1 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
5 Fix problem reported by Scott S. Tinsley for HP-UX 11.11 using
6 HP's ANSI C compiler. Declaring int functions causes warnings on
7 some modern systems and shouldn't be needed to compile on ancient
9 * src/copy.h (stat, lstat, rename): Remove decls.
10 * src/install.c (stat): Remove decl.
11 * src/ln.c (link, symlink): Remove decls.
13 2004-11-25 Jim Meyering <jim@meyering.net>
15 * man/help2man: Import help2man-1.35.1.
16 * man/Makefile.am (.x.1): Remove now-unnecessary use of
17 locally-added --program-name=NAME option. Now, help2man gets
18 the name from the [NAME] section (i.e. from our .x file).
19 * man/install.x: Use `install', not `ginstall' in the one-line
20 description. Reported by Brendan O'Dea.
21 * man/sha1sum.x: Use `sha1sum', not `shasum'.
23 2004-11-24 Jim Meyering <jim@meyering.net>
25 Since the changes of 2004-05-22, the u.saved_cwd member at
26 the bottom of the active-directory stack was no longer
27 strictly necessary. This change removes that member and uses
28 the newer cwd_state parameter for the final restore_cwd.
30 * src/remove.c (struct AD_ent) [u]: Remove now-unnecessary union.
31 [dev_ino]: Rename from `a'.
32 (AD_pop_and_chdir): Add a parameter to play the role of just-removed
33 bottom-of-stack cwd-state member.
34 (AD_pop_and_chdir): No longer return boolean. Adjust caller.
35 (AD_push_initial): Remove CWD parameter. Adjust caller.
37 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
39 Minor performance improvements and cleanups for "touch".
40 * src/touch.c (posix_date): Remove; not needed as a static var.
42 (touch): Use new futimens function to operate more efficiently
43 in some cases. Don't stat/fstat existing file when
44 (!amtime_now && change_times == (CH_ATIME | CH_MTIME)); the
45 old time stamps aren't needed in that case.
46 (main): change_times is int, not bool. Simplify test for
49 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
51 * src/install.c (usage): Avoid usage that runs afoul of Docbook
52 translation. Problem reported by Eric S. Raymond.
54 Restore dd's noctty flag, reverting the change of 2004-04-08.
55 POSIX does not allow "dd" to use O_NOCTTY by default.
56 * NEWS: Add noctty flag to dd.
57 * doc/coreutils.texi (dd invocation): Likewise.
58 * src/dd.c (flags, usage, main): Likewise.
60 2004-11-19 Alfred M. Szmidt <ams@gnu.org>
62 * src/ls.c (usage): Clarified description of --no-group (-G),
63 --human-readable (-h), --inode (-i), --size (-s), --time,
66 2004-11-19 Jim Meyering <jim@meyering.net>
68 * src/ls.c (usage): Clarify description of --author.
69 Tweak indentation so that help2man creates better nroff.
70 Reported by Dan Jacobson.
72 * src/uniq.c (check_file): Don't check stdout for errors here.
74 * src/pwd.c (find_dir_entry): Update comment to match reality.
76 2004-11-18 Jim Meyering <jim@meyering.net>
78 * src/pwd.c (robust_getcwd): Correct the comment: this function
79 constructs the directory name. The caller prints it.
81 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
83 * src/stat.c (STATFS): New macro, for portability to Solaris 9.
86 * src/basename.c, src/chroot.c, src/cksum.c, src/dd.c, src/dirname.c,
87 src/factor.c, src/hostid.c, src/hostname.c, src/link.c, src/logname.c,
88 src/nohup.c, src/printenv.c, src/pwd.c, src/setuidgid.c, src/sleep.c,
89 src/sync.c, src/tsort.c, src/unlink.c, src/uptime.c, src/users.c,
90 src/whoami.c, src/yes.c (main): Use getopt_long rather than getopt.
91 * src/readlink.c (main): argv is not const.
93 * src/cut.c (usage): Improve documentation along the lines suggested
95 * src/echo.c (usage): Likewise.
96 * src/expr.c (usage): Likewise.
98 * src/dircolors.hin: Add putty, screen-bce.
100 * src/pinky.c (print_entry): Fix memory leak.
101 * src/who.c (print_user): Likewise.
103 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
105 * NEWS: New dd operand "status=noxfer".
106 * src/dd.c (C_ASCII, C_EBCDIC, C_IBM, C_BLOCK, C_UNBLOCK,
107 C_LCASE, C_UCASE, C_SWAB, C_NOERROR, C_NOTRUNC, C_SYNC, C_TWOBUFS,
108 C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): Now constants, not
110 (STATUS_NOXFER, statuses): New constants.
111 (usage, print_stats, scanargs): Add support for status=noxfer.
112 (usage): Update status output to match new behavior.
113 (print_stats): Always output complete byte count.
114 Put space between numbers and units, as SI requires.
115 Use ngettext so that i18n can use plurals for "byte" and "second".
116 Don't multiply by 1e-9 (inexact); divide by 1e9 (which is exact).
117 (iflag_error_msgid, oflag_error_msgid): Remove; replace uses by
119 * tests/dd/skip-seek (@Tests): Use status=noxfer to avoid
120 problems with regression testing.
122 2004-11-14 Paul Eggert <eggert@cs.ucla.edu>
124 * NEWS: dd now outputs total bytes, seconds, and bytes per second.
125 * src/Makefile.am (dd_LDADD): Add $(LIB_CLOCK_GETTIME).
126 * src/dd.c: Include "human.h".
127 (w_bytes, start_time): New vars.
128 (usage): Document new I/O statistics output
129 (print_stats): Output new I/O statistics.
130 (cleanup): Do statistics after closing stdin and stdout, so that
131 the times are more accurate.
132 (write_output, dd_copy): Count output bytes.
133 (main): Get initial value of clock.
135 2004-11-14 Jim Meyering <jim@meyering.net>
137 Backslash-escape `-'s in email addresses, so that they are
138 rendered properly in UTF-locales.
139 * man/help2man (escape_hyphens): New function.
140 (main): Call it on email addresses.
142 * src/sort.c (zaptemp): Mark new diagnostic for translation.
144 * tests/misc/close-stdout: New file. Test today's closeout.c change.
145 * tests/misc/Makefile.am (TESTS): Add close-stdout.
147 2004-11-13 Jim Meyering <jim@meyering.net>
149 * src/test.c (usage): Put the description of `[-n] STRING'
150 on two lines, one for `-n STRING' and one for `STRING' so that
151 help2man properly escapes the `-'. Otherwise, the hyphen is
152 rendered inappropriately in UTF-8 locales.
153 Reported by Uwe Zeisberger in http://bugs.debian.org/281069.
155 2004-11-12 Paul Eggert <eggert@cs.ucla.edu>
157 * NEWS: Document the following changes.
159 * src/sort.c: Avoid O(N**2) behavior when there are many temporary
161 (temptail): New variable, so that we can easily append to list.
162 (create_temp_file): Create new files at end of list, so that
163 searching the list has O(N*NMERGE) behavior instead of O(N**2).
164 (zaptemp): Update temptail if needed.
165 (mergefps, merge): Accept new arg that counts temp files, and keep it
166 up to date as we create and remove temporaries. This is for
167 efficiency, so that we don't call zaptemp so often.
169 (sort): Don't create array in reverse order, since the list of
170 temporaries is now in the correct order.
172 (zaptemp): Protect against race condition: if 'sort' is
173 interrupted in the middle of zaptemp, it might unlink the
174 temporary file twice, and the second time this happens the file
175 might already have been created by some other process.
177 (zaptemp): Warn if a temporary file is not removed.
179 (create_temp_file): Use offsetof for clarity.
180 (die): Move it up earlier, to clean up the code a bit.
182 * src/pr.c (strtoumax): Declare if not declared.
183 (skip_to_page, first_page_number, last_page_number, page_number,
184 first_last_page, print_header):
185 Use uintmax_t for page numbers.
186 (first_last_page): Remove unnecessary forward declaration.
187 Do not modify arg (it is now a const pointer).
188 Return a true if successful, false (without print a diagnostic)
190 (main): If +XXX does not specify a valid page range, treat it
191 as a file name. This follows the response to Open Group XCU ERN 41
192 <http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>,
193 which says the behavior is allowed.
194 (skip_to_page): When starting page number exceeds page count,
195 print both numbers in the diagnostic.
196 (print_header): Detect page number overflow.
198 2004-11-07 Jim Meyering <jim@meyering.net>
200 * src/uname.c [__APPLE__]: Include <mach/machine.h> and <mach-o/arch.h>.
201 (main) [__APPLE__]: Get the processor type via syscall rather than
202 hard-coding "powerpc". From Toby Peterson.
204 * src/sort.c (merge): Remove declarations of now-unused variables.
206 2004-11-06 Paul Eggert <eggert@cs.ucla.edu>
208 * src/sort.c (first_same_file): Remove. Move most of the code to....
209 (avoid_trashing_input): New function.
210 (merge): Avoid some silly merges, e.g., copying a single file to
211 a temporary file when there are exactly 17 input files to merge.
212 Take a count of temporary files rather than a max_merge arg.
215 2004-11-06 Jim Meyering <jim@meyering.net>
217 * src/sort.c (xfclose): Don't close stdout here (just flush it),
218 since close_stdout now closes stdout unconditionally.
220 2004-11-05 Paul Eggert <eggert@cs.ucla.edu>
222 * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps,
223 first_same_file, merge, sort, main): Use size_t for indexes to arrays.
224 This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
226 (getmonth, keycompare, compare): Rewrite to avoid need for alloca,
227 thus avoiding unchecked stack overflow in some cases. As a side
228 effect this improve the performance of "sort -M" by a factor of 4
231 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
233 * src/stty.c: Include "vasprintf.h" since we use vasprintf now.
235 * src/Makefile.am (check-AUTHORS): Don't assume \? works in a sed
236 expression; it's not portable. Problem reported by Albert Chin.
237 Don't invoke a program more than once.
238 * src/groups.sh (version): New variable, containing author info,
239 for benefit of AUTHORS check. Use it when acting on --version option.
240 * AUTHORS: Remove duplicate lines. Remove bogus "chroot:"
243 * src/system.h: Don't #define and #undef getopt around <stdlib.h>,
244 as this breaks the new regime that does "#define getopt rpl_getopt".
245 Problem reported by Albert Chin for Solaris 9 with Sun cc in:
246 http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00019.html
247 I suppose this may cause problems on ancient hosts with
248 incompatible getopt declarations, but we'll cross that bridge if
249 the problem gets reported to us by someone who can test the fix.
251 2004-11-03 Jim Meyering <jim@meyering.net>
253 * src/tac.c: quote(...) file names in diagnostics.
255 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
257 * NEWS: Document getdate changes.
259 2004-10-29 Jim Meyering <jim@meyering.net>
261 * src/tac.c (tac_file): Remove temporary prototype and move this
262 function `down' so that it precedes definition of tac_nonseekable.
264 `tac /proc/modules' would print nothing
265 Reported by Harald Dunkel in http://bugs.debian.org/278604.
267 * src/tac.c (copy_to_temp): Renamed from save_stdin, since
268 now it copies a general file descriptor, not just stdin.
269 (tac_nonseekable): Renamed/adapted from tac_stdin.
270 (tac_file): Get fd via `open' directly rather than via fopen/fileno,
271 since we never used the stream. Perform "-" to stdin mapping here
272 rather than in main. Determine whether a file is seekable,
273 by trying to `lseek' to its end, and dispatch to tac_seekable or
274 tac_nonseekable accordingly.
275 (main): Rewrite argument handling now that it uses only tac_file.
276 * NEWS: Mention it here.
278 2004-10-21 Jim Meyering <jim@meyering.net>
280 * tests/mv/leak-fd: New file.
281 * tests/mv/Makefile.am (TESTS): Add it.
282 * tests/rm/dot-rel: New file.
283 * tests/rm/Makefile.am (TESTS): Add it.
285 Correct my patch of 2004-10-18.
286 * src/remove.c (rm): Destroy the saved_cwd here (via cwd_state),
287 if necessary, not in remove_dir. Otherwise, removing multiple
288 `.'-relative nonempty directories no longer worked.
290 2004-10-20 Paul Eggert <eggert@cs.ucla.edu>
292 * src/fmt.c (usage): Improve description of --prefix.
293 Problem reported by Edward Welbourne.
295 * man/uniq.x: Change summary so that it doesn't imply that
296 uniq writes to its input file. Problem reported by
299 2004-10-18 Jim Meyering <jim@meyering.net>
301 Plug a leak that would cause a cross-device mv to fail when
302 operating on too many command-line-specified nonempty directories.
303 * src/remove.c (remove_dir): Destroy the `struct saved_cwd' on the
304 top of the stack before returning. This usually closes the file
305 descriptor that was used to return to the original working directory.
306 Reported by Cyril Bouthors in
307 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/3048
308 * NEWS: Mention it here.
310 * src/pathchk.c (validate_file_name): Give a more descriptive
311 diagnostic when pathconf fails. This also avoids an unwarranted
312 warning from gcc-3.3.5 about a format not being a string literal.
314 * src/sleep.c (main): Remove declaration of unused local, c.
315 * src/printenv.c (main): Likewise.
316 * src/logname.c (main): Likewise.
317 * src/uptime.c (main): Likewise, for optc.
318 * src/tsort.c (main): Likewise, for opt.
320 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
322 * AUTHORS: Add self to pathchk.
323 * src/pathchk.c (AUTHORS): Add self.
324 Change "path" to "file name" whenever possible.
325 Remove usage comment, as it was a duplication of the code or doc.
326 Include <wchar.h> if available.
327 (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define.
328 (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX,
329 pathconf_wrapper, portable_chars, dir_ok): Remove.
330 (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros.
331 (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent.
332 (portable_chars_only): New arg FILELEN.
333 Don't assume ASCII; we might be on an EBCDIC host.
334 Don't assume unibyte locale in diagnostic.
335 (component_start, component_len): New functions.
336 (validate_file_name): Renamed from validate_path. All uses changed.
337 Pretty much a complete rewrite.
338 Don't make copy of file arg. Always append trailing slash to
339 pathconf arg, just in case it's a symlink (this is pure paranoia;
340 we don't know of any hosts where the trailing slash is required).
341 Use size_t instead of long int when possible.
342 Avoid need to call pathconf in most practical cases.
343 Don't use euidaccess several times to test searchability;
344 just use lstat once. Reword diagnostic to put the (often very long)
347 2004-10-15 Paul Eggert <eggert@cs.ucla.edu>
349 * src/printf.c (usage): Mention Unicode, and use H for hex digits.
351 2004-10-13 Jim Meyering <jim@meyering.net>
353 * NEWS: Mention today's fts.c fix.
355 2004-10-13 Paul Eggert <eggert@cs.ucla.edu>
357 * tests/stty/row-col-1: Set LC_ALL=C.
359 2004-10-12 Jim Meyering <jim@meyering.net>
361 * src/dircolors.hin: Add .flac and .mpc as audio suffixes.
362 From Jesus Climent in http://bugs.debian.org/276149.
364 2004-10-05 Paul Eggert <eggert@cs.ucla.edu>
366 * src/ls.c (ignore_mode): Renamed from ignore, to avoid shadowing
367 problems. All uses changed.
369 2004-10-05 Jim Meyering <jim@meyering.net>
371 * .x-sc_trailing_blank: Add an exclusion for config/texinfo.tex,
372 since Karl says its trailing blanks are there to stay :-)
374 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
376 * src/expr.c (NEW, OLD): Remove, partly to avoid
377 reference to obsolescent macro XMALLOC.
378 All uses replaced by xmalloc and free.
380 2004-09-28 Jim Meyering <jim@meyering.net>
382 * src/tail.c (usage): Clarify: --retry works only with --follow=name.
383 Reported by Nik A. Melchior in http://bugs.debian.org/273781.
385 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
387 * src/od.c (format_address_paren): c is optional, so don't output
390 2004-09-26 Paul Eggert <eggert@cs.ucla.edu>
392 Add support for ls --hide. Idea suggested by Bardur Arantsson.
393 * NEWS: Document this.
394 * src/ls.c (file_ignored): Renamed from file_interesting, with
395 inverted return value. Accept the file name, not a struct dirent *.
396 All uses changed. Avoid the expense of calling fnmatch if the
397 file is ignorable due to leading '.'.
398 (all_files, really_all_files): Removed; replaced by:
399 (ignore): New variable. All uses changed.
400 (IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION):
402 (hide_patterns): New variable.
403 (long_options, decode_switches, file_ignored, usage):
404 Add support for --hide.
405 (patterns_match): New function.
406 (usage): Replace "hide" with "ignore" in explanation, to avoid
409 2004-09-25 Paul Eggert <eggert@cs.ucla.edu>
411 * src/ls.c (gobble_file, print_long_format): Don't assume that
412 human-readable output has a byte count equal to its column width;
413 this isn't always true in locales where the radix character is not
415 (format_user_or_group): Revamp code to match the above fix;
416 this avoids the (very faint) possibility of integer overflow.
418 2004-09-24 Paul Eggert <eggert@cs.ucla.edu>
420 * NEWS: Mention that "chmod -r -w x" now works as expected.
421 * src/chmod.c (main): Revamp option processing to support this.
422 * tests/chmod/Makefile.am (TESTS): Add 'usage'.
423 * tests/chmod/usage: New set of tests for usage like that.
425 2004-09-24 Jim Meyering <jim@meyering.net>
427 * Makefile.maint (CVS_LIST): Use --types=AFGM option so that
428 it lists only cvs-controlled regular files.
430 * src/csplit.c (xalloc_die): Declare to be `extern', not `static'
431 to avoid a warning from gcc-3.4.1. Reported by Paul Eggert.
433 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
435 * Makefile.maint (CVS_LIST): New macro.
436 (sc_space_tab, sc_prohibit_atoi_atof, sc_file_system,
437 sc_prohibit_jm_in_m4, sc_system_h_headers, sc_sun_os_names,
438 sc_trailing_blank, po-check): Use it instead of the
439 nonstandard "cvsu --list".
441 * src/tail.c (parse_obsolete_option): Bring back support
442 for obsolete option followed by non-obsolete, or by more
443 than one file. When obsolete, conform to SUSv2 rather than
444 original POSIX 1003.2-1992, as SUSv2 corrected the case of
445 "tail -c". Add support for the SUSv2 "b" modifier.
446 * NEWS: Mention the above.
447 * tests/tail/Test.pm: New test case obs-b to check the above.
448 err-[134] no longer need _POSIX2_VERSION=199209.
449 Fix comments to match revised behavior.
451 2004-09-22 Jim Meyering <jim@meyering.net>
453 * Use automake-1.9.2. Regenerate dependent files.
455 * src/remove.c (struct dirstack_state) [current_arg_jumpbuf]:
458 Clean up scoping etc. so that some make `distcheck' tests pass.
459 * src/csplit.c (xalloc_die): Declare to be static.
460 * src/chown-core.c (chown_files): Declare as `extern'.
461 * src/cp-hash.c (remember_created): Likewise.
462 * src/copy.c (copy): Likewise.
463 * src/checksum.h (enum) [ALG_MD5]: Define to be 1, not 0.
465 * src/id.c, src/nl.c, src/expand.c: Remove trailing blanks.
466 * src/unexpand.c: Likewise.
468 * src/Makefile.am (check-AUTHORS): New rule.
469 (check): Depend on it.
472 * Makefile.maint (syntax-check-rules): Remove duplicate sc_tight_scope.
473 (sc_system_h_headers): Also exclude copy.h; it includes <stdbool.h>.
475 2004-09-22 Paul Eggert <eggert@cs.ucla.edu>
477 * src/ls.c (decode_switches): Don't compare a short value
478 to SIZE_MAX: GCC sometimes complains.
480 2004-09-21 Paul Eggert <eggert@cs.ucla.edu>
482 * NEWS: The following commands now reject unknown options:
483 basename dirname factor hostname link nohup sync unlink yes
484 Also, pathchk no longer accepts trailing options.
486 * src/basename.c: Include <getopt.h>.
487 * src/chroot.c: Likewise.
488 * src/dirname.c: Likewise.
489 * src/factor.c: Likewise.
490 * src/hostid.c: Likewise.
491 * src/hostname.c: Likewise.
492 * src/nohup.c: Likewise.
493 * src/pwd.c: Likewise.
494 * src/setuidgid.c: Likewise.
495 * src/sync.c: Likewise.
497 * src/basename.c (main): Reject unknown options.
498 * src/dirname.c (main): Likewise.
499 * src/factor.c (main): Likewise.
500 * src/hostid.c (main): Likewise.
501 * src/hostname.c (main): Likewise.
502 * src/link.c (main): Likewise.
503 * src/nohup.c (main): Likewise.
504 * src/pwd.c (main): Likewise.
505 * src/setuidgid.c (main): Likewise.
506 * src/sync.c (main): Likewise.
507 * src/unlink.c (main): Likewise.
508 * src/yes.c (main): Likewise.
510 * src/cat.c (main): Remove unused "case 0".
511 * src/chgrp.c (main): Likewise.
512 * src/chmod.c (main): Likewise.
513 * src/chown.c (main): Likewise.
514 * src/comm.c (main): Likewise.
515 * src/cp.c (main): Likewise.
516 * src/csplit.c (main): Likewise.
517 * src/cut.c (main): Likewise.
518 * src/date.c (main): Likewise.
519 * src/df.c (main): Likewise.
520 * src/du.c (main): Likewise.
521 * src/env.c (main): Likewise.
522 * src/expand.c (main): Likewise.
523 * src/fold.c (main): Likewise.
524 * src/head.c (main): Likewise.
525 * src/id.c (main): Likewise.
526 * src/install.c (main): Likewise.
527 * src/join.c (main): Likewise.
528 * src/ln.c (main): Likewise.
529 * src/ls.c (decode_switches): Likewise.
530 * src/mkdir.c (main): Likewise.
531 * src/mkfifo.c (main): Likewise.
532 * src/mknode.c (main): Likewise.
533 * src/mv.c (main): Likewise.
534 * src/nl.c (main): Likewise.
535 * src/paste.c (main): Likewise.
536 * src/pinky.c (main): Likewise.
537 * src/pr.c (main): Likewise.
538 * src/ptx.c (main): Likewise.
539 * src/readlink.c (main): Likewise.
540 * src/rm.c (main): Likewise.
541 * src/rmdir.c (main): Likewise.
542 * src/seq.c (main): Likewise.
543 * src/shred.c (main): Likewise.
544 * src/split.c (main): Likewise.
545 * src/sum.c (main): Likewise.
546 * src/tac.c (main): Likewise.
547 * src/tail.c (main): Likewise.
548 * src/tee.c (main): Likewise.
549 * src/touch.c (main): Likewise.
550 * src/tr.c (main): Likewise.
551 * src/tty.c (main): Likewise.
552 * src/uname.c (main): Likewise.
553 * src/unexpand.c (main): Likewise.
554 * src/wc.c (main): Likewise.
555 * src/who.c (main): Likewise.
557 * src/chroot.c (main): Use getopt where it suffices, not getopt_long.
558 * src/cksum.c (main): Likewise.
559 * src/dd.c (main): Likewise.
560 * src/logname.c (main): Likewise.
561 * src/printenv.c (main): Likewise.
562 * src/sleep.c (main): Likewise.
563 * src/tsort.c (main): Likewise.
564 * src/uptime.c (main): Likewise.
565 * src/users.c (main): Likewise.
566 * src/whoami.c (main): Likewise.
568 * src/du.c (long_options): Standardize on NULL vs 0.
569 * src/rm.c (long_opts): Likewise.
571 * src/logname.c (long_options): Remove.
572 * src/printenv.c (long_options): Likewise.
573 * src/sleep.c (long_options): Likewise.
574 * src/tsort.c (long_options): Likewise.
575 * src/uptime.c (longopts): Likewise.
576 * src/users.c (longopts): Likewise.
577 * src/whoami.c (long_options): Likewise.
579 * src/pathchk.c (longopts): Add --help, --version.
580 (main): Use longopts rather than parse_long_options.
581 * src/stty.c (longpts, main): Likewise.
583 * src/pathchk.c (main): Don't reorder arguments, so that
584 we can check weird file names.
586 * src/readlink.c: Don't include "long-options.h".
587 * src/sort.c: Likewise.
588 * src/stty.c: Likewise.
590 * src/split.c (verbose): Now bool, not int.
591 (VERBOSE_OPTION): New enum.
592 (longopts, main): Use it.
594 * tests/factor/basic: Adjust to new wording in diagnostic
595 that results from the above changes.
597 2004-09-21 Jim Meyering <jim@meyering.net>
599 * man/rm.x: Say "the response is affirmative" rather than "the
600 response begins with y or Y", so that the documentation is
601 accurate in non-English locales. Problem reported by Munzir Taha.
603 2004-09-19 Paul Eggert <eggert@cs.ucla.edu>
605 * src/echo.c (main): Don't pass NULL to strcmp when
606 POSIXLY_CORRECT and given no arguments.
608 * src/md5sum.c (STRING_OPTION): Remove.
609 (long_options, main): Remove support for undocumented and
610 obsolete --string option, as suggested in the 1996-09-26 patch.
611 * NEWS: Document this.
613 * tests/rm/fail-eperm: Don't try to remove writeable files in a
614 sticky /tmp directory, as SVR4-like systems (e.g., Solaris 9) let
615 you remove such files. Problem reported by Bert Fischer in:
616 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00074.html
618 2004-09-18 Paul Eggert <eggert@cs.ucla.edu>
620 * src/md5sum.c (STATUS_OPTION, STRING_OPTION): New enums.
621 (long_options, main): Use them instead of magic numbers 2 and 1.
622 For --string, optarg can't possibly be NULL.
624 * src/dd.c (usage): Distinguish between options and operands.
625 (scanargs): Don't mess with argc, argv; getopt_long handles this now.
626 Say "operands" for operands, not "options".
627 (main): Use getopt_long, so that "dd --" works as POSIX requires.
628 * tests/dd/misc: Check for "dd --".
630 * src/chroot.c (main): Reject unknown options instead of
631 interpreting them as a directory to chroot to.
633 * src/cksum.c: Remove obsolete comment about POSIX 1003.2/D11.2.
634 The current standard (POSIX 1003.1-2004) is correct.
635 (crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid
636 collision with builtin function.
637 (main) [defined CRCTAB]: Output in lowercase hexadecimal, and
638 output the first 0 as 8 digits, to make it easier to compare to
639 the text of the standard. Output crctab to be a const array.
640 (crctab): Use result of above changes.
641 (long_options): Remove; not needed if empty.
642 (main): getopt_long can't return 0 here, so simplify the code.
644 2004-09-13 Jim Meyering <jim@meyering.net>
646 * src/Makefile.am (localedir.h): Don't redirect directly to target.
648 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
650 * src/id.c (print_full_info): Don't exit with failure status simply
651 because a user or group number can't be turned into a name.
652 Problem reported by Felipe Kellermann in:
653 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00081.html
655 2004-09-12 Jim Meyering <jim@meyering.net>
657 * Makefile.maint (my-distcheck): When building with -Werror, also
660 2004-09-10 Paul Eggert <eggert@cs.ucla.edu>
662 * NEWS: "tail" now handles obscure POSIX 1003.2-1992 cases better.
663 * src/tail.c (parse_obsolete_option): Renamed from
664 parse_obsolescent_option, since the options are obsolete now.
665 Remove bool *arg; just exit if there's an error. Revamp to follow
666 POSIX 1003.2-1992 more precisely, to handle cases like "tail -
667 file" and "tail -10 -- file" correctly when we are conforming to
669 (main): Adjust to this change.
670 * tests/tail/Test.pm (test_vector): minus-* requires
671 _POSIX2_VERSION=199209 now, to work correctly if there is
672 an input file. err-1 and err-3 no longer errors if there
675 2004-09-09 Paul Eggert <eggert@cs.ucla.edu>
677 * src/test.c (usage): Document -r, -w, -x more carefully.
679 2004-09-08 Paul Eggert <eggert@cs.ucla.edu>
681 * src/test.c (usage): Document "test" (with no args) and "[ ]".
682 Document that -h and -L don't dereference.
684 * NEWS: Document that "tr xy -z" now works as per POSIX.
685 Sort the descriptions.
686 * src/tr.c (main): Don't reorder options.
687 * tests/tr/Test.pm (fowler-1): New test case.
689 2004-09-06 Paul Eggert <eggert@cs.ucla.edu>
691 * src/touch.c (main): Fix POSIX-conformance bug: "touch --
692 MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
693 conforming to pre-2001 POSIX.
694 * NEWS: Document this.
695 * tests/touch/obsolescent: Test for this bug. Also, set
696 _POSIX2_VERSION=199209 and POSIXLY_CORRECT=1 so that it's
697 a better test for obsolescent features.
699 * src/sort.c (main): Emulate Solaris 8 and 9 "sort -y", so that
700 "sort -y abc" is like "sort abc" whereas "sort -y 100" is like
703 * src/od.c: Several changes for POSIX and FreeBSD compatibility.
704 (COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X.
705 (long_options, main): --strings is now -S, not -s.
706 (usage): Reflect the usage changes.
707 (parse_old_offset): Do not issue a diagnostic on failure;
708 callers now do this as necessary.
709 (main): Support POSIX syntax. Remove unused case 0 from getopt_long.
710 Add support for new short options (many undocumented) for
711 compatibility with FreeBSD. Remove FIXME for -s; it's now
712 POSIX-compatible. Default format is now oS, not o2.
713 * NEWS: Describe the above.
715 2004-09-05 Paul Eggert <eggert@cs.ucla.edu>
717 * src/stty.c (valid_options): Remove.
718 (main): Fix some bugs in handling invalid option-combinations
720 (recover_mode): Arg is now char const *, not char *.
721 (main): Use STDIN_FILENO, not 0.
722 Simplify option-parsing code a tad.
723 * tests/stty/basic-1: Check for the fixed bugs.
725 2004-09-03 Paul Eggert <eggert@cs.ucla.edu>
727 * src/stat.c (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
728 it from ever being nonzero. Reported by Pozsar Balazs in:
729 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
730 (human_fstype): Add ramfs, squashfs, sysfs.
731 Reported by Pozsar Balazs in:
732 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
733 (human_fstype): Return char const *, not char *.
734 Simplify internals a bit, and avoid casts.
736 * src/dd.c (usage): "alternated EBCDIC" -> "alternate EBCDIC".
737 (bit_count): Remove. All uses changed to....
738 (multiple_bits_set): New function.
739 (scanargs): Use it, and check separately for each set of
740 incompatible options, to improve diagnostics.
742 (apply_translations): Move checks for incompatible options
743 to scanargs, so that they're done consistently.
745 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
747 Output correct errno-related diagnostic on "paste" I/O errors.
748 * src/paste.c (write_error, xputchar): New functions.
749 (paste_parallel): Use correct errno value after input error.
750 (paste_parallel, paste_serial): Report errno value after output error.
752 Port to diet libc. Problem reported by Felix von Leitner in:
753 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html
754 * src/paste.c (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove;
755 it's not portable C to assume FILE is a complete type.
756 (paste_parallel): Use index test instead of ENDLIST, and NULL
759 2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
761 POSIX-conformance fixes for "expand" and "unexpand".
762 Also, consistently use "tab stop" rather than "tabstop".
763 * NEWS: Document fixes.
764 * src/expand.c: Revamp to resemble the new unexpand.c better.
765 (usage): -i does not convert tabs after non-tabs.
766 (add_tab_stop): Renamed from add_tabstop. All uses changed.
767 (parse_tab_stop): Renamed from parse_tabstop. All uses changed.
768 (validate_tab_stop): Renamed from validate_tabstop. All uses changed.
769 (next_file, main): Check fclose against 0, not EOF.
770 (expand): Remove unnecessary casts.
771 Add another loop nesting level, for lines, so that per-line variables
772 are initialized cleanly.
773 Revamp tab checking. Check for write error immediately, rather
774 than just once at the end of the program.
775 * src/unexpand.c: Lkewise (for the expand.c changes).
776 (TAB_STOP_SENTINEL): Remove.
777 (tab_size): Now size_t, not uintmax_t, since we need to store
778 the sequences of blanks.
779 (max_column_width): New var.
780 (usage): Say "blank" where POSIX requires this.
781 (add_tab_stop): Calculate maximum column width.
782 (unexpand): Store the pending blanks, instead of merely counting them.
783 Follow POSIX's rules about -a requiring two blanks before a tab stop.
784 Get rid of internal label and goto.
785 * tests/unexpand/basic-1: Fix infloop-3 to match POSIX.
786 Add blanks-1 through blanks-13.
788 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
790 * NEWS: "chown : file", "chown '' file", and "chgrp '' file" now
791 succeed without changing the uid and gid, like FreeBSD.
792 * src/chgrp.c (parse_group): Return gid_t rather than storing it
793 through a pointer. Treat "chgrp '' file" as a no-op change,
795 (main): Set chopt.group_name to NULL if the group is the empty
797 * src/chown-core.c (describe_change): Describe changes to -1:-1
798 without using "to OWNERSHIP" phrase.
799 * src/chown.c (usage): "chown '' file" is now allowed.
800 (main): Do not set user name to the empty string if the group
802 * tests/chgrp/basic: Test "chgrp '' file".
803 * tests/chown/Makefile.am (TESTS): Add separator.
804 * tests/chown/separator: New file, partly taken from
805 Dmitry V. Levin's suggestion in
806 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
808 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
810 * tests/install/basic-1: Test for the -d regression.
812 2004-08-11 Dmitry V. Levin <ldv@altlinux.org>
814 * src/install.c (main): Fix -d regression introduced with
815 --target-directory support at 2004-06-25.
817 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
819 * src/copy.c (copy_internal): When preserving links, unlink
820 a destination with link count greater than one. This is so
821 that commands like "cp -a" don't get confused when copying into
822 a destination that already contains many hard links. Problem
823 reported by Tim Waugh in:
824 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00053.html
826 2004-08-10 Paul Eggert <eggert@cs.ucla.edu>
828 Convert all files to UTF-8.
829 * tests/fmt/basic (8-bit-pfx): Use UTF-8, not Latin-1.
830 * tests/sort/Test.pm (16a): Likewise.
831 * tests/uniq/Test.pm (8): Likewise.
832 * tests/misc/printf-hex: Use ASCII, not Latin-1.
834 * NEWS: Document "sort -o -" and "tee -" POSIX-conformance fixes.
835 * src/shred.c (usage): "-" is an operand, not an option.
836 * src/sort.c (die, xfopen, mergefps, first_same_file, merge):
837 A null file arg means standard output.
838 (main): "-o -" means to write to a file named "-",
839 not to standard output.
840 * src/tee.c (usage, tee): "tee -" writes to standard output, not
843 2004-08-10 Dmitry V. Levin <ldv@altlinux.org>
845 * src/install.c (change_timestamps): Fix int->bool conversion
846 bugs introduced on 2004-07-29.
848 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
850 * src/shred.c (wipename): Work even if the directory is writeable
851 and not readable. Prefer write access, since this should work
852 better with fdatasync.
854 * src/csplit.c (xalloc_die): New function.
855 (main): Remove now-obsolete initialization of xalloc_fail_func.
857 * src/md5sum.c: Adjust to sha->sha1 renaming.
859 2004-08-08 Dmitry V. Levin <ldv@altlinux.org>
862 * src/readlink.c (canonicalize_fname): Remove unneeded proxy function.
863 (can_mode): Make variable local.
865 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
867 * src/system.h (O_BINARY) [!O_BINARY && defined O_BINARY]:
868 Do not define, to avoid annoying compiler messages on QNX 6.3.
869 Problem reported by Johan in:
870 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00050.html
872 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
874 * src/system.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX):
875 Define to a concatenation of string literals, not to an expression;
876 needed for concatenation contexts.
877 (INTMAX_MAX, INTMAX_MIN): New macros.
879 * src/stat.c (print_stat): Don't assume st_ino / st_dev fits in
880 unsigned long; this isn't true for st_ino on Solaris 9.
882 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
884 * src/uname.c: Do not depend on HAVE_SYSCTL when deciding
885 whether to include files. Include <sys/param.h> if
886 HAVE_SYS_PARAM_H (not HAVE_SYSCTL).
887 (main) [defined __POWERPC__]: Add a kludge to work around a
888 Mac OS X bug, so that uname -p defaults to "powerpc" if
889 sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
890 fails. Problem reported by Petter Reinholdtsen in:
891 http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
893 * src/uniq.c (hard_LC_COLLATE, ignore_case, different, check_file,
894 main): Use bool for booleans.
895 (writeline, check_file): Use uintmax_t for line counts.
896 (check_file): Check for and report line number overflow,
898 * src/wc.c (iswspace, wc): Use to_uchar rather than a cast.
899 (print_lines, print_words, print_chars, print_bytes, print_linelength,
900 have_read_stdin, wc, wc_file, main):
901 Use bool for booleans.
902 (exit_status): Remove.
903 (wc, wc_file): Return bool status. All callers changed.
904 * src/who.c (scan_entries): 0 -> STDIN_FILENO.
905 * src/whoami.c (main): Print uids using unsigned long int, not
908 * src/unexpand.c: Int cleanup and minor reorganization to be more
910 Include quote.h, xstrndup.h.
911 (TAB_STOP_SENTINEL): Increase from INT_MAX to INTMAX_MAX.
912 (convert_entire_line, have_read_stdin, parse_tabstops, next_file,
914 Use bool for booleans.
915 (tab_size, tab_list, add_tabstop, validate_tabstops, unexpand):
916 Use uintmax_t for column counts.
917 (first_free_tab, validate_tabstops, unexpand): Use size_t for sizes.
918 (add_tabstop, parse_tabstops, main): Don't reserve UINTMAX_MAX
920 (parse_tabstops): Don't use ISBLANK on possibly-signed char.
921 Detect overflow in tab stop string.
922 (next_file, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
923 (unexpand): Concatenate input files the same way expand does.
925 * src/touch.c (no_create, use_ref, posix_date, amtime_now,
926 touch, main): Use bool for booleans.
927 (main): Avoid integer overflow when given more than INT_MAX
929 * src/tsort.c (struct item, n_strings): Use size_t for sizes.
930 (have_read_stdin, count_items, scan_zeros, detect_loop,
931 recurse_tree, walk_tree, tsort, main):
932 Use bool for booleans.
933 (exit_status): Remove.
934 (tsort): Return a success flag instead of storing into a global.
936 * src/tty.c (silent, main): Use bool for booleans.
937 (main): 0 -> STDIN_FILENO.
938 * src/uname.c (print_element): Use bool for booleans.
940 * src/test.c (TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND):
941 Remove. All uses replaced by C99 boolean primitives.
942 (TEST_TRUE, TEST_FALSE): New constants, for readability.
943 (test_unop, binop, unary_operator, binary_operator, two_arguments,
944 three_arguments, posixtest, expr, term, and, or, is_int, age_of,
945 one_argument, main): Use bool for booleans.
946 (advance, unary_advance): Now inline procedures rather than a macros.
947 (is_int): Renamed from isint, to avoid namespace clash with ctype.h.
948 (term, and, or): When it's easy, loop instead of recursing.
949 (term): Avoid integer overflow if there are INT_MAX-3 args (!).
950 (binary_operator, unary_operator): Simplify by systematically rewriting
951 true==FOO to FOO (where FOO is a boolean).
952 (unary_operator): Don't consider a file to be a regular file
953 merely because its mode&S_IFMT is zero. Just use S_ISREG.
954 Remove unnecessary casts. Remove ifdefs for things like
955 S_ISSOCK that are no longer needed, since stat-macros.h always
958 * src/tac-pipe.c (buf_init_from_stdin, find_bol, tac_mem):
959 Use bool for booleans.
960 (buf_init_from_stdin, buf_free, find_bol, print_line):
961 Use size_t for sizes.
962 * src/tac.c (separator_ends_record, tac_seekable, tac_file,
963 tac_stdin, tac_stdin_to_mem, main): Use bool for booleans.
964 (match_length, G_buffer_size, tac_seekable, main): Use size_t for sizes.
965 (tac_seekable): Use ptrdiff_t for pointer subtraction.
966 Report an error if the result is out of range.
967 (tac_seekable, main): Check for integer overflow in buffer size
969 (main): Remove unnecessary casts.
971 * src/su.c (run_shell): Pass a new n_additional_args arg, so that
972 the callee doesn't have to count 'em. All callers changed.
973 Don't allocate more space for the arg vector than we'll need.
974 Use memcpy to copy the args rather than rolling our own loop.
975 Use size_t for sizes.
976 (fast_startup, simulate_login, change_environment, log_su,
977 correct_password, restricted_shell, main): Use bool for booleans.
978 (longopts): Don't assume change_environment is an int.
979 Use NULL, not 0, for pointers.
980 (xsetenv): New function, replacing xputenv and concat.
982 (elements): Remove; no longer needed.
983 (log_su, correct_passwd, main): Prefer !x to x==NULL.
984 (log_su): 2 -> STDERR_FILENO.
985 (modify_environment, main): Don't assume that getenv's returned value
986 has an indefinite lifetime.
987 (modify_environment): Allocate a larger environ.
988 (main): Remove an impossible 'case 0'; if it happens now, it'll
989 get diagnosed. Don't assume getpwnam results outlive endpwent.
990 Check for null or empty pw_name, pw_dir and for null pw_passwd.
992 * src/stty.c (VA_START): Remove. All callers now use va_start.
993 (_POSIX_VDISABLE): Remove unnecessary cast.
994 (struct control_info, visible): Use cc_t for control chars.
995 (struct control_info): Use size_t for sizes.
996 (recover_mode, set_mode, display_speed, display_window_size,
997 valid_options, main, display_changed):
998 Use bool for booleans.
999 (integer_arg): Return unsigned long int, not long int.
1000 Accept new max arg; all callers changed, to specify a maximum
1001 value for integer parameters instead of silently overflowing.
1002 (wrap): Do not overrun the stack buffer if the output contains
1003 more than 1024 bytes. Instead, malloc a buffer.
1004 (main): Remove a "what is this?!?" FIXME. Nobody knows what it is.
1005 Remove unnecessary casts.
1006 (set_control_char): Allow int values only up to cc_t range.
1007 (screen_columns): Don't reject INT_MAX.
1008 (display_changed, display_all, display_speed, recover_mode):
1009 Don't assume cc_t fits in int.
1011 * src/remove.h: Add copyright notice.
1012 (struct rm_options): Use bool for booleans.
1013 * src/rmdir.c (empty_paths, ignore_fail_on_non_empty, verbose,
1014 errno_rmdir_non_empty, remove_parents, main): Likewise.
1015 * src/sum.c (have_read_stdin, bsd_sum_file, sysv_sum_file,
1017 (main): Don't dump core if invoked with argv[0]==NULL.
1018 * src/tee.c (tee, append, ignore_interrupts, main, tee):
1019 Use bool for booleans.
1020 (tee): Use ssize_t for read returns.
1022 * src/ptx.c: Add a FIXME mentioning that there are many
1023 unchecked integer overflows in this file.
1024 (gnu_extensions, auto_reference, input_reference, right_reference,
1025 ignore_case, initialize_regex, fix_output_parameters,
1026 output_one_roff_line, output_one_text_line, output_one_dumb_line, main):
1027 Use bool for booleans.
1028 (SKIP_SOMETHING, compare_words, digest_break_file,
1029 find_occurs_in_text, fix_output_parameters):
1030 Use to_uchar instead of a caset.
1031 (print_field): Rewrite to avoid cast.
1033 * src/printf.c (posixly_correct): Use bool for booleans.
1034 (verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
1035 (STRTOX): Rewrite to avoid casts.
1036 (print_esc_char): Arg is char, not int.
1037 * src/readlink.c (canonicalize): Remove. All uses now merely inspect
1039 (no_newline, verbose): Use bool for booleans.
1040 (can_mode): Now of type int; use -1 to denote otherwise-uninitialized.
1041 * src/shred.c (struct Options, main): Use bool for booleans.
1042 (isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
1043 * src/split.c (cwrite, bytes_split, lines_split, line_bytes_split):
1044 Use bool for booleans.
1045 * src/stat.c (G_fail): Remove.
1046 (print_statfs): Print various gotta-be-nonnegative values using
1047 unsigned long int, not long int or int.
1048 (do_statfs, do_stat): Return a boolean success flag.
1049 (do_stat, main): Use bool for booleans.
1051 * src/pr.c: Add a FIXME mentioning that there are many
1052 unchecked integer overflows in this file.
1053 (TRUE, FALSE): Remove. All uses replaced by true and false.
1054 (struct COLUMN, read_line, print_page, print_stored, open_file,
1055 skip_to_page, init_fps, parallel_files, align_empty_cols,
1056 empty_line, FF_only, explicit_columns, extremities, keep_FF,
1057 print_a_FF, print_a_header, use_form_feed, have_read_stdin,
1058 print_across_flag, storing_columns, balance_columns,
1059 truncate_lines, join_lines, untabify_input, failed_opens,
1060 numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix,
1061 double_space, ignore_failed_opens, use_col_separator,
1062 pad_vertically, last_line, main, init_parameters, skip_read,
1063 read_line, print_stored):
1064 Use bool for booleans.
1065 (struct COLUMN, char_to_clump, store_char, print_char):
1067 (clump_buff, print_clump): Use char[], not int[], for an array whose
1068 elements are always chars.
1069 (first_last_page, main, getoptarg, balance, add_line_number,
1070 char_to_uclump): Remove unnecessary casts.
1071 (init_parameters): Allocate chars, not ints, for clump_buff.
1072 (print_char): Use to_uchar before invoking ISPRINT.
1073 (char_to_clump): Convert to unsigned char before invoking ISPRINT.
1075 * src/nohup.c (main): Use bool for booleans.
1076 * src/paste.c (paste_parallel, paste_serial, main): Likewise.
1077 * src/pathchk.c (validate-path, main, portable_chars_only): Likewise.
1078 (portable_chars_only): Use to_uchar rather than a cast.
1079 * src/printenv.c (main): Use bool for booleans.
1080 Do not assume that the environ has at most one matching entry
1081 for each option (integer overflow was possible otherwise).
1083 * src/od.c (FMT_BYTES_ALLOCATED): Now an enum, not a decimal
1084 constant. Do not assume PRIdMAX etc. are strings of length 3 or
1086 (struct tspec): Use it. fmt_string is now an array, not
1087 a pointer, as there's little point to the indirection here.
1088 (struct tspec, flag_dump_strings,
1089 traditional, flag_pseudo_start, limit_bytes_to_format,
1090 abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul,
1091 decode_one_format, open_next_file, check_and_close,
1092 decode_format_string, skip, write_block, read_char, read_block,
1093 parse_old_offset, dump, dump_strings, main):
1094 Use bool for booleans.
1095 (struct tspec): Use void *, not char *, for generic pointers.
1096 (bytes_to_oct_digits, bytes_to_signed_dec_digits,
1097 bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
1098 Use char, not unsigned int, since char suffices.
1099 (print_s_char, print_char, print_s_short, print_short,
1100 print_int, print_long, print_long_long, print_float,
1101 print_double, print_long_double): Rewrite to avoid casts.
1102 These now take void * arguments, instead of char *.
1103 Use the same body for all functions, except for the choice
1104 of type. Assume C89 to simplify handling of signed char.
1105 (dump_hexl_mode_trailer, print_named_ascii, print_ascii):
1106 Rewrite to avoid casts.
1107 (print_named_ascii, print_ascii): Now takes void *, not char *.
1108 (decode_one_format): Use int for printf field widths, not
1109 unsigned int. Pass void * to subsidiary printers,
1110 not char *. Simplify handling of floating-point formats
1111 by factoring out common code dealing with precision and field width.
1112 (decode_format_string): Avoid need for temporary copy of
1113 each decoded struct tspec.
1114 (get_lcm): Remove unnecessary cast.
1115 (main): Fix bug where more than INT_MAX failed decodes were ignored.
1117 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
1119 * src/nl.c (TRUE, FALSE): Remove; all uses changed to true, false.
1120 (enum number_format): Remove.
1121 (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings,
1123 (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro.
1124 (section_del): Now const.
1125 (print_fmt): Remove.
1126 (starting_line_number, page_incr, blank_join, line_no,
1127 print_lineno, proc_text, main):
1128 Use intmax_t for line numbers.
1129 (reset_numbers, have_read_stdin, build_type_arg, nl_file, main):
1130 Use bool for booleans.
1131 (lineno_format): Now a string, not an enum value.
1132 (build_print_fmt): Remove. All calls removed. This work is
1133 now done within print_lineno.
1134 (build_type_arg): Use size_t for sizes.
1135 (print_lineno): Check for line number overflow.
1136 (proc_text, main): Remove unnecessary cast.
1138 * src/ln.c (symbolic_link, interactive, remove_existing_files,
1139 verbose, hard_dir_link, dereference_dest_dir_symlinks,
1140 do_link, main): Use bool for booleans.
1142 * src/ls.c (struct fileinfo, file_interesting,
1143 extract_dirs_from_files, color_symlink_as_referent,
1144 FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
1145 numeric_ids, print_block_size, dired, print_with_color,
1146 check_symlink_color, print_inode, recursive, immediate_dirs,
1147 all_files, really_all_files, qmark_funny_chars,
1148 print_dir_name, format_needs_stat, format_needs_type, visit_dir,
1149 main, decode_switches, parse_ls_color, print_dir, file_interesting,
1150 gobble_file, make_link_path, basename_is_dot_or_dotdot,
1151 extract_dirs_from_files, print_long_format):
1152 Use bool for booleans.
1153 (dir_defaulted): Remove; no longer needed.
1154 (main): Use int to count files, since it suffices for argv.
1155 Rewrite to avoid need for dir_defaulted.
1156 (main, print_dir, gobble_file, get_link_name,
1158 Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
1159 (decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
1160 Remove unnecessary cast to int. Use int instead of unsigned
1161 int to count from 0 to 1.
1162 (get_funky_string, print_type_indicator): Use char for bytes, not int.
1163 (make_link_path): Use NULL for null pointers.
1164 (quote_name): Use to_uchar instead of cast.
1166 * src/id.c (use_name, main, print_user, xgetgroups, print_group_list,
1167 print_full_info): Use bool for booleans.
1168 (problems): Remove, replacing with....
1169 (ok): New var (inverted from old sense).
1170 (print_user, print_group, print_full_info):
1171 Print uids/gids with %lu, not %u.
1172 (xgetgroups): Don't run out of memory if getgroups or getugroups
1174 * src/setuidgid.c (main): Print uids/gids with %lu, not %ld.
1176 * src/factor.c (wheel_tab): Use unsigned char instead of unsigned
1177 int, since it suffices.
1178 (factor, print_factors): Use size_t for sizes.
1179 (print_factors, do_stdin, main): Use bool for booleans.
1180 * src/fold.c (TAB_WIDTH): New macro; use it instead of "8".
1181 (fold_file, main): Use bool for booleans.
1182 (fold_file, main): Use size_t for sizes.
1183 (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead
1184 of prohibiting widths greater than INT_MAX.
1185 * src/head.c (presume_input_pipe, print_headers, have_read_stdin,
1186 write_header, elide_tail_bytes_pipe, elide_tail_bytes_file,
1187 elide_tail_lines_pipe, elide_tail_lines_seekable,
1188 elide_tail_lines_file, head_bytes, head_lines, head, head_file,
1189 string_to_integer, main):
1190 Use bool for booleans.
1191 (main): Rewrite to avoid cast.
1193 * src/csplit.c (struct line): Use size_t for sizes.
1194 (main): Remove unnecessary cast.
1195 * src/cut.c (cut_fields): Use to_uchar rather than a cast.
1196 * src/cut.c (cut_file, main): Use bool for booleans.
1197 * src/date.c (show_date, rfc_format, batch_convert, main): Likewise.
1198 * src/env.c (main): Likewise.
1199 * src/expr.c (nextarg): Likewise.
1200 * src/env.c (main): Remove unused and nonstandard envp arg.
1202 * src/fmt.c (COST, MAXWORDS): Add a comment describing some of
1203 fmt's arbitrary limits.
1204 (TRUE, FALSE): Remove; all uses changed to (true, false).
1205 (main): Use bool for booleans.
1206 Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol,
1208 (copy_rest): Remove unnecessary cast.
1209 (get_prefix): Rewrite to avoid cast.
1210 (check_punctuation): Use char *, not unsigned char *; C89 requires
1211 this. Avoid off-by-one buffer read overrun when line is empty.
1212 (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX.
1213 Remove unnecessary casts.
1214 * tests/fmt/basic (wide-1, wide-2, bad-suffix): Adjust to above
1217 * src/expand.c (convert_entire_line, have_read_stdin, parse_tabstops,
1218 next_file, expand, main):
1219 Use bool for booleans.
1220 (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops,
1222 Use uintmax_t for column counts.
1223 (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value.
1224 All callers changed.
1225 (parse_tabstops): Don't pass a negative char to isblank.
1226 Avoid memory leak with large tab stops.
1227 (validate_tabstops, expand): Don't assume number of tab stops is
1229 (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when
1230 storing values into exit_status.
1231 (expand): Use same pattern as unexpand for reading chars.
1232 Report an error when input line is too long, instead of silently
1233 screwing up. Do not mishandle tab stops when backspacing left
1236 * src/dircolors.c (have_read_stdin, append_quoted,
1237 dc_parse_stream, dc_parse_file, main): Use bool for booleans.
1238 (dc_parse_stream): Use enum for state, rather than int.
1239 Use ssize_t to store getline result.
1241 * src/dd.c (translation_needed, parse_integer, scanargs,
1242 apply_translations, char_is_saved, swab_buffer, skip_via_lseek):
1243 Use bool for booleans.
1244 (translate_buffer): Use to_uchar rather than a cast.
1245 (swab_buffer, copy_simple, copy_with_unblock):
1246 Use size_t for sizes.
1248 * src/seq.c (equal_width, valid_format, main): Use bool for booleans.
1249 * src/sleep.c (apply_suffix): Likewise.
1250 * src/tail.c (struct File_spec, reopen_inaccessible_files, count_lines,
1251 forever, from_start, print_headers, have_read_stdin, valid_file_spec,
1252 write_header, file_lines, pipe_lines, pipe_bytes, recheck,
1253 tail_forever, tail_bytes, tail_lines, tail, tail_file,
1254 parse_obsolescent_option, parse_options, main): Likewise.
1255 * src/sleep.c (apply_suffix): Invert sense of result.
1256 Use int (not unsigned int) for multiplier, as this generates better
1257 code with some compilers. Simplify code a bit.
1258 * src/tail.c (struct File_spec, max_n_unchanged_stats_between_opens,
1259 parse_options): Use uintmax_t, not unsigned int or unsigned long int,
1261 (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
1262 make it a bit clearer.
1264 * src/hostname.c: Include "xgethostname.h".
1265 (xgethostname): Remove decl; xgethostname.h has it.
1266 (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
1267 && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
1268 prototypes rather than K&R form. Assume any negative value from
1269 sysinfo denotes failure, not just -1.
1270 (main): Simplify use of sethostname.
1272 * src/pinky.c (include_idle, include_heading, include_fullname,
1273 include_project, include_plan, include_home_and_shell, do_short_format,
1274 include_where, main): Use bool for booleans.
1275 (count_ampersands, create_fullname, scan_entries, short_pinky):
1276 Use size_t for sizes.
1277 (create_fullname): Check for overflow in size calculations.
1278 (idle_string): Don't assume that the number of idle days
1279 is less than 10**8 and/or INT_MAX/(24*60*60).
1280 (main): No need to pass a non-NULL last arg to getopt_long.
1281 * src/uptime.c (print_uptime, uptime): Use size_t for sizes.
1282 (print_uptime): Remove unused local variable.
1283 (main): No need to pass a non-NULL last arg to getopt_long.
1284 * src/users.c (list_entries_users, users): Use size_t for sizes.
1285 (list_entries_users): Use char for bytes.
1286 (main): No need to pass a non-NULL last arg to getopt_long.
1287 * src/who.c (do_lookup, short_list, short_output, include_idle,
1288 include_heading, include_mesg, include_exit, need_boottime,
1289 need_deadprocs, need_login, need_initspawn, need_clockchange,
1290 need_runlevel, need_users, my_line_only, main): Use bool for booleans.
1291 (print_runlevel): Use unsigned char for bytes.
1292 (list_entries_who, scan_entries, who): Use size_t for sizes.
1293 (main): No need to pass a non-NULL last arg to getopt_long.
1295 * src/install.c (isdir): Remove decl.
1296 (install_file_to_path): Rely on make_path to fail if the destination
1297 is not a directory, by passing preserve_existing==true to it.
1298 Hence we no longer need to call isdir.
1299 Free dest_dir immediately when it's no longer needed, rather than
1300 waiting until the end of the function.
1301 (copy_file): Don't bother calling isdir, as copy will do the
1302 right thing if the destination is a directory.
1304 * src/du.c (fts_debug, opt_all, apparent_size, opt_count_all,
1305 print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
1306 Use bool for booleans.
1307 (max_depth): Now size_t, not int, to avoid an arbitrary limit
1308 of INT_MAX on depth.
1309 (G_fail): Remove: no longer needed, now that the relevant
1310 functions return bool.
1311 (process_file): Use return value to signal success rather than
1312 setting a global. Remove first_call static var; not needed, since
1313 we can look at n_alloc. Use size_t for depths. Remove FIXME
1314 about size_t casts, as it's now fixed. Use xnrealloc rather
1315 than the obsolescent XREALLOC. Don't bother to check whether
1316 reallocation is needed unless level > prev_level.
1317 (du_files): Invert sense of result, for consistency with
1318 other coreutils code. All callers changed.
1319 (main): Allow --max-depth values up to SIZE_MAX.
1321 * src/df.c (inode_format, show_all_fs, show_local_fs,
1322 show_listed_fs, posix_format, require_sync, print_type,
1323 selected_fstype, excluded_fstype, show_dev, show_point, main):
1324 Use bool for booleans.
1325 (df_readable, show_dev): Use UINTMAX_MAX instead of -1.
1326 (show_dev, show_point, main):
1327 Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
1328 Don't assume disk name lengths are <= INT_MAX.
1329 Rewrite pct calculation to avoid cast.
1330 (show_point): Don't assume resolved length is <= SSIZE_MAX.
1332 * src/cut.c (hash_int) [!defined UINTPTR_MAX]: Use size_t
1333 instead of uintptr_t.
1334 * src/shred.c (UINT_MAX_32_BITS): Remove.
1335 (word32): Remove. All uses changed to uint32_t.
1336 (isaac_seed_data): Remove unnecessary cast.
1337 * src/system.h (ptr_align): Use size_t; in practice, this is just as
1338 good as uintptr_t in checking for alignments, and has fewer
1339 configuration hassles.
1341 * src/Makefile.am (localedir.h): Make it readonly; this
1342 undoes part of the 2004-07-27 patch.
1344 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
1346 * src/sort.c (UCHAR): Remove; all uses changed to to_uchar.
1347 (IS_THOUSANDS_SEP): Use bool when appropriate.
1348 (numcompare, main): Use char, not int, when the value is always a char.
1349 (numcompare): Remove "register"; compilers are smart enough these days.
1350 * src/system.h (errno, CHAR_BIT): Remove decls;
1351 no longer needed now we assume C89 or better.
1352 Include <inttypes.h> before <stdint.h>, as it's the
1353 Autoconf-recommended pattern.
1354 (to_uchar): New inline function, moved here from tr.c.
1355 Use full names for int types, e.g. "long int" rather than "long".
1356 * src/tr.c (to_uchar): Remove; now in system.h.
1357 (is_char_class_member): Use bool when appropriate.
1359 * src/mkdir.c (create_parents, main): Use bool when appropriate.
1360 (main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
1362 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
1364 * src/mkfifo.c (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.
1366 * src/chmod.c (recurse, force_silent, process_file, process_files,
1367 main): Use bool when appropriate.
1368 * src/cksum.c (cksum, main): Likewise.
1369 * src/comm.c (hard_LC_COLLATE, only_file_1, only_file_2, both,
1370 compare_files, main): Likewise.
1372 * src/copy.h (struct cp_options): Likewise.
1373 * src/copy.c (copy_internal, is_ancestor, copy_dir, copy_reg,
1374 same_file_ok, seen_file, copy_internal, valid_options, copy): Likewise.
1375 * src/cp-hash.h (remember_created): Likewise.
1376 * src/cp-hash.c (remember_created): Likewise.
1377 * src/cp.c (struct dir_attr, flag_path, remove_trailing_slashes,
1378 re_protect, make_path_private, target_directory_operand, do_copy,
1379 cp_option_init, decode_preserve_arg, main): Likewise.
1380 * src/install.c (isdir, change_timestamps, change_attributes,
1381 copy_file, install_file_to_path, install_file_in_dir,
1382 install_file_in_file, strip_files, dir_arg, cp_option_init, main,
1383 change_attributes, change_timestamps): Likewise.
1384 * src/mv.c (remove_trailing_slashes, rm_option_init,
1385 cp_option_init, do_move, movefile, main): Likewise.
1386 * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
1387 AD_push, prompt, remove_dir): Likewise.
1388 * src/rm.c (rm_option_init, main): Likewise.
1390 * src/remove.c (top_dir, pop_dir, full_filename_):
1391 Use size_t for sizes.
1392 * src/cp.c (target_directory_operand): Do not clear *NEW_DST if stat
1393 succeeds. It's not necessary in that case, as *NEW_DST is always
1395 (do_copy): Rewrite slightly to avoid need for "unreachable" comment.
1396 (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
1397 * src/rm.c (main): Likewise.
1399 md5sum, sha1sum integer cleanups.
1401 * src/checksum.h: Don't include config.h, sys/types.h, stdio.h:
1403 (ALG_UNSPECIFIED): Remove.
1404 (ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
1405 * src/md5.c: Don't include any files other than checksum.h.
1406 * src/sha1sum.c: Likewise.
1407 * src/md5sum.c (OPENOPTS, have_read_stdin, status_only, warn,
1408 bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
1409 Use bool when appropriate.
1410 (digest_check): Increase limit of number of input lines to
1411 UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter.
1412 Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
1414 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
1416 * src/cat.c (exit_status): Remove. Now done by passing a boolean
1418 (simple_cat, cat): Return true if successful. All callers changed.
1419 (simple_cat, cat, main): Use bool for booleans.
1420 (simple_cat): Use size_t for sizes.
1421 (cat, main): Use the same names for parameters that we use for
1422 long options, to avoid confusion. This inverts the sense of the
1423 show_tabs (formerly output_tabs) and number_nonblank
1424 (formerly numbers_at_empty_lines) variables.
1425 (main): Don't mess up (due to integer overflow) if we are given
1426 INT_MAX - INT_MIN + 1 options.
1427 [O_BINARY]: Don't invoke isatty unless the other options require it.
1428 (main): When deciding whether to use simple_cat, don't worry
1429 about binary option; it's irrelevant.
1431 * src/dcgen: Remove comments, trailing white space, and empty
1432 lines from the output strings, to save space.
1433 Use a narrower type like 'unsigned char' for line lengths, if
1435 Make the output variables static, not extern.
1437 * src/chgrp.c (parse_group): Require base 10 when parsing
1439 (main): int -> bool when appropriate.
1440 * src/chown.c (main): Likewise.
1441 * src/chown-core.c: Include inttostr.h.
1442 (UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove.
1443 (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr
1444 instead of uint_to_string).
1445 (describe_change): Instead of an int flag, use a char *
1446 auxiliary; this avoids the need for casts.
1447 Assume free (NULL) works.
1448 (change_file_owner): Return true/false, not 0/-1, since
1449 we don't set errno. All callers changed.
1450 Use bool when appropriate.
1451 (chown_files): Likewise.
1452 * src/chown-core.h (chown_files): Likewise.
1454 * tests/chown/basic: Test for proper handling of uids like
1455 "010", which must be parsed as decimal.
1457 * tests/misc/pwd: Don't assume that Perl's getpwd agrees with our
1458 pwd when there are multiple names for the working directory
1459 (which can happen with an automounter, sigh).
1461 * src/Makefile.am ($(SCRIPTS)): Don't depend on Makefile;
1462 this causes Solaris 8 'make' to refuse to build "groups".
1463 (localedir.h): Don't depend on Makefile: this causes Solaris
1464 8 'make' to build localedir.h unnecessarily. The dependence
1465 on Makefile is ineffective anyway, since $(localedir) might
1466 change even if Makefile hasn't.
1468 * src/remove.c (remove_dir): If we can't save the state of the
1469 working directory, pretend we started from "/", not ".".
1470 This avoids a bug on hosts like Solaris that don't let you
1471 remove the working directory.
1473 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
1475 * src/printf.c (strtiomax, strtoumax): Declare if not already
1476 declared: this fixes a portability bug with Solaris 8 + GCC.
1477 (STRTOX): Parenthesize use of macro arg as expression.
1478 (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary
1480 * configure.ac: Check for declaration of strtoumax, for
1483 * src/Makefile.am (cp_LDADD, ginstall_LDADD, mv_LDADD,
1484 pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
1486 * tests/readlink/can-e: Don't assume that we can remove the
1487 working directory: this isn't possible under Solaris 8, say.
1488 * tests/readlink/can-f: Likewise.
1489 * tests/readlink/can-m: Likewise.
1491 * src/copy.c (copy_internal): find_backup_file_name no longer
1492 returns NULL, so don't bother to check for this.
1493 * src/cp.c (do_copy): Likewise.
1494 * src/ln.c (do_link): Likewise.
1496 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
1498 * src/nice.c (GET_NICE_VALUE): Renamed from GET_PRIORITY.
1500 (NZERO): New macro, if system doesn't define it already.
1501 (usage): Distinguish priorities from nice values.
1502 Don't assume NZERO is 20.
1503 (main): Use bool instead of int where appropriate.
1504 If user specifies an adjustment out of range, always truncate it
1505 to an inrange value instead of sometimes giving an error message
1507 Do not assume that -1 is an error return from "nice" or
1508 "getpriority", as it might be the current nice value minus NZERO.
1509 If nice/setpriority fails with errno == EPERM, go ahead and run
1510 the command anyway; POSIX requires this.
1512 * src/pathchk.c: Include euidaccess.h.
1513 (dir_ok): Use euidaccess, not access.
1514 * src/test.c (R_OK, W_OK, X_OK, FOK): Remove; system.h defines them.
1515 (eaccess): Remove. All users changed to use euidaccess instead.
1517 2004-07-24 Paul Eggert <eggert@cs.ucla.edu>
1519 * src/uptime.c (print_uptime) [defined BOOT_MSG]:
1520 Don't assume ut_line is null-terminated.
1521 * src/who.c (print_line): New arguments USERLEN and LINELEN,
1522 since USER and LINE might not be null terminated. All callers
1525 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
1527 Fix bug with "tail -f" reported by Rob Holland in
1528 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00054.html>.
1529 Also, remove the undocumented and unsupported-since-2000
1530 --max-consecutive-size-changes options. Fix another related bug:
1531 "tail" got confused if stdin, stdout, or stderr were closed.
1532 Also, use output buffering even with "tail -f".
1534 * NEWS: Document this, plus yesterday's patch.
1535 * doc/coreutils.texi (tail invocation): "size has remained the same"
1536 -> "file has not changed", which is more accurate for fifos.
1537 * src/tail.c: Include fcntl-safer.h.
1538 (COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong).
1539 (COPY_A_BUFFER): New macro.
1540 (struct File_spec): New members mtime, mode, blocking.
1541 Remove member n_consecutive_size_changes.
1542 (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES,
1543 max_n_consecutive_size_changes_between_opens,
1544 MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove.
1545 (long_options, tail_forever, parse_options):
1546 Remove (non-)support for --max-consecutive-size-changes.
1547 (record_open_fd): New function.
1548 (recheck, tail_file): Use it. Don't assume that stdin is open.
1549 (dump_remainder): Add support for new COPY_A_BUFFER special value.
1550 Treat errno==EAGAIN like EOF, since it might be a nonblocking read.
1551 (recheck): New arg BLOCKING, specifying whether to use blocking reads.
1553 (n_live_files): Remove, replacing with...
1554 (any_live_files): New function. All uses changed.
1555 (tail_forever): Use nonblocking I/O unless we know that blocking I/O
1556 is safe; this avoids some hangs when reading from a fifo.
1557 Avoid invoking fstat or sleep when using blocking I/O.
1558 Do not check for changes to size if the file is not a regular file,
1559 as the size is undefined in that case.
1560 Check for changes to mtime or mode, too; this works for non-regular
1562 (tail_forever, main): Redo fflush strategy to work even when input
1563 is nonblocking. Don't use unbuffered output; just flush when needed.
1565 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
1567 * src/tail.c (main): Ignore -f if no file operand is specified
1568 and standard input is a pipe.
1569 * doc/coreutils.texi (tail invocation): Do not ignore -f for
1570 all pipes, just for when standard input is a pipe and no
1571 file operand is specified.
1572 * tests/tail/Test.pm: Reinstate f-1 test, since we now pass.
1573 Add a new commented-out f-2 test, which we still fail.
1574 (test_vector): All f-* tests are special cases, not just f-1.
1576 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
1578 * src/uptime.c: Include c-strtod.h.
1579 (print_uptime): Use c_strtod instead of setlocale and sscanf.
1580 Use long int rather than int to count days (for 64-bit hosts),
1581 and check for arithmetic overflow when converting double to time_t.
1583 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
1585 * src/printf.c (vstrtold): Renamed from vstrtod.
1586 Now returns long double. All uses changed.
1587 (print_direc): Use "L" length modifier when printing floating point
1588 numbers, since we're now printing long double.
1590 2004-07-06 Paul Eggert <eggert@cs.ucla.edu>
1592 printf cleanup, to avoid undefined behavior, to add support for
1593 formats that Bash supports, and to support wide integers like
1596 * NEWS: Document this.
1597 * src/printf.c (UNSPECIFIED): Remove. All uses now replaced by
1598 booleans, so that we don't reserve any values for precision or
1600 (STRTOX): Use prototype, not K&R-style definition.
1601 (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol
1602 in ../lib), with type change to intmax_t.
1604 (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t.
1606 (vstrtod): Renamed from xstrtod. All uses changed.
1607 (print_direc): Use boolean arg instead of special value to indicate
1608 a missing precision or width. LENGTH no longer includes
1609 length modifiers or conversion character. New arg CONVERSION
1610 now specifies conversion character.
1611 Use intmax_t-width formatting for integers (like Bash).
1612 Add support for C99 %a, %A, %F (like Bash).
1613 Add support for field width with %c (POSIX requires this).
1614 Add a FIXME for lack of support for field width and precision
1616 Add support for '\'', '0' flags.
1617 Check for invalid combinations of flags, field width, precision,
1618 and conversion, to prevent use of undefined behavior.
1619 Allow multiple length modifiers, for formats like "%lld" (like Bash).
1620 Add support for C99 'j', 't', 'z' length modifiers (like Bash).
1621 In error message, output entire invalid conversion specification,
1622 instead of merely outputting % followed by the conversion char.
1623 * tests/misc/printf: Add tests for the above.
1625 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
1627 Change "readlink -f" to be more compatible with prior implementations.
1628 Add more canonicalize options, -e and -m.
1629 Add comprehensive tests for all readlink modes.
1631 * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME):
1632 Do not add canonicalize.c here.
1634 * src/readlink.c (longopts): Add new options.
1635 (usage): Document them.
1636 (canonicalize_fname): New proxy function.
1637 (main): Handle new options.
1638 * doc/coreutils.texi (readlink invocation): Document new
1639 "readlink -f" behaviour and new canonicalize options, -e and -m.
1641 * configure.ac (AC_CONFIG_FILES): Add tests/readlink/Makefile.
1642 * tests/Makefile.am (SUBDIRS): Add readlink.
1643 * tests/readlink/Makefile.am: New file.
1644 * tests/readlink/{rl-1,can-e,can-f,can-m}: New readlink tests.
1645 * tests/misc/Makefile.am (TESTS): Remove basic readlink test.
1646 * tests/misc/readlink: Remove file.
1648 2004-07-04 Jim Meyering <jim@meyering.net>
1650 * src/copy.c (copy_internal): Add a FIXME comment.
1652 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
1654 * src/copy.c (copy_dir): Assume path_concat returns non-NULL.
1655 * src/cp.c (do_copy): Likewise.
1656 * src/mv.c (movefile): Likewise.
1658 * src/cp.c (make_path_private): 2nd arg is now size_t, not int,
1659 to avoid problem when path_concat dir name is longer than 2 GiB (!).
1661 * src/nohup.c (main): Don't pass NULL first argument to path_concat.
1662 This cleans up the semantics a bit, as we no longer try to open the
1665 2004-07-01 Paul Eggert <eggert@cs.ucla.edu>
1667 * NEWS: Add short names -t and -T for --target-directory
1668 and --no-target-directory options, respectively.
1670 * src/cp.c (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
1671 Remove. All uses changed to 'T' and 't', respectively.
1672 * src/install.c, src/ln.c, src/mv.c: Likewise.
1674 * src/cp.c (long_opts, usage, do_copy, main): Add -t and -T as
1675 aliases for --target-directory and --no-target-directory,
1677 * src/install.c (long_options, main, usage): Likewise.
1678 * src/ln.c, src/mv.c: Likewise.
1680 2004-07-01 Jim Meyering <jim@meyering.net>
1682 * Makefile.maint (sc_file_system): New target.
1683 (syntax-check-rules): Add it.
1684 .x-sc_file_system: New file.
1685 * Makefile.am (EXTRA_DIST): Add it.
1687 * man/sync.x: Use "file system" rather than "filesystem".
1688 * man/stat.x, man/df.x: Likewise.
1690 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
1692 * src/df.c (usage, main): Output "file system" rather than
1694 * src/du.c (usage): Likewise.
1695 * src/shred.c (usage): Likewise.
1696 * src/stat.c (usage): Likewise.
1697 * src/stat.c (long_options, usage): Rename "--filesystem" to
1698 "--file-system". But keep the old name around, for compatibility
1701 2004-06-29 Paul Eggert <eggert@cs.ucla.edu>
1703 Add support for --no-target-directory option.
1705 * NEWS: Document it.
1706 * doc/coreutils.texi (Common options, Target directory, cp
1707 invocation, install invocation, mv invocation, ln invocation):
1709 (link invocation): Explain how to rewrite link using ln now
1710 that we have --no-target-directory.
1711 (ln invocation): Explain that --no-target-directory subsumes
1713 (unlink invocation): Modify wording to match new wording in
1716 * src/cp.c (NO_TARGET_DIRECTORY_OPTION): New constant.
1717 (long_opts, usage, do_copy, main): Add support for
1718 --no-target-directory,
1719 * src/install.c (NO_TARGET_DIRECTORY_OPTION, long_options, main,
1721 * src/ln.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
1723 * src/mv.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
1725 * src/mv.c (enum): Sort values.
1727 2004-06-29 Jim Meyering <jim@meyering.net>
1729 Don't let verbose-mode output from a subshell obscure actual differences.
1730 * tests/rm/inaccessible: Turn off command-echoing just before
1731 invoking subshell, then turn it back on if VERBOSE=yes afterward.
1733 2004-06-25 Paul Eggert <eggert@cs.ucla.edu>
1735 Add support for 'install --target-directory', an option
1736 that has been documented for years but not implemented (!).
1737 * doc/coreutils.texi (install invocation): Document
1738 --target-directory in synopsis, too.
1739 * src/install.c (TARGET_DIRECTORY_OPTION): New var.
1740 (long_options, main, usage): Add --target-directory.
1741 (target_directory_operand): New function, stolen from mv.c.
1742 (main): Use it. Check for -d and --target-directory.
1743 Alter wording of diagnostics to match other programs.
1745 2004-06-28 Jim Meyering <jim@meyering.net>
1747 * src/cp.c (usage): Fix copy+paste error in description of
1748 --target-directory: s/move/copy/. From Paul Jarc.
1750 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
1752 Use more-consistent rules among cp, ln, and mv when dealing with
1753 last operands that are (or look like) directories.
1755 * src/cp.c (target_directory_operand): New, nearly-common function,
1756 It reports an error if the destination appears to be a directory
1757 (e.g., because it has a trailing slash) but is not.
1758 * src/ln.c, src/mv.c: Likewise.
1759 * src/cp.c (do_copy): Use it.
1760 * src/ln.c (main): Likewise.
1761 * src/mv.c (main): Likewise.
1763 * src/cp.c (do_copy): Don't assume argc is positive.
1764 Don't bother to lstat dest, since copy() will do that for us.
1765 Use "const" to avoid the need for cast.
1767 * src/cp.c (do_copy): Don't output a usage message because of file
1768 problems (e.g., an operand is not a directory). Use it only for
1769 syntax. Standardize on "target %s is not a directory" for the
1771 * src/ln.c (main): Likewise.
1772 * src/mv.c (main): Likewise.
1774 * src/cp.c (do_copy): Remove test for trailing slash, since
1775 target_directory_operand now does this.
1776 * src/ln.c (main): Likewise.
1777 * src/mv.c (movefile): Likewise.
1779 * src/cp.c (main): Reject multiple target directories.
1780 Check whether a specified target is a directory when parsing the
1781 options, using stat. This gives more-accurate diagnostics.
1782 * src/ln.c (main): Likewise.
1784 * src/ln.c (isdir): Remove decl; no longer needed.
1785 * src/mv.c (isdir, lstat): Likewise.
1787 * src/ln.c (do_link): New arg dest_is_dir. All uses changed.
1788 Don't check the destination ourself; rely on dest_is_dir.
1789 This way we can avoid lstatting the destination in the
1790 usual case, and in the worst case we lstat 1, not 3 times.
1791 Don't bother to unlink unless link failed; this saves a syscall.
1792 Remove unnecessary backup_succeeded flag;
1793 it was identical to "dest_backup != NULL".
1795 * src/ln.c (main): Use int to count to argc, not unsigned int.
1796 This handles negative operand counts.
1797 * src/mv.c (main): Likewise.
1799 * src/mv.c (do_move): Don't call hash_init; expect the caller to
1800 do it, for consistency with cp.c and ln.c. All callers changed.
1801 (movefile): dest_is_dir parameter is now bool, not int.
1802 (main): Standardize on "missing destination file operand after %s"
1803 for the diagnostic, for consistency with cp.c.
1805 * tests/mv/diag: Don't assume "mv --target=nonexistentdir"
1806 will complain about the arg count.
1807 Adjust to new (briefer) diagnostics.
1808 * tests/cp/fail-perm: Add a test to verify that we get the new
1809 diagnostic when failing to copy through a symlink-to-inaccessible-dir.
1811 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
1813 Fix a bug: formerly, if d/x was a directory and x a file, "ln x
1814 d/" incorrectly created a link d/x/x. It also saves some system
1817 * NEWS: Document the fix.
1819 * src/ln.c (main): Don't append basename to dest if this
1820 results in an existing directory name.
1821 * tests/ln/misc: See whether a trailing slash is followed too far.
1823 2004-06-26 Jim Meyering <jim@meyering.net>
1825 * src/printf.c (main): When given no arguments, print the standard
1826 "missing operand\nTry printf --help..." message -- to be consistent.
1828 2004-06-26 Jim Meyering <jim@meyering.net>
1830 * src/mknod.c (main): Add \n at the end of message output via fprintf.
1832 2004-06-25 Jim Meyering <jim@meyering.net>
1834 * tests/ln/misc: Add test for ln subscript error.
1836 2004-06-23 Paul Eggert <eggert@cs.ucla.edu>
1838 * src/ln.c (do_link): Remove unnecessary call to lstat.
1839 (main): Avoid subscript error when the destination is "".
1841 2004-06-23 Jim Meyering <jim@meyering.net>
1843 * tests/*: Replace all occurrences of `(exit N); exit' with
1844 `(exit N); exit N'. Otherwise, those many tests could exit with
1845 improper exit status when exiting via e.g., a trapped interrupt.
1846 Thanks to a report from Bob Proulx.
1848 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1850 * src/who.c (idle_string, print_user): New arg boottime,
1851 specifying the most recent boot time. All uses changed.
1852 (idle_string) Consider a line to be "old" if it hasn't been used
1853 since the last boot time. Watch out for overflow when computing
1854 times, and for times in the future.
1855 (idle_string): Record latest boot time.
1857 2004-06-22 Jim Meyering <jim@meyering.net>
1859 * src/test.c (usage): Correct description of `-t FD'. The file
1860 descriptor, FD, is no longer optional. Reported by Ton Nijkes.
1862 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
1864 The 2004-06-19 fix for who and pinky was incomplete, as ctime
1865 has undefined behavior if the year precedes -999 or follows 9999.
1866 Since we have to stop using ctime anyway, we might as well use
1867 strftime and fix the FIXME, and support internationalized dates.
1869 * NEWS: Document the new behavior.
1870 * src/who.c: Include "hard-locale.h".
1871 (time_format, time_format_width): New vars.
1872 (time_string, print_line): Use them.
1874 (time_string): Use localtime + strftime instead of
1875 ctime, to avoid problems with years before -999 or after 9999.
1876 * src/pinky.c: Likewise.
1878 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
1880 Fix bug: GNU 'ls' didn't count columns correctly if user or group
1881 names contained multibyte characters where the column count
1882 differed from the byte count. This patch also corrects
1885 * src/ls.c (format_user_or_group): New function, which counts
1887 (format_user, format_group): Use it.
1888 (format_user_or_group_width): New function, which counts columns
1890 (format_user_width, format_group_width): Use it.
1892 2004-06-21 Jim Meyering <jim@meyering.net>
1894 * tests/priv-check: Quote "$PATH" in PATH=$PATH.
1895 Suggestion from Andreas Schwab.
1897 * tests/priv-check: When running as root, be sure to propagate
1898 PATH through to the process we exec as non-root.
1899 Reported by michael@aplatform.com.
1901 * src/mknod.c (main): Don't segfault when calculating the
1902 expected number of operands for `mknod NAME'.
1904 2004-06-20 Jim Meyering <jim@meyering.net>
1906 * src/dd.c (input_seek_errno): Declare file-scoped variable as static.
1908 2004-06-20 Paul Eggert <eggert@cs.ucla.edu>
1910 * src/basename.c (main):
1911 Standardize on the diagnostics given when someone gives
1912 too few operands ("missing operand after `xxx'") or
1913 too many operands ("extra operand `xxx'").
1914 Include "quote.h" and/or "error.h" if it wasn't already being included.
1915 * src/chgrp.c (main): Likewise.
1916 * src/chmod.c (main): Likewise.
1917 * src/chown.c (main): Likewise.
1918 * src/chroot.c (main): Likewise.
1919 * src/comm.c (main): Likewise.
1920 * src/cp.c (do_copy): Likewise.
1921 * src/csplit.c (main): Likewise.
1922 * src/date.c (main): Likewise.
1923 * src/dircolors.c (main): Likewise.
1924 * src/dirname.c (main): Likewise.
1925 * src/du.c (main): Likewise.
1926 * src/expr.c (main): Likewise.
1927 * src/hostid.c (main): Likewise.
1928 * src/hostname.c (main): Likewise.
1929 * src/id.c (main): Likewise.
1930 * src/install.c (main): Likewise.
1931 * src/join.c (add_file_name, main): Likewise.
1932 * src/link.c (main): Likewise.
1933 * src/ln.c (main): Likewise.
1934 * src/logname.c (main): Likewise.
1935 * src/md5sum.c (main): Likewise.
1936 * src/mkdir.c (main): Likewise.
1937 * src/mkfifo.c (main): Likewise.
1938 * src/mknod.c (main): Likewise.
1939 * src/mv.c (main): Likewise.
1940 * src/nohup.c (main): Likewise.
1941 * src/od.c (main): Likewise.
1942 * src/pathchk.c (main): Likewise.
1943 * src/ptx.c (main): Likewise.
1944 * src/readlink.c (main): Likewise.
1945 * src/rm.c (main): Likewise.
1946 * src/rmdir.c (main): Likewise.
1947 * src/seq.c (main): Likewise.
1948 * src/setuidgid.c (main): Likewise.
1949 * src/shred.c (main): Likewise.
1950 * src/sleep.c (main): Likewise.
1951 * src/sort.c (main): Likewise.
1952 * src/split.c (main): Likewise.
1953 * src/stat.c (main): Likewise.
1954 * src/test.c (beyond, main): Likewise.
1955 * src/touch.c (main): Likewise.
1956 * src/tr.c (main): Likewise.
1957 * src/tsort.c (main): Likewise.
1958 * src/tty.c (main): Likewise.
1959 * src/uname.c (main): Likewise.
1960 * src/uniq.c (main): Likewise.
1961 * src/unlink.c (main): Likewise.
1962 * src/uptime.c (main): Likewise.
1963 * src/users.c (main): Likewise.
1964 * src/who.c (main): Likewise.
1965 * src/whoami.c (main): Likewise.
1967 * tests/basename/basic: Adjust to new diagnostics.
1968 * tests/du/files0-from: Likewise.
1969 * tests/expr/basic: Likewise.
1970 * tests/mv/diag: Likewise.
1971 * tests/tsort/basic-1: Likewise.
1973 2004-06-20 Jim Meyering <jim@meyering.net>
1975 * src/ln.c: Remove declaration of yesno.
1976 Instead, include yesno.h.
1977 * src/copy.c: Likewise.
1979 * src/remove.c: Remove declaration of yesno.
1980 Instead, include yesno.h.
1981 (top_dir): Remove now-unnecessary cast of obstack_base.
1982 (pop_dir): Likewise.
1983 (full_filename_): Likewise.
1985 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
1987 Don't dump core if ctime returns NULL; this is possible on
1988 hosts with 64-bit time_t and 32-bit int.
1989 * src/who.c: Include "inttostr.h".
1990 (time_string): If ctime fails, print the raw time as an integer
1991 instead of dumping core.
1992 * src/pinky.c: Likewise, as follows:
1993 Include "inttostr.h".
1994 (time_string): New function, copied from who.c.
1995 (print_entry): Use it.
1997 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
1999 * src/who.c (print_line): Don't truncate user names at 8 bytes.
2000 Problem reported by Guido Leenders in:
2001 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
2002 * NEWS: document this.
2004 2004-06-19 Jim Meyering <jim@meyering.net>
2006 * src/system.h (case_GETOPT_VERSION_CHAR): Switch back to
2007 using GNU_PACKAGE (from PACKAGE) once again. This restores
2008 `GNU' to the parenthesized package name in --version output.
2009 Before, the first argument from AC_INIT, `GNU coreutils', would
2010 be propagated to the PACKAGE variable. Now, `GNU ' is trimmed.
2011 Reported by Richard Stallman.
2013 2004-06-17 Jim Meyering <jim@meyering.net>
2015 * src/tr.c (to_uchar): Rename function from `uchar'. The latter
2016 would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
2018 2004-06-15 Paul Eggert <eggert@cs.ucla.edu>
2020 * NEWS: Remove more special cases for POSIXLY_CORRECT when POSIX
2021 allows the GNU behavior. "--" is now supported by chroot, hostid,
2022 hosname, pwd, sync, yes.
2023 * doc/coreutils.texi (yes invocation, false invocation,
2024 true invocation): Document this.
2025 * src/chroot.c (main): Handle "--".
2026 * src/hostid.c (main): Likewise.
2027 * src/hostname.c (main): Likewise.
2028 * src/pwd.c (main): Likewise.
2029 * src/sync.c (main): Likewise.
2030 * src/yes.c (main): Likewise.
2031 * src/true.c (main): Recognize --help and --version even if
2032 POSIXLY_CORRECT is set.
2033 * src/yes.c (main): Likewise.
2035 2004-06-09 Paul Eggert <eggert@cs.ucla.edu>
2037 * NEWS: Remove special cases for POSIXLY_CORRECT when POSIX allows
2039 * doc/coreutils.texi (pr invocation, unlink invocation): Document this.
2040 * src/ls.c (decode_switches): Pay attention to TABSIZE even if
2041 POSIXLY_CORRECT is set. POSIX reserves upper-case environment
2042 variables to the implementation, so it's OK for ls to depend on
2044 * src/pr.c: Include "hard-locale.h".
2045 (main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
2046 POSIX specifies the behavior only in the POSIX locale.
2047 * src/printf.c (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
2048 since POSIX says the behavior is unspecified here.
2049 * src/tail.c (parse_obsolescent_option): Support multiple file operands
2050 even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
2051 * src/printf.c (main): Recognize --help, --version even if
2052 POSIXLY_CORRECT. POSIX does not specify any options, but it
2053 does not prohibit options either, so "printf" is like "expr" here.
2054 * src/unlink.c (main): Likewise.
2055 * tests/misc/printf: Adjust to the new semantics for \x if
2058 2004-06-14 Jim Meyering <jim@meyering.net>
2060 * tests/misc/pwd: New test, for fix of 2004-04-19.
2061 * tests/misc/Makefile.am (TESTS): Add pwd.
2062 (BUILD_SRC_DIR): Define BUILD_SRC_DIR.
2064 * src/copy.c: Remove declaration of euidaccess.
2065 Instead, include "euidaccess.h".
2067 2004-06-13 Paul Eggert <eggert@cs.ucla.edu>
2069 * src/who.c (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
2070 (UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
2071 as (sizeof "??") reliably returns 3.
2072 (print_line): Guard against idle and pid being too long
2073 (which is possible when printing headers).
2074 (print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
2075 Avoid unnecessary cast of sizeof to int.
2076 (make_id_equals_comment): Do not assume that UT_ID returns
2077 a string; it might return a non-null-terminated array.
2078 Use strncat instead. It's not very often where strncat is
2079 exactly what you want, but this is one of those rare cases.
2081 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
2083 * src/who.c (list_entries_who): Don't output a trailing space.
2085 2004-06-09 Jim Meyering <jim@meyering.net>
2087 * src/touch.c (usage): Improve wording in description of the
2088 --time=WORD option. Reported by Dan Jacobson.
2090 * src/chown-core.c (change_file_owner): Change names of parameters
2091 old_uid and old_gid to required_uid and required_gid respectively.
2093 * src/chmod.c (mode_changed): Return false, not 0, now that the
2094 function returns `bool'.
2096 2004-06-08 Paul Eggert <eggert@cs.ucla.edu>
2098 Adjust chmod and chown to be similar if -c or -v are given. In
2099 particular, a no-op chown is no longer reported as a change; this
2100 reverts to previous behavior. Also, fix both commands so that -v
2101 report failures even if the failure is not due to the chmod or
2104 * src/chmod.c (CH_NOT_APPLIED): New constant.
2105 (describe_change): Handle it.
2106 (process_file): Use it, if a symlink wasn't changed.
2107 (mode_changed): Return bool, not int. Accept new argument
2108 NEW_MODE; all callers changed. This lets us avoid statting the
2109 file unless the new mode has unusual bits.
2110 (process_file): Return -1 on error. With -v, report all errors
2111 verbosely, not just some.
2113 * src/chown-core.c (change_file_owner): Return -1 on error, not
2114 1 sometimes and -1 on others. Our caller ORs together our results,
2115 and (-1 | 1) == 0 on ones-complement hosts.
2116 With -v report all errors verbosely, not just some.
2117 Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
2118 file_stats wasn't set properly in that case.
2120 * tests/chgrp/basic: Adjust to above changes.
2122 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
2124 * tests/chgrp/basic: Test that chgrp -h does not fail on
2125 symlinks, even on hosts where that's not supported.
2126 Test that if -R is specified without -H or L, -h is assumed.
2127 Test that chown() is not optimized away.
2129 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
2131 Several fixes to chgrp and chown for compatibility with POSIX and BSD:
2133 Check for incompatible options. When -R and --dereference are
2134 both used, then either -H or -L must also be used. When -R and -h
2135 are both used, then -P must be in effect.
2137 -H, -L, and -P have no effect unless -R is also specified.
2138 If -P and -R are both specified, -h is assumed.
2140 Do not optimize away the chown() system call when the file's owner
2141 and group already have the desired value. This optimization was
2142 incorrect, as it failed to updated the last-changed time and reset
2143 special permission bits, as POSIX requires.
2145 Do not report an error if the owner or group of a
2146 recursively-encountered symbolic link cannot be updated because
2147 the file system does not support it.
2149 * NEWS: Document the above.
2151 * src/chgrp.c (main): Check for incompatible options. -R --dereference
2152 requires either -H or -L, and -R -h requires -P. If -H, specify
2153 FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
2154 file as much like chown.c as possible.
2155 * src/chown.c (main): Likewise.
2157 * src/chown-core.c (change_file_owner): Use ent->fts_statp only if
2158 needed. Chown a directory only after chowning its children; this
2159 avoids problems if the new directory ownership doesn't permit
2160 access to the children. Dereference symlinks before doing
2161 ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
2162 Do not optimize away the chown() system call when the file's owner
2163 and group already have the desired value. POSIX does not permit
2164 this optimization. Rely on chown and lchown to do the right
2165 thing with symlinks and/or -1 arguments, now that we have wrappers
2166 to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
2167 errors, not just command-line errors.
2168 (chown_files): Pass FTS_NOSTAT to xfts_open if we don't need file status.
2170 * src/system.h (ENOTSUP): Remove.
2172 * tests/chgrp/basic: Use chown --from to discover whether the
2173 group changed, since chgrp now changes unconditionally. This
2174 complicates the sed script a bit. Do not specify --dereference,
2175 since it's the default (and we want to test this). Adjust output
2176 to match the fact that chgrp no longer optimizes the case of
2177 changing a file's group to the same value as before.
2178 * tests/chgrp/posix-H: Do not attempt to combine -h and -H; these
2179 options are incompatible, and their behavior is undefined with POSIX.
2180 (changed, not_changed): Adjust to match the fact that -h is no longer
2181 specified. Sort names.
2182 * tests/chown/deref: Adjust error-diagnostic spelling to match new
2185 2004-06-07 Paul Eggert <eggert@cs.ucla.edu>
2187 * src/uname.c (main): Fix typo introduced on 2003-05-10 that
2188 prevented a diagnostic of any operands.
2190 2004-06-08 Jim Meyering <jim@meyering.net>
2192 * src/shred.c (direct_mode): Turn it on/off with directio, too.
2194 2004-06-07 Jim Meyering <jim@meyering.net>
2196 Enable direct-mode I/O (bypassing the buffer cache), if possible.
2197 Prompted by a suggestion from Kalle Olavi Niemitalo
2198 in http://bugs.debian.org/207035.
2199 * src/shred.c (direct_mode): New function.
2200 (do_wipefd): Turn on direct-mode I/O.
2201 (dopass): If a file's first write fails with EINVAL,
2202 turn off direct-mode I/O and retry the write.
2204 2004-06-05 Paul Eggert <eggert@cs.ucla.edu>
2206 * src/tr.c (main): "tr -d a b" is now a fatal error even if
2207 POSIXLY_CORRECT is set. The POSIX SYNOPSIS does not allow this
2210 2004-06-04 Paul Eggert <eggert@cs.ucla.edu>
2212 * src/shred.c (dopass): Don't subtract 1 from the offset after
2213 a write error. Problem reported by Jon Peatfield in:
2214 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
2216 2004-06-02 Paul Eggert <eggert@cs.ucla.edu>
2218 Fix bug reported by Buciuman Adrian in
2219 <http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00105.html>
2220 where 'dd' created a file that was too large. The bug was that dd
2221 assumed that the input file offset does not advance after a failed
2222 read; but POSIX says that the input file offset is undefined after
2225 * src/dd.c (MAX_BLOCKSIZE): New macro.
2226 (input_seekable, input_seek_errno, input_offset,
2227 input_offset_overflow): New vars.
2228 (scanargs): Reject block sizes greater than MAX_BLOCKSIZE.
2229 (advance_input_offset): New function.
2230 (skip_via_lseek): Set errno to zero when reporting our failure,
2231 so that we don't report based on garbage errno.
2232 (skip): If fdesc is standard input, advance the input offset.
2233 Do not quit if reading, and if noerror was specified;
2234 POSIX seems to require this.
2235 If read fails on output file, report the earlier lseek failure
2236 instead; this fixes a FIXME in dd_copy.
2237 (advance_input_after_read_error): New function.
2238 (dd_copy): Use it, instead of assuming that failed reads
2239 do not advance the file pointer. Advance input offset
2240 after nonfailed reads. Advance only a partial block if
2241 the previous read (before the failed read) succeeded, and
2242 do not generate an output block of zeros in this case.
2243 (main): Determine initial input offset, seekability of input,
2244 and error if it wasn't seekable.
2246 2004-06-02 Jim Meyering <jim@meyering.net>
2248 rm (without -f) could hang unnecessarily when attempting to
2249 remove a symlink to a file on an off-line NFS-mounted partition.
2250 Reported by David Howells in https://bugzilla.redhat.com/124699.
2251 * src/remove.c (write_protected_non_symlink): New function.
2252 Don't invoke euidaccess on symlinks.
2253 (prompt): Use write_protected_non_symlink rather than using
2254 euidaccess directly, being careful not to call lstat twice for a file.
2256 Fix a bug in how the --output-delimiter=D option works with
2257 abutting byte or character ranges. Reported by David Krider in
2258 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00132.html
2259 * src/cut.c (print_kth): Remove special case for open-ended range.
2260 (set_fields): Record the range start index for an interval even
2261 when it abuts another interval on its low side.
2262 Also record the range start index of the longest right-open-interval.
2263 * tests/cut/Test.pm: Add tests of --output-delimiter=S with
2264 abutting and overlapping byte ranges.
2266 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
2268 Some POSIX-conformance cleanups for tr.
2270 * src/tr.c (posix_pedantic): Remove; no longer needed since
2271 we need to test this in just one place now.
2272 (usage): Mention -C.
2273 (unquote): Note that \055, \n, etc are escaped.
2274 Do not worry about POSIXLY_CORRECT when warning about ambiguous
2276 \ at end of string stands for itself.
2277 Do not diagnose invalid backslash escapes: POSIX says the behavior
2278 is unspecified in this case, so we don't need to diagnose it.
2279 (main): Add support for -C (currently an alias for -c).
2280 Do not diagnose 'tr [:upper:] [:upper:], as POSIX does not require
2282 * tests/tr/Test.pm: New tests bs-055, bs-at-end, repeat-Compl.
2283 Fix comment for range-a-a.
2285 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
2287 Improve the efficiency (and in one case, correctness) of code
2288 that reads symlinks.
2290 * src/copy.c (copy_internal): Don't use alloca, as it can mess up
2291 royally if the link length is long (e.g., GNU/Hurd). Use
2292 xreadlink instead, it's safer. Don't bother to read the link if
2293 it's the wrong size. Add a FIXME because this area is a bit murky
2295 * src/ls.c (get_link_name): Update use of xreadlink.
2296 * src/readlink.c (main): Likewise.
2297 * src/stat.c (print_stat): Likewise.
2299 2004-06-01 Jim Meyering <jim@meyering.net>
2301 * src/env.c (main): Prefer the notation `STREQ (a, b)'
2302 over `!strcmp (a, b)'.
2303 * src/sort.c (main, sort_buffer_size): Prefer the notation
2304 `STREQ (a, b)' over `strcmp (a, b) == 0'.
2305 * src/date.c (batch_convert): Likewise.
2306 * src/expr.c (nextarg): Likewise.
2307 * src/su.c (correct_password, restricted_shell, main): Likewise.
2308 * src/ptx.c (swallow_file_in_memory, main): Likewise.
2309 * src/test.c (binary_operator, and, or, main): Likewise.
2311 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
2313 * NEWS: echo compatibility cleanup.
2314 * doc/coreutils.texi (echo invocation): Document the changes.
2315 * src/echo.c (V9_ECHO): Remove; always enabled.
2316 (DEFAULT_ECHO_TO_XPG): Renamed from V9_DEFAULT, so that
2317 we use the same naming convention as bash. Now an enum,
2319 (usage): Reword to mention -e/-E more accurately.
2320 Mention \0NNN (the POSIX syntax) rather than \NNN (nonstandard).
2321 (hextobin): New function.
2322 (main): Use bool rather than int for local vars when appropriate.
2323 Do not allow options if POSIXLY_CORRECT, unless we are using
2324 BSD semantics and the first argument is "-n".
2325 Don't pass unnecessary extra arg to parse_long_options.
2326 do_v9 now defaults to DEFAULT_ECHO_TO_XPG, not to allow_options.
2327 Do not look for options if !allow_options.
2328 Use size_t rather than int when appropriate.
2329 Open-code option test rather than using strrchr.
2330 Use faster test for "-".
2331 Avoid redundant argc test.
2332 Add support for \x, for Bash compatibility.
2333 Use e.g. '\a' rather than '\007', for portability to EBCDIC hosts.
2334 When '\c' is encountered, stop printing immediately, as POSIX
2336 Add support for \xhh syntax.
2337 Add support for \0ooo syntax; POSIX requires this.
2339 2004-06-01 Jim Meyering <jim@meyering.net>
2341 * Use automake-1.8b. Regenerate dependent files.
2343 2004-05-31 Jim Meyering <jim@meyering.net>
2345 * tests/Makefile.am.in (TESTS_ENVIRONMENT): Define PATH to include
2346 the build src/ directory -- at the front.
2347 ($(srcdir)/$x-tests): Depend on Makefile.am.
2348 Use $x as the program name, except when it would be `test' (test is
2349 the sole program tested via mk-script that is also a shell built-in).
2350 In that case, use the old ../../src/$x.
2352 2004-05-30 Jim Meyering <jim@meyering.net>
2354 Work around HPUX /bin/cc compiler bug that is exposed, now that
2355 sets are arrays of type `bool'. More details here:
2356 http://lists.gnu.org/archive/html/bug-gnulib/2004-05/msg00094.html
2357 FIXME: verify that the above URL points to the right message
2359 * src/tr.c (card_of_complement): Use cleaner `sizeof in_set'
2360 rather than `N_CHARS * sizeof(in_set[0])'. Using HPUX's /bin/cc
2361 (aC++/ANSI C B3910B A.05.55 [Dec 04 2003]) on an ia64-hp-hpux11.22
2362 system, those two expressions are not the same (256 vs. 1024).
2363 The effect of this problem was that `tr -c x y' would fail:
2364 tr: when not truncating set1, string2 must be non-empty
2365 (set_initialize): Remove unnecessary initialization of the `in_set'
2366 buffer; that initialization triggered the same compiler bug as above.
2368 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
2370 tr cleanup, mostly having to do with integer type ranges.
2373 * tests/tr/Test.pm: Add a few tests for the below. Alas, most of
2374 the test cases wouldn't be portable, or would take too much CPU
2377 * src/tr.c (N_CHARS, N_CHAR_CLASSES): Now an enum, not a macro.
2378 This is safe since the code already assumes N_CHARS fits in int.
2379 (Filter): Remove: we want to prototype everything.
2380 (ORD, CHR): Remove. All uses removed. Some replaced with:
2381 (uchar): New function. All places where a char must be converted
2382 to an unsigned char are now done this way, not by ad-hoc methods.
2383 (count): New type. Use it whenever counts or states are needed.
2384 (BEGIN_STATE): Increase from INT_MAX - 1 (which was bogus, anyway,
2385 since we used it in an unsigned int context) to UINTMAX_MAX - 1.
2386 (REPEAT_COUNT_MAXIMUM): New macro. Use it in place of BEGIN_STATE
2387 whenever appropriate.
2388 (NOT_A_CHAR): Remove global macro; now a local enum.
2389 (UL_LOWER, UL_UPPER, UL_NONE): No longer specify values, since
2390 the rest of the code no longer depends on them.
2391 (class_ok): Remove; all uses changed to use inline comparisons.
2392 (RE_NO_TYPE): Remove; wasn't used or needed.
2393 (struct List_element): normal_char and equiv_code are now unsigned
2395 first_char, last_char, and the_repeated_char are now unsigned char,
2396 not unsigned int. repeat_count is now count, not size_t.
2398 (struct Spec_list): state is now count, not unsigned int.
2399 lengthis now count, not size_t.
2400 n_indefinite_repeats is now size_t, not int.
2401 has_equiv_class, has_char_class, and has_restricted_char_class
2402 are now bool, not int. All uses changed.
2403 (struct E_string): s is now char *, not unsigned char *.
2404 escaped is now bool *, not int *. All uses changed.
2405 (ES_MATCH): Remove macro, replacing with:
2406 (es_match): New inline function. All uses changed.
2407 (squeeze_repeats, complement, posix_pedantic, truncate_set1,
2408 translating): Now bool, not int.
2409 (io_buf): Now char array, not unsigned char.
2410 (SET_TYPE): Remove. All uses replaced with bool.
2411 (is_equiv_class_member, unquote, append_range, append_char_class,
2412 append_equiv_class, find_closing_delim, star_digits_closebracket,
2413 build_spec_list, parse_str, homogeneous_spec_list):
2414 Now returns bool, not int. All uses changed.
2415 (is_equiv_class_member): Now inline.
2416 (is_equiv_class_member, is_char_class_member, make_printable_str,
2417 append_normal_char, append_range, append_repeated_char,
2419 Args are now of proper integer type.
2420 (unquote, look_up_char_class, make_printable_str,
2421 append_equiv_class, build_spec_list, squeeze_filter):
2422 Avoid unsigned char *p; gently convert *p to unsigned char instead.
2423 (unquote, get_spec_stats): Do not jump past declarations and then
2424 use them; C doesn't allow this in portable programs.
2425 (make_printable_str): Check for overflow in size calculations.
2426 (xmemdup): Remove. All uses rewritten.
2427 (find_bracketed_repeat): Args are now of proper pointer-to-integer
2428 type. Do not reject [c*0]. Use xstrtoumax, not xstrtoul.
2429 (find_bracketed_repeat, star_digits_closebracket): Check that the
2430 digits are not escaped.
2431 (build_spec_list): Don't bother to copy opnd_str; not needed.
2432 (build_spec_list, get_next): Simplify internal logic a bit.
2433 (card_of_complement): Fix bug due to char overflow.
2434 (get_spec_stats): Don't assume len fits into int.
2435 Check for integer overflow. Use abort() rather than assert(0).
2436 (string2_extend): Fix subscript error: is_char_class_member (..., 255)
2438 (squeeze_filter): READER is never null now; simplify code.
2439 READER arg now has a simpler type. Remove unnecessary casts.
2440 (squeeze_filter, main): Calls to fwrite improperly checked result
2441 against zero, rather than against requested size.
2442 (plain_read): New function.
2443 (read_and_delete, read_and_xlate):
2444 Remove unused filter arg, and don't worry about hit_eof.
2445 Simplify by using plain_read.
2446 (set_initialize): Args are bool and bool *, not int and SET_TYPE *.
2447 (main): Always pass a non-null procedure to squeeze_filter.
2448 Rewrite so that class_ok isn't needed.
2450 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
2452 * src/shred.c (dosync): Ignore EBADF errors, as IRIX 6.5
2453 fdatasync reports EBADF when syncing (unwritable) directories.
2454 Problem reported by Albert Chin-A-Young in:
2455 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
2457 2004-05-29 Jim Meyering <jim@meyering.net>
2459 * tests/chown/deref: Fix typo: use ls -ldo, not ls -ldg.
2460 Patch from Albert Chin.
2462 * src/ptx.c (text_buffer_maxend): Remove declaration of unused variable.
2464 * src/remove.c (push_dir): Merge declaration and adjacent assignment
2465 into a single statement.
2467 2004-05-28 Jim Meyering <jim@meyering.net>
2469 * src/remove.c (AD_mark_helper): Eliminate an unnecessary comparison.
2471 2004-05-22 Jim Meyering <jim@meyering.net>
2473 rm -r would get a failed assertion when run from an inaccessible
2474 directory and with two or more command line arguments including an
2475 absolute-named directory followed by a relative-named directory.
2477 * src/remove.h (struct rm_options) [require_restore_cwd]: New member.
2478 * src/remove.c (struct cwd_state): Define.
2479 (AD_pop_and_chdir): Redesign interface so that a restore_cwd failure
2480 can be detected by the caller. Instead of returning a malloc'd
2481 directory name, communicate it to caller via a new parameter, and
2482 return an indication of whether restore_cwd failed. Update caller.
2483 Eliminate an unnecessary call to AC_stack_top.
2484 (remove_dir): Change type of cwd_state parameter to `struct cwd_state'
2485 so we can now communicate to caller whether/how functions like
2486 restore_cwd have failed. Update caller.
2487 (rm_1): Fail if we've failed to restore the working directory
2488 and the name of the next file to remove is `.'-relative.
2489 (rm): Fail if the require_restore_cwd flag is true and we've
2490 failed to restore the working directory.
2491 * src/mv.c (rm_option_init): Initialize new member,
2492 x->require_restore_cwd.
2493 * src/rm.c (rm_option_init): Likewise.
2495 2004-05-21 Jim Meyering <jim@meyering.net>
2497 * tests/rm/inaccessible: New test for the above fix.
2498 * tests/rm/Makefile.am (TESTS): Add inaccessible.
2500 * src/remove.c (rm): Use free rather than XFREE.
2501 (remove_dir): Use xmalloc, not XMALLOC.
2502 (ds_init): Likewise.
2504 2004-05-20 Jim Meyering <jim@meyering.net>
2506 * Makefile.maint (sc_unmarked_diagnostics): Now that the unmarked
2507 diagnostics in shred.c have been fixed, don't exempt shred.c from
2510 * src/shred.c: Use translatable diagnostics, e.g.
2511 change "%s: remove" to _("%s: failed to remove") and
2512 change "%s: close" to _("%s: failed to close").
2514 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
2516 * src/shred.c (names): Bring back lower-case letters, "_", and
2517 ".". But continue to omit +, =, %, @, #, as they're either
2518 shell metacharacters (for some shells) or are not in some
2519 character sets, or (in the case of '%') must be a
2520 metacharacter somewhere.
2522 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
2524 * src/cut.c (cut_fields): Adjust to new signature of getndelim2.
2526 2004-05-17 Jim Meyering <jim@meyering.net>
2528 * src/shred.c (incname): Decrement `len' only once per loop iteration.
2530 chgrp and chown now dereference symlinks by default, per POSIX.
2531 Reported by Michal Politowski as http://bugs.debian.org/249177.
2533 * src/chown-core.c (chopt_init): Affect each symlink referent by default.
2534 * src/chown.c (usage): Update to reflect this.
2535 * src/chgrp.c (usage): Likewise.
2536 * NEWS: Describe the change.
2537 Adapt tests accordingly.
2538 * tests/chgrp/basic: Use -h where necessary to retain semantics.
2539 * tests/chgrp/deref: Likewise.
2540 * tests/chgrp/posix-H: Likewise.
2542 2004-05-15 Paul Eggert <eggert@cs.ucla.edu>
2544 In shred, check for errors from fdatasync more carefully. If
2545 fdatasync fails with errno==EINVAL, it means this implementation
2546 does not support synchronized I/O for this file. Do not report
2547 this as an error, as (for example) AIX 5.2 fdatasync reports it
2548 for raw disk devices. Problem reported by Albert Chin in
2549 <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.
2551 Check for write errors, though: the old code ignored them.
2552 Improve error checking in a few other cases, too (e.g., close of a
2555 Also, change several 'int' values to 'bool', so that the error
2556 checking is a bit clearer. Similarly, change unsigned values
2557 to size_t where appropriate.
2559 * src/shred.c: Include "dirname.h".
2560 (datasync) [!HAVE_FDATASYNC]: Remove.
2561 (dosync): New function.
2562 (dopass): Use it. Return 1 on write error, -1 on other error.
2563 All callers changed. Report write error if dosync does.
2564 (do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
2565 not int (0/-1). All callers changed. Return false if there's a
2567 (incname): Return bool (true/false), not int (0/1). Accept
2568 size_t length, not unsigned. All callers changed. Do not
2569 bother checking for non-digits; it can't happen. Replace
2570 recursion with iteration.
2571 (wipename): Use dir_name, base_name, etc. instead of assuming
2572 Unix file names. Use size_t for length, not unsigned.
2573 Report error if unlink or close fails.
2574 (wipename, main): Use bool for booleans.
2576 (names): Use only digits and uppercase letters, for greater
2579 2004-05-16 Jim Meyering <jim@meyering.net>
2581 * tests/chown/deref: New test for the yesterday's change.
2582 * tests/chown/Makefile.am (TESTS): Add deref.
2584 2004-05-15 Jim Meyering <jim@meyering.net>
2586 chown --dereference did nothing when the owner/group of a
2587 symlink matched the desired owner/group. Reported by David Malone.
2588 Also reported in 1999 as http://bugs.debian.org/39642.
2590 * src/chown-core.c (change_file_owner): When --dereference has
2591 been specified, and when processing a symlink, stat it to get the
2592 owner and group of the referent.
2594 2004-05-14 Jim Meyering <jim@meyering.net>
2596 * man/pwd.x, man/echo.x, man/printf.x: Fix typo:
2597 s/supercede/supersede/ reported by Andrew Fabbro.
2599 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
2601 Improve performance of `sort -m' on large files, at the cost of
2602 making some contrived examples unsafe. POSIX allows this
2603 optimization. Performance problem reported by Jonathan Baker in
2604 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00071.html>.
2606 * src/sort.c (first_same_file): Do not treat input pipes
2607 differently from other files.
2608 * doc/coreutils.texi (sort invocation): Document that "sort -m -o F"
2609 might write F before reading all the input.
2612 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
2614 * src/od.c (print_ascii, dump_strings): Use e.g. '\a' rather than
2615 '\007', for portability to EBCDIC hosts.
2616 * src/printf.c (print_esc_char): Likewise.
2617 * src/tr.c (unquote, make_printable_str): Likewise.
2619 2004-05-12 Jim Meyering <jim@meyering.net>
2621 * src/remove.c (AD_pop_and_chdir): Move lstat-`.' into if-block
2622 where the result is used. This avoids one unnecessary lstat call
2623 per command line argument.
2625 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
2627 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
2629 * src/Makefile.am (all_programs.list): New rule, copied from
2630 man/Makefile.am and tests/Makefile.am, except that we use the
2631 system tr rather than ./tr and we don't use tr -s.
2632 * tests/Makefile.am (all_programs): Use it.
2633 * man/Makefile.am (all_programs): Likewise. Renamed from programs,
2634 for consistency. All uses changed.
2636 2004-05-11 Jim Meyering <jim@meyering.net>
2638 * tests/rm/unread3: New test, for the above fix and today's
2639 lib/save-cwd.c improvement.
2640 * tests/rm/Makefile.am (TESTS): Add unread3.
2642 * src/rm.c: Don't include "save-cwd.h". It's no longer used.
2644 2004-05-10 Jim Meyering <jim@meyering.net>
2646 * tests/install/trap: New file. Test for bug fix of 2004-04-18.
2647 * tests/install/Makefile.am (TESTS): Add trap.
2649 * src/remove.c (AD_push): Don't use errno in diagnostic about
2652 Remove these generated files from CVS.
2653 * tests/cut/cut-tests, tests/date/date-tests, tests/join/join-tests:
2654 * tests/ls/ls-tests, tests/pr/pr-tests, tests/tac/tac-tests:
2655 * tests/tail/tail-tests, tests/test/test-tests, tests/tr/range-tests:
2656 * tests/tr/tr-tests, tests/wc/wc-tests:
2658 2004-05-09 Jim Meyering <jim@meyering.net>
2660 * src/tr.c (unquote): Use xcalloc rather than xmalloc and
2661 a loop initializing the just-allocated memory to zero.
2663 2004-05-08 Jim Meyering <jim@meyering.net>
2665 * tests/rm/no-give-up: New file; check for today's fix.
2666 * tests/rm/Makefile.am (TESTS): Add no-give-up.
2668 2004-05-08 Paul Eggert <eggert@cs.ucla.edu>
2670 Fix bug where "rm" gave up too easily, reported by Dan Jacobsen in
2671 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00013.html>.
2673 * src/remove.c (remove_entry): Check for errno values like ENOENT
2674 that show the file cannot be directory, instead of for errno
2675 values like EPERM that show the file might be a directory. This
2676 is necessary because, when a single unlink() call has multiple
2677 reasons to fail, it can set errno to any of those reasons; it's
2678 only the rare errno value like ENOENT that excludes all the other
2679 possible reasons to fail even when the file is a directory.
2680 (remove_cwd_entries): Don't attempt chdir if the file is known
2681 to not be a directory.
2682 (remove_dir): Use the same method that remove_cwd_entries uses
2683 (for some reason they differed). Don't assert that saved_errno
2684 must be EPERM; it might be just about anything.
2686 2004-05-06 Jim Meyering <jim@meyering.net>
2688 * src/id.c (xgetgroups): Use xnmalloc, rather than xmalloc.
2689 Don't add `1' to the buffer size (it was to protect against malloc
2690 implementations that fail to allocate a buffer of size zero).
2691 That is no longer necessary, since we use a malloc wrapper
2694 * src/wc.c (get_input_fstatus): Use xnmalloc, rather than xmalloc.
2695 * src/head.c (elide_tail_bytes_pipe): Likewise.
2696 * src/df.c (main): Likewise.
2697 * src/shred.c (do_wipefd): Likewise.
2698 * src/users.c (list_entries_users): Likewise.
2699 * src/tail.c (main): Likewise.
2700 * src/md5sum.c (main): Likewise.
2702 2004-04-29 Paul Eggert <eggert@cs.ucla.edu>
2704 * src/df.c (show_disk, show_point): If several filesystems are
2705 mounted on the same mount point, prefer the last one, not the first.
2706 Problem reported by Christian Jones in
2707 <http://mail.gnu.org/archive/html/bug-coreutils/2004-04/msg00200.html>.
2708 (show_disk): Remove unused statp arg. Return bool, not int.
2709 (show_point): Rewrite to avoid gotos. Use the same algorithm
2710 for lofs and dummies for each pass through the mount table,
2711 rather than subtly different algorithms (which are probably
2714 2004-05-03 Jim Meyering <jim@meyering.net>
2716 * Makefile.am (EXTRA_DIST): Add m4/ChangeLog, now that we no longer
2719 2004-05-01 Jim Meyering <jim@meyering.net>
2721 When chown or chgrp is modifying the referent of a symlink,
2722 use the chown(2) function, if possible.
2723 * src/chown-core.c (change_file_owner): Don't hard-code the
2724 open/fchown/close kludge here. Use `chown' instead.
2725 The chown function works just fine on conforming systems.
2726 Other systems now go through the new chown wrapper that
2727 resorts to the old kludge.
2729 * src/chown-core.c (change_file_owner): Add a comment.
2731 2004-04-27 Jim Meyering <jim@meyering.net>
2733 * src/ptx.c: Make over 40 global extern variables `static'.
2734 (syntax_table, re_syntax_table): Remove declarations of two unused
2735 variables (they were exposed by the above change).
2737 * src/du.c (G_fail, opt_nul_terminate_output): Declare `static'.
2738 * src/ln.c (backup_type): Likewise.
2740 * src/remove.c (rm): Add `extern' keyword.
2741 * src/cp-hash.c (forget_created, remember_created)
2742 (src_to_dest_lookup, remember_copied, hash_init, forget_all): Likewise.
2743 * src/copy.c (dest_info_init, src_info_init, copy): Likewise.
2744 * src/chown-core.c (chopt_init, chopt_free, gid_to_name)
2745 (uid_to_name, chown_files): Likewise.
2747 * src/Makefile.am (sc_tight_scope): New rule.
2748 * Makefile.maint (sc_tight_scope): New rule.
2749 (syntax-check-rules): Add it.
2751 2004-04-26 Jim Meyering <jim@meyering.net>
2753 * Use automake-1.8.4. Regenerate dependent files.
2755 * src/sort.c (limfield): Make a comment clearer.
2757 2004-04-25 Paul Eggert <eggert@twinsun.com>
2759 Fix POSIX-conformance bug: "sort -k 3,3.5b" is supposed to skip
2760 leading blanks when computing the location of the field end;
2761 it is not supposed to skip trailing blanks. Solaris 8 "sort"
2762 does conform to POSIX. Also fix the documentation to clarify
2763 this and related issues.
2765 * doc/coreutils.texi (sort invocation): Mention -k earlier, so
2766 that the options are in alphabetical order. Describe how -b works
2767 more-accurately; this involves fixing some examples, too. Mention
2768 what happens if the start field falls after an end field or after
2769 a line end. Warn about using -k without -b, -g, -M, -n, or -t.
2770 Add an example of how to sort IPv4 addresses and Apache Common
2771 Log Format dates. Remove a duplicate example.
2772 (Putting the tools together): Use separate options rather
2773 than agglomerating them.
2774 * src/sort.c (limfield): Use skipeblanks, not skipsblanks, to
2775 decode whether to skip leading blanks.
2776 (trailing_blanks): Remove.
2777 (fillbuf, getmonth, keycompare): Don't trim trailing blanks.
2779 * tests/pr/Test.pm: Fix typo in env_default comment.
2780 * tests/sort/Test.pm: Likewise.
2781 (18c, 18d): Reverse the order of output lines, so that the
2782 test cases conform to POSIX.
2784 2004-04-22 Paul Eggert <eggert@twinsun.com>
2786 More signal-handling cleanup for ls.c. Do not allow signals to
2787 happen between arbitrary output bytes, as the
2788 restore-default-color sequence can bollix up multibyte chars or
2789 color-change sequences in the ordinary output. Instead, process
2790 signals only between printing a file name and changing the color
2791 back to non_filename_text color. That way, if the signal handler
2792 changes the color (to the default), 'ls' will change it back when
2793 'ls' continues (after being suspended).
2795 Also, do not bother with signal-handling unless stdout is a
2796 controlling terminal; this lets stdio buffer better when "ls
2797 --color" is piped or sent to a file.
2799 * src/ls.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros.
2800 Do not include "full-write.h"; no longer needed.
2801 (tcgetpgrp) [! HAVE_TCGETPGRP]: New macro.
2802 (put_indicator_direct): Remove. All callers changed to use
2804 (caught_signals, interrupt_signal, stop_signal_count): New vars.
2805 (restore_default_color): Don't bother checking for put_indicator
2807 (sighandler): Don't handle SIGTSTP; that's another handler now.
2808 Simply set interrupt_signal to the signal, then exit.
2809 (stophandler, process_signals): New functions.
2810 (main): Don't output any color changes until _after_ the signal
2811 handlers are set up. This fixes a race condition where 'ls'
2812 could be interrupted while initializing colors, and leaving the
2813 terminal in an undesirable state.
2814 Don't mess with signal-handling if standard output is not a
2815 controlling terminal.
2816 When exiting, restore the default color, then restore the
2817 default signal handling, then act on any signals that weren't
2819 Do not print //DIRED// etc. in colors; this avoids the need
2820 to catch signals when printing them.
2821 (print_name_with_quoting): Process signals just before switching
2822 color back to non_filename_text.
2824 2004-04-23 Jim Meyering <jim@meyering.net>
2826 Avoid segfault on systems for which SIZE_MAX != (size_t) -1.
2827 * src/ls.c (quote_name): Use SIZE_MAX, not -1, in calls
2828 of quotearg_buffer. Patch by Mikulas Patocka.
2830 2004-04-18 Paul Eggert <eggert@twinsun.com>
2832 tee ignored SIGPIPE, but POSIX doesn't allow this.
2834 * src/tee.c (main): Do not ignore SIGPIPE, as POSIX 1003.1-2001
2835 does not allow this. This undoes the 1996-10-24 patch.
2837 2004-04-18 Paul Eggert <eggert@twinsun.com>
2839 Signal-handling cleanup for coreutils. Here are the highlights:
2841 - csplit sometimes failed to remove files when interrupted.
2842 - csplit didn't clean up if two signals arrived nearly simultaneously.
2843 - install -s would infloop on System V if SIGCHLD was ignored.
2844 - ls could incorrectly restore color if multiple signals
2845 arrived nearly simultaneously.
2847 * src/csplit.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
2849 (filename_space, prefix, suffix, digits, files_created, remove_files):
2851 (caught_signals): New var.
2852 (cleanup): Block signals while deleting all files.
2853 (cleanup_fatal, handle_line_error, regexp_error):
2854 Mark with ATTRIBUTE_NORETURN.
2855 (create_output_file, close_output_file, interrupt_handler):
2856 Block signals while changing the number of output files,
2857 to fix some race conditions.
2858 (delete_all_files): Do nothing if remove_files is zero.
2859 Clear files_created.
2860 (main): Don't mess with signals until after argument processing
2863 * src/csplit.c (main): Rewrite signal-catching code to make it
2864 similar to other coreutils programs. When processing signals,
2865 block all signals that we catch, but do not block signals that we
2866 don't catch. Avoid problems with unsigned int warnings.
2867 * src/ls.c (main): Likewise.
2868 * src/sort.c (main): Likewise.
2870 * src/csplit.c (interrupt_handler):
2871 Use void, not (obsolete) RETSIGTYPE.
2872 * src/shred.c (sigill_handler, isaac_seed_machdep): Likewise.
2874 * src/csplit.c (interrupt_handler) [defined SA_NOCLDSTOP]:
2875 Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
2876 * src/ls.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
2877 * src/sort.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
2878 * src/nohup.c (main) [!defined _POSIX_SOURCE]: Likewise, except
2880 * src/tee.c (main) [!defined _POSIX_SOURCE]: Likewise.
2882 * src/install.c: Include <signal.h>.
2883 (main) [defined SIGCHLD]: Set SIGCHLD handler to the default, if -s is
2884 given, since System V fork+wait does not work if SIGCHLD is ignored.
2886 * src/ls.c (sighandler) [!defined SA_NOCLDSTOP]: Reset signal
2887 handler to self, not to SIG_IGN, since SIGTSTP can be received
2889 (main): Use SA_RESTART, as that is simpler than checking for EINTR
2890 failures all over the place.
2892 2004-04-20 Jim Meyering <jim@meyering.net>
2894 * src/remove.c (is_empty_dir): Clarify comment.
2896 * man/help2man: Accept new option: --program-name=NAME, so that we
2897 can override the one in --version output. This is needed solely
2898 so that test.1 doesn't refer to `[' as the program name.
2899 Reported by Benjamin Cutler as http://bugs.debian.org/205251.
2900 * man/Makefile.am (.x.1): Use help2man's new --program-name option.
2902 * src/pwd.c: Don't include pathmax.h; system.h already does it.
2904 * src/cut.c (cut_fields): Free buffer upon getndelim2 failure.
2906 2004-04-19 Jim Meyering <jim@meyering.net>
2908 * src/shred.c (isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:
2909 Initialize a buffer to avoid warnings from tools like valgrind.
2911 * Makefile.maint (sc_trailing_blank): New rule.
2912 (syntax-check-rules): Add it.
2913 * .x-sc_trailing_blank: New file.
2915 Make pwd work even if the resulting name is so long that getcwd fails.
2916 * src/pwd.c: (path_free, path_init, path_prepend): New functions.
2917 (nth_parent, find_dir_entry, robust_getcwd): New functions.
2918 (main): First try getcwd, then, upon failure, robust_getcwd.
2920 2004-04-18 Jim Meyering <jim@meyering.net>
2922 * src/who.c (print_user): Use xrealloc here, rather than
2923 unchecked realloc. Remove anachronistic casts.
2925 * src/remove.c (full_filename_): Don't leak upon failed realloc.
2927 * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function,
2929 * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h,
2930 renaming it. Update uses.
2932 2004-04-17 Jim Meyering <jim@meyering.net>
2934 * configure.ac: Depend on automake-1.8.3.
2936 * src/join.c (add_file_name): Declare function to be `static'.
2937 (string_to_join_field): Likewise.
2938 * src/remove.c (ds_init, ds_free): Likewise.
2940 * Makefile.maint (sc_prohibit_jm_in_m4): New rule.
2941 (syntax-check-rules): Add to the list.
2943 2004-04-13 Paul Eggert <eggert@twinsun.com>
2945 Use page-aligned buffers whenever we bother to do I/O using buffer
2946 sizes that are tailored for the files.
2948 * src/cat.c: Include getpagesize.h.
2949 * src/copy.c: Likewise.
2950 * src/shred.c: Likewise.
2951 * src/split.c: Likewise.
2952 * src/cat.c (main): Align I/O buffers to page boundaries.
2953 * src/copy.c (copy_reg): Likewise.
2954 * src/shred.c (dopass): Likewise.
2955 * src/split.c (main): Likewise.
2956 * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove.
2957 All uses replaced by ptr_align.
2958 * src/od.c (gcd, lcm): Remove; now in system.h.
2959 * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c.
2961 2004-04-14 Jim Meyering <jim@meyering.net>
2963 Remove m4/Makefile.am: it's no longer needed, with newer automake
2964 * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list.
2965 * Makefile.am (SUBDIRS): Remove `m4' from the list.
2967 2004-04-13 Jim Meyering <jim@meyering.net>
2969 * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'.
2971 2004-03-27 Paul Eggert <eggert@twinsun.com>
2973 * NEWS: cp -pu and mv -u (when copying) now take the destination
2974 file system time stamp resolution into account.
2975 * doc/coreutils.texi (mv invocation): Document this.
2976 (cp invocation): Document -u (it was missing!) with new behavior.
2978 * src/copy.c: Include "utimecmp.h".
2979 (copy_internal): Compare time stamps using utimecmp rather than
2982 2004-04-09 Jim Meyering <jim@meyering.net>
2984 * Makefile.maint (.re-list): New rule/file, to replace
2985 hard-coded list of header file names.
2986 (sc_system_h_headers): Use the new file.
2987 Don't look for sys2.h anymore.
2989 * src/system.h: Include new "stat-macros.h" rather than hard-coding
2990 all of its macro definitions -- the list was slightly out of date.
2991 Suggestion from Dmitry V. Levin.
2993 2004-04-08 Paul Eggert <eggert@cs.ucla.edu>
2995 * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin.
2996 * doc/coreutils.texi (dd invocation): Likewise.
2997 * src/shred.c (O_NOCTTY): Remove redundant decl.
2998 * src/dd.c (flags, usage): Remove noctty flag.
2999 (main): Always use O_NOCTTY when opening files.
3001 2004-04-08 Jim Meyering <jim@meyering.net>
3003 * src/dd.c (dd_copy): Mark two diagnostics for translations.
3004 (set_fd_flags): Undo part of today's change: it's a little
3005 cleaner -- and more efficient in the common case -- to go
3006 ahead and OR in the -1 when fcntl fails.
3008 * Makefile.maint (sc_dd_max_sym_length): New target.
3009 (syntax-check-rules): Add it.
3011 * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]:
3012 Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum.
3014 * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
3015 Rename parameter, flags, to avoid shadowing global.
3016 (LONGEST_SYMBOL): Tweak comment.
3018 2004-04-07 Paul Eggert <eggert@twinsun.com>
3020 * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync,
3021 and new dd options iflag= and oflag=.
3022 * src/dd.c (usage): Likewise.
3023 * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib.
3024 * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro.
3025 (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
3026 (input_flags, output_flags): New vars.
3027 (LONGEST_SYMBOL): New macro.
3028 (struct symbol_value): Renamed from struct conversion. Members
3029 symbol and value renamed from convname and conversion. The
3030 symbol value is now an array instead of a pointer; this saves
3031 a bit of space and time in practice. All uses changed.
3032 (conversions): Add nocreat, excl, fdatasync, fsync. Now const.
3033 (flags): New constant array.
3034 (iflag_error_msgid, oflag_error_msgid): New constants.
3035 (parse_symbols): Renamed from parse_conversion and generalized
3036 to handle either conversion or flag symbols.
3037 (scanargs): Adjust uses of parse_symbols accodingly. Add
3038 support for iflag= and oflag=. Reject attempts to use
3039 both excl and nocreat.
3040 (set_fd_flags): New function.
3041 (dd_copy): Just return X rather than calling quit (X), since our
3042 caller invokes quit with the returned value. Add support for
3043 fdatasync and fsync.
3044 (main): Add support for iflag=, oflag=, and new conv= symbols.
3045 * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW,
3046 O_RSYNC, O_SYNC): Define to 0 if not already defined.
3048 * NEWS: Remove duplicate mention of BLOCKSIZE.
3050 2004-04-02 Andreas Schwab <schwab@suse.de>
3052 * src/stty.c: Add support for IUTF8 input flag.
3054 2004-04-06 Jim Meyering <jim@meyering.net>
3056 * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev.
3057 Interix spells it `mkdev'. Reported by Mark Funkenhauser.
3059 2004-04-04 Jim Meyering <jim@meyering.net>
3061 A specified format is no longer automatically newline terminated.
3062 If you want a newline at the end of your format, use `\n'.
3063 * src/stat.c (print_it): Don't print a newline at the end of
3065 (do_statfs): Add a newline at end of each default format string.
3067 2004-03-30 Paul Eggert <eggert@twinsun.com>
3069 * src/nohup.c (main): Adjust to new calling convention
3070 for set_cloexec_flag.
3072 2004-03-31 Jim Meyering <jim@meyering.net>
3074 * tests/Fetish.pm (run_tests): Remove `.orig' file.
3075 Remove debugging diagnostic.
3077 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
3078 would not elicit an error.
3079 * src/ptx.c: Include "xstrtol.h" and "quotearg.h".
3080 (main): Don't use atoi. Use xstrtoul instead.
3082 2004-03-30 Jim Meyering <jim@meyering.net>
3084 * Makefile.maint (sc_prohibit_atoi_atof): New rule.
3085 (syntax-check-rules): Add it.
3086 * .x-sc_prohibit_atoi_atof: New file.
3088 2004-03-29 Jim Meyering <jim@meyering.net>
3090 * tests/du/files0-from: Use new OUT_SUBST directive, so that this
3091 test is not sensitive to system-dependent block size differences.
3092 Prompted by a report of Solaris 8 differences from Paul Eggert.
3094 * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST.
3095 Rename `%tmp' to `%actual'. Reverse order of last two args to
3096 _compare_files (to $actual, $expected) so as to match declaration.
3098 2004-03-28 Paul Eggert <eggert@twinsun.com>
3100 Fix some gotchas encountered when porting to Solaris 8, using
3101 the Forte 6u2 compiler.
3103 * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]:
3104 Declare sethostname, since no Solaris header does it.
3105 * src/who.c: Include "vasprintf.h", for asprintf.
3107 2004-03-28 Jim Meyering <jim@meyering.net>
3110 * src/du.c (process_file): Don't record dev/inode for directories.
3112 Under some circumstances, without -c, du would mistakenly count the
3113 space of hard-linked files, not just the first one it encountered.
3114 Reported by Anthony Thyssen.
3115 * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.
3117 * src/du.c: Rename global `print_totals' to `print_grand_total'.
3119 * src/du.c (main): Rearrange filtering loop to be a tiny bit
3122 * src/chown-core.c: Don't include savedir.h -- no longer needed.
3123 * src/chmod.c: Likewise.
3125 2004-03-25 Jim Meyering <jim@meyering.net>
3127 * src/du.c (main): Remove now-unused declaration of `i'.
3129 2004-03-24 Paul Eggert <eggert@twinsun.com>
3131 * src/du.c (main): Filter out file names of length zero before
3132 invoking fts, so that they don't cause fatal errors.
3134 2004-03-25 Jim Meyering <jim@meyering.net>
3136 * tests/du/files0-from (zero-len): Add a test for the above.
3138 2004-02-25 Paul Eggert <eggert@twinsun.com>
3140 * NEWS: New environment var BLOCKSIZE.
3141 * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
3142 * tests/envvar-check: Test for it. Factor the code to simplify it.
3144 2004-03-23 Paul Eggert <eggert@twinsun.com>
3146 * NEWS: Shorten the du --files0-from announcement, and say
3147 "NUL-terminated" rather than "NUL-separated".
3148 * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
3150 (usage): Say "NUL-terminated", not "NUL-separated".
3151 (main): Check for I/O error when istream is closed.
3152 Allow --files0-from=F even if F is empty; this specifies no files.
3153 (du_files): Now that we allow the list of files to be empty,
3155 * tests/du/files0-from: Adjust to above changes to src/du.c.
3157 2004-03-24 Jim Meyering <jim@meyering.net>
3159 * tests/tail-2/assert: Avoid race condition that could cause
3160 spurious failure. Based on a patch from Andreas Schwab.
3162 2004-03-23 Jim Meyering <jim@meyering.net>
3164 * src/du.c (main): Free the hash table, too.
3166 2004-03-22 Jim Meyering <jim@meyering.net>
3168 * man/Makefile.am (.x.1): Remove --info-page= option, reverting
3169 the change of 2004-01-22. I can no longer reproduce the problem
3170 that prompted that change, and `info coreutils pr' would display the
3171 `printing text' section of the manual, not the one on `pr invocation'.
3173 * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics
3174 to match corrected output.
3176 * src/du.c: Include "readtokens0.h" rather than "readtokens.h".
3177 (main): Use readtoken0 functions rather than readtokens.
3178 Don't use errno when diagnosing readtokens0 failure.
3179 Fix off-by-one error in the token number reported in a diagnostic.
3180 (du_files): Return bool, rather than int.
3181 (main): Call readtokens0_free.
3183 2004-03-21 Jim Meyering <jim@meyering.net>
3185 * src/remove.c (ds_free): Plug a small leak.
3187 * tests/Fetish.pm: Fix typo in comment.
3189 2004-03-07 Jim Meyering <jim@meyering.net>
3191 * NEWS: du accepts a new option --files0-from=FILE, where FILE
3192 contains a list of NUL-separated file names.
3194 * src/du.c: Include "readtokens.h".
3195 (usage): Describe the new option, and adjust the `Usage':
3196 with this option, no FILE may be specified on the command line.
3197 (main): Handle the new option.
3199 * tests/du/files0-from: New tests, for the above.
3200 * tests/du/Makefile.am (TESTS): Add files0-from.
3202 * src/factor.c (do_stdin): Reflect changes in use of readtoken.
3203 * src/tsort.c (tsort): Likewise.
3205 2004-02-29 Paul Eggert <eggert@twinsun.com>
3207 * NEWS: Add support for a new notation @N to get_date to represent
3208 the time stamp with numeric value N. Improve support for
3209 fractional time stamps. date's -d and -f options now accept them.
3210 Likewise for touch -t. date has a new option --iso-8601=ns.
3212 * doc/coreutils.texi (touch invocation):
3213 Describe use of fractional seconds.
3214 (date invocation, Options for date): Likewise.
3215 * doc/getdate.texi (General date syntax, Time of day items): Likewise.
3216 * doc/coreutils.texi (date invocation): Mention effect of LC_TIME.
3217 (Options for date): Describe new --iso-8601=ns option.
3219 * doc/getdate.texi: Add copyright notice. Change getdate to
3220 get_date when talking about the function name.
3221 (Seconds since the Epoch): New section, containing the time_t
3222 info moved from Date input formats section, along with new
3223 info about the @ syntax. Mention negative time stamps,
3224 fractional time stamps, and leap seconds.
3225 (General date syntax): Modernize examples a bit to reflect new
3227 (General date syntax, Relative items in date strings):
3228 Use ' rather than " to quote formats.
3229 (Time of day items): Add an example with fractional seconds.
3230 Describe fractional-second syntax.
3232 * src/Makefile.am (touch_LDADD): New macro, since `touch' now
3233 needs clock_gettime.
3235 * src/date.c (enum Time_spec): New enum TIME_SPEC_NS.
3236 (time_spec_string, time_spec, show_date): Support it.
3237 (usage): Remove description of -ITIMESPEC, as it's obsolete and
3238 confusing. Mention --iso-8601=ns.
3239 (batch_convert): getline returns ssize_t, not int.
3241 * src/touch.c (newtime): Now an array of two timespecs, one
3242 for access and one for modification.
3243 (ref_stats): Remove.
3244 (get_reldate): Use get_date's parameter profile.
3245 (touch, main): Adjust to above changes.
3246 (main): Work even if tm_year == INT_MAX (so long as long int is wider).
3247 Use gettime instead of gettimeofday, for new get_date signature.
3249 * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32,
3252 2004-03-15 Jim Meyering <jim@meyering.net>
3254 * Makefile.maint (alpha beta major): `Make' the emit_upload_commands
3255 target before updating $(prev_version_file).
3257 * tests/misc/date-sec: New file, to test for just-fixed bug in date.
3258 See today's change in lib/getdate.y.
3259 * tests/misc/Makefile.am (TESTS): Add date-sec.
3261 2004-03-14 Jim Meyering <jim@meyering.net>
3263 * announce-gen (print_changelog_deltas): Use `.sig' suffix for
3264 signature files, not `.asc'. Reported by angico@yahoo.com.
3266 2004-03-13 Jim Meyering <jim@meyering.net>
3268 * src/cp.c (do_copy): Tweak wording in a diagnostic.
3269 Suggestion from Karl Berry.
3270 Include "quoatearg.h".
3271 (do_copy): Use quotearg_colon (not quote) for diagnostics
3272 that begin with `"%s:'.
3274 * src/nl.c (usage): Specify that nl uses _basic_ regular expressions.
3275 Suggestion from Dan Jacobson.
3277 2004-03-12 Jim Meyering <jim@meyering.net>
3281 Sometimes, when source and destination partition are different,
3282 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
3284 * src/copy.c: When moving a set of N hard-linked files between
3285 partitions, via two or more command line arguments where the
3286 command line argument containing the Nth link contains no other
3287 link to that same file, mv would mistakenly copy the file, rather
3288 than hard-linking it to the other(s). That happens because when the
3289 final link is processed, its link count has been reduced to 1 since
3290 the other links have been `copied' to the destination partition
3291 and the source links have been removed.
3292 (copy_internal): When in move mode, use the source dev/inode
3293 pair to look up destination name even when st_nlink == 1.
3294 * src/cp-hash.c (src_to_dest_lookup): New function.
3295 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
3296 * tests/mv/part-hardlink: New file. Test for the above fix.
3297 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
3299 * announce-gen: Sync with autoconf.
3301 * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
3302 This was triggered on a Linux-2.2.19 system using a file system
3303 NFS-mounted from some sort of Sun.
3305 2004-03-11 Jim Meyering <jim@meyering.net>
3307 * Use automake-1.8.3. Regenerate dependent files.
3309 2004-03-10 Jim Meyering <jim@meyering.net>
3311 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
3312 so that this test works with SELinux-enabled systems.
3313 Based on a patch from Tim Waugh.
3315 `join -1 x' would give a misleading diagnostic
3316 * src/join.c (string_to_join_field): Report that a non-numeric field
3317 number is invalid, rather than `so large that it is not representable'.
3318 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
3320 2004-03-06 Jim Meyering <jim@meyering.net>
3322 cp --sparse=always sparse-image-file.img /dev/hda1 could
3323 produce an invalid copy on the destination device.
3325 * src/copy.c (copy_reg): Even with --sparse=always, try to
3326 make `holes' only if the destination is a regular file.
3327 Reported by Szakacsits Szabolcs.
3329 2004-03-03 Paul Eggert <eggert@twinsun.com>
3331 * src/nohup.c (main): Don't invoke set_cloexec_flag with
3332 a file descriptor of -1.
3334 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
3336 * src/nohup.c: Include "cloexec.h".
3337 (main): Set the copy of stderr to close on exec.
3339 2004-03-01 Paul Eggert <eggert@twinsun.com>
3341 * configure.ac: Include <signal.h> when checking for strsignal,
3342 sys_siglist, and friends. Problem reported by Tony Leneis in
3343 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
3345 2004-02-25 Paul Eggert <eggert@twinsun.com>
3347 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
3348 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
3351 2004-02-23 Paul Eggert <eggert@twinsun.com>
3353 * NEWS: Document how chown's USER.GROUP argument is now parsed.
3355 2004-02-23 Jim Meyering <jim@meyering.net>
3357 * src/seq.c (usage): Remove stray space after \n in --help output.
3359 2004-02-22 Jim Meyering <jim@meyering.net>
3361 * src/du.c (usage): Separate -H and --si. Say that the meaning
3362 of -H will soon change to that of --dereference-args (-D).
3364 2004-02-21 Jim Meyering <jim@meyering.net>
3366 * src/comm.c (usage): Tell what comm does when there are no options.
3367 Reword in terms of FILE1 and FILE2 rather than `left file' and
3368 `right file'. Suggestion from Dan Jacobson.
3370 2004-02-15 Paul Eggert <eggert@twinsun.com>
3372 Fix some POSIX-conformance bugs in expr.
3374 * NEWS: document the following changes to src/expr.c.
3375 * doc/coreutils.texi (expr invocation): Likewise.
3376 Document what forms integers may take, and say "integer"
3377 consistently instead of "number". Warn about operands
3378 that "expr" can misinterpret, and how to work around the
3380 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
3381 Accept a bool argument specifying whether to evaluate the
3382 expression. This is to allow short-circuit evaluation. All
3384 (null): Report that a string is zero even if it has
3385 a form like "-0" or "00".
3386 (eval1, eval): Use short-circuit evaluation for | and &.
3387 (eval): Return 0 if both arguments are null or zero, instead
3388 of returning the first argument.
3389 * tests/expr/basic: Add some tests for the above.
3391 2004-02-17 Jim Meyering <jim@meyering.net>
3395 `make check' from a build inside a chroot environment would fail
3396 * tests/help-version: Specify an argument (`/') for df, in the
3397 unusual event that there is no valid entry in /etc/mtab.
3398 Likewise for id: add the -u option, so we don't get spurious
3399 failures when there are no user or group names.
3402 * src/sort.c (usage) [-u]: Add punctuation so that the description in
3403 the help2man-generated (line-joined) man page is more readable.
3404 Reported by Tim Waugh.
3405 [-T]: Add a semicolon, for the same reason.
3407 2004-02-15 Jim Meyering <jim@meyering.net>
3409 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
3411 2004-02-11 Jim Meyering <jim@meyering.net>
3413 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
3414 $(srcdir)/../Makefile.am.in, rather than $<.
3415 Suggestion from Michael Elizabeth Chastain.
3417 2004-02-10 Jim Meyering <jim@meyering.net>
3419 * config/install-sh: Make this script executable.
3420 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
3421 is executable. Otherwise, on systems that lack a suitable install
3422 binary, `make install' would fail, because of the way this script
3423 is invoked (without `$SHELL ' prefix).
3424 Reported by Bob Proulx.
3426 2004-02-08 Jim Meyering <jim@meyering.net>
3430 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
3431 that would cause an unwarranted test failure.
3432 * tests/rm/rm3: Likewise.
3434 2004-02-07 Jim Meyering <jim@meyering.net>
3436 Remove xstat function pointer member. The way it was used was not
3437 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
3438 inline `stat' and `lstat' functions, thus making the tests of
3439 `xstat == lstat' in copy.c always fail.
3440 * src/copy.h (struct cp_options) [xstat]: Remove member.
3442 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
3443 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
3444 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
3445 (valid_options): Remove now-obsolete FIXME comments.
3447 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
3448 `*(x->xstat) (...)'.
3449 (do_copy): Declare/use local xstat rather than x->xstat.
3450 (main): Remove code that set x.xstat.
3451 * src/mv.c (cp_option_init): Don't initialize xstat member.
3452 * src/install.c (cp_option_init): Likewise.
3454 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
3455 so that emit_upload_commands can use these variables, too.
3457 2004-02-06 Jim Meyering <jim@meyering.net>
3459 * tests/rm/deep-1: Remove `du' stack space test.
3460 Apparently, `ulimit -s N' isn't portable enough.
3461 This test will be restored (with a guard against losing ulimit)
3462 in its own file later.
3464 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
3465 since this test doesn't take long enough to merit them.
3466 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
3468 * Makefile.maint (signatures): Remove definition.
3469 Now, automake's gnupload handles this.
3470 (%.sig: %): Remove now-unused rule.
3471 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
3472 `$(distdir).tar.bz2 $(distdir).tar.gz'.
3473 (emit-upload-commands): Adjust to use gnupload.
3475 2004-02-05 Jim Meyering <jim@meyering.net>
3477 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
3478 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3479 Now, those are all defined in timespec.h.
3482 * src/date.c: Don't include timespec.h, now that system.h does it.
3484 2004-02-02 Paul Eggert <eggert@twinsun.com>
3486 Don't dump core if localtime returns NULL (possible on
3487 hosts with 64-bit time_t and 32-bit int).
3488 * src/date.c: Include "inttostr.h".
3489 (batch_convert, main):
3490 If time conversion fails, exit with nonzero status.
3491 (show_date): Return int to report conversion failure.
3492 Print the time as an int if localtime fails.
3493 * src/uptime.c: Print "??" if the current clock can't
3494 be converted by localtime. This won't happen until the year
3495 2*31 + 1900, but we don't want to dump core even if the current
3496 clock has the wrong value.
3498 * src/stat.c: Include "inttostr.h".
3499 (human_time): Print the date/time as a number of seconds since the
3500 epoch if it can't be converted by localtime. This is better than
3501 just saying "invalid", and is consistent with what "ls" does.
3502 Don't dump core if the year has more than 48 digits; this isn't
3503 possible on any contemporary host, but we might as well do it right.
3505 2004-01-31 Paul Eggert <eggert@twinsun.com>
3507 * src/stat.c (human_time): Accept time rather than
3508 pointer-to-const-time parameter, for clarity. All callers changed.
3510 2004-02-02 Jim Meyering <jim@meyering.net>
3512 * src/stat.c (do_stat): Remove extra trailing newline from
3513 default formats. Reported by Nelson H. F. Beebe.
3515 Print actual fractional seconds in time stamps, not just `.00000000'.
3516 * src/stat.c (human_time): Add and use new parameter, t_ns.
3517 (print_stat): Update callers.
3518 * src/ls.c (TIMESPEC_NS): Remove definition.
3519 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
3520 also uses this macro.
3521 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
3522 fractional seconds for files on an XFS file system, but that stat's
3523 fractional seconds were always zero.
3525 2004-01-28 Paul Eggert <eggert@twinsun.com>
3527 * src/seq.c (print_numbers): Use 'double' for loop index, not
3528 'int', to avoid problems with integer overflow. On almost all
3529 machines 'double' works in every case where 'int' works, and
3530 it works on other cases besides.
3532 2004-01-27 Jim Meyering <jim@meyering.net>
3534 * src/seq.c (usage): Mention that if INCREMENT is omitted,
3535 it defaults to 1, even when FIRST is larger than LAST.
3536 Reword so as not to exclude the possibility that INCREMENT be zero.
3538 2004-01-25 Jim Meyering <jim@meyering.net>
3542 * Makefile.maint (signatures): Comment out definition.
3544 2004-01-23 Jim Meyering <jim@meyering.net>
3546 * Makefile.maint (header_regexp): Add exitfail.
3548 * man/Makefile.am (EXTRA_DIST): Add help2man.
3549 Reported by Nelson H. F. Beebe.
3551 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
3552 so it works on systems with Perl installed somewhere other than in
3555 * src/paste.c (paste_parallel): Declare local, chr, to be of type
3556 `int', not `char', since it must hold EOF. This bug would make
3557 paste infloop on some systems. Test failures reported by
3558 Nelson H. F. Beebe and Christian Krackowizer.
3560 2004-01-22 Jim Meyering <jim@meyering.net>
3562 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
3563 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
3565 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
3566 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
3567 Use --info-page='coreutils PROG' option.
3568 Now, readlink.1 refers the user to `info coreutils readlink'
3569 rather than to `info readlink'. Reported by Matt Swift.
3571 2004-01-21 Paul Eggert <eggert@twinsun.com>
3573 Exit status cleanup.
3575 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
3576 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
3577 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
3578 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
3579 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
3580 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
3581 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
3582 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
3583 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
3584 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
3585 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
3586 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
3587 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
3588 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
3589 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
3590 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
3591 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
3593 * src/cat.c (usage): Don't bother normalizing exit status
3594 since the arg is already the correct exit status now.
3595 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
3596 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
3597 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
3598 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
3599 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
3601 * src/chown.c (main): Removed unused local 'fail'.
3603 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
3606 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
3607 * src/env.c, src/nice.c, src/su.c: Likewise.
3608 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
3609 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
3610 * src/expr.c (main): Use initialize_exit_failure rather than
3611 setting exit_failure directly; this optimizes away redundant
3613 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
3615 * src/chroot.c (main): Exit with status 1 rather than 127
3616 if chroot itself fails, as per documentation.
3618 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
3619 rather than roll-your-own symbols or integers.
3620 * src/env.c (main): Likewise.
3621 * src/nohup.c (main): Likewise.
3622 * src/su.c (run_shell): Likewise.
3624 * src/cp.c (exit_status): Remove static var....
3625 (main): Making it local here instead. Use =, not |=, to set it.
3627 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
3629 * src/date.c (batch_convert, main): Likewise.
3630 * src/dd.c (dd_copy): Likewise.
3631 * src/pr.c (first_last_page, main, getoptarg): Likewise.
3632 * src/tr.c (main): Likewise.
3633 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
3634 POSIX doesn't require it.
3635 * src/dd.c (write_output, skip, dd_copy): Likewise.
3636 * src/df.c (main): Likewise.
3637 * src/id.c (main): Likewise.
3638 * src/install.c (main): Likewise.
3639 * src/ln.c (main): Likewise.
3640 * src/ls.c (main): Likewise.
3641 * src/mv.c (main): Likewise.
3642 * src/shred.c (main): Likewise.
3644 * src/env.c (main): Exit with status 1, not 2, on errors detected
3646 * src/hostname.c (main): Likewise.
3647 * src/nl.c (main): Likewise.
3648 * src/stty.c (main): Likewise.
3650 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
3651 consistency with the other programs' naming conventions.
3654 * src/factor.c (main): Do not report a usage error simply
3655 because stdin has bad numbers.
3657 * src/id.c (problems): Now a boolean int, not a counter,
3658 so that we don't have to worry about int overflow. All uses changed.
3659 * src/touch.c (err): Likewise.
3661 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
3663 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
3664 * src/mknod.c: Likewise.
3666 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
3667 on error; this is in case EXIT_FAILURE is unusual.
3668 * src/su.c (main): Likewise.
3670 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
3671 changed to EXIT_CANNOT_INVOKE.
3673 * src/printenv.c (PRINTENV_FAILURE): New constant.
3674 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
3675 command-line syntax problems.
3677 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
3678 (main): Avoid integer overflow when seeing whether errors occurred.
3680 * src/seq.c (print_numbers): Now returns void, not (zero) int.
3681 All callers changed.
3682 (main): Remove unused local variable 'errs'. Always exit successfully
3683 if we reach the end.
3685 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
3686 for consistency with other programs here. All uses changed.
3687 (main): Use 'error' to exit rather than invoking 'exit' here.
3689 * src/sort.c: Don't include <assert.h>.
3690 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
3691 (usage): Don't use 'assert'.
3692 (main): Remove redundant assignment to exit_failure.
3694 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
3696 (initialize_exit_failure): New inline function.
3697 Include exitfail.h here, since we refer to exit_failure.
3698 All callers changed to not include exitfail.h.
3700 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
3701 substitute them for the corresponding integer constants.
3703 * tests/help-version (expected_failure_status_date): Remove, as
3704 'date' is now normal.
3705 (expected_failure_status_nohup): New var.
3707 2004-01-21 Jim Meyering <jim@meyering.net>
3709 * tests/touch/relative: Remove `command' syntax.
3710 Thanks to Nelson H. F. Beebe and Paul Eggert.
3712 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
3713 so as to avoid problems with systems using TAI clocks.
3714 Although it's no longer necessary, set TZ=UTC0 also for the
3715 initial touch command. Reported by Paul Jarc here:
3716 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
3718 2004-01-20 Diego Biurrun <diego@biurrun.de>
3720 * src/dircolors.hin: Add .mov to the list of media files.
3722 2004-01-19 Paul Eggert <eggert@twinsun.com>
3724 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
3725 portable). Problem reported by Christian Krackowizer. Also, use
3726 +0000 rather than +0 to specify a time zone, as the documentation
3727 requires four digits.
3729 2004-01-19 Jim Meyering <jim@meyering.net>
3731 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
3732 * tests/mv/backup-is-src: Likewise.
3733 Problem reported by Peter Horst
3735 2004-01-17 Jim Meyering <jim@meyering.net>
3737 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
3741 2003-12-15 Paul Eggert <eggert@twinsun.com>
3743 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
3744 with -r specifying the origin for -d.
3745 * src/touch.c (flexible_date): Remove static var.
3746 (get_reldate): New function.
3747 (main): Use it, to implement this new behavior.
3749 2004-01-16 Jim Meyering <jim@meyering.net>
3751 * tests/touch/relative: New test for the above.
3752 * tests/touch/Makefile.am (TESTS): Add relative.
3754 2004-01-13 Jim Meyering <jim@meyering.net>
3756 * src/system.h: Include contents of sys2.h.
3757 * src/sys2.h: Remove file.
3758 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
3760 * Use automake-1.8.2. Regenerate dependent files.
3762 * Update to gettext-0.13.1.
3763 * configure.ac: Use gettext-0.13.1.
3764 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
3766 2004-01-12 Jim Meyering <jim@meyering.net>
3768 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
3770 * Makefile.maint (po-check): Ensure that cvsu works before using it.
3771 Reported by Alexandre Duret-Lutz.
3773 * src/tail.c (main): Warn about following stdin only when it's a tty.
3775 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
3777 2004-01-10 Jim Meyering <jim@meyering.net>
3779 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
3781 2004-01-09 Jim Meyering <jim@meyering.net>
3783 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
3785 2004-01-08 Jim Meyering <jim@meyering.net>
3787 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
3788 From Andreas Schwab.
3790 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
3791 remnant) from PATH component. That would cause tests in this directory
3792 not to run the just-built binaries, but rather whatever happened
3793 to be in one's PATH. Reported by Christian Krackowizer.
3795 2004-01-04 Jim Meyering <jim@meyering.net>
3797 * src/csplit.c (new_control_record): Use x2nrealloc
3798 rather than xrealloc.
3800 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
3802 (make_path_private): Likewise.
3804 2004-01-03 Jim Meyering <jim@meyering.net>
3806 * src/paste.c: Use `bool' (not int) as the type for a few
3808 (collapse_escapes): Rewrite to set globals rather than modifying
3810 Use size_t (not int) for all counters and related index variables.
3811 (paste_parallel): Remove needless complexity of
3812 using xrealloc in the loop; just allocate the buffers up front.
3813 Free the two temporary buffers.
3814 Move declarations of locals `down' into scope where used.
3815 (paste_serial): Remove `register' attributes.
3816 (main): Simplify delim-related code.
3817 Free `delims', now that it's malloc'd.
3819 2004-01-02 Jim Meyering <jim@meyering.net>
3821 * src/chroot.c: Include "quote.h".
3822 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
3823 (main): Exit with status of 127, not 1, for too-few-args,
3824 chroot failure, or chdir failure.
3825 Give a better diagnostic upon execvp failure.
3827 * src/du.c (usage): Mention that, with its current meaning,
3830 * src/tail.c (main): Warn about following stdin when it's a tty.
3831 Fail when following by name but no names are specified.
3833 2003-12-30 Jim Meyering <jim@meyering.net>
3835 * src/fold.c (main): Use memcpy, not strcpy.
3837 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
3840 2003-12-28 Jim Meyering <jim@meyering.net>
3842 * src/unexpand.c (n_tabs_allocated): New global.
3843 (add_tabstop): Use x2nrealloc rather than xrealloc.
3844 * src/expand.c: Likewise.
3846 * tests/misc/expand: New file.
3847 * tests/misc/Makefile.am (TESTS): Add expand.
3849 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
3850 (fillbuf): Use x2nrealloc rather than xrealloc.
3851 (sort): Use xnmalloc rather than xmalloc.
3854 2003-12-27 Jim Meyering <jim@meyering.net>
3856 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
3858 2003-12-29 Paul Eggert <eggert@twinsun.com>
3860 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
3861 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
3863 * doc/coreutils.texi (join invocation): Remove documentation
3864 accordingly. Document that -t makes all separators significant.
3866 * src/join.c: Include posixver.h.
3867 (obsolete_usage): New var.
3868 (longopts): Put obsolete options first.
3869 (OBSOLETE_LONG_OPTIONS): New constant.
3870 (get_option, add_file_name): New functions.
3871 (main): Use them to support new behavior.
3872 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
3873 Do not mark -j FIELD as obsolescent; it is longstanding
3874 UNIX tradition and is a valid extension to POSIX.
3876 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
3878 2003-12-28 Paul Eggert <eggert@twinsun.com>
3880 * src/join.c (add_field_list): Don't use alloca with unbounded
3881 size; just modify the argument, which is no longer const *.
3883 Various other minor cleanups, mostly to avoid the need for casts.
3885 (extract_field): Renamed from ADD_FIELD, as it's now a function.
3887 (struct field.beg): Now char *, not unsigned char const *. All
3888 uses changed. It shouldn't be const since xmemcoll writes on its
3890 (extract_field): Likewise, for 2nd arg.
3891 (keycmp): Remove now-unnecessary cast of xmemcoll args.
3893 (is_blank): New function, to avoid need to cast arg to unsigned char.
3894 (extract_field): Use it.
3896 (xfields): Rewrite pretty much from scratch.
3898 (hard_LC_COLLATE): Now bool, not int.
3899 (get_line, getseq, add_field_list): Now returns bool, not int.
3900 (decode_field_spec, add_field_list): Return true on success (not
3901 false), for consistency with the rest of the code. All uses changed.
3903 (tab): Now char, not unsigned char. This wasn't 100% necessary
3904 but is slightly cleaner.
3905 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
3907 (empty_filler): Now const *.
3909 (make_blank): Remove; wasn't needed. Remove all calls.
3910 (main): Don't set uni_blank.nfields; zero is fine.
3912 2003-12-27 Jim Meyering <jim@meyering.net>
3914 * src/join.c: Include "quote.h".
3915 (min, max): Remove definitions.
3916 Make a few function parameters and corresponding
3917 locals `const'. Use bool for boolean variables.
3918 Use size_t (not int) for all counters and related index variables.
3919 (prjoin): Remove now-useless assertion.
3920 (string_to_join_field): New function.
3921 (main): Accept join fields as large as SIZE_MAX.
3922 (keycmp): Rename `min' to MIN and max to MAX.
3924 2003-12-26 Jim Meyering <jim@meyering.net>
3926 fold -s didn't work on e.g., alpha-based systems.
3927 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
3928 x2nrealloc works properly on systems with differing sizes for int
3929 and size_t. Reported by Nelson Beebe.
3931 * src/fold.c: Use `bool' (not int) as the type for a few
3934 2003-12-23 Paul Eggert <eggert@twinsun.com>
3936 * src/ls.c (length_of_file_names_and_frills):
3937 Remove forward decl; not needed.
3938 (print_file_name_and_frills, length_of_file_name_and_frills):
3939 With -m, don't output spaces before inum or size.
3940 (print_with_commas): Don't output space just before newline.
3942 2003-12-24 Jim Meyering <jim@meyering.net>
3944 * tests/ls/Makefile.am (TESTS): Add m-option.
3945 * tests/ls/m-option: New file. Test for above fixes.
3947 2003-12-20 Jim Meyering <jim@meyering.net>
3951 * src/pr.c: Change type of global, buff_allocated, to size_t.
3953 * src/join.c [struct seq]: Change types of members count and alloc
3954 from `int' to `size_t'.
3956 * tests/Makefile.am (root-hint): Tweak wording.
3958 * src/du.c: Accept new option (-0, --null) that makes it so each
3959 output line is NUL-terminated rather than newline-terminated.
3961 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
3962 Reported by Volker Paul.
3963 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
3964 * tests/dd/unblock-sync: New test for the above.
3966 2003-12-19 Jim Meyering <jim@meyering.net>
3968 * tests/misc/nohup: Double quote back-ticked expression,
3969 in case it ends up having an unexpected value.
3971 * tests/ls/no-arg: Use ls's -1 option in both runs.
3973 * src/du.c (fts_debug): New global.
3974 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
3975 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
3976 (main) [DU_DEBUG]: Accept -d option.
3978 2003-12-18 Jim Meyering <jim@meyering.net>
3980 * src/ls.c (format_user): Increment dired_pos via two statements,
3981 `dired_pos += width; dired_pos++;' rather than one,
3982 `dired_pos += width + 1;' since the latter could conceivably overflow.
3983 (format_group): Likewise.
3986 * configure.ac: Require automake-1.8.
3988 2003-12-12 Jim Meyering <jim@meyering.net>
3990 * Use automake-1.8. Regenerate dependent files.
3992 2003-12-08 Jim Meyering <jim@meyering.net>
3994 * Makefile.maint (news-date-check): New rule.
3995 (alpha beta major): Depend on it.
3997 2003-12-03 Paul Eggert <eggert@twinsun.com>
3999 * NEWS: ls -l (and similar options) now adjust all columns to
4000 fit the data. Generalized from a suggestion by Leah Q for file sizes.
4001 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
4002 (format_user_width, format_group_width, unsigned_file_size,
4003 format_group): New functions.
4004 (block_size_width): Renamed from block_size_size.
4005 (inode_number_width, nlink_width, owner_width, group_width,
4006 author_width, major_device_number_width, minor_device_number_width,
4007 file_size_width): New vars.
4008 (clear_files): Initialize them.
4009 (gobble_file): Set them. Don't ceiling block_size_width to 7.
4010 (print_long_file): Use them.
4011 (gobble_file): Use a new local variable 'f' to make the code
4012 smaller and more consistent with other functions.
4013 (format_user): Output to stdout, not to a buffer, so that we
4014 don't have to worry about buffer overrun. Update dired_pos.
4015 (print_long_file): Don't put owner, group, author into buffer;
4016 just print them directly. Don't assume link counts and
4017 major and minor numbers fit into unsigned long int.
4018 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
4019 'ls' output is fixed-width.
4021 2003-12-02 Jim Meyering <jim@meyering.net>
4023 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
4025 2003-11-27 Jim Meyering <jim@meyering.net>
4027 * Use automake-1.7f. Regenerate dependent files.
4029 2003-11-24 Paul Eggert <eggert@twinsun.com>
4031 Parse floating-point operands and options in the C locale.
4032 POSIX requires this for printf, and we might as well be
4033 consistent elsewhere (tail, sleep, seq).
4035 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
4036 needed now that we assume C89. Include "c-strtod.h".
4037 (xstrtod): Call c_strtod, not strtod.
4038 * src/sleep.c: Include "c-strtod.h".
4039 (main): Update xstrtod call to include new argument, c_strtod.
4040 * src/seq.c (scan_double_arg): Likewise.
4041 * src/tail.c (parse_options): Likewise.
4043 2003-11-24 Jim Meyering <jim@meyering.net>
4045 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
4046 Reported by Mark Conty.
4048 2003-11-22 Jim Meyering <jim@meyering.net>
4050 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
4051 (sc_system_h_headers): Do this test only if sys2.h exists.
4053 2003-11-20 Jim Meyering <jim@meyering.net>
4055 * tests/help-version: Ensure that the bug-reporting address is
4056 included in the --help output for every program.
4057 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
4059 * src/ptx.c (usage): Output bug-reporting address.
4060 Reported by Dan Jacobson.
4062 2003-11-19 Jim Meyering <jim@meyering.net>
4064 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
4065 on the join fields. Suggestion from Bruce Robertson.
4067 2003-11-18 Jim Meyering <jim@meyering.net>
4069 `od -c -w9999999' could segfault
4070 * src/od.c (dump): Use xnmalloc/free, not alloca.
4072 2003-11-16 Jim Meyering <jim@meyering.net>
4074 * Use autoconf-2.59. Regenerate dependent files.
4076 * tests/du/hard-link: Minor tweak: use mkdir -p.
4078 Fix read-from-free'd-buffer error detected by valgrind.
4079 * src/csplit.c (remove_line): Don't return a pointer to data in
4080 a freed buffer. Instead, arrange to free the buffer on the
4083 * tests/misc/csplit: New test for above fix.
4085 2003-11-11 Jim Meyering <jim@meyering.net>
4087 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
4088 This avoids a warning from valgrind about memcpy with overlapping
4089 source and destination.
4091 * configure.ac: Require automake-1.7.8.
4093 2003-11-09 Jim Meyering <jim@meyering.net>
4095 * Use automake-1.7.9. Regenerate dependent files.
4097 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
4098 * src/chown.c: Likewise.
4100 * src/chown-core.c: Include "root-dev-ino.h".
4101 (chopt_init): Initialize new member.
4102 (change_file_owner): Support rm's new --preserve-root option.
4104 * src/remove.c: Include "root-dev-ino.h".
4105 (remove_cwd_entries): Remove now-obsolete FIXME comment.
4106 (remove_dir): Support rm's new --preserve-root option.
4108 * src/chown.c: Include "root-dev-ino.h".
4109 Add new options: --preserve-root and --no-preserve-root.
4111 * src/chmod.c: Include "root-dev-ino.h".
4112 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
4113 ROOT_DEV_INO_WARN macros.
4114 (get_root_dev_ino): Remove function definition, now that it's
4115 been moved to a separate file.
4116 (usage): Describe new options.
4118 * src/mv.c (rm_option_init): Initialized new member.
4120 * src/remove.h: Include "dev-ino.h".
4121 (struct rm_options): Add new member: root_dev_ino.
4122 * src/chown-core.h: Include "dev-ino.h".
4123 (struct Chown_option): Add new member: root_dev_ino.
4125 2003-11-06 Jim Meyering <jim@meyering.net>
4127 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
4128 hard-coding `sizeof FILE*'.
4130 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
4132 * src/wc.c (main): Free `fstatus' so there is no confusion about
4133 whether it's leaked or not.
4134 * src/who.c (who): Likewise for `utmp_buf'.
4136 2003-11-05 Paul Eggert <eggert@twinsun.com>
4138 Fix 'cut' problems with size_t overflow and unsigned int.
4139 More generally, resize integer variables to fit use more precisely.
4140 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
4141 (struct range_pair): Make members to be of type size_t, not unsigned.
4142 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
4143 (suppress_non_delimited, output_delimiter_specified,
4144 have_read_stdin, print_kth, set_fields): Now bool, nt int.
4145 (delim): Now unsigned char, not int.
4146 (mark_printable_field, is_printable_field, is_range_start_index,
4147 set_fields, set_fields, cut_bytes, cut_fields):
4148 Use size_t, not unsigned, for field and byte counts.
4149 (hash_int): Use uintptr_t, not unsigned, for pointers converted
4150 to integers. This squeezes more info out of them.
4151 (set_fields, cut_bytes, cut_fields, main):
4152 Use bool, not int, for booleans.
4153 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
4155 2003-11-05 Paul Eggert <eggert@twinsun.com>
4157 * man/Makefile.am (check-programs-vs-x):
4158 Work even if $(programs) contains '$'.
4159 Work even if 'missing=1' in environment.
4160 Don't report an error simply because $(programs) outputs nothing.
4162 2003-11-05 Jim Meyering <jim@meyering.net>
4164 * Use autoconf-2.58. Regenerate dependent files.
4166 * src/tr.c (spec_init): Fix typo in last change.
4168 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
4169 call to variadic version_etc function, so that it works even on systems
4170 for which sizeof char* != sizeof int.
4171 * src/true.c (main): Likewise.
4172 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
4173 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
4174 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
4175 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
4176 Similarly, cast NULL to `(char *)' in call to variadic function,
4177 parse_long_options, so that it works even on systems for which
4178 sizeof char* != sizeof int.
4179 A similar problem was reported by Harti Brandt in
4180 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
4182 * src/users.c (users): Free `utmp_buf' explicitly so that people
4183 don't mistake this for a real leak.
4184 Patch by Dennis Smit <ds@nerds-incorporated.org.
4186 2003-11-04 Paul Eggert <eggert@twinsun.com>
4188 * README: Document _POSIX2_VERSION.
4190 2003-11-04 Jim Meyering <jim@meyering.net>
4192 * src/tac.c (memrchr): Remove #if-0'd function.
4193 (tac_stdin_to_mem): Clean up #if-0'd code.
4195 * src/od.c (decode_format_string): Remove unnecessary casts.
4196 Use more maintainable `sizeof *var'.
4197 (main): Call decode_format_string rather than decode_one_format,
4198 now that `spec' may be NULL.
4200 * src/chmod.c (AUTHORS): Add my name.
4202 * src/split.c (next_file_name): Use `sizeof *var' rather than
4203 hard-coding `sizeof size_t'.
4205 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
4207 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
4208 to avoid potential overflow in pointer arithmetic.
4209 (set_fields): Use not `1', but rather `sizeof *printable_field' as
4210 second argument to xcalloc.
4211 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
4212 rather than xrealloc.
4213 * src/date.c (show_date): Likewise.
4214 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
4215 * src/pr.c (store_char): Likewise.
4216 * src/fold.c (fold_file): Likewise.
4218 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
4219 type changes (unsigned int -> size_t) in hash.c.
4220 * src/cp-hash.c (src_to_dest_hash): Likewise.
4221 * src/du.c (entry_hash): Likewise.
4222 * src/ls.c (dev_ino_hash): Likewise.
4223 * src/cut.c (hash_int): Likewise. Declare function as static.
4225 2003-11-03 Jim Meyering <jim@meyering.net>
4227 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
4228 * tests/misc/fold: Fail the test immediately if we're not running
4229 the expected version of fold.
4231 2003-11-02 Jim Meyering <jim@meyering.net>
4233 * src/tr.c (append_normal_char, append_range, append_char_class)
4234 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
4235 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
4236 and usually shorter.
4237 * src/copy.c (copy_internal): Likewise.
4238 * src/join.c (initseq, add_field, make_blank): Likewise.
4239 * src/od.c (main): Likewise.
4240 * src/cp.c (make_path_private): Likewise.
4241 * src/tsort.c (new_item, record_relation): Likewise.
4243 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
4244 (main): Also remove anachronistic cast of xmalloc return value.
4245 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
4246 (main): Also remove anachronistic cast of xmalloc return value.
4247 * src/sort.c (inittables): Likewise.
4248 (sort): Also Split a long line.
4250 2003-10-25 Jim Meyering <jim@meyering.net>
4252 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
4253 type changes (unsigned int -> size_t) in hash.c.
4254 * src/cp-hash.c (src_to_dest_hash): Likewise.
4255 * src/du.c (entry_hash): Likewise.
4256 * src/ls.c (dev_ino_hash): Likewise.
4257 * src/cut.c (hash_int): Likewise. Declare function as static.
4259 2003-10-21 Jim Meyering <jim@meyering.net>
4261 Don't fail when run with VERBOSE=yes.
4262 * tests/chgrp/basic: Do `set +x' before starting the subshell
4263 from which we invoke chgrp. Otherwise, the output from the
4264 VERBOSE=yes-induced `set -x' would result in spurious differences.
4265 Reported by Russel Coker via Michael Stone.
4267 2003-10-19 Jim Meyering <jim@meyering.net>
4269 chmod now uses fts to perform a directory traversal when -R is
4270 specified. Before, it operated on full path names, and as such
4271 would encounter the PATH_MAX (often 4096) limit.
4273 * src/chmod.c: Include "xfts.h".
4274 (process_file): Rename from change_file_mode.
4275 Adapt to be used with fts.
4276 (process_files): New function.
4278 2003-10-18 Jim Meyering <jim@meyering.net>
4280 * tests/du/deref-args: Ensure that du -D now dereferences all
4281 symlinks specified on the command line, not just those that
4282 reference directories.
4284 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
4285 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
4286 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
4287 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
4288 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
4289 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
4290 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
4291 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
4292 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
4293 Update the call to parse_long_options so that `AUTHORS, NULL' are the
4295 * src/true.c (main): Append NULL to version_etc argument list.
4296 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
4298 2003-10-17 Andreas Schwab <schwab@suse.de>
4300 * tests/mk-script: Get $srcdir from first parameter instead of
4302 (main): Update usage.
4304 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
4305 first argument of mk-script.
4306 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
4308 2003-10-17 Jim Meyering <jim@meyering.net>
4310 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
4311 generated `man' page is more readable. Suggestion from Dan Jacobson.
4313 * src/chown-core.c (change_file_owner): Handle the cases in
4314 which fts_info indicates an error with the given entry.
4316 * src/du.c (main): Simply assign to bit_flags.
4317 Don't bother with bit arithmetic.
4319 * tests/chmod/no-x: New file.
4320 * tests/chgrp/no-x: New file.
4321 * tests/chmod/Makefile.am (TESTS): Add no-x.
4322 * tests/chgrp/Makefile.am (TESTS): Likewise.
4324 * src/du.c: Include "xfts.h".
4325 (du_files): Use xfts_open, rather than fts_open.
4326 * src/chown-core.c (chown_files): Likewise.
4328 2003-10-16 Jim Meyering <jim@meyering.net>
4330 * src/chgrp.c (main): Simply assign to bit_flags.
4331 Don't bother with bit arithmetic.
4332 * src/chown.c (main): Likewise.
4333 Rename a couple of local variables.
4334 Remove unnecessary casts.
4336 * src/tail.c (start_bytes): Rename local, remainder, to avoid
4337 gcc's warning about shadowing a global.
4339 2003-10-15 Jim Meyering <jim@meyering.net>
4341 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
4342 use fts to perform a directory traversal when -R is specified.
4343 Before, they operated on full path names, and as such would
4344 encounter the PATH_MAX (often 4096) limit.
4345 They are more efficient. For example, before, chgrp -R would
4346 take almost 5 seconds to change about 2000 directories and fail
4347 (with `File name too long'), while now it succeeds on a hierarchy
4348 of depth 20,000 in 1/10 the time.
4350 * src/chown.c: Include "userspec.h" and "fts_.h".
4351 (WRITTEN_BY): Add my name.
4352 (getpwnam, getgrnam, getgrgid): Remove declarations.
4353 (endpwent): Remove definition.
4355 (main): Handle new options.
4356 Call new function, chown_files rather than change_file_owner.
4358 * src/chgrp.c: Include "fts_.h".
4359 (WRITTEN_BY): Add my name.
4360 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
4363 (main): Handle new options.
4364 Call new function, chown_files rather than change_file_owner.
4366 Rewrite to iterate through hierarchies using fts rather than
4367 via explicit recursion.
4368 * src/chown-core.c: Include "fts_.h"
4369 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
4370 on a single file at a time.
4371 (chown_files): New function.
4372 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
4373 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
4374 [struct Chown_option] (dereference): Remove member with ambiguous name.
4375 [struct Chown_option] (affect_symlink_referent): New member.
4376 (chown_files): New prototype.
4378 * tests/chgrp/recurse: Update tests accordingly.
4379 * tests/chgrp/posix-H: New tests for the above.
4380 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
4382 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
4383 work even for superuser. Suggestion from Dan Jacobson.
4385 2003-10-14 Paul Eggert <eggert@twinsun.com>
4387 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
4389 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
4390 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
4391 * src/sort.c (parse_field_count): Handle the case where overflow
4392 and invalid suffix char are both reported.
4394 2003-10-14 Jim Meyering <jim@meyering.net>
4396 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
4397 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
4400 2003-10-13 Paul Eggert <eggert@twinsun.com>
4402 Fix to avoid a denial-of-service attack if the display width is
4403 enormous. Also, clean up the code a bit by removing duplicate code.
4405 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
4406 (calculate_columns): New function, that contains code that used
4407 to be common to print_many_per_line and print_horizontal.
4408 (print_many_per_line, print_horizontal): Use it.
4409 (decode_switches): Set max_idx here, not in calculate_columns.
4410 (print_current_files): Don't call init_column_info; calculate_columns
4412 (init_column_info): Don't allocate a lot more space than is needed
4413 to represent the current set of files. Allocate all the new
4414 size_t cells in one call to xnmalloc, rather than a row at a time.
4416 2003-10-13 Jim Meyering <jim@meyering.net>
4418 * src/ls.c (init_column_info): Add another FIXME comment.
4420 2003-10-13 Paul Eggert <eggert@twinsun.com>
4422 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
4423 Remove several arbitrary limits on hosts where int cannot represent
4426 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
4427 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
4428 struct column_info.col_arr[0], max_idx):
4429 Now size_t, not int.
4430 (get_funky_string): Return bool indicating success, instead of
4431 a negative count to indicate failure. Store number of columns
4432 through new parameter OUTPUT_COUNT; that way, they can never
4433 go negative. Change equals_end from int to bool. All uses
4435 (struct column_info.valid_len): Now bool, not int. All uses changed.
4436 (dired_dump_obstack, get_funky_string, clear_files,
4437 extract_dirs_from_files, print_current_files,
4438 print_many_per_line, print_horizontal, init_column_info,
4439 put_indicator, length_of_file_name_and_frills,
4440 print_with_commas): Use size_t, not int, for local variables
4442 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
4443 Check for TIOCGWINSZ returing negative values (or values greater
4445 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
4447 Use xmalloc and xnmalloc, not XMALLOC.
4448 (gobble_file): Use xnrealloc, not XREALLOC.
4449 (print_color_indicator): Remove now-unnecessary cast to size_t.
4451 2003-10-12 Paul Eggert <eggert@twinsun.com>
4453 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
4454 * tests/sort/sort-tests: Remove from CVS; assume that people
4455 brave enough to check coreutils out from CVS can rebuild it.
4457 2003-10-12 Jim Meyering <jim@meyering.net>
4459 New options: --preserve-root and --no-preserve-root.
4460 * src/chmod.c (change_file_mode): Honor new option.
4461 (change_file_mode): Strip trailing slashes on directory
4462 argument passed to change_dir_mode.
4463 (get_root_dev_ino): New function.
4464 (main): Initialize global, root_dev_ino.
4466 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
4467 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
4469 * src/chmod.c (change_file_mode): Likewise.
4471 2003-10-08 Jim Meyering <jim@meyering.net>
4473 * src/csplit.c (main): Remove obsolete FIXME.
4475 2003-10-07 Jim Meyering <jim@meyering.net>
4477 * Use automake-1.7.8. Regenerate dependent files.
4479 2003-09-29 Paul Eggert <eggert@twinsun.com>
4483 * doc/coreutils.texi (csplit invocation):
4484 The regexp offset need not have a sign; POSIX requires support
4485 for signless offets.
4487 Be more careful about int widths. For example, remove some
4488 arbitrary limits by replacing 'unsigned' with 'size_t',
4489 'uintmax_t', etc. Use standard bool rather than a homegrown type.
4490 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4491 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
4492 to <stdbool.h> usage.
4493 (struct control): offset is now intmax_t, not int.
4494 repeat_forever is now bool, not int.
4495 (struct cstring): len is now size_t, not unsigned int.
4496 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
4497 size_t, not unsigned. start_line, first_available are now
4498 uintmax_t, not unsigned.
4499 (hold_count, control_used): Now size_t, not unsigned.
4500 (last_line_number, current_line, bytes_written):
4501 Now uintmax_t, not unsigned.
4502 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
4503 create_new_buffer, get_new_buffer, load_buffer, find_line,
4504 process_regexp, split_file, new_control_record, extract_regexp,
4505 get_format_width, get_format_prec, max_out):
4506 size args, locals, and returned values are now size_t, not unsigned
4508 (get_first_line_in_buffer, find_line, write_to_file,
4509 handle_line_error, process_line_count, regexp_error, process_regexp,
4511 File line, byte, and repetition counts are now uintmax_t, not unsigned.
4512 (check_for_offset): Don't require a sign before the offset.
4513 Use xstrtoimax to do the real work.
4514 (extract_regexp): Remove harmful cast of size to unsigned.
4515 256 -> 1<<CHAR_BIT, for clarity.
4516 (get_format_flags): Return at most 3, to avoid worries about overflow.
4518 (bytes_to_octal_digits): Remove.
4520 (cleanup): Don't check whether output_stream is NULL, since
4521 close_output_file does that for us.
4523 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
4524 (sizeof *p);" instead of the more long-winded alternatives.
4526 (get_new_buffer): Use O(1) algorithm for resizing a buffer
4527 to a much larger size, instead of an O(N) algorithm.
4529 (process_regexp): Use plain NULL rather than casted 0.
4531 (make_filename): Use %u, not %d, to format unsigned file number.
4533 (new_control_record): Use xrealloc exclusively, since it handles
4536 (extract_regexp): Change misspelled word in diagnostic.
4538 (get_format_width): Even if a minimum field width is specified,
4539 allow room for enough octal digits to represent the value of
4540 the maximum representible integer. This fixes a potential
4541 buffer overrun. Calculate this room at compile-time, not
4542 at run-time; this removes the need for bytes_to_octal_digits.
4543 Check for overflow; this removes a FIXME.
4545 (get_format_prec): Don't allow precision to be signed; it's
4546 not ANSI. Check for overflow. Remove hardcoded "11" as
4547 default precision; this fixes a potential buffer overrun
4548 on hosts with wider size_t.
4550 (get_format_conv_type): Change local variable to be of type
4551 unsigned char, not int; this removes a potential subscript
4552 violation on hosts where char is signed.
4554 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
4555 Allow "%%" in format. Don't overflow when
4556 counting lots of percents.
4558 (usage): Default sprintf format is %02u, not %d.
4560 2003-10-05 Jim Meyering <jim@meyering.net>
4562 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
4564 * src/du.c (du_files): Mark diagnostic for translation.
4566 2003-10-04 Jim Meyering <jim@meyering.net>
4568 * src/du.c (du_files): Ignore any failure of fts_close.
4569 Give better diagnostics for failed fts_open.
4571 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
4573 Deprecate existing use of -H (aka --si).
4574 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
4575 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
4576 (main): Warn that the meaning of -H will soon change to be
4579 2003-10-03 Jim Meyering <jim@meyering.net>
4581 * src/du.c: Accept --no-dereference (-P).
4583 2003-10-02 Jim Meyering <jim@meyering.net>
4585 * tests/du/trailing-slash: Adjust for slightly different output.
4587 Rewrite du.c to use fts.
4588 * src/du.c: Include "fts_.h", not ftw.h.
4589 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
4590 (IS_FTW_DIR_TYPE): Remove definition.
4591 (IS_DIR_TYPE): Define.
4592 (is_symlink_to_dir): Remove now-unnecessary function.
4593 (process_file, du_files): Rewrite to use fts.
4595 * tests/du/inaccessible-cwd: Ensure that even when run from an
4596 inaccessible directory, du can still operate on accessible
4597 directories elsewhere.
4598 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
4600 * tests/rm/deep-1: Ensure that du can process a hierarchy
4601 of depth 400 while using no more than 50KB of stack space.
4603 2003-10-01 Akim Demaille <akim@epita.fr>
4605 * announce-gen (print_news_deltas): New function, extracted from main.
4606 (main): Make `news_file' an array.
4607 Use '...=s' => \@var for --news and --url-directory specs.
4608 Before there were a couple of portability problems.
4610 2003-09-28 Jim Meyering <jim@meyering.net>
4612 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
4613 (syntax-check-rules): Add it.
4615 * src/copy.c: Remove unnecessary cast of alloca, since now it's
4616 guaranteed to be (void *).
4617 * src/cp.c: Likewise.
4618 * src/join.c: Likewise.
4619 * src/ln.c: Likewise.
4620 * src/ls.c: Likewise.
4621 * src/od.c: Likewise.
4622 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
4624 2003-09-27 Jim Meyering <jim@meyering.net>
4626 Don't exhaust virtual memory when processing large inputs.
4627 Fix this by removing csplit's internal free-list management;
4628 instead rely on malloc for that.
4630 * src/csplit.c (free_list): Remove global.
4631 (clear_all_line_control): Remove function.
4632 (get_new_buffer): Always use create_new_buffer to obtain a
4633 new buffer, rather than searching free_list.
4634 (free_buffer): Just call free.
4635 Reported by Nikola Milutinovic.
4637 2003-09-26 Jim Meyering <jim@meyering.net>
4639 * man/rm.x: Also list `chattr' in SEE ALSO section.
4640 Suggestion from Mark Hubbart.
4642 2003-09-25 Jim Meyering <jim@meyering.net>
4644 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
4645 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
4647 * Use autoconf-2.57d. Regenerate dependent files.
4649 2003-09-24 Jim Meyering <jim@meyering.net>
4651 Minor efficiency tweak.
4652 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
4653 (do_link): Likewise.
4655 2003-09-23 Jim Meyering <jim@meyering.net>
4657 * src/paste.c (paste_serial): Save errno after input error,
4658 to report proper errno value.
4659 Based on a patch from Paul Eggert.
4661 * src/tee.c (tee): Adjust fwrite arguments so that the return
4662 value is the number of bytes written.
4664 2003-09-16 Paul Eggert <eggert@twinsun.com>
4666 Don't assume ferror sets errno. Bug reported by Bruno Haible.
4668 * src/comm.c (compare_files): Save errno after input error,
4669 to report proper errno value.
4670 * src/fold.c (fold_file): Likewise.
4671 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
4672 * src/unexpand.c (unexpand): Likewise.
4674 * src/csplit.c (close_output_file): Don't report bogus errno value
4675 after ferror discovers an output error. We don't know the proper
4676 errno value, since it might have been caused by any of a whole
4677 bunch of calls, and it might have been trashed in the meantime.
4678 Fixing this problem will require much more extensive changes;
4679 in the meantime just say "write error".
4680 * src/od.c (check_and_close, dump, dump_strings): Likewise.
4681 * src/uniq.c (check_file): Likewise.
4683 * src/join.c (get_line): Report error right away if I/O fails,
4684 so that the proper errno value is used.
4685 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
4686 * src/tee.c (tee): Likewise.
4687 * src/uniq.c (check_file): Likewise.
4689 * src/od.c (skip): If a read fails, don't retry it later, so
4690 that we report the proper errno.
4692 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
4694 * src/tee.c (tee): Once a write failure has occurred, don't bother
4695 writing anything more to that stream.
4697 * src/uniq.c (check_file): Check for ferror (stdout) even if
4700 * src/yes.c (UNROLL): Remove.
4701 (main): Exit immediately when write failure is detected.
4702 Simplify code by assigning to argv when argc == 1.
4704 2003-09-21 Paul Eggert <eggert@twinsun.com>
4706 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
4707 (WRITTEN_BY): Change "Franc,ois" (actually using
4708 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
4711 2003-09-19 Jim Meyering <jim@meyering.net>
4713 `du -D symlink-to-dir' would mistakenly omit the slash in
4714 lines like this: 24 symlink-to-dir/subdir
4715 * src/du.c (process_file): Fix offset calculation.
4716 Reported by Jeff Sheinberg as Debian bug #211591;
4717 http://bugs.debian.org/205251
4719 * tests/du/deref-args: New file/test for the above.
4720 * tests/du/Makefile.am (TESTS): Add deref-args.
4722 * src/du.c (process_file): Remove useless disjunct.
4724 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
4726 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
4727 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
4728 Mark each WRITTEN_BY string as translatable.
4730 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
4731 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
4732 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
4733 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
4734 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
4735 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
4736 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
4737 * who.c, whoami.c, yes.c: Revert yesterday's changes.
4738 Instead, a subsequent change will embed `Written by ' in
4739 each string along with the author names.
4741 * src/true.c: Revert yesterday's changes.
4742 * src/sys2.h: Likewise.
4744 2003-09-18 Jim Meyering <jim@meyering.net>
4746 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
4747 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
4748 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
4749 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
4750 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
4751 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
4752 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
4753 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
4754 comma-separated list of strings and/or update the call to
4755 parse_long_options so that `AUTHORS, NULL' are the last parameters.
4756 * src/true.c (main): Append NULL to version_etc argument list.
4757 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
4759 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
4760 shadowing the math function name. Also rename loga to log_a.
4762 2003-09-14 Jim Meyering <jim@meyering.net>
4764 * src/factor.c (print_factors): Give a separate diagnostic
4765 for numbers that are too large, but otherwise valid.
4766 Reported by Dániel Varga.
4768 2003-09-10 Jim Meyering <jim@meyering.net>
4770 * Use automake-1.7.7. Regenerate dependent files.
4772 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
4773 of `fmt -1'. Using the just-built tr is a little cleaner.
4774 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
4775 * man/Makefile.am (programs, check-x-vs-1): Likewise.
4777 2003-09-09 Jim Meyering <jim@meyering.net>
4779 * src/copy.c: Alphabetize includes.
4780 Remove duplicate inclusion of "same.h".
4782 2003-09-08 Jim Meyering <jim@meyering.net>
4784 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
4785 Didn't give enough of a benefit, mainly because it's not yet
4790 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
4791 (check-programs-vs-x): Fail if $(programs) is empty.
4793 * src/remove.c: Add a comment.
4795 2003-09-07 Jim Meyering <jim@meyering.net>
4797 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
4798 Don't define. These symbols are no longer used.
4800 * tests/misc/tty-eof: Write ^D as \cD.
4801 Complete the change of 2003-08-02.
4803 * Makefile.maint (po-check): Use cvsu, so that a temporary source
4804 file in lib/ or src/ doesn't induce an unwarranted failure.
4805 Add a kludge to filter out the sole generated source file that
4806 also has translatable messages: src/false.c.
4808 2003-09-06 Jim Meyering <jim@meyering.net>
4810 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
4811 (parse_options): Give a diagnostic for (but still accept) the
4812 deprecated --allow-missing option.
4814 2003-09-04 Paul Eggert <eggert@twinsun.com>
4816 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
4817 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
4819 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
4820 size_bound ourselves. if an input file is a pipe and the user
4821 specified a size, use that size instead of trying to guess the
4822 pipe size. This has the beneficial side effect of avoiding the
4823 overhead of default_sort_size in that case. All callers changed.
4824 (sort): Remove static var size; now done by sort_buffer_size.
4826 2003-09-05 Jim Meyering <jim@meyering.net>
4828 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
4830 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
4831 to start, rather than just .1. Upon failure, print unexpected state.
4833 2003-09-04 Paul Eggert <eggert@twinsun.com>
4835 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
4836 SAFE_READ_ERROR to tmp->nbytes.
4837 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
4839 * src/head.c (struct linebuffer): Change nbytes and nlines
4840 from unsigned int to size_t. unsigned int is safe (after the
4841 2003-09-03 patch) but size_t is cleaner.
4842 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
4843 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
4845 Standardize on BUFSIZ as opposed to other macro names and values.
4846 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
4847 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
4848 stdio.h has always defined it,
4849 and other code already assumes it's defined.
4850 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
4851 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
4852 (io_buf): IO_BUF_SIZE -> BUFSIZ.
4854 2003-09-04 Paul Eggert <eggert@twinsun.com>
4856 * src/seq.c (step): Default to 1.
4857 (print_numbers): Allow the output to be empty.
4858 (main): The default step is 1, even if LAST < FIRST;
4859 as per documentation.
4860 * tests/seq/basic (onearg-2): Output should be empty.
4862 2003-09-05 Jim Meyering <jim@meyering.net>
4864 * Makefile.cfg (wget_files): Temporarily disable, until master
4865 versions are restored to ftp.gnu.org.
4867 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
4869 Make seq's --width (-w) option work properly even when the
4870 endpoint requiring the larger width is negative and smaller than
4872 * src/seq.c (get_width_format): Include `-' in the set of bytes
4873 allowed in a `simple' number (no decimal point, no exponent).
4874 Reported by Patrick Mauritz.
4876 2003-09-02 Paul Eggert <eggert@twinsun.com>
4878 * NEWS: sort -t '\0' now uses a NUL tab.
4879 sort option order no longer matters, unless POSIX requires it.
4880 * src/sort.c (usage): Say "blanks" instead of "whitespace",
4881 Similar fixes for many comments.
4882 (TAB_DEFAULT): New constant, so that we can support NUL as
4883 the field separator.
4884 (tab): Now int, not char. Initialize to TAB_DEFAULT.
4885 (specify_sort_size): If multiple sizes are specified, use the largest.
4886 (begfield, limfield): Support NUL tab char.
4887 (set_ordering): Do not let -i override -d.
4888 (main): Report an error if incompatible -o or -t options are given.
4889 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
4891 2003-09-05 Jim Meyering <jim@meyering.net>
4893 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
4895 2003-09-03 Andreas Schwab <schwab@suse.de>
4897 Bug report and patch here:
4898 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
4899 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
4900 * src/head.c (elide_tail_lines_pipe): Likewise.
4902 2003-09-03 Jim Meyering <jim@meyering.net>
4904 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
4905 small amount of code from him was first moved to lib/human.c, and was
4906 subsequently rewritten entirely.
4907 * src/df.c (AUTHORS): Likewise.
4909 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
4911 * src/md5sum.c (split_3): Accept the BSD format for generic
4912 message digest modes. Currently works with BSD's MD5 and SHA1
4913 formats since these are the two algorithms presently used in
4914 coreutils. Updated comments to reflect this change.
4915 (bsd_split_3): Updated comments.
4917 * tests/md5sum/basic-1: New test to make sure that
4918 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
4919 from `check-bsd' test in tests/sha1sum/basic-1).
4921 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
4922 --check exit status and BSD SHA1 format (adapted from tests
4923 in tests/md5sum/basic-1).
4925 2003-08-30 Jim Meyering <jim@meyering.net>
4927 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
4929 When source and destination arguments refer to the same file, reside
4930 on a partition (e.g. VFAT) on which distinct names may refer to the
4931 same directory entry (often due to variations in case), and when the
4932 link count for the file is 1, mv no longer unlinks the file. Instead,
4933 it gives the expected diagnostic that the source and destination are
4934 the same. WARNING: this is an incomplete fix. If the file happens
4935 to have a link count of 2 or greater, such an erroneous mv command
4936 will still unlink it.
4937 Although that is not possible on vfat or umsdos, it is possible on
4938 other file system types, e.g., ntfs, and hpfs.
4939 * src/copy.c (same_file_ok): Invoke same_name (which might still
4940 return false for names that refer to the same directory entry)
4941 only if the link count is 2 or more.
4942 * tests/mv/vfat: Show how to demonstrate the above problem.
4943 This test is not run.
4944 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
4946 2003-08-27 Jim Meyering <jim@meyering.net>
4948 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
4949 who's -l option has been eliciting an unconditional warning about
4950 this impending change since sh-utils-2.0.12 (April 2002).
4952 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
4953 This would happen for nonempty files not ending with a newline.
4954 Reported by Dan Jacobson.
4955 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
4956 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
4958 * src/stat.c (print_it): Avoid buffer overrun that would
4959 occur when the user-specified format string ends with `%'.
4960 Patch by Tommi Kyntola.
4961 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
4962 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
4964 2003-08-26 Jim Meyering <jim@meyering.net>
4966 Apply changes from bison.
4967 * GNUmakefile (SHELL): Define to `sh', if necessary.
4969 * Makefile.maint (WGETFLAGS): Define to `-C off'.
4970 Update all uses of $(WGET).
4972 2003-08-22 Akim Demaille <akim@epita.fr>
4974 * Makefile.cfg (local-checks-to-skip): New.
4975 * Makefile.maint (local-check): Rename as...
4976 (local-checks-available): this.
4979 2003-08-26 Akim Demaille <akim@epita.fr>
4981 * announce-gen (print_changelog_deltas): Neutralize "<#" as
4982 "<\#" to avoid magic from Gnus when posting parts of this script.
4984 2003-08-25 Jim Meyering <jim@meyering.net>
4986 * src/stat.c (main): Warn about use of deprecated `-l' option.
4988 2003-08-22 Jim Meyering <jim@meyering.net>
4990 * src/stat.c (do_stat): For link count at end of line, use %h format,
4991 instead of %-5h. The latter would make stat emit trailing spaces.
4992 Reported by Dan Jacobson.
4994 2003-08-20 Jim Meyering <jim@meyering.net>
4996 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
4998 2003-08-19 Jim Meyering <jim@meyering.net>
5000 * src/system.h: Include stdlib.h unconditionally,
5001 as we're now assuming that part of hosted C89.
5003 2003-08-18 Jim Meyering <jim@meyering.net>
5005 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
5006 to avoid warnings from gcc.
5008 2003-08-17 Jim Meyering <jim@meyering.net>
5010 Avoid unnecessary and sometimes time-consuming hostname lookups.
5011 * src/who.c (print_user): Use strchr, not strrchr.
5012 * src/pinky.c (print_entry): Likewise.
5013 Patch by Michael Stone.
5014 This fixes a typo I introduced in who-users.c on 1996-02-23.
5016 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
5017 disallowed between `@...@'.
5019 2003-08-16 Paul Eggert <eggert@twinsun.com>
5021 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
5022 done by gnulib .m4 files.
5023 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
5024 * src/sys2.h (strtoull): Remove unused declaration.
5026 2003-08-16 Jim Meyering <jim@meyering.net>
5028 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
5031 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
5032 race condition bug. The bug would be triggered when tailing a file
5033 with file pointer not at beginning of file, and where the file was
5034 truncated to have a length of less than the initial offset at just
5035 the right moment (between the two lseek calls in this function).
5037 An invalid initial value for *read_pos would result in
5038 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
5039 busy-wait rather than sleeping between iterations. The bug manifests
5040 itself only when tailing regular files that are initially nonempty.
5041 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
5043 (tail_lines): Likewise, after lseek calls.
5044 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
5045 * tests/tail-2/tail-n0f: New file. Test for above fix.
5046 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
5048 2003-08-15 Jim Meyering <jim@meyering.net>
5050 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
5051 (sc_sun_os_names): Likewise.
5052 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
5054 * man/help2man: Remove some SPACEs before TAB.
5056 2003-08-14 Paul Eggert <eggert@twinsun.com>
5058 * Makefile.maint (LC_ALL): Set to C.
5059 * man/Makefile.am (ASSORT): New var.
5060 (check-x-vs-1, programs): Use it.
5061 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
5062 * tests/Makefile.am (ASSORT, all_programs): Likewise.
5064 2003-08-11 Jim Meyering <jim@meyering.net>
5066 fold -s -wN would infloop for N < 8 with TABs in the input.
5067 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
5068 * src/fold.c (fold_file): Move contents of `else'-block
5069 out of conditional so it's used also for --spaces (-s).
5070 * tests/misc/fold: Test for the above fix.
5071 * tests/misc/Makefile.am (TESTS): Add fold.
5073 2003-08-10 Jim Meyering <jim@meyering.net>
5075 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
5076 system.h so the types from time.h and sys/time.h are available.
5077 It appears that this is necessary for OpenBSD, NetBSD, and
5078 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
5080 2003-08-06 Paul Eggert <eggert@twinsun.com>
5082 * NEWS: Add support for setting file timestamps to microsecond
5083 resolution, on hosts that support this.
5084 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
5085 * src/copy.c (copy_internal):
5086 Set file timestamps with utimens, not utime.
5087 * src/cp.c (re_protect): Likewise.
5088 * src/install.c (change_timestamps): Likewise.
5089 * src/touch.c (newtime, touch, main): Likewise.
5091 2003-08-09 Jim Meyering <jim@meyering.net>
5093 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
5095 (syntax-check-rules): Add it.
5097 * src/tail.c (main): Tweak Solaris OS version number in comment.
5098 * src/wc.c (wc): Likewise
5099 * tests/tail-2/fflush: Likewise.
5101 * src/tail.c: Add new undocumented option, --presume-input-pipe.
5102 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
5104 2003-08-08 Paul Eggert <eggert@twinsun.com>
5106 Use new gnulib 'extensions' module.
5107 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
5110 2003-08-08 Paul Eggert <eggert@twinsun.com>
5112 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
5114 2003-08-09 Jim Meyering <jim@meyering.net>
5116 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
5117 For tests of obsolete behavior, don't presume that unsetting
5118 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
5120 2003-08-07 Paul Eggert <eggert@twinsun.com>
5122 * doc/coreutils.texi (split invocation):
5123 Add -d or --numeric-suffixes option to 'split'.
5124 From a suggestion by Jesse Kornblum.
5125 * src/split.c (suffix_alphabet): New var.
5126 (longopts, usage, next_file_name, main): Support -d.
5127 (next_file_name, main): Allow -a0, as POSIX requires.
5128 (next_file_name): Don't assume ASCII-like encoding;
5129 'a' through 'z' are not contiguous in EBCDIC.
5131 2003-08-05 Paul Eggert <eggert@twinsun.com>
5133 Merge getline from gnulib.
5134 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
5135 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
5136 New files, from gnulib.
5137 * lib/getdelim2.c, lib/getdelim2.h: Remove.
5138 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
5139 getdelim2.h to getndelim2.c and getndelim2.h.
5140 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
5141 checking for getdelim.
5142 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
5143 than rolling our own.
5144 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
5145 (cut_fields): Invoke getndelim2 rather than getdelim2.
5147 2003-08-04 Jim Meyering <jim@meyering.net>
5149 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
5150 and for the indices to iterate through nsigs.
5152 2003-08-02 Paul Eggert <eggert@twinsun.com>
5154 * src/sort.c: Minor code cleanups, mostly to use more accurate
5155 types and to remove unnecessary casts.
5156 (min, max): Remove. All uses changed to MIN and MAX.
5157 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
5158 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
5159 keyfield.numeric, struct keyfield.general_numeric, struct
5160 keyfield.month, struct keyfield.reverse, reverse, unique,
5161 have_read_stdin): Now bool, not int. All uses changed.
5162 (eolchar): Now char, not int.
5163 (struct keyfield.ignore): Now bool const *, not int *.
5164 (struct keyfield.translate): Now char const *, not char *.
5165 (struct month.name): Likewise.
5166 (blanks, nonprinting, nondictionary): Now bool[], not int[].
5167 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
5168 check, sort, main): Use const * pointers when possible.
5169 (month_cmp): Rewrite to avoid casts.
5170 (inittables): Initialize tables unconditionally, to avoid branches.
5171 (fillbuf): Return bool, not int. All uses changed.
5172 (fillbuf, keycompare, new_key, main):
5173 Use SIZE_MAX rather than (size_t) -1.
5174 (trailing_blanks): Renamed from trim_trailing_blanks.
5175 Return the number of blanks to trim. All uses changed.
5176 (getmonth): Use trailing_blanks rather than open code.
5177 (keycompare): Do not cast char * to unsigned char *; not needed.
5178 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
5180 (compare, main): Use | rather than || to avoid jumps.
5181 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
5183 (check, first_same_file, sort, main):
5184 Use bool instead of int local vars when possible.
5185 (check): Merge the old 'checkfp' and 'check' into a single function,
5186 that returns a boolean (true if the file was ordered).
5188 (main): Use int instead of unsigned for iterating through nsigs.
5189 Rename local var "posix_pedantic" to "posixly_correct".
5191 2003-08-02 Jim Meyering <jim@meyering.net>
5193 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
5194 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
5196 * src/cut.c (cut_fields): Don't read again after encountering an
5197 initial EOF. E.g., `cut -f2' would do so.
5198 * tests/misc/tty-eof: Add a test for the above fix.
5200 * src/sort.c (sortlines): Add description and references.
5203 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
5204 the tests in help-version will use the just-built binaries.
5205 Reported by Christian Krackowizer.
5207 2003-07-31 Paul Eggert <eggert@twinsun.com>
5209 * NEWS: Add --rfc-2822 option to GNU date.
5210 * doc/coreutils.texi (Time directives, Options for date, Examples
5212 * src/date.c (long_options, usage, main): Likewise.
5213 * doc/getdate.texi (General date syntax): Likewise.
5214 * doc/coreutils.texi (Options for date): Fix a typo in format:
5215 it's now %d not %_d. Add URLs.
5217 2003-08-01 Jim Meyering <jim@meyering.net>
5219 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
5220 Otherwise, with at least the /bin/sh from HPUX 10.20,
5221 the trap code would end up converting that to exit 1 and thus an
5222 unexpected test failure. Reported by Christian Krackowizer.
5224 2003-07-31 Paul Eggert <eggert@twinsun.com>
5226 * src/ptx.c: Do not include bumpalloc.h.
5227 (WORD_TABLE): New member alloc.
5228 (ALLOC_NEW_WORD): Remove.
5229 (occurs_alloc): New var.
5230 (digest_word_file, find_occurs_in_text): Check for arithmetic
5231 overflow when computing table size. Use xrealloc rather than
5232 bumpalloc primitives.
5234 2003-07-29 Jim Meyering <jim@meyering.net>
5238 * README: When running tests as root, suggest using
5239 sudo with NON_ROOT_USERNAME=$USER.
5241 * tests/Makefile.am (all_programs): Makefile is in ../src, not
5244 2003-07-28 Jim Meyering <jim@meyering.net>
5246 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
5248 2003-07-28 Paul Eggert <eggert@twinsun.com>
5250 * lib/stdbool.hin (_Bool): Make it signed char, instead of
5251 an enum type, so that it's guaranteed to promote to int.
5252 * src/sort.c (sortlines_temp): Undo previous change.
5254 2003-07-28 Jim Meyering <jim@meyering.net>
5256 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
5257 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
5258 would cause lines[-1 - swap] (with swap = false) to evaluate to
5261 2003-07-27 Jim Meyering <jim@meyering.net>
5263 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
5264 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
5266 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
5267 directories, as required by POSIX. Reported by Karl Berry.
5268 * tests/rm/dir-no-w: New file. Test for the above fix.
5269 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
5271 * tests/mk-script: Emit `$xx', not its expansion.
5273 2003-07-27 Paul Eggert <eggert@twinsun.com>
5275 This change was inspired by a similar proposal by Stepan Kasal.
5276 * src/sort.c (mergelines, sortlines_temp): New functions.
5277 (sortlines): Use them, to reduce the number of times that
5278 we need to copy 'struct line' values. This improved CPU
5279 performance by about 30% on one 18 MB test.
5280 (sort): Don't invoke sortlines unless we have 2 or more lines.
5282 2003-07-26 Stepan Kasal <kasal@ucw.cz>
5284 * src/sort.c (sort): Don't require two `struct line's per text line,
5285 the new sort algorithm requires just 1.5.
5287 2003-07-27 Jim Meyering <jim@meyering.net>
5289 * src/pathchk.c (validate_path): Use %lu, not %ld.
5291 * src/cut.c (is_printable_field): Simplify bit arithmetic.
5293 * src/ls.c (sort_files): Put `volatile' in the right place.
5296 2003-07-26 Jim Meyering <jim@meyering.net>
5298 Use only one bit per field/offset in array, not one `int'.
5299 * src/cut.c (printable_field): Change type to `unsigned char'.
5300 (mark_printable_field, is_printable_field): New functions.
5301 Use them in place of all direct accesses of `printable_field'.
5303 * src/expand.c (parse_tabstops): Detect overflow properly.
5304 * src/cut.c (set_fields): Likewise.
5306 * src/rm.c: Include "dirname.h".
5307 (usage): Use base_name (program_name) in body of --help output.
5309 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
5310 Idea from Brendan O'Dea, who suggested using
5311 `program_name = basename (argv[0]);' everywhere --
5312 can't do that, but using base_name works just fine here.
5314 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
5316 2003-07-24 Paul Eggert <eggert@twinsun.com>
5318 Fix some POSIX-compliance problems with 'test'. This makes
5319 'test' more compatible with Bash.
5321 * NEWS, doc/coreutils.texi: Document the following.
5322 * src/test.c: Include exitfail.h.
5323 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
5324 (test-syntax_error): Use it.
5325 (binary_operator): Now takes bool arg specifying whether left operand
5326 is -l ARG, so that caller determines this rather than us.
5328 (term): Use posixtest to evaluate parenthesized subexpressions.
5329 (unary_operator, one_argument): Remove support for -t without operand.
5330 (one_argument): Take argument from argv[pos].
5331 (one_argument, two_arguments, three_arguments): Advance pos.
5332 All callers changed.
5333 (three_arguments): Look for binary ops before "!". Then look
5334 for parenthesized one_argument expressions, instead of trusting
5335 expr () to do the right thing.
5336 (posixtest): Now takes number of args. All callers changed.
5337 Treat "( A B )" like "A B".
5338 (main): Set exit_failure to TEST_FAILURE. Don't depend on
5339 POSIXLY_CORRECT, as we now conform to POSIX by default.
5340 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
5341 * tests/test/Test.pm (test_vector): Add several tests to check
5342 the above. Syntax errors now exit with status 2, not 1.
5343 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
5345 2003-07-26 Jim Meyering <jim@meyering.net>
5347 * tests/help-version: Adjust for above change in test behavior:
5348 `[' exits with 2, not 1, and test doesn't accept --help or --version.
5350 * Makefile.maint (ME): Don't use trick suggested in Make manual.
5351 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
5353 * Makefile.maint (sc_system_h_headers): Another syntax check.
5354 (syntax-check-rules): Add it to the list.
5356 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
5357 so it matches `%ld' format even on 32-bit systems.
5359 * src/fmt.c (flush_paragraph): Cast field width to `int' to
5360 avoid warning on 64-bit systems.
5362 * src/ls.c (sort_files): Make `func' volatile, so it can't be
5363 clobbered by a `longjmp' into this function.
5365 2003-07-25 Jim Meyering <jim@meyering.net>
5367 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
5370 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
5371 because it'd evoke spurious failure on 64-bit systems.
5373 2003-07-24 Jim Meyering <jim@meyering.net>
5375 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
5376 output its current record counts. Reported by Jurriaan.
5378 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
5379 `wc' with no options. This goes along with the change of 2003-07-20.
5381 2003-07-23 Jim Meyering <jim@meyering.net>
5383 Don't include headers already included by system.h:
5384 * src/tr.c: Don't include errno.h.
5385 * src/true.c: Don't include version-etc.h.
5386 * src/test.c: Don't include limits.h or error.h.
5387 * src/stat.c: Don't include unistd.h or time.h.
5388 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
5389 * src/pr.c: Don't include time.h.
5390 * src/pathchk.c: Don't include errno.h.
5391 * src/nice.c: Don't include sys/time.h.
5392 * src/ls.c: Don't include stdlib.h.
5394 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
5395 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
5396 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
5397 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
5398 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
5399 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
5400 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
5401 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
5402 Don't include closeout.h.
5404 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
5405 can access the required version of rm.
5406 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
5408 * tests/cut/Test.pm (out-delim3a): New test.
5410 * man/help2man: Update to version 1.33.
5412 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
5414 * src/dircolors.c: Include xstrndup.h.
5415 (xstrndup): Remove function, now that it's been factored out into
5418 2003-07-22 Paul Eggert <eggert@twinsun.com>
5420 * src/wc.c (wc): Fix typo in computation of file from file_x,
5421 which caused the former to be used uninitialized if file_x was
5424 2003-07-22 Jim Meyering <jim@meyering.net>
5426 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
5428 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
5429 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
5430 Thomas Luzat. See http://bugs.debian.org/202413 for details.
5432 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
5434 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
5436 * src/cut.c (set_fields): Mark all selected indices before trying to
5437 determine range endpoints.
5438 * tests/cut/Test.pm: New test for the above fix.
5440 Begin to address this comment: What if someone wants to
5441 extract the 1,000,000-th field of some huge input file?
5442 The first step is to rearrange things so that the values
5443 in the printable_field array are all 0/1 rather than 0/1/2.
5444 * src/cut.c (RANGE_START_SENTINEL): Remove.
5445 Store range-start indices in a hash table, rather than
5446 overloading the `printable_field' array.
5447 (range_start_ht): New global.
5448 (hash_int, hash_compare_ints, is_range_start_index): New functions.
5449 (print_kth): Use is_range_start_index; don't test printable_field.
5450 (set_fields): Detect overflow.
5451 (set_fields): Insert each range-start index into range_start_ht.
5452 (main): Call set_fields only once, and only after
5453 output_delimiter_specified and (if required) range_start_ht have
5456 2003-07-20 Paul Eggert <eggert@twinsun.com>
5458 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
5459 invoked with a null pointer when there were no file arguments.
5461 2003-07-20 Jim Meyering <jim@meyering.net>
5463 * Makefile.maint (sc_changelog): Add another nit-picky check.
5465 * src/wc.c (write_counts): Add a comment.
5466 (wc): Rename `file' parameter.
5467 Set new local, `file', to be the file name, or (when it's NULL)
5468 _("standard output") so that all uses of `file' use the proper value.
5469 Use STREQ, not strcmp.
5471 2003-07-20 Paul Eggert <eggert@twinsun.com>
5473 wc count field widths now are heuristically adjusted depending
5474 on the input size, if known. If only one count is printed, it
5475 is guaranteed to be printed without leading spaces.
5477 Previously, wc did not align the count fields if
5478 POSIXLY_CORRECT was set, but POSIX did not actually require
5479 this undesirable behavior, so it has been removed.
5481 * NEWS: Document this.
5482 * doc/coreutils.texi (wc invocation): Likewise.
5484 * src/wc.c (number_width): New var.
5485 (posixly_correct): Remove.
5486 (struct fstatus): New struct.
5487 (write_counts): Output fields of width number_width.
5488 Do not worry about POSIXLY_CORRECT.
5489 Use null file, not empty-string file, to denote stdin,
5490 since "" is a valid file name on some hosts.
5491 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
5493 (wc): Avoid problems if end_pos - current_pos overflows.
5494 Do not print odd message if stdin has a read error.
5495 (get_input_fstatus, compute_number_width): New functions.
5496 (main): Use them to implement the new behavior.
5497 Ignore POSIXLY_CORRECT.
5499 * tests/wc/Test.pm: Adjust to the new output widths.
5501 2003-07-19 Jim Meyering <jim@meyering.net>
5503 * tests/rm/fail-eperm: Don't create temporary directory --
5506 * tests/shred/remove: Don't open-code test for UID != 0.
5507 Use priv-check's require-non-root instead.
5508 Update to use newer framework.
5510 * tests/help-version (expected_failure_status_expr): Record that
5511 expr exits with status of 3 for e.g., a write error.
5513 * tests/priv-check: Use `id -u' to see if we're running as root,
5514 rather than trying go write to an write-protected file.
5515 When running as root, ensure $NON_ROOT_USERNAME is valid.
5516 When running as root with `require-non-root', ensure that `.'
5517 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
5518 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
5520 * src/printenv.c: Include "exitfail.h".
5521 (main): Set exit_failure rather than calling close_stdout_set_status.
5522 * src/date.c: Likewise.
5523 * src/sort.c: Likewise.
5524 * src/tty.c: Likewise.
5526 2003-07-18 Jim Meyering <jim@meyering.net>
5528 * tests/touch/not-owner: Update to use newer framework.
5530 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
5531 directory, and remove Perl-coded `you may not run as root' test.
5532 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
5533 hard-coding something not quite equivalent.
5534 Paul Jarc reported the inconsistent diagnostics.
5536 * src/sort.c (main): Use close_stdout via atexit.
5537 Now `sort --version' and `sort --help' fail, as they should
5538 when their output is redirected to /dev/full.
5540 * src/su.c (usage): Don't call close_stdout here.
5541 (main): Use close_stdout via atexit.
5542 Now `su --version > /dev/full' fails, as it should.
5543 Somehow, the change of 2000-05-07 that purports to fix this
5546 * tests/help-version (--help/--version vs. /dev/full): Special-case
5547 `[' to protect it from expected_failure_status-`eval'.
5549 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
5550 count and the corresponding line, as required by POSIX.
5551 Reported by Clement Wang.
5552 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
5554 * tests/expr/basic: Add tests for when exit status is 2.
5556 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
5557 Use an anonymous `enum', rather than #define.
5559 2003-07-17 Paul Eggert <eggert@twinsun.com>
5561 * src/expr.c: Include "exitfail.h", "quotearg.h".
5562 (EXPR_INVALID, EXPR_ERROR): New constants.
5563 (nomoreargs, null, toarith, nextarg): Return bool, not int.
5564 (syntax_error): New function, exiting with status 2. Use it
5565 insteading of printing "syntax error" ourselves.
5566 (main): Initialize exit_failure to EXPR_ERROR.
5567 Exit with EXPR_INVALID on syntax error (too few arguments).
5568 (nextarg): Use strcmp, not strcoll; strcoll might return
5569 an undesirable 0, or might fail.
5570 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
5571 or other such error.
5572 (eval2): Report an error if strcoll fails in a string comparison.
5573 * src/sort.c: Include "exitfail.h".
5574 (main): Set exit_failure, not xalloc_exit_failure and
5575 xmemcoll_exit_failure.
5576 * tests/expr/basic: Invalid value exits with status 3, not 2.
5578 2003-07-16 Jim Meyering <jim@meyering.net>
5580 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
5581 per GNU maintainer guidelines. The next non-beta release will be 5.1.
5583 This script would have caught at least two recent bugs:
5584 those in [ and kill.
5585 * tests/help-version: Revive this script.
5586 It wasn't doing anything useful, since $all_programs wasn't being
5587 defined by the invoking Makefile.am.
5588 Reflect that nohup is no longer a script, so don't exclude it.
5589 Add framework to handle the programs added since it was last run:
5590 kill, stat, unlink, [, link, readlink.
5591 Fix path-related problems deriving from the move of this script
5592 from src/ to its present location.
5593 * tests/Makefile.am (all_programs): Define.
5594 (TESTS_ENVIRONMENT): Use it.
5596 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
5597 whereby kill would always attempt to operate on argv[0] and fail.
5599 * src/test.c (integer_expected_error): Improve diagnostic -- now,
5600 it also matches the one from bash's builtin test.
5601 (binary_operator): Add \n at end of diagnostic.
5603 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
5604 * tests/priv-check: Move setuidgid-related and
5605 NON_ROOT_USERNAME-checking code to this file.
5607 * README: Update section on testing as `root'.
5608 Suggestion from Paul Jarc.
5610 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
5611 names of authors that I just found in bash's builtins/test.def.
5613 Running `[' with no arguments would evoke a segfault.
5614 * src/test.c (main) [LBRACKET]: Move initialization of argv to
5615 precede potential use via test_syntax_error.
5617 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
5618 warning from automake -Wall.
5620 2003-07-15 Jim Meyering <jim@meyering.net>
5624 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
5627 * announce-gen (print_changelog_deltas): Relax tests for matching
5628 version-number line in NEWS.
5629 Change the .sig suffix to .asc here, too.
5631 2003-07-14 Jim Meyering <jim@meyering.net>
5633 * Makefile.maint (%.asc): Renamed from %.sig.
5634 Generate and use ascii-armored signatures.
5635 Use gpg's -o option.
5637 2003-07-13 Jim Meyering <jim@meyering.net>
5639 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
5642 * Makefile.maint (syntax-check): Move each individual check into
5644 (syntax-check-rules): This is the list of syntax-check targets.
5645 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
5646 (sc_cast_of_x_alloc_return_value, sc_space_tab):
5647 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
5649 2003-07-12 Jim Meyering <jim@meyering.net>
5651 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
5652 traces of the nohup script.
5654 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
5655 $(OPTIONAL_BIN_ZCRIPTS).
5657 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
5658 target, not before the `>'.
5660 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
5661 now that that function no longer calls `error'.
5663 * src/df.c (find_mount_point): Emit a diagnostic for each
5664 failed syscall, rather than relying on caller to do that.
5665 The caller couldn't do a good job, anyhow -- too many different
5666 ways to fail (each with a different referent).
5667 Give a diagnostic upon failed save_cwd, now that that function
5668 no longer calls `error'.
5669 (show_point): Don't diagnose find_mount_point's errors, now that
5670 it handles them itself.
5672 * src/df.c (find_mount_point): Don't let free clobber errno upon
5675 * src/sys2.h: Remove alloca-related block.
5676 * src/system.h: Include <alloca.h> here, instead.
5678 It appears that the `#pragma alloca' included via "system.h" is
5679 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
5680 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
5681 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
5683 * src/chown-core.c (change_file_owner): Do not restore any special
5684 permission bits (e.g., set-user-ID, set-group-ID) that are reset
5685 by chown(2) on some systems. Suggestion and insistence :-) from
5688 * tests/input-tty: Also check `test -t 1'.
5689 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
5690 test would block when run in the background.
5692 2003-07-11 Jim Meyering <jim@meyering.net>
5694 * tests/sample-test: Also fail if cat-to-create-expected-output
5695 fails. Otherwise, if both `exp' and `out' were to end up empty
5696 because of e.g., a full disk, they would mistakenly compare equal.
5698 * src/nohup.c: New file. Rewrite of nohup.sh in C.
5699 This solves a portability problem: on at least Solaris systems,
5700 when nohup.sh used the vendor /bin/sh, it would exit with status
5701 of `1' rather than the required 126 or 127 upon failure to exec
5702 the specified program.
5704 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
5705 (bin_PROGRAMS): Add nohup.
5706 (EXTRA_DIST): Remove nohup.sh.
5707 (all_programs): Remove use of $(EXTRA_SCRIPTS).
5708 * src/nohup.sh: Remove file.
5709 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
5711 * tests/misc/nohup: Tests for the above.
5712 * tests/misc/Makefile.am (TESTS): Add nohup.
5714 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
5715 the macro, COPY_FD_DIAGNOSE.
5716 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
5717 (head_file): Likewise.
5719 * src/date.c: Include "quote.h".
5720 (batch_convert): Use the quote function rather than using literal `...'
5723 * src/setuidgid.c (main): Enclose diagnostic in _(...).
5724 * src/fmt.c (main): Likewise.
5725 * src/mknod.c (main): Likewise.
5726 * src/tac.c (tac_seekable): Likewise.
5727 * src/yes.c (main): Likewise.
5728 * src/od.c (main): Likewise.
5729 * src/install.c (change_attributes): Likewise.
5731 2003-07-10 Jim Meyering <jim@meyering.net>
5733 * src/head.c (usage): Use 1024*1024 in place of 1048576.
5734 * src/tail.c (usage): Likewise.
5736 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
5737 place of the kludge in this test. Suggestion from Paul Jarc.
5739 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
5740 * src/setuidgid.c: New program, solely for testing (not installed).
5742 * src/chown-core.c (change_file_owner): Don't leak file descriptors
5743 when dereferencing symlinks.
5745 2003-07-09 Jim Meyering <jim@meyering.net>
5747 * tests/du/slash: New file/test for today's lib/ftw.c fix.
5748 * tests/du/Makefile.am (TESTS): Add slash
5750 * src/tail.c (xlseek): Avoid warning about ``return without value
5751 from function returning non-void''.
5753 2003-07-08 Jim Meyering <jim@meyering.net>
5755 * man/help2man: Update to version 1.29.
5757 * man/help2man: Add END handler to close STDOUT and check for errors.
5759 2003-06-30 Paul Eggert <eggert@twinsun.com>
5761 Add support for a "[" that conforms to the GNU coding standards,
5762 i.e., that does not depend on its name.
5763 * src/lbracket.c: New file.
5765 * man/Makefile.am (programs): Ignore "[", since it doesn't have
5766 a separate man page.
5767 * src/Makefile.am (bin_PROGRAMS): Add "[".
5768 (__SOURCES): New var.
5769 * src/test.c (LBRACKET): Define to 0 if not defined.
5770 (main): Use LBRACKET rather than argv[0].
5772 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
5773 Reported by Paul Jarc and Dan Jacobson.
5775 * src/test.c (main): Do not recognize --help or --version if
5776 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
5777 Do not bother testing that margv[margc] is non-null.
5779 2003-07-04 Jim Meyering <jim@meyering.net>
5781 * src/who.c (print_line): Rewrite to use asprintf, in order to be
5782 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
5784 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
5785 option, and perform the +1600 invocations of head IFF the envvar
5786 RUN_EXPENSIVE_TESTS is set.
5788 2003-07-03 Jim Meyering <jim@meyering.net>
5790 * src/cp.c (do_copy): Give a better diagnostic when failing due
5791 to nonexistent destination directory. Reported by Dmitry Rutsky.
5792 See http://bugs.debian.org/199730 for details.
5794 2003-06-27 Jim Meyering <jim@meyering.net>
5796 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
5797 * src/split.c (longopts): Use `1', not `0' as the value for
5798 for &verbose. Reported by Keith Thompson.
5800 Test for the above fix.
5801 * tests/misc/split-a: Also use --verbose and compare stderr
5802 output with what we'd expect.
5804 2003-06-20 Jim Meyering <jim@meyering.net>
5806 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
5807 Use `error_t' (rather than int) as type for local `err'.
5808 From Alfred M. Szmidt.
5810 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
5812 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
5813 Fix author preservation code.
5815 2003-06-19 Jim Meyering <jim@meyering.net>
5817 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
5818 (do_link): Don't warn about hard link to symlink.
5820 2003-06-18 Jim Meyering <jim@meyering.net>
5822 * src/cut.c: Include "getdelim2.h", not "getstr.h".
5823 Reflect renaming: getstr -> getdelim2.
5825 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
5826 readline -> readlinebuffer.
5828 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
5830 * src/readlink.c: Include <sys/types.h> before system.h (because
5831 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
5833 2003-06-17 Jim Meyering <jim@meyering.net>
5835 * src/system.h (initialize_main): Define.
5836 Use it in every `main'. Applied via this:
5837 p='initialize_main (&argc, &argv);'
5838 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
5839 $(grep -l program_name.=.argv.0 *.c)
5840 test.c uses margc/margv, so I made the change manually for that file.
5841 Based on a patch from Bernard Giroud.
5843 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
5845 Fix for build failure on Ultrix 4.3.
5846 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
5847 Include sys/param.h and sys/mount.h on ultrix.
5849 2003-06-16 Jim Meyering <jim@meyering.net>
5851 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
5853 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
5854 them here instead, but with one change: define EISDIR to -1, not 0.
5856 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
5857 guaranteed to be defined.
5858 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
5860 * README: Mention the CVS repository.
5861 Encourage addition of test cases.
5863 2003-06-12 Jim Meyering <jim@meyering.net>
5865 * src/touch.c (touch): Call close only if necessary.
5868 * src/wc.c (usage): Correct wording: wc prints counts in the order
5869 `newline, word, byte'. Reported by Keith M. Briggs.
5870 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
5872 2003-06-10 Jim Meyering <jim@meyering.net>
5874 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
5876 2003-06-07 Jim Meyering <jim@meyering.net>
5878 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
5881 2003-06-06 Jim Meyering <jim@meyering.net>
5883 * src/extract-magic (main): Avoid newer 3-arg form of open,
5884 so this script works also with e.g., perl5.005_03.
5885 Patch by John David Anglin.
5887 2003-06-04 Paul Eggert <eggert@twinsun.com>
5889 * src/system.h: Include <stdbool.h> unconditionally.
5891 2003-06-04 Jim Meyering <jim@meyering.net>
5893 * man/Makefile.am (check-programs-vs-x): Rename target
5894 from check-programs-vs-1. Adjust rule to check for the
5895 primary (.x) file, not the generated one (.1).
5897 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
5899 * man/kill.x: New file.
5900 * man/Makefile.am (dist_man_MANS): Add kill.1.
5903 2003-06-04 Jim Meyering <jim@meyering.net>
5905 Ensure that the .x file for a new program is never forgotten again.
5906 * man/Makefile.am (programs): Define.
5907 (check-programs-vs-1): New phony target.
5908 (check-local): Depend on it.
5910 2003-06-03 Jim Meyering <jim@meyering.net>
5912 Avoid unnecessary copying of environment.
5913 * src/env.c (main): Rather than clearing the environment and --
5914 unless told to ignore environment -- copying all settings from
5915 the saved, original environment, clear the environment only when
5916 that is requested. Suggested by Jens Elkner.
5918 2003-06-02 Jim Meyering <jim@meyering.net>
5920 * src/system.h: Always include <string.h>, since we assume C89.
5921 Include <limits.h> without checking for HAVE_LIMITS_H.
5923 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
5924 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
5926 2003-06-01 Jim Meyering <jim@meyering.net>
5928 Avoid a race condition in `tail -f' described by Ken Raeburn in
5929 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
5930 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
5931 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
5932 (tail_bytes, tail_lines, tail): Likewise.
5933 (tail_file): Use the new `read_pos' value as the size,
5934 rather than stats.st_size from the fstat call.
5936 2003-05-28 Jim Meyering <jim@meyering.net>
5938 * src/extract-magic: Allow expansion of `$file' in the here-
5939 document corresponding to the comment at the top of fs.h.
5941 2003-05-26 Jim Meyering <jim@meyering.net>
5943 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
5944 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
5945 Use #if/#elif/... cascade so we get only one set of include files.
5946 Reported by Nelson Beebe.
5948 2003-05-24 Jim Meyering <jim@meyering.net>
5950 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
5951 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
5952 accept the BSD format.
5954 2003-03-28 Joe Orton <jorton@redhat.com>
5956 * src/md5sum.c (bsd_split_3): New function.
5957 (split_3): Detect checksums from BSD 'md5' command and handle them
5960 * tests/md5sum/basic-1: New tests for --check exit status, and for
5961 BSD-style checksum files.
5963 2003-05-21 Jim Meyering <jim@meyering.net>
5965 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
5966 This sort of thing is why it'd be *Really Good* to factor
5967 out the common code used here and in tail.c.
5969 2003-05-14 Jim Meyering <jim@meyering.net>
5971 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
5973 * tests/du/slink: Skip this test if `.' is on an XFS file system.
5975 * tests/du/fd-leak: New file. Test for the bug in du that
5976 was fixed by the 2003-05-12 change to lib/ftw.c.
5977 * tests/du/Makefile.am (TESTS): Add fd-leak.
5979 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
5980 includes a translatable word, `and'.
5982 * src/dd.c (usage): Don't use `,' as the thousands separator
5983 in e.g. 1,000,000 and 1,048,576. Instead, do this:
5984 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
5985 * src/df.c (usage): Likewise.
5986 * src/du.c (usage): Likewise.
5987 * src/ls.c (usage): Likewise.
5989 * Makefile.maint (syntax-check): Add another check.
5991 2003-05-13 Paul Eggert <eggert@twinsun.com>
5993 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
5994 must output nothing. Problem reported by Josh Hyman.
5996 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
5997 (output_unique, output_first_repeated, output_later_repeated):
5998 New vars. All uses of "mode" changed to use these variables,
5999 which are not mutually exclusive as "mode" was.
6000 (writeline): New arg "match", used to control whether to
6001 obey output_first_repeated or output_later_repeated.
6002 All callers changed.
6003 (check_file, main): Adjust to above changes.
6005 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
6007 2003-05-14 Jim Meyering <jim@meyering.net>
6009 * tests/rm/rm3: Use tr's \n notation rather than \012.
6010 This package can afford to do that, since its tests are guaranteed use
6011 GNU tr, which has accepted the more modern notation for 10 years.
6012 * tests/rm/rm5: Likewise.
6013 * tests/cp/same-file: Likewise.
6014 * tests/stty/row-col-1: Likewise.
6015 * tests/stty/basic-1: Likewise.
6016 * tests/rm/deep-1: Likewise.
6017 * tests/mv/part-symlink: Likewise.
6018 * tests/mkdir/perm: Likewise.
6019 * tests/misc/nice: Likewise.
6021 2003-05-13 Jim Meyering <jim@meyering.net>
6023 * src/copy.c (struct F_triple) [name]: Remove const attribute.
6024 (triple_free): Don't apply cast to argument of free.
6025 (seen_file): Add cast here instead.
6027 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
6028 (src_to_dest_free): Don't apply cast to argument of free.
6030 * src/sort.c (zaptemp): Don't apply cast to argument of free.
6031 * src/pr.c (init_fps, init_store_cols): Likewise.
6032 * src/join.c (delseq, freeline): Likewise.
6033 * src/expr.c (OLD): Likewise.
6034 * src/sort.c (sort): Likewise.
6035 * src/head.c (elide_tail_lines_pipe): Likewise.
6037 * src/tail.c: Include "quote.h".
6038 Use quote in diagnostics. Change many error format strings
6039 from just `%s' to e.g., `error reading %s'.
6040 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
6041 Rewrite newline-counting loop to use memchr.
6043 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
6044 Now that assert is no longer used, don't include <assert.h>.
6046 2003-05-12 Jim Meyering <jim@meyering.net>
6048 * src/head.c: Include <assert.h>.
6049 (AUTHORS): Add my name.
6050 (elide_tail_lines_pipe): New function.
6052 2003-05-10 Jim Meyering <jim@meyering.net>
6054 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
6056 * src/readlink.c (main): Set program_name before first use.
6057 Remove that (redundant) first use.
6058 Don't exit successfully just because --verbose was specified.
6059 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
6060 parameter is 0, error does not exit.
6062 * src/uname.c (main): When failing due to too many arguments, also say
6063 that, rather than just "Try `uname --help' for more information.".
6064 * src/comm.c (main): Likewise, but for too few arguments.
6065 * src/logname.c: Include error.h.
6066 (main): Say why we're failing.
6068 * src/uniq.c (main): Don't segfault when argc < optind.
6069 * src/who.c (main): Handle argc < optind.
6070 * src/df.c (main): Likewise.
6071 * src/install.c (main): Likewise.
6072 * src/mv.c (main): Likewise.
6073 * src/pwd.c (main): Likewise.
6074 * src/tty.c (main): Likewise.
6075 * src/chroot.c (main): Likewise.
6076 * src/hostname.c: Likewise.
6077 * src/du.c (main): Likewise.
6078 * src/expand.c (main): Likewise.
6079 * src/env.c (main): Likewise.
6080 * src/unexpand.c (main): Likewise.
6081 * src/printenv.c (main): Likewise.
6082 * src/sync.c (main): Handle argc == 0.
6083 * src/expr.c (main): Likewise.
6084 * src/printf.c (main): Likewise.
6085 * src/basename.c (main): Likewise.
6086 * src/ln.c (main): Test for `missing argument' before computing n_files.
6087 * src/tail.c (main): Test for the case of no arguments before
6090 * src/kill.c (send_signals): Don't check command line arguments here.
6091 (main): Check them here instead. Handle argc < optind.
6093 * src/logname.c (main): Use error, rather than fprintf, for the sake
6096 * src/rm.c (main): Don't overrun array bound if argc is 0.
6098 2003-05-09 Jim Meyering <jim@meyering.net>
6100 * src/sort.c (main): Don't overrun array bound if argc is 0.
6101 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
6102 Reported by Wartan Hachaturow.
6104 2003-05-07 Jim Meyering <jim@meyering.net>
6106 Implement support so that `head --lines=-N' works on seekable files.
6107 * src/head.c (enum Copy_fd_status): Define.
6108 (COPY_FD_DIAGNOSE): New macro.
6109 (elide_tail_lines_seekable): New funtion.
6110 (elide_tail_lines_file): Call it here.
6112 2003-05-06 Jim Meyering <jim@meyering.net>
6114 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
6116 2003-05-04 Jim Meyering <jim@meyering.net>
6118 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
6119 caused the addition of thousands of small files to the tar archive.
6120 * tests/misc/head-elide-tail: New file. Add them here instead.
6121 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
6123 2003-05-04 Paul Eggert <eggert@twinsun.com>
6125 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
6126 (IF_READDIR_NEEDS_REWINDDIR): Remove.
6127 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
6128 which was a bit weird because it couldn't be emulated by a function.
6130 2003-05-03 Jim Meyering <jim@meyering.net>
6132 Extend head to accept --lines=-N (--bytes=-N) and to print all
6133 but the N lines (bytes) at the end of the file.
6134 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
6135 Use quote() in diagnostics, rather than literal `' marks.
6136 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
6138 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
6139 (head_file): Reorganize so as to call head from only one place.
6140 (main): Likewise, for head_file.
6141 Handle new, undocumented option, --presume-input-pipe.
6142 Handle negative line and byte counts.
6143 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
6145 * tests/du/8gb: Skip test if the file system of `.' doesn't support
6146 sparse files -- otherwise it'd create a file of size 8GB.
6148 2003-05-02 Jim Meyering <jim@meyering.net>
6150 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
6151 Instead explain about `-' and standard input.
6152 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
6153 Reported by Keith Thompson.
6154 * tests/fmt/basic: Add test for the above fix.
6156 * src/fmt.c: Include "quote.h".
6157 Use quote() in diagnostics, rather than literal `' marks.
6158 (main): Exit nonzero when unable to open an input file.
6159 * tests/fmt/basic: Add test for the above fix.
6161 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
6162 specifications like `-72x'.
6163 * tests/fmt/basic: Add test for the above fix.
6165 Work around nasty readdir bug on Darwin6.5.
6166 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
6167 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
6168 returned NULL and there has been at least one successful unlink or
6169 rmdir call since the opendir or previous rewinddir, then call
6170 rewinddir and reiterate the loop.
6172 Factor out common code.
6173 * src/remove.c (readdir_ignoring_dotdirs): New function.
6174 (is_empty_dir): Use it here.
6175 (remove_cwd_entries): Use it here.
6177 2003-05-01 Jim Meyering <jim@meyering.net>
6179 * tests/rm/r-3: Create 500 rather than just 300 files.
6180 There's a bug in Darwin6.5's readdir that shows up only with
6182 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
6186 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
6187 (dump_remainder): Move two declarations `down' into the scope
6188 where they are used.
6189 (xlseek): Return the resulting offset.
6190 (file_lines): Rename parameter, file_length, to end_pos.
6191 (pipe_lines): Don't coerce safe_read return value to `int'.
6192 Adapt tests accordingly.
6193 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
6195 Change type of `total_bytes' from `int' to `size_t',
6196 since the former wouldn't always be wide enough.
6197 Don't coerce safe_read return value to `int',
6198 and adapt tests accordingly.
6199 Now that testing for a read error no longer involves
6200 using `tmp', handle that case *after* freeing `tmp'.
6201 (start_bytes): Clean up.
6202 (tail_bytes): Now that `n_bytes' may be larger than
6203 OFF_T_MAX, test for that condition and, if it's true, don't
6204 use lseek optimizations.
6205 (parse_options): Don't fail just because N_UNITS is larger than
6206 the maximum size of a file -- tail may be applied to an input
6207 stream (e.g., a pipe) with more data than that.
6209 * Makefile.maint (syntax-check): Rename from alloc-check.
6210 Also check for SPACE-TAB sequences.
6211 Also check for malloc/calloc/realloc casts.
6213 2003-05-01 Jim Meyering <jim@meyering.net>
6215 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
6217 2003-04-28 Jim Meyering <jim@meyering.net>
6219 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
6220 make the now-more-picky tsort fail.
6222 2003-04-24 Jim Meyering <jim@meyering.net>
6224 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
6225 (main): Minor syntactic clean-up.
6227 * src/tsort.c (tsort): Fail if the input contains an odd number of
6228 tokens. Reported by junkio@cox.net.
6230 * tests/tsort/basic-1: Test for the above fix.
6232 2003-04-21 Jim Meyering <jim@meyering.net>
6234 * tests/misc/printf: Add tests for the printf fixes below.
6236 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
6238 2003-04-20 Paul Eggert <eggert@twinsun.com>
6240 Fix printf POSIX compatibility bug reported by Ben Harris in
6241 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
6242 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
6243 \0NNN in the %b operand.
6244 * src/printf.c (usage): Likewise.
6245 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
6246 is desired. All uses changed. Behave like Bash printf if %b
6247 operand uses \NNN where the initial N is not 0.
6249 2003-04-17 Jim Meyering <jim@meyering.net>
6251 * src/stty.c: Remove uses of PROTOTYPE macro.
6253 2003-04-15 Jim Meyering <jim@meyering.net>
6255 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
6256 each sequence of spaces before a TAB character.
6258 2003-04-13 Jim Meyering <jim@meyering.net>
6260 * src/remove.c (is_empty_dir): Don't closedir (NULL).
6262 2003-04-12 Jim Meyering <jim@meyering.net>
6264 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
6265 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
6266 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
6267 * src/nl.c (main): Fix those problems and remove literal quote marks
6268 (e.g., "`%s'") from format string; instead use "%s" in each format
6269 string and `quote (optarg)' as the corresponding argument.
6270 Also, diagnose all invalid command line options before failing.
6272 * src/nl.c (proc_text): Fix a bug that would make nl output extra
6273 newlines in some cases. Details here: http://bugs.debian.org/177256.
6274 This bug was introduced on 2001-11-10 for textutils-2.0.17.
6275 * tests/misc/nl: Add test for the above-fixed bug.
6277 * tests/misc/readlink: New file. Test the --canonicalize option.
6278 * tests/misc/Makefile.am (TESTS): Add readlink.
6280 2003-04-11 Jim Meyering <jim@meyering.net>
6283 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
6284 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
6285 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
6286 retain alignment) each sequence of spaces before a TAB character.
6288 * src/ls.c: Include <stdlib.h> unconditionally.
6290 * Makefile.maint (xalloc-check): Rename from header-check.
6292 * src/yes.c: Include error.h after system.h, not before.
6295 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
6296 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
6297 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
6298 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
6299 * src/tr.c: * src/unexpand.c, src/users.c:
6300 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
6301 return values and of xrealloc's first argument.
6302 Fix the former with this:
6303 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
6305 2003-04-10 Jim Meyering <jim@meyering.net>
6307 * src/stty.c (wrapf): Declare with format attribute.
6309 The S_MAGIC_... names shouldn't be maintained in two places (prior
6310 to this change, one would have to keep stat.c and fs.h in sync).
6311 This change makes it so those names and the corresponding
6312 hexadecimal constants all reside in stat.c. fs.h is now generated.
6313 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
6314 (BUILT_SOURCES): Add fs.h, now that it's generated.
6315 (EXTRA_DIST): Add extract-magic.
6316 * src/extract-magic: New script to extract fs.h definitions from stat.c.
6317 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
6318 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
6320 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
6321 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
6323 * man/unexpand.x: Add `SEE ALSO' reference to expand.
6324 * man/expand.x: Add `SEE ALSO' reference to unexpand.
6325 Suggestion from Dan Jacobson.
6327 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
6329 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
6330 * src/stat.c (human_fstype): Handle Linux's devpts.
6332 2003-04-09 Paul Eggert <eggert@twinsun.com>
6334 * src/split.c (line_bytes_split): Arg is of type size_t, since
6335 that's all that is supported for now.
6336 (main): Check for overflow in obsolescent line count option.
6338 2003-04-09 Jim Meyering <jim@meyering.net>
6340 * tests/misc/split-fail: Add a new test for the above fix.
6342 * src/split.c (bytes_split): Use size_t temporary (rather than
6343 uintmax_t original) in remaining computations. From Paul Eggert.
6345 Handle command line option arguments larger than 2^31.
6346 This allows e.g., splitting into files of size 2GB and larger,
6347 and running split --lines=N with N=2^31 or more.
6348 But for --line-bytes=N, the restriction that N <= SIZE_MAX
6349 remains (for now), due to the way it is implemented.
6351 * src/split.c: Include "inttostr.h".
6352 (bytes_split, lines_split, line_bytes_split, main):
6353 Use uintmax_t, not size_t, for file sizes.
6354 (main): Give a better diagnostic for option arguments == 0.
6355 Use umaxtostr to print file sizes.
6356 Reported by Luke Hassell.
6358 2003-04-08 Jim Meyering <jim@meyering.net>
6360 * src/rm.c (usage): Mention that --directory (-d) works only
6361 on some systems. Suggestion from Samuel Tardieu.
6363 * tests/basename/basic: Run $PERL to see if it is available,
6364 rather than testing its value.
6365 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
6366 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
6367 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
6368 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
6369 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
6370 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
6371 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
6372 * tests/sum/basic-1, tests/seq/basic: Likewise.
6374 * tests/misc/Makefile.am (TESTS): Add split-fail.
6375 * tests/misc/split-fail: New file.
6377 * src/split.c: Rename local variables: nchars -> n_bytes.
6378 (lines_split): Rename local, nlines -> n_lines.
6379 (main): Rename local variable: s/accum/n_units/.
6380 (main): Use STDIN_FILENO, not literal `0'.
6382 2003-04-07 Jim Meyering <jim@meyering.net>
6384 * src/stat.c: Add #include directives for Ultrix 4.4.
6385 Based on a suggested change from Bert Deknuydt.
6387 2003-04-06 Jim Meyering <jim@meyering.net>
6389 * Makefile.maint (makefile-check): New rule.
6390 (local-check): Add it.
6392 2003-04-05 Jim Meyering <jim@meyering.net>
6394 * Makefile.am (nearly all of them):
6395 Use $(VAR) rather than @VAR@, now that we can rely on automake to
6396 emit a definition for each substituted variable.
6397 * tests/Makefile.am.in: Likewise.
6399 * tests/rm/rm5: Add a comment explaining why this test fails when
6400 using Tru64's broken sed.
6401 * tests/rm/rm3: Likewise.
6403 Make `kill -t' output signal descriptions (not `?') on Tru64.
6404 * src/kill.c (sys_siglist): Also check for __sys_siglist.
6405 Patch by Tony Leneis.
6406 * configure.ac: Also check for declaration of __sys_siglist.
6407 Required for Tru64 4.0D, 4.0F, and 5.1.
6408 Reported by Tony Leneis.
6410 2003-04-04 Jim Meyering <jim@meyering.net>
6412 * src/Makefile.am (PERL): Remove unnecessary definition.
6414 Because of inappropriate (but POSIX-mandated) behavior of rename,
6415 `mv a b' would not remove `a' in some unusual cases. Work around
6416 this by unlinking `a' when necessary.
6418 * src/copy.c (same_file_ok): Add an output parameter.
6419 Set it in the offending case.
6420 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
6421 Reported by Ed Avis.
6422 * tests/mv/hard-4: New test for the above.
6423 * tests/mv/Makefile.am (TESTS): Add hard-4.
6425 Clean up rules for automatically generated sources:
6426 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
6427 Make each generated file be read-only.
6428 Add each file name to BUILT_SOURCES separately.
6429 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
6431 Put LOCALEDIR macro definition in new file: localedir.h.
6432 * src/Makefile.am (DEFS): Remove definition.
6433 (localedir.h): New rule.
6434 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
6435 * src/system.h: Include "localedir.h".
6437 2003-04-02 Jim Meyering <jim@meyering.net>
6441 * tests/misc/Makefile.am (TESTS): Add false.
6443 * Makefile.maint (TMPDIR): Make sure it's defined.
6444 (my-distcheck): Build in $(TMPDIR), not `.'.
6446 * src/Makefile.am (false.c): Change all occurrences of
6447 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
6448 unsuccessfully also with --help. Reported by Paul Jarc,
6449 * tests/misc/false: New test for the above.
6451 2003-03-30 Jim Meyering <jim@meyering.net>
6453 * NEWS: Note the location of older NEWS files.
6455 * src/remove.c (is_empty_dir): Don't let a failing closedir
6456 clobber errno. Spotted by Arnold Robbins.
6458 * src/env.c: Fix typo in comment. From Arnold Robbins.
6460 2003-03-29 Jim Meyering <jim@meyering.net>
6464 * README: Note to expect build problems for stat.c on Ultrix 4.3.
6465 Note that there are some harmless test failures when running
6466 `make check' as root on some systems.
6468 2003-03-28 Jim Meyering <jim@meyering.net>
6470 * tests/stty/row-col-1: Skip this test if stty can't get window size.
6471 This happens when connecting to sparc-solaris5.7 via ssh from within
6472 emacs. Reported by Karl Berry.
6474 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
6475 Otherwise, on systems (DJGPP) that emulate pipes using files,
6476 this test would never complete, waiting for `yes' to terminate.
6477 * tests/du/slink: As above, use seq, not `yes' to generate link target.
6478 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
6479 Reported by Rich Dawe.
6481 2003-03-27 Jim Meyering <jim@meyering.net>
6483 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
6484 from `written by...' comment, at his request.
6486 2003-03-24 Paul Eggert <eggert@twinsun.com>
6488 Fix buffer overrun problem reported by TAKAI Kousuke, along
6489 with some other POSIX incompatibilities.
6491 * src/printf.c (print_esc): Do not treat \x specially if
6492 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
6493 in backslash. Treat incomplete escape sequences as strings
6494 of characters, as POSIX requires.
6495 (print_formatted): Allow multiple flags. Avoid buffer overrun
6496 if the format is incomplete.
6498 2003-03-24 Jim Meyering <jim@meyering.net>
6500 * tests/misc/printf: Add tests for the above fixes and changes.
6502 2003-03-26 Jim Meyering <jim@meyering.net>
6504 * src/copy.h (struct cp_options): Add a comment.
6506 2003-03-23 Jim Meyering <jim@meyering.net>
6508 * README: Describe problem with 64-bit mode on HPUX 11.x,
6509 with patch for /usr/include/inttypes.h.
6510 * TODO: Plan to add an autoconf test to work around the bug.
6512 2003-03-22 Jim Meyering <jim@meyering.net>
6514 * src/stat.c: Don't include <sys/sysmacros.h>.
6515 That is already done via system.h. Otherwise, the multiple
6516 inclusion would evoke redefinition warnings from Cray's /bin/cc,
6517 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
6518 (human_fstype): Factor some directives `up', out of this function.
6519 Cast away `const' to avoid error from Cray's /bin/cc.
6521 2003-03-20 Jim Meyering <jim@meyering.net>
6523 * announce-gen (print_changelog_deltas): Ensure that a newline
6524 precedes each row of `*'s.
6526 2003-03-20 Jim Meyering <jim@meyering.net>
6530 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
6531 format flag characters.
6532 Do not require that a field width be specified.
6533 Do not fail when given a field width of `0'.
6534 Reported by Dan Jacobson.
6535 * tests/seq/basic: Add new tests for the above-fixed bug.
6537 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
6538 (install-root): Likewise.
6539 (install-exec-local): Likewise.
6540 Based on a patch from Richard Dawe.
6542 2003-03-19 Jim Meyering <jim@meyering.net>
6544 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
6545 because the DJGPP 2.03 port of 'ln -s' doesn't work.
6546 Include $(EXEEXT) in program names.
6547 Since $(LN_S) may degenerate to `cp -p', be careful
6548 to invoke it from the destination directory.
6549 Mostly from Richard Dawe.
6550 * configure.ac: Use AC_PROG_LN_S.
6552 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
6553 CDPATH shell variable set could cause this test to fail.
6554 Reported by Karl Berry.
6556 2003-03-18 Jim Meyering <jim@meyering.net>
6558 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
6559 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
6560 AIX 5.1's xlc could not compile the former.
6561 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
6563 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
6565 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
6566 program names, since automake only adds $(EXEEXT) to programs
6569 2003-03-16 Jim Meyering <jim@meyering.net>
6571 * src/remove.c (rm): Put two local variables in static storage,
6572 so they can't be clobbered by the potential longjmp.
6574 2003-03-15 Jim Meyering <jim@meyering.net>
6576 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
6577 so that a version number with a two-digit component can still count
6578 as an alpha release. Reported by Richard A Downing.
6579 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
6581 2003-03-14 Jim Meyering <jim@meyering.net>
6583 * src/ansi2knr.c: Remove no-longer-used file.
6584 * src/ansi2knr.1: Likewise.
6586 * Makefile.maint (prev_version_file): Don't use ?= for this particular
6587 assignment, since it causes trouble with old versions of GNU make
6588 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
6589 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
6590 Patch from Alexandre Duret-Lutz.
6592 * Use patched automake-1.7.3. Regenerate Makefile.in files in
6593 subdirectories so that each includes a definition of ACLOCAL_M4.
6595 * announce-gen (main): Label the compressed source URLs.
6599 * tests/du/slink: Relax the test for the `local'ness of a file system,
6600 so that now it works also for tmpfs.
6602 * tests/du/hard-link: Transform output from first du, so that this
6603 test doesn't fail on file systems like tmpfs that order directory
6604 entries differently.
6606 2003-03-13 Jim Meyering <jim@meyering.net>
6608 * tests/du/8gb: Work around what appears to be an NFS failure that
6609 would make this test fail on some systems.
6611 2003-03-11 Jim Meyering <jim@meyering.net>
6613 * tests/du/basic: Make the test file exactly 4k bytes long.
6615 * src/split.c (longopts): Don't hard-code `2' here.
6616 Instead, just specify `&verbose', and ...
6617 (main): ... remove the `case 2:' block for --verbose.
6619 * tests/du/basic: Make the test file larger than 64 bytes, so that
6620 we don't immediately disqualify file systems (e.g., NetApp) on which
6621 smaller files take up zero disk blocks. Reported by Vin Shelton.
6623 2003-03-10 Jim Meyering <jim@meyering.net>
6625 Don't segfault for a negative field width or precision in format string.
6626 Note that this is just a stopgap fix. The longer term solution may
6627 involve adapting bash's builtins/printf.def.
6629 * src/printf.c: (UNSPECIFIED): Define.
6630 (print_direc): Use the special value, UNSPECIFIED, to indicate
6631 that field_width or precision has not been specified.
6632 (print_formatted): Fail if field_width or precision is the
6633 special value, UNSPECIFIED.
6634 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
6636 * src/sys2.h (INT_MIN): Define, if necessary.
6637 * tests/misc/printf: Add a test for the above-fixed bug.
6639 2003-03-09 Jim Meyering <jim@meyering.net>
6641 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
6642 changing its sign. This avoids a warning from gcc on 64-bit systems.
6643 Reported by Bob Proulx.
6644 (pop_dir): Reverse order of sign change and cast, to be consistent
6647 2003-03-08 Jim Meyering <jim@meyering.net>
6649 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
6650 shell variable, but only in the environment. With /bin/sh->bash, the
6651 shell variable is set to `y', and that would cause a spurious warning.
6652 Reported by Bob Proulx.
6654 * tests/Makefile.am (check-root): Remove touch/fifo.
6655 It doesn't appear to have to be run as root.
6657 * tests/rm/fail-2eperm: Rather than simply using the first non-root
6658 user name, make sure that the selected user name has a usable shell.
6659 Reported by Paul Jarc.
6661 Before, when using shred on a device, one had to specify --exact,
6662 or be careful to choose a size that would not be rounded up and
6663 exceed the maximum value; that could result in a failure of
6665 * src/shred.c (do_wipefd): --exact is now the default for non-regular
6666 files. Suggestion from Ben Elliston.
6669 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
6670 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
6671 Patch by Bob Proulx.
6673 * src/Makefile.am (check-misc): Check for use of `defined' in
6675 Change to $(srcdir) before running grep.
6677 * src/sleep.c: Remove now-unused #include and #define directives.
6679 * src/du.c (process_file): If a file's size is not being counted
6680 e.g., because it's a hard link to a file we've already counted,
6681 then don't print a line for it.
6683 * tests/du/hard-link: New test for the above-fixed bug.
6684 * tests/du/Makefile.am (TESTS): Add hard-link.
6687 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
6688 and make the two-array approach work.
6690 * tests/du/basic: Correct/add tests for the above fix.
6691 Set LC_ALL, etc., now that we use sort.
6692 Check the block/size of a small file, too.
6693 Correct expected results for simple dir1/dir2/file case.
6694 Add another test of du -S.
6696 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
6698 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
6699 middle-end/9986). As one of GCC's optimizations, it transforms a
6700 fputs_unlocked call to a fputc_unlocked call when the string is
6701 one character long. However, hpux doesn't have fputc_unlocked.
6703 * expr.c (usage): Use putchar, not fputs, to output a single character.
6704 * ls.c (dired_dump_obstack): Likewise.
6705 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
6706 * stat.c (print_it): Likewise.
6708 2003-03-07 Jim Meyering <jim@meyering.net>
6710 * src/cp.c: Remove everything associated with mmap-stack.c.
6711 This reverts the two changes of 2003-02-21.
6712 * src/du.c: Remove everything associated with mmap-stack.c.
6713 This reverts the change of 2003-02-19.
6715 2003-03-06 Jim Meyering <jim@meyering.net>
6717 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
6718 CDPATH shell variable set could cause this test to fail.
6719 Reported by Karl Berry.
6721 2003-03-05 Jim Meyering <jim@meyering.net>
6725 * src/printf.c (print_esc): Remove pointless comparison of unsigned
6726 integer with zero, to avoid a warning from Intel's ecc.
6727 Reported by Nelson Beebe.
6729 * src/du.c (process_file): Sizes must all be of type uintmax_t.
6730 Otherwise, for files or totals that are too big, numbers would
6731 be truncated. Patch mostly by Michael Stone.
6732 Reported by Ingo Saitz as Debian bug #183210.
6734 * tests/du/8gb: New test for the above-fixed bug.
6735 * tests/du/Makefile.am (TESTS): Add 8gb.
6737 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
6738 rather than UTILS_OPEN_MAX - 10.
6740 2003-03-04 Jim Meyering <jim@meyering.net>
6742 * README: Refer new feature discussion to bug-coreutils@gnu.org,
6743 rather than bug-gnu-utils, now that the former is better known.
6744 Suggestion from Göran Uddeborg.
6746 * src/stat.c (usage): Capitalize consistently.
6747 Reported by Göran Uddeborg.
6749 * Makefile.maint (rel-files): Include $(signatures), so that
6750 those files are also copied into $(release_archive_dir).
6752 * src/df.c (find_mount_point): Call error here, now that restore_cwd
6754 * src/remove.c (AD_pop_and_chdir): Likewise.
6756 * tests/Makefile.am (check-root): Add fail-2eperm.
6758 2003-03-03 Jim Meyering <jim@meyering.net>
6760 * src/remove.c (remove_cwd_entries): Include the full filename of
6761 the offending file, not just the basename.
6763 * tests/misc/tty-eof: Set $ME properly.
6765 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
6766 Remove now-unused variables.
6767 (tag-prev-version, prev-cvs-tag): Likewise.
6769 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
6770 accurate diagnostic when failing to remove a file owned by some other
6771 user. Reported by Ivo Timmermans via Michael Stone.
6772 This fixes Debian bug# 178471.
6774 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
6775 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
6776 Based on a report from Ivo Timmermans.
6778 2003-03-02 Jim Meyering <jim@meyering.net>
6780 * src/copy.c (copy_internal) [un_backup]: When recovering from a
6781 failure to create a hard link, do not remove the entry associating
6782 the source dev/ino with the destination file name.
6783 * tests/mv/Makefile.am (TESTS): Add hard-3.
6784 * tests/mv/hard-3: New test, for the above-fixed bug.
6785 Inspired by a report from Iida Yosiaki.
6787 2003-03-01 Jim Meyering <jim@meyering.net>
6789 * src/df.c (print_header): Don't embed spaces in a separate `Type'
6790 header string. Instead, put `Filesystem' and `Type' headers in the
6791 same string, so translators can use horizontal space as needed.
6792 Reported by Jean Charles Delepine.
6794 2003-02-28 Jim Meyering <jim@meyering.net>
6796 * src/copy.c (copy_internal): When link fails because of an
6797 existing destination file, unlink that file and try again.
6798 Reported by Iida Yosiaki.
6800 * tests/mv/Makefile.am (TESTS): Add hard-2.
6801 * tests/mv/hard-2: New test for the above-fixed bug.
6802 Based on a test case from Iida Yosiaki.
6804 2003-02-26 Jim Meyering <jim@meyering.net>
6806 * tests/du/basic: Don't test du's -b option here. Directory byte
6807 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
6808 and IBM AIX 4.2. Reported by Nelson Beebe.
6810 2003-02-25 Jim Meyering <jim@meyering.net>
6812 * Makefile.maint (announcement): Now that ChangeLog entries
6813 are output by announce-gen, don't do it here.
6814 * announce-gen (print_changelog_deltas): New function.
6817 2003-02-22 Jim Meyering <jim@meyering.net>
6819 * announce-gen: New option: --release-type=TYPE
6820 * Makefile.maint (beta, major): New targets. Remove `release'.
6821 Put them all together on a line.
6822 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
6823 invocation of `announcement'.
6824 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
6826 * announce-gen: New option: --news=NEWS_FILE.
6827 Extract NEWS entries here, not via rules in Makefile.maint.
6828 * Makefile.maint (announcement): Now that NEWS entries are
6829 extracted by announce-gen, don't do it here.
6830 (news-r1, news-r2): Remove now-unused definitions.
6832 2003-02-21 Jim Meyering <jim@meyering.net>
6836 Merge in changes from autoconf's version of this file.
6837 * Makefile.maint (www-gnu): Define.
6838 (standards.texi-url_prefix): Use $(www-gnu).
6839 (make-stds.texi-url_prefix): Likewise.
6841 * src/cp.c: Include "mmap-stack.h".
6842 (main): Invoke `run' through a macro that (when possible) runs it
6843 with a large, mmap'd stack.
6845 * src/cp.c (run): New function, preparing for the above.
6846 Exit from this function, not from main
6849 * src/du.c: New option: --apparent-size.
6850 (enum) [APPARENT_SIZE_OPTION]: New member.
6851 (long_options): Add it.
6852 (usage): Describe it.
6854 ['b']: Set apparent_size.
6855 David Eisner reported that the behavior of --bytes had changed.
6856 Paul Eggert proposed the use of a new option, --apparent-size.
6858 * src/du.c (apparent_size): New global.
6859 (print_only_size): Reflect the fact that we're printing byte counts,
6860 not ST_NBLOCKSIZE-byte-block counts.
6861 (print_size): Call print_only_size rather than duplicating its code.
6862 (process_file): Accumulate byte counts, rather than block counts.
6864 * src/du.c (process_file): Always reset size_to_propagate_to_parent
6865 for --separate-dirs (-S).
6867 2003-02-20 Jim Meyering <jim@meyering.net>
6869 * Use automake-1.7.3. Regenerate dependent files.
6871 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
6872 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
6873 (usage) [%B]: Describe it.
6876 * src/du.c (process_file): Reorganize the code to use only
6877 one `sum' array, and change how -S works back to the way it was
6878 before 2003-01-31. Patch by Bruno Haible.
6880 * tests/du/basic: New test.
6881 * tests/du/Makefile.am (TESTS): Add basic.
6883 * tests/envvar-check: Add checks for the following:
6884 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
6886 * tests/Makefile.am: Rename phony target envvar-check to evar-check
6887 so as not to conflict with the distributed file by the same name.
6889 * src/du.c (process_file): Set info->skip before any possible return.
6891 Report correct usage for directories, not 0.
6892 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
6893 _before_ recording the dev/ino of a directory.
6894 Reported by Bruno Haible.
6896 Now, df always displays the device file name corresponding to the
6897 listed mount point under `Filesystem'. Before, for an unmounted
6898 block- or character-special file argument, it would display the
6899 command-line argument instead.
6900 * src/df.c (show_disk): Return a value indicating whether
6901 there was a match. Don't try to find a mount point here.
6902 (show_entry): If show_disk doesn't find a match, call show_point.
6904 2003-02-19 Jim Meyering <jim@meyering.net>
6906 * src/du.c: Include "mmap-stack.h".
6907 (du_files): Add prototype with ATTRIBUTE_NORETURN.
6908 Exit from this function, not from...
6910 Instead, if possible, invoke du_files through a macro that
6911 runs it with a large, mmap'd stack.
6913 * src/join.c (usage): Change wording in --help output:
6914 use FILENUM instead of `SIDE' and say what FILENUM means.
6915 Reported by Bernhard Gabler.
6917 * src/df.c (print_header): Rather than using a hard-coded literal
6918 string of spaces matching the length of the English `...Type' header,
6919 output the right number of spaces to match the selected translation.
6920 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
6922 * src/split.c (bytes_split): Remove unnecessary `else' after break.
6923 (lines_split): Likewise. and correct misleading indentation.
6925 * src/split.c: Include "full-read.h".
6926 (bytes_split, lines_split, line_bytes_split): Use full_read,
6927 not safe_read. The way split was using the latter, a short read
6928 could cause split to terminate before EOF.
6930 * tests/misc/tty-eof: Test all programs that can read stdin,
6931 requiring no arguments and that write to standard output.
6933 * tests/misc/tty-eof: New file. Renamed from ...
6934 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
6935 * tests/misc/Makefile.am (TESTS): Reflect renaming.
6937 2003-02-18 Jim Meyering <jim@meyering.net>
6939 cksum would perform an extra read after encountering EOF
6940 * src/cksum.c (cksum): Exit the loop upon EOF, too.
6941 Patch by Michael Bacarella.
6943 Test for the bug fixed today in cksum, md5sum, and sha1sum.
6944 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
6945 cat, cksum, md5sum, and sha1sum all in the same loop.
6947 2003-02-14 Jim Meyering <jim@meyering.net>
6949 * src/remove.c: Include "euidaccess.h".
6950 Remove declaration of euidaccess.
6952 2003-02-12 Jim Meyering <jim@meyering.net>
6954 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
6955 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
6957 2003-02-10 Jim Meyering <jim@meyering.net>
6959 * src/test.c: Don't include group-member.h.
6960 Include euidaccess.h.
6961 (eaccess): Rewrite function to set the real uid and gid temporarily
6962 to the effective uid and gid, then invoke 'access', and then set the
6963 real uid and gid back. On systems that lack setreuid or setregid,
6964 fall back on the kludges in euidaccess. Before, it would not work
6965 for e.g., files with ACLs, files that were marked immutable,
6966 or on file systems mounted read-only. Nelson Beebe raised the issue.
6967 Paul Eggert suggested the new implementation.
6969 2003-02-09 Jim Meyering <jim@meyering.net>
6971 * src/test.c (test_stat): Remove function. It's job is done (only
6972 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
6974 2003-02-08 Jim Meyering <jim@meyering.net>
6978 * tests/mv/part-symlink: Don't assume that the file owner username
6979 length is less than 9 in ls output: instead, omit that field
6980 altogether. Reported by, and suggested fix from, Ferdinand.
6982 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
6983 * tests/du/Makefile.am (TESTS): Add restore-wd.
6985 * src/rm.c: Correct now-invalid comment about cycle-detection.
6987 2003-02-06 Jim Meyering <jim@meyering.net>
6989 * NEWS: Add entries from old/*/NEWS
6990 from fileutils-4.1 through 4.1.11 and
6991 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
6995 * src/du.c (process_file): Don't return early for excluded files
6996 or for files whose dev/inode we've already seen.
6998 2003-02-05 Jim Meyering <jim@meyering.net>
7000 * tests/du/exclude: New file.
7001 * tests/du/Makefile.am (TESTS): Add exclude.
7003 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
7005 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
7006 Fix memory allocation arithmetic.
7008 2003-02-04 Jim Meyering <jim@meyering.net>
7010 `df /dev/block-or-char-device-file--not-mounted' now reports
7011 the name of the file system on which the file resides, usually `/'.
7012 Before, it would leave the `Mounted on' field blank.
7013 * src/df.c (show_disk): Move function to precede find_mount_point.
7014 (show_disk): Add parameter: STATP.
7015 If we don't find a matching device name, then resort to calling
7016 find_mount_point. Reported by Bob Proulx.
7018 2003-02-03 Andreas Schwab <schwab@suse.de>
7020 * tests/rm/cycle: Require non-root.
7021 * tests/rm/isatty: Likewise.
7023 2003-02-02 Jim Meyering <jim@meyering.net>
7027 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
7029 Ensure that there are no offending uses of `:'.
7030 * Makefile.maint (makefile_path_separator_check): New rule.
7031 (local-check): Add it to the list.
7033 2003-02-01 Jim Meyering <jim@meyering.net>
7035 * src/du.c (MAX_N_DESCRIPTORS): Define.
7037 * src/stat.c (G_fail): New global.
7038 (human_time): Diagnose failed localtime, not failed nstrftime.
7039 (main): Fail if G_fail is set.
7041 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
7043 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
7044 hard-coding the path-separator. Also double-quote the new PATH,
7045 to avoid problems when the path-separator is a semi-colon or when
7046 `pwd` contains e.g. a space.
7047 * tests/chgrp/Makefile.am: Likewise.
7048 * tests/chmod/Makefile.am: Likewise.
7049 * tests/chown/Makefile.am: Likewise.
7050 * tests/cp/Makefile.am: Likewise.
7051 * tests/dd/Makefile.am: Likewise.
7052 * tests/dircolors/Makefile.am: Likewise.
7053 * tests/du/Makefile.am: Likewise.
7054 * tests/expr/Makefile.am: Likewise.
7055 * tests/factor/Makefile.am: Likewise.
7056 * tests/fmt/Makefile.am: Likewise.
7057 * tests/install/Makefile.am: Likewise.
7058 * tests/ln/Makefile.am: Likewise.
7059 * tests/ls/Makefile.am: Likewise.
7060 * tests/ls-2/Makefile.am: Likewise.
7061 * tests/md5sum/Makefile.am: Likewise.
7062 * tests/misc/Makefile.am: Likewise.
7063 * tests/mkdir/Makefile.am: Likewise.
7064 * tests/mv/Makefile.am: Likewise.
7065 * tests/od/Makefile.am: Likewise.
7066 * tests/rm/Makefile.am: Likewise.
7067 * tests/rmdir/Makefile.am: Likewise.
7068 * tests/seq/Makefile.am: Likewise.
7069 * tests/sha1sum/Makefile.am: Likewise.
7070 * tests/shred/Makefile.am: Likewise.
7071 * tests/stty/Makefile.am: Likewise.
7072 * tests/sum/Makefile.am: Likewise.
7073 * tests/tail-2/Makefile.am: Likewise.
7074 * tests/touch/Makefile.am: Likewise.
7075 * tests/tsort/Makefile.am: Likewise.
7076 * tests/unexpand/Makefile.am: Likewise.
7078 2003-01-31 Jim Meyering <jim@meyering.net>
7080 * src/stat.c: Include "file-type.h"
7081 (print_human_type): Remove function.
7082 (human_access): Rename from print_human_access. Return a string.
7083 (human_time): Rename from print_human_time. Return a string.
7084 (print_stat): Arrange so that field width and an alignment specifier
7085 are honored for the %A, %F, %x, %y, and %z formats.
7086 [%F]: Use file_type; this gives slightly different file type strings,
7087 e.g., `directory' instead of `Directory' and `regular file' or
7088 `regular empty file' instead of `Regular file'.
7089 Prompted by a report from Richard Dawe that the uses of
7090 S_IFSOCK and S_IFIFO in print_human_time were not portable
7091 to systems using e.g., DJGPP.
7093 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
7095 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
7096 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
7098 2003-01-31 Jim Meyering <jim@meyering.net>
7100 * src/du.c (main): Upon processing an invalid option or an invalid
7101 --exclude-from or --max-depth option argument, don't exit right away,
7102 in case there are others. Rather record the failure and exit after
7103 processing other options.
7105 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
7106 tar archive easier to reproduce.
7108 Rewrite to perform directory traversal using nftw.
7110 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
7111 (AUTHORS): Add self.
7112 (opt_one_file_system): Move global into `main'.
7113 (path, xstat, exit_status): Remove declarations.
7114 (arg_length, suffix_length): New globals.
7115 (G_fail): New global, sort of like the old `exit_status'.
7116 (IS_FTW_DIR_TYPE): Define.
7117 (print_only_size): New function.
7118 (process_file): New function.
7119 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
7120 (str_trunc, pop_dir, count_entry): Likewise.
7121 (du_files): Rewrite to use nftw.
7123 2003-01-30 Jim Meyering <jim@meyering.net>
7125 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
7126 symlink-to-directory with -L, even without the trailing slash.
7128 2003-01-27 Jim Meyering <jim@meyering.net>
7130 * src/Makefile.am (check-misc): Check for st_blocks, too.
7132 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
7133 Reported by Richard Dawe.
7135 2003-01-27 Andreas Schwab <schwab@suse.de>
7137 * src/ls.c (quote_name): Add fourth parameter, width, into which to
7138 store the screen columns, and return the number of bytes instead.
7139 (print_dir): Pass NULL as fourth parameter of quote_name.
7140 (print_name_with_quoting): Likewise.
7141 (length_of_file_name_and_frills): Get the width from the fourth
7142 parameter of quote_name instead of return value.
7144 2003-01-27 Jim Meyering <jim@meyering.net>
7146 * src/ls.c (decode_switches): If `dired' is set without
7147 `format == long_format', then silently reset dired. This doesn't
7148 change the behavior of ls (all prior uses of dired were protected
7149 by `&& format == long_format'), and lets us...
7150 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
7151 (PUSH_CURRENT_DIRED_POS): Likewise.
7154 2003-01-22 Jim Meyering <jim@meyering.net>
7156 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
7157 * tests/du/Makefile.am (TESTS): Add no-x.
7159 2003-01-21 Jim Meyering <jim@meyering.net>
7161 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
7162 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
7163 it may still be a directory -- or not (e.g., with FreeBSD on an
7164 NFS-mounted file system), so resort to calling lstat to find out.
7165 Based on a patch by Michael van Elst.
7167 * tests/cp/same-file: Don't assume that the file owner username
7168 length is less than 9 in ls output: instead, omit that field
7169 altogether. Reported by, and suggested fix from, Ferdinand.
7171 2003-01-20 Jim Meyering <jim@meyering.net>
7173 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
7174 large format widths no longer cause strftime to infloop.
7176 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
7178 2003-01-19 Jim Meyering <jim@meyering.net>
7180 * src/readlink.c: Include "canonicalize.h".
7182 2003-01-18 Jim Meyering <jim@meyering.net>
7184 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
7186 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
7187 (long_options): Add option --dereference-command-line-symlink-to-dir.
7188 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
7189 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
7190 -d, -F, -l options is specified.
7191 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
7192 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
7193 Change --dereference-command-line (-H) to dereference *all*
7194 command line arguments, including broken symlinks.
7196 2003-01-15 Paul Eggert <eggert@twinsun.com>
7198 Change ls -H back to the way it was yesterday, since this is
7199 compatible with FreeBSD and the POSIX spec is confusing
7200 and somewhat contradictory.
7202 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
7203 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
7204 (long_options): Change the long option name back.
7205 (usage): Change the usage back.
7206 (gobble_file): When -H is specified, dereference a top-level
7207 arg even if it points to a non-directory.
7209 2003-01-15 Jim Meyering <jim@meyering.net>
7211 * src/ls.c (gobble_file): Fall back on using lstat when required:
7212 when --dereference (-L) is not specified, and
7213 - when operating on a dangling symlink
7214 - when operating on command-line-symlink-to-directories
7215 This fixes numerous problems. Here are examples:
7216 - `ls dangling-symlink' would fail with `no such file...'
7217 Now it prints `dangling-symlink'.
7218 - `ls -i symlink' would mistakenly print the inode of the referent.
7219 Now it prints the inode of the symlink. Likewise for --size (-s).
7220 Based on a patch from Michael Stone.
7221 Reported by Deepak Goel as Debian bug #173793.
7223 Rename ls's --dereference-command-line (-H)
7224 option to --dereference-command-line-symlink-to-dir.
7225 * src/ls.c [enum Dereference_symlink]
7226 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
7227 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
7228 (long_options): Rename the long option.
7229 (usage): Say that --dereference-... changes how ls treats
7230 only symlinks to directories specified on the command line.
7232 2003-01-14 Jim Meyering <jim@meyering.net>
7234 * tests/ls/dangle: New file/test, for the above fix.
7235 * tests/ls/inode: Another new file/test, for the above fix.
7236 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
7238 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
7239 so that ls --color would no longer highlight the names of files with
7240 the execute bit set when not specified on the command line.
7241 Patch by Michael Stone. Reported by Stephen Depooter as
7244 * tests/ls-2/tests (color-exe): New test, for the above fix.
7246 2003-01-13 Jim Meyering <jim@meyering.net>
7248 * tests/shred/exact: Also test for just fixed bug with --zero.
7250 * src/shred.c (long_opts): --zero does not require an argument.
7251 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
7253 2003-01-12 Jim Meyering <jim@meyering.net>
7255 * Makefile.maint (cvs-update): Skip any file with local modifications.
7257 * src/unexpand.c (usage): Document --first-only and mention that
7258 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
7260 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
7262 * src/df.c: Include "canonicalize.h".
7263 Use canonicalize_file_name unconditionally.
7265 2003-01-09 Jim Meyering <jim@meyering.net>
7267 * README: Add readlink.
7269 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
7271 * src/df.c: Include "xgetcwd.h".
7272 * src/pwd.c: Likewise.
7274 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
7276 * src/shred.c: Remove declaration of xstrdup.
7277 We already get it via xalloc.h which is included via system.h.
7279 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
7281 New program: readlink.
7283 * src/Makefile.am (bin_PROGRAMS): Add readlink.
7284 * src/readlink.c: New file.
7286 * man/readlink.x: New file.
7287 * man/Makefile.am (dist_man_MANS): Add readlink.1.
7288 (readlink.1): New rule.
7290 2003-01-09 Jim Meyering <jim@meyering.net>
7292 When selecting ranges of byte offsets (as opposed to ranges of fields)
7293 and when --output-delimiter=STRING is specified, output STRING between
7294 ranges of selected bytes.
7295 * src/cut.c (RANGE_START_SENTINEL): Define.
7296 (output_delimiter_specified): New global.
7297 (print_kth): Add parameter. Adjust all callers.
7298 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
7299 (cut_bytes): When requested, output STRING between ranges of
7301 (main): Make a diagnostic a little clearer.
7302 Based on a patch from Jan Nieuwenhuizen.
7304 * tests/cut/Test.pm: New tests for the above.
7306 * src/cut.c (set_fields): Make code agree with comment:
7307 Don't merge abutting ranges like 4- and 2-3. This makes no
7308 difference currently, but is required to support an upcoming change.
7310 2003-01-07 Jim Meyering <jim@meyering.net>
7312 * src/cut.c (set_fields): Fix typo in comment.
7314 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
7315 * tests/touch/Makefile.am (TESTS): Add not-owner.
7316 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
7317 Now, this tests only the nonexistent-directory diagnostic.
7318 Suggestion from Michael Stone.
7320 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
7322 2003-01-04 Jim Meyering <jim@meyering.net>
7324 * src/copy.h: Remove use of PARAMS.
7325 * src/remove.h: Likewise.
7326 * src/chown-core.h: Likewise.
7328 rm could be tricked into mistakenly reporting a cycle.
7329 * src/remove.c: [cycle_check_state]: New global.
7330 (remove_cwd_entries): Adapt to new semantics of cycle_check.
7331 (rm): Call cycle_check_init and cycle_check_free for each file.
7332 * tests/rm/cycle (rm): New test, for the above fix.
7333 * tests/rm/Makefile.am (TESTS): Add cycle.
7335 When rm detects a cycle, don't abort the entire command,
7336 but rather just the affected command line argument.
7337 * src/remove.c: Include <setjmp.h>
7338 (struct dirstack_state) [current_arg_jumpbuf]: New member.
7339 (remove_cwd_entries): Call longjmp if we detect a cycle.
7340 (rm): Call setjmp here.
7342 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
7343 Instead, include cycle-check.h and use it.
7345 * src/remove.h (struct dev_ino): Remove declaration.
7347 * src/remove.c (remove_cwd_entries): Fix typos in comment.
7349 Don't include trailing /. in diagnostics about directories.
7350 * src/remove.c (full_filename_): When FILENAME is just `.'
7351 and there is a nonempty directory-name part, don't append `/.'.
7352 * tests/rm/unread2: Remove trailing /. from diagnostic.
7353 * tests/rm/rm2: Likewise.
7355 * src/remove.c (struct dirstack_state): Define.
7356 To be used in place of these file-scoped globals ...
7357 (dir_stack, len_stack, Active_dir): Remove globals.
7358 (ds_init, ds_free): New functions.
7359 (full_filename): Define.
7360 (full_filename_): Rename from full_filename.
7362 Begin to make AD_* functions more generic.
7363 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
7364 (AD_push): Likewise.
7365 (AD_INIT_OTHER_MEMBERS): Define.
7366 (remove_dir): Define the `status' member manually after each
7367 call to AD_push or AD_push_initial.
7369 * src/Makefile.am (check-misc): New rule, to ensure that no more
7370 S_IS* macro definitions sneak into the code.
7371 (check): Depend on check-misc.
7373 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
7374 * src/du.c (count_entry) [S_ISLNK]: Don't define.
7375 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
7377 2003-01-03 Jim Meyering <jim@meyering.net>
7379 * src/true.c: Add copyright.
7380 (AUTHORS): I suppose I've written it.
7382 * src/Makefile.am (false.c): Make the generated file be read-only.
7384 2003-01-04 Jim Meyering <jim@meyering.net>
7386 * src/ls.c: Include "dev-ino.h".
7387 [struct dev_ino]: Remove declaration.
7389 2003-01-02 Jim Meyering <jim@meyering.net>
7391 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
7392 from mv: s/missing file arguments/missing file argument/.
7393 With --target-directory=DIR, cp and mv work with a single file argument.
7394 Reported by Karl Berry.
7396 * tests/rm/isatty: Enable this test.
7398 2002-12-31 Jim Meyering <jim@meyering.net>
7400 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
7401 (AD_push): Likewise.
7402 (AD_INIT_OTHER_MEMBERS): Define.
7403 (remove_dir): Define the `status' member manually after each
7404 call to AD_push or AD_push_initial.
7406 * src/ls.c [struct dev_ino]: Remove definition.
7407 Include "dev-ino.h" instead.
7409 2002-12-28 Jim Meyering <jim@meyering.net>
7411 * tests/du/Makefile.am (TESTS): Add no-deref.
7412 * tests/du/no-deref: New script.
7414 2002-12-23 Jim Meyering <jim@meyering.net>
7416 * src/remove.c (remove_cwd_entries): Fix typo in comment.
7418 2002-12-21 Jim Meyering <jim@meyering.net>
7420 * announce-gen: Generate MML-formatted announcement.
7421 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
7423 2002-12-20 Jim Meyering <jim@meyering.net>
7425 * src/touch.c (touch): Change the wording of a diagnostic so
7426 that it makes sense both when the file exists and when it doesn't.
7427 Suggestion from Michael Stone.
7429 2002-12-18 Jim Meyering <jim@meyering.net>
7431 * src/stty.c (valid_options): Declare to be static.
7433 2002-12-15 Jim Meyering <jim@meyering.net>
7435 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
7437 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
7438 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
7439 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
7440 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
7441 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
7443 * src/remove.c (PARAMS): Remove definition.
7444 * src/sys2.h: Likewise.
7446 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
7447 Include strftime.h instead.
7449 2002-12-14 Jim Meyering <jim@meyering.net>
7451 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
7453 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
7454 This is necessary at least for Irix6.5 when using c89.
7455 Reported by Nelson Beebe.
7457 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
7459 * tests/misc/cat-tty-eof: New test.
7461 * src/mknod.c (usage): Specify how major and minor mode numbers
7462 are interpreted. Report forwarded by Kristin E Thomas.
7463 * src/mknod.c: Remove now-redundant usage-specifying comment.
7465 2002-12-13 Jim Meyering <jim@meyering.net>
7469 * tests/du/trailing-slash: Allow for a directory of size `0'.
7470 That happens at least on file systems of type tmpfs on linux-2.4.18.
7472 * announce-gen: New script to begin replacing the commands
7473 associated with the rule here...
7474 * Makefile.maint (announcement): Invoke announce-gen.
7475 * Makefile.am (EXTRA_DIST): Add announce-gen.
7477 * tests/cp/preserve-2: New file/test, for latest fix.
7478 * tests/cp/Makefile.am (TESTS): Add preserve-2.
7480 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
7482 Fix a bug whereby cp would fail to parse an option like
7483 --preserve=mode,ownership.
7484 * src/cp.c (decode_preserve_arg): Advance `comma' to
7485 point the character following the comma.
7487 2002-12-11 Jim Meyering <jim@meyering.net>
7489 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
7490 in case it's already defined.
7492 2002-12-09 Jim Meyering <jim@meyering.net>
7494 * tests/touch/fail-diag: Don't get a test failure if /no exists.
7495 Instead, evoke a framework failure if /no-$$ exists.
7496 Reported by Michael Stone.
7498 2002-12-08 Jim Meyering <jim@meyering.net>
7500 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
7501 Define to rpl_lstat, so that even on systems like Solaris 5.8,
7502 du honors (per POSIX) the trailing slash on an argument referring
7503 to a symlink-to-directory.
7505 2002-12-06 Jim Meyering <jim@meyering.net>
7507 * Use autoconf-2.57. Regenerate dependent files.
7508 * Use automake-1.7.2. Regenerate dependent files.
7510 * src/ls.c (gobble_file): Also stat the file if it's a
7511 regular file and --indicator-style=classify (aka -F).
7512 Thanks to Ed Santiago for opening my eyes.
7514 * tests/ls/file-type: New file. Test for the above.
7515 A test to contrast ls -F and ls --indicator-style=file-type.
7516 * tests/ls/Makefile.am (TESTS): Add file-type.
7518 2002-12-04 Jim Meyering <jim@meyering.net>
7520 * tests/ls/follow-slink: Make sure the symlink was created.
7521 Richard Dawe reported that `ln -s link link' succeeds, but creates
7522 no file on systems running some version of the DJGPP libc.
7524 2002-12-03 Jim Meyering <jim@meyering.net>
7526 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
7527 since this package no longer panders to K&R compilers.
7529 2002-12-02 Jim Meyering <jim@meyering.net>
7531 * tests/du/slink: Skip this test if `.' is on a non-local file system.
7533 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
7534 something to replace.
7536 2002-12-01 Jim Meyering <jim@meyering.net>
7538 * src/stat.c: Don't include <string.h> or <ctype.h>.
7539 That's already done via system.h.
7540 * src/dircolors.c: Don't include <ctype.h>.
7542 2002-11-30 Jim Meyering <jim@meyering.net>
7544 * ls.c (gobble_file): Remove the block of code that caused
7545 `ls --color -F symlink-to-dir' to list the files in
7546 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
7547 like `ls -F symlink-to-dir') but with the addition of highlighting.
7548 Similarly, `ls --color -dF symlink-to-dir' would print
7549 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
7550 Reported by Jeff Sheinberg as Debian bug #168203.
7551 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
7553 ls is now more efficient: with certain options, it no longer needs
7554 to stat each directory entry on systems with valid dirent.d_type.
7555 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
7556 (main): Make --recursive set format_needs_type, not format_needs_stat.
7557 (gobble_file): Remove a FIXME comment, now that it's fixed.
7559 2002-11-24 Jim Meyering <jim@meyering.net>
7561 * src/du.c (du_files): Don't strip any trailing slash.
7562 Rewrite so that `/' is no longer represented internally as
7564 (count_entry): When appending a file name component,
7565 account for the fact that the current path may end in `/'.
7566 François Pinard reported that `du symlink-to-dir/' was not
7567 equivalent to `du symlink-to-dir/.'. Now it is.
7568 * tests/du/trailing-slash: New file/test, for the above fix.
7569 * tests/du/Makefile.am (TESTS): Add trailing-slash.
7571 2002-11-23 Jim Meyering <jim@meyering.net>
7573 * src/tac.c (output): Declare some local variables to be of type size_t,
7574 rather than `int' to avoid warnings from gcc.
7576 2002-11-21 Paul Eggert <eggert@twinsun.com>
7578 * src/ls.c (decode_switches): Use case-sensitive matching to
7579 decode the QUOTING_STYLE environment variable. This is more
7580 consistent with the documentation, and with --quoting-style.
7582 2002-11-21 Martin Buck <martin.buck@ascom.ch
7584 * src/stty.c (struct speeds): Add support for all baud rates defined
7587 2002-11-19 Jim Meyering <jim@meyering.net>
7589 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
7590 run in a UTF locale. Report and suggested fix by Bruno Haible.
7591 * tests/fmt/basic: Likewise.
7593 2002-11-17 Jim Meyering <jim@meyering.net>
7595 * configure.ac: Update via autoupdate.
7596 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
7598 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
7599 Reported by Hans Ginzel.
7601 2002-11-15 Jim Meyering <jim@meyering.net>
7603 * Makefile.cfg (gnu_rel_host): Define.
7604 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
7605 on whether $(VERSION) looks like a major release number.
7607 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
7608 (release): Rename from `alpha'.
7609 (alpha): Depend on release.
7611 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
7613 2002-11-14 Jim Meyering <jim@meyering.net>
7615 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
7616 (announcement): Use the new variable.
7618 * Makefile.maint: Sync with Bison, i.e.:
7619 (po-check): Scan .l and .y files instead of the
7620 .c and the .h files that they generate. This fixes the bug
7621 reported by Tim Van Holder in:
7622 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
7623 Look for N_ as well as for _. Try to avoid matching #define for
7627 2002-11-12 Jim Meyering <jim@meyering.net>
7629 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
7630 Replace sole use with equivalent `#ifdef S_ISLNK'.
7631 Inconsistency reported by Dmitry V. Levin.
7633 2002-11-11 Jim Meyering <jim@meyering.net>
7635 * src/stat.c (usage): Transform --help items output via s/ - / /,
7636 so that help2man produces properly formatted man pages.
7637 Reported by Herbert Xu as Debian bug #168400.
7639 2002-11-10 Jim Meyering <jim@meyering.net>
7641 * src/ls.c (sighandler): Handle SIGTSTP specially.
7642 Based on suggestions from Solar Designer and Dmitry V. Levin.
7645 * Makefile.cfg (cvs_files): Define. From autoconf.
7646 (local_updates): Likewise.
7648 * src/ls.c (restore_default_color_handler, sigtstp_handler):
7650 (sighandler): New function, based on the one in sort.c.
7651 (main): Use sigaction, if possible; otherwise signal.
7652 Handle these signals:
7653 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
7654 Don't register our handler if the signal is already being ignored.
7656 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
7657 * src/csplit.c (interrupt_handler): Likewise.
7658 * src/sort.c (sighandler): Likewise.
7659 (main): Declare `i' and `nsigs' to be unsigned, not int.
7661 2002-11-09 Jim Meyering <jim@meyering.net>
7663 ls --color: restore terminal text color upon signal.
7664 * src/ls.c: Include "full-write.h" and <signal.h>.
7665 (restore_default_color, restore_default_color_handler): New functions.
7666 (sigtstp_handler, put_indicator_direct): New functions.
7667 (main) [print_with_color]: Register signal handlers.
7668 Patch mostly by Solar Designer and Stanislav Ievlev.
7670 Update from autoconf.
7671 * Makefile.maint (AMTAR): Remove definition.
7672 (update, cvs-update, po-update, do-po-update): New rules.
7673 (wget-update): Update (thus renaming to cvs-update).
7674 (automake_repo): Use anoncvs@sources.redhat.com.
7676 2002-11-06 Jim Meyering <jim@meyering.net>
7678 * tests/misc/Makefile.am (TESTS): Add printf-hex.
7680 * tests/misc/printf: Be careful to test the code in this package,
7681 not the shell built-in function.
7683 * src/printf.c (print_esc): A hexadecimal escape sequence has
7684 at most two hex. digits, not three. Reported by Padraig Brady.
7685 (usage): Update description.
7686 * tests/misc/printf-hex: New file/test, for the above fix.
7688 2002-10-07 Paul Eggert <eggert@twinsun.com>
7690 Add support for locale-specific size indications (e.g.,
7691 thousands-separators) and for explicit size suffixes on output.
7693 * doc/coreutils.texi (Block size): Say that:
7694 This affects display format as well as block size.
7695 Fractional block counts are rounded up.
7696 ls file size blocksize defaults to 1.
7697 A block size spec preceded by ' generates thousands separators.
7698 A suffix without a preceding integer generates suffixes.
7699 (tail invocation): 32k -> 32 KiB.
7700 (What information is listed): ls -h is now equivalent to
7701 ls --block-size=human, and ls -H is now equivalent to
7702 ls --block-size=si. Displayed file size is now always affected by
7705 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
7706 lib/umaxtostr.c: New files, taken from GNU tar.
7708 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
7710 (EXTRA_DIST): Add inttostr.c.
7712 * lib/human.c, lib/human.h: Rewrite to support locale-specific
7713 notations like thousands separators.
7714 Specify what includer of include.h must include beforehand.
7715 (human_group_digits, human_suppress_point_zero, human_autoscale,
7716 human_base_1024, human_SI, human_B): New enum values.
7717 (human_readable): Rename from human_readable_inexact; put the
7718 options before the sizes. All uses changed. The old human_readable
7719 function has been removed; use inttostr.h instead.
7720 (human_options): Renamed from human_block_size, with new signature
7721 that allows block sizes up to UINTMAX_MAX. All callers changed.
7723 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
7724 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
7725 freestanding C89. No need to check for stdlib.h or string.h since
7726 autoconf does this now.
7728 * src/cksum.c (cksum): Use primitives from inttostr.h, not
7729 human.h, to print large numbers simply.
7730 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
7731 * src/dd.c (print_stats, main): Likewise.
7732 * src/df.c (print_header): Likewise.
7733 * src/factor.c (print_factors): Likewise.
7734 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
7735 * src/shred.c (dopass): Likewise.
7736 * src/sort.c (checkfp): Likewise.
7737 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
7738 * src/tail.c (xlseek): Likewise.
7739 * src/wc.c (write_counts, wc): Likewise.
7741 * src/df.c (human_output_opts): New var.
7742 (output_block_size): Now uintmax_t, not int, to handle larger
7743 block sizes. All uses changed.
7744 * src/du.c: Likewise.
7745 * src/ls.c: Likewise.
7747 * src/df.c (print_header): In the header line, prefer SI to human
7748 representation if it's shorter; if neither is shorter, try to
7749 intuit what the user would prefer.
7751 * src/expr.c (inttostr): Remove; use new imaxtostr library
7754 * src/ls.c (file_output_block_size): New var, to distinguish
7755 file sizes from other sizes.
7756 (decode_switches): Set it.
7758 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
7759 (dopass): When printing progress, use floor for what has been done
7760 so far (since we should be conservative there), and ceiling for
7761 what needs to be done (since that's what other programs use).
7763 2002-10-19 Jim Meyering <jim@meyering.net>
7765 * src/pinky.c (print_heading): Align TTY and Name headings.
7766 Reported by Karl Eichwalder.
7768 2002-10-18 Jim Meyering <jim@meyering.net>
7770 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
7771 Remove now-useless cast.
7772 (stdread): Remove function.
7773 (bytes_split): Use size_t instead of int.
7774 Use safe_read, not stdread.
7775 (lines_split): Likewise.
7776 Use memchr rather than a `while' loop.
7777 (line_bytes_split): Use size_t instead of int.
7778 Use safe_read, not stdread.
7779 (main): Add some FIXME comments to remind me to remove casts.
7781 * src/system.h (ST_BLKSIZE): Correct comment describing how to
7782 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
7784 2002-10-17 Jim Meyering <jim@meyering.net>
7786 Fix a problem that could make e.g., `cat' misbehave on systems which
7787 give invalid (unreasonably large) values for stat.st_blksize.
7788 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
7789 Reported by Petter Reinholdtsen.
7791 2002-10-14 Jim Meyering <jim@meyering.net>
7793 Specifying a printf conversion specifer as nl's separator string
7794 could cause nl to segfault.
7795 * src/nl.c (build_print_fmt): Don't include separator string
7796 in the printf format; it might contain `%'.
7797 Use a better bound on the length of the print_fmt buffer.
7798 (print_lineno): Print the separator here instead.
7799 Reported by Doug Coleman.
7801 * tests/misc/nl: New file/tests, including a test for the above.
7802 * tests/misc/Makefile.am (TESTS): Add nl.
7804 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
7805 * tests/misc/Makefile.am (TESTS): Add split-l.
7807 2002-10-13 Jim Meyering <jim@meyering.net>
7811 * src/du.c (usage): Tweak description of --dereference-args/-D.
7813 * src/du.c (count_entry): Also save cwd when dereferencing (via
7814 --dereference-args, -D) a command-line argument.
7815 Reported by Michal Svec. Based on a patch by Andreas Schwab.
7817 * src/Makefile.am (../AUTHORS): New target/rule.
7819 2002-10-12 Jim Meyering <jim@meyering.net>
7821 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
7822 of type size_t, since that's the way it's used and avoids a warning.
7824 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
7825 since that's how it's always used and avoids a new warning from gcc.
7826 (read_input): Adapt to new safe_read ABI.
7828 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
7831 * src/pinky.c (print_long_entry): fread returns size_t.
7832 Declare local `bytes' accordingly, to avoid warning.
7834 tail -c +N would perform an extra read after encountering EOF
7835 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
7836 * src/tail.c (start_bytes): Detect EOF, inform caller.
7837 (tail_bytes): Upon EOF in start_bytes, return immediately.
7838 (file_lines): Reorganize to use memrchr rather than an explicit loop.
7839 Adapt to new safe_read ABI.
7841 2002-10-11 Jim Meyering <jim@meyering.net>
7843 * tests/du/deref: New file/test, for the above fix.
7844 * tests/du/Makefile.am (TESTS): Add deref.
7846 2002-10-10 Jim Meyering <jim@meyering.net>
7848 * tests/ln/Makefile.am (TESTS): Add target-1.
7849 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
7851 2002-10-09 Jim Meyering <jim@meyering.net>
7853 * tests/cp/backup-is-src: Ensure that certain environment variables
7854 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
7856 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
7857 consume 4GB of disk space on systems without support for sparse files.
7858 Fix a logic error that'd make it `cat err' even though dd didn't fail.
7860 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
7861 Patch by steven@magelico.net, forwarded by Michael Stone.
7863 * tests/ls/dired: Ensure that ls produces English messages.
7864 Patch by Alexey Vyskubov, forwarded by Michael Stone.
7866 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
7868 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
7870 2002-10-08 Jim Meyering <jim@meyering.net>
7872 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
7873 Fix syntax in test: use =, not ==.
7874 Reported by Bob Proulx.
7875 Change all the rest like this: grep -lR "testing framework'" .\
7876 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
7878 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
7879 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
7880 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
7881 * src/wc.c (wc): Likewise.
7883 2002-10-07 Paul Eggert <eggert@twinsun.com>
7886 Don't advance the write pointer past the end of the write buffer.
7887 * src/sort.c (begfield, limfield): Likewise.
7889 2002-10-07 Jim Meyering <jim@meyering.net>
7891 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
7892 * src/head.c (head_bytes, head_lines): Likewise.
7894 2002-10-06 Jim Meyering <jim@meyering.net>
7896 * src/dd.c (scanargs): Ensure that specified block sizes (specified
7897 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
7898 (skip, dd_copy): Adapt to new safe_read ABI.
7900 * Makefile.maint (signatures): Define.
7902 (announcement): Depend on $(signatures).
7904 * Makefile.maint (announcement): Output all URLs for detached
7905 signatures, not just the last one from the previous loop.
7907 2002-10-05 Jim Meyering <jim@meyering.net>
7911 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
7912 don't recurse into directory, DIR. Prompted by a report from
7915 * tests/rm/i-no-r: New file/test, for the above fix.
7916 * tests/rm/Makefile.am (TESTS): Add i-no-r.
7918 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
7919 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
7921 2002-10-03 Jim Meyering <jim@meyering.net>
7923 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
7924 * src/df.c (AUTHORS): Likewise.
7925 * src/du.c (AUTHORS): Likewise.
7926 * src/tail.c (AUTHORS): Likewise.
7927 * src/touch.c (AUTHORS): Likewise.
7929 2002-10-02 Jim Meyering <jim@meyering.net>
7931 * Makefile.am (SUBDIRS): Remove `old'.
7932 (EXTRA_DIST): List the files in old/.
7933 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
7934 Suggestion from Akim Demaille.
7936 2002-10-01 Jim Meyering <jim@meyering.net>
7938 * src/sys2.h (SSIZE_MAX): Define.
7940 2002-09-30 Jim Meyering <jim@meyering.net>
7942 * src/csplit.c: Don't include stdlib.h here. It's already included
7945 2002-09-29 Jim Meyering <jim@meyering.net>
7947 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
7948 expression to avoid bogus warning from gcc.
7950 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
7951 (cat): Declare insize and outsize to be of type size_t, not int.
7952 Rearrange pointer/integer expressions to avoid bogus warnings.
7953 (main): Declare insize and outsize to be of type size_t, not int.
7955 * src/tail.c (parse_options): Give a sensible diagnostic for
7956 an invalid byte or line count. Reported by Mikko Tuumanen.
7958 * src/touch.c (main): Split a long line.
7960 * tests/du/Makefile.am (TESTS): Add slink.
7961 * tests/du/slink: New test for system.h change of 2002-08-31.
7963 In move mode, always first try to rename. Before, upon failure to
7964 rename a directory, this code would never attempt to rename any
7965 other file in that directory, but would thenceforth always copy.
7966 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
7967 may fail with EXDEV, yet renaming files within that directory to
7968 a newly-created destination directory succeeds.
7969 * src/copy.c (copy_internal): Remove local, move_mode;
7970 use x->move_mode instead. Based on a patch from Tom Haynes.
7972 2002-09-28 Jim Meyering <jim@meyering.net>
7974 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
7975 Factor out some duplication.
7977 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
7979 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
7981 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
7982 to avoid compiler warnings.
7984 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
7987 Fix things so `mkdir -p' can create very deep directories, e.g.,
7988 mkdir -p $(perl -e 'print "a/" x 40000') now works.
7989 * src/mkdir.c (main): For --parents (-p), call make_path with the
7990 entire directory name, so we don't ever require that file operations
7991 like stat or chmod be performed on the entire command line argument.
7992 * makepath.c (make_path): Restore umask *before* creating the final
7995 2002-09-27 Andreas Schwab <schwab@suse.de>
7997 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
7998 to avoid overflow. Reported by Hans Lermen.
8000 2002-09-26 Jim Meyering <jim@meyering.net>
8002 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
8004 2002-09-25 Jim Meyering <jim@meyering.net>
8006 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
8007 and add a cast, to avoid a warning about `signed and unsigned type in
8008 conditional expression'.
8010 2002-09-22 Jim Meyering <jim@meyering.net>
8012 * src/rmdir.c: Include "dirname.h", for declaration of
8013 strip_trailing_slashes.
8015 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
8016 Now they're defined through system.h.
8018 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
8019 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
8020 since it's already included from sys2.h via system.h.
8022 * Use automake-1.6f. Regenerate dependent files.
8024 * src/Makefile.am (PERL): Remove duplicate definition.
8026 fmt's -s, -t, -c options didn't work properly for long lines.
8027 Since get_line may end up calling put_paragraph (for long lines),
8028 be sure to set global, `other_indent', before it is used there.
8030 * src/fmt.c (set_other_indent): New function, factored out of...
8031 (get_paragraph): ... here. Call it.
8032 (get_line): Call set_other_indent before calling flush_paragraph,
8033 which calls fmt_paragraph, which in turn calls put_paragraph,
8034 which uses other_indent.
8036 * tests/fmt/Makefile.am (TESTS): Add long-line.
8037 * tests/fmt/long-line: New file/test, for the above fix.
8039 2002-09-21 Jim Meyering <jim@meyering.net>
8041 * src/od.c: No longer include deprecated <values.h>.
8042 It was required solely for now-removed reference to BITSPERBYTE.
8043 * src/install.c: Likewise.
8044 Suggestion from Bruno Haible.
8046 2002-09-06 Andreas Schwab <schwab@suse.de>
8048 `rmdir -p dir-specified-with-trailing-slash/' would fail.
8049 * src/rmdir.c (remove_parents): Strip trailing slashes.
8051 2002-09-20 Jim Meyering <jim@meyering.net>
8053 * tests/rmdir/t-slash: New file/test, for the above fix.
8054 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
8056 * Makefile.maint (announcement): Arrange to gpg-sign the message.
8057 Add a URL for each detached signature file.
8059 2002-09-07 Bruno Haible <bruno@clisp.org>
8061 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
8063 2002-09-18 Jim Meyering <jim@meyering.net>
8065 `od -t x8' used the wrong (`l'-prefixed) printf format.
8066 Likewise for the o8 and u8 formats.
8067 * src/od.c (ISPEC_TO_FORMAT): Define macro.
8068 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
8069 Reported by Arun Sharma.
8071 2002-09-17 Jim Meyering <jim@meyering.net>
8073 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
8074 From gettext's intl/loadmsgcat.c.
8076 * tests/od/x8: New file/test, for the above fix.
8077 * tests/od/Makefile.am (TESTS): Add x8.
8079 2002-09-15 Jim Meyering <jim@meyering.net>
8081 * Use autoconf-2.54. Regenerate dependent files.
8083 * src/csplit.c (get_format_width): Add cast to avoid
8084 warning about `signed and unsigned type in conditional expression'.
8086 2002-09-14 Jim Meyering <jim@meyering.net>
8088 * src/who.c (print_user): Change type of local to size_t
8089 to avoid warnings about `comparison between signed and unsigned'.
8090 * src/ptx.c (generate_all_output): Likewise.
8092 * src/dd.c (main, skip): Add casts to avoid warnings about
8093 `comparison between signed and unsigned'.
8095 * src/id.c (print_full_info, print_group_list): Add casts to avoid
8096 warnings about `signed and unsigned type in conditional expression'.
8098 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
8099 to avoid warnings about `comparison between signed and unsigned'.
8100 (split_3): Change parameter names to be readable and add comment.
8101 Clean up the test for whether a line may be ignored.
8103 2002-09-13 Jim Meyering <jim@meyering.net>
8105 * src/printf.c (main): Handle leading command line argument of `--'.
8106 Reported by Raul: DervishD <raul@pleyades.net>
8107 * tests/misc/printf: New file: test for the above.
8108 * tests/misc/Makefile.am (TESTS): Add printf.
8110 * src/date.c (usage): Explain that %S's range of [0..60] is required --
8111 rather than 0..59 -- to accommodate the occasional positive leap second.
8112 Reported by Richard Neill.
8114 2002-09-12 Jim Meyering <jim@meyering.net>
8116 * src/Makefile.am (nanosec_libs): Define.
8117 (sleep_LDADD, tail_LDADD): Use it here.
8119 Factor nanosleep-related code into ../lib/xnanosleep.c.
8120 * src/sleep.c: Include xnanosleep.h.
8121 Factor out fenv.h-related code.
8122 (timespec_subtract): Remove function.
8123 (main): Remove code that deals with computing start and stop times
8124 as well as the loop around nanosleep. Now that's in xnanosleep.c.
8126 Allow S (in --sleep-interval=S) to be a floating point value.
8127 * src/tail.c: Include xnanosleep.h and xstrtod.h.
8128 Move declaration of global variable, sleep_interval, to ...
8130 (usage): Update description of --sleep-interval option.
8131 (tail_forever): New parameter, sleep_interval. Update caller.
8132 Use xnanosleep, rather than sleep.
8133 (parse_options): New parameter, sleep_interval. Update caller.
8134 Use xstrtod, now that we accept floating point values.
8135 Prompted by a patch from Augey Mikus.
8137 2002-09-06 Jim Meyering <jim@meyering.net>
8139 * src/remove.c (prompt): Change comment to give a better note to
8140 translators. From Michael Piefel.
8142 2002-09-02 Jim Meyering <jim@meyering.net>
8144 * README: A good problem report/patch includes diffs against
8145 the most recent test release.
8147 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
8148 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
8150 * src/kill.c (print_table_row): Use an unsigned type for widths
8151 to avoid warning about comparison between signed and unsigned.
8152 (list_signals): Likewise.
8154 * src/od.c (skip): Add a cast to avoid warning about comparison
8155 between signed and unsigned.
8156 * src/install.c (get_ids): Likewise. Also rearrange range-checking
8157 comparisons to make them more readable.
8159 2002-09-01 Jim Meyering <jim@meyering.net>
8163 2002-08-31 Jim Meyering <jim@meyering.net>
8165 Symlinks were always reported as using 0 blocks.
8166 * src/system.h (ST_NBLOCKS): Don't depend on file type.
8167 This reverts the change of 2000-01-30.
8168 Based on a report and patch from Neil Brown via Michael Stone.
8169 This fixes Debian Bug#156358.
8171 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
8172 `exit (1)' to `exit (EXIT_FAILURE)', and
8173 `usage (1)' to `usage (EXIT_FAILURE)'.
8175 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
8176 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
8177 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
8178 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
8179 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
8180 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
8181 error never exits successfully.
8183 2002-08-29 Jim Meyering <jim@meyering.net>
8185 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
8186 when ignoring any return value.
8188 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
8189 failures. On some systems (at least EMC Celerra and Solaris5.8),
8190 this appears to be necessary.
8191 (is_empty_dir): Likewise. Also, always close directory handle.
8192 * src/ls.c (print_dir): Likewise.
8193 (print_dir): Rename local variable: reading -> dirp.
8194 Reported by Mike Coleman.
8196 2002-08-28 Jim Meyering <jim@meyering.net>
8198 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
8199 Give a diagnostic and fail if closedir fails.
8201 2002-08-26 Jim Meyering <jim@meyering.net>
8203 * Makefile.am (THANKS-to-translators): New rule.
8204 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
8205 * THANKStt.in: New file.
8207 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
8209 (main): Register it with atexit.
8210 Close STDOUT_FILENO, to avoid a problem when writing to
8211 /dev/audio on at least Solaris 5.7 and 5.8 systems.
8212 Reported by Shing-Shong Shei.
8214 2002-08-25 Jim Meyering <jim@meyering.net>
8216 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
8217 * src/tac.c (main): Likewise.
8218 * src/tail.c (main): Likewise.
8219 * src/tee.c (main): Likewise.
8220 * src/tr.c (main): Likewise.
8221 * src/wc.c (main): Likewise.
8223 2002-08-20 Jim Meyering <jim@meyering.net>
8225 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
8227 2002-08-10 Paul Eggert <eggert@twinsun.com>
8229 * src/nohup.sh: Don't use "exec --"; it's not portable and
8230 shouldn't be needed.
8232 2002-08-09 Jim Meyering <jim@meyering.net>
8234 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
8235 (usage): Clarify help text for the -COLUMN option.
8236 Patch by Padraig Brady.
8237 * tests/pr/Test.pm [col-last]: New test for the above.
8239 * configure.ac: Start with version 4.5.1, chosen so that it's larger
8240 than the latest version numbers of the component packages.
8242 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
8245 2002-08-08 Jim Meyering <jim@meyering.net>
8247 * src/date.c: Guard inclusion of <langinfo.h> with
8248 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
8249 * src/sort.c: Likewise.
8250 Patch by GOTO Masanori.
8252 2002-08-05 Paul Eggert <eggert@twinsun.com>
8254 Fix some minor time-related bugs with POSIX time arguments.
8255 Some valid time stamps were being rejected (notably -1, and
8256 time stamps before 1900 on 64-bit hosts). And some invalid
8257 time stamps were being accepted, e.g. September 31.
8259 * src/date.c (main): Adjust to posixtime signature change.
8260 * src/touch.c (main): Likewise. Remove unnecessary initialization.
8261 Use localtime, not posixtm, to warn about obsolete "touch".
8263 2002-08-05 Jim Meyering <jim@meyering.net>
8265 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
8267 2002-08-04 Jim Meyering <jim@meyering.net>
8269 * src/Makefile.am (check-README): New target/rule.
8270 (check): Depend on it.
8272 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
8274 2002-08-03 Jim Meyering <jim@meyering.net>
8276 * Makefile.am (SUBDIRS): Add old.
8277 * old/: New directory, containing legacy ChangeLog* and NEWS files
8278 from the fileutils, sh-utils, and textutils packages.
8280 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
8282 2002-08-02 Paul Eggert <eggert@twinsun.com>
8284 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
8286 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
8287 (hard_LC_COLLATE): New var.
8288 (different): Args are now char *, not const char *.
8289 Use xmemcoll instead of memcmp to compare lines, so that
8290 LC_COLLATE has effect. However, use memcmp if it is an
8292 (check_file): Do not include newline in comparison, so that
8293 xmemcoll has a byte to stomp on temporarily.
8294 (main): Set hard_LC_COLLATE.
8296 2002-07-29 Jim Meyering <jim@meyering.net>
8298 * Makefile.am (SUBDIRS): Remove djgpp, for now.
8300 2002-07-20 Jim Meyering <jim@meyering.net>
8302 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
8303 into EXIT_FAILURE. Otherwise, false --help and false --version
8306 2002-07-08 Jim Meyering <jim@meyering.net>
8308 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
8309 rather than the hard-coded `sh-utils'.
8311 2002-07-01 Jim Meyering <jim@meyering.net>
8313 * configure.ac: Merge the three files from fileutils,
8314 textutils, and sh-utils.
8315 * Makefile.am: Likewise.
8316 * src/Makefile.am: Likewise.