aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-10-23 12:33:43 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-10-23 12:33:43 +0000
commit3d7ba196798ea695f564dc47dd33afba241d9f22 (patch)
tree0a3e6d1c1331bce2a8a9d1c4d0cedc43549c32de /usr.sbin/pkg_install/lib
parent54fdce06771baed604dae320ff9478c94efa9902 (diff)
Notes
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/pen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c
index 2d9f46e8db13..305d5bc53ba3 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.4 1995/10/15 04:39:56 jkh Exp $";
+static const char *rcsid = "$Id: pen.c,v 1.13.4.5 1995/10/15 14:08:42 jkh Exp $";
#endif
/*
@@ -116,14 +116,17 @@ leave_playpen(char *save)
/* Don't interrupt while we're cleaning up */
oldsig = signal(SIGINT, SIG_IGN);
- if (chdir(Previous) == FAIL)
+ if (Previous[0] && chdir(Previous) == FAIL)
barf("Can't chdir back to '%s'.", Previous);
else if (Current[0]) {
if (vsystem("rm -rf %s", Current))
whinge("Couldn't remove temporary dir '%s'", Current);
strcpy(Current, Previous);
}
- strcpy(Previous, save);
+ if (save)
+ strcpy(Previous, save);
+ else
+ Previous[0] = '\0';
signal(SIGINT, oldsig);
}