Mercurial > hg > octave-kai > gnulib-hg
changeset 1206:5032c8c66257
(make_path): Reformat 3 if-stmts to test `if (newly_created_dir)' only once.
Suggestion from Andreas Schwab.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 10 Jan 1998 10:28:37 +0000 |
parents | 594755a693bf |
children | 018973497075 |
files | lib/makepath.c |
diffstat | 1 files changed, 23 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/makepath.c +++ b/lib/makepath.c @@ -239,29 +239,31 @@ } } - if (newly_created_dir && verbose_fmt_string != NULL) - fprintf (stderr, verbose_fmt_string, dirpath); - - if (newly_created_dir - && (owner != (uid_t) -1 || group != (gid_t) -1) - && chown (basename_dir, owner, group) -#if defined(AFS) && defined (EPERM) - && errno != EPERM -#endif - ) + if (newly_created_dir) { - error (0, errno, "%s", dirpath); - CLEANUP; - return 1; - } + if (verbose_fmt_string) + fprintf (stderr, verbose_fmt_string, dirpath); - 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 ((owner != (uid_t) -1 || group != (gid_t) -1) + && chown (basename_dir, owner, group) +#if defined(AFS) && defined (EPERM) + && errno != EPERM +#endif + ) + { + error (0, errno, "%s", dirpath); + CLEANUP; + return 1; + } + + 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,