Jim Meyering [Sun, 16 Sep 2001 09:28:34 +0000 (09:28 +0000)]
(digest_check): On systems for which setmode actually
does something, arrange to read the file containing checksum strings
in text mode. Based on a patch from Chris Faylor.
Jim Meyering [Sat, 15 Sep 2001 17:07:24 +0000 (17:07 +0000)]
(EISDIR): Define to 0, if not already defined.
(touch): Give a better diagnostic for e.g., `touch /' by non-root.
Based on a patch from Michael Stone.
Reported by Jeff Sheinberg as Debian bug #101677.
Jim Meyering [Sat, 15 Sep 2001 11:38:36 +0000 (11:38 +0000)]
Accept new option: --reply={yes,no,query}
Include argmatch.h.
(enum) [REPLY_OPTION]: Define.
(usage): Describe new option.
Split long usage string into smaller pieces.
(main): Handle new option.
Jim Meyering [Wed, 12 Sep 2001 09:07:35 +0000 (09:07 +0000)]
The command `echo a|./fmt -2147483647' would cause fmt to segfault.
(fmt_paragraph): Test for sentinal directly, rather than
doing arithmetic with it's potentially large (INT_MAX) length.
Jim Meyering [Fri, 7 Sep 2001 09:44:07 +0000 (09:44 +0000)]
New 'uname' options -i or --hardware-platform,
and -o or --operating-system.
'uname -a' now outputs -i and -o information at the end.
New uname option --kernel-version is an alias for -v.
Uname option --release has been renamed to --kernel-release,
and --sysname has been renamed to --kernel-name;
the old options will work for a while, but are no longer documented.
Jim Meyering [Fri, 7 Sep 2001 09:43:03 +0000 (09:43 +0000)]
Correct copyright notice as per latest coding standards.
Remove list of options in comment, which wasn't
worth maintaining separately from usage().
(print_element): Move definition up, avoiding the need for
declaration and allowing inlining on some platforms.
Keep track of whether something has been printed; this is more
natural than modifying `toprint'.
(PRINT_KERNEL_NAME): Renamed from PRINT_SYSNAME.
(PRINT_KERNEL_RELEASE): Renamed from PRINT_RELEASE.
(PRINT_KERNEL_VERSION): Renamed from PRINT_VERSION.
(PRINT_HARDWARE_PLATFORM, PRINT_OPERATING_SYSTEM): New macros.
(toprint): Remove global var; now local in `main'.
(long_options, usage, main): Implement changes described in NEWS.
Reorder options to reflect output order.
(main): Use buffers one byte longer, for compatibility with Solaris 8.
Output newline at end. -a sets `toprint' to -1 now; this is simpler.
Do not bother invoking system calls like uname if the resulting
information does not need to be printed.
Do not fail if sysinfo fails; just print "unknown".
Jim Meyering [Tue, 4 Sep 2001 20:20:16 +0000 (20:20 +0000)]
(xreadlink): Omit size_t* arg. All uses changed.
Use ssize_t, not int, to store result of readlink.
Check for ssize_t overflow as well as size_t overflow,
as POSIX says the result of readlink is implementation-defined
when ssize_t overflows.
Remove unnecessary cast to char*.
Use free+malloc instead of realloc, as the storage doesn't need
to be preserved and it's clearer and can be more efficient that way.
(SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
Jim Meyering [Mon, 3 Sep 2001 18:21:53 +0000 (18:21 +0000)]
Fix the !HAVE_GETCWD_NULL code to behave more
like the HAVE_GETCWD_NULL code.
Include pathmax.h if not HAVE_GETCWD.
Do not include xalloc.h.
(INITIAL_BUFFER_SIZE): New symbol.
Do not use xmalloc / xrealloc, since the caller is responsible for
handling errors. Preserve errno around `free' during failure.
Do not overrun buffer when using getwd.