Commit Graph

4679 Commits

Author SHA1 Message Date
Paul Eggert 4fa016cbc9 Include <getopt.h>.
(main): Reject unknown options.
2004-09-21 22:01:50 +00:00
Paul Eggert 0d219ee57d Include <getopt.h>.
(main): Reject unknown options.
2004-09-21 22:01:28 +00:00
Paul Eggert 82a84d38cb (main): Don't dump core if POSIXLY_CORRECT and given no arguments. 2004-09-20 06:32:10 +00:00
Paul Eggert 83100c448b (STRING_OPTION): Remove.
(long_options, main): Remove support for undocumented and
obsolete --string option, as suggested in the 1996-09-26 patch.
2004-09-19 16:52:50 +00:00
Paul Eggert fdac7ecb11 (STATUS_OPTION, STRING_OPTION): New enums.
(long_options, main): Use them instead of magic numbers 2 and 1.
For --string, optarg can't possibly be NULL.
2004-09-19 02:21:09 +00:00
Paul Eggert 701fdccca9 (usage): Distinguish between options and operands.
(scanargs): Don't mess with argc, argv; getopt_long handles this now.
Say "operands" for operands, not "options".
(main): Use getopt_long, so that "dd --" works as POSIX requires.
2004-09-19 01:46:09 +00:00
Paul Eggert 77f80f747e (main): Usage failure is EXIT_FAIL, not EXIT_FAILURE. 2004-09-19 01:07:46 +00:00
Paul Eggert b1d33bd46d Fix typo in previous change. 2004-09-19 01:02:30 +00:00
Paul Eggert 9f5c2a8415 (main): Reject unknown options instead of
interpreting them as a directory to chroot to.
2004-09-19 00:58:47 +00:00
Paul Eggert 21b794d06b Remove obsolete comment about POSIX 1003.2/D11.2.
The current standard (POSIX 1003.1-2004) is correct.
(crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid
collision with builtin function.
(main) [defined CRCTAB]: Output in lowercase hexadecimal, and
output the first 0 as 8 digits, to make it easier to compare to
the text of the standard.  Output crctab to be a const array.
(crctab): Use result of above changes.
(long_options): Remove; not needed if empty.
(main): getopt_long can't return 0 here, so simplify the code.
2004-09-19 00:39:52 +00:00
Paul Eggert 3ff4c0ba42 Regenerate. 2004-09-13 13:05:51 +00:00
Paul Eggert 7f924031d6 (localedir.h): Don't redirect directly to target. 2004-09-13 13:05:08 +00:00
Paul Eggert 1359bf8d48 Adjust to backup enum rename. 2004-09-13 12:15:02 +00:00
Paul Eggert 3e60f6731d Adjust to backup file rename. 2004-09-13 12:13:04 +00:00
Paul Eggert 615d4b2cc8 Adjust to backup enum rename. 2004-09-13 12:12:26 +00:00
Paul Eggert 2cfb3f4502 (print_full_info): Don't exit with failure status simply
because a user or group number can't be turned into a name.
2004-09-13 10:43:21 +00:00
Paul Eggert 160d311c8b (parse_obsolete_option): Renamed from
parse_obsolescent_option, since the options are obsolete now.
Remove bool *arg; just exit if there's an error.  Revamp to follow
POSIX 1003.2-1992 more precisely, to handle cases like "tail -
file" and "tail -10 -- file" correctly when we are conforming to
the older standard.
(main): Adjust to this change.
2004-09-10 20:54:08 +00:00
Paul Eggert ffcbb97833 (usage): Document -r, -w, -x more carefully. 2004-09-09 23:21:20 +00:00
Paul Eggert 200579181f (usage): Mention that -h and -L don't dereference. 2004-09-09 04:15:02 +00:00
Paul Eggert 47358fd2de (usage): Document "test" (with no args) and "[ ]". 2004-09-09 03:53:54 +00:00
Paul Eggert c9a4995265 (main): Don't reorder options. 2004-09-09 00:27:56 +00:00
Paul Eggert f786a91cd3 (main): Fix POSIX-conformance bug: "touch --
MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
conforming to pre-2001 POSIX.
2004-09-07 06:21:46 +00:00
Paul Eggert 0cd2d8a70e (main): Emulate Solaris 8 and 9 "sort -y", so that
"sort -y abc" is like "sort abc" whereas "sort -y 100" is like
plain "sort".
2004-09-07 05:09:24 +00:00
Paul Eggert 286260ca55 Several changes for POSIX and FreeBSD compatibility.
(COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X.
(long_options, main): --strings is now -S, not -s.
(usage): Reflect the usage changes.
(parse_old_offset): Do not issue a diagnostic on failure;
callers now do this as necessary.
(main): Support POSIX syntax.  Remove unused case 0 from getopt_long.
Add support for new short options (many undocumented) for
compatibility with FreeBSD.  Remove FIXME for -s; it's now
POSIX-compatible.  Default format is now oS, not o2.
2004-09-06 07:46:43 +00:00
Paul Eggert 3427d5c60c Sort options in usage message. 2004-09-06 01:00:03 +00:00
Paul Eggert 893a0d6f31 (recover_mode): Arg is now char const *, not char *.
(main): Use STDIN_FILENO, not 0.
Simplify option-parsing code a tad.
2004-09-05 07:27:51 +00:00
Paul Eggert 9be806694a (valid_options): Remove.
(main): Fix some bugs in handling invalid option-combinations
like "stty -F".
2004-09-05 07:21:42 +00:00
Paul Eggert c43708fda4 Regenerate. 2004-09-05 07:11:47 +00:00
Paul Eggert 7ee151d229 (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
it from ever being nonzero.  Reported by Pozsar Balazs in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
(human_fstype): Add ramfs, squashfs, sysfs.
Reported by Pozsar Balazs in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
(human_fstype): Return char const *, not char *.
Simplify internals a bit, and avoid casts.
2004-09-03 21:58:36 +00:00
Paul Eggert 54f4b3ce74 (usage): "alternated EBCDIC" -> "alternate EBCDIC".
(bit_count): Remove.  All uses changed to....
(multiple_bits_set): New function.
(scanargs): Use it, and check separately for each set of
incompatible options, to improve diagnostics.
(MX): Remove.
(apply_translations): Move checks for incompatible options
to scanargs, so that they're done consistently.
2004-09-03 08:11:34 +00:00
Paul Eggert 53af9da394 Output correct errno-related diagnostic on "paste" I/O errors.
(write_error, xputchar): New functions.
(paste_parallel): Use correct errno value after input error.
(paste_parallel, paste_serial): Report errno value after output error.
2004-09-03 01:35:33 +00:00
Paul Eggert d33243b5ac (paste_parallel): Improve replacement for ENDLIST and CLOSED. 2004-09-03 01:23:15 +00:00
Paul Eggert 0dd27bdf17 (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove;
it's not portable C to assume FILE is a complete type.
(paste_parallel): Use null instead of ENDLIST, and an explicit
boolean instead of CLOSED.
2004-09-02 23:56:42 +00:00
Paul Eggert 969ed5b8f3 (add_tab_stop): Renamed from add_tabstop. All uses changed.
(parse_tab_stop): Renamed from parse_tabstop.  All uses changed.
(validate_tab_stop): Renamed from validate_tabstop.  All uses changed.
(next_file, main): Check fclose against 0, not EOF.
(unexpand): Remove unnecessary casts.
Add another loop nesting level, for lines, so that per-line variables
are initialized cleanly.
Revamp tab checking.  Check for write error immediately, rather
than just once at the end of the program.
(TAB_STOP_SENTINEL): Remove.
(tab_size): Now size_t, not uintmax_t, since we need to store
the sequences of blanks.
(max_column_width): New var.
(usage): Say "blank" where POSIX requires this.
(add_tab_stop): Calculate maximum column width.
(unexpand): Store the pending blanks, instead of merely counting them.
Follow POSIX's rules about -a requiring two blanks before a tab stop.
Get rid of internal label and goto.
2004-08-24 07:38:49 +00:00
Paul Eggert 0d568f7678 Revamp to resemble the new unexpand.c better.
(usage): -i does not convert tabs after non-tabs.
(add_tab_stop): Renamed from add_tabstop.  All uses changed.
(parse_tab_stop): Renamed from parse_tabstop.  All uses changed.
(validate_tab_stop): Renamed from validate_tabstop.  All uses changed.
(next_file, main): Check fclose against 0, not EOF.
(expand): Remove unnecessary casts.
Add another loop nesting level, for lines, so that per-line variables
are initialized cleanly.
Revamp tab checking.  Check for write error immediately, rather
than just once at the end of the program.
2004-08-24 07:38:04 +00:00
Paul Eggert 5dd2658cb2 Regenerate. 2004-08-20 02:12:59 +00:00
Paul Eggert 958ae74efa (usage): "chown '' file" is now allowed.
(main): Do not set user name to the empty string if the group
name is null.
2004-08-19 20:03:26 +00:00
Paul Eggert 67d2281544 (describe_change): Describe changes to -1:-1
without using "to OWNERSHIP" phrase.
2004-08-19 20:03:11 +00:00
Paul Eggert bbc2ac99c1 (parse_group): Return gid_t rather than storing it
through a pointer.  Treat "chgrp '' file" as a no-op change,
as FreeBSD does.
(main): Set chopt.group_name to NULL if the group is the empty
string.
2004-08-19 20:02:46 +00:00
Paul Eggert 8c3f76651a Regenerate. 2004-08-11 23:47:29 +00:00
Paul Eggert f469551274 Further fix for -d regression. 2004-08-11 23:41:44 +00:00
Paul Eggert b2c632e20c (main): Fix -d regression introduced with
--target-directory support at 2004-06-25.
2004-08-11 21:44:36 +00:00
Paul Eggert 367719ba5f (copy_internal): When preserving links, unlink
a destination with link count greater than one.  This is so
that commands like "cp -a" don't get confused when copying into
a destination that already contains many hard links.
2004-08-11 17:19:25 +00:00
Paul Eggert 8dafbe5806 (usage, tee): "tee -" writes to standard output, not
to a file named "-".
2004-08-10 22:08:58 +00:00
Paul Eggert 7b99d60f08 (die, xfopen, mergefps, first_same_file, merge):
A null file arg means standard output.
(main): "-o -" means to write to a file named "-",
not to standard output.
2004-08-10 22:08:09 +00:00
Paul Eggert 3847c07f66 (usage): "-" is an operand, not an option. 2004-08-10 22:07:52 +00:00
Paul Eggert 811c61b049 (change_timestamps): Fix int->bool conversion
bugs introduced on 2004-07-29.
2004-08-10 20:32:19 +00:00
Paul Eggert 290ba4ab1d (canonicalize_fname): Remove unneeded proxy function.
(can_mode): Make variable local.
2004-08-09 23:40:49 +00:00
Paul Eggert 1def589bea (wipename): Work even if the directory is writeable
and not readable.  Prefer write access, since this should work
better with fdatasync.
2004-08-09 23:34:49 +00:00
Paul Eggert 5d204d4e2f Regenerate. 2004-08-09 18:51:05 +00:00