Commit Graph

5069 Commits

Author SHA1 Message Date
Paul Eggert 4432ecc7b5 Include quotearg.h.
(diagnose_surprises): New var.
(process_file): Diagnose surprises.  Simplify the logic a bit,
while we're at it.
(main): Prepare to diagnose surprises.  Remove useless code for
'-' option.
2005-05-04 17:22:25 +00:00
Paul Eggert 77be207a57 (usage): ls --indicator-style=directory renamed to ls
--indicator-style=slash, to avoid confusion with ls --directory.
(slash): Renamed from directory_only.  All uses changed.
2005-05-02 18:40:47 +00:00
Paul Eggert 71a7e54b0d mode_free -> free 2005-05-01 14:27:51 +00:00
Paul Eggert 67a19c8e42 Regenerate. 2005-04-30 00:07:30 +00:00
Paul Eggert 483ad6b981 (enum indicator_style): New constant directory_only,
for -p.
(indicator_style_args, indicator_style_types): Set it appropriately.
(decode_switches, gobble_file, print_type_indicator):
(length_of_file_name_and_frills):
Implement the change described in NEWS.
(decode_switches): Quote ">", too.
(usage): Update to match the new behavior.  Describe ">".
2005-04-29 21:01:04 +00:00
Paul Eggert b1fdaf5ac7 (main): Adjust to new modechange API.
Also, free the mode_change object when done.
2005-04-28 16:31:09 +00:00
Paul Eggert 30f5286c50 (change, umask_value): New static vars.
(reference_file): Move this static var to inside "main".
(process_file, process_files): Remove CHANGES arg; now taken from
static var.  All uses changed.
(usage): Fix incorrect description of MODE operand.
(main): For invalid mode usages, output a brief usage message.
Adjust to new modechange API.
2005-04-28 16:29:59 +00:00
Paul Eggert c906160906 (main): Don't complain about -NUM. 2005-04-26 16:43:45 +00:00
Paul Eggert c360992faf Remove posixver.h and its uses.
(main): Don't complain about -TAB.
2005-04-26 16:43:33 +00:00
Paul Eggert 369458974f (parse_obsolete_option): Don't complain about -NUM. 2005-04-26 16:43:18 +00:00
Paul Eggert 1e63d9354d Remove posixver.h and its uses.
(main): Don't complain about -NUM option.
2005-04-26 16:43:03 +00:00
Paul Eggert aa9faf52c4 Remove posixver.h and its uses.
(short_options): New constant, which always supports -y arg.
(COMMON_SHORT_OPTIONS): Remove.
2005-04-26 16:42:51 +00:00
Paul Eggert 8f7612bc5e Remove posixver.h and its uses.
(short_options): New constant, which always supports -S[string].
(COMMON_SHORT_OPTIONS): Remove.
2005-04-26 16:42:38 +00:00
Paul Eggert d6ac4446c4 Remove posixver.h and its uses.
(short_options): New constant, which always supports -w[num].
(COMMON_SHORT_OPTIONS): Remove.
2005-04-26 16:42:26 +00:00
Paul Eggert c631833814 Remove posixver.h and its uses.
(main): Always support -NUM option.
2005-04-26 16:41:59 +00:00
Paul Eggert f9118c1c2e Remove posixver.h and its uses.
(obsolete_usage): Remove.
(join_field_1, join_field_2): Initialize to SIZE_MAX to indicate
they haven't been set yet.
(tab): Now int, not char.  Initialize to -1 to indicate white space
separates columns, so that we can use NUL as a separator.
All uses changed.
(OBSOLETE_LONG_OPTIONS, get_option): Remove.
(string_to_join_field): Remove ERR_MSG_FMT arg; a single format
suffices.  Use xstrtoul for sizes; it suffices.
(decode_field_spec): Report an error and exit on failure.  Return void,
not bool.
(add_field_list): Likewise.
(set_join_field): New function.
(enum operand_status): New enum.
(add_file_name): New args OPERAND_STATUS, JOPTION_COUNT,
PREV_OPTC_STATUS, OPTC_STATUS to handle the bewildering array of
possibilities with obsolete option parsing.
(main): Use it.  Do not depend on POSIX version.
Check for conflicting options.  Parse obsolete options -j1 and -j2
so that it is a pure extension to POSIX 1003.1-2001.
Allow '-t\0' to specify a NUL tab, stealing the code from 'sort'.
2005-04-26 16:41:45 +00:00
Paul Eggert e8e6441094 Remove posixver.h and its uses.
(header_mode_option): Remove.
(main): Don't complain about obsolete -NUM args.
2005-04-26 16:41:29 +00:00
Paul Eggert bcb5f0e6da Remove posixver.h and its uses.
(shortopts): New constant.  -DIGIT now always takes an optional arg.
(main): Don't preprocess arg list; that was buggy.  Use method
similar to expand.
2005-04-26 16:41:17 +00:00
Paul Eggert cf8a5565cf Remove posixver.h and its uses.
(shortopts): New constant.  -DIGIT now always takes an optional arg.
(main): Revamp parsing of -DIGIT to let parse_tab_stops handle it.
Don't complain about -DIGIT.
2005-04-26 16:41:03 +00:00
Paul Eggert 3263435391 Remove posixver.h and its uses.
(COMMON_SHORT_OPTIONS): Remove.
(short_options): New constant.
(short_options, usage): -I now always takes an optional arg.
2005-04-26 16:40:43 +00:00
Paul Eggert 4e7d4dfd8d (main): If getopt fails, exit with status 127, not status 1. 2005-04-23 05:57:33 +00:00
Paul Eggert d3eadc9cbf (main): Report proper program name when getopt finds trouble. 2005-04-23 05:39:55 +00:00
Paul Eggert fde1a93ab8 (main): Compile mode with MODE_MASK_ALL and initial umask. 2005-04-22 23:53:33 +00:00
Paul Eggert 18f6ab0228 (main): Compile mode with MODE_MASK_ALL and initial umask. 2005-04-22 23:53:13 +00:00
Paul Eggert 5ce302fba5 (main): Compile mode with MODE_MASK_ALL and initial umask. 2005-04-22 23:52:35 +00:00
Paul Eggert 08e7216b2c Regenerate. 2005-04-18 23:38:19 +00:00
Paul Eggert bb40c7aeca (LDADD, $(PROGRAMS)): fetish -> coreutils. 2005-04-18 23:32:49 +00:00
Jim Meyering c64856e992 Don't include stat-macros.h directly. system.h does that. 2005-04-18 07:03:50 +00:00
Jim Meyering 037421542d (S_TYPEISSHM): Remove definition.
Get the definition by including "stat-macros.h", instead.
2005-04-16 06:38:20 +00:00
Jim Meyering 22abf053ca Correct typo, fchmod -> fchown, in a comment. 2005-04-14 12:09:00 +00:00
Paul Eggert 54ba3e1287 (usage): uid -> user ID 2005-04-12 07:39:38 +00:00
Jim Meyering aa3d627011 (tsort): Use "%s" as the format string, rather than a diagnostic or a file name. 2005-04-12 06:47:44 +00:00
Jim Meyering 0510017888 (compare_files): Remove declaration of unused local. 2005-04-12 06:46:10 +00:00
Paul Eggert 6fabf88aec (usage, main): Use "user ID", not "UID", and similarly for "group ID". 2005-04-12 05:44:47 +00:00
Paul Eggert 064c7a4273 (usage): Use "user ID", not "UID", and similarly
for "group ID".
2005-04-12 05:44:16 +00:00
Paul Eggert 3aeec3ceed Regenerate. 2005-04-11 20:21:07 +00:00
Paul Eggert 786ebb2cec Include stdio_safer.h.
(check_file): Don't assume fopen cannot return stdin or stdout.
2005-04-11 20:13:26 +00:00
Paul Eggert 45e6c262b9 (next_file): Don't assume fopen cannot return stdin. 2005-04-11 20:13:10 +00:00
Paul Eggert 8e8520b0ba (have_read_stdin): Remove; no longer needed. All uses
removed.
(tsort): Do not assume fopen can't return stdin.
Close stdin before returning.  All uses changed.
2005-04-11 20:12:51 +00:00
Paul Eggert 39d496f075 Include unistd-safer.h.
(touch): Use fd_safer.
2005-04-11 20:12:32 +00:00
Paul Eggert 857b9db0e0 Include stdio-safer.h.
(tee): Use fopen_safer.
2005-04-11 20:12:17 +00:00
Paul Eggert 99eb6d3a02 Include unistd-safer.h rather than fcntl-safer.h.
(recheck, tail_file): Use fd_safer rather than open_safer.
2005-04-11 20:12:01 +00:00
Paul Eggert 9db4c89700 Include unistd-safer.h.
(copy_to_temp): Use fd_safer.
(tac_file): Don't assume fopen cannot return stdin.
2005-04-11 20:11:45 +00:00
Paul Eggert da5dc50751 (bsd_sum_file, sysv_sym_file):
Use same pattern as elsewhere for checking for stdin.
2005-04-11 20:11:27 +00:00
Paul Eggert a498869855 Include unistd-safer.h.
(cwrite): Use fd_safer.  Replace mystery constant 0666 with symbolic
version, as POSIX requires.
2005-04-11 20:11:08 +00:00
Paul Eggert 66729cdcd3 Include unistd-safer.h.
(create_temp_file): Use fd_safer.
(xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
2005-04-11 20:10:52 +00:00
Paul Eggert 0d49dd9de2 Include unistd-safer.h.
(wipename): Use fd_safer on directory file descriptor.
(wipefile): Remove special case for /dev/fd/* on older hosts.
It didn't work in general, and wasn't documented.
Use fd_safer.
2005-04-11 20:10:23 +00:00
Paul Eggert caca482cde (main): Don't assume fopen returns stdout after closing
stdout.  Use freopen instead.
2005-04-11 20:10:00 +00:00
Paul Eggert 02b7510866 Include stdio-safer.h.
(open_file): Use fopen_safer.
(close_file): Don't assume fopen does not return stdin.
2005-04-11 20:09:42 +00:00
Paul Eggert c2377708ec (paste_serial): Don't assume fopen does not return stdin. 2005-04-11 20:09:22 +00:00