aboutsummaryrefslogtreecommitdiff
path: root/coreutils/mkdir.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-11-22 07:41:00 +0000
committerEric Andersen <andersen@codepoet.org>1999-11-22 07:41:00 +0000
commitcb41c2e83b9e9997b9737d7061d53f7c11a463a8 (patch)
tree9fed0b9a9a44389618c13d8094b26224355d3108 /coreutils/mkdir.c
parent5d44d1fda593248c154ec68b38ce946a69f9b0fc (diff)
downloadbusybox-cb41c2e83b9e9997b9737d7061d53f7c11a463a8.tar.gz
Bug fixes
Diffstat (limited to 'coreutils/mkdir.c')
-rw-r--r--coreutils/mkdir.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 2cd178805..9ea3b4ea0 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -80,17 +80,21 @@ extern int mkdir_main(int argc, char **argv)
while (argc > 0) {
int status;
struct stat statBuf;
- status=stat(*argv, &statBuf);
+ char buf[NAME_MAX];
+
+ strcpy (buf, *argv);
+ status=stat(buf, &statBuf);
if (status != -1 && status != ENOENT ) {
- fprintf(stderr, "%s: File exists\n", *argv);
+ fprintf(stderr, "%s: File exists\n", buf);
exit( FALSE);
}
if (parentFlag == TRUE) {
- createPath(*argv, mode);
+ strcat( buf, "/");
+ createPath(buf, mode);
}
else {
- if (mkdir (*argv, mode) != 0) {
- perror(*argv);
+ if (mkdir (buf, mode) != 0) {
+ perror(buf);
exit( FALSE);
}
}