diff options
author | jkh <jkh@FreeBSD.org> | 1996-02-09 12:05:26 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-02-09 12:05:26 +0000 |
commit | ab4e86359ca4991600aafeea273fbee7600c0061 (patch) | |
tree | 0b324ea6e6b9c0a7753633b40290fd86ce818376 /usr.sbin/pkg_install | |
parent | 91b7831a8f74ab0430652c2656d17f7ac49e8945 (diff) | |
download | FreeBSD-src-ab4e86359ca4991600aafeea273fbee7600c0061.zip FreeBSD-src-ab4e86359ca4991600aafeea273fbee7600c0061.tar.gz |
Fix to catch a stupid oversight on my part which allowed this thing
to remove the current directory under certain circumstances.
Submitted by: Richard J Kuhns <rjk@watson.grauel.com>
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/lib/pen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index 5d07e6e..e5873e1 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: pen.c,v 1.13.4.6 1995/10/23 12:33:43 jkh Exp $"; +static const char *rcsid = "$Id: pen.c,v 1.19 1995/10/25 15:38:35 jkh Exp $"; #endif /* @@ -118,7 +118,7 @@ leave_playpen(char *save) oldsig = signal(SIGINT, SIG_IGN); if (Previous[0] && chdir(Previous) == FAIL) barf("Can't chdir back to '%s'.", Previous); - else if (Current[0]) { + else if (Current[0] && strcmp(Current, Previous)) { if (vsystem("rm -rf %s", Current)) whinge("Couldn't remove temporary dir '%s'", Current); strcpy(Current, Previous); |