diff options
author | adam <adam@FreeBSD.org> | 1994-08-29 16:31:38 +0000 |
---|---|---|
committer | adam <adam@FreeBSD.org> | 1994-08-29 16:31:38 +0000 |
commit | f91b99de988ba2906c698b969f4f84842a5680cf (patch) | |
tree | bdb60801ae9c226a1baec636a1c95c7c443d1206 /usr.sbin/pkg_install/create/perform.c | |
parent | 31fb6031b67541a734e9a8b60a9e6b86045cb589 (diff) | |
download | FreeBSD-src-f91b99de988ba2906c698b969f4f84842a5680cf.zip FreeBSD-src-f91b99de988ba2906c698b969f4f84842a5680cf.tar.gz |
Allow creation of absolute package names
typo index() --> rindex() in order to split correct suffix
Fix @srcdir so it actually works
Submitted by: adam
Diffstat (limited to 'usr.sbin/pkg_install/create/perform.c')
-rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 1763cf2..2f2bb5a 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.8 1994/05/19 18:27:41 alm Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.9 1994/05/25 06:24:41 jkh Exp $"; #endif /* @@ -55,7 +55,7 @@ pkg_perform(char **pkgs) plist.head = plist.tail = NULL; /* Break the package name into base and desired suffix (if any) */ - if ((cp = index(pkg, '.')) != NULL) { + if ((cp = rindex(pkg, '.')) != NULL) { suffix = cp + 1; *cp = '\0'; } @@ -142,7 +142,10 @@ make_dist(char *home, char *pkg, char *suffix, Package *plist) int ret; args[0] = '\0'; - sprintf(tball, "%s/%s.%s", home, pkg, suffix); + if (*pkg == '/') + sprintf(tball, "%s.%s", pkg, suffix); + else + sprintf(tball, "%s/%s.%s", home, pkg, suffix); if (index(suffix, 'z')) /* Compress/gzip? */ strcat(args, "z"); if (Dereference) |