Skip to content
Browse files

mkdir fixes [thanks to mtheall]

  • Loading branch information...
1 parent bb35e86 commit 51048b98f50eb8d90c44b46f8b2b7bb8bd18d849 @fincs committed Aug 3, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 apps/unixtools/mkdir/source/main.c
View
4 apps/unixtools/mkdir/source/main.c
@@ -39,7 +39,7 @@ int mkdirp(char *path, int mode, int verbose) {
c = path;
do {
- if(mkdir(path, mode)) {
+ if(*path && mkdir(path, mode)) {
if(errno != EEXIST) {
fprintf(stderr, "mkdir: '%s': %s\n", path, strerror(errno));
for(c = path; c < end; c++) {
@@ -51,7 +51,7 @@ int mkdirp(char *path, int mode, int verbose) {
return 1;
}
}
- else if(verbose)
+ else if(*path && verbose)
printf("mkdir: created directory '%s'\n", path);
while(c < end && *c != 0)

0 comments on commit 51048b9

Please sign in to comment.
Something went wrong with that request. Please try again.