1 2003-09-19 Jim Meyering <jim@meyering.net>
5 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
7 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
8 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
9 Mark each WRITTEN_BY string as translatable.
11 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
12 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
13 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
14 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
15 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
16 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
17 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
18 * who.c, whoami.c, yes.c: Revert yesterday's changes.
19 Instead, a subsequent change will embed `Written by ' in
20 each string along with the author names.
22 * src/true.c: Revert yesterday's changes.
23 * src/sys2.h: Likewise.
25 2003-09-18 Jim Meyering <jim@meyering.net>
27 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
28 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
29 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
30 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
31 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
32 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
33 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
34 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
35 comma-separated list of strings and/or update the call to
36 parse_long_options so that `AUTHORS, NULL' are the last parameters.
37 * src/true.c (main): Append NULL to version_etc argument list.
38 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
40 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
41 shadowing the math function name. Also rename loga to log_a.
43 2003-09-14 Jim Meyering <jim@meyering.net>
45 * src/factor.c (print_factors): Give a separate diagnostic
46 for numbers that are too large, but otherwise valid.
47 Reported by Dániel Varga.
49 2003-09-10 Jim Meyering <jim@meyering.net>
51 * Use automake-1.7.7. Regenerate dependent files.
53 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
54 of `fmt -1'. Using the just-built tr is a little cleaner.
55 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
56 * man/Makefile.am (programs, check-x-vs-1): Likewise.
58 2003-09-09 Jim Meyering <jim@meyering.net>
60 * src/copy.c: Alphabetize includes.
61 Remove duplicate inclusion of "same.h".
63 2003-09-08 Jim Meyering <jim@meyering.net>
65 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
66 Didn't give enough of a benefit, mainly because it's not yet
71 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
72 (check-programs-vs-x): Fail if $(programs) is empty.
74 * src/remove.c: Add a comment.
76 2003-09-07 Jim Meyering <jim@meyering.net>
78 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
79 Don't define. These symbols are no longer used.
81 * tests/misc/tty-eof: Write ^D as \cD.
82 Complete the change of 2003-08-02.
84 * Makefile.maint (po-check): Use cvsu, so that a temporary source
85 file in lib/ or src/ doesn't induce an unwarranted failure.
86 Add a kludge to filter out the sole generated source file that
87 also has translatable messages: src/false.c.
89 2003-09-06 Jim Meyering <jim@meyering.net>
91 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
92 (parse_options): Give a diagnostic for (but still accept) the
93 deprecated --allow-missing option.
95 2003-09-04 Paul Eggert <eggert@twinsun.com>
97 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
98 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
100 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
101 size_bound ourselves. if an input file is a pipe and the user
102 specified a size, use that size instead of trying to guess the
103 pipe size. This has the beneficial side effect of avoiding the
104 overhead of default_sort_size in that case. All callers changed.
105 (sort): Remove static var size; now done by sort_buffer_size.
107 2003-09-05 Jim Meyering <jim@meyering.net>
109 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
111 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
112 to start, rather than just .1. Upon failure, print unexpected state.
114 2003-09-04 Paul Eggert <eggert@twinsun.com>
116 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
117 SAFE_READ_ERROR to tmp->nbytes.
118 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
120 * src/head.c (struct linebuffer): Change nbytes and nlines
121 from unsigned int to size_t. unsigned int is safe (after the
122 2003-09-03 patch) but size_t is cleaner.
123 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
124 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
126 Standardize on BUFSIZ as opposed to other macro names and values.
127 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
128 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
129 stdio.h has always defined it,
130 and other code already assumes it's defined.
131 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
132 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
133 (io_buf): IO_BUF_SIZE -> BUFSIZ.
135 2003-09-04 Paul Eggert <eggert@twinsun.com>
137 * src/seq.c (step): Default to 1.
138 (print_numbers): Allow the output to be empty.
139 (main): The default step is 1, even if LAST < FIRST;
140 as per documentation.
141 * tests/seq/basic (onearg-2): Output should be empty.
143 2003-09-05 Jim Meyering <jim@meyering.net>
145 * Makefile.cfg (wget_files): Temporarily disable, until master
146 versions are restored to ftp.gnu.org.
148 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
150 Make seq's --width (-w) option work properly even when the
151 endpoint requiring the larger width is negative and smaller than
153 * src/seq.c (get_width_format): Include `-' in the set of bytes
154 allowed in a `simple' number (no decimal point, no exponent).
155 Reported by Patrick Mauritz.
157 2003-09-02 Paul Eggert <eggert@twinsun.com>
159 * NEWS: sort -t '\0' now uses a NUL tab.
160 sort option order no longer matters, unless POSIX requires it.
161 * src/sort.c (usage): Say "blanks" instead of "whitespace",
162 Similar fixes for many comments.
163 (TAB_DEFAULT): New constant, so that we can support NUL as
165 (tab): Now int, not char. Initialize to TAB_DEFAULT.
166 (specify_sort_size): If multiple sizes are specified, use the largest.
167 (begfield, limfield): Support NUL tab char.
168 (set_ordering): Do not let -i override -d.
169 (main): Report an error if incompatible -o or -t options are given.
170 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
172 2003-09-05 Jim Meyering <jim@meyering.net>
174 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
176 2003-09-03 Andreas Schwab <schwab@suse.de>
178 Bug report and patch here:
179 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
180 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
181 * src/head.c (elide_tail_lines_pipe): Likewise.
183 2003-09-03 Jim Meyering <jim@meyering.net>
185 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
186 small amount of code from him was first moved to lib/human.c, and was
187 subsequently rewritten entirely.
188 * src/df.c (AUTHORS): Likewise.
190 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
192 * src/md5sum.c (split_3): Accept the BSD format for generic
193 message digest modes. Currently works with BSD's MD5 and SHA1
194 formats since these are the two algorithms presently used in
195 coreutils. Updated comments to reflect this change.
196 (bsd_split_3): Updated comments.
198 * tests/md5sum/basic-1: New test to make sure that
199 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
200 from `check-bsd' test in tests/sha1sum/basic-1).
202 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
203 --check exit status and BSD SHA1 format (adapted from tests
204 in tests/md5sum/basic-1).
206 2003-08-30 Jim Meyering <jim@meyering.net>
208 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
210 When source and destination arguments refer to the same file, reside
211 on a partition (e.g. VFAT) on which distinct names may refer to the
212 same directory entry (often due to variations in case), and when the
213 link count for the file is 1, mv no longer unlinks the file. Instead,
214 it gives the expected diagnostic that the source and destination are
215 the same. WARNING: this is an incomplete fix. If the file happens
216 to have a link count of 2 or greater, such an erroneous mv command
217 will still unlink it.
218 Although that is not possible on vfat or umsdos, it is possible on
219 other file system types, e.g., ntfs, and hpfs.
220 * src/copy.c (same_file_ok): Invoke same_name (which might still
221 return false for names that refer to the same directory entry)
222 only if the link count is 2 or more.
223 * tests/mv/vfat: Show how to demonstrate the above problem.
224 This test is not run.
225 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
227 2003-08-27 Jim Meyering <jim@meyering.net>
229 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
230 who's -l option has been eliciting an unconditional warning about
231 this impending change since sh-utils-2.0.12 (April 2002).
233 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
234 This would happen for nonempty files not ending with a newline.
235 Reported by Dan Jacobson.
236 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
237 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
239 * src/stat.c (print_it): Avoid buffer overrun that would
240 occur when the user-specified format string ends with `%'.
241 Patch by Tommi Kyntola.
242 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
243 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
245 2003-08-26 Jim Meyering <jim@meyering.net>
247 Apply changes from bison.
248 * GNUmakefile (SHELL): Define to `sh', if necessary.
250 * Makefile.maint (WGETFLAGS): Define to `-C off'.
251 Update all uses of $(WGET).
253 2003-08-22 Akim Demaille <akim@epita.fr>
255 * Makefile.cfg (local-checks-to-skip): New.
256 * Makefile.maint (local-check): Rename as...
257 (local-checks-available): this.
260 2003-08-26 Akim Demaille <akim@epita.fr>
262 * announce-gen (print_changelog_deltas): Neutralize "<#" as
263 "<\#" to avoid magic from Gnus when posting parts of this script.
265 2003-08-25 Jim Meyering <jim@meyering.net>
267 * src/stat.c (main): Warn about use of deprecated `-l' option.
269 2003-08-22 Jim Meyering <jim@meyering.net>
271 * src/stat.c (do_stat): For link count at end of line, use %h format,
272 instead of %-5h. The latter would make stat emit trailing spaces.
273 Reported by Dan Jacobson.
275 2003-08-20 Jim Meyering <jim@meyering.net>
277 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
279 2003-08-19 Jim Meyering <jim@meyering.net>
281 * src/system.h: Include stdlib.h unconditionally,
282 as we're now assuming that part of hosted C89.
284 2003-08-18 Jim Meyering <jim@meyering.net>
286 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
287 to avoid warnings from gcc.
289 2003-08-17 Jim Meyering <jim@meyering.net>
291 Avoid unnecessary and sometimes time-consuming hostname lookups.
292 * src/who.c (print_user): Use strchr, not strrchr.
293 * src/pinky.c (print_entry): Likewise.
294 Patch by Michael Stone.
295 This fixes a typo I introduced in who-users.c on 1996-02-23.
297 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
298 disallowed between `@...@'.
300 2003-08-16 Paul Eggert <eggert@twinsun.com>
302 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
303 done by gnulib .m4 files.
304 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
305 * src/sys2.h (strtoull): Remove unused declaration.
307 2003-08-16 Jim Meyering <jim@meyering.net>
309 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
312 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
313 race condition bug. The bug would be triggered when tailing a file
314 with file pointer not at beginning of file, and where the file was
315 truncated to have a length of less than the initial offset at just
316 the right moment (between the two lseek calls in this function).
318 An invalid initial value for *read_pos would result in
319 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
320 busy-wait rather than sleeping between iterations. The bug manifests
321 itself only when tailing regular files that are initially nonempty.
322 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
324 (tail_lines): Likewise, after lseek calls.
325 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
326 * tests/tail-2/tail-n0f: New file. Test for above fix.
327 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
329 2003-08-15 Jim Meyering <jim@meyering.net>
331 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
332 (sc_sun_os_names): Likewise.
333 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
335 * man/help2man: Remove some SPACEs before TAB.
337 2003-08-14 Paul Eggert <eggert@twinsun.com>
339 * Makefile.maint (LC_ALL): Set to C.
340 * man/Makefile.am (ASSORT): New var.
341 (check-x-vs-1, programs): Use it.
342 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
343 * tests/Makefile.am (ASSORT, all_programs): Likewise.
345 2003-08-11 Jim Meyering <jim@meyering.net>
347 fold -s -wN would infloop for N < 8 with TABs in the input.
348 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
349 * src/fold.c (fold_file): Move contents of `else'-block
350 out of conditional so it's used also for --spaces (-s).
351 * tests/misc/fold: Test for the above fix.
352 * tests/misc/Makefile.am (TESTS): Add fold.
354 2003-08-10 Jim Meyering <jim@meyering.net>
356 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
357 system.h so the types from time.h and sys/time.h are available.
358 It appears that this is necessary for OpenBSD, NetBSD, and
359 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
361 2003-08-06 Paul Eggert <eggert@twinsun.com>
363 * NEWS: Add support for setting file timestamps to microsecond
364 resolution, on hosts that support this.
365 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
366 * src/copy.c (copy_internal):
367 Set file timestamps with utimens, not utime.
368 * src/cp.c (re_protect): Likewise.
369 * src/install.c (change_timestamps): Likewise.
370 * src/touch.c (newtime, touch, main): Likewise.
372 2003-08-09 Jim Meyering <jim@meyering.net>
374 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
376 (syntax-check-rules): Add it.
378 * src/tail.c (main): Tweak Solaris OS version number in comment.
379 * src/wc.c (wc): Likewise
380 * tests/tail-2/fflush: Likewise.
382 * src/tail.c: Add new undocumented option, --presume-input-pipe.
383 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
385 2003-08-08 Paul Eggert <eggert@twinsun.com>
387 Use new gnulib 'extensions' module.
388 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
391 2003-08-08 Paul Eggert <eggert@twinsun.com>
393 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
395 2003-08-09 Jim Meyering <jim@meyering.net>
397 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
398 For tests of obsolete behavior, don't presume that unsetting
399 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
401 2003-08-07 Paul Eggert <eggert@twinsun.com>
403 * doc/coreutils.texi (split invocation):
404 Add -d or --numeric-suffixes option to 'split'.
405 From a suggestion by Jesse Kornblum.
406 * src/split.c (suffix_alphabet): New var.
407 (longopts, usage, next_file_name, main): Support -d.
408 (next_file_name, main): Allow -a0, as POSIX requires.
409 (next_file_name): Don't assume ASCII-like encoding;
410 'a' through 'z' are not contiguous in EBCDIC.
412 2003-08-05 Paul Eggert <eggert@twinsun.com>
414 Merge getline from gnulib.
415 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
416 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
417 New files, from gnulib.
418 * lib/getdelim2.c, lib/getdelim2.h: Remove.
419 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
420 getdelim2.h to getndelim2.c and getndelim2.h.
421 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
422 checking for getdelim.
423 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
424 than rolling our own.
425 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
426 (cut_fields): Invoke getndelim2 rather than getdelim2.
428 2003-08-04 Jim Meyering <jim@meyering.net>
430 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
431 and for the indices to iterate through nsigs.
433 2003-08-02 Paul Eggert <eggert@twinsun.com>
435 * src/sort.c: Minor code cleanups, mostly to use more accurate
436 types and to remove unnecessary casts.
437 (min, max): Remove. All uses changed to MIN and MAX.
438 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
439 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
440 keyfield.numeric, struct keyfield.general_numeric, struct
441 keyfield.month, struct keyfield.reverse, reverse, unique,
442 have_read_stdin): Now bool, not int. All uses changed.
443 (eolchar): Now char, not int.
444 (struct keyfield.ignore): Now bool const *, not int *.
445 (struct keyfield.translate): Now char const *, not char *.
446 (struct month.name): Likewise.
447 (blanks, nonprinting, nondictionary): Now bool[], not int[].
448 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
449 check, sort, main): Use const * pointers when possible.
450 (month_cmp): Rewrite to avoid casts.
451 (inittables): Initialize tables unconditionally, to avoid branches.
452 (fillbuf): Return bool, not int. All uses changed.
453 (fillbuf, keycompare, new_key, main):
454 Use SIZE_MAX rather than (size_t) -1.
455 (trailing_blanks): Renamed from trim_trailing_blanks.
456 Return the number of blanks to trim. All uses changed.
457 (getmonth): Use trailing_blanks rather than open code.
458 (keycompare): Do not cast char * to unsigned char *; not needed.
459 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
461 (compare, main): Use | rather than || to avoid jumps.
462 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
464 (check, first_same_file, sort, main):
465 Use bool instead of int local vars when possible.
466 (check): Merge the old 'checkfp' and 'check' into a single function,
467 that returns a boolean (true if the file was ordered).
469 (main): Use int instead of unsigned for iterating through nsigs.
470 Rename local var "posix_pedantic" to "posixly_correct".
472 2003-08-02 Jim Meyering <jim@meyering.net>
474 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
475 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
477 * src/cut.c (cut_fields): Don't read again after encountering an
478 initial EOF. E.g., `cut -f2' would do so.
479 * tests/misc/tty-eof: Add a test for the above fix.
481 * src/sort.c (sortlines): Add description and references.
484 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
485 the tests in help-version will use the just-built binaries.
486 Reported by Christian Krackowizer.
488 2003-07-31 Paul Eggert <eggert@twinsun.com>
490 * NEWS: Add --rfc-2822 option to GNU date.
491 * doc/coreutils.texi (Time directives, Options for date, Examples
493 * src/date.c (long_options, usage, main): Likewise.
494 * doc/getdate.texi (General date syntax): Likewise.
495 * doc/coreutils.texi (Options for date): Fix a typo in format:
496 it's now %d not %_d. Add URLs.
498 2003-08-01 Jim Meyering <jim@meyering.net>
500 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
501 Otherwise, with at least the /bin/sh from HPUX 10.20,
502 the trap code would end up converting that to exit 1 and thus an
503 unexpected test failure. Reported by Christian Krackowizer.
505 2003-07-31 Paul Eggert <eggert@twinsun.com>
507 * src/ptx.c: Do not include bumpalloc.h.
508 (WORD_TABLE): New member alloc.
509 (ALLOC_NEW_WORD): Remove.
510 (occurs_alloc): New var.
511 (digest_word_file, find_occurs_in_text): Check for arithmetic
512 overflow when computing table size. Use xrealloc rather than
513 bumpalloc primitives.
515 2003-07-29 Jim Meyering <jim@meyering.net>
519 * README: When running tests as root, suggest using
520 sudo with NON_ROOT_USERNAME=$USER.
522 * tests/Makefile.am (all_programs): Makefile is in ../src, not
525 2003-07-28 Jim Meyering <jim@meyering.net>
527 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
529 2003-07-28 Paul Eggert <eggert@twinsun.com>
531 * lib/stdbool.hin (_Bool): Make it signed char, instead of
532 an enum type, so that it's guaranteed to promote to int.
533 * src/sort.c (sortlines_temp): Undo previous change.
535 2003-07-28 Jim Meyering <jim@meyering.net>
537 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
538 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
539 would cause lines[-1 - swap] (with swap = false) to evaluate to
542 2003-07-27 Jim Meyering <jim@meyering.net>
544 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
545 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
547 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
548 directories, as required by POSIX. Reported by Karl Berry.
549 * tests/rm/dir-no-w: New file. Test for the above fix.
550 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
552 * tests/mk-script: Emit `$xx', not its expansion.
554 2003-07-27 Paul Eggert <eggert@twinsun.com>
556 This change was inspired by a similar proposal by Stepan Kasal.
557 * src/sort.c (mergelines, sortlines_temp): New functions.
558 (sortlines): Use them, to reduce the number of times that
559 we need to copy 'struct line' values. This improved CPU
560 performance by about 30% on one 18 MB test.
561 (sort): Don't invoke sortlines unless we have 2 or more lines.
563 2003-07-26 Stepan Kasal <kasal@ucw.cz>
565 * src/sort.c (sort): Don't require two `struct line's per text line,
566 the new sort algorithm requires just 1.5.
568 2003-07-27 Jim Meyering <jim@meyering.net>
570 * src/pathchk.c (validate_path): Use %lu, not %ld.
572 * src/cut.c (is_printable_field): Simplify bit arithmetic.
574 * src/ls.c (sort_files): Put `volatile' in the right place.
577 2003-07-26 Jim Meyering <jim@meyering.net>
579 Use only one bit per field/offset in array, not one `int'.
580 * src/cut.c (printable_field): Change type to `unsigned char'.
581 (mark_printable_field, is_printable_field): New functions.
582 Use them in place of all direct accesses of `printable_field'.
584 * src/expand.c (parse_tabstops): Detect overflow properly.
585 * src/cut.c (set_fields): Likewise.
587 * src/rm.c: Include "dirname.h".
588 (usage): Use base_name (program_name) in body of --help output.
590 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
591 Idea from Brendan O'Dea, who suggested using
592 `program_name = basename (argv[0]);' everywhere --
593 can't do that, but using base_name works just fine here.
595 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
597 2003-07-24 Paul Eggert <eggert@twinsun.com>
599 Fix some POSIX-compliance problems with 'test'. This makes
600 'test' more compatible with Bash.
602 * NEWS, doc/coreutils.texi: Document the following.
603 * src/test.c: Include exitfail.h.
604 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
605 (test-syntax_error): Use it.
606 (binary_operator): Now takes bool arg specifying whether left operand
607 is -l ARG, so that caller determines this rather than us.
609 (term): Use posixtest to evaluate parenthesized subexpressions.
610 (unary_operator, one_argument): Remove support for -t without operand.
611 (one_argument): Take argument from argv[pos].
612 (one_argument, two_arguments, three_arguments): Advance pos.
614 (three_arguments): Look for binary ops before "!". Then look
615 for parenthesized one_argument expressions, instead of trusting
616 expr () to do the right thing.
617 (posixtest): Now takes number of args. All callers changed.
618 Treat "( A B )" like "A B".
619 (main): Set exit_failure to TEST_FAILURE. Don't depend on
620 POSIXLY_CORRECT, as we now conform to POSIX by default.
621 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
622 * tests/test/Test.pm (test_vector): Add several tests to check
623 the above. Syntax errors now exit with status 2, not 1.
624 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
626 2003-07-26 Jim Meyering <jim@meyering.net>
628 * tests/help-version: Adjust for above change in test behavior:
629 `[' exits with 2, not 1, and test doesn't accept --help or --version.
631 * Makefile.maint (ME): Don't use trick suggested in Make manual.
632 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
634 * Makefile.maint (sc_system_h_headers): Another syntax check.
635 (syntax-check-rules): Add it to the list.
637 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
638 so it matches `%ld' format even on 32-bit systems.
640 * src/fmt.c (flush_paragraph): Cast field width to `int' to
641 avoid warning on 64-bit systems.
643 * src/ls.c (sort_files): Make `func' volatile, so it can't be
644 clobbered by a `longjmp' into this function.
646 2003-07-25 Jim Meyering <jim@meyering.net>
648 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
651 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
652 because it'd evoke spurious failure on 64-bit systems.
654 2003-07-24 Jim Meyering <jim@meyering.net>
656 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
657 output its current record counts. Reported by Jurriaan.
659 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
660 `wc' with no options. This goes along with the change of 2003-07-20.
662 2003-07-23 Jim Meyering <jim@meyering.net>
664 Don't include headers already included by system.h:
665 * src/tr.c: Don't include errno.h.
666 * src/true.c: Don't include version-etc.h.
667 * src/test.c: Don't include limits.h or error.h.
668 * src/stat.c: Don't include unistd.h or time.h.
669 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
670 * src/pr.c: Don't include time.h.
671 * src/pathchk.c: Don't include errno.h.
672 * src/nice.c: Don't include sys/time.h.
673 * src/ls.c: Don't include stdlib.h.
675 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
676 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
677 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
678 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
679 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
680 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
681 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
682 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
683 Don't include closeout.h.
685 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
686 can access the required version of rm.
687 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
689 * tests/cut/Test.pm (out-delim3a): New test.
691 * man/help2man: Update to version 1.33.
693 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
695 * src/dircolors.c: Include xstrndup.h.
696 (xstrndup): Remove function, now that it's been factored out into
699 2003-07-22 Paul Eggert <eggert@twinsun.com>
701 * src/wc.c (wc): Fix typo in computation of file from file_x,
702 which caused the former to be used uninitialized if file_x was
705 2003-07-22 Jim Meyering <jim@meyering.net>
707 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
709 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
710 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
711 Thomas Luzat. See http://bugs.debian.org/202413 for details.
713 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
715 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
717 * src/cut.c (set_fields): Mark all selected indices before trying to
718 determine range endpoints.
719 * tests/cut/Test.pm: New test for the above fix.
721 Begin to address this comment: What if someone wants to
722 extract the 1,000,000-th field of some huge input file?
723 The first step is to rearrange things so that the values
724 in the printable_field array are all 0/1 rather than 0/1/2.
725 * src/cut.c (RANGE_START_SENTINEL): Remove.
726 Store range-start indices in a hash table, rather than
727 overloading the `printable_field' array.
728 (range_start_ht): New global.
729 (hash_int, hash_compare_ints, is_range_start_index): New functions.
730 (print_kth): Use is_range_start_index; don't test printable_field.
731 (set_fields): Detect overflow.
732 (set_fields): Insert each range-start index into range_start_ht.
733 (main): Call set_fields only once, and only after
734 output_delimiter_specified and (if required) range_start_ht have
737 2003-07-20 Paul Eggert <eggert@twinsun.com>
739 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
740 invoked with a null pointer when there were no file arguments.
742 2003-07-20 Jim Meyering <jim@meyering.net>
744 * Makefile.maint (sc_changelog): Add another nit-picky check.
746 * src/wc.c (write_counts): Add a comment.
747 (wc): Rename `file' parameter.
748 Set new local, `file', to be the file name, or (when it's NULL)
749 _("standard output") so that all uses of `file' use the proper value.
750 Use STREQ, not strcmp.
752 2003-07-20 Paul Eggert <eggert@twinsun.com>
754 wc count field widths now are heuristically adjusted depending
755 on the input size, if known. If only one count is printed, it
756 is guaranteed to be printed without leading spaces.
758 Previously, wc did not align the count fields if
759 POSIXLY_CORRECT was set, but POSIX did not actually require
760 this undesirable behavior, so it has been removed.
762 * NEWS: Document this.
763 * doc/coreutils.texi (wc invocation): Likewise.
765 * src/wc.c (number_width): New var.
766 (posixly_correct): Remove.
767 (struct fstatus): New struct.
768 (write_counts): Output fields of width number_width.
769 Do not worry about POSIXLY_CORRECT.
770 Use null file, not empty-string file, to denote stdin,
771 since "" is a valid file name on some hosts.
772 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
774 (wc): Avoid problems if end_pos - current_pos overflows.
775 Do not print odd message if stdin has a read error.
776 (get_input_fstatus, compute_number_width): New functions.
777 (main): Use them to implement the new behavior.
778 Ignore POSIXLY_CORRECT.
780 * tests/wc/Test.pm: Adjust to the new output widths.
782 2003-07-19 Jim Meyering <jim@meyering.net>
784 * tests/rm/fail-eperm: Don't create temporary directory --
787 * tests/shred/remove: Don't open-code test for UID != 0.
788 Use priv-check's require-non-root instead.
789 Update to use newer framework.
791 * tests/help-version (expected_failure_status_expr): Record that
792 expr exits with status of 3 for e.g., a write error.
794 * tests/priv-check: Use `id -u' to see if we're running as root,
795 rather than trying go write to an write-protected file.
796 When running as root, ensure $NON_ROOT_USERNAME is valid.
797 When running as root with `require-non-root', ensure that `.'
798 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
799 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
801 * src/printenv.c: Include "exitfail.h".
802 (main): Set exit_failure rather than calling close_stdout_set_status.
803 * src/date.c: Likewise.
804 * src/sort.c: Likewise.
805 * src/tty.c: Likewise.
807 2003-07-18 Jim Meyering <jim@meyering.net>
809 * tests/touch/not-owner: Update to use newer framework.
811 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
812 directory, and remove Perl-coded `you may not run as root' test.
813 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
814 hard-coding something not quite equivalent.
815 Paul Jarc reported the inconsistent diagnostics.
817 * src/sort.c (main): Use close_stdout via atexit.
818 Now `sort --version' and `sort --help' fail, as they should
819 when their output is redirected to /dev/full.
821 * src/su.c (usage): Don't call close_stdout here.
822 (main): Use close_stdout via atexit.
823 Now `su --version > /dev/full' fails, as it should.
824 Somehow, the change of 2000-05-07 that purports to fix this
827 * tests/help-version (--help/--version vs. /dev/full): Special-case
828 `[' to protect it from expected_failure_status-`eval'.
830 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
831 count and the corresponding line, as required by POSIX.
832 Reported by Clement Wang.
833 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
835 * tests/expr/basic: Add tests for when exit status is 2.
837 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
838 Use an anonymous `enum', rather than #define.
840 2003-07-17 Paul Eggert <eggert@twinsun.com>
842 * src/expr.c: Include "exitfail.h", "quotearg.h".
843 (EXPR_INVALID, EXPR_ERROR): New constants.
844 (nomoreargs, null, toarith, nextarg): Return bool, not int.
845 (syntax_error): New function, exiting with status 2. Use it
846 insteading of printing "syntax error" ourselves.
847 (main): Initialize exit_failure to EXPR_ERROR.
848 Exit with EXPR_INVALID on syntax error (too few arguments).
849 (nextarg): Use strcmp, not strcoll; strcoll might return
850 an undesirable 0, or might fail.
851 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
853 (eval2): Report an error if strcoll fails in a string comparison.
854 * src/sort.c: Include "exitfail.h".
855 (main): Set exit_failure, not xalloc_exit_failure and
856 xmemcoll_exit_failure.
857 * tests/expr/basic: Invalid value exits with status 3, not 2.
859 2003-07-16 Jim Meyering <jim@meyering.net>
861 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
862 per GNU maintainer guidelines. The next non-beta release will be 5.1.
864 This script would have caught at least two recent bugs:
866 * tests/help-version: Revive this script.
867 It wasn't doing anything useful, since $all_programs wasn't being
868 defined by the invoking Makefile.am.
869 Reflect that nohup is no longer a script, so don't exclude it.
870 Add framework to handle the programs added since it was last run:
871 kill, stat, unlink, [, link, readlink.
872 Fix path-related problems deriving from the move of this script
873 from src/ to its present location.
874 * tests/Makefile.am (all_programs): Define.
875 (TESTS_ENVIRONMENT): Use it.
877 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
878 whereby kill would always attempt to operate on argv[0] and fail.
880 * src/test.c (integer_expected_error): Improve diagnostic -- now,
881 it also matches the one from bash's builtin test.
882 (binary_operator): Add \n at end of diagnostic.
884 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
885 * tests/priv-check: Move setuidgid-related and
886 NON_ROOT_USERNAME-checking code to this file.
888 * README: Update section on testing as `root'.
889 Suggestion from Paul Jarc.
891 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
892 names of authors that I just found in bash's builtins/test.def.
894 Running `[' with no arguments would evoke a segfault.
895 * src/test.c (main) [LBRACKET]: Move initialization of argv to
896 precede potential use via test_syntax_error.
898 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
899 warning from automake -Wall.
901 2003-07-15 Jim Meyering <jim@meyering.net>
905 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
908 * announce-gen (print_changelog_deltas): Relax tests for matching
909 version-number line in NEWS.
910 Change the .sig suffix to .asc here, too.
912 2003-07-14 Jim Meyering <jim@meyering.net>
914 * Makefile.maint (%.asc): Renamed from %.sig.
915 Generate and use ascii-armored signatures.
918 2003-07-13 Jim Meyering <jim@meyering.net>
920 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
923 * Makefile.maint (syntax-check): Move each individual check into
925 (syntax-check-rules): This is the list of syntax-check targets.
926 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
927 (sc_cast_of_x_alloc_return_value, sc_space_tab):
928 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
930 2003-07-12 Jim Meyering <jim@meyering.net>
932 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
933 traces of the nohup script.
935 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
936 $(OPTIONAL_BIN_ZCRIPTS).
938 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
939 target, not before the `>'.
941 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
942 now that that function no longer calls `error'.
944 * src/df.c (find_mount_point): Emit a diagnostic for each
945 failed syscall, rather than relying on caller to do that.
946 The caller couldn't do a good job, anyhow -- too many different
947 ways to fail (each with a different referent).
948 Give a diagnostic upon failed save_cwd, now that that function
949 no longer calls `error'.
950 (show_point): Don't diagnose find_mount_point's errors, now that
951 it handles them itself.
953 * src/df.c (find_mount_point): Don't let free clobber errno upon
956 * src/sys2.h: Remove alloca-related block.
957 * src/system.h: Include <alloca.h> here, instead.
959 It appears that the `#pragma alloca' included via "system.h" is
960 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
961 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
962 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
964 * src/chown-core.c (change_file_owner): Do not restore any special
965 permission bits (e.g., set-user-ID, set-group-ID) that are reset
966 by chown(2) on some systems. Suggestion and insistence :-) from
969 * tests/input-tty: Also check `test -t 1'.
970 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
971 test would block when run in the background.
973 2003-07-11 Jim Meyering <jim@meyering.net>
975 * tests/sample-test: Also fail if cat-to-create-expected-output
976 fails. Otherwise, if both `exp' and `out' were to end up empty
977 because of e.g., a full disk, they would mistakenly compare equal.
979 * src/nohup.c: New file. Rewrite of nohup.sh in C.
980 This solves a portability problem: on at least Solaris systems,
981 when nohup.sh used the vendor /bin/sh, it would exit with status
982 of `1' rather than the required 126 or 127 upon failure to exec
983 the specified program.
985 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
986 (bin_PROGRAMS): Add nohup.
987 (EXTRA_DIST): Remove nohup.sh.
988 (all_programs): Remove use of $(EXTRA_SCRIPTS).
989 * src/nohup.sh: Remove file.
990 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
992 * tests/misc/nohup: Tests for the above.
993 * tests/misc/Makefile.am (TESTS): Add nohup.
995 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
996 the macro, COPY_FD_DIAGNOSE.
997 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
998 (head_file): Likewise.
1000 * src/date.c: Include "quote.h".
1001 (batch_convert): Use the quote function rather than using literal `...'
1004 * src/setuidgid.c (main): Enclose diagnostic in _(...).
1005 * src/fmt.c (main): Likewise.
1006 * src/mknod.c (main): Likewise.
1007 * src/tac.c (tac_seekable): Likewise.
1008 * src/yes.c (main): Likewise.
1009 * src/od.c (main): Likewise.
1010 * src/install.c (change_attributes): Likewise.
1012 2003-07-10 Jim Meyering <jim@meyering.net>
1014 * src/head.c (usage): Use 1024*1024 in place of 1048576.
1015 * src/tail.c (usage): Likewise.
1017 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
1018 place of the kludge in this test. Suggestion from Paul Jarc.
1020 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
1021 * src/setuidgid.c: New program, solely for testing (not installed).
1023 * src/chown-core.c (change_file_owner): Don't leak file descriptors
1024 when dereferencing symlinks.
1026 2003-07-09 Jim Meyering <jim@meyering.net>
1028 * tests/du/slash: New file/test for today's lib/ftw.c fix.
1029 * tests/du/Makefile.am (TESTS): Add slash
1031 * src/tail.c (xlseek): Avoid warning about ``return without value
1032 from function returning non-void''.
1034 2003-07-08 Jim Meyering <jim@meyering.net>
1036 * man/help2man: Update to version 1.29.
1038 * man/help2man: Add END handler to close STDOUT and check for errors.
1040 2003-06-30 Paul Eggert <eggert@twinsun.com>
1042 Add support for a "[" that conforms to the GNU coding standards,
1043 i.e., that does not depend on its name.
1044 * src/lbracket.c: New file.
1046 * man/Makefile.am (programs): Ignore "[", since it doesn't have
1047 a separate man page.
1048 * src/Makefile.am (bin_PROGRAMS): Add "[".
1049 (__SOURCES): New var.
1050 * src/test.c (LBRACKET): Define to 0 if not defined.
1051 (main): Use LBRACKET rather than argv[0].
1053 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
1054 Reported by Paul Jarc and Dan Jacobson.
1056 * src/test.c (main): Do not recognize --help or --version if
1057 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
1058 Do not bother testing that margv[margc] is non-null.
1060 2003-07-04 Jim Meyering <jim@meyering.net>
1062 * src/who.c (print_line): Rewrite to use asprintf, in order to be
1063 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
1065 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
1066 option, and perform the +1600 invocations of head IFF the envvar
1067 RUN_EXPENSIVE_TESTS is set.
1069 2003-07-03 Jim Meyering <jim@meyering.net>
1071 * src/cp.c (do_copy): Give a better diagnostic when failing due
1072 to nonexistent destination directory. Reported by Dmitry Rutsky.
1073 See http://bugs.debian.org/199730 for details.
1075 2003-06-27 Jim Meyering <jim@meyering.net>
1077 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
1078 * src/split.c (longopts): Use `1', not `0' as the value for
1079 for &verbose. Reported by Keith Thompson.
1081 Test for the above fix.
1082 * tests/misc/split-a: Also use --verbose and compare stderr
1083 output with what we'd expect.
1085 2003-06-20 Jim Meyering <jim@meyering.net>
1087 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
1088 Use `error_t' (rather than int) as type for local `err'.
1089 From Alfred M. Szmidt.
1091 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
1093 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
1094 Fix author preservation code.
1096 2003-06-19 Jim Meyering <jim@meyering.net>
1098 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
1099 (do_link): Don't warn about hard link to symlink.
1101 2003-06-18 Jim Meyering <jim@meyering.net>
1103 * src/cut.c: Include "getdelim2.h", not "getstr.h".
1104 Reflect renaming: getstr -> getdelim2.
1106 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
1107 readline -> readlinebuffer.
1109 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1111 * src/readlink.c: Include <sys/types.h> before system.h (because
1112 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
1114 2003-06-17 Jim Meyering <jim@meyering.net>
1116 * src/system.h (initialize_main): Define.
1117 Use it in every `main'. Applied via this:
1118 p='initialize_main (&argc, &argv);'
1119 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
1120 $(grep -l program_name.=.argv.0 *.c)
1121 test.c uses margc/margv, so I made the change manually for that file.
1122 Based on a patch from Bernard Giroud.
1124 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1126 Fix for build failure on Ultrix 4.3.
1127 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
1128 Include sys/param.h and sys/mount.h on ultrix.
1130 2003-06-16 Jim Meyering <jim@meyering.net>
1132 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
1134 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
1135 them here instead, but with one change: define EISDIR to -1, not 0.
1137 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
1138 guaranteed to be defined.
1139 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
1141 * README: Mention the CVS repository.
1142 Encourage addition of test cases.
1144 2003-06-12 Jim Meyering <jim@meyering.net>
1146 * src/touch.c (touch): Call close only if necessary.
1149 * src/wc.c (usage): Correct wording: wc prints counts in the order
1150 `newline, word, byte'. Reported by Keith M. Briggs.
1151 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
1153 2003-06-10 Jim Meyering <jim@meyering.net>
1155 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
1157 2003-06-07 Jim Meyering <jim@meyering.net>
1159 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
1162 2003-06-06 Jim Meyering <jim@meyering.net>
1164 * src/extract-magic (main): Avoid newer 3-arg form of open,
1165 so this script works also with e.g., perl5.005_03.
1166 Patch by John David Anglin.
1168 2003-06-04 Paul Eggert <eggert@twinsun.com>
1170 * src/system.h: Include <stdbool.h> unconditionally.
1172 2003-06-04 Jim Meyering <jim@meyering.net>
1174 * man/Makefile.am (check-programs-vs-x): Rename target
1175 from check-programs-vs-1. Adjust rule to check for the
1176 primary (.x) file, not the generated one (.1).
1178 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
1180 * man/kill.x: New file.
1181 * man/Makefile.am (dist_man_MANS): Add kill.1.
1184 2003-06-04 Jim Meyering <jim@meyering.net>
1186 Ensure that the .x file for a new program is never forgotten again.
1187 * man/Makefile.am (programs): Define.
1188 (check-programs-vs-1): New phony target.
1189 (check-local): Depend on it.
1191 2003-06-03 Jim Meyering <jim@meyering.net>
1193 Avoid unnecessary copying of environment.
1194 * src/env.c (main): Rather than clearing the environment and --
1195 unless told to ignore environment -- copying all settings from
1196 the saved, original environment, clear the environment only when
1197 that is requested. Suggested by Jens Elkner.
1199 2003-06-02 Jim Meyering <jim@meyering.net>
1201 * src/system.h: Always include <string.h>, since we assume C89.
1202 Include <limits.h> without checking for HAVE_LIMITS_H.
1204 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
1205 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
1207 2003-06-01 Jim Meyering <jim@meyering.net>
1209 Avoid a race condition in `tail -f' described by Ken Raeburn in
1210 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
1211 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
1212 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
1213 (tail_bytes, tail_lines, tail): Likewise.
1214 (tail_file): Use the new `read_pos' value as the size,
1215 rather than stats.st_size from the fstat call.
1217 2003-05-28 Jim Meyering <jim@meyering.net>
1219 * src/extract-magic: Allow expansion of `$file' in the here-
1220 document corresponding to the comment at the top of fs.h.
1222 2003-05-26 Jim Meyering <jim@meyering.net>
1224 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
1225 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
1226 Use #if/#elif/... cascade so we get only one set of include files.
1227 Reported by Nelson Beebe.
1229 2003-05-24 Jim Meyering <jim@meyering.net>
1231 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
1232 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
1233 accept the BSD format.
1235 2003-03-28 Joe Orton <jorton@redhat.com>
1237 * src/md5sum.c (bsd_split_3): New function.
1238 (split_3): Detect checksums from BSD 'md5' command and handle them
1241 * tests/md5sum/basic-1: New tests for --check exit status, and for
1242 BSD-style checksum files.
1244 2003-05-21 Jim Meyering <jim@meyering.net>
1246 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
1247 This sort of thing is why it'd be *Really Good* to factor
1248 out the common code used here and in tail.c.
1250 2003-05-14 Jim Meyering <jim@meyering.net>
1252 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
1254 * tests/du/slink: Skip this test if `.' is on an XFS file system.
1256 * tests/du/fd-leak: New file. Test for the bug in du that
1257 was fixed by the 2003-05-12 change to lib/ftw.c.
1258 * tests/du/Makefile.am (TESTS): Add fd-leak.
1260 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
1261 includes a translatable word, `and'.
1263 * src/dd.c (usage): Don't use `,' as the thousands separator
1264 in e.g. 1,000,000 and 1,048,576. Instead, do this:
1265 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
1266 * src/df.c (usage): Likewise.
1267 * src/du.c (usage): Likewise.
1268 * src/ls.c (usage): Likewise.
1270 * Makefile.maint (syntax-check): Add another check.
1272 2003-05-13 Paul Eggert <eggert@twinsun.com>
1274 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
1275 must output nothing. Problem reported by Josh Hyman.
1277 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
1278 (output_unique, output_first_repeated, output_later_repeated):
1279 New vars. All uses of "mode" changed to use these variables,
1280 which are not mutually exclusive as "mode" was.
1281 (writeline): New arg "match", used to control whether to
1282 obey output_first_repeated or output_later_repeated.
1283 All callers changed.
1284 (check_file, main): Adjust to above changes.
1286 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
1288 2003-05-14 Jim Meyering <jim@meyering.net>
1290 * tests/rm/rm3: Use tr's \n notation rather than \012.
1291 This package can afford to do that, since its tests are guaranteed use
1292 GNU tr, which has accepted the more modern notation for 10 years.
1293 * tests/rm/rm5: Likewise.
1294 * tests/cp/same-file: Likewise.
1295 * tests/stty/row-col-1: Likewise.
1296 * tests/stty/basic-1: Likewise.
1297 * tests/rm/deep-1: Likewise.
1298 * tests/mv/part-symlink: Likewise.
1299 * tests/mkdir/perm: Likewise.
1300 * tests/misc/nice: Likewise.
1302 2003-05-13 Jim Meyering <jim@meyering.net>
1304 * src/copy.c (struct F_triple) [name]: Remove const attribute.
1305 (triple_free): Don't apply cast to argument of free.
1306 (seen_file): Add cast here instead.
1308 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
1309 (src_to_dest_free): Don't apply cast to argument of free.
1311 * src/sort.c (zaptemp): Don't apply cast to argument of free.
1312 * src/pr.c (init_fps, init_store_cols): Likewise.
1313 * src/join.c (delseq, freeline): Likewise.
1314 * src/expr.c (OLD): Likewise.
1315 * src/sort.c (sort): Likewise.
1316 * src/head.c (elide_tail_lines_pipe): Likewise.
1318 * src/tail.c: Include "quote.h".
1319 Use quote in diagnostics. Change many error format strings
1320 from just `%s' to e.g., `error reading %s'.
1321 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
1322 Rewrite newline-counting loop to use memchr.
1324 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
1325 Now that assert is no longer used, don't include <assert.h>.
1327 2003-05-12 Jim Meyering <jim@meyering.net>
1329 * src/head.c: Include <assert.h>.
1330 (AUTHORS): Add my name.
1331 (elide_tail_lines_pipe): New function.
1333 2003-05-10 Jim Meyering <jim@meyering.net>
1335 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
1337 * src/readlink.c (main): Set program_name before first use.
1338 Remove that (redundant) first use.
1339 Don't exit successfully just because --verbose was specified.
1340 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
1341 parameter is 0, error does not exit.
1343 * src/uname.c (main): When failing due to too many arguments, also say
1344 that, rather than just "Try `uname --help' for more information.".
1345 * src/comm.c (main): Likewise, but for too few arguments.
1346 * src/logname.c: Include error.h.
1347 (main): Say why we're failing.
1349 * src/uniq.c (main): Don't segfault when argc < optind.
1350 * src/who.c (main): Handle argc < optind.
1351 * src/df.c (main): Likewise.
1352 * src/install.c (main): Likewise.
1353 * src/mv.c (main): Likewise.
1354 * src/pwd.c (main): Likewise.
1355 * src/tty.c (main): Likewise.
1356 * src/chroot.c (main): Likewise.
1357 * src/hostname.c: Likewise.
1358 * src/du.c (main): Likewise.
1359 * src/expand.c (main): Likewise.
1360 * src/env.c (main): Likewise.
1361 * src/unexpand.c (main): Likewise.
1362 * src/printenv.c (main): Likewise.
1363 * src/sync.c (main): Handle argc == 0.
1364 * src/expr.c (main): Likewise.
1365 * src/printf.c (main): Likewise.
1366 * src/basename.c (main): Likewise.
1367 * src/ln.c (main): Test for `missing argument' before computing n_files.
1368 * src/tail.c (main): Test for the case of no arguments before
1371 * src/kill.c (send_signals): Don't check command line arguments here.
1372 (main): Check them here instead. Handle argc < optind.
1374 * src/logname.c (main): Use error, rather than fprintf, for the sake
1377 * src/rm.c (main): Don't overrun array bound if argc is 0.
1379 2003-05-09 Jim Meyering <jim@meyering.net>
1381 * src/sort.c (main): Don't overrun array bound if argc is 0.
1382 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
1383 Reported by Wartan Hachaturow.
1385 2003-05-07 Jim Meyering <jim@meyering.net>
1387 Implement support so that `head --lines=-N' works on seekable files.
1388 * src/head.c (enum Copy_fd_status): Define.
1389 (COPY_FD_DIAGNOSE): New macro.
1390 (elide_tail_lines_seekable): New funtion.
1391 (elide_tail_lines_file): Call it here.
1393 2003-05-06 Jim Meyering <jim@meyering.net>
1395 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
1397 2003-05-04 Jim Meyering <jim@meyering.net>
1399 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
1400 caused the addition of thousands of small files to the tar archive.
1401 * tests/misc/head-elide-tail: New file. Add them here instead.
1402 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
1404 2003-05-04 Paul Eggert <eggert@twinsun.com>
1406 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
1407 (IF_READDIR_NEEDS_REWINDDIR): Remove.
1408 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
1409 which was a bit weird because it couldn't be emulated by a function.
1411 2003-05-03 Jim Meyering <jim@meyering.net>
1413 Extend head to accept --lines=-N (--bytes=-N) and to print all
1414 but the N lines (bytes) at the end of the file.
1415 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
1416 Use quote() in diagnostics, rather than literal `' marks.
1417 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
1419 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
1420 (head_file): Reorganize so as to call head from only one place.
1421 (main): Likewise, for head_file.
1422 Handle new, undocumented option, --presume-input-pipe.
1423 Handle negative line and byte counts.
1424 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
1426 * tests/du/8gb: Skip test if the file system of `.' doesn't support
1427 sparse files -- otherwise it'd create a file of size 8GB.
1429 2003-05-02 Jim Meyering <jim@meyering.net>
1431 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
1432 Instead explain about `-' and standard input.
1433 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
1434 Reported by Keith Thompson.
1435 * tests/fmt/basic: Add test for the above fix.
1437 * src/fmt.c: Include "quote.h".
1438 Use quote() in diagnostics, rather than literal `' marks.
1439 (main): Exit nonzero when unable to open an input file.
1440 * tests/fmt/basic: Add test for the above fix.
1442 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
1443 specifications like `-72x'.
1444 * tests/fmt/basic: Add test for the above fix.
1446 Work around nasty readdir bug on Darwin6.5.
1447 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
1448 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
1449 returned NULL and there has been at least one successful unlink or
1450 rmdir call since the opendir or previous rewinddir, then call
1451 rewinddir and reiterate the loop.
1453 Factor out common code.
1454 * src/remove.c (readdir_ignoring_dotdirs): New function.
1455 (is_empty_dir): Use it here.
1456 (remove_cwd_entries): Use it here.
1458 2003-05-01 Jim Meyering <jim@meyering.net>
1460 * tests/rm/r-3: Create 500 rather than just 300 files.
1461 There's a bug in Darwin6.5's readdir that shows up only with
1463 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
1467 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
1468 (dump_remainder): Move two declarations `down' into the scope
1469 where they are used.
1470 (xlseek): Return the resulting offset.
1471 (file_lines): Rename parameter, file_length, to end_pos.
1472 (pipe_lines): Don't coerce safe_read return value to `int'.
1473 Adapt tests accordingly.
1474 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
1476 Change type of `total_bytes' from `int' to `size_t',
1477 since the former wouldn't always be wide enough.
1478 Don't coerce safe_read return value to `int',
1479 and adapt tests accordingly.
1480 Now that testing for a read error no longer involves
1481 using `tmp', handle that case *after* freeing `tmp'.
1482 (start_bytes): Clean up.
1483 (tail_bytes): Now that `n_bytes' may be larger than
1484 OFF_T_MAX, test for that condition and, if it's true, don't
1485 use lseek optimizations.
1486 (parse_options): Don't fail just because N_UNITS is larger than
1487 the maximum size of a file -- tail may be applied to an input
1488 stream (e.g., a pipe) with more data than that.
1490 * Makefile.maint (syntax-check): Rename from alloc-check.
1491 Also check for SPACE-TAB sequences.
1492 Also check for malloc/calloc/realloc casts.
1494 2003-05-01 Jim Meyering <jim@meyering.net>
1496 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
1498 2003-04-28 Jim Meyering <jim@meyering.net>
1500 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
1501 make the now-more-picky tsort fail.
1503 2003-04-24 Jim Meyering <jim@meyering.net>
1505 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
1506 (main): Minor syntactic clean-up.
1508 * src/tsort.c (tsort): Fail if the input contains an odd number of
1509 tokens. Reported by junkio@cox.net.
1511 * tests/tsort/basic-1: Test for the above fix.
1513 2003-04-21 Jim Meyering <jim@meyering.net>
1515 * tests/misc/printf: Add tests for the printf fixes below.
1517 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
1519 2003-04-20 Paul Eggert <eggert@twinsun.com>
1521 Fix printf POSIX compatibility bug reported by Ben Harris in
1522 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
1523 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
1524 \0NNN in the %b operand.
1525 * src/printf.c (usage): Likewise.
1526 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
1527 is desired. All uses changed. Behave like Bash printf if %b
1528 operand uses \NNN where the initial N is not 0.
1530 2003-04-17 Jim Meyering <jim@meyering.net>
1532 * src/stty.c: Remove uses of PROTOTYPE macro.
1534 2003-04-15 Jim Meyering <jim@meyering.net>
1536 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
1537 each sequence of spaces before a TAB character.
1539 2003-04-13 Jim Meyering <jim@meyering.net>
1541 * src/remove.c (is_empty_dir): Don't closedir (NULL).
1543 2003-04-12 Jim Meyering <jim@meyering.net>
1545 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
1546 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
1547 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
1548 * src/nl.c (main): Fix those problems and remove literal quote marks
1549 (e.g., "`%s'") from format string; instead use "%s" in each format
1550 string and `quote (optarg)' as the corresponding argument.
1551 Also, diagnose all invalid command line options before failing.
1553 * src/nl.c (proc_text): Fix a bug that would make nl output extra
1554 newlines in some cases. Details here: http://bugs.debian.org/177256.
1555 This bug was introduced on 2001-11-10 for textutils-2.0.17.
1556 * tests/misc/nl: Add test for the above-fixed bug.
1558 * tests/misc/readlink: New file. Test the --canonicalize option.
1559 * tests/misc/Makefile.am (TESTS): Add readlink.
1561 2003-04-11 Jim Meyering <jim@meyering.net>
1564 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
1565 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
1566 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
1567 retain alignment) each sequence of spaces before a TAB character.
1569 * src/ls.c: Include <stdlib.h> unconditionally.
1571 * Makefile.maint (xalloc-check): Rename from header-check.
1573 * src/yes.c: Include error.h after system.h, not before.
1576 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
1577 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
1578 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
1579 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
1580 * src/tr.c: * src/unexpand.c, src/users.c:
1581 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
1582 return values and of xrealloc's first argument.
1583 Fix the former with this:
1584 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
1586 2003-04-10 Jim Meyering <jim@meyering.net>
1588 * src/stty.c (wrapf): Declare with format attribute.
1590 The S_MAGIC_... names shouldn't be maintained in two places (prior
1591 to this change, one would have to keep stat.c and fs.h in sync).
1592 This change makes it so those names and the corresponding
1593 hexadecimal constants all reside in stat.c. fs.h is now generated.
1594 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
1595 (BUILT_SOURCES): Add fs.h, now that it's generated.
1596 (EXTRA_DIST): Add extract-magic.
1597 * src/extract-magic: New script to extract fs.h definitions from stat.c.
1598 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
1599 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
1601 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
1602 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
1604 * man/unexpand.x: Add `SEE ALSO' reference to expand.
1605 * man/expand.x: Add `SEE ALSO' reference to unexpand.
1606 Suggestion from Dan Jacobson.
1608 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
1610 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
1611 * src/stat.c (human_fstype): Handle Linux's devpts.
1613 2003-04-09 Paul Eggert <eggert@twinsun.com>
1615 * src/split.c (line_bytes_split): Arg is of type size_t, since
1616 that's all that is supported for now.
1617 (main): Check for overflow in obsolescent line count option.
1619 2003-04-09 Jim Meyering <jim@meyering.net>
1621 * tests/misc/split-fail: Add a new test for the above fix.
1623 * src/split.c (bytes_split): Use size_t temporary (rather than
1624 uintmax_t original) in remaining computations. From Paul Eggert.
1626 Handle command line option arguments larger than 2^31.
1627 This allows e.g., splitting into files of size 2GB and larger,
1628 and running split --lines=N with N=2^31 or more.
1629 But for --line-bytes=N, the restriction that N <= SIZE_MAX
1630 remains (for now), due to the way it is implemented.
1632 * src/split.c: Include "inttostr.h".
1633 (bytes_split, lines_split, line_bytes_split, main):
1634 Use uintmax_t, not size_t, for file sizes.
1635 (main): Give a better diagnostic for option arguments == 0.
1636 Use umaxtostr to print file sizes.
1637 Reported by Luke Hassell.
1639 2003-04-08 Jim Meyering <jim@meyering.net>
1641 * src/rm.c (usage): Mention that --directory (-d) works only
1642 on some systems. Suggestion from Samuel Tardieu.
1644 * tests/basename/basic: Run $PERL to see if it is available,
1645 rather than testing its value.
1646 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
1647 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
1648 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
1649 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
1650 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
1651 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
1652 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
1653 * tests/sum/basic-1, tests/seq/basic: Likewise.
1655 * tests/misc/Makefile.am (TESTS): Add split-fail.
1656 * tests/misc/split-fail: New file.
1658 * src/split.c: Rename local variables: nchars -> n_bytes.
1659 (lines_split): Rename local, nlines -> n_lines.
1660 (main): Rename local variable: s/accum/n_units/.
1661 (main): Use STDIN_FILENO, not literal `0'.
1663 2003-04-07 Jim Meyering <jim@meyering.net>
1665 * src/stat.c: Add #include directives for Ultrix 4.4.
1666 Based on a suggested change from Bert Deknuydt.
1668 2003-04-06 Jim Meyering <jim@meyering.net>
1670 * Makefile.maint (makefile-check): New rule.
1671 (local-check): Add it.
1673 2003-04-05 Jim Meyering <jim@meyering.net>
1675 * Makefile.am (nearly all of them):
1676 Use $(VAR) rather than @VAR@, now that we can rely on automake to
1677 emit a definition for each substituted variable.
1678 * tests/Makefile.am.in: Likewise.
1680 * tests/rm/rm5: Add a comment explaining why this test fails when
1681 using Tru64's broken sed.
1682 * tests/rm/rm3: Likewise.
1684 Make `kill -t' output signal descriptions (not `?') on Tru64.
1685 * src/kill.c (sys_siglist): Also check for __sys_siglist.
1686 Patch by Tony Leneis.
1687 * configure.ac: Also check for declaration of __sys_siglist.
1688 Required for Tru64 4.0D, 4.0F, and 5.1.
1689 Reported by Tony Leneis.
1691 2003-04-04 Jim Meyering <jim@meyering.net>
1693 * src/Makefile.am (PERL): Remove unnecessary definition.
1695 Because of inappropriate (but POSIX-mandated) behavior of rename,
1696 `mv a b' would not remove `a' in some unusual cases. Work around
1697 this by unlinking `a' when necessary.
1699 * src/copy.c (same_file_ok): Add an output parameter.
1700 Set it in the offending case.
1701 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
1702 Reported by Ed Avis.
1703 * tests/mv/hard-4: New test for the above.
1704 * tests/mv/Makefile.am (TESTS): Add hard-4.
1706 Clean up rules for automatically generated sources:
1707 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
1708 Make each generated file be read-only.
1709 Add each file name to BUILT_SOURCES separately.
1710 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
1712 Put LOCALEDIR macro definition in new file: localedir.h.
1713 * src/Makefile.am (DEFS): Remove definition.
1714 (localedir.h): New rule.
1715 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
1716 * src/system.h: Include "localedir.h".
1718 2003-04-02 Jim Meyering <jim@meyering.net>
1722 * tests/misc/Makefile.am (TESTS): Add false.
1724 * Makefile.maint (TMPDIR): Make sure it's defined.
1725 (my-distcheck): Build in $(TMPDIR), not `.'.
1727 * src/Makefile.am (false.c): Change all occurrences of
1728 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
1729 unsuccessfully also with --help. Reported by Paul Jarc,
1730 * tests/misc/false: New test for the above.
1732 2003-03-30 Jim Meyering <jim@meyering.net>
1734 * NEWS: Note the location of older NEWS files.
1736 * src/remove.c (is_empty_dir): Don't let a failing closedir
1737 clobber errno. Spotted by Arnold Robbins.
1739 * src/env.c: Fix typo in comment. From Arnold Robbins.
1741 2003-03-29 Jim Meyering <jim@meyering.net>
1745 * README: Note to expect build problems for stat.c on Ultrix 4.3.
1746 Note that there are some harmless test failures when running
1747 `make check' as root on some systems.
1749 2003-03-28 Jim Meyering <jim@meyering.net>
1751 * tests/stty/row-col-1: Skip this test if stty can't get window size.
1752 This happens when connecting to sparc-solaris5.7 via ssh from within
1753 emacs. Reported by Karl Berry.
1755 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
1756 Otherwise, on systems (DJGPP) that emulate pipes using files,
1757 this test would never complete, waiting for `yes' to terminate.
1758 * tests/du/slink: As above, use seq, not `yes' to generate link target.
1759 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
1760 Reported by Rich Dawe.
1762 2003-03-27 Jim Meyering <jim@meyering.net>
1764 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
1765 from `written by...' comment, at his request.
1767 2003-03-24 Paul Eggert <eggert@twinsun.com>
1769 Fix buffer overrun problem reported by TAKAI Kousuke, along
1770 with some other POSIX incompatibilities.
1772 * src/printf.c (print_esc): Do not treat \x specially if
1773 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
1774 in backslash. Treat incomplete escape sequences as strings
1775 of characters, as POSIX requires.
1776 (print_formatted): Allow multiple flags. Avoid buffer overrun
1777 if the format is incomplete.
1779 2003-03-24 Jim Meyering <jim@meyering.net>
1781 * tests/misc/printf: Add tests for the above fixes and changes.
1783 2003-03-26 Jim Meyering <jim@meyering.net>
1785 * src/copy.h (struct cp_options): Add a comment.
1787 2003-03-23 Jim Meyering <jim@meyering.net>
1789 * README: Describe problem with 64-bit mode on HPUX 11.x,
1790 with patch for /usr/include/inttypes.h.
1791 * TODO: Plan to add an autoconf test to work around the bug.
1793 2003-03-22 Jim Meyering <jim@meyering.net>
1795 * src/stat.c: Don't include <sys/sysmacros.h>.
1796 That is already done via system.h. Otherwise, the multiple
1797 inclusion would evoke redefinition warnings from Cray's /bin/cc,
1798 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
1799 (human_fstype): Factor some directives `up', out of this function.
1800 Cast away `const' to avoid error from Cray's /bin/cc.
1802 2003-03-20 Jim Meyering <jim@meyering.net>
1804 * announce-gen (print_changelog_deltas): Ensure that a newline
1805 precedes each row of `*'s.
1807 2003-03-20 Jim Meyering <jim@meyering.net>
1811 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
1812 format flag characters.
1813 Do not require that a field width be specified.
1814 Do not fail when given a field width of `0'.
1815 Reported by Dan Jacobson.
1816 * tests/seq/basic: Add new tests for the above-fixed bug.
1818 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
1819 (install-root): Likewise.
1820 (install-exec-local): Likewise.
1821 Based on a patch from Richard Dawe.
1823 2003-03-19 Jim Meyering <jim@meyering.net>
1825 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
1826 because the DJGPP 2.03 port of 'ln -s' doesn't work.
1827 Include $(EXEEXT) in program names.
1828 Since $(LN_S) may degenerate to `cp -p', be careful
1829 to invoke it from the destination directory.
1830 Mostly from Richard Dawe.
1831 * configure.ac: Use AC_PROG_LN_S.
1833 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
1834 CDPATH shell variable set could cause this test to fail.
1835 Reported by Karl Berry.
1837 2003-03-18 Jim Meyering <jim@meyering.net>
1839 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
1840 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
1841 AIX 5.1's xlc could not compile the former.
1842 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
1844 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
1846 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
1847 program names, since automake only adds $(EXEEXT) to programs
1850 2003-03-16 Jim Meyering <jim@meyering.net>
1852 * src/remove.c (rm): Put two local variables in static storage,
1853 so they can't be clobbered by the potential longjmp.
1855 2003-03-15 Jim Meyering <jim@meyering.net>
1857 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
1858 so that a version number with a two-digit component can still count
1859 as an alpha release. Reported by Richard A Downing.
1860 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
1862 2003-03-14 Jim Meyering <jim@meyering.net>
1864 * src/ansi2knr.c: Remove no-longer-used file.
1865 * src/ansi2knr.1: Likewise.
1867 * Makefile.maint (prev_version_file): Don't use ?= for this particular
1868 assignment, since it causes trouble with old versions of GNU make
1869 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
1870 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
1871 Patch from Alexandre Duret-Lutz.
1873 * Use patched automake-1.7.3. Regenerate Makefile.in files in
1874 subdirectories so that each includes a definition of ACLOCAL_M4.
1876 * announce-gen (main): Label the compressed source URLs.
1880 * tests/du/slink: Relax the test for the `local'ness of a file system,
1881 so that now it works also for tmpfs.
1883 * tests/du/hard-link: Transform output from first du, so that this
1884 test doesn't fail on file systems like tmpfs that order directory
1885 entries differently.
1887 2003-03-13 Jim Meyering <jim@meyering.net>
1889 * tests/du/8gb: Work around what appears to be an NFS failure that
1890 would make this test fail on some systems.
1892 2003-03-11 Jim Meyering <jim@meyering.net>
1894 * tests/du/basic: Make the test file exactly 4k bytes long.
1896 * src/split.c (longopts): Don't hard-code `2' here.
1897 Instead, just specify `&verbose', and ...
1898 (main): ... remove the `case 2:' block for --verbose.
1900 * tests/du/basic: Make the test file larger than 64 bytes, so that
1901 we don't immediately disqualify file systems (e.g., NetApp) on which
1902 smaller files take up zero disk blocks. Reported by Vin Shelton.
1904 2003-03-10 Jim Meyering <jim@meyering.net>
1906 Don't segfault for a negative field width or precision in format string.
1907 Note that this is just a stopgap fix. The longer term solution may
1908 involve adapting bash's builtins/printf.def.
1910 * src/printf.c: (UNSPECIFIED): Define.
1911 (print_direc): Use the special value, UNSPECIFIED, to indicate
1912 that field_width or precision has not been specified.
1913 (print_formatted): Fail if field_width or precision is the
1914 special value, UNSPECIFIED.
1915 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
1917 * src/sys2.h (INT_MIN): Define, if necessary.
1918 * tests/misc/printf: Add a test for the above-fixed bug.
1920 2003-03-09 Jim Meyering <jim@meyering.net>
1922 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
1923 changing its sign. This avoids a warning from gcc on 64-bit systems.
1924 Reported by Bob Proulx.
1925 (pop_dir): Reverse order of sign change and cast, to be consistent
1928 2003-03-08 Jim Meyering <jim@meyering.net>
1930 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
1931 shell variable, but only in the environment. With /bin/sh->bash, the
1932 shell variable is set to `y', and that would cause a spurious warning.
1933 Reported by Bob Proulx.
1935 * tests/Makefile.am (check-root): Remove touch/fifo.
1936 It doesn't appear to have to be run as root.
1938 * tests/rm/fail-2eperm: Rather than simply using the first non-root
1939 user name, make sure that the selected user name has a usable shell.
1940 Reported by Paul Jarc.
1942 Before, when using shred on a device, one had to specify --exact,
1943 or be careful to choose a size that would not be rounded up and
1944 exceed the maximum value; that could result in a failure of
1946 * src/shred.c (do_wipefd): --exact is now the default for non-regular
1947 files. Suggestion from Ben Elliston.
1950 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
1951 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
1952 Patch by Bob Proulx.
1954 * src/Makefile.am (check-misc): Check for use of `defined' in
1956 Change to $(srcdir) before running grep.
1958 * src/sleep.c: Remove now-unused #include and #define directives.
1960 * src/du.c (process_file): If a file's size is not being counted
1961 e.g., because it's a hard link to a file we've already counted,
1962 then don't print a line for it.
1964 * tests/du/hard-link: New test for the above-fixed bug.
1965 * tests/du/Makefile.am (TESTS): Add hard-link.
1968 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
1969 and make the two-array approach work.
1971 * tests/du/basic: Correct/add tests for the above fix.
1972 Set LC_ALL, etc., now that we use sort.
1973 Check the block/size of a small file, too.
1974 Correct expected results for simple dir1/dir2/file case.
1975 Add another test of du -S.
1977 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1979 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
1980 middle-end/9986). As one of GCC's optimizations, it transforms a
1981 fputs_unlocked call to a fputc_unlocked call when the string is
1982 one character long. However, hpux doesn't have fputc_unlocked.
1984 * expr.c (usage): Use putchar, not fputs, to output a single character.
1985 * ls.c (dired_dump_obstack): Likewise.
1986 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
1987 * stat.c (print_it): Likewise.
1989 2003-03-07 Jim Meyering <jim@meyering.net>
1991 * src/cp.c: Remove everything associated with mmap-stack.c.
1992 This reverts the two changes of 2003-02-21.
1993 * src/du.c: Remove everything associated with mmap-stack.c.
1994 This reverts the change of 2003-02-19.
1996 2003-03-06 Jim Meyering <jim@meyering.net>
1998 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
1999 CDPATH shell variable set could cause this test to fail.
2000 Reported by Karl Berry.
2002 2003-03-05 Jim Meyering <jim@meyering.net>
2006 * src/printf.c (print_esc): Remove pointless comparison of unsigned
2007 integer with zero, to avoid a warning from Intel's ecc.
2008 Reported by Nelson Beebe.
2010 * src/du.c (process_file): Sizes must all be of type uintmax_t.
2011 Otherwise, for files or totals that are too big, numbers would
2012 be truncated. Patch mostly by Michael Stone.
2013 Reported by Ingo Saitz as Debian bug #183210.
2015 * tests/du/8gb: New test for the above-fixed bug.
2016 * tests/du/Makefile.am (TESTS): Add 8gb.
2018 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
2019 rather than UTILS_OPEN_MAX - 10.
2021 2003-03-04 Jim Meyering <jim@meyering.net>
2023 * README: Refer new feature discussion to bug-coreutils@gnu.org,
2024 rather than bug-gnu-utils, now that the former is better known.
2025 Suggestion from Göran Uddeborg.
2027 * src/stat.c (usage): Capitalize consistently.
2028 Reported by Göran Uddeborg.
2030 * Makefile.maint (rel-files): Include $(signatures), so that
2031 those files are also copied into $(release_archive_dir).
2033 * src/df.c (find_mount_point): Call error here, now that restore_cwd
2035 * src/remove.c (AD_pop_and_chdir): Likewise.
2037 * tests/Makefile.am (check-root): Add fail-2eperm.
2039 2003-03-03 Jim Meyering <jim@meyering.net>
2041 * src/remove.c (remove_cwd_entries): Include the full filename of
2042 the offending file, not just the basename.
2044 * tests/misc/tty-eof: Set $ME properly.
2046 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
2047 Remove now-unused variables.
2048 (tag-prev-version, prev-cvs-tag): Likewise.
2050 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
2051 accurate diagnostic when failing to remove a file owned by some other
2052 user. Reported by Ivo Timmermans via Michael Stone.
2053 This fixes Debian bug# 178471.
2055 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
2056 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
2057 Based on a report from Ivo Timmermans.
2059 2003-03-02 Jim Meyering <jim@meyering.net>
2061 * src/copy.c (copy_internal) [un_backup]: When recovering from a
2062 failure to create a hard link, do not remove the entry associating
2063 the source dev/ino with the destination file name.
2064 * tests/mv/Makefile.am (TESTS): Add hard-3.
2065 * tests/mv/hard-3: New test, for the above-fixed bug.
2066 Inspired by a report from Iida Yosiaki.
2068 2003-03-01 Jim Meyering <jim@meyering.net>
2070 * src/df.c (print_header): Don't embed spaces in a separate `Type'
2071 header string. Instead, put `Filesystem' and `Type' headers in the
2072 same string, so translators can use horizontal space as needed.
2073 Reported by Jean Charles Delepine.
2075 2003-02-28 Jim Meyering <jim@meyering.net>
2077 * src/copy.c (copy_internal): When link fails because of an
2078 existing destination file, unlink that file and try again.
2079 Reported by Iida Yosiaki.
2081 * tests/mv/Makefile.am (TESTS): Add hard-2.
2082 * tests/mv/hard-2: New test for the above-fixed bug.
2083 Based on a test case from Iida Yosiaki.
2085 2003-02-26 Jim Meyering <jim@meyering.net>
2087 * tests/du/basic: Don't test du's -b option here. Directory byte
2088 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
2089 and IBM AIX 4.2. Reported by Nelson Beebe.
2091 2003-02-25 Jim Meyering <jim@meyering.net>
2093 * Makefile.maint (announcement): Now that ChangeLog entries
2094 are output by announce-gen, don't do it here.
2095 * announce-gen (print_changelog_deltas): New function.
2098 2003-02-22 Jim Meyering <jim@meyering.net>
2100 * announce-gen: New option: --release-type=TYPE
2101 * Makefile.maint (beta, major): New targets. Remove `release'.
2102 Put them all together on a line.
2103 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
2104 invocation of `announcement'.
2105 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
2107 * announce-gen: New option: --news=NEWS_FILE.
2108 Extract NEWS entries here, not via rules in Makefile.maint.
2109 * Makefile.maint (announcement): Now that NEWS entries are
2110 extracted by announce-gen, don't do it here.
2111 (news-r1, news-r2): Remove now-unused definitions.
2113 2003-02-21 Jim Meyering <jim@meyering.net>
2117 Merge in changes from autoconf's version of this file.
2118 * Makefile.maint (www-gnu): Define.
2119 (standards.texi-url_prefix): Use $(www-gnu).
2120 (make-stds.texi-url_prefix): Likewise.
2122 * src/cp.c: Include "mmap-stack.h".
2123 (main): Invoke `run' through a macro that (when possible) runs it
2124 with a large, mmap'd stack.
2126 * src/cp.c (run): New function, preparing for the above.
2127 Exit from this function, not from main
2130 * src/du.c: New option: --apparent-size.
2131 (enum) [APPARENT_SIZE_OPTION]: New member.
2132 (long_options): Add it.
2133 (usage): Describe it.
2135 ['b']: Set apparent_size.
2136 David Eisner reported that the behavior of --bytes had changed.
2137 Paul Eggert proposed the use of a new option, --apparent-size.
2139 * src/du.c (apparent_size): New global.
2140 (print_only_size): Reflect the fact that we're printing byte counts,
2141 not ST_NBLOCKSIZE-byte-block counts.
2142 (print_size): Call print_only_size rather than duplicating its code.
2143 (process_file): Accumulate byte counts, rather than block counts.
2145 * src/du.c (process_file): Always reset size_to_propagate_to_parent
2146 for --separate-dirs (-S).
2148 2003-02-20 Jim Meyering <jim@meyering.net>
2150 * Use automake-1.7.3. Regenerate dependent files.
2152 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
2153 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
2154 (usage) [%B]: Describe it.
2157 * src/du.c (process_file): Reorganize the code to use only
2158 one `sum' array, and change how -S works back to the way it was
2159 before 2003-01-31. Patch by Bruno Haible.
2161 * tests/du/basic: New test.
2162 * tests/du/Makefile.am (TESTS): Add basic.
2164 * tests/envvar-check: Add checks for the following:
2165 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
2167 * tests/Makefile.am: Rename phony target envvar-check to evar-check
2168 so as not to conflict with the distributed file by the same name.
2170 * src/du.c (process_file): Set info->skip before any possible return.
2172 Report correct usage for directories, not 0.
2173 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
2174 _before_ recording the dev/ino of a directory.
2175 Reported by Bruno Haible.
2177 Now, df always displays the device file name corresponding to the
2178 listed mount point under `Filesystem'. Before, for an unmounted
2179 block- or character-special file argument, it would display the
2180 command-line argument instead.
2181 * src/df.c (show_disk): Return a value indicating whether
2182 there was a match. Don't try to find a mount point here.
2183 (show_entry): If show_disk doesn't find a match, call show_point.
2185 2003-02-19 Jim Meyering <jim@meyering.net>
2187 * src/du.c: Include "mmap-stack.h".
2188 (du_files): Add prototype with ATTRIBUTE_NORETURN.
2189 Exit from this function, not from...
2191 Instead, if possible, invoke du_files through a macro that
2192 runs it with a large, mmap'd stack.
2194 * src/join.c (usage): Change wording in --help output:
2195 use FILENUM instead of `SIDE' and say what FILENUM means.
2196 Reported by Bernhard Gabler.
2198 * src/df.c (print_header): Rather than using a hard-coded literal
2199 string of spaces matching the length of the English `...Type' header,
2200 output the right number of spaces to match the selected translation.
2201 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
2203 * src/split.c (bytes_split): Remove unnecessary `else' after break.
2204 (lines_split): Likewise. and correct misleading indentation.
2206 * src/split.c: Include "full-read.h".
2207 (bytes_split, lines_split, line_bytes_split): Use full_read,
2208 not safe_read. The way split was using the latter, a short read
2209 could cause split to terminate before EOF.
2211 * tests/misc/tty-eof: Test all programs that can read stdin,
2212 requiring no arguments and that write to standard output.
2214 * tests/misc/tty-eof: New file. Renamed from ...
2215 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
2216 * tests/misc/Makefile.am (TESTS): Reflect renaming.
2218 2003-02-18 Jim Meyering <jim@meyering.net>
2220 cksum would perform an extra read after encountering EOF
2221 * src/cksum.c (cksum): Exit the loop upon EOF, too.
2222 Patch by Michael Bacarella.
2224 Test for the bug fixed today in cksum, md5sum, and sha1sum.
2225 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
2226 cat, cksum, md5sum, and sha1sum all in the same loop.
2228 2003-02-14 Jim Meyering <jim@meyering.net>
2230 * src/remove.c: Include "euidaccess.h".
2231 Remove declaration of euidaccess.
2233 2003-02-12 Jim Meyering <jim@meyering.net>
2235 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
2236 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
2238 2003-02-10 Jim Meyering <jim@meyering.net>
2240 * src/test.c: Don't include group-member.h.
2241 Include euidaccess.h.
2242 (eaccess): Rewrite function to set the real uid and gid temporarily
2243 to the effective uid and gid, then invoke 'access', and then set the
2244 real uid and gid back. On systems that lack setreuid or setregid,
2245 fall back on the kludges in euidaccess. Before, it would not work
2246 for e.g., files with ACLs, files that were marked immutable,
2247 or on file systems mounted read-only. Nelson Beebe raised the issue.
2248 Paul Eggert suggested the new implementation.
2250 2003-02-09 Jim Meyering <jim@meyering.net>
2252 * src/test.c (test_stat): Remove function. It's job is done (only
2253 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
2255 2003-02-08 Jim Meyering <jim@meyering.net>
2259 * tests/mv/part-symlink: Don't assume that the file owner username
2260 length is less than 9 in ls output: instead, omit that field
2261 altogether. Reported by, and suggested fix from, Ferdinand.
2263 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
2264 * tests/du/Makefile.am (TESTS): Add restore-wd.
2266 * src/rm.c: Correct now-invalid comment about cycle-detection.
2268 2003-02-06 Jim Meyering <jim@meyering.net>
2270 * NEWS: Add entries from old/*/NEWS
2271 from fileutils-4.1 through 4.1.11 and
2272 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
2276 * src/du.c (process_file): Don't return early for excluded files
2277 or for files whose dev/inode we've already seen.
2279 2003-02-05 Jim Meyering <jim@meyering.net>
2281 * tests/du/exclude: New file.
2282 * tests/du/Makefile.am (TESTS): Add exclude.
2284 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
2286 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
2287 Fix memory allocation arithmetic.
2289 2003-02-04 Jim Meyering <jim@meyering.net>
2291 `df /dev/block-or-char-device-file--not-mounted' now reports
2292 the name of the file system on which the file resides, usually `/'.
2293 Before, it would leave the `Mounted on' field blank.
2294 * src/df.c (show_disk): Move function to precede find_mount_point.
2295 (show_disk): Add parameter: STATP.
2296 If we don't find a matching device name, then resort to calling
2297 find_mount_point. Reported by Bob Proulx.
2299 2003-02-03 Andreas Schwab <schwab@suse.de>
2301 * tests/rm/cycle: Require non-root.
2302 * tests/rm/isatty: Likewise.
2304 2003-02-02 Jim Meyering <jim@meyering.net>
2308 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
2310 Ensure that there are no offending uses of `:'.
2311 * Makefile.maint (makefile_path_separator_check): New rule.
2312 (local-check): Add it to the list.
2314 2003-02-01 Jim Meyering <jim@meyering.net>
2316 * src/du.c (MAX_N_DESCRIPTORS): Define.
2318 * src/stat.c (G_fail): New global.
2319 (human_time): Diagnose failed localtime, not failed nstrftime.
2320 (main): Fail if G_fail is set.
2322 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
2324 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
2325 hard-coding the path-separator. Also double-quote the new PATH,
2326 to avoid problems when the path-separator is a semi-colon or when
2327 `pwd` contains e.g. a space.
2328 * tests/chgrp/Makefile.am: Likewise.
2329 * tests/chmod/Makefile.am: Likewise.
2330 * tests/chown/Makefile.am: Likewise.
2331 * tests/cp/Makefile.am: Likewise.
2332 * tests/dd/Makefile.am: Likewise.
2333 * tests/dircolors/Makefile.am: Likewise.
2334 * tests/du/Makefile.am: Likewise.
2335 * tests/expr/Makefile.am: Likewise.
2336 * tests/factor/Makefile.am: Likewise.
2337 * tests/fmt/Makefile.am: Likewise.
2338 * tests/install/Makefile.am: Likewise.
2339 * tests/ln/Makefile.am: Likewise.
2340 * tests/ls/Makefile.am: Likewise.
2341 * tests/ls-2/Makefile.am: Likewise.
2342 * tests/md5sum/Makefile.am: Likewise.
2343 * tests/misc/Makefile.am: Likewise.
2344 * tests/mkdir/Makefile.am: Likewise.
2345 * tests/mv/Makefile.am: Likewise.
2346 * tests/od/Makefile.am: Likewise.
2347 * tests/rm/Makefile.am: Likewise.
2348 * tests/rmdir/Makefile.am: Likewise.
2349 * tests/seq/Makefile.am: Likewise.
2350 * tests/sha1sum/Makefile.am: Likewise.
2351 * tests/shred/Makefile.am: Likewise.
2352 * tests/stty/Makefile.am: Likewise.
2353 * tests/sum/Makefile.am: Likewise.
2354 * tests/tail-2/Makefile.am: Likewise.
2355 * tests/touch/Makefile.am: Likewise.
2356 * tests/tsort/Makefile.am: Likewise.
2357 * tests/unexpand/Makefile.am: Likewise.
2359 2003-01-31 Jim Meyering <jim@meyering.net>
2361 * src/stat.c: Include "file-type.h"
2362 (print_human_type): Remove function.
2363 (human_access): Rename from print_human_access. Return a string.
2364 (human_time): Rename from print_human_time. Return a string.
2365 (print_stat): Arrange so that field width and an alignment specifier
2366 are honored for the %A, %F, %x, %y, and %z formats.
2367 [%F]: Use file_type; this gives slightly different file type strings,
2368 e.g., `directory' instead of `Directory' and `regular file' or
2369 `regular empty file' instead of `Regular file'.
2370 Prompted by a report from Richard Dawe that the uses of
2371 S_IFSOCK and S_IFIFO in print_human_time were not portable
2372 to systems using e.g., DJGPP.
2374 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
2376 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
2377 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
2379 2003-01-31 Jim Meyering <jim@meyering.net>
2381 * src/du.c (main): Upon processing an invalid option or an invalid
2382 --exclude-from or --max-depth option argument, don't exit right away,
2383 in case there are others. Rather record the failure and exit after
2384 processing other options.
2386 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
2387 tar archive easier to reproduce.
2389 Rewrite to perform directory traversal using nftw.
2391 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
2392 (AUTHORS): Add self.
2393 (opt_one_file_system): Move global into `main'.
2394 (path, xstat, exit_status): Remove declarations.
2395 (arg_length, suffix_length): New globals.
2396 (G_fail): New global, sort of like the old `exit_status'.
2397 (IS_FTW_DIR_TYPE): Define.
2398 (print_only_size): New function.
2399 (process_file): New function.
2400 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
2401 (str_trunc, pop_dir, count_entry): Likewise.
2402 (du_files): Rewrite to use nftw.
2404 2003-01-30 Jim Meyering <jim@meyering.net>
2406 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
2407 symlink-to-directory with -L, even without the trailing slash.
2409 2003-01-27 Jim Meyering <jim@meyering.net>
2411 * src/Makefile.am (check-misc): Check for st_blocks, too.
2413 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
2414 Reported by Richard Dawe.
2416 2003-01-27 Andreas Schwab <schwab@suse.de>
2418 * src/ls.c (quote_name): Add fourth parameter, width, into which to
2419 store the screen columns, and return the number of bytes instead.
2420 (print_dir): Pass NULL as fourth parameter of quote_name.
2421 (print_name_with_quoting): Likewise.
2422 (length_of_file_name_and_frills): Get the width from the fourth
2423 parameter of quote_name instead of return value.
2425 2003-01-27 Jim Meyering <jim@meyering.net>
2427 * src/ls.c (decode_switches): If `dired' is set without
2428 `format == long_format', then silently reset dired. This doesn't
2429 change the behavior of ls (all prior uses of dired were protected
2430 by `&& format == long_format'), and lets us...
2431 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
2432 (PUSH_CURRENT_DIRED_POS): Likewise.
2435 2003-01-22 Jim Meyering <jim@meyering.net>
2437 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
2438 * tests/du/Makefile.am (TESTS): Add no-x.
2440 2003-01-21 Jim Meyering <jim@meyering.net>
2442 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
2443 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
2444 it may still be a directory -- or not (e.g., with FreeBSD on an
2445 NFS-mounted file system), so resort to calling lstat to find out.
2446 Based on a patch by Michael van Elst.
2448 * tests/cp/same-file: Don't assume that the file owner username
2449 length is less than 9 in ls output: instead, omit that field
2450 altogether. Reported by, and suggested fix from, Ferdinand.
2452 2003-01-20 Jim Meyering <jim@meyering.net>
2454 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
2455 large format widths no longer cause strftime to infloop.
2457 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
2459 2003-01-19 Jim Meyering <jim@meyering.net>
2461 * src/readlink.c: Include "canonicalize.h".
2463 2003-01-18 Jim Meyering <jim@meyering.net>
2465 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
2467 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
2468 (long_options): Add option --dereference-command-line-symlink-to-dir.
2469 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
2470 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
2471 -d, -F, -l options is specified.
2472 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
2473 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
2474 Change --dereference-command-line (-H) to dereference *all*
2475 command line arguments, including broken symlinks.
2477 2003-01-15 Paul Eggert <eggert@twinsun.com>
2479 Change ls -H back to the way it was yesterday, since this is
2480 compatible with FreeBSD and the POSIX spec is confusing
2481 and somewhat contradictory.
2483 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
2484 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
2485 (long_options): Change the long option name back.
2486 (usage): Change the usage back.
2487 (gobble_file): When -H is specified, dereference a top-level
2488 arg even if it points to a non-directory.
2490 2003-01-15 Jim Meyering <jim@meyering.net>
2492 * src/ls.c (gobble_file): Fall back on using lstat when required:
2493 when --dereference (-L) is not specified, and
2494 - when operating on a dangling symlink
2495 - when operating on command-line-symlink-to-directories
2496 This fixes numerous problems. Here are examples:
2497 - `ls dangling-symlink' would fail with `no such file...'
2498 Now it prints `dangling-symlink'.
2499 - `ls -i symlink' would mistakenly print the inode of the referent.
2500 Now it prints the inode of the symlink. Likewise for --size (-s).
2501 Based on a patch from Michael Stone.
2502 Reported by Deepak Goel as Debian bug #173793.
2504 Rename ls's --dereference-command-line (-H)
2505 option to --dereference-command-line-symlink-to-dir.
2506 * src/ls.c [enum Dereference_symlink]
2507 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
2508 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
2509 (long_options): Rename the long option.
2510 (usage): Say that --dereference-... changes how ls treats
2511 only symlinks to directories specified on the command line.
2513 2003-01-14 Jim Meyering <jim@meyering.net>
2515 * tests/ls/dangle: New file/test, for the above fix.
2516 * tests/ls/inode: Another new file/test, for the above fix.
2517 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
2519 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
2520 so that ls --color would no longer highlight the names of files with
2521 the execute bit set when not specified on the command line.
2522 Patch by Michael Stone. Reported by Stephen Depooter as
2525 * tests/ls-2/tests (color-exe): New test, for the above fix.
2527 2003-01-13 Jim Meyering <jim@meyering.net>
2529 * tests/shred/exact: Also test for just fixed bug with --zero.
2531 * src/shred.c (long_opts): --zero does not require an argument.
2532 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
2534 2003-01-12 Jim Meyering <jim@meyering.net>
2536 * Makefile.maint (cvs-update): Skip any file with local modifications.
2538 * src/unexpand.c (usage): Document --first-only and mention that
2539 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
2541 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
2543 * src/df.c: Include "canonicalize.h".
2544 Use canonicalize_file_name unconditionally.
2546 2003-01-09 Jim Meyering <jim@meyering.net>
2548 * README: Add readlink.
2550 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
2552 * src/df.c: Include "xgetcwd.h".
2553 * src/pwd.c: Likewise.
2555 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
2557 * src/shred.c: Remove declaration of xstrdup.
2558 We already get it via xalloc.h which is included via system.h.
2560 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
2562 New program: readlink.
2564 * src/Makefile.am (bin_PROGRAMS): Add readlink.
2565 * src/readlink.c: New file.
2567 * man/readlink.x: New file.
2568 * man/Makefile.am (dist_man_MANS): Add readlink.1.
2569 (readlink.1): New rule.
2571 2003-01-09 Jim Meyering <jim@meyering.net>
2573 When selecting ranges of byte offsets (as opposed to ranges of fields)
2574 and when --output-delimiter=STRING is specified, output STRING between
2575 ranges of selected bytes.
2576 * src/cut.c (RANGE_START_SENTINEL): Define.
2577 (output_delimiter_specified): New global.
2578 (print_kth): Add parameter. Adjust all callers.
2579 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
2580 (cut_bytes): When requested, output STRING between ranges of
2582 (main): Make a diagnostic a little clearer.
2583 Based on a patch from Jan Nieuwenhuizen.
2585 * tests/cut/Test.pm: New tests for the above.
2587 * src/cut.c (set_fields): Make code agree with comment:
2588 Don't merge abutting ranges like 4- and 2-3. This makes no
2589 difference currently, but is required to support an upcoming change.
2591 2003-01-07 Jim Meyering <jim@meyering.net>
2593 * src/cut.c (set_fields): Fix typo in comment.
2595 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
2596 * tests/touch/Makefile.am (TESTS): Add not-owner.
2597 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
2598 Now, this tests only the nonexistent-directory diagnostic.
2599 Suggestion from Michael Stone.
2601 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
2603 2003-01-04 Jim Meyering <jim@meyering.net>
2605 * src/copy.h: Remove use of PARAMS.
2606 * src/remove.h: Likewise.
2607 * src/chown-core.h: Likewise.
2609 rm could be tricked into mistakenly reporting a cycle.
2610 * src/remove.c: [cycle_check_state]: New global.
2611 (remove_cwd_entries): Adapt to new semantics of cycle_check.
2612 (rm): Call cycle_check_init and cycle_check_free for each file.
2613 * tests/rm/cycle (rm): New test, for the above fix.
2614 * tests/rm/Makefile.am (TESTS): Add cycle.
2616 When rm detects a cycle, don't abort the entire command,
2617 but rather just the affected command line argument.
2618 * src/remove.c: Include <setjmp.h>
2619 (struct dirstack_state) [current_arg_jumpbuf]: New member.
2620 (remove_cwd_entries): Call longjmp if we detect a cycle.
2621 (rm): Call setjmp here.
2623 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
2624 Instead, include cycle-check.h and use it.
2626 * src/remove.h (struct dev_ino): Remove declaration.
2628 * src/remove.c (remove_cwd_entries): Fix typos in comment.
2630 Don't include trailing /. in diagnostics about directories.
2631 * src/remove.c (full_filename_): When FILENAME is just `.'
2632 and there is a nonempty directory-name part, don't append `/.'.
2633 * tests/rm/unread2: Remove trailing /. from diagnostic.
2634 * tests/rm/rm2: Likewise.
2636 * src/remove.c (struct dirstack_state): Define.
2637 To be used in place of these file-scoped globals ...
2638 (dir_stack, len_stack, Active_dir): Remove globals.
2639 (ds_init, ds_free): New functions.
2640 (full_filename): Define.
2641 (full_filename_): Rename from full_filename.
2643 Begin to make AD_* functions more generic.
2644 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
2645 (AD_push): Likewise.
2646 (AD_INIT_OTHER_MEMBERS): Define.
2647 (remove_dir): Define the `status' member manually after each
2648 call to AD_push or AD_push_initial.
2650 * src/Makefile.am (check-misc): New rule, to ensure that no more
2651 S_IS* macro definitions sneak into the code.
2652 (check): Depend on check-misc.
2654 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
2655 * src/du.c (count_entry) [S_ISLNK]: Don't define.
2656 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
2658 2003-01-03 Jim Meyering <jim@meyering.net>
2660 * src/true.c: Add copyright.
2661 (AUTHORS): I suppose I've written it.
2663 * src/Makefile.am (false.c): Make the generated file be read-only.
2665 2003-01-04 Jim Meyering <meyering@lucent.com>
2667 * src/ls.c: Include "dev-ino.h".
2668 [struct dev_ino]: Remove declaration.
2670 2003-01-02 Jim Meyering <meyering@lucent.com>
2672 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
2673 from mv: s/missing file arguments/missing file argument/.
2674 With --target-directory=DIR, cp and mv work with a single file argument.
2675 Reported by Karl Berry.
2677 * tests/rm/isatty: Enable this test.
2679 2002-12-31 Jim Meyering <meyering@lucent.com>
2681 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
2682 (AD_push): Likewise.
2683 (AD_INIT_OTHER_MEMBERS): Define.
2684 (remove_dir): Define the `status' member manually after each
2685 call to AD_push or AD_push_initial.
2687 * src/ls.c [struct dev_ino]: Remove definition.
2688 Include "dev-ino.h" instead.
2690 2002-12-28 Jim Meyering <meyering@lucent.com>
2692 * tests/du/Makefile.am (TESTS): Add no-deref.
2693 * tests/du/no-deref: New script.
2695 2002-12-23 Jim Meyering <meyering@lucent.com>
2697 * src/remove.c (remove_cwd_entries): Fix typo in comment.
2699 2002-12-21 Jim Meyering <jim@meyering.net>
2701 * announce-gen: Generate MML-formatted announcement.
2702 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
2704 2002-12-20 Jim Meyering <jim@meyering.net>
2706 * src/touch.c (touch): Change the wording of a diagnostic so
2707 that it makes sense both when the file exists and when it doesn't.
2708 Suggestion from Michael Stone.
2710 2002-12-18 Jim Meyering <jim@meyering.net>
2712 * src/stty.c (valid_options): Declare to be static.
2714 2002-12-15 Jim Meyering <jim@meyering.net>
2716 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
2718 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
2719 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
2720 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
2721 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
2722 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
2724 * src/remove.c (PARAMS): Remove definition.
2725 * src/sys2.h: Likewise.
2727 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
2728 Include strftime.h instead.
2730 2002-12-14 Jim Meyering <jim@meyering.net>
2732 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
2734 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
2735 This is necessary at least for Irix6.5 when using c89.
2736 Reported by Nelson Beebe.
2738 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
2740 * tests/misc/cat-tty-eof: New test.
2742 * src/mknod.c (usage): Specify how major and minor mode numbers
2743 are interpreted. Report forwarded by Kristin E Thomas.
2744 * src/mknod.c: Remove now-redundant usage-specifying comment.
2746 2002-12-13 Jim Meyering <jim@meyering.net>
2750 * tests/du/trailing-slash: Allow for a directory of size `0'.
2751 That happens at least on file systems of type tmpfs on linux-2.4.18.
2753 * announce-gen: New script to begin replacing the commands
2754 associated with the rule here...
2755 * Makefile.maint (announcement): Invoke announce-gen.
2756 * Makefile.am (EXTRA_DIST): Add announce-gen.
2758 * tests/cp/preserve-2: New file/test, for latest fix.
2759 * tests/cp/Makefile.am (TESTS): Add preserve-2.
2761 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
2763 Fix a bug whereby cp would fail to parse an option like
2764 --preserve=mode,ownership.
2765 * src/cp.c (decode_preserve_arg): Advance `comma' to
2766 point the character following the comma.
2768 2002-12-11 Jim Meyering <jim@meyering.net>
2770 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
2771 in case it's already defined.
2773 2002-12-09 Jim Meyering <jim@meyering.net>
2775 * tests/touch/fail-diag: Don't get a test failure if /no exists.
2776 Instead, evoke a framework failure if /no-$$ exists.
2777 Reported by Michael Stone.
2779 2002-12-08 Jim Meyering <jim@meyering.net>
2781 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
2782 Define to rpl_lstat, so that even on systems like Solaris 5.8,
2783 du honors (per POSIX) the trailing slash on an argument referring
2784 to a symlink-to-directory.
2786 2002-12-06 Jim Meyering <jim@meyering.net>
2788 * Use autoconf-2.57. Regenerate dependent files.
2789 * Use automake-1.7.2. Regenerate dependent files.
2791 * src/ls.c (gobble_file): Also stat the file if it's a
2792 regular file and --indicator-style=classify (aka -F).
2793 Thanks to Ed Santiago for opening my eyes.
2795 * tests/ls/file-type: New file. Test for the above.
2796 A test to contrast ls -F and ls --indicator-style=file-type.
2797 * tests/ls/Makefile.am (TESTS): Add file-type.
2799 2002-12-04 Jim Meyering <jim@meyering.net>
2801 * tests/ls/follow-slink: Make sure the symlink was created.
2802 Richard Dawe reported that `ln -s link link' succeeds, but creates
2803 no file on systems running some version of the DJGPP libc.
2805 2002-12-03 Jim Meyering <jim@meyering.net>
2807 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
2808 since this package no longer panders to K&R compilers.
2810 2002-12-02 Jim Meyering <jim@meyering.net>
2812 * tests/du/slink: Skip this test if `.' is on a non-local file system.
2814 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
2815 something to replace.
2817 2002-12-01 Jim Meyering <jim@meyering.net>
2819 * src/stat.c: Don't include <string.h> or <ctype.h>.
2820 That's already done via system.h.
2821 * src/dircolors.c: Don't include <ctype.h>.
2823 2002-11-30 Jim Meyering <jim@meyering.net>
2825 * ls.c (gobble_file): Remove the block of code that caused
2826 `ls --color -F symlink-to-dir' to list the files in
2827 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
2828 like `ls -F symlink-to-dir') but with the addition of highlighting.
2829 Similarly, `ls --color -dF symlink-to-dir' would print
2830 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
2831 Reported by Jeff Sheinberg as Debian bug #168203.
2832 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
2834 ls is now more efficient: with certain options, it no longer needs
2835 to stat each directory entry on systems with valid dirent.d_type.
2836 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
2837 (main): Make --recursive set format_needs_type, not format_needs_stat.
2838 (gobble_file): Remove a FIXME comment, now that it's fixed.
2840 2002-11-24 Jim Meyering <jim@meyering.net>
2842 * src/du.c (du_files): Don't strip any trailing slash.
2843 Rewrite so that `/' is no longer represented internally as
2845 (count_entry): When appending a file name component,
2846 account for the fact that the current path may end in `/'.
2847 François Pinard reported that `du symlink-to-dir/' was not
2848 equivalent to `du symlink-to-dir/.'. Now it is.
2849 * tests/du/trailing-slash: New file/test, for the above fix.
2850 * tests/du/Makefile.am (TESTS): Add trailing-slash.
2852 2002-11-23 Jim Meyering <jim@meyering.net>
2854 * src/tac.c (output): Declare some local variables to be of type size_t,
2855 rather than `int' to avoid warnings from gcc.
2857 2002-11-21 Paul Eggert <eggert@twinsun.com>
2859 * src/ls.c (decode_switches): Use case-sensitive matching to
2860 decode the QUOTING_STYLE environment variable. This is more
2861 consistent with the documentation, and with --quoting-style.
2863 2002-11-21 Martin Buck <martin.buck@ascom.ch
2865 * src/stty.c (struct speeds): Add support for all baud rates defined
2868 2002-11-19 Jim Meyering <jim@meyering.net>
2870 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
2871 run in a UTF locale. Report and suggested fix by Bruno Haible.
2872 * tests/fmt/basic: Likewise.
2874 2002-11-17 Jim Meyering <jim@meyering.net>
2876 * configure.ac: Update via autoupdate.
2877 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
2879 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
2880 Reported by Hans Ginzel.
2882 2002-11-15 Jim Meyering <jim@meyering.net>
2884 * Makefile.cfg (gnu_rel_host): Define.
2885 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
2886 on whether $(VERSION) looks like a major release number.
2888 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
2889 (release): Rename from `alpha'.
2890 (alpha): Depend on release.
2892 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
2894 2002-11-14 Jim Meyering <jim@meyering.net>
2896 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
2897 (announcement): Use the new variable.
2899 * Makefile.maint: Sync with Bison, i.e.:
2900 (po-check): Scan .l and .y files instead of the
2901 .c and the .h files that they generate. This fixes the bug
2902 reported by Tim Van Holder in:
2903 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
2904 Look for N_ as well as for _. Try to avoid matching #define for
2908 2002-11-12 Jim Meyering <jim@meyering.net>
2910 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
2911 Replace sole use with equivalent `#ifdef S_ISLNK'.
2912 Inconsistency reported by Dmitry V. Levin.
2914 2002-11-11 Jim Meyering <jim@meyering.net>
2916 * src/stat.c (usage): Transform --help items output via s/ - / /,
2917 so that help2man produces properly formatted man pages.
2918 Reported by Herbert Xu as Debian bug #168400.
2920 2002-11-10 Jim Meyering <jim@meyering.net>
2922 * src/ls.c (sighandler): Handle SIGTSTP specially.
2923 Based on suggestions from Solar Designer and Dmitry V. Levin.
2926 * Makefile.cfg (cvs_files): Define. From autoconf.
2927 (local_updates): Likewise.
2929 * src/ls.c (restore_default_color_handler, sigtstp_handler):
2931 (sighandler): New function, based on the one in sort.c.
2932 (main): Use sigaction, if possible; otherwise signal.
2933 Handle these signals:
2934 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
2935 Don't register our handler if the signal is already being ignored.
2937 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
2938 * src/csplit.c (interrupt_handler): Likewise.
2939 * src/sort.c (sighandler): Likewise.
2940 (main): Declare `i' and `nsigs' to be unsigned, not int.
2942 2002-11-09 Jim Meyering <jim@meyering.net>
2944 ls --color: restore terminal text color upon signal.
2945 * src/ls.c: Include "full-write.h" and <signal.h>.
2946 (restore_default_color, restore_default_color_handler): New functions.
2947 (sigtstp_handler, put_indicator_direct): New functions.
2948 (main) [print_with_color]: Register signal handlers.
2949 Patch mostly by Solar Designer and Stanislav Ievlev.
2951 Update from autoconf.
2952 * Makefile.maint (AMTAR): Remove definition.
2953 (update, cvs-update, po-update, do-po-update): New rules.
2954 (wget-update): Update (thus renaming to cvs-update).
2955 (automake_repo): Use anoncvs@sources.redhat.com.
2957 2002-11-06 Jim Meyering <jim@meyering.net>
2959 * tests/misc/Makefile.am (TESTS): Add printf-hex.
2961 * tests/misc/printf: Be careful to test the code in this package,
2962 not the shell built-in function.
2964 * src/printf.c (print_esc): A hexadecimal escape sequence has
2965 at most two hex. digits, not three. Reported by Padraig Brady.
2966 (usage): Update description.
2967 * tests/misc/printf-hex: New file/test, for the above fix.
2969 2002-10-07 Paul Eggert <eggert@twinsun.com>
2971 Add support for locale-specific size indications (e.g.,
2972 thousands-separators) and for explicit size suffixes on output.
2974 * doc/coreutils.texi (Block size): Say that:
2975 This affects display format as well as block size.
2976 Fractional block counts are rounded up.
2977 ls file size blocksize defaults to 1.
2978 A block size spec preceded by ' generates thousands separators.
2979 A suffix without a preceding integer generates suffixes.
2980 (tail invocation): 32k -> 32 KiB.
2981 (What information is listed): ls -h is now equivalent to
2982 ls --block-size=human, and ls -H is now equivalent to
2983 ls --block-size=si. Displayed file size is now always affected by
2986 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
2987 lib/umaxtostr.c: New files, taken from GNU tar.
2989 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
2991 (EXTRA_DIST): Add inttostr.c.
2993 * lib/human.c, lib/human.h: Rewrite to support locale-specific
2994 notations like thousands separators.
2995 Specify what includer of include.h must include beforehand.
2996 (human_group_digits, human_suppress_point_zero, human_autoscale,
2997 human_base_1024, human_SI, human_B): New enum values.
2998 (human_readable): Rename from human_readable_inexact; put the
2999 options before the sizes. All uses changed. The old human_readable
3000 function has been removed; use inttostr.h instead.
3001 (human_options): Renamed from human_block_size, with new signature
3002 that allows block sizes up to UINTMAX_MAX. All callers changed.
3004 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
3005 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
3006 freestanding C89. No need to check for stdlib.h or string.h since
3007 autoconf does this now.
3009 * src/cksum.c (cksum): Use primitives from inttostr.h, not
3010 human.h, to print large numbers simply.
3011 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
3012 * src/dd.c (print_stats, main): Likewise.
3013 * src/df.c (print_header): Likewise.
3014 * src/factor.c (print_factors): Likewise.
3015 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
3016 * src/shred.c (dopass): Likewise.
3017 * src/sort.c (checkfp): Likewise.
3018 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
3019 * src/tail.c (xlseek): Likewise.
3020 * src/wc.c (write_counts, wc): Likewise.
3022 * src/df.c (human_output_opts): New var.
3023 (output_block_size): Now uintmax_t, not int, to handle larger
3024 block sizes. All uses changed.
3025 * src/du.c: Likewise.
3026 * src/ls.c: Likewise.
3028 * src/df.c (print_header): In the header line, prefer SI to human
3029 representation if it's shorter; if neither is shorter, try to
3030 intuit what the user would prefer.
3032 * src/expr.c (inttostr): Remove; use new imaxtostr library
3035 * src/ls.c (file_output_block_size): New var, to distinguish
3036 file sizes from other sizes.
3037 (decode_switches): Set it.
3039 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
3040 (dopass): When printing progress, use floor for what has been done
3041 so far (since we should be conservative there), and ceiling for
3042 what needs to be done (since that's what other programs use).
3044 2002-10-19 Jim Meyering <jim@meyering.net>
3046 * src/pinky.c (print_heading): Align TTY and Name headings.
3047 Reported by Karl Eichwalder.
3049 2002-10-18 Jim Meyering <jim@meyering.net>
3051 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
3052 Remove now-useless cast.
3053 (stdread): Remove function.
3054 (bytes_split): Use size_t instead of int.
3055 Use safe_read, not stdread.
3056 (lines_split): Likewise.
3057 Use memchr rather than a `while' loop.
3058 (line_bytes_split): Use size_t instead of int.
3059 Use safe_read, not stdread.
3060 (main): Add some FIXME comments to remind me to remove casts.
3062 * src/system.h (ST_BLKSIZE): Correct comment describing how to
3063 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
3065 2002-10-17 Jim Meyering <jim@meyering.net>
3067 Fix a problem that could make e.g., `cat' misbehave on systems which
3068 give invalid (unreasonably large) values for stat.st_blksize.
3069 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
3070 Reported by Petter Reinholdtsen.
3072 2002-10-14 Jim Meyering <jim@meyering.net>
3074 Specifying a printf conversion specifer as nl's separator string
3075 could cause nl to segfault.
3076 * src/nl.c (build_print_fmt): Don't include separator string
3077 in the printf format; it might contain `%'.
3078 Use a better bound on the length of the print_fmt buffer.
3079 (print_lineno): Print the separator here instead.
3080 Reported by Doug Coleman.
3082 * tests/misc/nl: New file/tests, including a test for the above.
3083 * tests/misc/Makefile.am (TESTS): Add nl.
3085 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
3086 * tests/misc/Makefile.am (TESTS): Add split-l.
3088 2002-10-13 Jim Meyering <jim@meyering.net>
3092 * src/du.c (usage): Tweak description of --dereference-args/-D.
3094 * src/du.c (count_entry): Also save cwd when dereferencing (via
3095 --dereference-args, -D) a command-line argument.
3096 Reported by Michal Svec. Based on a patch by Andreas Schwab.
3098 * src/Makefile.am (../AUTHORS): New target/rule.
3100 2002-10-12 Jim Meyering <jim@meyering.net>
3102 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
3103 of type size_t, since that's the way it's used and avoids a warning.
3105 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
3106 since that's how it's always used and avoids a new warning from gcc.
3107 (read_input): Adapt to new safe_read ABI.
3109 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
3112 * src/pinky.c (print_long_entry): fread returns size_t.
3113 Declare local `bytes' accordingly, to avoid warning.
3115 tail -c +N would perform an extra read after encountering EOF
3116 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
3117 * src/tail.c (start_bytes): Detect EOF, inform caller.
3118 (tail_bytes): Upon EOF in start_bytes, return immediately.
3119 (file_lines): Reorganize to use memrchr rather than an explicit loop.
3120 Adapt to new safe_read ABI.
3122 2002-10-11 Jim Meyering <jim@meyering.net>
3124 * tests/du/deref: New file/test, for the above fix.
3125 * tests/du/Makefile.am (TESTS): Add deref.
3127 2002-10-10 Jim Meyering <jim@meyering.net>
3129 * tests/ln/Makefile.am (TESTS): Add target-1.
3130 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
3132 2002-10-09 Jim Meyering <jim@meyering.net>
3134 * tests/cp/backup-is-src: Ensure that certain environment variables
3135 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
3137 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
3138 consume 4GB of disk space on systems without support for sparse files.
3139 Fix a logic error that'd make it `cat err' even though dd didn't fail.
3141 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
3142 Patch by steven@magelico.net, forwarded by Michael Stone.
3144 * tests/ls/dired: Ensure that ls produces English messages.
3145 Patch by Alexey Vyskubov, forwarded by Michael Stone.
3147 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
3149 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
3151 2002-10-08 Jim Meyering <jim@meyering.net>
3153 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
3154 Fix syntax in test: use =, not ==.
3155 Reported by Bob Proulx.
3156 Change all the rest like this: grep -lR "testing framework'" .\
3157 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
3159 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
3160 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
3161 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
3162 * src/wc.c (wc): Likewise.
3164 2002-10-07 Paul Eggert <eggert@twinsun.com>
3167 Don't advance the write pointer past the end of the write buffer.
3168 * src/sort.c (begfield, limfield): Likewise.
3170 2002-10-07 Jim Meyering <jim@meyering.net>
3172 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
3173 * src/head.c (head_bytes, head_lines): Likewise.
3175 2002-10-06 Jim Meyering <jim@meyering.net>
3177 * src/dd.c (scanargs): Ensure that specified block sizes (specified
3178 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
3179 (skip, dd_copy): Adapt to new safe_read ABI.
3181 * Makefile.maint (signatures): Define.
3183 (announcement): Depend on $(signatures).
3185 * Makefile.maint (announcement): Output all URLs for detached
3186 signatures, not just the last one from the previous loop.
3188 2002-10-05 Jim Meyering <jim@meyering.net>
3192 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
3193 don't recurse into directory, DIR. Prompted by a report from
3196 * tests/rm/i-no-r: New file/test, for the above fix.
3197 * tests/rm/Makefile.am (TESTS): Add i-no-r.
3199 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
3200 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
3202 2002-10-03 Jim Meyering <jim@meyering.net>
3204 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
3205 * src/df.c (AUTHORS): Likewise.
3206 * src/du.c (AUTHORS): Likewise.
3207 * src/tail.c (AUTHORS): Likewise.
3208 * src/touch.c (AUTHORS): Likewise.
3210 2002-10-02 Jim Meyering <jim@meyering.net>
3212 * Makefile.am (SUBDIRS): Remove `old'.
3213 (EXTRA_DIST): List the files in old/.
3214 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
3215 Suggestion from Akim Demaille.
3217 2002-10-01 Jim Meyering <jim@meyering.net>
3219 * src/sys2.h (SSIZE_MAX): Define.
3221 2002-09-30 Jim Meyering <jim@meyering.net>
3223 * src/csplit.c: Don't include stdlib.h here. It's already included
3226 2002-09-29 Jim Meyering <jim@meyering.net>
3228 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
3229 expression to avoid bogus warning from gcc.
3231 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
3232 (cat): Declare insize and outsize to be of type size_t, not int.
3233 Rearrange pointer/integer expressions to avoid bogus warnings.
3234 (main): Declare insize and outsize to be of type size_t, not int.
3236 * src/tail.c (parse_options): Give a sensible diagnostic for
3237 an invalid byte or line count. Reported by Mikko Tuumanen.
3239 * src/touch.c (main): Split a long line.
3241 * tests/du/Makefile.am (TESTS): Add slink.
3242 * tests/du/slink: New test for system.h change of 2002-08-31.
3244 In move mode, always first try to rename. Before, upon failure to
3245 rename a directory, this code would never attempt to rename any
3246 other file in that directory, but would thenceforth always copy.
3247 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
3248 may fail with EXDEV, yet renaming files within that directory to
3249 a newly-created destination directory succeeds.
3250 * src/copy.c (copy_internal): Remove local, move_mode;
3251 use x->move_mode instead. Based on a patch from Tom Haynes.
3253 2002-09-28 Jim Meyering <jim@meyering.net>
3255 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
3256 Factor out some duplication.
3258 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
3260 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
3262 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
3263 to avoid compiler warnings.
3265 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
3268 Fix things so `mkdir -p' can create very deep directories, e.g.,
3269 mkdir -p $(perl -e 'print "a/" x 40000') now works.
3270 * src/mkdir.c (main): For --parents (-p), call make_path with the
3271 entire directory name, so we don't ever require that file operations
3272 like stat or chmod be performed on the entire command line argument.
3273 * makepath.c (make_path): Restore umask *before* creating the final
3276 2002-09-27 Andreas Schwab <schwab@suse.de>
3278 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
3279 to avoid overflow. Reported by Hans Lermen.
3281 2002-09-26 Jim Meyering <jim@meyering.net>
3283 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
3285 2002-09-25 Jim Meyering <jim@meyering.net>
3287 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
3288 and add a cast, to avoid a warning about `signed and unsigned type in
3289 conditional expression'.
3291 2002-09-22 Jim Meyering <jim@meyering.net>
3293 * src/rmdir.c: Include "dirname.h", for declaration of
3294 strip_trailing_slashes.
3296 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
3297 Now they're defined through system.h.
3299 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
3300 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
3301 since it's already included from sys2.h via system.h.
3303 * Use automake-1.6f. Regenerate dependent files.
3305 * src/Makefile.am (PERL): Remove duplicate definition.
3307 fmt's -s, -t, -c options didn't work properly for long lines.
3308 Since get_line may end up calling put_paragraph (for long lines),
3309 be sure to set global, `other_indent', before it is used there.
3311 * src/fmt.c (set_other_indent): New function, factored out of...
3312 (get_paragraph): ... here. Call it.
3313 (get_line): Call set_other_indent before calling flush_paragraph,
3314 which calls fmt_paragraph, which in turn calls put_paragraph,
3315 which uses other_indent.
3317 * tests/fmt/Makefile.am (TESTS): Add long-line.
3318 * tests/fmt/long-line: New file/test, for the above fix.
3320 2002-09-21 Jim Meyering <jim@meyering.net>
3322 * src/od.c: No longer include deprecated <values.h>.
3323 It was required solely for now-removed reference to BITSPERBYTE.
3324 * src/install.c: Likewise.
3325 Suggestion from Bruno Haible.
3327 2002-09-06 Andreas Schwab <schwab@suse.de>
3329 `rmdir -p dir-specified-with-trailing-slash/' would fail.
3330 * src/rmdir.c (remove_parents): Strip trailing slashes.
3332 2002-09-20 Jim Meyering <jim@meyering.net>
3334 * tests/rmdir/t-slash: New file/test, for the above fix.
3335 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
3337 * Makefile.maint (announcement): Arrange to gpg-sign the message.
3338 Add a URL for each detached signature file.
3340 2002-09-07 Bruno Haible <bruno@clisp.org>
3342 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
3344 2002-09-18 Jim Meyering <jim@meyering.net>
3346 `od -t x8' used the wrong (`l'-prefixed) printf format.
3347 Likewise for the o8 and u8 formats.
3348 * src/od.c (ISPEC_TO_FORMAT): Define macro.
3349 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
3350 Reported by Arun Sharma.
3352 2002-09-17 Jim Meyering <jim@meyering.net>
3354 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
3355 From gettext's intl/loadmsgcat.c.
3357 * tests/od/x8: New file/test, for the above fix.
3358 * tests/od/Makefile.am (TESTS): Add x8.
3360 2002-09-15 Jim Meyering <jim@meyering.net>
3362 * Use autoconf-2.54. Regenerate dependent files.
3364 * src/csplit.c (get_format_width): Add cast to avoid
3365 warning about `signed and unsigned type in conditional expression'.
3367 2002-09-14 Jim Meyering <jim@meyering.net>
3369 * src/who.c (print_user): Change type of local to size_t
3370 to avoid warnings about `comparison between signed and unsigned'.
3371 * src/ptx.c (generate_all_output): Likewise.
3373 * src/dd.c (main, skip): Add casts to avoid warnings about
3374 `comparison between signed and unsigned'.
3376 * src/id.c (print_full_info, print_group_list): Add casts to avoid
3377 warnings about `signed and unsigned type in conditional expression'.
3379 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
3380 to avoid warnings about `comparison between signed and unsigned'.
3381 (split_3): Change parameter names to be readable and add comment.
3382 Clean up the test for whether a line may be ignored.
3384 2002-09-13 Jim Meyering <jim@meyering.net>
3386 * src/printf.c (main): Handle leading command line argument of `--'.
3387 Reported by Raul: DervishD <raul@pleyades.net>
3388 * tests/misc/printf: New file: test for the above.
3389 * tests/misc/Makefile.am (TESTS): Add printf.
3391 * src/date.c (usage): Explain that %S's range of [0..60] is required --
3392 rather than 0..59 -- to accommodate the occasional positive leap second.
3393 Reported by Richard Neill.
3395 2002-09-12 Jim Meyering <jim@meyering.net>
3397 * src/Makefile.am (nanosec_libs): Define.
3398 (sleep_LDADD, tail_LDADD): Use it here.
3400 Factor nanosleep-related code into ../lib/xnanosleep.c.
3401 * src/sleep.c: Include xnanosleep.h.
3402 Factor out fenv.h-related code.
3403 (timespec_subtract): Remove function.
3404 (main): Remove code that deals with computing start and stop times
3405 as well as the loop around nanosleep. Now that's in xnanosleep.c.
3407 Allow S (in --sleep-interval=S) to be a floating point value.
3408 * src/tail.c: Include xnanosleep.h and xstrtod.h.
3409 Move declaration of global variable, sleep_interval, to ...
3411 (usage): Update description of --sleep-interval option.
3412 (tail_forever): New parameter, sleep_interval. Update caller.
3413 Use xnanosleep, rather than sleep.
3414 (parse_options): New parameter, sleep_interval. Update caller.
3415 Use xstrtod, now that we accept floating point values.
3416 Prompted by a patch from Augey Mikus.
3418 2002-09-06 Jim Meyering <jim@meyering.net>
3420 * src/remove.c (prompt): Change comment to give a better note to
3421 translators. From Michael Piefel.
3423 2002-09-02 Jim Meyering <jim@meyering.net>
3425 * README: A good problem report/patch includes diffs against
3426 the most recent test release.
3428 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
3429 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
3431 * src/kill.c (print_table_row): Use an unsigned type for widths
3432 to avoid warning about comparison between signed and unsigned.
3433 (list_signals): Likewise.
3435 * src/od.c (skip): Add a cast to avoid warning about comparison
3436 between signed and unsigned.
3437 * src/install.c (get_ids): Likewise. Also rearrange range-checking
3438 comparisons to make them more readable.
3440 2002-09-01 Jim Meyering <jim@meyering.net>
3444 2002-08-31 Jim Meyering <jim@meyering.net>
3446 Symlinks were always reported as using 0 blocks.
3447 * src/system.h (ST_NBLOCKS): Don't depend on file type.
3448 This reverts the change of 2000-01-30.
3449 Based on a report and patch from Neil Brown via Michael Stone.
3450 This fixes Debian Bug#156358.
3452 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
3453 `exit (1)' to `exit (EXIT_FAILURE)', and
3454 `usage (1)' to `usage (EXIT_FAILURE)'.
3456 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
3457 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
3458 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
3459 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
3460 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
3461 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
3462 error never exits successfully.
3464 2002-08-29 Jim Meyering <jim@meyering.net>
3466 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
3467 when ignoring any return value.
3469 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
3470 failures. On some systems (at least EMC Celerra and Solaris5.8),
3471 this appears to be necessary.
3472 (is_empty_dir): Likewise. Also, always close directory handle.
3473 * src/ls.c (print_dir): Likewise.
3474 (print_dir): Rename local variable: reading -> dirp.
3475 Reported by Mike Coleman.
3477 2002-08-28 Jim Meyering <jim@meyering.net>
3479 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
3480 Give a diagnostic and fail if closedir fails.
3482 2002-08-26 Jim Meyering <jim@meyering.net>
3484 * Makefile.am (THANKS-to-translators): New rule.
3485 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
3486 * THANKStt.in: New file.
3488 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
3490 (main): Register it with atexit.
3491 Close STDOUT_FILENO, to avoid a problem when writing to
3492 /dev/audio on at least Solaris 5.7 and 5.8 systems.
3493 Reported by Shing-Shong Shei.
3495 2002-08-25 Jim Meyering <jim@meyering.net>
3497 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
3498 * src/tac.c (main): Likewise.
3499 * src/tail.c (main): Likewise.
3500 * src/tee.c (main): Likewise.
3501 * src/tr.c (main): Likewise.
3502 * src/wc.c (main): Likewise.
3504 2002-08-20 Jim Meyering <jim@meyering.net>
3506 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
3508 2002-08-10 Paul Eggert <eggert@twinsun.com>
3510 * src/nohup.sh: Don't use "exec --"; it's not portable and
3511 shouldn't be needed.
3513 2002-08-09 Jim Meyering <jim@meyering.net>
3515 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
3516 (usage): Clarify help text for the -COLUMN option.
3517 Patch by Padraig Brady.
3518 * tests/pr/Test.pm [col-last]: New test for the above.
3520 * configure.ac: Start with version 4.5.1, chosen so that it's larger
3521 than the latest version numbers of the component packages.
3523 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
3526 2002-08-08 Jim Meyering <jim@meyering.net>
3528 * src/date.c: Guard inclusion of <langinfo.h> with
3529 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
3530 * src/sort.c: Likewise.
3531 Patch by GOTO Masanori.
3533 2002-08-05 Paul Eggert <eggert@twinsun.com>
3535 Fix some minor time-related bugs with POSIX time arguments.
3536 Some valid time stamps were being rejected (notably -1, and
3537 time stamps before 1900 on 64-bit hosts). And some invalid
3538 time stamps were being accepted, e.g. September 31.
3540 * src/date.c (main): Adjust to posixtime signature change.
3541 * src/touch.c (main): Likewise. Remove unnecessary initialization.
3542 Use localtime, not posixtm, to warn about obsolete "touch".
3544 2002-08-05 Jim Meyering <jim@meyering.net>
3546 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
3548 2002-08-04 Jim Meyering <jim@meyering.net>
3550 * src/Makefile.am (check-README): New target/rule.
3551 (check): Depend on it.
3553 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
3555 2002-08-03 Jim Meyering <jim@meyering.net>
3557 * Makefile.am (SUBDIRS): Add old.
3558 * old/: New directory, containing legacy ChangeLog* and NEWS files
3559 from the fileutils, sh-utils, and textutils packages.
3561 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
3563 2002-08-02 Paul Eggert <eggert@twinsun.com>
3565 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
3567 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
3568 (hard_LC_COLLATE): New var.
3569 (different): Args are now char *, not const char *.
3570 Use xmemcoll instead of memcmp to compare lines, so that
3571 LC_COLLATE has effect. However, use memcmp if it is an
3573 (check_file): Do not include newline in comparison, so that
3574 xmemcoll has a byte to stomp on temporarily.
3575 (main): Set hard_LC_COLLATE.
3577 2002-07-29 Jim Meyering <jim@meyering.net>
3579 * Makefile.am (SUBDIRS): Remove djgpp, for now.
3581 2002-07-20 Jim Meyering <jim@meyering.net>
3583 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
3584 into EXIT_FAILURE. Otherwise, false --help and false --version
3587 2002-07-08 Jim Meyering <jim@meyering.net>
3589 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
3590 rather than the hard-coded `sh-utils'.
3592 2002-07-01 Jim Meyering <jim@meyering.net>
3594 * configure.ac: Merge the three files from fileutils,
3595 textutils, and sh-utils.
3596 * Makefile.am: Likewise.
3597 * src/Makefile.am: Likewise.