diff options
-rw-r--r-- | usr.sbin/pkg_install/delete/main.c | 25 | ||||
-rw-r--r-- | usr.sbin/pkg_install/info/main.c | 24 |
2 files changed, 46 insertions, 3 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) diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c index 83f6ef4..9a8a3db 100644 --- a/usr.sbin/pkg_install/info/main.c +++ b/usr.sbin/pkg_install/info/main.c @@ -44,6 +44,7 @@ main(int argc, char **argv) { int ch; char **pkgs, **start; + char *pkgs_split; pkgs = start = argv; if (argc == 1) { @@ -144,7 +145,28 @@ main(int argc, char **argv) /* 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 && !AllInstalled && !CheckPkg) |