aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/misc.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-07-08 08:54:36 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-07-08 08:54:36 +0000
commitcf1647cd2fd785ffdd4872e03dd8836d010af5f2 (patch)
tree412d8ec8d51ea1577e0884b928bfc378d1f29f28 /usr.sbin/sysinstall/misc.c
parent502ba6e4a88ba3af76f4f20255eeb64f3e6b4989 (diff)
downloadsrc-cf1647cd2fd785ffdd4872e03dd8836d010af5f2.tar.gz
src-cf1647cd2fd785ffdd4872e03dd8836d010af5f2.zip
Whoops! Now that I'm decompressing docs into /tmp, it's important to
make sure that /tmp is there first! :-) While I'm at it, clean up the somewhat inexplicably bogus Mkdir() function.
Notes
Notes: svn path=/head/; revision=17005
Diffstat (limited to 'usr.sbin/sysinstall/misc.c')
-rw-r--r--usr.sbin/sysinstall/misc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c
index 1c737cb794de..e4a13603ebdd 100644
--- a/usr.sbin/sysinstall/misc.c
+++ b/usr.sbin/sysinstall/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $
+ * $Id: misc.c,v 1.20 1996/06/25 18:41:10 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -249,24 +249,24 @@ items_free(dialogMenuItem *list, int *curr, int *max)
}
int
-Mkdir(char *ipath, void *data)
+Mkdir(char *ipath)
{
struct stat sb;
- int final=0;
+ int final;
char *p, *path;
if (file_readable(ipath) || Fake)
return DITEM_SUCCESS;
- path = strdup(ipath);
+ path = strcpy(alloca(strlen(ipath) + 1), ipath);
if (isDebug())
msgDebug("mkdir(%s)\n", path);
p = path;
if (p[0] == '/') /* Skip leading '/'. */
++p;
- for (;!final; ++p) {
+ for (final = FALSE; !final; ++p) {
if (p[0] == '\0' || (p[0] == '/' && p[1] == '\0'))
- final++;
+ final = TRUE;
else if (p[0] != '/')
continue;
*p = '\0';
@@ -284,7 +284,6 @@ Mkdir(char *ipath, void *data)
}
*p = '/';
}
- free(path);
return DITEM_SUCCESS;
}
@@ -308,7 +307,7 @@ Mount(char *mountp, void *dev)
}
memset(&ufsargs,0,sizeof ufsargs);
- if (Mkdir(mountpoint, NULL)) {
+ if (Mkdir(mountpoint)) {
msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
return DITEM_FAILURE;
}