1 2004-04-19 Jim Meyering <jim@meyering.net>
5 Make pwd work even if the resulting name is so long that getcwd fails.
6 * src/pwd.c: (path_free, path_init, path_prepend): New functions.
7 (nth_parent, find_dir_entry, robust_getcwd): New functions.
8 (main): First try getcwd, then, upon failure, robust_getcwd.
10 2004-04-18 Jim Meyering <jim@meyering.net>
12 * src/who.c (print_user): Use xrealloc here, rather than
13 unchecked realloc. Remove anachronistic casts.
15 * src/remove.c (full_filename_): Don't leak upon failed realloc.
17 * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function,
19 * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h,
20 renaming it. Update uses.
22 2004-04-17 Jim Meyering <jim@meyering.net>
24 * configure.ac: Depend on automake-1.8.3.
26 * src/join.c (add_file_name): Declare function to be `static'.
27 (string_to_join_field): Likewise.
28 * src/remove.c (ds_init, ds_free): Likewise.
30 * Makefile.maint (sc_prohibit_jm_in_m4): New rule.
31 (syntax-check-rules): Add to the list.
33 2004-04-13 Paul Eggert <eggert@twinsun.com>
35 Use page-aligned buffers whenever we bother to do I/O using buffer
36 sizes that are tailored for the files.
38 * src/cat.c: Include getpagesize.h.
39 * src/copy.c: Likewise.
40 * src/shred.c: Likewise.
41 * src/split.c: Likewise.
42 * src/cat.c (main): Align I/O buffers to page boundaries.
43 * src/copy.c (copy_reg): Likewise.
44 * src/shred.c (dopass): Likewise.
45 * src/split.c (main): Likewise.
46 * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove.
47 All uses replaced by ptr_align.
48 * src/od.c (gcd, lcm): Remove; now in system.h.
49 * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c.
51 2004-04-14 Jim Meyering <jim@meyering.net>
53 Remove m4/Makefile.am: it's no longer needed, with newer automake
54 * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list.
55 * Makefile.am (SUBDIRS): Remove `m4' from the list.
57 2004-04-13 Jim Meyering <jim@meyering.net>
59 * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'.
61 2004-03-27 Paul Eggert <eggert@twinsun.com>
63 * NEWS: cp -pu and mv -u (when copying) now take the destination
64 file system time stamp resolution into account.
65 * doc/coreutils.texi (mv invocation): Document this.
66 (cp invocation): Document -u (it was missing!) with new behavior.
68 * src/copy.c: Include "utimecmp.h".
69 (copy_internal): Compare time stamps using utimecmp rather than
72 2004-04-09 Jim Meyering <jim@meyering.net>
74 * Makefile.maint (.re-list): New rule/file, to replace
75 hard-coded list of header file names.
76 (sc_system_h_headers): Use the new file.
77 Don't look for sys2.h anymore.
79 * src/system.h: Include new "stat-macros.h" rather than hard-coding
80 all of its macro definitions -- the list was slightly out of date.
81 Suggestion from Dmitry V. Levin.
83 2004-04-08 Paul Eggert <eggert@cs.ucla.edu>
85 * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin.
86 * doc/coreutils.texi (dd invocation): Likewise.
87 * src/shred.c (O_NOCTTY): Remove redundant decl.
88 * src/dd.c (flags, usage): Remove noctty flag.
89 (main): Always use O_NOCTTY when opening files.
91 2004-04-08 Jim Meyering <jim@meyering.net>
93 * src/dd.c (dd_copy): Mark two diagnostics for translations.
94 (set_fd_flags): Undo part of today's change: it's a little
95 cleaner -- and more efficient in the common case -- to go
96 ahead and OR in the -1 when fcntl fails.
98 * Makefile.maint (sc_dd_max_sym_length): New target.
99 (syntax-check-rules): Add it.
101 * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]:
102 Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum.
104 * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
105 Rename parameter, flags, to avoid shadowing global.
106 (LONGEST_SYMBOL): Tweak comment.
108 2004-04-07 Paul Eggert <eggert@twinsun.com>
110 * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync,
111 and new dd options iflag= and oflag=.
112 * src/dd.c (usage): Likewise.
113 * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib.
114 * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro.
115 (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
116 (input_flags, output_flags): New vars.
117 (LONGEST_SYMBOL): New macro.
118 (struct symbol_value): Renamed from struct conversion. Members
119 symbol and value renamed from convname and conversion. The
120 symbol value is now an array instead of a pointer; this saves
121 a bit of space and time in practice. All uses changed.
122 (conversions): Add nocreat, excl, fdatasync, fsync. Now const.
123 (flags): New constant array.
124 (iflag_error_msgid, oflag_error_msgid): New constants.
125 (parse_symbols): Renamed from parse_conversion and generalized
126 to handle either conversion or flag symbols.
127 (scanargs): Adjust uses of parse_symbols accodingly. Add
128 support for iflag= and oflag=. Reject attempts to use
129 both excl and nocreat.
130 (set_fd_flags): New function.
131 (dd_copy): Just return X rather than calling quit (X), since our
132 caller invokes quit with the returned value. Add support for
134 (main): Add support for iflag=, oflag=, and new conv= symbols.
135 * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW,
136 O_RSYNC, O_SYNC): Define to 0 if not already defined.
138 * NEWS: Remove duplicate mention of BLOCKSIZE.
140 2004-04-02 Andreas Schwab <schwab@suse.de>
142 * src/stty.c: Add support for IUTF8 input flag.
144 2004-04-06 Jim Meyering <jim@meyering.net>
146 * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev.
147 Interix spells it `mkdev'. Reported by Mark Funkenhauser.
149 2004-04-04 Jim Meyering <jim@meyering.net>
151 A specified format is no longer automatically newline terminated.
152 If you want a newline at the end of your format, use `\n'.
153 * src/stat.c (print_it): Don't print a newline at the end of
155 (do_statfs): Add a newline at end of each default format string.
157 2004-03-30 Paul Eggert <eggert@twinsun.com>
159 * src/nohup.c (main): Adjust to new calling convention
160 for set_cloexec_flag.
162 2004-03-31 Jim Meyering <jim@meyering.net>
164 * tests/Fetish.pm (run_tests): Remove `.orig' file.
165 Remove debugging diagnostic.
167 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
168 would not elicit an error.
169 * src/ptx.c: Include "xstrtol.h" and "quotearg.h".
170 (main): Don't use atoi. Use xstrtoul instead.
172 2004-03-30 Jim Meyering <jim@meyering.net>
174 * Makefile.maint (sc_prohibit_atoi_atof): New rule.
175 (syntax-check-rules): Add it.
176 * .x-sc_prohibit_atoi_atof: New file.
178 2004-03-29 Jim Meyering <jim@meyering.net>
180 * tests/du/files0-from: Use new OUT_SUBST directive, so that this
181 test is not sensitive to system-dependent block size differences.
182 Prompted by a report of Solaris 8 differences from Paul Eggert.
184 * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST.
185 Rename `%tmp' to `%actual'. Reverse order of last two args to
186 _compare_files (to $actual, $expected) so as to match declaration.
188 2004-03-28 Paul Eggert <eggert@twinsun.com>
190 Fix some gotchas encountered when porting to Solaris 8, using
191 the Forte 6u2 compiler.
193 * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]:
194 Declare sethostname, since no Solaris header does it.
195 * src/who.c: Include "vasprintf.h", for asprintf.
197 2004-03-28 Jim Meyering <jim@meyering.net>
200 * src/du.c (process_file): Don't record dev/inode for directories.
202 Under some circumstances, without -c, du would mistakenly count the
203 space of hard-linked files, not just the first one it encountered.
204 Reported by Anthony Thyssen.
205 * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.
207 * src/du.c: Rename global `print_totals' to `print_grand_total'.
209 * src/du.c (main): Rearrange filtering loop to be a tiny bit
212 * src/chown-core.c: Don't include savedir.h -- no longer needed.
213 * src/chmod.c: Likewise.
215 2004-03-25 Jim Meyering <jim@meyering.net>
217 * src/du.c (main): Remove now-unused declaration of `i'.
219 2004-03-24 Paul Eggert <eggert@twinsun.com>
221 * src/du.c (main): Filter out file names of length zero before
222 invoking fts, so that they don't cause fatal errors.
224 2004-03-25 Jim Meyering <jim@meyering.net>
226 * tests/du/files0-from (zero-len): Add a test for the above.
228 2004-02-25 Paul Eggert <eggert@twinsun.com>
230 * NEWS: New environment var BLOCKSIZE.
231 * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
232 * tests/envvar-check: Test for it. Factor the code to simplify it.
234 2004-03-23 Paul Eggert <eggert@twinsun.com>
236 * NEWS: Shorten the du --files0-from announcement, and say
237 "NUL-terminated" rather than "NUL-separated".
238 * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
240 (usage): Say "NUL-terminated", not "NUL-separated".
241 (main): Check for I/O error when istream is closed.
242 Allow --files0-from=F even if F is empty; this specifies no files.
243 (du_files): Now that we allow the list of files to be empty,
245 * tests/du/files0-from: Adjust to above changes to src/du.c.
247 2004-03-24 Jim Meyering <jim@meyering.net>
249 * tests/tail-2/assert: Avoid race condition that could cause
250 spurious failure. Based on a patch from Andreas Schwab.
252 2004-03-23 Jim Meyering <jim@meyering.net>
254 * src/du.c (main): Free the hash table, too.
256 2004-03-22 Jim Meyering <jim@meyering.net>
258 * man/Makefile.am (.x.1): Remove --info-page= option, reverting
259 the change of 2004-01-22. I can no longer reproduce the problem
260 that prompted that change, and `info coreutils pr' would display the
261 `printing text' section of the manual, not the one on `pr invocation'.
263 * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics
264 to match corrected output.
266 * src/du.c: Include "readtokens0.h" rather than "readtokens.h".
267 (main): Use readtoken0 functions rather than readtokens.
268 Don't use errno when diagnosing readtokens0 failure.
269 Fix off-by-one error in the token number reported in a diagnostic.
270 (du_files): Return bool, rather than int.
271 (main): Call readtokens0_free.
273 2004-03-21 Jim Meyering <jim@meyering.net>
275 * src/remove.c (ds_free): Plug a small leak.
277 * tests/Fetish.pm: Fix typo in comment.
279 2004-03-07 Jim Meyering <jim@meyering.net>
281 * NEWS: du accepts a new option --files0-from=FILE, where FILE
282 contains a list of NUL-separated file names.
284 * src/du.c: Include "readtokens.h".
285 (usage): Describe the new option, and adjust the `Usage':
286 with this option, no FILE may be specified on the command line.
287 (main): Handle the new option.
289 * tests/du/files0-from: New tests, for the above.
290 * tests/du/Makefile.am (TESTS): Add files0-from.
292 * src/factor.c (do_stdin): Reflect changes in use of readtoken.
293 * src/tsort.c (tsort): Likewise.
295 2004-02-29 Paul Eggert <eggert@twinsun.com>
297 * NEWS: Add support for a new notation @N to get_date to represent
298 the time stamp with numeric value N. Improve support for
299 fractional time stamps. date's -d and -f options now accept them.
300 Likewise for touch -t. date has a new option --iso-8601=ns.
302 * doc/coreutils.texi (touch invocation):
303 Describe use of fractional seconds.
304 (date invocation, Options for date): Likewise.
305 * doc/getdate.texi (General date syntax, Time of day items): Likewise.
306 * doc/coreutils.texi (date invocation): Mention effect of LC_TIME.
307 (Options for date): Describe new --iso-8601=ns option.
309 * doc/getdate.texi: Add copyright notice. Change getdate to
310 get_date when talking about the function name.
311 (Seconds since the Epoch): New section, containing the time_t
312 info moved from Date input formats section, along with new
313 info about the @ syntax. Mention negative time stamps,
314 fractional time stamps, and leap seconds.
315 (General date syntax): Modernize examples a bit to reflect new
317 (General date syntax, Relative items in date strings):
318 Use ' rather than " to quote formats.
319 (Time of day items): Add an example with fractional seconds.
320 Describe fractional-second syntax.
322 * src/Makefile.am (touch_LDADD): New macro, since `touch' now
325 * src/date.c (enum Time_spec): New enum TIME_SPEC_NS.
326 (time_spec_string, time_spec, show_date): Support it.
327 (usage): Remove description of -ITIMESPEC, as it's obsolete and
328 confusing. Mention --iso-8601=ns.
329 (batch_convert): getline returns ssize_t, not int.
331 * src/touch.c (newtime): Now an array of two timespecs, one
332 for access and one for modification.
334 (get_reldate): Use get_date's parameter profile.
335 (touch, main): Adjust to above changes.
336 (main): Work even if tm_year == INT_MAX (so long as long int is wider).
337 Use gettime instead of gettimeofday, for new get_date signature.
339 * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32,
342 2004-03-15 Jim Meyering <jim@meyering.net>
344 * Makefile.maint (alpha beta major): `Make' the emit_upload_commands
345 target before updating $(prev_version_file).
347 * tests/misc/date-sec: New file, to test for just-fixed bug in date.
348 See today's change in lib/getdate.y.
349 * tests/misc/Makefile.am (TESTS): Add date-sec.
351 2004-03-14 Jim Meyering <jim@meyering.net>
353 * announce-gen (print_changelog_deltas): Use `.sig' suffix for
354 signature files, not `.asc'. Reported by angico@yahoo.com.
356 2004-03-13 Jim Meyering <jim@meyering.net>
358 * src/cp.c (do_copy): Tweak wording in a diagnostic.
359 Suggestion from Karl Berry.
360 Include "quoatearg.h".
361 (do_copy): Use quotearg_colon (not quote) for diagnostics
362 that begin with `"%s:'.
364 * src/nl.c (usage): Specify that nl uses _basic_ regular expressions.
365 Suggestion from Dan Jacobson.
367 2004-03-12 Jim Meyering <jim@meyering.net>
371 Sometimes, when source and destination partition are different,
372 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
374 * src/copy.c: When moving a set of N hard-linked files between
375 partitions, via two or more command line arguments where the
376 command line argument containing the Nth link contains no other
377 link to that same file, mv would mistakenly copy the file, rather
378 than hard-linking it to the other(s). That happens because when the
379 final link is processed, its link count has been reduced to 1 since
380 the other links have been `copied' to the destination partition
381 and the source links have been removed.
382 (copy_internal): When in move mode, use the source dev/inode
383 pair to look up destination name even when st_nlink == 1.
384 * src/cp-hash.c (src_to_dest_lookup): New function.
385 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
386 * tests/mv/part-hardlink: New file. Test for the above fix.
387 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
389 * announce-gen: Sync with autoconf.
391 * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
392 This was triggered on a Linux-2.2.19 system using a file system
393 NFS-mounted from some sort of Sun.
395 2004-03-11 Jim Meyering <jim@meyering.net>
397 * Use automake-1.8.3. Regenerate dependent files.
399 2004-03-10 Jim Meyering <jim@meyering.net>
401 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
402 so that this test works with SELinux-enabled systems.
403 Based on a patch from Tim Waugh.
405 `join -1 x' would give a misleading diagnostic
406 * src/join.c (string_to_join_field): Report that a non-numeric field
407 number is invalid, rather than `so large that it is not representable'.
408 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
410 2004-03-06 Jim Meyering <jim@meyering.net>
412 cp --sparse=always sparse-image-file.img /dev/hda1 could
413 produce an invalid copy on the destination device.
415 * src/copy.c (copy_reg): Even with --sparse=always, try to
416 make `holes' only if the destination is a regular file.
417 Reported by Szakacsits Szabolcs.
419 2004-03-03 Paul Eggert <eggert@twinsun.com>
421 * src/nohup.c (main): Don't invoke set_cloexec_flag with
422 a file descriptor of -1.
424 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
426 * src/nohup.c: Include "cloexec.h".
427 (main): Set the copy of stderr to close on exec.
429 2004-03-01 Paul Eggert <eggert@twinsun.com>
431 * configure.ac: Include <signal.h> when checking for strsignal,
432 sys_siglist, and friends. Problem reported by Tony Leneis in
433 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
435 2004-02-25 Paul Eggert <eggert@twinsun.com>
437 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
438 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
441 2004-02-23 Paul Eggert <eggert@twinsun.com>
443 * NEWS: Document how chown's USER.GROUP argument is now parsed.
445 2004-02-23 Jim Meyering <jim@meyering.net>
447 * src/seq.c (usage): Remove stray space after \n in --help output.
449 2004-02-22 Jim Meyering <jim@meyering.net>
451 * src/du.c (usage): Separate -H and --si. Say that the meaning
452 of -H will soon change to that of --dereference-args (-D).
454 2004-02-21 Jim Meyering <jim@meyering.net>
456 * src/comm.c (usage): Tell what comm does when there are no options.
457 Reword in terms of FILE1 and FILE2 rather than `left file' and
458 `right file'. Suggestion from Dan Jacobson.
460 2004-02-15 Paul Eggert <eggert@twinsun.com>
462 Fix some POSIX-conformance bugs in expr.
464 * NEWS: document the following changes to src/expr.c.
465 * doc/coreutils.texi (expr invocation): Likewise.
466 Document what forms integers may take, and say "integer"
467 consistently instead of "number". Warn about operands
468 that "expr" can misinterpret, and how to work around the
470 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
471 Accept a bool argument specifying whether to evaluate the
472 expression. This is to allow short-circuit evaluation. All
474 (null): Report that a string is zero even if it has
475 a form like "-0" or "00".
476 (eval1, eval): Use short-circuit evaluation for | and &.
477 (eval): Return 0 if both arguments are null or zero, instead
478 of returning the first argument.
479 * tests/expr/basic: Add some tests for the above.
481 2004-02-17 Jim Meyering <jim@meyering.net>
485 `make check' from a build inside a chroot environment would fail
486 * tests/help-version: Specify an argument (`/') for df, in the
487 unusual event that there is no valid entry in /etc/mtab.
488 Likewise for id: add the -u option, so we don't get spurious
489 failures when there are no user or group names.
492 * src/sort.c (usage) [-u]: Add punctuation so that the description in
493 the help2man-generated (line-joined) man page is more readable.
494 Reported by Tim Waugh.
495 [-T]: Add a semicolon, for the same reason.
497 2004-02-15 Jim Meyering <jim@meyering.net>
499 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
501 2004-02-11 Jim Meyering <jim@meyering.net>
503 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
504 $(srcdir)/../Makefile.am.in, rather than $<.
505 Suggestion from Michael Elizabeth Chastain.
507 2004-02-10 Jim Meyering <jim@meyering.net>
509 * config/install-sh: Make this script executable.
510 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
511 is executable. Otherwise, on systems that lack a suitable install
512 binary, `make install' would fail, because of the way this script
513 is invoked (without `$SHELL ' prefix).
514 Reported by Bob Proulx.
516 2004-02-08 Jim Meyering <jim@meyering.net>
520 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
521 that would cause an unwarranted test failure.
522 * tests/rm/rm3: Likewise.
524 2004-02-07 Jim Meyering <jim@meyering.net>
526 Remove xstat function pointer member. The way it was used was not
527 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
528 inline `stat' and `lstat' functions, thus making the tests of
529 `xstat == lstat' in copy.c always fail.
530 * src/copy.h (struct cp_options) [xstat]: Remove member.
532 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
533 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
534 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
535 (valid_options): Remove now-obsolete FIXME comments.
537 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
539 (do_copy): Declare/use local xstat rather than x->xstat.
540 (main): Remove code that set x.xstat.
541 * src/mv.c (cp_option_init): Don't initialize xstat member.
542 * src/install.c (cp_option_init): Likewise.
544 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
545 so that emit_upload_commands can use these variables, too.
547 2004-02-06 Jim Meyering <jim@meyering.net>
549 * tests/rm/deep-1: Remove `du' stack space test.
550 Apparently, `ulimit -s N' isn't portable enough.
551 This test will be restored (with a guard against losing ulimit)
552 in its own file later.
554 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
555 since this test doesn't take long enough to merit them.
556 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
558 * Makefile.maint (signatures): Remove definition.
559 Now, automake's gnupload handles this.
560 (%.sig: %): Remove now-unused rule.
561 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
562 `$(distdir).tar.bz2 $(distdir).tar.gz'.
563 (emit-upload-commands): Adjust to use gnupload.
565 2004-02-05 Jim Meyering <jim@meyering.net>
567 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
568 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
569 Now, those are all defined in timespec.h.
572 * src/date.c: Don't include timespec.h, now that system.h does it.
574 2004-02-02 Paul Eggert <eggert@twinsun.com>
576 Don't dump core if localtime returns NULL (possible on
577 hosts with 64-bit time_t and 32-bit int).
578 * src/date.c: Include "inttostr.h".
579 (batch_convert, main):
580 If time conversion fails, exit with nonzero status.
581 (show_date): Return int to report conversion failure.
582 Print the time as an int if localtime fails.
583 * src/uptime.c: Print "??" if the current clock can't
584 be converted by localtime. This won't happen until the year
585 2*31 + 1900, but we don't want to dump core even if the current
586 clock has the wrong value.
588 * src/stat.c: Include "inttostr.h".
589 (human_time): Print the date/time as a number of seconds since the
590 epoch if it can't be converted by localtime. This is better than
591 just saying "invalid", and is consistent with what "ls" does.
592 Don't dump core if the year has more than 48 digits; this isn't
593 possible on any contemporary host, but we might as well do it right.
595 2004-01-31 Paul Eggert <eggert@twinsun.com>
597 * src/stat.c (human_time): Accept time rather than
598 pointer-to-const-time parameter, for clarity. All callers changed.
600 2004-02-02 Jim Meyering <jim@meyering.net>
602 * src/stat.c (do_stat): Remove extra trailing newline from
603 default formats. Reported by Nelson H. F. Beebe.
605 Print actual fractional seconds in time stamps, not just `.00000000'.
606 * src/stat.c (human_time): Add and use new parameter, t_ns.
607 (print_stat): Update callers.
608 * src/ls.c (TIMESPEC_NS): Remove definition.
609 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
610 also uses this macro.
611 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
612 fractional seconds for files on an XFS file system, but that stat's
613 fractional seconds were always zero.
615 2004-01-28 Paul Eggert <eggert@twinsun.com>
617 * src/seq.c (print_numbers): Use 'double' for loop index, not
618 'int', to avoid problems with integer overflow. On almost all
619 machines 'double' works in every case where 'int' works, and
620 it works on other cases besides.
622 2004-01-27 Jim Meyering <jim@meyering.net>
624 * src/seq.c (usage): Mention that if INCREMENT is omitted,
625 it defaults to 1, even when FIRST is larger than LAST.
626 Reword so as not to exclude the possibility that INCREMENT be zero.
628 2004-01-25 Jim Meyering <jim@meyering.net>
632 * Makefile.maint (signatures): Comment out definition.
634 2004-01-23 Jim Meyering <jim@meyering.net>
636 * Makefile.maint (header_regexp): Add exitfail.
638 * man/Makefile.am (EXTRA_DIST): Add help2man.
639 Reported by Nelson H. F. Beebe.
641 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
642 so it works on systems with Perl installed somewhere other than in
645 * src/paste.c (paste_parallel): Declare local, chr, to be of type
646 `int', not `char', since it must hold EOF. This bug would make
647 paste infloop on some systems. Test failures reported by
648 Nelson H. F. Beebe and Christian Krackowizer.
650 2004-01-22 Jim Meyering <jim@meyering.net>
652 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
653 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
655 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
656 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
657 Use --info-page='coreutils PROG' option.
658 Now, readlink.1 refers the user to `info coreutils readlink'
659 rather than to `info readlink'. Reported by Matt Swift.
661 2004-01-21 Paul Eggert <eggert@twinsun.com>
665 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
666 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
667 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
668 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
669 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
670 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
671 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
672 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
673 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
674 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
675 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
676 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
677 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
678 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
679 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
680 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
681 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
683 * src/cat.c (usage): Don't bother normalizing exit status
684 since the arg is already the correct exit status now.
685 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
686 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
687 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
688 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
689 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
691 * src/chown.c (main): Removed unused local 'fail'.
693 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
696 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
697 * src/env.c, src/nice.c, src/su.c: Likewise.
698 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
699 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
700 * src/expr.c (main): Use initialize_exit_failure rather than
701 setting exit_failure directly; this optimizes away redundant
703 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
705 * src/chroot.c (main): Exit with status 1 rather than 127
706 if chroot itself fails, as per documentation.
708 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
709 rather than roll-your-own symbols or integers.
710 * src/env.c (main): Likewise.
711 * src/nohup.c (main): Likewise.
712 * src/su.c (run_shell): Likewise.
714 * src/cp.c (exit_status): Remove static var....
715 (main): Making it local here instead. Use =, not |=, to set it.
717 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
719 * src/date.c (batch_convert, main): Likewise.
720 * src/dd.c (dd_copy): Likewise.
721 * src/pr.c (first_last_page, main, getoptarg): Likewise.
722 * src/tr.c (main): Likewise.
723 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
724 POSIX doesn't require it.
725 * src/dd.c (write_output, skip, dd_copy): Likewise.
726 * src/df.c (main): Likewise.
727 * src/id.c (main): Likewise.
728 * src/install.c (main): Likewise.
729 * src/ln.c (main): Likewise.
730 * src/ls.c (main): Likewise.
731 * src/mv.c (main): Likewise.
732 * src/shred.c (main): Likewise.
734 * src/env.c (main): Exit with status 1, not 2, on errors detected
736 * src/hostname.c (main): Likewise.
737 * src/nl.c (main): Likewise.
738 * src/stty.c (main): Likewise.
740 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
741 consistency with the other programs' naming conventions.
744 * src/factor.c (main): Do not report a usage error simply
745 because stdin has bad numbers.
747 * src/id.c (problems): Now a boolean int, not a counter,
748 so that we don't have to worry about int overflow. All uses changed.
749 * src/touch.c (err): Likewise.
751 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
753 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
754 * src/mknod.c: Likewise.
756 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
757 on error; this is in case EXIT_FAILURE is unusual.
758 * src/su.c (main): Likewise.
760 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
761 changed to EXIT_CANNOT_INVOKE.
763 * src/printenv.c (PRINTENV_FAILURE): New constant.
764 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
765 command-line syntax problems.
767 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
768 (main): Avoid integer overflow when seeing whether errors occurred.
770 * src/seq.c (print_numbers): Now returns void, not (zero) int.
772 (main): Remove unused local variable 'errs'. Always exit successfully
775 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
776 for consistency with other programs here. All uses changed.
777 (main): Use 'error' to exit rather than invoking 'exit' here.
779 * src/sort.c: Don't include <assert.h>.
780 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
781 (usage): Don't use 'assert'.
782 (main): Remove redundant assignment to exit_failure.
784 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
786 (initialize_exit_failure): New inline function.
787 Include exitfail.h here, since we refer to exit_failure.
788 All callers changed to not include exitfail.h.
790 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
791 substitute them for the corresponding integer constants.
793 * tests/help-version (expected_failure_status_date): Remove, as
794 'date' is now normal.
795 (expected_failure_status_nohup): New var.
797 2004-01-21 Jim Meyering <jim@meyering.net>
799 * tests/touch/relative: Remove `command' syntax.
800 Thanks to Nelson H. F. Beebe and Paul Eggert.
802 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
803 so as to avoid problems with systems using TAI clocks.
804 Although it's no longer necessary, set TZ=UTC0 also for the
805 initial touch command. Reported by Paul Jarc here:
806 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
808 2004-01-20 Diego Biurrun <diego@biurrun.de>
810 * src/dircolors.hin: Add .mov to the list of media files.
812 2004-01-19 Paul Eggert <eggert@twinsun.com>
814 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
815 portable). Problem reported by Christian Krackowizer. Also, use
816 +0000 rather than +0 to specify a time zone, as the documentation
817 requires four digits.
819 2004-01-19 Jim Meyering <jim@meyering.net>
821 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
822 * tests/mv/backup-is-src: Likewise.
823 Problem reported by Peter Horst
825 2004-01-17 Jim Meyering <jim@meyering.net>
827 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
831 2003-12-15 Paul Eggert <eggert@twinsun.com>
833 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
834 with -r specifying the origin for -d.
835 * src/touch.c (flexible_date): Remove static var.
836 (get_reldate): New function.
837 (main): Use it, to implement this new behavior.
839 2004-01-16 Jim Meyering <jim@meyering.net>
841 * tests/touch/relative: New test for the above.
842 * tests/touch/Makefile.am (TESTS): Add relative.
844 2004-01-13 Jim Meyering <jim@meyering.net>
846 * src/system.h: Include contents of sys2.h.
847 * src/sys2.h: Remove file.
848 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
850 * Use automake-1.8.2. Regenerate dependent files.
852 * Update to gettext-0.13.1.
853 * configure.ac: Use gettext-0.13.1.
854 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
856 2004-01-12 Jim Meyering <jim@meyering.net>
858 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
860 * Makefile.maint (po-check): Ensure that cvsu works before using it.
861 Reported by Alexandre Duret-Lutz.
863 * src/tail.c (main): Warn about following stdin only when it's a tty.
865 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
867 2004-01-10 Jim Meyering <jim@meyering.net>
869 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
871 2004-01-09 Jim Meyering <jim@meyering.net>
873 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
875 2004-01-08 Jim Meyering <jim@meyering.net>
877 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
880 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
881 remnant) from PATH component. That would cause tests in this directory
882 not to run the just-built binaries, but rather whatever happened
883 to be in one's PATH. Reported by Christian Krackowizer.
885 2004-01-04 Jim Meyering <jim@meyering.net>
887 * src/csplit.c (new_control_record): Use x2nrealloc
888 rather than xrealloc.
890 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
892 (make_path_private): Likewise.
894 2004-01-03 Jim Meyering <jim@meyering.net>
896 * src/paste.c: Use `bool' (not int) as the type for a few
898 (collapse_escapes): Rewrite to set globals rather than modifying
900 Use size_t (not int) for all counters and related index variables.
901 (paste_parallel): Remove needless complexity of
902 using xrealloc in the loop; just allocate the buffers up front.
903 Free the two temporary buffers.
904 Move declarations of locals `down' into scope where used.
905 (paste_serial): Remove `register' attributes.
906 (main): Simplify delim-related code.
907 Free `delims', now that it's malloc'd.
909 2004-01-02 Jim Meyering <jim@meyering.net>
911 * src/chroot.c: Include "quote.h".
912 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
913 (main): Exit with status of 127, not 1, for too-few-args,
914 chroot failure, or chdir failure.
915 Give a better diagnostic upon execvp failure.
917 * src/du.c (usage): Mention that, with its current meaning,
920 * src/tail.c (main): Warn about following stdin when it's a tty.
921 Fail when following by name but no names are specified.
923 2003-12-30 Jim Meyering <jim@meyering.net>
925 * src/fold.c (main): Use memcpy, not strcpy.
927 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
930 2003-12-28 Jim Meyering <jim@meyering.net>
932 * src/unexpand.c (n_tabs_allocated): New global.
933 (add_tabstop): Use x2nrealloc rather than xrealloc.
934 * src/expand.c: Likewise.
936 * tests/misc/expand: New file.
937 * tests/misc/Makefile.am (TESTS): Add expand.
939 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
940 (fillbuf): Use x2nrealloc rather than xrealloc.
941 (sort): Use xnmalloc rather than xmalloc.
944 2003-12-27 Jim Meyering <jim@meyering.net>
946 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
948 2003-12-29 Paul Eggert <eggert@twinsun.com>
950 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
951 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
953 * doc/coreutils.texi (join invocation): Remove documentation
954 accordingly. Document that -t makes all separators significant.
956 * src/join.c: Include posixver.h.
957 (obsolete_usage): New var.
958 (longopts): Put obsolete options first.
959 (OBSOLETE_LONG_OPTIONS): New constant.
960 (get_option, add_file_name): New functions.
961 (main): Use them to support new behavior.
962 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
963 Do not mark -j FIELD as obsolescent; it is longstanding
964 UNIX tradition and is a valid extension to POSIX.
966 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
968 2003-12-28 Paul Eggert <eggert@twinsun.com>
970 * src/join.c (add_field_list): Don't use alloca with unbounded
971 size; just modify the argument, which is no longer const *.
973 Various other minor cleanups, mostly to avoid the need for casts.
975 (extract_field): Renamed from ADD_FIELD, as it's now a function.
977 (struct field.beg): Now char *, not unsigned char const *. All
978 uses changed. It shouldn't be const since xmemcoll writes on its
980 (extract_field): Likewise, for 2nd arg.
981 (keycmp): Remove now-unnecessary cast of xmemcoll args.
983 (is_blank): New function, to avoid need to cast arg to unsigned char.
984 (extract_field): Use it.
986 (xfields): Rewrite pretty much from scratch.
988 (hard_LC_COLLATE): Now bool, not int.
989 (get_line, getseq, add_field_list): Now returns bool, not int.
990 (decode_field_spec, add_field_list): Return true on success (not
991 false), for consistency with the rest of the code. All uses changed.
993 (tab): Now char, not unsigned char. This wasn't 100% necessary
994 but is slightly cleaner.
995 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
997 (empty_filler): Now const *.
999 (make_blank): Remove; wasn't needed. Remove all calls.
1000 (main): Don't set uni_blank.nfields; zero is fine.
1002 2003-12-27 Jim Meyering <jim@meyering.net>
1004 * src/join.c: Include "quote.h".
1005 (min, max): Remove definitions.
1006 Make a few function parameters and corresponding
1007 locals `const'. Use bool for boolean variables.
1008 Use size_t (not int) for all counters and related index variables.
1009 (prjoin): Remove now-useless assertion.
1010 (string_to_join_field): New function.
1011 (main): Accept join fields as large as SIZE_MAX.
1012 (keycmp): Rename `min' to MIN and max to MAX.
1014 2003-12-26 Jim Meyering <jim@meyering.net>
1016 fold -s didn't work on e.g., alpha-based systems.
1017 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
1018 x2nrealloc works properly on systems with differing sizes for int
1019 and size_t. Reported by Nelson Beebe.
1021 * src/fold.c: Use `bool' (not int) as the type for a few
1024 2003-12-23 Paul Eggert <eggert@twinsun.com>
1026 * src/ls.c (length_of_file_names_and_frills):
1027 Remove forward decl; not needed.
1028 (print_file_name_and_frills, length_of_file_name_and_frills):
1029 With -m, don't output spaces before inum or size.
1030 (print_with_commas): Don't output space just before newline.
1032 2003-12-24 Jim Meyering <jim@meyering.net>
1034 * tests/ls/Makefile.am (TESTS): Add m-option.
1035 * tests/ls/m-option: New file. Test for above fixes.
1037 2003-12-20 Jim Meyering <jim@meyering.net>
1041 * src/pr.c: Change type of global, buff_allocated, to size_t.
1043 * src/join.c [struct seq]: Change types of members count and alloc
1044 from `int' to `size_t'.
1046 * tests/Makefile.am (root-hint): Tweak wording.
1048 * src/du.c: Accept new option (-0, --null) that makes it so each
1049 output line is NUL-terminated rather than newline-terminated.
1051 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
1052 Reported by Volker Paul.
1053 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
1054 * tests/dd/unblock-sync: New test for the above.
1056 2003-12-19 Jim Meyering <jim@meyering.net>
1058 * tests/misc/nohup: Double quote back-ticked expression,
1059 in case it ends up having an unexpected value.
1061 * tests/ls/no-arg: Use ls's -1 option in both runs.
1063 * src/du.c (fts_debug): New global.
1064 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
1065 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
1066 (main) [DU_DEBUG]: Accept -d option.
1068 2003-12-18 Jim Meyering <jim@meyering.net>
1070 * src/ls.c (format_user): Increment dired_pos via two statements,
1071 `dired_pos += width; dired_pos++;' rather than one,
1072 `dired_pos += width + 1;' since the latter could conceivably overflow.
1073 (format_group): Likewise.
1076 * configure.ac: Require automake-1.8.
1078 2003-12-12 Jim Meyering <jim@meyering.net>
1080 * Use automake-1.8. Regenerate dependent files.
1082 2003-12-08 Jim Meyering <jim@meyering.net>
1084 * Makefile.maint (news-date-check): New rule.
1085 (alpha beta major): Depend on it.
1087 2003-12-03 Paul Eggert <eggert@twinsun.com>
1089 * NEWS: ls -l (and similar options) now adjust all columns to
1090 fit the data. Generalized from a suggestion by Leah Q for file sizes.
1091 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
1092 (format_user_width, format_group_width, unsigned_file_size,
1093 format_group): New functions.
1094 (block_size_width): Renamed from block_size_size.
1095 (inode_number_width, nlink_width, owner_width, group_width,
1096 author_width, major_device_number_width, minor_device_number_width,
1097 file_size_width): New vars.
1098 (clear_files): Initialize them.
1099 (gobble_file): Set them. Don't ceiling block_size_width to 7.
1100 (print_long_file): Use them.
1101 (gobble_file): Use a new local variable 'f' to make the code
1102 smaller and more consistent with other functions.
1103 (format_user): Output to stdout, not to a buffer, so that we
1104 don't have to worry about buffer overrun. Update dired_pos.
1105 (print_long_file): Don't put owner, group, author into buffer;
1106 just print them directly. Don't assume link counts and
1107 major and minor numbers fit into unsigned long int.
1108 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
1109 'ls' output is fixed-width.
1111 2003-12-02 Jim Meyering <jim@meyering.net>
1113 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
1115 2003-11-27 Jim Meyering <jim@meyering.net>
1117 * Use automake-1.7f. Regenerate dependent files.
1119 2003-11-24 Paul Eggert <eggert@twinsun.com>
1121 Parse floating-point operands and options in the C locale.
1122 POSIX requires this for printf, and we might as well be
1123 consistent elsewhere (tail, sleep, seq).
1125 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
1126 needed now that we assume C89. Include "c-strtod.h".
1127 (xstrtod): Call c_strtod, not strtod.
1128 * src/sleep.c: Include "c-strtod.h".
1129 (main): Update xstrtod call to include new argument, c_strtod.
1130 * src/seq.c (scan_double_arg): Likewise.
1131 * src/tail.c (parse_options): Likewise.
1133 2003-11-24 Jim Meyering <jim@meyering.net>
1135 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
1136 Reported by Mark Conty.
1138 2003-11-22 Jim Meyering <jim@meyering.net>
1140 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
1141 (sc_system_h_headers): Do this test only if sys2.h exists.
1143 2003-11-20 Jim Meyering <jim@meyering.net>
1145 * tests/help-version: Ensure that the bug-reporting address is
1146 included in the --help output for every program.
1147 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
1149 * src/ptx.c (usage): Output bug-reporting address.
1150 Reported by Dan Jacobson.
1152 2003-11-19 Jim Meyering <jim@meyering.net>
1154 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
1155 on the join fields. Suggestion from Bruce Robertson.
1157 2003-11-18 Jim Meyering <jim@meyering.net>
1159 `od -c -w9999999' could segfault
1160 * src/od.c (dump): Use xnmalloc/free, not alloca.
1162 2003-11-16 Jim Meyering <jim@meyering.net>
1164 * Use autoconf-2.59. Regenerate dependent files.
1166 * tests/du/hard-link: Minor tweak: use mkdir -p.
1168 Fix read-from-free'd-buffer error detected by valgrind.
1169 * src/csplit.c (remove_line): Don't return a pointer to data in
1170 a freed buffer. Instead, arrange to free the buffer on the
1173 * tests/misc/csplit: New test for above fix.
1175 2003-11-11 Jim Meyering <jim@meyering.net>
1177 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
1178 This avoids a warning from valgrind about memcpy with overlapping
1179 source and destination.
1181 * configure.ac: Require automake-1.7.8.
1183 2003-11-09 Jim Meyering <jim@meyering.net>
1185 * Use automake-1.7.9. Regenerate dependent files.
1187 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
1188 * src/chown.c: Likewise.
1190 * src/chown-core.c: Include "root-dev-ino.h".
1191 (chopt_init): Initialize new member.
1192 (change_file_owner): Support rm's new --preserve-root option.
1194 * src/remove.c: Include "root-dev-ino.h".
1195 (remove_cwd_entries): Remove now-obsolete FIXME comment.
1196 (remove_dir): Support rm's new --preserve-root option.
1198 * src/chown.c: Include "root-dev-ino.h".
1199 Add new options: --preserve-root and --no-preserve-root.
1201 * src/chmod.c: Include "root-dev-ino.h".
1202 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
1203 ROOT_DEV_INO_WARN macros.
1204 (get_root_dev_ino): Remove function definition, now that it's
1205 been moved to a separate file.
1206 (usage): Describe new options.
1208 * src/mv.c (rm_option_init): Initialized new member.
1210 * src/remove.h: Include "dev-ino.h".
1211 (struct rm_options): Add new member: root_dev_ino.
1212 * src/chown-core.h: Include "dev-ino.h".
1213 (struct Chown_option): Add new member: root_dev_ino.
1215 2003-11-06 Jim Meyering <jim@meyering.net>
1217 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
1218 hard-coding `sizeof FILE*'.
1220 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
1222 * src/wc.c (main): Free `fstatus' so there is no confusion about
1223 whether it's leaked or not.
1224 * src/who.c (who): Likewise for `utmp_buf'.
1226 2003-11-05 Paul Eggert <eggert@twinsun.com>
1228 Fix 'cut' problems with size_t overflow and unsigned int.
1229 More generally, resize integer variables to fit use more precisely.
1230 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
1231 (struct range_pair): Make members to be of type size_t, not unsigned.
1232 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
1233 (suppress_non_delimited, output_delimiter_specified,
1234 have_read_stdin, print_kth, set_fields): Now bool, nt int.
1235 (delim): Now unsigned char, not int.
1236 (mark_printable_field, is_printable_field, is_range_start_index,
1237 set_fields, set_fields, cut_bytes, cut_fields):
1238 Use size_t, not unsigned, for field and byte counts.
1239 (hash_int): Use uintptr_t, not unsigned, for pointers converted
1240 to integers. This squeezes more info out of them.
1241 (set_fields, cut_bytes, cut_fields, main):
1242 Use bool, not int, for booleans.
1243 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
1245 2003-11-05 Paul Eggert <eggert@twinsun.com>
1247 * man/Makefile.am (check-programs-vs-x):
1248 Work even if $(programs) contains '$'.
1249 Work even if 'missing=1' in environment.
1250 Don't report an error simply because $(programs) outputs nothing.
1252 2003-11-05 Jim Meyering <jim@meyering.net>
1254 * Use autoconf-2.58. Regenerate dependent files.
1256 * src/tr.c (spec_init): Fix typo in last change.
1258 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
1259 call to variadic version_etc function, so that it works even on systems
1260 for which sizeof char* != sizeof int.
1261 * src/true.c (main): Likewise.
1262 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
1263 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
1264 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
1265 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
1266 Similarly, cast NULL to `(char *)' in call to variadic function,
1267 parse_long_options, so that it works even on systems for which
1268 sizeof char* != sizeof int.
1269 A similar problem was reported by Harti Brandt in
1270 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
1272 * src/users.c (users): Free `utmp_buf' explicitly so that people
1273 don't mistake this for a real leak.
1274 Patch by Dennis Smit <ds@nerds-incorporated.org.
1276 2003-11-04 Paul Eggert <eggert@twinsun.com>
1278 * README: Document _POSIX2_VERSION.
1280 2003-11-04 Jim Meyering <jim@meyering.net>
1282 * src/tac.c (memrchr): Remove #if-0'd function.
1283 (tac_stdin_to_mem): Clean up #if-0'd code.
1285 * src/od.c (decode_format_string): Remove unnecessary casts.
1286 Use more maintainable `sizeof *var'.
1287 (main): Call decode_format_string rather than decode_one_format,
1288 now that `spec' may be NULL.
1290 * src/chmod.c (AUTHORS): Add my name.
1292 * src/split.c (next_file_name): Use `sizeof *var' rather than
1293 hard-coding `sizeof size_t'.
1295 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
1297 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
1298 to avoid potential overflow in pointer arithmetic.
1299 (set_fields): Use not `1', but rather `sizeof *printable_field' as
1300 second argument to xcalloc.
1301 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
1302 rather than xrealloc.
1303 * src/date.c (show_date): Likewise.
1304 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
1305 * src/pr.c (store_char): Likewise.
1306 * src/fold.c (fold_file): Likewise.
1308 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
1309 type changes (unsigned int -> size_t) in hash.c.
1310 * src/cp-hash.c (src_to_dest_hash): Likewise.
1311 * src/du.c (entry_hash): Likewise.
1312 * src/ls.c (dev_ino_hash): Likewise.
1313 * src/cut.c (hash_int): Likewise. Declare function as static.
1315 2003-11-03 Jim Meyering <jim@meyering.net>
1317 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
1318 * tests/misc/fold: Fail the test immediately if we're not running
1319 the expected version of fold.
1321 2003-11-02 Jim Meyering <jim@meyering.net>
1323 * src/tr.c (append_normal_char, append_range, append_char_class)
1324 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
1325 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
1326 and usually shorter.
1327 * src/copy.c (copy_internal): Likewise.
1328 * src/join.c (initseq, add_field, make_blank): Likewise.
1329 * src/od.c (main): Likewise.
1330 * src/cp.c (make_path_private): Likewise.
1331 * src/tsort.c (new_item, record_relation): Likewise.
1333 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
1334 (main): Also remove anachronistic cast of xmalloc return value.
1335 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
1336 (main): Also remove anachronistic cast of xmalloc return value.
1337 * src/sort.c (inittables): Likewise.
1338 (sort): Also Split a long line.
1340 2003-10-25 Jim Meyering <jim@meyering.net>
1342 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
1343 type changes (unsigned int -> size_t) in hash.c.
1344 * src/cp-hash.c (src_to_dest_hash): Likewise.
1345 * src/du.c (entry_hash): Likewise.
1346 * src/ls.c (dev_ino_hash): Likewise.
1347 * src/cut.c (hash_int): Likewise. Declare function as static.
1349 2003-10-21 Jim Meyering <jim@meyering.net>
1351 Don't fail when run with VERBOSE=yes.
1352 * tests/chgrp/basic: Do `set +x' before starting the subshell
1353 from which we invoke chgrp. Otherwise, the output from the
1354 VERBOSE=yes-induced `set -x' would result in spurious differences.
1355 Reported by Russel Coker via Michael Stone.
1357 2003-10-19 Jim Meyering <jim@meyering.net>
1359 chmod now uses fts to perform a directory traversal when -R is
1360 specified. Before, it operated on full path names, and as such
1361 would encounter the PATH_MAX (often 4096) limit.
1363 * src/chmod.c: Include "xfts.h".
1364 (process_file): Rename from change_file_mode.
1365 Adapt to be used with fts.
1366 (process_files): New function.
1368 2003-10-18 Jim Meyering <jim@meyering.net>
1370 * tests/du/deref-args: Ensure that du -D now dereferences all
1371 symlinks specified on the command line, not just those that
1372 reference directories.
1374 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1375 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1376 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1377 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1378 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1379 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1380 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1381 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
1382 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
1383 Update the call to parse_long_options so that `AUTHORS, NULL' are the
1385 * src/true.c (main): Append NULL to version_etc argument list.
1386 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1388 2003-10-17 Andreas Schwab <schwab@suse.de>
1390 * tests/mk-script: Get $srcdir from first parameter instead of
1392 (main): Update usage.
1394 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
1395 first argument of mk-script.
1396 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
1398 2003-10-17 Jim Meyering <jim@meyering.net>
1400 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
1401 generated `man' page is more readable. Suggestion from Dan Jacobson.
1403 * src/chown-core.c (change_file_owner): Handle the cases in
1404 which fts_info indicates an error with the given entry.
1406 * src/du.c (main): Simply assign to bit_flags.
1407 Don't bother with bit arithmetic.
1409 * tests/chmod/no-x: New file.
1410 * tests/chgrp/no-x: New file.
1411 * tests/chmod/Makefile.am (TESTS): Add no-x.
1412 * tests/chgrp/Makefile.am (TESTS): Likewise.
1414 * src/du.c: Include "xfts.h".
1415 (du_files): Use xfts_open, rather than fts_open.
1416 * src/chown-core.c (chown_files): Likewise.
1418 2003-10-16 Jim Meyering <jim@meyering.net>
1420 * src/chgrp.c (main): Simply assign to bit_flags.
1421 Don't bother with bit arithmetic.
1422 * src/chown.c (main): Likewise.
1423 Rename a couple of local variables.
1424 Remove unnecessary casts.
1426 * src/tail.c (start_bytes): Rename local, remainder, to avoid
1427 gcc's warning about shadowing a global.
1429 2003-10-15 Jim Meyering <jim@meyering.net>
1431 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
1432 use fts to perform a directory traversal when -R is specified.
1433 Before, they operated on full path names, and as such would
1434 encounter the PATH_MAX (often 4096) limit.
1435 They are more efficient. For example, before, chgrp -R would
1436 take almost 5 seconds to change about 2000 directories and fail
1437 (with `File name too long'), while now it succeeds on a hierarchy
1438 of depth 20,000 in 1/10 the time.
1440 * src/chown.c: Include "userspec.h" and "fts_.h".
1441 (WRITTEN_BY): Add my name.
1442 (getpwnam, getgrnam, getgrgid): Remove declarations.
1443 (endpwent): Remove definition.
1445 (main): Handle new options.
1446 Call new function, chown_files rather than change_file_owner.
1448 * src/chgrp.c: Include "fts_.h".
1449 (WRITTEN_BY): Add my name.
1450 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
1453 (main): Handle new options.
1454 Call new function, chown_files rather than change_file_owner.
1456 Rewrite to iterate through hierarchies using fts rather than
1457 via explicit recursion.
1458 * src/chown-core.c: Include "fts_.h"
1459 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
1460 on a single file at a time.
1461 (chown_files): New function.
1462 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
1463 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
1464 [struct Chown_option] (dereference): Remove member with ambiguous name.
1465 [struct Chown_option] (affect_symlink_referent): New member.
1466 (chown_files): New prototype.
1468 * tests/chgrp/recurse: Update tests accordingly.
1469 * tests/chgrp/posix-H: New tests for the above.
1470 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
1472 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
1473 work even for superuser. Suggestion from Dan Jacobson.
1475 2003-10-14 Paul Eggert <eggert@twinsun.com>
1477 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1479 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1480 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1481 * src/sort.c (parse_field_count): Handle the case where overflow
1482 and invalid suffix char are both reported.
1484 2003-10-14 Jim Meyering <jim@meyering.net>
1486 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1487 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1490 2003-10-13 Paul Eggert <eggert@twinsun.com>
1492 Fix to avoid a denial-of-service attack if the display width is
1493 enormous. Also, clean up the code a bit by removing duplicate code.
1495 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1496 (calculate_columns): New function, that contains code that used
1497 to be common to print_many_per_line and print_horizontal.
1498 (print_many_per_line, print_horizontal): Use it.
1499 (decode_switches): Set max_idx here, not in calculate_columns.
1500 (print_current_files): Don't call init_column_info; calculate_columns
1502 (init_column_info): Don't allocate a lot more space than is needed
1503 to represent the current set of files. Allocate all the new
1504 size_t cells in one call to xnmalloc, rather than a row at a time.
1506 2003-10-13 Jim Meyering <jim@meyering.net>
1508 * src/ls.c (init_column_info): Add another FIXME comment.
1510 2003-10-13 Paul Eggert <eggert@twinsun.com>
1512 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1513 Remove several arbitrary limits on hosts where int cannot represent
1516 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1517 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1518 struct column_info.col_arr[0], max_idx):
1519 Now size_t, not int.
1520 (get_funky_string): Return bool indicating success, instead of
1521 a negative count to indicate failure. Store number of columns
1522 through new parameter OUTPUT_COUNT; that way, they can never
1523 go negative. Change equals_end from int to bool. All uses
1525 (struct column_info.valid_len): Now bool, not int. All uses changed.
1526 (dired_dump_obstack, get_funky_string, clear_files,
1527 extract_dirs_from_files, print_current_files,
1528 print_many_per_line, print_horizontal, init_column_info,
1529 put_indicator, length_of_file_name_and_frills,
1530 print_with_commas): Use size_t, not int, for local variables
1532 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1533 Check for TIOCGWINSZ returing negative values (or values greater
1535 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1537 Use xmalloc and xnmalloc, not XMALLOC.
1538 (gobble_file): Use xnrealloc, not XREALLOC.
1539 (print_color_indicator): Remove now-unnecessary cast to size_t.
1541 2003-10-12 Paul Eggert <eggert@twinsun.com>
1543 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1544 * tests/sort/sort-tests: Remove from CVS; assume that people
1545 brave enough to check coreutils out from CVS can rebuild it.
1547 2003-10-12 Jim Meyering <jim@meyering.net>
1549 New options: --preserve-root and --no-preserve-root.
1550 * src/chmod.c (change_file_mode): Honor new option.
1551 (change_file_mode): Strip trailing slashes on directory
1552 argument passed to change_dir_mode.
1553 (get_root_dev_ino): New function.
1554 (main): Initialize global, root_dev_ino.
1556 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1557 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
1559 * src/chmod.c (change_file_mode): Likewise.
1561 2003-10-08 Jim Meyering <jim@meyering.net>
1563 * src/csplit.c (main): Remove obsolete FIXME.
1565 2003-10-07 Jim Meyering <jim@meyering.net>
1567 * Use automake-1.7.8. Regenerate dependent files.
1569 2003-09-29 Paul Eggert <eggert@twinsun.com>
1573 * doc/coreutils.texi (csplit invocation):
1574 The regexp offset need not have a sign; POSIX requires support
1575 for signless offets.
1577 Be more careful about int widths. For example, remove some
1578 arbitrary limits by replacing 'unsigned' with 'size_t',
1579 'uintmax_t', etc. Use standard bool rather than a homegrown type.
1580 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1581 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
1582 to <stdbool.h> usage.
1583 (struct control): offset is now intmax_t, not int.
1584 repeat_forever is now bool, not int.
1585 (struct cstring): len is now size_t, not unsigned int.
1586 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1587 size_t, not unsigned. start_line, first_available are now
1588 uintmax_t, not unsigned.
1589 (hold_count, control_used): Now size_t, not unsigned.
1590 (last_line_number, current_line, bytes_written):
1591 Now uintmax_t, not unsigned.
1592 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1593 create_new_buffer, get_new_buffer, load_buffer, find_line,
1594 process_regexp, split_file, new_control_record, extract_regexp,
1595 get_format_width, get_format_prec, max_out):
1596 size args, locals, and returned values are now size_t, not unsigned
1598 (get_first_line_in_buffer, find_line, write_to_file,
1599 handle_line_error, process_line_count, regexp_error, process_regexp,
1601 File line, byte, and repetition counts are now uintmax_t, not unsigned.
1602 (check_for_offset): Don't require a sign before the offset.
1603 Use xstrtoimax to do the real work.
1604 (extract_regexp): Remove harmful cast of size to unsigned.
1605 256 -> 1<<CHAR_BIT, for clarity.
1606 (get_format_flags): Return at most 3, to avoid worries about overflow.
1608 (bytes_to_octal_digits): Remove.
1610 (cleanup): Don't check whether output_stream is NULL, since
1611 close_output_file does that for us.
1613 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1614 (sizeof *p);" instead of the more long-winded alternatives.
1616 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1617 to a much larger size, instead of an O(N) algorithm.
1619 (process_regexp): Use plain NULL rather than casted 0.
1621 (make_filename): Use %u, not %d, to format unsigned file number.
1623 (new_control_record): Use xrealloc exclusively, since it handles
1626 (extract_regexp): Change misspelled word in diagnostic.
1628 (get_format_width): Even if a minimum field width is specified,
1629 allow room for enough octal digits to represent the value of
1630 the maximum representible integer. This fixes a potential
1631 buffer overrun. Calculate this room at compile-time, not
1632 at run-time; this removes the need for bytes_to_octal_digits.
1633 Check for overflow; this removes a FIXME.
1635 (get_format_prec): Don't allow precision to be signed; it's
1636 not ANSI. Check for overflow. Remove hardcoded "11" as
1637 default precision; this fixes a potential buffer overrun
1638 on hosts with wider size_t.
1640 (get_format_conv_type): Change local variable to be of type
1641 unsigned char, not int; this removes a potential subscript
1642 violation on hosts where char is signed.
1644 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1645 Allow "%%" in format. Don't overflow when
1646 counting lots of percents.
1648 (usage): Default sprintf format is %02u, not %d.
1650 2003-10-05 Jim Meyering <jim@meyering.net>
1652 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1654 * src/du.c (du_files): Mark diagnostic for translation.
1656 2003-10-04 Jim Meyering <jim@meyering.net>
1658 * src/du.c (du_files): Ignore any failure of fts_close.
1659 Give better diagnostics for failed fts_open.
1661 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1663 Deprecate existing use of -H (aka --si).
1664 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1665 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1666 (main): Warn that the meaning of -H will soon change to be
1669 2003-10-03 Jim Meyering <jim@meyering.net>
1671 * src/du.c: Accept --no-dereference (-P).
1673 2003-10-02 Jim Meyering <jim@meyering.net>
1675 * tests/du/trailing-slash: Adjust for slightly different output.
1677 Rewrite du.c to use fts.
1678 * src/du.c: Include "fts_.h", not ftw.h.
1679 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1680 (IS_FTW_DIR_TYPE): Remove definition.
1681 (IS_DIR_TYPE): Define.
1682 (is_symlink_to_dir): Remove now-unnecessary function.
1683 (process_file, du_files): Rewrite to use fts.
1685 * tests/du/inaccessible-cwd: Ensure that even when run from an
1686 inaccessible directory, du can still operate on accessible
1687 directories elsewhere.
1688 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1690 * tests/rm/deep-1: Ensure that du can process a hierarchy
1691 of depth 400 while using no more than 50KB of stack space.
1693 2003-10-01 Akim Demaille <akim@epita.fr>
1695 * announce-gen (print_news_deltas): New function, extracted from main.
1696 (main): Make `news_file' an array.
1697 Use '...=s' => \@var for --news and --url-directory specs.
1698 Before there were a couple of portability problems.
1700 2003-09-28 Jim Meyering <jim@meyering.net>
1702 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1703 (syntax-check-rules): Add it.
1705 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1706 guaranteed to be (void *).
1707 * src/cp.c: Likewise.
1708 * src/join.c: Likewise.
1709 * src/ln.c: Likewise.
1710 * src/ls.c: Likewise.
1711 * src/od.c: Likewise.
1712 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1714 2003-09-27 Jim Meyering <jim@meyering.net>
1716 Don't exhaust virtual memory when processing large inputs.
1717 Fix this by removing csplit's internal free-list management;
1718 instead rely on malloc for that.
1720 * src/csplit.c (free_list): Remove global.
1721 (clear_all_line_control): Remove function.
1722 (get_new_buffer): Always use create_new_buffer to obtain a
1723 new buffer, rather than searching free_list.
1724 (free_buffer): Just call free.
1725 Reported by Nikola Milutinovic.
1727 2003-09-26 Jim Meyering <jim@meyering.net>
1729 * man/rm.x: Also list `chattr' in SEE ALSO section.
1730 Suggestion from Mark Hubbart.
1732 2003-09-25 Jim Meyering <jim@meyering.net>
1734 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1735 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1737 * Use autoconf-2.57d. Regenerate dependent files.
1739 2003-09-24 Jim Meyering <jim@meyering.net>
1741 Minor efficiency tweak.
1742 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1743 (do_link): Likewise.
1745 2003-09-23 Jim Meyering <jim@meyering.net>
1747 * src/paste.c (paste_serial): Save errno after input error,
1748 to report proper errno value.
1749 Based on a patch from Paul Eggert.
1751 * src/tee.c (tee): Adjust fwrite arguments so that the return
1752 value is the number of bytes written.
1754 2003-09-16 Paul Eggert <eggert@twinsun.com>
1756 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1758 * src/comm.c (compare_files): Save errno after input error,
1759 to report proper errno value.
1760 * src/fold.c (fold_file): Likewise.
1761 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1762 * src/unexpand.c (unexpand): Likewise.
1764 * src/csplit.c (close_output_file): Don't report bogus errno value
1765 after ferror discovers an output error. We don't know the proper
1766 errno value, since it might have been caused by any of a whole
1767 bunch of calls, and it might have been trashed in the meantime.
1768 Fixing this problem will require much more extensive changes;
1769 in the meantime just say "write error".
1770 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1771 * src/uniq.c (check_file): Likewise.
1773 * src/join.c (get_line): Report error right away if I/O fails,
1774 so that the proper errno value is used.
1775 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1776 * src/tee.c (tee): Likewise.
1777 * src/uniq.c (check_file): Likewise.
1779 * src/od.c (skip): If a read fails, don't retry it later, so
1780 that we report the proper errno.
1782 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1784 * src/tee.c (tee): Once a write failure has occurred, don't bother
1785 writing anything more to that stream.
1787 * src/uniq.c (check_file): Check for ferror (stdout) even if
1790 * src/yes.c (UNROLL): Remove.
1791 (main): Exit immediately when write failure is detected.
1792 Simplify code by assigning to argv when argc == 1.
1794 2003-09-21 Paul Eggert <eggert@twinsun.com>
1796 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1797 (WRITTEN_BY): Change "Franc,ois" (actually using
1798 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1801 2003-09-19 Jim Meyering <jim@meyering.net>
1803 `du -D symlink-to-dir' would mistakenly omit the slash in
1804 lines like this: 24 symlink-to-dir/subdir
1805 * src/du.c (process_file): Fix offset calculation.
1806 Reported by Jeff Sheinberg as Debian bug #211591;
1807 http://bugs.debian.org/205251
1809 * tests/du/deref-args: New file/test for the above.
1810 * tests/du/Makefile.am (TESTS): Add deref-args.
1812 * src/du.c (process_file): Remove useless disjunct.
1814 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1816 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1817 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1818 Mark each WRITTEN_BY string as translatable.
1820 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1821 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1822 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1823 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1824 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1825 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1826 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1827 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1828 Instead, a subsequent change will embed `Written by ' in
1829 each string along with the author names.
1831 * src/true.c: Revert yesterday's changes.
1832 * src/sys2.h: Likewise.
1834 2003-09-18 Jim Meyering <jim@meyering.net>
1836 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1837 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1838 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1839 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1840 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1841 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1842 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1843 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1844 comma-separated list of strings and/or update the call to
1845 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1846 * src/true.c (main): Append NULL to version_etc argument list.
1847 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1849 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1850 shadowing the math function name. Also rename loga to log_a.
1852 2003-09-14 Jim Meyering <jim@meyering.net>
1854 * src/factor.c (print_factors): Give a separate diagnostic
1855 for numbers that are too large, but otherwise valid.
1856 Reported by Dániel Varga.
1858 2003-09-10 Jim Meyering <jim@meyering.net>
1860 * Use automake-1.7.7. Regenerate dependent files.
1862 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1863 of `fmt -1'. Using the just-built tr is a little cleaner.
1864 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1865 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1867 2003-09-09 Jim Meyering <jim@meyering.net>
1869 * src/copy.c: Alphabetize includes.
1870 Remove duplicate inclusion of "same.h".
1872 2003-09-08 Jim Meyering <jim@meyering.net>
1874 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1875 Didn't give enough of a benefit, mainly because it's not yet
1880 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1881 (check-programs-vs-x): Fail if $(programs) is empty.
1883 * src/remove.c: Add a comment.
1885 2003-09-07 Jim Meyering <jim@meyering.net>
1887 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1888 Don't define. These symbols are no longer used.
1890 * tests/misc/tty-eof: Write ^D as \cD.
1891 Complete the change of 2003-08-02.
1893 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1894 file in lib/ or src/ doesn't induce an unwarranted failure.
1895 Add a kludge to filter out the sole generated source file that
1896 also has translatable messages: src/false.c.
1898 2003-09-06 Jim Meyering <jim@meyering.net>
1900 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1901 (parse_options): Give a diagnostic for (but still accept) the
1902 deprecated --allow-missing option.
1904 2003-09-04 Paul Eggert <eggert@twinsun.com>
1906 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1907 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1909 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1910 size_bound ourselves. if an input file is a pipe and the user
1911 specified a size, use that size instead of trying to guess the
1912 pipe size. This has the beneficial side effect of avoiding the
1913 overhead of default_sort_size in that case. All callers changed.
1914 (sort): Remove static var size; now done by sort_buffer_size.
1916 2003-09-05 Jim Meyering <jim@meyering.net>
1918 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1920 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1921 to start, rather than just .1. Upon failure, print unexpected state.
1923 2003-09-04 Paul Eggert <eggert@twinsun.com>
1925 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1926 SAFE_READ_ERROR to tmp->nbytes.
1927 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1929 * src/head.c (struct linebuffer): Change nbytes and nlines
1930 from unsigned int to size_t. unsigned int is safe (after the
1931 2003-09-03 patch) but size_t is cleaner.
1932 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1933 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1935 Standardize on BUFSIZ as opposed to other macro names and values.
1936 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1937 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1938 stdio.h has always defined it,
1939 and other code already assumes it's defined.
1940 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1941 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1942 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1944 2003-09-04 Paul Eggert <eggert@twinsun.com>
1946 * src/seq.c (step): Default to 1.
1947 (print_numbers): Allow the output to be empty.
1948 (main): The default step is 1, even if LAST < FIRST;
1949 as per documentation.
1950 * tests/seq/basic (onearg-2): Output should be empty.
1952 2003-09-05 Jim Meyering <jim@meyering.net>
1954 * Makefile.cfg (wget_files): Temporarily disable, until master
1955 versions are restored to ftp.gnu.org.
1957 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1959 Make seq's --width (-w) option work properly even when the
1960 endpoint requiring the larger width is negative and smaller than
1962 * src/seq.c (get_width_format): Include `-' in the set of bytes
1963 allowed in a `simple' number (no decimal point, no exponent).
1964 Reported by Patrick Mauritz.
1966 2003-09-02 Paul Eggert <eggert@twinsun.com>
1968 * NEWS: sort -t '\0' now uses a NUL tab.
1969 sort option order no longer matters, unless POSIX requires it.
1970 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1971 Similar fixes for many comments.
1972 (TAB_DEFAULT): New constant, so that we can support NUL as
1973 the field separator.
1974 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1975 (specify_sort_size): If multiple sizes are specified, use the largest.
1976 (begfield, limfield): Support NUL tab char.
1977 (set_ordering): Do not let -i override -d.
1978 (main): Report an error if incompatible -o or -t options are given.
1979 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1981 2003-09-05 Jim Meyering <jim@meyering.net>
1983 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1985 2003-09-03 Andreas Schwab <schwab@suse.de>
1987 Bug report and patch here:
1988 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1989 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1990 * src/head.c (elide_tail_lines_pipe): Likewise.
1992 2003-09-03 Jim Meyering <jim@meyering.net>
1994 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1995 small amount of code from him was first moved to lib/human.c, and was
1996 subsequently rewritten entirely.
1997 * src/df.c (AUTHORS): Likewise.
1999 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
2001 * src/md5sum.c (split_3): Accept the BSD format for generic
2002 message digest modes. Currently works with BSD's MD5 and SHA1
2003 formats since these are the two algorithms presently used in
2004 coreutils. Updated comments to reflect this change.
2005 (bsd_split_3): Updated comments.
2007 * tests/md5sum/basic-1: New test to make sure that
2008 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
2009 from `check-bsd' test in tests/sha1sum/basic-1).
2011 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
2012 --check exit status and BSD SHA1 format (adapted from tests
2013 in tests/md5sum/basic-1).
2015 2003-08-30 Jim Meyering <jim@meyering.net>
2017 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
2019 When source and destination arguments refer to the same file, reside
2020 on a partition (e.g. VFAT) on which distinct names may refer to the
2021 same directory entry (often due to variations in case), and when the
2022 link count for the file is 1, mv no longer unlinks the file. Instead,
2023 it gives the expected diagnostic that the source and destination are
2024 the same. WARNING: this is an incomplete fix. If the file happens
2025 to have a link count of 2 or greater, such an erroneous mv command
2026 will still unlink it.
2027 Although that is not possible on vfat or umsdos, it is possible on
2028 other file system types, e.g., ntfs, and hpfs.
2029 * src/copy.c (same_file_ok): Invoke same_name (which might still
2030 return false for names that refer to the same directory entry)
2031 only if the link count is 2 or more.
2032 * tests/mv/vfat: Show how to demonstrate the above problem.
2033 This test is not run.
2034 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
2036 2003-08-27 Jim Meyering <jim@meyering.net>
2038 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
2039 who's -l option has been eliciting an unconditional warning about
2040 this impending change since sh-utils-2.0.12 (April 2002).
2042 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
2043 This would happen for nonempty files not ending with a newline.
2044 Reported by Dan Jacobson.
2045 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
2046 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
2048 * src/stat.c (print_it): Avoid buffer overrun that would
2049 occur when the user-specified format string ends with `%'.
2050 Patch by Tommi Kyntola.
2051 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
2052 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
2054 2003-08-26 Jim Meyering <jim@meyering.net>
2056 Apply changes from bison.
2057 * GNUmakefile (SHELL): Define to `sh', if necessary.
2059 * Makefile.maint (WGETFLAGS): Define to `-C off'.
2060 Update all uses of $(WGET).
2062 2003-08-22 Akim Demaille <akim@epita.fr>
2064 * Makefile.cfg (local-checks-to-skip): New.
2065 * Makefile.maint (local-check): Rename as...
2066 (local-checks-available): this.
2069 2003-08-26 Akim Demaille <akim@epita.fr>
2071 * announce-gen (print_changelog_deltas): Neutralize "<#" as
2072 "<\#" to avoid magic from Gnus when posting parts of this script.
2074 2003-08-25 Jim Meyering <jim@meyering.net>
2076 * src/stat.c (main): Warn about use of deprecated `-l' option.
2078 2003-08-22 Jim Meyering <jim@meyering.net>
2080 * src/stat.c (do_stat): For link count at end of line, use %h format,
2081 instead of %-5h. The latter would make stat emit trailing spaces.
2082 Reported by Dan Jacobson.
2084 2003-08-20 Jim Meyering <jim@meyering.net>
2086 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
2088 2003-08-19 Jim Meyering <jim@meyering.net>
2090 * src/system.h: Include stdlib.h unconditionally,
2091 as we're now assuming that part of hosted C89.
2093 2003-08-18 Jim Meyering <jim@meyering.net>
2095 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
2096 to avoid warnings from gcc.
2098 2003-08-17 Jim Meyering <jim@meyering.net>
2100 Avoid unnecessary and sometimes time-consuming hostname lookups.
2101 * src/who.c (print_user): Use strchr, not strrchr.
2102 * src/pinky.c (print_entry): Likewise.
2103 Patch by Michael Stone.
2104 This fixes a typo I introduced in who-users.c on 1996-02-23.
2106 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
2107 disallowed between `@...@'.
2109 2003-08-16 Paul Eggert <eggert@twinsun.com>
2111 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
2112 done by gnulib .m4 files.
2113 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
2114 * src/sys2.h (strtoull): Remove unused declaration.
2116 2003-08-16 Jim Meyering <jim@meyering.net>
2118 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
2121 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
2122 race condition bug. The bug would be triggered when tailing a file
2123 with file pointer not at beginning of file, and where the file was
2124 truncated to have a length of less than the initial offset at just
2125 the right moment (between the two lseek calls in this function).
2127 An invalid initial value for *read_pos would result in
2128 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
2129 busy-wait rather than sleeping between iterations. The bug manifests
2130 itself only when tailing regular files that are initially nonempty.
2131 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
2133 (tail_lines): Likewise, after lseek calls.
2134 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
2135 * tests/tail-2/tail-n0f: New file. Test for above fix.
2136 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
2138 2003-08-15 Jim Meyering <jim@meyering.net>
2140 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
2141 (sc_sun_os_names): Likewise.
2142 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
2144 * man/help2man: Remove some SPACEs before TAB.
2146 2003-08-14 Paul Eggert <eggert@twinsun.com>
2148 * Makefile.maint (LC_ALL): Set to C.
2149 * man/Makefile.am (ASSORT): New var.
2150 (check-x-vs-1, programs): Use it.
2151 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
2152 * tests/Makefile.am (ASSORT, all_programs): Likewise.
2154 2003-08-11 Jim Meyering <jim@meyering.net>
2156 fold -s -wN would infloop for N < 8 with TABs in the input.
2157 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
2158 * src/fold.c (fold_file): Move contents of `else'-block
2159 out of conditional so it's used also for --spaces (-s).
2160 * tests/misc/fold: Test for the above fix.
2161 * tests/misc/Makefile.am (TESTS): Add fold.
2163 2003-08-10 Jim Meyering <jim@meyering.net>
2165 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
2166 system.h so the types from time.h and sys/time.h are available.
2167 It appears that this is necessary for OpenBSD, NetBSD, and
2168 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
2170 2003-08-06 Paul Eggert <eggert@twinsun.com>
2172 * NEWS: Add support for setting file timestamps to microsecond
2173 resolution, on hosts that support this.
2174 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
2175 * src/copy.c (copy_internal):
2176 Set file timestamps with utimens, not utime.
2177 * src/cp.c (re_protect): Likewise.
2178 * src/install.c (change_timestamps): Likewise.
2179 * src/touch.c (newtime, touch, main): Likewise.
2181 2003-08-09 Jim Meyering <jim@meyering.net>
2183 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
2185 (syntax-check-rules): Add it.
2187 * src/tail.c (main): Tweak Solaris OS version number in comment.
2188 * src/wc.c (wc): Likewise
2189 * tests/tail-2/fflush: Likewise.
2191 * src/tail.c: Add new undocumented option, --presume-input-pipe.
2192 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
2194 2003-08-08 Paul Eggert <eggert@twinsun.com>
2196 Use new gnulib 'extensions' module.
2197 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
2200 2003-08-08 Paul Eggert <eggert@twinsun.com>
2202 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
2204 2003-08-09 Jim Meyering <jim@meyering.net>
2206 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
2207 For tests of obsolete behavior, don't presume that unsetting
2208 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
2210 2003-08-07 Paul Eggert <eggert@twinsun.com>
2212 * doc/coreutils.texi (split invocation):
2213 Add -d or --numeric-suffixes option to 'split'.
2214 From a suggestion by Jesse Kornblum.
2215 * src/split.c (suffix_alphabet): New var.
2216 (longopts, usage, next_file_name, main): Support -d.
2217 (next_file_name, main): Allow -a0, as POSIX requires.
2218 (next_file_name): Don't assume ASCII-like encoding;
2219 'a' through 'z' are not contiguous in EBCDIC.
2221 2003-08-05 Paul Eggert <eggert@twinsun.com>
2223 Merge getline from gnulib.
2224 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
2225 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
2226 New files, from gnulib.
2227 * lib/getdelim2.c, lib/getdelim2.h: Remove.
2228 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
2229 getdelim2.h to getndelim2.c and getndelim2.h.
2230 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
2231 checking for getdelim.
2232 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
2233 than rolling our own.
2234 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
2235 (cut_fields): Invoke getndelim2 rather than getdelim2.
2237 2003-08-04 Jim Meyering <jim@meyering.net>
2239 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
2240 and for the indices to iterate through nsigs.
2242 2003-08-02 Paul Eggert <eggert@twinsun.com>
2244 * src/sort.c: Minor code cleanups, mostly to use more accurate
2245 types and to remove unnecessary casts.
2246 (min, max): Remove. All uses changed to MIN and MAX.
2247 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
2248 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
2249 keyfield.numeric, struct keyfield.general_numeric, struct
2250 keyfield.month, struct keyfield.reverse, reverse, unique,
2251 have_read_stdin): Now bool, not int. All uses changed.
2252 (eolchar): Now char, not int.
2253 (struct keyfield.ignore): Now bool const *, not int *.
2254 (struct keyfield.translate): Now char const *, not char *.
2255 (struct month.name): Likewise.
2256 (blanks, nonprinting, nondictionary): Now bool[], not int[].
2257 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
2258 check, sort, main): Use const * pointers when possible.
2259 (month_cmp): Rewrite to avoid casts.
2260 (inittables): Initialize tables unconditionally, to avoid branches.
2261 (fillbuf): Return bool, not int. All uses changed.
2262 (fillbuf, keycompare, new_key, main):
2263 Use SIZE_MAX rather than (size_t) -1.
2264 (trailing_blanks): Renamed from trim_trailing_blanks.
2265 Return the number of blanks to trim. All uses changed.
2266 (getmonth): Use trailing_blanks rather than open code.
2267 (keycompare): Do not cast char * to unsigned char *; not needed.
2268 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
2270 (compare, main): Use | rather than || to avoid jumps.
2271 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
2273 (check, first_same_file, sort, main):
2274 Use bool instead of int local vars when possible.
2275 (check): Merge the old 'checkfp' and 'check' into a single function,
2276 that returns a boolean (true if the file was ordered).
2278 (main): Use int instead of unsigned for iterating through nsigs.
2279 Rename local var "posix_pedantic" to "posixly_correct".
2281 2003-08-02 Jim Meyering <jim@meyering.net>
2283 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
2284 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
2286 * src/cut.c (cut_fields): Don't read again after encountering an
2287 initial EOF. E.g., `cut -f2' would do so.
2288 * tests/misc/tty-eof: Add a test for the above fix.
2290 * src/sort.c (sortlines): Add description and references.
2293 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
2294 the tests in help-version will use the just-built binaries.
2295 Reported by Christian Krackowizer.
2297 2003-07-31 Paul Eggert <eggert@twinsun.com>
2299 * NEWS: Add --rfc-2822 option to GNU date.
2300 * doc/coreutils.texi (Time directives, Options for date, Examples
2302 * src/date.c (long_options, usage, main): Likewise.
2303 * doc/getdate.texi (General date syntax): Likewise.
2304 * doc/coreutils.texi (Options for date): Fix a typo in format:
2305 it's now %d not %_d. Add URLs.
2307 2003-08-01 Jim Meyering <jim@meyering.net>
2309 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
2310 Otherwise, with at least the /bin/sh from HPUX 10.20,
2311 the trap code would end up converting that to exit 1 and thus an
2312 unexpected test failure. Reported by Christian Krackowizer.
2314 2003-07-31 Paul Eggert <eggert@twinsun.com>
2316 * src/ptx.c: Do not include bumpalloc.h.
2317 (WORD_TABLE): New member alloc.
2318 (ALLOC_NEW_WORD): Remove.
2319 (occurs_alloc): New var.
2320 (digest_word_file, find_occurs_in_text): Check for arithmetic
2321 overflow when computing table size. Use xrealloc rather than
2322 bumpalloc primitives.
2324 2003-07-29 Jim Meyering <jim@meyering.net>
2328 * README: When running tests as root, suggest using
2329 sudo with NON_ROOT_USERNAME=$USER.
2331 * tests/Makefile.am (all_programs): Makefile is in ../src, not
2334 2003-07-28 Jim Meyering <jim@meyering.net>
2336 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
2338 2003-07-28 Paul Eggert <eggert@twinsun.com>
2340 * lib/stdbool.hin (_Bool): Make it signed char, instead of
2341 an enum type, so that it's guaranteed to promote to int.
2342 * src/sort.c (sortlines_temp): Undo previous change.
2344 2003-07-28 Jim Meyering <jim@meyering.net>
2346 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
2347 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
2348 would cause lines[-1 - swap] (with swap = false) to evaluate to
2351 2003-07-27 Jim Meyering <jim@meyering.net>
2353 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
2354 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
2356 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
2357 directories, as required by POSIX. Reported by Karl Berry.
2358 * tests/rm/dir-no-w: New file. Test for the above fix.
2359 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
2361 * tests/mk-script: Emit `$xx', not its expansion.
2363 2003-07-27 Paul Eggert <eggert@twinsun.com>
2365 This change was inspired by a similar proposal by Stepan Kasal.
2366 * src/sort.c (mergelines, sortlines_temp): New functions.
2367 (sortlines): Use them, to reduce the number of times that
2368 we need to copy 'struct line' values. This improved CPU
2369 performance by about 30% on one 18 MB test.
2370 (sort): Don't invoke sortlines unless we have 2 or more lines.
2372 2003-07-26 Stepan Kasal <kasal@ucw.cz>
2374 * src/sort.c (sort): Don't require two `struct line's per text line,
2375 the new sort algorithm requires just 1.5.
2377 2003-07-27 Jim Meyering <jim@meyering.net>
2379 * src/pathchk.c (validate_path): Use %lu, not %ld.
2381 * src/cut.c (is_printable_field): Simplify bit arithmetic.
2383 * src/ls.c (sort_files): Put `volatile' in the right place.
2386 2003-07-26 Jim Meyering <jim@meyering.net>
2388 Use only one bit per field/offset in array, not one `int'.
2389 * src/cut.c (printable_field): Change type to `unsigned char'.
2390 (mark_printable_field, is_printable_field): New functions.
2391 Use them in place of all direct accesses of `printable_field'.
2393 * src/expand.c (parse_tabstops): Detect overflow properly.
2394 * src/cut.c (set_fields): Likewise.
2396 * src/rm.c: Include "dirname.h".
2397 (usage): Use base_name (program_name) in body of --help output.
2399 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
2400 Idea from Brendan O'Dea, who suggested using
2401 `program_name = basename (argv[0]);' everywhere --
2402 can't do that, but using base_name works just fine here.
2404 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
2406 2003-07-24 Paul Eggert <eggert@twinsun.com>
2408 Fix some POSIX-compliance problems with 'test'. This makes
2409 'test' more compatible with Bash.
2411 * NEWS, doc/coreutils.texi: Document the following.
2412 * src/test.c: Include exitfail.h.
2413 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
2414 (test-syntax_error): Use it.
2415 (binary_operator): Now takes bool arg specifying whether left operand
2416 is -l ARG, so that caller determines this rather than us.
2418 (term): Use posixtest to evaluate parenthesized subexpressions.
2419 (unary_operator, one_argument): Remove support for -t without operand.
2420 (one_argument): Take argument from argv[pos].
2421 (one_argument, two_arguments, three_arguments): Advance pos.
2422 All callers changed.
2423 (three_arguments): Look for binary ops before "!". Then look
2424 for parenthesized one_argument expressions, instead of trusting
2425 expr () to do the right thing.
2426 (posixtest): Now takes number of args. All callers changed.
2427 Treat "( A B )" like "A B".
2428 (main): Set exit_failure to TEST_FAILURE. Don't depend on
2429 POSIXLY_CORRECT, as we now conform to POSIX by default.
2430 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
2431 * tests/test/Test.pm (test_vector): Add several tests to check
2432 the above. Syntax errors now exit with status 2, not 1.
2433 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
2435 2003-07-26 Jim Meyering <jim@meyering.net>
2437 * tests/help-version: Adjust for above change in test behavior:
2438 `[' exits with 2, not 1, and test doesn't accept --help or --version.
2440 * Makefile.maint (ME): Don't use trick suggested in Make manual.
2441 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
2443 * Makefile.maint (sc_system_h_headers): Another syntax check.
2444 (syntax-check-rules): Add it to the list.
2446 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
2447 so it matches `%ld' format even on 32-bit systems.
2449 * src/fmt.c (flush_paragraph): Cast field width to `int' to
2450 avoid warning on 64-bit systems.
2452 * src/ls.c (sort_files): Make `func' volatile, so it can't be
2453 clobbered by a `longjmp' into this function.
2455 2003-07-25 Jim Meyering <jim@meyering.net>
2457 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
2460 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
2461 because it'd evoke spurious failure on 64-bit systems.
2463 2003-07-24 Jim Meyering <jim@meyering.net>
2465 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
2466 output its current record counts. Reported by Jurriaan.
2468 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
2469 `wc' with no options. This goes along with the change of 2003-07-20.
2471 2003-07-23 Jim Meyering <jim@meyering.net>
2473 Don't include headers already included by system.h:
2474 * src/tr.c: Don't include errno.h.
2475 * src/true.c: Don't include version-etc.h.
2476 * src/test.c: Don't include limits.h or error.h.
2477 * src/stat.c: Don't include unistd.h or time.h.
2478 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
2479 * src/pr.c: Don't include time.h.
2480 * src/pathchk.c: Don't include errno.h.
2481 * src/nice.c: Don't include sys/time.h.
2482 * src/ls.c: Don't include stdlib.h.
2484 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2485 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2486 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2487 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2488 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2489 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2490 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2491 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2492 Don't include closeout.h.
2494 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2495 can access the required version of rm.
2496 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2498 * tests/cut/Test.pm (out-delim3a): New test.
2500 * man/help2man: Update to version 1.33.
2502 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2504 * src/dircolors.c: Include xstrndup.h.
2505 (xstrndup): Remove function, now that it's been factored out into
2508 2003-07-22 Paul Eggert <eggert@twinsun.com>
2510 * src/wc.c (wc): Fix typo in computation of file from file_x,
2511 which caused the former to be used uninitialized if file_x was
2514 2003-07-22 Jim Meyering <jim@meyering.net>
2516 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2518 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2519 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
2520 Thomas Luzat. See http://bugs.debian.org/202413 for details.
2522 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2524 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
2526 * src/cut.c (set_fields): Mark all selected indices before trying to
2527 determine range endpoints.
2528 * tests/cut/Test.pm: New test for the above fix.
2530 Begin to address this comment: What if someone wants to
2531 extract the 1,000,000-th field of some huge input file?
2532 The first step is to rearrange things so that the values
2533 in the printable_field array are all 0/1 rather than 0/1/2.
2534 * src/cut.c (RANGE_START_SENTINEL): Remove.
2535 Store range-start indices in a hash table, rather than
2536 overloading the `printable_field' array.
2537 (range_start_ht): New global.
2538 (hash_int, hash_compare_ints, is_range_start_index): New functions.
2539 (print_kth): Use is_range_start_index; don't test printable_field.
2540 (set_fields): Detect overflow.
2541 (set_fields): Insert each range-start index into range_start_ht.
2542 (main): Call set_fields only once, and only after
2543 output_delimiter_specified and (if required) range_start_ht have
2546 2003-07-20 Paul Eggert <eggert@twinsun.com>
2548 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2549 invoked with a null pointer when there were no file arguments.
2551 2003-07-20 Jim Meyering <jim@meyering.net>
2553 * Makefile.maint (sc_changelog): Add another nit-picky check.
2555 * src/wc.c (write_counts): Add a comment.
2556 (wc): Rename `file' parameter.
2557 Set new local, `file', to be the file name, or (when it's NULL)
2558 _("standard output") so that all uses of `file' use the proper value.
2559 Use STREQ, not strcmp.
2561 2003-07-20 Paul Eggert <eggert@twinsun.com>
2563 wc count field widths now are heuristically adjusted depending
2564 on the input size, if known. If only one count is printed, it
2565 is guaranteed to be printed without leading spaces.
2567 Previously, wc did not align the count fields if
2568 POSIXLY_CORRECT was set, but POSIX did not actually require
2569 this undesirable behavior, so it has been removed.
2571 * NEWS: Document this.
2572 * doc/coreutils.texi (wc invocation): Likewise.
2574 * src/wc.c (number_width): New var.
2575 (posixly_correct): Remove.
2576 (struct fstatus): New struct.
2577 (write_counts): Output fields of width number_width.
2578 Do not worry about POSIXLY_CORRECT.
2579 Use null file, not empty-string file, to denote stdin,
2580 since "" is a valid file name on some hosts.
2581 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
2583 (wc): Avoid problems if end_pos - current_pos overflows.
2584 Do not print odd message if stdin has a read error.
2585 (get_input_fstatus, compute_number_width): New functions.
2586 (main): Use them to implement the new behavior.
2587 Ignore POSIXLY_CORRECT.
2589 * tests/wc/Test.pm: Adjust to the new output widths.
2591 2003-07-19 Jim Meyering <jim@meyering.net>
2593 * tests/rm/fail-eperm: Don't create temporary directory --
2596 * tests/shred/remove: Don't open-code test for UID != 0.
2597 Use priv-check's require-non-root instead.
2598 Update to use newer framework.
2600 * tests/help-version (expected_failure_status_expr): Record that
2601 expr exits with status of 3 for e.g., a write error.
2603 * tests/priv-check: Use `id -u' to see if we're running as root,
2604 rather than trying go write to an write-protected file.
2605 When running as root, ensure $NON_ROOT_USERNAME is valid.
2606 When running as root with `require-non-root', ensure that `.'
2607 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2608 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2610 * src/printenv.c: Include "exitfail.h".
2611 (main): Set exit_failure rather than calling close_stdout_set_status.
2612 * src/date.c: Likewise.
2613 * src/sort.c: Likewise.
2614 * src/tty.c: Likewise.
2616 2003-07-18 Jim Meyering <jim@meyering.net>
2618 * tests/touch/not-owner: Update to use newer framework.
2620 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2621 directory, and remove Perl-coded `you may not run as root' test.
2622 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2623 hard-coding something not quite equivalent.
2624 Paul Jarc reported the inconsistent diagnostics.
2626 * src/sort.c (main): Use close_stdout via atexit.
2627 Now `sort --version' and `sort --help' fail, as they should
2628 when their output is redirected to /dev/full.
2630 * src/su.c (usage): Don't call close_stdout here.
2631 (main): Use close_stdout via atexit.
2632 Now `su --version > /dev/full' fails, as it should.
2633 Somehow, the change of 2000-05-07 that purports to fix this
2636 * tests/help-version (--help/--version vs. /dev/full): Special-case
2637 `[' to protect it from expected_failure_status-`eval'.
2639 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2640 count and the corresponding line, as required by POSIX.
2641 Reported by Clement Wang.
2642 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2644 * tests/expr/basic: Add tests for when exit status is 2.
2646 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2647 Use an anonymous `enum', rather than #define.
2649 2003-07-17 Paul Eggert <eggert@twinsun.com>
2651 * src/expr.c: Include "exitfail.h", "quotearg.h".
2652 (EXPR_INVALID, EXPR_ERROR): New constants.
2653 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2654 (syntax_error): New function, exiting with status 2. Use it
2655 insteading of printing "syntax error" ourselves.
2656 (main): Initialize exit_failure to EXPR_ERROR.
2657 Exit with EXPR_INVALID on syntax error (too few arguments).
2658 (nextarg): Use strcmp, not strcoll; strcoll might return
2659 an undesirable 0, or might fail.
2660 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2661 or other such error.
2662 (eval2): Report an error if strcoll fails in a string comparison.
2663 * src/sort.c: Include "exitfail.h".
2664 (main): Set exit_failure, not xalloc_exit_failure and
2665 xmemcoll_exit_failure.
2666 * tests/expr/basic: Invalid value exits with status 3, not 2.
2668 2003-07-16 Jim Meyering <jim@meyering.net>
2670 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2671 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2673 This script would have caught at least two recent bugs:
2674 those in [ and kill.
2675 * tests/help-version: Revive this script.
2676 It wasn't doing anything useful, since $all_programs wasn't being
2677 defined by the invoking Makefile.am.
2678 Reflect that nohup is no longer a script, so don't exclude it.
2679 Add framework to handle the programs added since it was last run:
2680 kill, stat, unlink, [, link, readlink.
2681 Fix path-related problems deriving from the move of this script
2682 from src/ to its present location.
2683 * tests/Makefile.am (all_programs): Define.
2684 (TESTS_ENVIRONMENT): Use it.
2686 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2687 whereby kill would always attempt to operate on argv[0] and fail.
2689 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2690 it also matches the one from bash's builtin test.
2691 (binary_operator): Add \n at end of diagnostic.
2693 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2694 * tests/priv-check: Move setuidgid-related and
2695 NON_ROOT_USERNAME-checking code to this file.
2697 * README: Update section on testing as `root'.
2698 Suggestion from Paul Jarc.
2700 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2701 names of authors that I just found in bash's builtins/test.def.
2703 Running `[' with no arguments would evoke a segfault.
2704 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2705 precede potential use via test_syntax_error.
2707 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2708 warning from automake -Wall.
2710 2003-07-15 Jim Meyering <jim@meyering.net>
2714 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2717 * announce-gen (print_changelog_deltas): Relax tests for matching
2718 version-number line in NEWS.
2719 Change the .sig suffix to .asc here, too.
2721 2003-07-14 Jim Meyering <jim@meyering.net>
2723 * Makefile.maint (%.asc): Renamed from %.sig.
2724 Generate and use ascii-armored signatures.
2725 Use gpg's -o option.
2727 2003-07-13 Jim Meyering <jim@meyering.net>
2729 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2732 * Makefile.maint (syntax-check): Move each individual check into
2734 (syntax-check-rules): This is the list of syntax-check targets.
2735 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2736 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2737 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2739 2003-07-12 Jim Meyering <jim@meyering.net>
2741 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2742 traces of the nohup script.
2744 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2745 $(OPTIONAL_BIN_ZCRIPTS).
2747 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2748 target, not before the `>'.
2750 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2751 now that that function no longer calls `error'.
2753 * src/df.c (find_mount_point): Emit a diagnostic for each
2754 failed syscall, rather than relying on caller to do that.
2755 The caller couldn't do a good job, anyhow -- too many different
2756 ways to fail (each with a different referent).
2757 Give a diagnostic upon failed save_cwd, now that that function
2758 no longer calls `error'.
2759 (show_point): Don't diagnose find_mount_point's errors, now that
2760 it handles them itself.
2762 * src/df.c (find_mount_point): Don't let free clobber errno upon
2765 * src/sys2.h: Remove alloca-related block.
2766 * src/system.h: Include <alloca.h> here, instead.
2768 It appears that the `#pragma alloca' included via "system.h" is
2769 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2770 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2771 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2773 * src/chown-core.c (change_file_owner): Do not restore any special
2774 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2775 by chown(2) on some systems. Suggestion and insistence :-) from
2778 * tests/input-tty: Also check `test -t 1'.
2779 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2780 test would block when run in the background.
2782 2003-07-11 Jim Meyering <jim@meyering.net>
2784 * tests/sample-test: Also fail if cat-to-create-expected-output
2785 fails. Otherwise, if both `exp' and `out' were to end up empty
2786 because of e.g., a full disk, they would mistakenly compare equal.
2788 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2789 This solves a portability problem: on at least Solaris systems,
2790 when nohup.sh used the vendor /bin/sh, it would exit with status
2791 of `1' rather than the required 126 or 127 upon failure to exec
2792 the specified program.
2794 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2795 (bin_PROGRAMS): Add nohup.
2796 (EXTRA_DIST): Remove nohup.sh.
2797 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2798 * src/nohup.sh: Remove file.
2799 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2801 * tests/misc/nohup: Tests for the above.
2802 * tests/misc/Makefile.am (TESTS): Add nohup.
2804 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2805 the macro, COPY_FD_DIAGNOSE.
2806 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2807 (head_file): Likewise.
2809 * src/date.c: Include "quote.h".
2810 (batch_convert): Use the quote function rather than using literal `...'
2813 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2814 * src/fmt.c (main): Likewise.
2815 * src/mknod.c (main): Likewise.
2816 * src/tac.c (tac_seekable): Likewise.
2817 * src/yes.c (main): Likewise.
2818 * src/od.c (main): Likewise.
2819 * src/install.c (change_attributes): Likewise.
2821 2003-07-10 Jim Meyering <jim@meyering.net>
2823 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2824 * src/tail.c (usage): Likewise.
2826 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2827 place of the kludge in this test. Suggestion from Paul Jarc.
2829 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2830 * src/setuidgid.c: New program, solely for testing (not installed).
2832 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2833 when dereferencing symlinks.
2835 2003-07-09 Jim Meyering <jim@meyering.net>
2837 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2838 * tests/du/Makefile.am (TESTS): Add slash
2840 * src/tail.c (xlseek): Avoid warning about ``return without value
2841 from function returning non-void''.
2843 2003-07-08 Jim Meyering <jim@meyering.net>
2845 * man/help2man: Update to version 1.29.
2847 * man/help2man: Add END handler to close STDOUT and check for errors.
2849 2003-06-30 Paul Eggert <eggert@twinsun.com>
2851 Add support for a "[" that conforms to the GNU coding standards,
2852 i.e., that does not depend on its name.
2853 * src/lbracket.c: New file.
2855 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2856 a separate man page.
2857 * src/Makefile.am (bin_PROGRAMS): Add "[".
2858 (__SOURCES): New var.
2859 * src/test.c (LBRACKET): Define to 0 if not defined.
2860 (main): Use LBRACKET rather than argv[0].
2862 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2863 Reported by Paul Jarc and Dan Jacobson.
2865 * src/test.c (main): Do not recognize --help or --version if
2866 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2867 Do not bother testing that margv[margc] is non-null.
2869 2003-07-04 Jim Meyering <jim@meyering.net>
2871 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2872 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2874 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2875 option, and perform the +1600 invocations of head IFF the envvar
2876 RUN_EXPENSIVE_TESTS is set.
2878 2003-07-03 Jim Meyering <jim@meyering.net>
2880 * src/cp.c (do_copy): Give a better diagnostic when failing due
2881 to nonexistent destination directory. Reported by Dmitry Rutsky.
2882 See http://bugs.debian.org/199730 for details.
2884 2003-06-27 Jim Meyering <jim@meyering.net>
2886 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2887 * src/split.c (longopts): Use `1', not `0' as the value for
2888 for &verbose. Reported by Keith Thompson.
2890 Test for the above fix.
2891 * tests/misc/split-a: Also use --verbose and compare stderr
2892 output with what we'd expect.
2894 2003-06-20 Jim Meyering <jim@meyering.net>
2896 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2897 Use `error_t' (rather than int) as type for local `err'.
2898 From Alfred M. Szmidt.
2900 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2902 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2903 Fix author preservation code.
2905 2003-06-19 Jim Meyering <jim@meyering.net>
2907 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2908 (do_link): Don't warn about hard link to symlink.
2910 2003-06-18 Jim Meyering <jim@meyering.net>
2912 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2913 Reflect renaming: getstr -> getdelim2.
2915 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2916 readline -> readlinebuffer.
2918 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2920 * src/readlink.c: Include <sys/types.h> before system.h (because
2921 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2923 2003-06-17 Jim Meyering <jim@meyering.net>
2925 * src/system.h (initialize_main): Define.
2926 Use it in every `main'. Applied via this:
2927 p='initialize_main (&argc, &argv);'
2928 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2929 $(grep -l program_name.=.argv.0 *.c)
2930 test.c uses margc/margv, so I made the change manually for that file.
2931 Based on a patch from Bernard Giroud.
2933 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2935 Fix for build failure on Ultrix 4.3.
2936 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2937 Include sys/param.h and sys/mount.h on ultrix.
2939 2003-06-16 Jim Meyering <jim@meyering.net>
2941 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2943 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2944 them here instead, but with one change: define EISDIR to -1, not 0.
2946 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2947 guaranteed to be defined.
2948 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2950 * README: Mention the CVS repository.
2951 Encourage addition of test cases.
2953 2003-06-12 Jim Meyering <jim@meyering.net>
2955 * src/touch.c (touch): Call close only if necessary.
2958 * src/wc.c (usage): Correct wording: wc prints counts in the order
2959 `newline, word, byte'. Reported by Keith M. Briggs.
2960 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2962 2003-06-10 Jim Meyering <jim@meyering.net>
2964 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2966 2003-06-07 Jim Meyering <jim@meyering.net>
2968 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2971 2003-06-06 Jim Meyering <jim@meyering.net>
2973 * src/extract-magic (main): Avoid newer 3-arg form of open,
2974 so this script works also with e.g., perl5.005_03.
2975 Patch by John David Anglin.
2977 2003-06-04 Paul Eggert <eggert@twinsun.com>
2979 * src/system.h: Include <stdbool.h> unconditionally.
2981 2003-06-04 Jim Meyering <jim@meyering.net>
2983 * man/Makefile.am (check-programs-vs-x): Rename target
2984 from check-programs-vs-1. Adjust rule to check for the
2985 primary (.x) file, not the generated one (.1).
2987 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2989 * man/kill.x: New file.
2990 * man/Makefile.am (dist_man_MANS): Add kill.1.
2993 2003-06-04 Jim Meyering <jim@meyering.net>
2995 Ensure that the .x file for a new program is never forgotten again.
2996 * man/Makefile.am (programs): Define.
2997 (check-programs-vs-1): New phony target.
2998 (check-local): Depend on it.
3000 2003-06-03 Jim Meyering <jim@meyering.net>
3002 Avoid unnecessary copying of environment.
3003 * src/env.c (main): Rather than clearing the environment and --
3004 unless told to ignore environment -- copying all settings from
3005 the saved, original environment, clear the environment only when
3006 that is requested. Suggested by Jens Elkner.
3008 2003-06-02 Jim Meyering <jim@meyering.net>
3010 * src/system.h: Always include <string.h>, since we assume C89.
3011 Include <limits.h> without checking for HAVE_LIMITS_H.
3013 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
3014 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
3016 2003-06-01 Jim Meyering <jim@meyering.net>
3018 Avoid a race condition in `tail -f' described by Ken Raeburn in
3019 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
3020 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
3021 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
3022 (tail_bytes, tail_lines, tail): Likewise.
3023 (tail_file): Use the new `read_pos' value as the size,
3024 rather than stats.st_size from the fstat call.
3026 2003-05-28 Jim Meyering <jim@meyering.net>
3028 * src/extract-magic: Allow expansion of `$file' in the here-
3029 document corresponding to the comment at the top of fs.h.
3031 2003-05-26 Jim Meyering <jim@meyering.net>
3033 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
3034 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
3035 Use #if/#elif/... cascade so we get only one set of include files.
3036 Reported by Nelson Beebe.
3038 2003-05-24 Jim Meyering <jim@meyering.net>
3040 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
3041 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
3042 accept the BSD format.
3044 2003-03-28 Joe Orton <jorton@redhat.com>
3046 * src/md5sum.c (bsd_split_3): New function.
3047 (split_3): Detect checksums from BSD 'md5' command and handle them
3050 * tests/md5sum/basic-1: New tests for --check exit status, and for
3051 BSD-style checksum files.
3053 2003-05-21 Jim Meyering <jim@meyering.net>
3055 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
3056 This sort of thing is why it'd be *Really Good* to factor
3057 out the common code used here and in tail.c.
3059 2003-05-14 Jim Meyering <jim@meyering.net>
3061 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
3063 * tests/du/slink: Skip this test if `.' is on an XFS file system.
3065 * tests/du/fd-leak: New file. Test for the bug in du that
3066 was fixed by the 2003-05-12 change to lib/ftw.c.
3067 * tests/du/Makefile.am (TESTS): Add fd-leak.
3069 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
3070 includes a translatable word, `and'.
3072 * src/dd.c (usage): Don't use `,' as the thousands separator
3073 in e.g. 1,000,000 and 1,048,576. Instead, do this:
3074 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
3075 * src/df.c (usage): Likewise.
3076 * src/du.c (usage): Likewise.
3077 * src/ls.c (usage): Likewise.
3079 * Makefile.maint (syntax-check): Add another check.
3081 2003-05-13 Paul Eggert <eggert@twinsun.com>
3083 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
3084 must output nothing. Problem reported by Josh Hyman.
3086 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
3087 (output_unique, output_first_repeated, output_later_repeated):
3088 New vars. All uses of "mode" changed to use these variables,
3089 which are not mutually exclusive as "mode" was.
3090 (writeline): New arg "match", used to control whether to
3091 obey output_first_repeated or output_later_repeated.
3092 All callers changed.
3093 (check_file, main): Adjust to above changes.
3095 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
3097 2003-05-14 Jim Meyering <jim@meyering.net>
3099 * tests/rm/rm3: Use tr's \n notation rather than \012.
3100 This package can afford to do that, since its tests are guaranteed use
3101 GNU tr, which has accepted the more modern notation for 10 years.
3102 * tests/rm/rm5: Likewise.
3103 * tests/cp/same-file: Likewise.
3104 * tests/stty/row-col-1: Likewise.
3105 * tests/stty/basic-1: Likewise.
3106 * tests/rm/deep-1: Likewise.
3107 * tests/mv/part-symlink: Likewise.
3108 * tests/mkdir/perm: Likewise.
3109 * tests/misc/nice: Likewise.
3111 2003-05-13 Jim Meyering <jim@meyering.net>
3113 * src/copy.c (struct F_triple) [name]: Remove const attribute.
3114 (triple_free): Don't apply cast to argument of free.
3115 (seen_file): Add cast here instead.
3117 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
3118 (src_to_dest_free): Don't apply cast to argument of free.
3120 * src/sort.c (zaptemp): Don't apply cast to argument of free.
3121 * src/pr.c (init_fps, init_store_cols): Likewise.
3122 * src/join.c (delseq, freeline): Likewise.
3123 * src/expr.c (OLD): Likewise.
3124 * src/sort.c (sort): Likewise.
3125 * src/head.c (elide_tail_lines_pipe): Likewise.
3127 * src/tail.c: Include "quote.h".
3128 Use quote in diagnostics. Change many error format strings
3129 from just `%s' to e.g., `error reading %s'.
3130 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
3131 Rewrite newline-counting loop to use memchr.
3133 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
3134 Now that assert is no longer used, don't include <assert.h>.
3136 2003-05-12 Jim Meyering <jim@meyering.net>
3138 * src/head.c: Include <assert.h>.
3139 (AUTHORS): Add my name.
3140 (elide_tail_lines_pipe): New function.
3142 2003-05-10 Jim Meyering <jim@meyering.net>
3144 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
3146 * src/readlink.c (main): Set program_name before first use.
3147 Remove that (redundant) first use.
3148 Don't exit successfully just because --verbose was specified.
3149 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
3150 parameter is 0, error does not exit.
3152 * src/uname.c (main): When failing due to too many arguments, also say
3153 that, rather than just "Try `uname --help' for more information.".
3154 * src/comm.c (main): Likewise, but for too few arguments.
3155 * src/logname.c: Include error.h.
3156 (main): Say why we're failing.
3158 * src/uniq.c (main): Don't segfault when argc < optind.
3159 * src/who.c (main): Handle argc < optind.
3160 * src/df.c (main): Likewise.
3161 * src/install.c (main): Likewise.
3162 * src/mv.c (main): Likewise.
3163 * src/pwd.c (main): Likewise.
3164 * src/tty.c (main): Likewise.
3165 * src/chroot.c (main): Likewise.
3166 * src/hostname.c: Likewise.
3167 * src/du.c (main): Likewise.
3168 * src/expand.c (main): Likewise.
3169 * src/env.c (main): Likewise.
3170 * src/unexpand.c (main): Likewise.
3171 * src/printenv.c (main): Likewise.
3172 * src/sync.c (main): Handle argc == 0.
3173 * src/expr.c (main): Likewise.
3174 * src/printf.c (main): Likewise.
3175 * src/basename.c (main): Likewise.
3176 * src/ln.c (main): Test for `missing argument' before computing n_files.
3177 * src/tail.c (main): Test for the case of no arguments before
3180 * src/kill.c (send_signals): Don't check command line arguments here.
3181 (main): Check them here instead. Handle argc < optind.
3183 * src/logname.c (main): Use error, rather than fprintf, for the sake
3186 * src/rm.c (main): Don't overrun array bound if argc is 0.
3188 2003-05-09 Jim Meyering <jim@meyering.net>
3190 * src/sort.c (main): Don't overrun array bound if argc is 0.
3191 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
3192 Reported by Wartan Hachaturow.
3194 2003-05-07 Jim Meyering <jim@meyering.net>
3196 Implement support so that `head --lines=-N' works on seekable files.
3197 * src/head.c (enum Copy_fd_status): Define.
3198 (COPY_FD_DIAGNOSE): New macro.
3199 (elide_tail_lines_seekable): New funtion.
3200 (elide_tail_lines_file): Call it here.
3202 2003-05-06 Jim Meyering <jim@meyering.net>
3204 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
3206 2003-05-04 Jim Meyering <jim@meyering.net>
3208 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
3209 caused the addition of thousands of small files to the tar archive.
3210 * tests/misc/head-elide-tail: New file. Add them here instead.
3211 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
3213 2003-05-04 Paul Eggert <eggert@twinsun.com>
3215 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
3216 (IF_READDIR_NEEDS_REWINDDIR): Remove.
3217 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
3218 which was a bit weird because it couldn't be emulated by a function.
3220 2003-05-03 Jim Meyering <jim@meyering.net>
3222 Extend head to accept --lines=-N (--bytes=-N) and to print all
3223 but the N lines (bytes) at the end of the file.
3224 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
3225 Use quote() in diagnostics, rather than literal `' marks.
3226 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
3228 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
3229 (head_file): Reorganize so as to call head from only one place.
3230 (main): Likewise, for head_file.
3231 Handle new, undocumented option, --presume-input-pipe.
3232 Handle negative line and byte counts.
3233 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
3235 * tests/du/8gb: Skip test if the file system of `.' doesn't support
3236 sparse files -- otherwise it'd create a file of size 8GB.
3238 2003-05-02 Jim Meyering <jim@meyering.net>
3240 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
3241 Instead explain about `-' and standard input.
3242 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
3243 Reported by Keith Thompson.
3244 * tests/fmt/basic: Add test for the above fix.
3246 * src/fmt.c: Include "quote.h".
3247 Use quote() in diagnostics, rather than literal `' marks.
3248 (main): Exit nonzero when unable to open an input file.
3249 * tests/fmt/basic: Add test for the above fix.
3251 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
3252 specifications like `-72x'.
3253 * tests/fmt/basic: Add test for the above fix.
3255 Work around nasty readdir bug on Darwin6.5.
3256 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
3257 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
3258 returned NULL and there has been at least one successful unlink or
3259 rmdir call since the opendir or previous rewinddir, then call
3260 rewinddir and reiterate the loop.
3262 Factor out common code.
3263 * src/remove.c (readdir_ignoring_dotdirs): New function.
3264 (is_empty_dir): Use it here.
3265 (remove_cwd_entries): Use it here.
3267 2003-05-01 Jim Meyering <jim@meyering.net>
3269 * tests/rm/r-3: Create 500 rather than just 300 files.
3270 There's a bug in Darwin6.5's readdir that shows up only with
3272 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
3276 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
3277 (dump_remainder): Move two declarations `down' into the scope
3278 where they are used.
3279 (xlseek): Return the resulting offset.
3280 (file_lines): Rename parameter, file_length, to end_pos.
3281 (pipe_lines): Don't coerce safe_read return value to `int'.
3282 Adapt tests accordingly.
3283 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
3285 Change type of `total_bytes' from `int' to `size_t',
3286 since the former wouldn't always be wide enough.
3287 Don't coerce safe_read return value to `int',
3288 and adapt tests accordingly.
3289 Now that testing for a read error no longer involves
3290 using `tmp', handle that case *after* freeing `tmp'.
3291 (start_bytes): Clean up.
3292 (tail_bytes): Now that `n_bytes' may be larger than
3293 OFF_T_MAX, test for that condition and, if it's true, don't
3294 use lseek optimizations.
3295 (parse_options): Don't fail just because N_UNITS is larger than
3296 the maximum size of a file -- tail may be applied to an input
3297 stream (e.g., a pipe) with more data than that.
3299 * Makefile.maint (syntax-check): Rename from alloc-check.
3300 Also check for SPACE-TAB sequences.
3301 Also check for malloc/calloc/realloc casts.
3303 2003-05-01 Jim Meyering <jim@meyering.net>
3305 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
3307 2003-04-28 Jim Meyering <jim@meyering.net>
3309 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
3310 make the now-more-picky tsort fail.
3312 2003-04-24 Jim Meyering <jim@meyering.net>
3314 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
3315 (main): Minor syntactic clean-up.
3317 * src/tsort.c (tsort): Fail if the input contains an odd number of
3318 tokens. Reported by junkio@cox.net.
3320 * tests/tsort/basic-1: Test for the above fix.
3322 2003-04-21 Jim Meyering <jim@meyering.net>
3324 * tests/misc/printf: Add tests for the printf fixes below.
3326 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
3328 2003-04-20 Paul Eggert <eggert@twinsun.com>
3330 Fix printf POSIX compatibility bug reported by Ben Harris in
3331 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
3332 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
3333 \0NNN in the %b operand.
3334 * src/printf.c (usage): Likewise.
3335 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
3336 is desired. All uses changed. Behave like Bash printf if %b
3337 operand uses \NNN where the initial N is not 0.
3339 2003-04-17 Jim Meyering <jim@meyering.net>
3341 * src/stty.c: Remove uses of PROTOTYPE macro.
3343 2003-04-15 Jim Meyering <jim@meyering.net>
3345 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
3346 each sequence of spaces before a TAB character.
3348 2003-04-13 Jim Meyering <jim@meyering.net>
3350 * src/remove.c (is_empty_dir): Don't closedir (NULL).
3352 2003-04-12 Jim Meyering <jim@meyering.net>
3354 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
3355 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
3356 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
3357 * src/nl.c (main): Fix those problems and remove literal quote marks
3358 (e.g., "`%s'") from format string; instead use "%s" in each format
3359 string and `quote (optarg)' as the corresponding argument.
3360 Also, diagnose all invalid command line options before failing.
3362 * src/nl.c (proc_text): Fix a bug that would make nl output extra
3363 newlines in some cases. Details here: http://bugs.debian.org/177256.
3364 This bug was introduced on 2001-11-10 for textutils-2.0.17.
3365 * tests/misc/nl: Add test for the above-fixed bug.
3367 * tests/misc/readlink: New file. Test the --canonicalize option.
3368 * tests/misc/Makefile.am (TESTS): Add readlink.
3370 2003-04-11 Jim Meyering <jim@meyering.net>
3373 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
3374 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
3375 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
3376 retain alignment) each sequence of spaces before a TAB character.
3378 * src/ls.c: Include <stdlib.h> unconditionally.
3380 * Makefile.maint (xalloc-check): Rename from header-check.
3382 * src/yes.c: Include error.h after system.h, not before.
3385 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
3386 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
3387 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
3388 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
3389 * src/tr.c: * src/unexpand.c, src/users.c:
3390 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
3391 return values and of xrealloc's first argument.
3392 Fix the former with this:
3393 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
3395 2003-04-10 Jim Meyering <jim@meyering.net>
3397 * src/stty.c (wrapf): Declare with format attribute.
3399 The S_MAGIC_... names shouldn't be maintained in two places (prior
3400 to this change, one would have to keep stat.c and fs.h in sync).
3401 This change makes it so those names and the corresponding
3402 hexadecimal constants all reside in stat.c. fs.h is now generated.
3403 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
3404 (BUILT_SOURCES): Add fs.h, now that it's generated.
3405 (EXTRA_DIST): Add extract-magic.
3406 * src/extract-magic: New script to extract fs.h definitions from stat.c.
3407 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
3408 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
3410 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
3411 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
3413 * man/unexpand.x: Add `SEE ALSO' reference to expand.
3414 * man/expand.x: Add `SEE ALSO' reference to unexpand.
3415 Suggestion from Dan Jacobson.
3417 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
3419 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
3420 * src/stat.c (human_fstype): Handle Linux's devpts.
3422 2003-04-09 Paul Eggert <eggert@twinsun.com>
3424 * src/split.c (line_bytes_split): Arg is of type size_t, since
3425 that's all that is supported for now.
3426 (main): Check for overflow in obsolescent line count option.
3428 2003-04-09 Jim Meyering <jim@meyering.net>
3430 * tests/misc/split-fail: Add a new test for the above fix.
3432 * src/split.c (bytes_split): Use size_t temporary (rather than
3433 uintmax_t original) in remaining computations. From Paul Eggert.
3435 Handle command line option arguments larger than 2^31.
3436 This allows e.g., splitting into files of size 2GB and larger,
3437 and running split --lines=N with N=2^31 or more.
3438 But for --line-bytes=N, the restriction that N <= SIZE_MAX
3439 remains (for now), due to the way it is implemented.
3441 * src/split.c: Include "inttostr.h".
3442 (bytes_split, lines_split, line_bytes_split, main):
3443 Use uintmax_t, not size_t, for file sizes.
3444 (main): Give a better diagnostic for option arguments == 0.
3445 Use umaxtostr to print file sizes.
3446 Reported by Luke Hassell.
3448 2003-04-08 Jim Meyering <jim@meyering.net>
3450 * src/rm.c (usage): Mention that --directory (-d) works only
3451 on some systems. Suggestion from Samuel Tardieu.
3453 * tests/basename/basic: Run $PERL to see if it is available,
3454 rather than testing its value.
3455 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
3456 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
3457 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
3458 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
3459 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
3460 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
3461 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
3462 * tests/sum/basic-1, tests/seq/basic: Likewise.
3464 * tests/misc/Makefile.am (TESTS): Add split-fail.
3465 * tests/misc/split-fail: New file.
3467 * src/split.c: Rename local variables: nchars -> n_bytes.
3468 (lines_split): Rename local, nlines -> n_lines.
3469 (main): Rename local variable: s/accum/n_units/.
3470 (main): Use STDIN_FILENO, not literal `0'.
3472 2003-04-07 Jim Meyering <jim@meyering.net>
3474 * src/stat.c: Add #include directives for Ultrix 4.4.
3475 Based on a suggested change from Bert Deknuydt.
3477 2003-04-06 Jim Meyering <jim@meyering.net>
3479 * Makefile.maint (makefile-check): New rule.
3480 (local-check): Add it.
3482 2003-04-05 Jim Meyering <jim@meyering.net>
3484 * Makefile.am (nearly all of them):
3485 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3486 emit a definition for each substituted variable.
3487 * tests/Makefile.am.in: Likewise.
3489 * tests/rm/rm5: Add a comment explaining why this test fails when
3490 using Tru64's broken sed.
3491 * tests/rm/rm3: Likewise.
3493 Make `kill -t' output signal descriptions (not `?') on Tru64.
3494 * src/kill.c (sys_siglist): Also check for __sys_siglist.
3495 Patch by Tony Leneis.
3496 * configure.ac: Also check for declaration of __sys_siglist.
3497 Required for Tru64 4.0D, 4.0F, and 5.1.
3498 Reported by Tony Leneis.
3500 2003-04-04 Jim Meyering <jim@meyering.net>
3502 * src/Makefile.am (PERL): Remove unnecessary definition.
3504 Because of inappropriate (but POSIX-mandated) behavior of rename,
3505 `mv a b' would not remove `a' in some unusual cases. Work around
3506 this by unlinking `a' when necessary.
3508 * src/copy.c (same_file_ok): Add an output parameter.
3509 Set it in the offending case.
3510 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3511 Reported by Ed Avis.
3512 * tests/mv/hard-4: New test for the above.
3513 * tests/mv/Makefile.am (TESTS): Add hard-4.
3515 Clean up rules for automatically generated sources:
3516 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3517 Make each generated file be read-only.
3518 Add each file name to BUILT_SOURCES separately.
3519 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3521 Put LOCALEDIR macro definition in new file: localedir.h.
3522 * src/Makefile.am (DEFS): Remove definition.
3523 (localedir.h): New rule.
3524 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3525 * src/system.h: Include "localedir.h".
3527 2003-04-02 Jim Meyering <jim@meyering.net>
3531 * tests/misc/Makefile.am (TESTS): Add false.
3533 * Makefile.maint (TMPDIR): Make sure it's defined.
3534 (my-distcheck): Build in $(TMPDIR), not `.'.
3536 * src/Makefile.am (false.c): Change all occurrences of
3537 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3538 unsuccessfully also with --help. Reported by Paul Jarc,
3539 * tests/misc/false: New test for the above.
3541 2003-03-30 Jim Meyering <jim@meyering.net>
3543 * NEWS: Note the location of older NEWS files.
3545 * src/remove.c (is_empty_dir): Don't let a failing closedir
3546 clobber errno. Spotted by Arnold Robbins.
3548 * src/env.c: Fix typo in comment. From Arnold Robbins.
3550 2003-03-29 Jim Meyering <jim@meyering.net>
3554 * README: Note to expect build problems for stat.c on Ultrix 4.3.
3555 Note that there are some harmless test failures when running
3556 `make check' as root on some systems.
3558 2003-03-28 Jim Meyering <jim@meyering.net>
3560 * tests/stty/row-col-1: Skip this test if stty can't get window size.
3561 This happens when connecting to sparc-solaris5.7 via ssh from within
3562 emacs. Reported by Karl Berry.
3564 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3565 Otherwise, on systems (DJGPP) that emulate pipes using files,
3566 this test would never complete, waiting for `yes' to terminate.
3567 * tests/du/slink: As above, use seq, not `yes' to generate link target.
3568 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3569 Reported by Rich Dawe.
3571 2003-03-27 Jim Meyering <jim@meyering.net>
3573 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3574 from `written by...' comment, at his request.
3576 2003-03-24 Paul Eggert <eggert@twinsun.com>
3578 Fix buffer overrun problem reported by TAKAI Kousuke, along
3579 with some other POSIX incompatibilities.
3581 * src/printf.c (print_esc): Do not treat \x specially if
3582 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
3583 in backslash. Treat incomplete escape sequences as strings
3584 of characters, as POSIX requires.
3585 (print_formatted): Allow multiple flags. Avoid buffer overrun
3586 if the format is incomplete.
3588 2003-03-24 Jim Meyering <jim@meyering.net>
3590 * tests/misc/printf: Add tests for the above fixes and changes.
3592 2003-03-26 Jim Meyering <jim@meyering.net>
3594 * src/copy.h (struct cp_options): Add a comment.
3596 2003-03-23 Jim Meyering <jim@meyering.net>
3598 * README: Describe problem with 64-bit mode on HPUX 11.x,
3599 with patch for /usr/include/inttypes.h.
3600 * TODO: Plan to add an autoconf test to work around the bug.
3602 2003-03-22 Jim Meyering <jim@meyering.net>
3604 * src/stat.c: Don't include <sys/sysmacros.h>.
3605 That is already done via system.h. Otherwise, the multiple
3606 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3607 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3608 (human_fstype): Factor some directives `up', out of this function.
3609 Cast away `const' to avoid error from Cray's /bin/cc.
3611 2003-03-20 Jim Meyering <jim@meyering.net>
3613 * announce-gen (print_changelog_deltas): Ensure that a newline
3614 precedes each row of `*'s.
3616 2003-03-20 Jim Meyering <jim@meyering.net>
3620 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3621 format flag characters.
3622 Do not require that a field width be specified.
3623 Do not fail when given a field width of `0'.
3624 Reported by Dan Jacobson.
3625 * tests/seq/basic: Add new tests for the above-fixed bug.
3627 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3628 (install-root): Likewise.
3629 (install-exec-local): Likewise.
3630 Based on a patch from Richard Dawe.
3632 2003-03-19 Jim Meyering <jim@meyering.net>
3634 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3635 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3636 Include $(EXEEXT) in program names.
3637 Since $(LN_S) may degenerate to `cp -p', be careful
3638 to invoke it from the destination directory.
3639 Mostly from Richard Dawe.
3640 * configure.ac: Use AC_PROG_LN_S.
3642 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3643 CDPATH shell variable set could cause this test to fail.
3644 Reported by Karl Berry.
3646 2003-03-18 Jim Meyering <jim@meyering.net>
3648 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3649 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3650 AIX 5.1's xlc could not compile the former.
3651 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3653 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3655 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3656 program names, since automake only adds $(EXEEXT) to programs
3659 2003-03-16 Jim Meyering <jim@meyering.net>
3661 * src/remove.c (rm): Put two local variables in static storage,
3662 so they can't be clobbered by the potential longjmp.
3664 2003-03-15 Jim Meyering <jim@meyering.net>
3666 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3667 so that a version number with a two-digit component can still count
3668 as an alpha release. Reported by Richard A Downing.
3669 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3671 2003-03-14 Jim Meyering <jim@meyering.net>
3673 * src/ansi2knr.c: Remove no-longer-used file.
3674 * src/ansi2knr.1: Likewise.
3676 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3677 assignment, since it causes trouble with old versions of GNU make
3678 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3679 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3680 Patch from Alexandre Duret-Lutz.
3682 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3683 subdirectories so that each includes a definition of ACLOCAL_M4.
3685 * announce-gen (main): Label the compressed source URLs.
3689 * tests/du/slink: Relax the test for the `local'ness of a file system,
3690 so that now it works also for tmpfs.
3692 * tests/du/hard-link: Transform output from first du, so that this
3693 test doesn't fail on file systems like tmpfs that order directory
3694 entries differently.
3696 2003-03-13 Jim Meyering <jim@meyering.net>
3698 * tests/du/8gb: Work around what appears to be an NFS failure that
3699 would make this test fail on some systems.
3701 2003-03-11 Jim Meyering <jim@meyering.net>
3703 * tests/du/basic: Make the test file exactly 4k bytes long.
3705 * src/split.c (longopts): Don't hard-code `2' here.
3706 Instead, just specify `&verbose', and ...
3707 (main): ... remove the `case 2:' block for --verbose.
3709 * tests/du/basic: Make the test file larger than 64 bytes, so that
3710 we don't immediately disqualify file systems (e.g., NetApp) on which
3711 smaller files take up zero disk blocks. Reported by Vin Shelton.
3713 2003-03-10 Jim Meyering <jim@meyering.net>
3715 Don't segfault for a negative field width or precision in format string.
3716 Note that this is just a stopgap fix. The longer term solution may
3717 involve adapting bash's builtins/printf.def.
3719 * src/printf.c: (UNSPECIFIED): Define.
3720 (print_direc): Use the special value, UNSPECIFIED, to indicate
3721 that field_width or precision has not been specified.
3722 (print_formatted): Fail if field_width or precision is the
3723 special value, UNSPECIFIED.
3724 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3726 * src/sys2.h (INT_MIN): Define, if necessary.
3727 * tests/misc/printf: Add a test for the above-fixed bug.
3729 2003-03-09 Jim Meyering <jim@meyering.net>
3731 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3732 changing its sign. This avoids a warning from gcc on 64-bit systems.
3733 Reported by Bob Proulx.
3734 (pop_dir): Reverse order of sign change and cast, to be consistent
3737 2003-03-08 Jim Meyering <jim@meyering.net>
3739 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3740 shell variable, but only in the environment. With /bin/sh->bash, the
3741 shell variable is set to `y', and that would cause a spurious warning.
3742 Reported by Bob Proulx.
3744 * tests/Makefile.am (check-root): Remove touch/fifo.
3745 It doesn't appear to have to be run as root.
3747 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3748 user name, make sure that the selected user name has a usable shell.
3749 Reported by Paul Jarc.
3751 Before, when using shred on a device, one had to specify --exact,
3752 or be careful to choose a size that would not be rounded up and
3753 exceed the maximum value; that could result in a failure of
3755 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3756 files. Suggestion from Ben Elliston.
3759 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3760 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3761 Patch by Bob Proulx.
3763 * src/Makefile.am (check-misc): Check for use of `defined' in
3765 Change to $(srcdir) before running grep.
3767 * src/sleep.c: Remove now-unused #include and #define directives.
3769 * src/du.c (process_file): If a file's size is not being counted
3770 e.g., because it's a hard link to a file we've already counted,
3771 then don't print a line for it.
3773 * tests/du/hard-link: New test for the above-fixed bug.
3774 * tests/du/Makefile.am (TESTS): Add hard-link.
3777 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3778 and make the two-array approach work.
3780 * tests/du/basic: Correct/add tests for the above fix.
3781 Set LC_ALL, etc., now that we use sort.
3782 Check the block/size of a small file, too.
3783 Correct expected results for simple dir1/dir2/file case.
3784 Add another test of du -S.
3786 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3788 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3789 middle-end/9986). As one of GCC's optimizations, it transforms a
3790 fputs_unlocked call to a fputc_unlocked call when the string is
3791 one character long. However, hpux doesn't have fputc_unlocked.
3793 * expr.c (usage): Use putchar, not fputs, to output a single character.
3794 * ls.c (dired_dump_obstack): Likewise.
3795 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3796 * stat.c (print_it): Likewise.
3798 2003-03-07 Jim Meyering <jim@meyering.net>
3800 * src/cp.c: Remove everything associated with mmap-stack.c.
3801 This reverts the two changes of 2003-02-21.
3802 * src/du.c: Remove everything associated with mmap-stack.c.
3803 This reverts the change of 2003-02-19.
3805 2003-03-06 Jim Meyering <jim@meyering.net>
3807 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3808 CDPATH shell variable set could cause this test to fail.
3809 Reported by Karl Berry.
3811 2003-03-05 Jim Meyering <jim@meyering.net>
3815 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3816 integer with zero, to avoid a warning from Intel's ecc.
3817 Reported by Nelson Beebe.
3819 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3820 Otherwise, for files or totals that are too big, numbers would
3821 be truncated. Patch mostly by Michael Stone.
3822 Reported by Ingo Saitz as Debian bug #183210.
3824 * tests/du/8gb: New test for the above-fixed bug.
3825 * tests/du/Makefile.am (TESTS): Add 8gb.
3827 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3828 rather than UTILS_OPEN_MAX - 10.
3830 2003-03-04 Jim Meyering <jim@meyering.net>
3832 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3833 rather than bug-gnu-utils, now that the former is better known.
3834 Suggestion from Göran Uddeborg.
3836 * src/stat.c (usage): Capitalize consistently.
3837 Reported by Göran Uddeborg.
3839 * Makefile.maint (rel-files): Include $(signatures), so that
3840 those files are also copied into $(release_archive_dir).
3842 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3844 * src/remove.c (AD_pop_and_chdir): Likewise.
3846 * tests/Makefile.am (check-root): Add fail-2eperm.
3848 2003-03-03 Jim Meyering <jim@meyering.net>
3850 * src/remove.c (remove_cwd_entries): Include the full filename of
3851 the offending file, not just the basename.
3853 * tests/misc/tty-eof: Set $ME properly.
3855 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3856 Remove now-unused variables.
3857 (tag-prev-version, prev-cvs-tag): Likewise.
3859 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3860 accurate diagnostic when failing to remove a file owned by some other
3861 user. Reported by Ivo Timmermans via Michael Stone.
3862 This fixes Debian bug# 178471.
3864 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3865 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3866 Based on a report from Ivo Timmermans.
3868 2003-03-02 Jim Meyering <jim@meyering.net>
3870 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3871 failure to create a hard link, do not remove the entry associating
3872 the source dev/ino with the destination file name.
3873 * tests/mv/Makefile.am (TESTS): Add hard-3.
3874 * tests/mv/hard-3: New test, for the above-fixed bug.
3875 Inspired by a report from Iida Yosiaki.
3877 2003-03-01 Jim Meyering <jim@meyering.net>
3879 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3880 header string. Instead, put `Filesystem' and `Type' headers in the
3881 same string, so translators can use horizontal space as needed.
3882 Reported by Jean Charles Delepine.
3884 2003-02-28 Jim Meyering <jim@meyering.net>
3886 * src/copy.c (copy_internal): When link fails because of an
3887 existing destination file, unlink that file and try again.
3888 Reported by Iida Yosiaki.
3890 * tests/mv/Makefile.am (TESTS): Add hard-2.
3891 * tests/mv/hard-2: New test for the above-fixed bug.
3892 Based on a test case from Iida Yosiaki.
3894 2003-02-26 Jim Meyering <jim@meyering.net>
3896 * tests/du/basic: Don't test du's -b option here. Directory byte
3897 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3898 and IBM AIX 4.2. Reported by Nelson Beebe.
3900 2003-02-25 Jim Meyering <jim@meyering.net>
3902 * Makefile.maint (announcement): Now that ChangeLog entries
3903 are output by announce-gen, don't do it here.
3904 * announce-gen (print_changelog_deltas): New function.
3907 2003-02-22 Jim Meyering <jim@meyering.net>
3909 * announce-gen: New option: --release-type=TYPE
3910 * Makefile.maint (beta, major): New targets. Remove `release'.
3911 Put them all together on a line.
3912 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3913 invocation of `announcement'.
3914 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3916 * announce-gen: New option: --news=NEWS_FILE.
3917 Extract NEWS entries here, not via rules in Makefile.maint.
3918 * Makefile.maint (announcement): Now that NEWS entries are
3919 extracted by announce-gen, don't do it here.
3920 (news-r1, news-r2): Remove now-unused definitions.
3922 2003-02-21 Jim Meyering <jim@meyering.net>
3926 Merge in changes from autoconf's version of this file.
3927 * Makefile.maint (www-gnu): Define.
3928 (standards.texi-url_prefix): Use $(www-gnu).
3929 (make-stds.texi-url_prefix): Likewise.
3931 * src/cp.c: Include "mmap-stack.h".
3932 (main): Invoke `run' through a macro that (when possible) runs it
3933 with a large, mmap'd stack.
3935 * src/cp.c (run): New function, preparing for the above.
3936 Exit from this function, not from main
3939 * src/du.c: New option: --apparent-size.
3940 (enum) [APPARENT_SIZE_OPTION]: New member.
3941 (long_options): Add it.
3942 (usage): Describe it.
3944 ['b']: Set apparent_size.
3945 David Eisner reported that the behavior of --bytes had changed.
3946 Paul Eggert proposed the use of a new option, --apparent-size.
3948 * src/du.c (apparent_size): New global.
3949 (print_only_size): Reflect the fact that we're printing byte counts,
3950 not ST_NBLOCKSIZE-byte-block counts.
3951 (print_size): Call print_only_size rather than duplicating its code.
3952 (process_file): Accumulate byte counts, rather than block counts.
3954 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3955 for --separate-dirs (-S).
3957 2003-02-20 Jim Meyering <jim@meyering.net>
3959 * Use automake-1.7.3. Regenerate dependent files.
3961 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3962 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3963 (usage) [%B]: Describe it.
3966 * src/du.c (process_file): Reorganize the code to use only
3967 one `sum' array, and change how -S works back to the way it was
3968 before 2003-01-31. Patch by Bruno Haible.
3970 * tests/du/basic: New test.
3971 * tests/du/Makefile.am (TESTS): Add basic.
3973 * tests/envvar-check: Add checks for the following:
3974 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3976 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3977 so as not to conflict with the distributed file by the same name.
3979 * src/du.c (process_file): Set info->skip before any possible return.
3981 Report correct usage for directories, not 0.
3982 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3983 _before_ recording the dev/ino of a directory.
3984 Reported by Bruno Haible.
3986 Now, df always displays the device file name corresponding to the
3987 listed mount point under `Filesystem'. Before, for an unmounted
3988 block- or character-special file argument, it would display the
3989 command-line argument instead.
3990 * src/df.c (show_disk): Return a value indicating whether
3991 there was a match. Don't try to find a mount point here.
3992 (show_entry): If show_disk doesn't find a match, call show_point.
3994 2003-02-19 Jim Meyering <jim@meyering.net>
3996 * src/du.c: Include "mmap-stack.h".
3997 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3998 Exit from this function, not from...
4000 Instead, if possible, invoke du_files through a macro that
4001 runs it with a large, mmap'd stack.
4003 * src/join.c (usage): Change wording in --help output:
4004 use FILENUM instead of `SIDE' and say what FILENUM means.
4005 Reported by Bernhard Gabler.
4007 * src/df.c (print_header): Rather than using a hard-coded literal
4008 string of spaces matching the length of the English `...Type' header,
4009 output the right number of spaces to match the selected translation.
4010 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
4012 * src/split.c (bytes_split): Remove unnecessary `else' after break.
4013 (lines_split): Likewise. and correct misleading indentation.
4015 * src/split.c: Include "full-read.h".
4016 (bytes_split, lines_split, line_bytes_split): Use full_read,
4017 not safe_read. The way split was using the latter, a short read
4018 could cause split to terminate before EOF.
4020 * tests/misc/tty-eof: Test all programs that can read stdin,
4021 requiring no arguments and that write to standard output.
4023 * tests/misc/tty-eof: New file. Renamed from ...
4024 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
4025 * tests/misc/Makefile.am (TESTS): Reflect renaming.
4027 2003-02-18 Jim Meyering <jim@meyering.net>
4029 cksum would perform an extra read after encountering EOF
4030 * src/cksum.c (cksum): Exit the loop upon EOF, too.
4031 Patch by Michael Bacarella.
4033 Test for the bug fixed today in cksum, md5sum, and sha1sum.
4034 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
4035 cat, cksum, md5sum, and sha1sum all in the same loop.
4037 2003-02-14 Jim Meyering <jim@meyering.net>
4039 * src/remove.c: Include "euidaccess.h".
4040 Remove declaration of euidaccess.
4042 2003-02-12 Jim Meyering <jim@meyering.net>
4044 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
4045 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
4047 2003-02-10 Jim Meyering <jim@meyering.net>
4049 * src/test.c: Don't include group-member.h.
4050 Include euidaccess.h.
4051 (eaccess): Rewrite function to set the real uid and gid temporarily
4052 to the effective uid and gid, then invoke 'access', and then set the
4053 real uid and gid back. On systems that lack setreuid or setregid,
4054 fall back on the kludges in euidaccess. Before, it would not work
4055 for e.g., files with ACLs, files that were marked immutable,
4056 or on file systems mounted read-only. Nelson Beebe raised the issue.
4057 Paul Eggert suggested the new implementation.
4059 2003-02-09 Jim Meyering <jim@meyering.net>
4061 * src/test.c (test_stat): Remove function. It's job is done (only
4062 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
4064 2003-02-08 Jim Meyering <jim@meyering.net>
4068 * tests/mv/part-symlink: Don't assume that the file owner username
4069 length is less than 9 in ls output: instead, omit that field
4070 altogether. Reported by, and suggested fix from, Ferdinand.
4072 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
4073 * tests/du/Makefile.am (TESTS): Add restore-wd.
4075 * src/rm.c: Correct now-invalid comment about cycle-detection.
4077 2003-02-06 Jim Meyering <jim@meyering.net>
4079 * NEWS: Add entries from old/*/NEWS
4080 from fileutils-4.1 through 4.1.11 and
4081 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
4085 * src/du.c (process_file): Don't return early for excluded files
4086 or for files whose dev/inode we've already seen.
4088 2003-02-05 Jim Meyering <jim@meyering.net>
4090 * tests/du/exclude: New file.
4091 * tests/du/Makefile.am (TESTS): Add exclude.
4093 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
4095 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
4096 Fix memory allocation arithmetic.
4098 2003-02-04 Jim Meyering <jim@meyering.net>
4100 `df /dev/block-or-char-device-file--not-mounted' now reports
4101 the name of the file system on which the file resides, usually `/'.
4102 Before, it would leave the `Mounted on' field blank.
4103 * src/df.c (show_disk): Move function to precede find_mount_point.
4104 (show_disk): Add parameter: STATP.
4105 If we don't find a matching device name, then resort to calling
4106 find_mount_point. Reported by Bob Proulx.
4108 2003-02-03 Andreas Schwab <schwab@suse.de>
4110 * tests/rm/cycle: Require non-root.
4111 * tests/rm/isatty: Likewise.
4113 2003-02-02 Jim Meyering <jim@meyering.net>
4117 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
4119 Ensure that there are no offending uses of `:'.
4120 * Makefile.maint (makefile_path_separator_check): New rule.
4121 (local-check): Add it to the list.
4123 2003-02-01 Jim Meyering <jim@meyering.net>
4125 * src/du.c (MAX_N_DESCRIPTORS): Define.
4127 * src/stat.c (G_fail): New global.
4128 (human_time): Diagnose failed localtime, not failed nstrftime.
4129 (main): Fail if G_fail is set.
4131 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
4133 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
4134 hard-coding the path-separator. Also double-quote the new PATH,
4135 to avoid problems when the path-separator is a semi-colon or when
4136 `pwd` contains e.g. a space.
4137 * tests/chgrp/Makefile.am: Likewise.
4138 * tests/chmod/Makefile.am: Likewise.
4139 * tests/chown/Makefile.am: Likewise.
4140 * tests/cp/Makefile.am: Likewise.
4141 * tests/dd/Makefile.am: Likewise.
4142 * tests/dircolors/Makefile.am: Likewise.
4143 * tests/du/Makefile.am: Likewise.
4144 * tests/expr/Makefile.am: Likewise.
4145 * tests/factor/Makefile.am: Likewise.
4146 * tests/fmt/Makefile.am: Likewise.
4147 * tests/install/Makefile.am: Likewise.
4148 * tests/ln/Makefile.am: Likewise.
4149 * tests/ls/Makefile.am: Likewise.
4150 * tests/ls-2/Makefile.am: Likewise.
4151 * tests/md5sum/Makefile.am: Likewise.
4152 * tests/misc/Makefile.am: Likewise.
4153 * tests/mkdir/Makefile.am: Likewise.
4154 * tests/mv/Makefile.am: Likewise.
4155 * tests/od/Makefile.am: Likewise.
4156 * tests/rm/Makefile.am: Likewise.
4157 * tests/rmdir/Makefile.am: Likewise.
4158 * tests/seq/Makefile.am: Likewise.
4159 * tests/sha1sum/Makefile.am: Likewise.
4160 * tests/shred/Makefile.am: Likewise.
4161 * tests/stty/Makefile.am: Likewise.
4162 * tests/sum/Makefile.am: Likewise.
4163 * tests/tail-2/Makefile.am: Likewise.
4164 * tests/touch/Makefile.am: Likewise.
4165 * tests/tsort/Makefile.am: Likewise.
4166 * tests/unexpand/Makefile.am: Likewise.
4168 2003-01-31 Jim Meyering <jim@meyering.net>
4170 * src/stat.c: Include "file-type.h"
4171 (print_human_type): Remove function.
4172 (human_access): Rename from print_human_access. Return a string.
4173 (human_time): Rename from print_human_time. Return a string.
4174 (print_stat): Arrange so that field width and an alignment specifier
4175 are honored for the %A, %F, %x, %y, and %z formats.
4176 [%F]: Use file_type; this gives slightly different file type strings,
4177 e.g., `directory' instead of `Directory' and `regular file' or
4178 `regular empty file' instead of `Regular file'.
4179 Prompted by a report from Richard Dawe that the uses of
4180 S_IFSOCK and S_IFIFO in print_human_time were not portable
4181 to systems using e.g., DJGPP.
4183 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
4185 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
4186 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
4188 2003-01-31 Jim Meyering <jim@meyering.net>
4190 * src/du.c (main): Upon processing an invalid option or an invalid
4191 --exclude-from or --max-depth option argument, don't exit right away,
4192 in case there are others. Rather record the failure and exit after
4193 processing other options.
4195 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
4196 tar archive easier to reproduce.
4198 Rewrite to perform directory traversal using nftw.
4200 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
4201 (AUTHORS): Add self.
4202 (opt_one_file_system): Move global into `main'.
4203 (path, xstat, exit_status): Remove declarations.
4204 (arg_length, suffix_length): New globals.
4205 (G_fail): New global, sort of like the old `exit_status'.
4206 (IS_FTW_DIR_TYPE): Define.
4207 (print_only_size): New function.
4208 (process_file): New function.
4209 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
4210 (str_trunc, pop_dir, count_entry): Likewise.
4211 (du_files): Rewrite to use nftw.
4213 2003-01-30 Jim Meyering <jim@meyering.net>
4215 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
4216 symlink-to-directory with -L, even without the trailing slash.
4218 2003-01-27 Jim Meyering <jim@meyering.net>
4220 * src/Makefile.am (check-misc): Check for st_blocks, too.
4222 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
4223 Reported by Richard Dawe.
4225 2003-01-27 Andreas Schwab <schwab@suse.de>
4227 * src/ls.c (quote_name): Add fourth parameter, width, into which to
4228 store the screen columns, and return the number of bytes instead.
4229 (print_dir): Pass NULL as fourth parameter of quote_name.
4230 (print_name_with_quoting): Likewise.
4231 (length_of_file_name_and_frills): Get the width from the fourth
4232 parameter of quote_name instead of return value.
4234 2003-01-27 Jim Meyering <jim@meyering.net>
4236 * src/ls.c (decode_switches): If `dired' is set without
4237 `format == long_format', then silently reset dired. This doesn't
4238 change the behavior of ls (all prior uses of dired were protected
4239 by `&& format == long_format'), and lets us...
4240 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
4241 (PUSH_CURRENT_DIRED_POS): Likewise.
4244 2003-01-22 Jim Meyering <jim@meyering.net>
4246 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
4247 * tests/du/Makefile.am (TESTS): Add no-x.
4249 2003-01-21 Jim Meyering <jim@meyering.net>
4251 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
4252 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
4253 it may still be a directory -- or not (e.g., with FreeBSD on an
4254 NFS-mounted file system), so resort to calling lstat to find out.
4255 Based on a patch by Michael van Elst.
4257 * tests/cp/same-file: Don't assume that the file owner username
4258 length is less than 9 in ls output: instead, omit that field
4259 altogether. Reported by, and suggested fix from, Ferdinand.
4261 2003-01-20 Jim Meyering <jim@meyering.net>
4263 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
4264 large format widths no longer cause strftime to infloop.
4266 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
4268 2003-01-19 Jim Meyering <jim@meyering.net>
4270 * src/readlink.c: Include "canonicalize.h".
4272 2003-01-18 Jim Meyering <jim@meyering.net>
4274 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
4276 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
4277 (long_options): Add option --dereference-command-line-symlink-to-dir.
4278 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
4279 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
4280 -d, -F, -l options is specified.
4281 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
4282 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
4283 Change --dereference-command-line (-H) to dereference *all*
4284 command line arguments, including broken symlinks.
4286 2003-01-15 Paul Eggert <eggert@twinsun.com>
4288 Change ls -H back to the way it was yesterday, since this is
4289 compatible with FreeBSD and the POSIX spec is confusing
4290 and somewhat contradictory.
4292 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
4293 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
4294 (long_options): Change the long option name back.
4295 (usage): Change the usage back.
4296 (gobble_file): When -H is specified, dereference a top-level
4297 arg even if it points to a non-directory.
4299 2003-01-15 Jim Meyering <jim@meyering.net>
4301 * src/ls.c (gobble_file): Fall back on using lstat when required:
4302 when --dereference (-L) is not specified, and
4303 - when operating on a dangling symlink
4304 - when operating on command-line-symlink-to-directories
4305 This fixes numerous problems. Here are examples:
4306 - `ls dangling-symlink' would fail with `no such file...'
4307 Now it prints `dangling-symlink'.
4308 - `ls -i symlink' would mistakenly print the inode of the referent.
4309 Now it prints the inode of the symlink. Likewise for --size (-s).
4310 Based on a patch from Michael Stone.
4311 Reported by Deepak Goel as Debian bug #173793.
4313 Rename ls's --dereference-command-line (-H)
4314 option to --dereference-command-line-symlink-to-dir.
4315 * src/ls.c [enum Dereference_symlink]
4316 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
4317 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
4318 (long_options): Rename the long option.
4319 (usage): Say that --dereference-... changes how ls treats
4320 only symlinks to directories specified on the command line.
4322 2003-01-14 Jim Meyering <jim@meyering.net>
4324 * tests/ls/dangle: New file/test, for the above fix.
4325 * tests/ls/inode: Another new file/test, for the above fix.
4326 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
4328 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
4329 so that ls --color would no longer highlight the names of files with
4330 the execute bit set when not specified on the command line.
4331 Patch by Michael Stone. Reported by Stephen Depooter as
4334 * tests/ls-2/tests (color-exe): New test, for the above fix.
4336 2003-01-13 Jim Meyering <jim@meyering.net>
4338 * tests/shred/exact: Also test for just fixed bug with --zero.
4340 * src/shred.c (long_opts): --zero does not require an argument.
4341 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
4343 2003-01-12 Jim Meyering <jim@meyering.net>
4345 * Makefile.maint (cvs-update): Skip any file with local modifications.
4347 * src/unexpand.c (usage): Document --first-only and mention that
4348 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
4350 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
4352 * src/df.c: Include "canonicalize.h".
4353 Use canonicalize_file_name unconditionally.
4355 2003-01-09 Jim Meyering <jim@meyering.net>
4357 * README: Add readlink.
4359 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
4361 * src/df.c: Include "xgetcwd.h".
4362 * src/pwd.c: Likewise.
4364 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
4366 * src/shred.c: Remove declaration of xstrdup.
4367 We already get it via xalloc.h which is included via system.h.
4369 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
4371 New program: readlink.
4373 * src/Makefile.am (bin_PROGRAMS): Add readlink.
4374 * src/readlink.c: New file.
4376 * man/readlink.x: New file.
4377 * man/Makefile.am (dist_man_MANS): Add readlink.1.
4378 (readlink.1): New rule.
4380 2003-01-09 Jim Meyering <jim@meyering.net>
4382 When selecting ranges of byte offsets (as opposed to ranges of fields)
4383 and when --output-delimiter=STRING is specified, output STRING between
4384 ranges of selected bytes.
4385 * src/cut.c (RANGE_START_SENTINEL): Define.
4386 (output_delimiter_specified): New global.
4387 (print_kth): Add parameter. Adjust all callers.
4388 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
4389 (cut_bytes): When requested, output STRING between ranges of
4391 (main): Make a diagnostic a little clearer.
4392 Based on a patch from Jan Nieuwenhuizen.
4394 * tests/cut/Test.pm: New tests for the above.
4396 * src/cut.c (set_fields): Make code agree with comment:
4397 Don't merge abutting ranges like 4- and 2-3. This makes no
4398 difference currently, but is required to support an upcoming change.
4400 2003-01-07 Jim Meyering <jim@meyering.net>
4402 * src/cut.c (set_fields): Fix typo in comment.
4404 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
4405 * tests/touch/Makefile.am (TESTS): Add not-owner.
4406 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
4407 Now, this tests only the nonexistent-directory diagnostic.
4408 Suggestion from Michael Stone.
4410 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
4412 2003-01-04 Jim Meyering <jim@meyering.net>
4414 * src/copy.h: Remove use of PARAMS.
4415 * src/remove.h: Likewise.
4416 * src/chown-core.h: Likewise.
4418 rm could be tricked into mistakenly reporting a cycle.
4419 * src/remove.c: [cycle_check_state]: New global.
4420 (remove_cwd_entries): Adapt to new semantics of cycle_check.
4421 (rm): Call cycle_check_init and cycle_check_free for each file.
4422 * tests/rm/cycle (rm): New test, for the above fix.
4423 * tests/rm/Makefile.am (TESTS): Add cycle.
4425 When rm detects a cycle, don't abort the entire command,
4426 but rather just the affected command line argument.
4427 * src/remove.c: Include <setjmp.h>
4428 (struct dirstack_state) [current_arg_jumpbuf]: New member.
4429 (remove_cwd_entries): Call longjmp if we detect a cycle.
4430 (rm): Call setjmp here.
4432 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
4433 Instead, include cycle-check.h and use it.
4435 * src/remove.h (struct dev_ino): Remove declaration.
4437 * src/remove.c (remove_cwd_entries): Fix typos in comment.
4439 Don't include trailing /. in diagnostics about directories.
4440 * src/remove.c (full_filename_): When FILENAME is just `.'
4441 and there is a nonempty directory-name part, don't append `/.'.
4442 * tests/rm/unread2: Remove trailing /. from diagnostic.
4443 * tests/rm/rm2: Likewise.
4445 * src/remove.c (struct dirstack_state): Define.
4446 To be used in place of these file-scoped globals ...
4447 (dir_stack, len_stack, Active_dir): Remove globals.
4448 (ds_init, ds_free): New functions.
4449 (full_filename): Define.
4450 (full_filename_): Rename from full_filename.
4452 Begin to make AD_* functions more generic.
4453 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4454 (AD_push): Likewise.
4455 (AD_INIT_OTHER_MEMBERS): Define.
4456 (remove_dir): Define the `status' member manually after each
4457 call to AD_push or AD_push_initial.
4459 * src/Makefile.am (check-misc): New rule, to ensure that no more
4460 S_IS* macro definitions sneak into the code.
4461 (check): Depend on check-misc.
4463 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
4464 * src/du.c (count_entry) [S_ISLNK]: Don't define.
4465 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
4467 2003-01-03 Jim Meyering <jim@meyering.net>
4469 * src/true.c: Add copyright.
4470 (AUTHORS): I suppose I've written it.
4472 * src/Makefile.am (false.c): Make the generated file be read-only.
4474 2003-01-04 Jim Meyering <jim@meyering.net>
4476 * src/ls.c: Include "dev-ino.h".
4477 [struct dev_ino]: Remove declaration.
4479 2003-01-02 Jim Meyering <jim@meyering.net>
4481 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4482 from mv: s/missing file arguments/missing file argument/.
4483 With --target-directory=DIR, cp and mv work with a single file argument.
4484 Reported by Karl Berry.
4486 * tests/rm/isatty: Enable this test.
4488 2002-12-31 Jim Meyering <jim@meyering.net>
4490 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4491 (AD_push): Likewise.
4492 (AD_INIT_OTHER_MEMBERS): Define.
4493 (remove_dir): Define the `status' member manually after each
4494 call to AD_push or AD_push_initial.
4496 * src/ls.c [struct dev_ino]: Remove definition.
4497 Include "dev-ino.h" instead.
4499 2002-12-28 Jim Meyering <jim@meyering.net>
4501 * tests/du/Makefile.am (TESTS): Add no-deref.
4502 * tests/du/no-deref: New script.
4504 2002-12-23 Jim Meyering <jim@meyering.net>
4506 * src/remove.c (remove_cwd_entries): Fix typo in comment.
4508 2002-12-21 Jim Meyering <jim@meyering.net>
4510 * announce-gen: Generate MML-formatted announcement.
4511 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4513 2002-12-20 Jim Meyering <jim@meyering.net>
4515 * src/touch.c (touch): Change the wording of a diagnostic so
4516 that it makes sense both when the file exists and when it doesn't.
4517 Suggestion from Michael Stone.
4519 2002-12-18 Jim Meyering <jim@meyering.net>
4521 * src/stty.c (valid_options): Declare to be static.
4523 2002-12-15 Jim Meyering <jim@meyering.net>
4525 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4527 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4528 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4529 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4530 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4531 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4533 * src/remove.c (PARAMS): Remove definition.
4534 * src/sys2.h: Likewise.
4536 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4537 Include strftime.h instead.
4539 2002-12-14 Jim Meyering <jim@meyering.net>
4541 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4543 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4544 This is necessary at least for Irix6.5 when using c89.
4545 Reported by Nelson Beebe.
4547 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4549 * tests/misc/cat-tty-eof: New test.
4551 * src/mknod.c (usage): Specify how major and minor mode numbers
4552 are interpreted. Report forwarded by Kristin E Thomas.
4553 * src/mknod.c: Remove now-redundant usage-specifying comment.
4555 2002-12-13 Jim Meyering <jim@meyering.net>
4559 * tests/du/trailing-slash: Allow for a directory of size `0'.
4560 That happens at least on file systems of type tmpfs on linux-2.4.18.
4562 * announce-gen: New script to begin replacing the commands
4563 associated with the rule here...
4564 * Makefile.maint (announcement): Invoke announce-gen.
4565 * Makefile.am (EXTRA_DIST): Add announce-gen.
4567 * tests/cp/preserve-2: New file/test, for latest fix.
4568 * tests/cp/Makefile.am (TESTS): Add preserve-2.
4570 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
4572 Fix a bug whereby cp would fail to parse an option like
4573 --preserve=mode,ownership.
4574 * src/cp.c (decode_preserve_arg): Advance `comma' to
4575 point the character following the comma.
4577 2002-12-11 Jim Meyering <jim@meyering.net>
4579 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4580 in case it's already defined.
4582 2002-12-09 Jim Meyering <jim@meyering.net>
4584 * tests/touch/fail-diag: Don't get a test failure if /no exists.
4585 Instead, evoke a framework failure if /no-$$ exists.
4586 Reported by Michael Stone.
4588 2002-12-08 Jim Meyering <jim@meyering.net>
4590 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4591 Define to rpl_lstat, so that even on systems like Solaris 5.8,
4592 du honors (per POSIX) the trailing slash on an argument referring
4593 to a symlink-to-directory.
4595 2002-12-06 Jim Meyering <jim@meyering.net>
4597 * Use autoconf-2.57. Regenerate dependent files.
4598 * Use automake-1.7.2. Regenerate dependent files.
4600 * src/ls.c (gobble_file): Also stat the file if it's a
4601 regular file and --indicator-style=classify (aka -F).
4602 Thanks to Ed Santiago for opening my eyes.
4604 * tests/ls/file-type: New file. Test for the above.
4605 A test to contrast ls -F and ls --indicator-style=file-type.
4606 * tests/ls/Makefile.am (TESTS): Add file-type.
4608 2002-12-04 Jim Meyering <jim@meyering.net>
4610 * tests/ls/follow-slink: Make sure the symlink was created.
4611 Richard Dawe reported that `ln -s link link' succeeds, but creates
4612 no file on systems running some version of the DJGPP libc.
4614 2002-12-03 Jim Meyering <jim@meyering.net>
4616 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4617 since this package no longer panders to K&R compilers.
4619 2002-12-02 Jim Meyering <jim@meyering.net>
4621 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4623 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4624 something to replace.
4626 2002-12-01 Jim Meyering <jim@meyering.net>
4628 * src/stat.c: Don't include <string.h> or <ctype.h>.
4629 That's already done via system.h.
4630 * src/dircolors.c: Don't include <ctype.h>.
4632 2002-11-30 Jim Meyering <jim@meyering.net>
4634 * ls.c (gobble_file): Remove the block of code that caused
4635 `ls --color -F symlink-to-dir' to list the files in
4636 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4637 like `ls -F symlink-to-dir') but with the addition of highlighting.
4638 Similarly, `ls --color -dF symlink-to-dir' would print
4639 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4640 Reported by Jeff Sheinberg as Debian bug #168203.
4641 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4643 ls is now more efficient: with certain options, it no longer needs
4644 to stat each directory entry on systems with valid dirent.d_type.
4645 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4646 (main): Make --recursive set format_needs_type, not format_needs_stat.
4647 (gobble_file): Remove a FIXME comment, now that it's fixed.
4649 2002-11-24 Jim Meyering <jim@meyering.net>
4651 * src/du.c (du_files): Don't strip any trailing slash.
4652 Rewrite so that `/' is no longer represented internally as
4654 (count_entry): When appending a file name component,
4655 account for the fact that the current path may end in `/'.
4656 François Pinard reported that `du symlink-to-dir/' was not
4657 equivalent to `du symlink-to-dir/.'. Now it is.
4658 * tests/du/trailing-slash: New file/test, for the above fix.
4659 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4661 2002-11-23 Jim Meyering <jim@meyering.net>
4663 * src/tac.c (output): Declare some local variables to be of type size_t,
4664 rather than `int' to avoid warnings from gcc.
4666 2002-11-21 Paul Eggert <eggert@twinsun.com>
4668 * src/ls.c (decode_switches): Use case-sensitive matching to
4669 decode the QUOTING_STYLE environment variable. This is more
4670 consistent with the documentation, and with --quoting-style.
4672 2002-11-21 Martin Buck <martin.buck@ascom.ch
4674 * src/stty.c (struct speeds): Add support for all baud rates defined
4677 2002-11-19 Jim Meyering <jim@meyering.net>
4679 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4680 run in a UTF locale. Report and suggested fix by Bruno Haible.
4681 * tests/fmt/basic: Likewise.
4683 2002-11-17 Jim Meyering <jim@meyering.net>
4685 * configure.ac: Update via autoupdate.
4686 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4688 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4689 Reported by Hans Ginzel.
4691 2002-11-15 Jim Meyering <jim@meyering.net>
4693 * Makefile.cfg (gnu_rel_host): Define.
4694 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4695 on whether $(VERSION) looks like a major release number.
4697 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4698 (release): Rename from `alpha'.
4699 (alpha): Depend on release.
4701 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4703 2002-11-14 Jim Meyering <jim@meyering.net>
4705 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4706 (announcement): Use the new variable.
4708 * Makefile.maint: Sync with Bison, i.e.:
4709 (po-check): Scan .l and .y files instead of the
4710 .c and the .h files that they generate. This fixes the bug
4711 reported by Tim Van Holder in:
4712 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4713 Look for N_ as well as for _. Try to avoid matching #define for
4717 2002-11-12 Jim Meyering <jim@meyering.net>
4719 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4720 Replace sole use with equivalent `#ifdef S_ISLNK'.
4721 Inconsistency reported by Dmitry V. Levin.
4723 2002-11-11 Jim Meyering <jim@meyering.net>
4725 * src/stat.c (usage): Transform --help items output via s/ - / /,
4726 so that help2man produces properly formatted man pages.
4727 Reported by Herbert Xu as Debian bug #168400.
4729 2002-11-10 Jim Meyering <jim@meyering.net>
4731 * src/ls.c (sighandler): Handle SIGTSTP specially.
4732 Based on suggestions from Solar Designer and Dmitry V. Levin.
4735 * Makefile.cfg (cvs_files): Define. From autoconf.
4736 (local_updates): Likewise.
4738 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4740 (sighandler): New function, based on the one in sort.c.
4741 (main): Use sigaction, if possible; otherwise signal.
4742 Handle these signals:
4743 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4744 Don't register our handler if the signal is already being ignored.
4746 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4747 * src/csplit.c (interrupt_handler): Likewise.
4748 * src/sort.c (sighandler): Likewise.
4749 (main): Declare `i' and `nsigs' to be unsigned, not int.
4751 2002-11-09 Jim Meyering <jim@meyering.net>
4753 ls --color: restore terminal text color upon signal.
4754 * src/ls.c: Include "full-write.h" and <signal.h>.
4755 (restore_default_color, restore_default_color_handler): New functions.
4756 (sigtstp_handler, put_indicator_direct): New functions.
4757 (main) [print_with_color]: Register signal handlers.
4758 Patch mostly by Solar Designer and Stanislav Ievlev.
4760 Update from autoconf.
4761 * Makefile.maint (AMTAR): Remove definition.
4762 (update, cvs-update, po-update, do-po-update): New rules.
4763 (wget-update): Update (thus renaming to cvs-update).
4764 (automake_repo): Use anoncvs@sources.redhat.com.
4766 2002-11-06 Jim Meyering <jim@meyering.net>
4768 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4770 * tests/misc/printf: Be careful to test the code in this package,
4771 not the shell built-in function.
4773 * src/printf.c (print_esc): A hexadecimal escape sequence has
4774 at most two hex. digits, not three. Reported by Padraig Brady.
4775 (usage): Update description.
4776 * tests/misc/printf-hex: New file/test, for the above fix.
4778 2002-10-07 Paul Eggert <eggert@twinsun.com>
4780 Add support for locale-specific size indications (e.g.,
4781 thousands-separators) and for explicit size suffixes on output.
4783 * doc/coreutils.texi (Block size): Say that:
4784 This affects display format as well as block size.
4785 Fractional block counts are rounded up.
4786 ls file size blocksize defaults to 1.
4787 A block size spec preceded by ' generates thousands separators.
4788 A suffix without a preceding integer generates suffixes.
4789 (tail invocation): 32k -> 32 KiB.
4790 (What information is listed): ls -h is now equivalent to
4791 ls --block-size=human, and ls -H is now equivalent to
4792 ls --block-size=si. Displayed file size is now always affected by
4795 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4796 lib/umaxtostr.c: New files, taken from GNU tar.
4798 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4800 (EXTRA_DIST): Add inttostr.c.
4802 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4803 notations like thousands separators.
4804 Specify what includer of include.h must include beforehand.
4805 (human_group_digits, human_suppress_point_zero, human_autoscale,
4806 human_base_1024, human_SI, human_B): New enum values.
4807 (human_readable): Rename from human_readable_inexact; put the
4808 options before the sizes. All uses changed. The old human_readable
4809 function has been removed; use inttostr.h instead.
4810 (human_options): Renamed from human_block_size, with new signature
4811 that allows block sizes up to UINTMAX_MAX. All callers changed.
4813 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4814 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4815 freestanding C89. No need to check for stdlib.h or string.h since
4816 autoconf does this now.
4818 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4819 human.h, to print large numbers simply.
4820 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4821 * src/dd.c (print_stats, main): Likewise.
4822 * src/df.c (print_header): Likewise.
4823 * src/factor.c (print_factors): Likewise.
4824 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4825 * src/shred.c (dopass): Likewise.
4826 * src/sort.c (checkfp): Likewise.
4827 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4828 * src/tail.c (xlseek): Likewise.
4829 * src/wc.c (write_counts, wc): Likewise.
4831 * src/df.c (human_output_opts): New var.
4832 (output_block_size): Now uintmax_t, not int, to handle larger
4833 block sizes. All uses changed.
4834 * src/du.c: Likewise.
4835 * src/ls.c: Likewise.
4837 * src/df.c (print_header): In the header line, prefer SI to human
4838 representation if it's shorter; if neither is shorter, try to
4839 intuit what the user would prefer.
4841 * src/expr.c (inttostr): Remove; use new imaxtostr library
4844 * src/ls.c (file_output_block_size): New var, to distinguish
4845 file sizes from other sizes.
4846 (decode_switches): Set it.
4848 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4849 (dopass): When printing progress, use floor for what has been done
4850 so far (since we should be conservative there), and ceiling for
4851 what needs to be done (since that's what other programs use).
4853 2002-10-19 Jim Meyering <jim@meyering.net>
4855 * src/pinky.c (print_heading): Align TTY and Name headings.
4856 Reported by Karl Eichwalder.
4858 2002-10-18 Jim Meyering <jim@meyering.net>
4860 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4861 Remove now-useless cast.
4862 (stdread): Remove function.
4863 (bytes_split): Use size_t instead of int.
4864 Use safe_read, not stdread.
4865 (lines_split): Likewise.
4866 Use memchr rather than a `while' loop.
4867 (line_bytes_split): Use size_t instead of int.
4868 Use safe_read, not stdread.
4869 (main): Add some FIXME comments to remind me to remove casts.
4871 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4872 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4874 2002-10-17 Jim Meyering <jim@meyering.net>
4876 Fix a problem that could make e.g., `cat' misbehave on systems which
4877 give invalid (unreasonably large) values for stat.st_blksize.
4878 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4879 Reported by Petter Reinholdtsen.
4881 2002-10-14 Jim Meyering <jim@meyering.net>
4883 Specifying a printf conversion specifer as nl's separator string
4884 could cause nl to segfault.
4885 * src/nl.c (build_print_fmt): Don't include separator string
4886 in the printf format; it might contain `%'.
4887 Use a better bound on the length of the print_fmt buffer.
4888 (print_lineno): Print the separator here instead.
4889 Reported by Doug Coleman.
4891 * tests/misc/nl: New file/tests, including a test for the above.
4892 * tests/misc/Makefile.am (TESTS): Add nl.
4894 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4895 * tests/misc/Makefile.am (TESTS): Add split-l.
4897 2002-10-13 Jim Meyering <jim@meyering.net>
4901 * src/du.c (usage): Tweak description of --dereference-args/-D.
4903 * src/du.c (count_entry): Also save cwd when dereferencing (via
4904 --dereference-args, -D) a command-line argument.
4905 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4907 * src/Makefile.am (../AUTHORS): New target/rule.
4909 2002-10-12 Jim Meyering <jim@meyering.net>
4911 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4912 of type size_t, since that's the way it's used and avoids a warning.
4914 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4915 since that's how it's always used and avoids a new warning from gcc.
4916 (read_input): Adapt to new safe_read ABI.
4918 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4921 * src/pinky.c (print_long_entry): fread returns size_t.
4922 Declare local `bytes' accordingly, to avoid warning.
4924 tail -c +N would perform an extra read after encountering EOF
4925 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4926 * src/tail.c (start_bytes): Detect EOF, inform caller.
4927 (tail_bytes): Upon EOF in start_bytes, return immediately.
4928 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4929 Adapt to new safe_read ABI.
4931 2002-10-11 Jim Meyering <jim@meyering.net>
4933 * tests/du/deref: New file/test, for the above fix.
4934 * tests/du/Makefile.am (TESTS): Add deref.
4936 2002-10-10 Jim Meyering <jim@meyering.net>
4938 * tests/ln/Makefile.am (TESTS): Add target-1.
4939 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4941 2002-10-09 Jim Meyering <jim@meyering.net>
4943 * tests/cp/backup-is-src: Ensure that certain environment variables
4944 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4946 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4947 consume 4GB of disk space on systems without support for sparse files.
4948 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4950 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4951 Patch by steven@magelico.net, forwarded by Michael Stone.
4953 * tests/ls/dired: Ensure that ls produces English messages.
4954 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4956 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4958 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4960 2002-10-08 Jim Meyering <jim@meyering.net>
4962 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4963 Fix syntax in test: use =, not ==.
4964 Reported by Bob Proulx.
4965 Change all the rest like this: grep -lR "testing framework'" .\
4966 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4968 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4969 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4970 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4971 * src/wc.c (wc): Likewise.
4973 2002-10-07 Paul Eggert <eggert@twinsun.com>
4976 Don't advance the write pointer past the end of the write buffer.
4977 * src/sort.c (begfield, limfield): Likewise.
4979 2002-10-07 Jim Meyering <jim@meyering.net>
4981 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4982 * src/head.c (head_bytes, head_lines): Likewise.
4984 2002-10-06 Jim Meyering <jim@meyering.net>
4986 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4987 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4988 (skip, dd_copy): Adapt to new safe_read ABI.
4990 * Makefile.maint (signatures): Define.
4992 (announcement): Depend on $(signatures).
4994 * Makefile.maint (announcement): Output all URLs for detached
4995 signatures, not just the last one from the previous loop.
4997 2002-10-05 Jim Meyering <jim@meyering.net>
5001 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
5002 don't recurse into directory, DIR. Prompted by a report from
5005 * tests/rm/i-no-r: New file/test, for the above fix.
5006 * tests/rm/Makefile.am (TESTS): Add i-no-r.
5008 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
5009 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
5011 2002-10-03 Jim Meyering <jim@meyering.net>
5013 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
5014 * src/df.c (AUTHORS): Likewise.
5015 * src/du.c (AUTHORS): Likewise.
5016 * src/tail.c (AUTHORS): Likewise.
5017 * src/touch.c (AUTHORS): Likewise.
5019 2002-10-02 Jim Meyering <jim@meyering.net>
5021 * Makefile.am (SUBDIRS): Remove `old'.
5022 (EXTRA_DIST): List the files in old/.
5023 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
5024 Suggestion from Akim Demaille.
5026 2002-10-01 Jim Meyering <jim@meyering.net>
5028 * src/sys2.h (SSIZE_MAX): Define.
5030 2002-09-30 Jim Meyering <jim@meyering.net>
5032 * src/csplit.c: Don't include stdlib.h here. It's already included
5035 2002-09-29 Jim Meyering <jim@meyering.net>
5037 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
5038 expression to avoid bogus warning from gcc.
5040 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
5041 (cat): Declare insize and outsize to be of type size_t, not int.
5042 Rearrange pointer/integer expressions to avoid bogus warnings.
5043 (main): Declare insize and outsize to be of type size_t, not int.
5045 * src/tail.c (parse_options): Give a sensible diagnostic for
5046 an invalid byte or line count. Reported by Mikko Tuumanen.
5048 * src/touch.c (main): Split a long line.
5050 * tests/du/Makefile.am (TESTS): Add slink.
5051 * tests/du/slink: New test for system.h change of 2002-08-31.
5053 In move mode, always first try to rename. Before, upon failure to
5054 rename a directory, this code would never attempt to rename any
5055 other file in that directory, but would thenceforth always copy.
5056 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
5057 may fail with EXDEV, yet renaming files within that directory to
5058 a newly-created destination directory succeeds.
5059 * src/copy.c (copy_internal): Remove local, move_mode;
5060 use x->move_mode instead. Based on a patch from Tom Haynes.
5062 2002-09-28 Jim Meyering <jim@meyering.net>
5064 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
5065 Factor out some duplication.
5067 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
5069 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
5071 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
5072 to avoid compiler warnings.
5074 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
5077 Fix things so `mkdir -p' can create very deep directories, e.g.,
5078 mkdir -p $(perl -e 'print "a/" x 40000') now works.
5079 * src/mkdir.c (main): For --parents (-p), call make_path with the
5080 entire directory name, so we don't ever require that file operations
5081 like stat or chmod be performed on the entire command line argument.
5082 * makepath.c (make_path): Restore umask *before* creating the final
5085 2002-09-27 Andreas Schwab <schwab@suse.de>
5087 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
5088 to avoid overflow. Reported by Hans Lermen.
5090 2002-09-26 Jim Meyering <jim@meyering.net>
5092 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
5094 2002-09-25 Jim Meyering <jim@meyering.net>
5096 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
5097 and add a cast, to avoid a warning about `signed and unsigned type in
5098 conditional expression'.
5100 2002-09-22 Jim Meyering <jim@meyering.net>
5102 * src/rmdir.c: Include "dirname.h", for declaration of
5103 strip_trailing_slashes.
5105 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
5106 Now they're defined through system.h.
5108 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
5109 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
5110 since it's already included from sys2.h via system.h.
5112 * Use automake-1.6f. Regenerate dependent files.
5114 * src/Makefile.am (PERL): Remove duplicate definition.
5116 fmt's -s, -t, -c options didn't work properly for long lines.
5117 Since get_line may end up calling put_paragraph (for long lines),
5118 be sure to set global, `other_indent', before it is used there.
5120 * src/fmt.c (set_other_indent): New function, factored out of...
5121 (get_paragraph): ... here. Call it.
5122 (get_line): Call set_other_indent before calling flush_paragraph,
5123 which calls fmt_paragraph, which in turn calls put_paragraph,
5124 which uses other_indent.
5126 * tests/fmt/Makefile.am (TESTS): Add long-line.
5127 * tests/fmt/long-line: New file/test, for the above fix.
5129 2002-09-21 Jim Meyering <jim@meyering.net>
5131 * src/od.c: No longer include deprecated <values.h>.
5132 It was required solely for now-removed reference to BITSPERBYTE.
5133 * src/install.c: Likewise.
5134 Suggestion from Bruno Haible.
5136 2002-09-06 Andreas Schwab <schwab@suse.de>
5138 `rmdir -p dir-specified-with-trailing-slash/' would fail.
5139 * src/rmdir.c (remove_parents): Strip trailing slashes.
5141 2002-09-20 Jim Meyering <jim@meyering.net>
5143 * tests/rmdir/t-slash: New file/test, for the above fix.
5144 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
5146 * Makefile.maint (announcement): Arrange to gpg-sign the message.
5147 Add a URL for each detached signature file.
5149 2002-09-07 Bruno Haible <bruno@clisp.org>
5151 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
5153 2002-09-18 Jim Meyering <jim@meyering.net>
5155 `od -t x8' used the wrong (`l'-prefixed) printf format.
5156 Likewise for the o8 and u8 formats.
5157 * src/od.c (ISPEC_TO_FORMAT): Define macro.
5158 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
5159 Reported by Arun Sharma.
5161 2002-09-17 Jim Meyering <jim@meyering.net>
5163 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
5164 From gettext's intl/loadmsgcat.c.
5166 * tests/od/x8: New file/test, for the above fix.
5167 * tests/od/Makefile.am (TESTS): Add x8.
5169 2002-09-15 Jim Meyering <jim@meyering.net>
5171 * Use autoconf-2.54. Regenerate dependent files.
5173 * src/csplit.c (get_format_width): Add cast to avoid
5174 warning about `signed and unsigned type in conditional expression'.
5176 2002-09-14 Jim Meyering <jim@meyering.net>
5178 * src/who.c (print_user): Change type of local to size_t
5179 to avoid warnings about `comparison between signed and unsigned'.
5180 * src/ptx.c (generate_all_output): Likewise.
5182 * src/dd.c (main, skip): Add casts to avoid warnings about
5183 `comparison between signed and unsigned'.
5185 * src/id.c (print_full_info, print_group_list): Add casts to avoid
5186 warnings about `signed and unsigned type in conditional expression'.
5188 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
5189 to avoid warnings about `comparison between signed and unsigned'.
5190 (split_3): Change parameter names to be readable and add comment.
5191 Clean up the test for whether a line may be ignored.
5193 2002-09-13 Jim Meyering <jim@meyering.net>
5195 * src/printf.c (main): Handle leading command line argument of `--'.
5196 Reported by Raul: DervishD <raul@pleyades.net>
5197 * tests/misc/printf: New file: test for the above.
5198 * tests/misc/Makefile.am (TESTS): Add printf.
5200 * src/date.c (usage): Explain that %S's range of [0..60] is required --
5201 rather than 0..59 -- to accommodate the occasional positive leap second.
5202 Reported by Richard Neill.
5204 2002-09-12 Jim Meyering <jim@meyering.net>
5206 * src/Makefile.am (nanosec_libs): Define.
5207 (sleep_LDADD, tail_LDADD): Use it here.
5209 Factor nanosleep-related code into ../lib/xnanosleep.c.
5210 * src/sleep.c: Include xnanosleep.h.
5211 Factor out fenv.h-related code.
5212 (timespec_subtract): Remove function.
5213 (main): Remove code that deals with computing start and stop times
5214 as well as the loop around nanosleep. Now that's in xnanosleep.c.
5216 Allow S (in --sleep-interval=S) to be a floating point value.
5217 * src/tail.c: Include xnanosleep.h and xstrtod.h.
5218 Move declaration of global variable, sleep_interval, to ...
5220 (usage): Update description of --sleep-interval option.
5221 (tail_forever): New parameter, sleep_interval. Update caller.
5222 Use xnanosleep, rather than sleep.
5223 (parse_options): New parameter, sleep_interval. Update caller.
5224 Use xstrtod, now that we accept floating point values.
5225 Prompted by a patch from Augey Mikus.
5227 2002-09-06 Jim Meyering <jim@meyering.net>
5229 * src/remove.c (prompt): Change comment to give a better note to
5230 translators. From Michael Piefel.
5232 2002-09-02 Jim Meyering <jim@meyering.net>
5234 * README: A good problem report/patch includes diffs against
5235 the most recent test release.
5237 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
5238 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
5240 * src/kill.c (print_table_row): Use an unsigned type for widths
5241 to avoid warning about comparison between signed and unsigned.
5242 (list_signals): Likewise.
5244 * src/od.c (skip): Add a cast to avoid warning about comparison
5245 between signed and unsigned.
5246 * src/install.c (get_ids): Likewise. Also rearrange range-checking
5247 comparisons to make them more readable.
5249 2002-09-01 Jim Meyering <jim@meyering.net>
5253 2002-08-31 Jim Meyering <jim@meyering.net>
5255 Symlinks were always reported as using 0 blocks.
5256 * src/system.h (ST_NBLOCKS): Don't depend on file type.
5257 This reverts the change of 2000-01-30.
5258 Based on a report and patch from Neil Brown via Michael Stone.
5259 This fixes Debian Bug#156358.
5261 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
5262 `exit (1)' to `exit (EXIT_FAILURE)', and
5263 `usage (1)' to `usage (EXIT_FAILURE)'.
5265 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
5266 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
5267 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
5268 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
5269 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
5270 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
5271 error never exits successfully.
5273 2002-08-29 Jim Meyering <jim@meyering.net>
5275 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
5276 when ignoring any return value.
5278 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
5279 failures. On some systems (at least EMC Celerra and Solaris5.8),
5280 this appears to be necessary.
5281 (is_empty_dir): Likewise. Also, always close directory handle.
5282 * src/ls.c (print_dir): Likewise.
5283 (print_dir): Rename local variable: reading -> dirp.
5284 Reported by Mike Coleman.
5286 2002-08-28 Jim Meyering <jim@meyering.net>
5288 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
5289 Give a diagnostic and fail if closedir fails.
5291 2002-08-26 Jim Meyering <jim@meyering.net>
5293 * Makefile.am (THANKS-to-translators): New rule.
5294 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
5295 * THANKStt.in: New file.
5297 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
5299 (main): Register it with atexit.
5300 Close STDOUT_FILENO, to avoid a problem when writing to
5301 /dev/audio on at least Solaris 5.7 and 5.8 systems.
5302 Reported by Shing-Shong Shei.
5304 2002-08-25 Jim Meyering <jim@meyering.net>
5306 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
5307 * src/tac.c (main): Likewise.
5308 * src/tail.c (main): Likewise.
5309 * src/tee.c (main): Likewise.
5310 * src/tr.c (main): Likewise.
5311 * src/wc.c (main): Likewise.
5313 2002-08-20 Jim Meyering <jim@meyering.net>
5315 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
5317 2002-08-10 Paul Eggert <eggert@twinsun.com>
5319 * src/nohup.sh: Don't use "exec --"; it's not portable and
5320 shouldn't be needed.
5322 2002-08-09 Jim Meyering <jim@meyering.net>
5324 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
5325 (usage): Clarify help text for the -COLUMN option.
5326 Patch by Padraig Brady.
5327 * tests/pr/Test.pm [col-last]: New test for the above.
5329 * configure.ac: Start with version 4.5.1, chosen so that it's larger
5330 than the latest version numbers of the component packages.
5332 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
5335 2002-08-08 Jim Meyering <jim@meyering.net>
5337 * src/date.c: Guard inclusion of <langinfo.h> with
5338 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
5339 * src/sort.c: Likewise.
5340 Patch by GOTO Masanori.
5342 2002-08-05 Paul Eggert <eggert@twinsun.com>
5344 Fix some minor time-related bugs with POSIX time arguments.
5345 Some valid time stamps were being rejected (notably -1, and
5346 time stamps before 1900 on 64-bit hosts). And some invalid
5347 time stamps were being accepted, e.g. September 31.
5349 * src/date.c (main): Adjust to posixtime signature change.
5350 * src/touch.c (main): Likewise. Remove unnecessary initialization.
5351 Use localtime, not posixtm, to warn about obsolete "touch".
5353 2002-08-05 Jim Meyering <jim@meyering.net>
5355 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
5357 2002-08-04 Jim Meyering <jim@meyering.net>
5359 * src/Makefile.am (check-README): New target/rule.
5360 (check): Depend on it.
5362 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
5364 2002-08-03 Jim Meyering <jim@meyering.net>
5366 * Makefile.am (SUBDIRS): Add old.
5367 * old/: New directory, containing legacy ChangeLog* and NEWS files
5368 from the fileutils, sh-utils, and textutils packages.
5370 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
5372 2002-08-02 Paul Eggert <eggert@twinsun.com>
5374 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
5376 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
5377 (hard_LC_COLLATE): New var.
5378 (different): Args are now char *, not const char *.
5379 Use xmemcoll instead of memcmp to compare lines, so that
5380 LC_COLLATE has effect. However, use memcmp if it is an
5382 (check_file): Do not include newline in comparison, so that
5383 xmemcoll has a byte to stomp on temporarily.
5384 (main): Set hard_LC_COLLATE.
5386 2002-07-29 Jim Meyering <jim@meyering.net>
5388 * Makefile.am (SUBDIRS): Remove djgpp, for now.
5390 2002-07-20 Jim Meyering <jim@meyering.net>
5392 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
5393 into EXIT_FAILURE. Otherwise, false --help and false --version
5396 2002-07-08 Jim Meyering <jim@meyering.net>
5398 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
5399 rather than the hard-coded `sh-utils'.
5401 2002-07-01 Jim Meyering <jim@meyering.net>
5403 * configure.ac: Merge the three files from fileutils,
5404 textutils, and sh-utils.
5405 * Makefile.am: Likewise.
5406 * src/Makefile.am: Likewise.