Author | Jamozed <[email protected]> |
Date | 2020-07-09 09:58:31 |
Commit | 9884f2c5d6a8cc12827e9f6dee514095197f14d5 |
Parent | b6408670959e3ec344ce5c1973d0a3f810527118 |
mkdir: Fix misleading indentation warning
Diffstat
M | src/mkdir.c | | | 9 | ++++----- |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mkdir.c b/src/mkdir.c index d58ea7a..5e6844c 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -1,4 +1,4 @@ -// mkdir.c, version 1.0.2 +// mkdir.c, version 1.0.3 // OMKOV coreutils implementation of POSIX mkdir // Copyright (C) 2020, Jakob Wakeling // All rights reserved. @@ -44,7 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. #include <stdbool.h> #include <stdio.h> -#define VERSION "1.0.2" +#define VERSION "1.0.3" #define USR 05700 #define GRP 02070 @@ -99,9 +99,8 @@ int main(int ac, char *av[]) { A0 = av[0]; char *p = av[i]; for (; *p == '/'; ++p) {} for (; *p; ++p) { - if (*p != '/' || *(p + 1) == '/') { continue; } - *p = 0; - if (mkdir(av[i], mode)) if (errno != EEXIST) { + if (*p != '/' || *(p + 1) == '/') { continue; } *p = 0; + if (mkdir(av[i], mode) && errno != EEXIST) { warn("%s: %s", av[i], serr()); continue; } *p = '/'; }