diff options
author | jkh <jkh@FreeBSD.org> | 2000-10-22 09:53:27 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2000-10-22 09:53:27 +0000 |
commit | cdb92ab985da815edb3ed6f156cc138ef8c69b25 (patch) | |
tree | d916990bf8a948c43f12a1989cb668b0302720e3 /usr.sbin/pkg_install/delete | |
parent | 567e25b3be30b0a309b784bbbb9ad319a070342b (diff) | |
download | FreeBSD-src-cdb92ab985da815edb3ed6f156cc138ef8c69b25.zip FreeBSD-src-cdb92ab985da815edb3ed6f156cc138ef8c69b25.tar.gz |
Cause fatal error messages to be a little more helpful to the programmer
concerning where they're taking place.
Switch from [r]index() to str[r]chr() functions, which are more ISO
compliant.
Prompted by: Edward Welbourne <eddy@vortigen.demon.co.uk>
Diffstat (limited to 'usr.sbin/pkg_install/delete')
-rw-r--r-- | usr.sbin/pkg_install/delete/main.c | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/delete/perform.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c index 3150118..fc35c4e 100644 --- a/usr.sbin/pkg_install/delete/main.c +++ b/usr.sbin/pkg_install/delete/main.c @@ -87,7 +87,7 @@ main(int argc, char **argv) /* Get all the remaining package names, if any */ while (*argv) { - while ((pkgs_split = rindex(*argv, (int)'/')) != NULL) { + while ((pkgs_split = strrchr(*argv, (int)'/')) != NULL) { *pkgs_split++ = '\0'; /* * If character after the '/' is alphanumeric, then we've found the diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c index f3a963e..7752938 100644 --- a/usr.sbin/pkg_install/delete/perform.c +++ b/usr.sbin/pkg_install/delete/perform.c @@ -79,7 +79,7 @@ pkg_do(char *pkg) if (!getcwd(home, FILENAME_MAX)) { cleanup(0); - errx(2, "unable to get current working directory!"); + errx(2, __FUNCTION__ ": unable to get current working directory!"); } if (chdir(LogDir) == FAIL) { @@ -169,7 +169,7 @@ pkg_do(char *pkg) if (chdir(home) == FAIL) { cleanup(0); - errx(2, "unable to return to working directory %s!", home); + errx(2, __FUNCTION__ ": unable to return to working directory %s!", home); } if (!Fake) { @@ -200,7 +200,7 @@ pkg_do(char *pkg) if (chdir(home) == FAIL) { cleanup(0); - errx(2, "unable to return to working directory %s!", home); + errx(2, __FUNCTION__ ": unable to return to working directory %s!", home); } if (!Fake) { @@ -227,7 +227,7 @@ sanity_check(char *pkg) { if (!fexists(CONTENTS_FNAME)) { cleanup(0); - errx(2, "installed package %s has no %s file!", pkg, CONTENTS_FNAME); + errx(2, __FUNCTION__ ": installed package %s has no %s file!", pkg, CONTENTS_FNAME); } } |