diff options
author | Chris Piazza <cpiazza@FreeBSD.org> | 1999-11-18 23:32:43 +0000 |
---|---|---|
committer | Chris Piazza <cpiazza@FreeBSD.org> | 1999-11-18 23:32:43 +0000 |
commit | 79e970eddeef35dcbc1e45f6adc0e2d089f4c18e (patch) | |
tree | 1b60a6dd7709351ba969a9d712f3ca6144645e20 | |
parent | b5ee3fc0694a84ad84675d0181221060bfde742d (diff) | |
download | src-79e970eddeef35dcbc1e45f6adc0e2d089f4c18e.tar.gz src-79e970eddeef35dcbc1e45f6adc0e2d089f4c18e.zip |
Make `pkg_add -r package1 package2 package3 ...` work correctly.
Reviewed by: billf
Notes
Notes:
svn path=/head/; revision=53388
-rw-r--r-- | usr.sbin/pkg_install/add/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c index 174479ce1752..f96940e890c0 100644 --- a/usr.sbin/pkg_install/add/main.c +++ b/usr.sbin/pkg_install/add/main.c @@ -62,7 +62,8 @@ main(int argc, char **argv) char *cp; char *remotepkg = NULL, *ptr; - static char packageroot[MAXPATHLEN] = "ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/"; + static const char packageroot[MAXPATHLEN] = "ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/"; + static char temppackageroot[MAXPATHLEN]; start = argv; while ((ch = getopt(argc, argv, Options)) != -1) { @@ -129,11 +130,12 @@ main(int argc, char **argv) /* Get all the remaining package names, if any */ for (ch = 0; *argv; ch++, argv++) { if (Remote) { + strcpy(temppackageroot, packageroot); if (getenv("PACKAGESITE") == NULL) - strcat(packageroot, getpackagesite()); + strcat(temppackageroot, getpackagesite()); else - strcpy(packageroot, (getenv("PACKAGESITE"))); - remotepkg = strcat(packageroot, *argv); + strcpy(temppackageroot, (getenv("PACKAGESITE"))); + remotepkg = strcat(temppackageroot, *argv); if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' && ptr[2] == 'g' && ptr[3] == 'z' && !ptr[4])) strcat(remotepkg, ".tgz"); |