ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/src/common/loadvars.c
(Generate patch)

Comparing src/common/loadvars.c (file contents):
Revision 2.20 by greg, Sat Jun 10 15:49:55 2023 UTC vs.
Revision 2.24 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7  
8   #include "copyright.h"
9  
10 #include <stdio.h>
11 #include <stdlib.h>
10   #include <ctype.h>
11  
12   #include "standard.h"
13 + #include "paths.h"
14   #include "vars.h"
15  
16   #define NOCHAR  127             /* constant for character to delete */
# Line 116 | Line 115 | setvariable(                   /* assign variable according to string
115                          quote *= (ass[i] != quote);
116                  } else {                /* otherwise, squeeze spaces */
117                          if (isspace(*cp))
118 <                                while (isspace(ass[i]))
118 >                                while (isspace(ass[i])|(ass[i]==NOCHAR))
119                                          i++;
120                          if ((ass[i] == '"') | (ass[i] == '\''))
121                                  quote = ass[i];
# Line 311 | Line 310 | fltvalue(                              /* check float variable for legal values
310   }
311  
312  
313 + int
314 + singlevar(                              /* assigned single value? */
315 +        VARIABLE *vp
316 + )
317 + {
318 +        if (vp->fixval == catvalues)
319 +                return(0);
320 +
321 +        return((vp->fixval == strvalue) |
322 +                        (vp->fixval == fltvalue) |
323 +                        (vp->fixval == intvalue) |
324 +                        (vp->fixval == qualvalue) |
325 +                        (vp->fixval == boolvalue));
326 + }
327 +
328   void
329   printvars(                              /* print variable values */
330          FILE    *fp
# Line 322 | Line 336 | printvars(                             /* print variable values */
336          for (i = 0; i < NVARS; i++)             /* print each variable */
337              for (j = 0; j < vdef(i); j++) {     /* print each assignment */
338                  fputs(vnam(i), fp);
339 <                fputs("= ", fp);
339 >                fputc('=', fp);
340 >                if (!singlevar(&vv[i]))
341 >                        fputc(' ', fp);
342                  k = clipline = ( vv[i].fixval == catvalues ? 64 : 236 )
343                                  - strlen(vnam(i)) ;
344                  cp = nvalue(i, j);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines