ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fixargv0.c
Revision: 2.3
Committed: Tue Feb 25 02:47:21 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 2.2: +1 -56 lines
Log Message:
Replaced inline copyright notice with #include "copyright.h"

File Contents

# User Rev Content
1 greg 2.1 #ifndef lint
2 greg 2.2 static const char RCSid[] = "$Id$";
3 greg 2.1 #endif
4     /*
5     * Fix argv[0] for DOS environments
6 greg 2.2 *
7     * External symbols declared in standard.h
8     */
9    
10 greg 2.3 #include "copyright.h"
11 greg 2.1
12    
13     char *
14     fixargv0(av0) /* extract command name from full path */
15     char *av0;
16     {
17     register char *cp = av0;
18    
19     while (*cp) cp++; /* start from end */
20     while (cp-- > av0)
21     switch (*cp) { /* fix up command name */
22     case '.': /* remove extension */
23     *cp = '\0';
24     continue;
25     case '\\': /* remove directory */
26     return(cp+1);
27     default: /* convert to lower case */
28     *cp = tolower(*cp);
29     continue;
30     }
31     return(av0);
32     }
33    
34