diff options
author | B. Watson <urchlay@slackware.uk> | 2024-12-14 23:51:29 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-12-14 23:51:29 -0500 |
commit | 01a5b51315430bc714a194cd0a864d4e33d6682f (patch) | |
tree | 419d378abec2a43015b6a20a5a2a73e06ed8a6b6 /getopt.c | |
parent | aa10bae90176d5025148225781d9176b6ee347d4 (diff) | |
download | uxd-01a5b51315430bc714a194cd0a864d4e33d6682f.tar.gz |
rename getopt() so we can compile with g++ if needed.
Diffstat (limited to 'getopt.c')
-rw-r--r-- | getopt.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -36,17 +36,12 @@ extern char *self; #define ENDARGS "--" /* this is included because index is not on some UNIX systems */ -static -char * -index (s, c) -register char *s; -register int c; - { +static char *index (char *s, int c) { while (*s) if (c == *s) return (s); else s++; return (NULL); - } +} /* * get option letter from argument vector @@ -60,11 +55,9 @@ char *optarg; /* argument associated with option */ fputc(optopt,stderr);fputs(" (use -h for help)\n",stderr);return(BADCH); -int getopt(int nargc, char **nargv, char *ostr) -{ +int my_getopt(int nargc, char **nargv, char *ostr) { static char *place = EMSG; /* option letter processing */ - register char *oli; /* option letter list index */ - char *index(); + char *oli; /* option letter list index */ if(!*place) { /* update scanning pointer */ if(optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) return(EOF); |