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

Comparing ray/src/common/expandarg.c (file contents):
Revision 2.9 by greg, Sat May 17 02:49:41 2008 UTC vs.
Revision 2.11 by greg, Sat Dec 28 18:05:13 2019 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include "copyright.h"
11  
12   #include <errno.h>
13 #include <string.h>
13  
14   #include "rtio.h"
15   #include "rtmisc.h"
# Line 24 | Line 23 | int    filexpchr = '@';                /* file expansion character */
23  
24  
25   int
26 < expandarg(acp, avp, n)          /* expand list at argument n */
27 < int     *acp;
28 < register char   ***avp;
29 < int     n;
26 > expandarg(              /* expand list at argument n */
27 >        int     *acp,
28 >        char    ***avp,
29 >        int     n
30 > )
31   {
32          int     ace;
33          char    *ave[MAXARGEXP];
# Line 37 | Line 37 | int    n;
37                  return(0);
38          errno = 0;      
39          if ((*avp)[n][0] == filexpchr) {                /* file name */
40 <                ace = wordfile(ave, (*avp)[n]+1);
40 >                ace = wordfile(ave, MAXARGEXP, (*avp)[n]+1);
41                  if (ace < 0)
42                          return(-1);     /* no such file */
43          } else if ((*avp)[n][0] == envexpchr) {         /* env. variable */
44 <                ace = wordstring(ave, getenv((*avp)[n]+1));
44 >                ace = wordstring(ave, MAXARGEXP, getenv((*avp)[n]+1));
45                  if (ace < 0)
46                          return(-1);     /* no such variable */
47          } else                                          /* regular argument */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines