Commit Graph
20330 Commits
Author SHA1 Message Date
Jim Meyering dd0d9c278a *** empty log message *** 2004-07-08 14:03:45 +00:00
Jim Meyering 405c640f5b printf cleanup, to avoid undefined behavior, to add support for
formats that Bash supports, and to support wide integers like
Bash does.

Add tests for the above.
2004-07-08 14:03:20 +00:00
Jim Meyering 3f61615681 *** empty log message *** 2004-07-08 14:01:59 +00:00
Jim Meyering 62e1d5259d printf cleanup, to avoid undefined behavior, to add support for
formats that Bash supports, and to support wide integers like
Bash does.

(UNSPECIFIED): Remove.  All uses now replaced by
booleans, so that we don't reserve any values for precision or
width (like Bash).
(STRTOX): Use prototype, not K&R-style definition.
(vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol
in ../lib), with type change to intmax_t.
All uses changed.
(vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t.
All uses changed.
(vstrtod): Renamed from xstrtod.  All uses changed.
(print_direc): Use boolean arg instead of special value to indicate
a missing precision or width.  LENGTH no longer includes
length modifiers or conversion character.  New arg CONVERSION
now specifies conversion character.
Use intmax_t-width formatting for integers (like Bash).
Add support for C99 %a, %A, %F (like Bash).
Add support for field width with %c (POSIX requires this).
Add a FIXME for lack of support for field width and precision
for %b.
Add support for '\'', '0' flags.
Check for invalid combinations of flags, field width, precision,
and conversion, to prevent use of undefined behavior.
Allow multiple length modifiers, for formats like "%lld" (like Bash).
Add support for C99 'j', 't', 'z' length modifiers (like Bash).
In error message, output entire invalid conversion specification,
instead of merely outputting % followed by the conversion char.
2004-07-08 14:01:49 +00:00
Jim Meyering 2aa1f2d16b *** empty log message *** 2004-07-07 15:54:54 +00:00
Jim Meyering f1314a409c Don't infloop when MAXSYMLINKS is not defined.
Detect symlink loops much earlier (albeit lazily) on systems
with MAXSYMLINKS defined to a large value.

Include "cycle-check.h".
(canonicalize_filename_mode): Don't try to detect loops by counting
symlink-hops.  Instead, use the cycle-check module.
2004-07-07 15:54:51 +00:00
Jim Meyering ff5ea92271 Include stdbool.h.
Forward-declare `struct stat'.
2004-07-07 15:07:08 +00:00
Jim Meyering de9faabfe6 *** empty log message *** 2004-07-07 09:28:24 +00:00
Jim Meyering f7975d11d7 (canonicalize_filename_mode): Remove do-while(0) loop.
Replace each corresponding `break' stmt with `continue'.
2004-07-07 09:28:15 +00:00
Jim Meyering 0f3da8f425 . 2004-07-06 17:30:29 +00:00
Jim Meyering bb11ba8316 . 2004-07-06 17:00:53 +00:00
Jim Meyering 2b19667f16 Include "stat-macros.h".
(canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that
S_ISLNK is guaranteed to be defined (via stat-macros.h).
2004-07-06 17:00:36 +00:00
Jim Meyering 260a2f0a47 *** empty log message *** 2004-07-06 16:56:30 +00:00
Jim Meyering b2c18c67d4 (libfetish_a_SOURCES): Add canonicalize.c unconditionally. 2004-07-06 16:56:21 +00:00
Jim Meyering 51dfe9cc31 (canonicalize_mode_t): New type. 2004-07-06 16:55:40 +00:00
Jim Meyering 17b22ef83f Include "file-type.h".
(canonicalize_filename_mode): New function, based on
canonicalize_file_name, supports three canonicalize modes.
(canonicalize_file_name)
[!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it.
2004-07-06 16:55:26 +00:00
Jim Meyering e86c162eed *** empty log message *** 2004-07-06 16:17:25 +00:00
Jim Meyering 859fcb7eec (AC_FUNC_CANONICALIZE_FILE_NAME): Do not add canonicalize.c here. 2004-07-06 16:17:10 +00:00
Jim Meyering 48e3ae2b2f *** empty log message *** 2004-07-06 16:16:01 +00:00
Jim Meyering 159c3f467e (readlink invocation): Document new
"readlink -f" behaviour and new canonicalize options, -e and -m.
2004-07-06 16:15:45 +00:00
Jim Meyering 0966feecc2 . 2004-07-06 16:14:45 +00:00
Jim Meyering 06291f1741 renamed from ../misc/readline 2004-07-06 16:14:40 +00:00
Jim Meyering 0206598b8b . 2004-07-06 16:14:19 +00:00
Jim Meyering 6ec3b19040 From Dmitry V. Levin 2004-07-06 16:14:15 +00:00
Jim Meyering 519533ed8e (SUBDIRS): Add readlink. 2004-07-06 16:13:31 +00:00
Jim Meyering bb16bf0cd5 (AC_CONFIG_FILES): Add tests/readlink/Makefile. 2004-07-06 16:13:17 +00:00
Jim Meyering ef09b8426a (TESTS): Remove basic readlink test. 2004-07-06 16:13:01 +00:00
Jim Meyering 037b7fc0b9 renamed to ../readlink/rl-1 2004-07-06 16:12:39 +00:00
Jim Meyering e0b8973bd4 Change "readlink -f" to be more compatible with prior implementations.
Add more canonicalize options, -e and -m.
Add comprehensive tests for all readlink modes.

(longopts): Add new options.
(usage): Document them.
(canonicalize_fname): New proxy function.
(main): Handle new options.
2004-07-06 16:11:03 +00:00
Jim Meyering 554dc97975 *** empty log message *** 2004-07-05 08:41:43 +00:00
Jim Meyering a8aa538b09 (path_concat): Improve comment. From Paul Eggert. 2004-07-05 08:41:13 +00:00
Jim Meyering 325a75af63 *** empty log message *** 2004-07-04 20:14:52 +00:00
Jim Meyering 034b4caa6d (mempcpy): Don't define if a system header defines it.
Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
(longest_relative_suffix): New function.
(path_concat): Use it.  Assume first argument is not NULL.
Port to DOS.  Omit redundant separators.
Report an error instead of returning NULL.
Use mempcpy instead of memcpy.
(xpath_concat): Remove: not declared or used.
2004-07-04 20:14:44 +00:00
Jim Meyering fb4cd3cc3f *** empty log message *** 2004-07-04 18:13:02 +00:00
Jim Meyering 5e1589ace8 (copy_internal): Add a FIXME comment. 2004-07-04 18:12:55 +00:00
Jim Meyering 6ce20e8caa (canonicalize_file_name): Assume that path_concat never returns NULL. 2004-07-04 18:03:07 +00:00
Jim Meyering 19dc6a7964 *** empty log message *** 2004-07-04 18:01:56 +00:00
Jim Meyering 10da95cf3f (main): Don't pass NULL first argument to path_concat.
This cleans up the semantics a bit, as we no longer try to open the
same file twice.
2004-07-04 18:01:04 +00:00
Jim Meyering cc4105f095 (movefile): Assume path_concat returns non-NULL. 2004-07-04 17:47:29 +00:00
Jim Meyering ae206c4b1c (do_copy): Assume path_concat returns non-NULL.
(make_path_private): 2nd arg is now size_t, not int,
to avoid problem when path_concat dir name is longer than 2 GiB (!).
2004-07-04 17:47:09 +00:00
Jim Meyering aead5906dc (copy_dir): Assume path_concat returns non-NULL. 2004-07-04 17:46:17 +00:00
Jim Meyering d7da2ba957 *** empty log message *** 2004-07-04 17:44:24 +00:00
Jim Meyering a55d4bffcd (gl_PATH_CONCAT): Don't require gl_AC_DOS, the
prerequisite modules now handle the DOS stuff.
Don't check for unistd.h.
2004-07-04 17:44:17 +00:00
Jim Meyering ea32998672 . 2004-07-02 17:02:32 +00:00
Jim Meyering ebc78a4613 *** empty log message *** 2004-07-02 17:02:20 +00:00
Jim Meyering 57fcc427c0 (Common options, Target directory, cp invocation,
install invocation, mv invocation, ln invocation): Add -t as a
short option for --target-directory, and -T as a short option for
--no-target-directory.  Clean up relevant synopses a bit, so that
the language is similar for all.
2004-07-02 17:02:15 +00:00
Jim Meyering bc012e8ad9 . 2004-07-02 17:01:30 +00:00
Jim Meyering 9f3628bd45 Add short names -t and -T for --target-directory
and --no-target-directory options, respectively.

(NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
Remove.  All uses changed to 'T' and 't', respectively.

(long_options, main, usage): Add -t and -T as
aliases for --target-directory and --no-target-directory,
respectively.
2004-07-02 17:00:53 +00:00
Jim Meyering 1b32f828b0 Add short names -t and -T for --target-directory
and --no-target-directory options, respectively.

(NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
Remove.  All uses changed to 'T' and 't', respectively.

(long_opts, usage, do_copy, main): Add -t and -T as
aliases for --target-directory and --no-target-directory,
respectively.
2004-07-02 17:00:10 +00:00
Jim Meyering 4695f1e3b7 * NEWS: Add short names -t and -T for --target-directory
and --no-target-directory options, respectively.
2004-07-02 16:59:41 +00:00