summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/misc.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-07-08 08:54:36 +0000
committerjkh <jkh@FreeBSD.org>1996-07-08 08:54:36 +0000
commit7e51f09a84728ab85cf82db31aad751f4aca98cb (patch)
tree412d8ec8d51ea1577e0884b928bfc378d1f29f28 /usr.sbin/sade/misc.c
parent824afef0c4ffcf3871a0091dfb4fb8af21888b56 (diff)
downloadFreeBSD-src-7e51f09a84728ab85cf82db31aad751f4aca98cb.zip
FreeBSD-src-7e51f09a84728ab85cf82db31aad751f4aca98cb.tar.gz
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.
Diffstat (limited to 'usr.sbin/sade/misc.c')
-rw-r--r--usr.sbin/sade/misc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 1c737cb..e4a1360 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/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;
}
OpenPOWER on IntegriCloud