diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-03-12 06:12:43 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-03-12 06:12:43 +0000 |
| commit | 1c3f12fd44bb6373174e7543e3a205e0518449df (patch) | |
| tree | 6fffba09e8c18c06746d8341febb872dbc4b0867 /usr.sbin/pkg_install/lib/file.c | |
| parent | b079435208aa63b4d5a97d4851a41689cfb12a72 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pkg_install/lib/file.c')
| -rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index bddebab09f55..19ce0136af2d 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: file.c,v 1.19 1995/11/12 04:55:38 jkh Exp $"; +static const char *rcsid = "$Id: file.c,v 1.20 1996/02/19 02:35:56 mpp Exp $"; #endif /* @@ -432,17 +432,21 @@ unpack(char *pkg, char *flist) { char args[10], suffix[80], *cp; + args[0] = '\0'; /* * Figure out by a crude heuristic whether this or not this is probably * compressed. */ - args[0] = '\0'; - cp = rindex(pkg, '.'); - if (cp) { - strcpy(suffix, cp + 1); - if (index(suffix, 'z') || index(suffix, 'Z')) - strcpy(args, "-z"); + if (strcmp(pkg, "-")) { + cp = rindex(pkg, '.'); + if (cp) { + strcpy(suffix, cp + 1); + if (index(suffix, 'z') || index(suffix, 'Z')) + strcpy(args, "-z"); + } } + else + strcpy(args, "z"); strcat(args, "xpf"); if (vsystem("tar %s %s %s", args, pkg, flist ? flist : "")) { whinge("Tar extract of %s failed!", pkg); |
