aboutsummaryrefslogtreecommitdiffstats
path: root/lib/makepath.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2005-06-02Use "file name" when talking about file names, instead of "filename"Paul Eggert1-398/+0
or "path", as per the GNU coding standards. As part of this, rename makepath.c to mkdir-p.c, and path-concat.c to filenamecat.c, and likewise for the .h files.
2005-05-14Update FSF postal mail address.Jim Meyering1-1/+1
2005-05-05(make_path): chdir to "//", not "/", if the file namePaul Eggert1-4/+10
starts with exactly two slashes.
2004-07-30(make_path, make_dir): Use bool, not int, since we're not setting errno.Paul Eggert1-48/+41
Use mode_t for modes, not int. All uses changed. (errno): Remove decl; no longer needed since we assume C89.
2004-06-19Remove all S_IS* and S_IF* definitions.Jim Meyering1-38/+4
Instead, just include "stat-macros.h".
2003-09-10Include makepath.h first, to test interface.Jim Meyering1-13/+4
Include <stdlib.h> and <string.h> unconditionally.
2003-07-12(make_path): Enclose diagnostic in _(...).Jim Meyering1-1/+1
2003-06-18Merge in change from gnulib.Jim Meyering1-15/+4
Remove block of alloca-related code in favor of an unconditional `#include <alloca.h>'.
2003-06-18remove bogus commentJim Meyering1-1/+0
2003-03-04(CLEANUP_CWD): Call error here, now that restore_cwd no longer does it.Jim Meyering1-3/+9
2003-01-11Don't test HAVE_ERRNO_H. It's not necessary.Jim Meyering1-4/+3
2002-11-23Include gettext.h instead of <libintl.h>.Jim Meyering1-10/+2
2002-09-28(make_path): Restore umask *before* creating the final component.Jim Meyering1-3/+3
2002-09-22(make_path): Minor reformatting.Jim Meyering1-3/+4
2002-03-10(make_path): Remove a comma from a diagnostic.Jim Meyering1-2/+2
2001-05-12Include dirname.h.Jim Meyering1-3/+1
(strip_trailing_slashes): Remove decl; now in dirname.h.
2000-11-05(make_dir): Remove `static' attribute.Jim Meyering1-3/+3
Tweak a comment.
2000-07-30(make_path): Quote the other instance, too.Jim Meyering1-1/+1
2000-07-15Include quote.h.Jim Meyering1-11/+19
(make_path): Convert "`%s'" in format strings to "%s", and wrap each corresponding argument in a `quote (...)' call. Give better diagnostics.
2000-05-22Remove old, now-unnecessary `#ifdef __MSDOS__' block.Jim Meyering1-5/+0
2000-04-27tweak commentJim Meyering1-1/+2
2000-04-26(S_IRWXUGO): Define.Jim Meyering1-8/+16
(make_path): Always perform explicit chmod if MODE specifies any of the `special' permission bits.
1999-12-13(make_path): Consistently use error to outputJim Meyering1-1/+1
the verbose, `created directory ...' messages. Reported by Bernhard Rosenkraenzer.
1999-11-11(make_path): Fix long-latent bug (note othersJim Meyering1-1/+1
just like it were fixed in 1998-01-02). A user (FIXME, who?) reported that using `install -d -g foo 1/2` only sets the group on the intermediate directory, not the final component. From Michael Stone.
1999-05-06(make_dir): When reporting a mkdir failure and theJim Meyering1-1/+2
target cannot be `stat'ed, use the errno from the failed mkdir call, not the one from the stat call. Before this change, running `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly elicit `No such file or directory' instead of `Permission denied'.
1999-05-05Include makepath.h libintl.h, not after it.Jim Meyering1-1/+3
Otherwise, we'd get the wrong definition of PARAMS from libintl.h. (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES, which is necessary on Irix4 since cc doesn't define __STDC__.) From Kaveh Ghazi.
1999-04-26(make_path): Use proper mode_t types and macros.Jim Meyering1-5/+21
Don't assume the traditional Unix values for mode bits. (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU): Define if not defined.
1999-01-02Include locale.h and libintl.h, and define `_()'.Jim Meyering1-6/+17
Mark translatable strings.
1999-01-02(make_dir): New function, factored out of make_path.Jim Meyering1-35/+60
(make_path): Use make_dir rather than open-coding it twice. This effectively reverses the order of the latter pair of stat/mkdir calls and fixes a race condition bug whereby one of two concurrent `mkdir -p' processes could fail with EEXIST.
1998-02-11Add my comment from ChangeLog entry for gkm's change.Jim Meyering1-0/+8
1998-01-10(make_path): Reformat 3 if-stmts to test `if (newly_created_dir)' only once.Jim Meyering1-19/+21
Suggestion from Andreas Schwab.
1998-01-10(make_path): Put only newly created directories on the LEADING_DIRS list.Jim Meyering1-2/+2
1998-01-02(make_path): Try to change ownership only if we've just created theJim Meyering1-4/+15
directory. Fix latent bug (s/&&/||/ in two places -- also, note that it could not be exercised via install or mkdir) whereby chown would not be invoked when only one of owner/group is not -1.
1997-12-28(make_path) [!__STDC__]: Remove K&R-style definition.Jim Meyering1-13/+0
1997-10-06(make_path): Print verbose message using fprintf, not error.Jim Meyering1-1/+1
1997-10-06(make_path): Print message IFF the directory wasJim Meyering1-1/+4
just created and the format string is non-NULL.
1997-07-09(make_path): Chdir to `/' before starting if necessary.Jim Meyering1-15/+17
Call save_cwd before while loop rather than from first iteration inside it.
1997-07-09Add comments.Jim Meyering1-0/+7
1997-07-01(make_path): Reorder stat-then-mkdir-if-missingJim Meyering1-26/+28
calls so that mkdir is called first. Before make_path would first `stat' a directory, then call mkdir if it didn't exist. But if some other process created the directory between the stat & mkdir, the mkdir would fail with EEXIST. Diagnosis and suggestion from Greg McGary.
1997-06-15Rewrite using save-cwd.c and chdir to remove quadratic component of complexity.Jim Meyering1-27/+95
Before, it processed O(n^2) directory name components via stat and mkdir. Now it's O(n). This makes mkdir -p a lot more efficient when creating directories with very many components. On a Linux 2.0.30 ext2fs filesystem this command: mkdir -p `perl -e 'print "a/" x 500'` now runs in 0.77 seconds (user+sys). Contrast that with the 9.5(!) seconds it took before.
1996-11-04libitizeJim Meyering1-1/+1
1996-09-28.Jim Meyering1-21/+21
1996-07-15update FSF address in copyrightJim Meyering1-2/+2
1996-07-14Remove my address.Jim Meyering1-2/+1
1995-05-19No longer include safe-l?stat.h.Jim Meyering1-1/+1
1995-05-13(make_path): Use stat, not SAFE_STAT.Jim Meyering1-12/+12
Use strchr, not index. Adjust defines accordingly.
1994-11-06merge with 1.12Jim Meyering1-0/+11
1994-11-04Include makepath.h.Jim Meyering1-27/+37
Add an argument: PRESERVE_EXISTING. Declare char* arguments const.
1994-10-02merge with 3.9hJim Meyering1-7/+0
1994-08-27.Jim Meyering1-2/+2