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

Comparing ray/src/common/fixargv0.c (file contents):
Revision 2.7 by schorsch, Sun Mar 20 16:36:17 2016 UTC vs.
Revision 2.9 by greg, Fri Jul 24 16:58:16 2020 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   *  External symbols declared in paths.h
8   */
9  
10 #include "copyright.h"
11
10   #include <ctype.h>
11   #include <string.h>
12  
13 < extern char *
14 < fixargv0(av0)                   /* extract command name from full path */
17 < char  *av0;
13 > char *
14 > fixargv0(char *av0)             /* extract command name from full path */
15   {
16 <        register char  *cp = av0, *end = av0;
16 >        char  *cp = av0, *end;
17  
18          while (*cp) cp++;               /* start from end */
19          end = cp;
# Line 27 | Line 24 | char  *av0;
24                          end = cp;
25                          continue;
26                  case '\\':                      /* remove directory */
27 +                case '/':
28                          /* make sure the original pointer remains the same */
29                          memmove(av0, cp+1, end-cp);
30 <                        break;
30 >                        return(av0);
31                  default:                        /* convert to lower case */
32                          *cp = tolower(*cp);
33                          continue;
34                  }
35          return(av0);
36   }
39
40

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines