diff options
author | Jim Meyering <jim@meyering.net> | 1998-01-10 10:28:37 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-01-10 10:28:37 +0000 |
commit | 09d96ac539fc89028f2991839805fad826e7e4cf (patch) | |
tree | 5ef9ddd8ec0df25b8427f5a7a67155b084e65e62 /lib | |
parent | 3edbca0e04a6bf2782fce4446029972e56ee6494 (diff) | |
download | coreutils-09d96ac539fc89028f2991839805fad826e7e4cf.tar.xz |
(make_path): Reformat 3 if-stmts to test `if (newly_created_dir)' only once.
Suggestion from Andreas Schwab.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/makepath.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lib/makepath.c b/lib/makepath.c index 98e1ff573..ea0a021d8 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -239,29 +239,31 @@ make_path (const char *argpath, } } - if (newly_created_dir && verbose_fmt_string != NULL) - fprintf (stderr, verbose_fmt_string, dirpath); + if (newly_created_dir) + { + if (verbose_fmt_string) + fprintf (stderr, verbose_fmt_string, dirpath); - if (newly_created_dir - && (owner != (uid_t) -1 || group != (gid_t) -1) - && chown (basename_dir, owner, group) + if ((owner != (uid_t) -1 || group != (gid_t) -1) + && chown (basename_dir, owner, group) #if defined(AFS) && defined (EPERM) - && errno != EPERM + && errno != EPERM #endif - ) - { - error (0, errno, "%s", dirpath); - CLEANUP; - return 1; - } + ) + { + error (0, errno, "%s", dirpath); + CLEANUP; + return 1; + } - if (newly_created_dir && re_protect) - { - struct ptr_list *new = (struct ptr_list *) - alloca (sizeof (struct ptr_list)); - new->dirname_end = slash; - new->next = leading_dirs; - leading_dirs = new; + if (re_protect) + { + struct ptr_list *new = (struct ptr_list *) + alloca (sizeof (struct ptr_list)); + new->dirname_end = slash; + new->next = leading_dirs; + leading_dirs = new; + } } /* If we were able to save the initial working directory, |