diff options
Diffstat (limited to 'usr.sbin/pkg_install/delete/main.c')
-rw-r--r-- | usr.sbin/pkg_install/delete/main.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c index 6956f70..7567286 100644 --- a/usr.sbin/pkg_install/delete/main.c +++ b/usr.sbin/pkg_install/delete/main.c @@ -41,6 +41,7 @@ main(int argc, char **argv) { int ch, error; char **pkgs, **start; + char *pkgs_split; pkgs = start = argv; while ((ch = getopt(argc, argv, Options)) != -1) @@ -81,9 +82,29 @@ main(int argc, char **argv) argv += optind; /* Get all the remaining package names, if any */ - /* Get all the remaining package names, if any */ while (*argv) - *pkgs++ = *argv++; + { + if( (pkgs_split = rindex(*argv, (int) '/')) != NULL ) + { + while( !isalpha(*(pkgs_split+1)) ) + { + *pkgs_split = '\0'; + pkgs_split = rindex(*argv, (int) '/'); + } + if(pkgs_split != NULL) + { + pkgs_split++; + *pkgs = pkgs_split; + pkgs++; + } + } + else + { + *pkgs = *argv; + pkgs++; + } + argv++; + } /* If no packages, yelp */ if (pkgs == start) |