Mercurial > hg > octave-kai > gnulib-hg
changeset 973:012a30772bbf
Add comments.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Wed, 09 Jul 1997 14:00:27 +0000 |
parents | b30f9ff1e92e |
children | 02953a589bfd |
files | lib/makepath.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/makepath.c +++ b/lib/makepath.c @@ -210,6 +210,9 @@ saved_cwd = !save_cwd (&cwd); } + /* If save_cwd could not record the current directory, then don't + do the chdir optimization and resort to using full pathnames. */ + if (!saved_cwd) basename_dir = dirpath; @@ -258,6 +261,10 @@ leading_dirs = new; } + /* If we were able to save the initial working directory, + then we can use chdir to change into each directory before + creating an entry in that directory. This avoids making + stat and mkdir process O(n^2) file name components. */ if (saved_cwd && chdir (basename_dir) < 0) { error (0, errno, "cannot chdir to directory, %s", dirpath);