version 1.2, 1996/06/26 05:31:37 |
version 1.3, 1997/08/17 21:25:01 |
|
|
char **argv; |
char **argv; |
{ |
{ |
char *p; |
char *p; |
int ch; |
|
|
|
setlocale(LC_ALL, ""); |
setlocale(LC_ALL, ""); |
|
|
while ((ch = getopt(argc, argv, "")) != -1) |
if (argc != 2 && argc != 3) |
switch(ch) { |
|
case '?': |
|
default: |
|
usage(); |
|
} |
|
argc -= optind; |
|
argv += optind; |
|
|
|
if (argc != 1 && argc != 2) |
|
usage(); |
usage(); |
|
argc--; |
|
argv++; |
|
|
/* |
/* |
* (1) If string is // it is implementation defined whether steps (2) |
* (1) If string is // it is implementation defined whether steps (2) |
|
|
for (p = *argv;; ++p) { |
for (p = *argv;; ++p) { |
if (!*p) { |
if (!*p) { |
if (p > *argv) |
if (p > *argv) |
(void)printf("/\n"); |
(void)putchar('/'); |
else |
(void)putchar('\n'); |
(void)printf("\n"); |
|
exit(0); |
exit(0); |
} |
} |
if (*p != '/') |
if (*p != '/') |
|
|
p[off] = '\0'; |
p[off] = '\0'; |
} |
} |
} |
} |
(void)printf("%s\n", p); |
(void)puts(p); |
exit(0); |
exit(0); |
} |
} |
|
|