ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fixargv0.c
Revision: 2.1
Committed: Fri Oct 9 10:27:41 1992 UTC (31 years, 6 months ago) by greg
Content type: text/plain
Branch: MAIN
Log Message:
Initial revision

File Contents

# User Rev Content
1 greg 2.1 /* Copyright (c) 1992 Regents of the University of California */
2    
3     #ifndef lint
4     static char SCCSid[] = "$SunId$ LBL";
5     #endif
6    
7     /*
8     * Fix argv[0] for DOS environments
9     */
10    
11    
12     char *
13     fixargv0(av0) /* extract command name from full path */
14     char *av0;
15     {
16     register char *cp = av0;
17    
18     while (*cp) cp++; /* start from end */
19     while (cp-- > av0)
20     switch (*cp) { /* fix up command name */
21     case '.': /* remove extension */
22     *cp = '\0';
23     continue;
24     case '\\': /* remove directory */
25     return(cp+1);
26     default: /* convert to lower case */
27     *cp = tolower(*cp);
28     continue;
29     }
30     return(av0);
31     }
32    
33