X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmakepath.c;h=4d647b5ef3160a5bcdd1cf8c80bdd7b51a1b3f34;hb=56f88f60ae60c1483a1ee5330d02a8251897f383;hp=9e70ed72c660a57c1ac7b2982aec2b5b011fb2cb;hpb=f35893155a31779fb14ba7da078eacd97254939e;p=gnulib.git diff --git a/lib/makepath.c b/lib/makepath.c index 9e70ed72c..4d647b5ef 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -21,8 +21,8 @@ #ifdef HAVE_CONFIG_H #if defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation - using -I. -I will use ./config.h rather than /config.h - (which it would do because it found this file in ). */ + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ #include #else #include "config.h" @@ -206,7 +206,10 @@ make_path (argpath, mode, parent_mode, owner, group, verbose_fmt_string) /* We're done making leading directories. Make the final component of the path. */ - if (mkdir (dirpath, mode)) + /* The path could end in "/." or contain "/..", so test + if we really have to create the directory. */ + + if (stat (dirpath, &stats) && mkdir (dirpath, mode)) { error (0, errno, "cannot make directory `%s'", dirpath); umask (oldmask);