diff options
Diffstat (limited to 'usr.bin/compress/compress.c')
-rw-r--r-- | usr.bin/compress/compress.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c index f73419d..1f458e5 100644 --- a/usr.bin/compress/compress.c +++ b/usr.bin/compress/compress.c @@ -75,7 +75,7 @@ main(int argc, char *argv[]) char *p, newname[MAXPATHLEN]; cat = 0; - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; @@ -141,7 +141,7 @@ main(int argc, char *argv[]) compress(*argv, "/dev/stdout", bits); break; } - if ((p = rindex(*argv, '.')) != NULL && + if ((p = strrchr(*argv, '.')) != NULL && !strcmp(p, ".Z")) { cwarnx("%s: name already has trailing .Z", *argv); @@ -164,7 +164,7 @@ main(int argc, char *argv[]) break; } len = strlen(*argv); - if ((p = rindex(*argv, '.')) == NULL || + if ((p = strrchr(*argv, '.')) == NULL || strcmp(p, ".Z")) { if (len > sizeof(newname) - 3) { cwarnx("%s: name too long", *argv); |