1 2005-04-12 Jim Meyering <jim@meyering.net>
5 * src/tsort.c (tsort): Use "%s" as the format string,
6 rather than a diagnostic or a file name.
8 * src/comm.c (compare_files): Remove declaration of unused local.
10 * src/chown-core.c (chopt_free): Mark parameter as unused.
12 2005-04-11 Paul Eggert <eggert@cs.ucla.edu>
14 * man/chown.x: Reword to match user manual.
16 * src/setuidgid.c (usage): Use "user ID", not "UID", and similarly
18 * src/whoami.c (usage, main): Likewise.
20 Add bulletproofing for cases where stdin, stdout, or stderr are closed.
21 * src/comm.c: Include stdio-safer.h.
22 (compare_files): Exit right away on I/O error rather than continuing
23 and producing confusing output and error messages.
24 Return void, not int; all callers changed.
25 Use fopen_safer to avoid confusion with file descriptors.
26 * src/copy.c: Include unistd-safer.h.
27 (copy_reg): Use fd_safer.
28 * src/csplit.c: Include stdio-safer.h.
29 (input_desc): Remove unnecessary static initialization.
30 (set_input_file): Use STDIN_FILENO, not 0.
31 (create_output_file): Use fopen_safer.
32 * src/dircolors.c (dc_parse_file): Don't assume fopen does not
34 * src/head.c (head_file): Don't assume open does not return 0.
35 * src/join.c: Include stdio-safer.h.
36 (main): Use fopen_safer. Simplify the resulting code.
37 * src/md5sum.c (digest_file, digest_check):
38 Don't assume that fopen does not return stdin.
39 * src/nohup.c: Include unistd-safer.h.
40 (main): Don't dup stderr to stdin or stdout by mistake.
41 * src/od.c (check_and_close): Don't assume fopen does not return stdin.
42 * src/paste.c (paste_serial): Likewise.
43 * src/pr.c: Include stdio-safer.h.
44 (open_file): Use fopen_safer.
45 (close_file): Don't assume fopen does not return stdin.
46 * src/ptx.c (main): Don't assume fopen returns stdout after closing
47 stdout. Use freopen instead.
48 * src/shred.c: Include unistd-safer.h.
49 (wipename): Use fd_safer on directory file descriptor.
50 (wipefile): Remove special case for /dev/fd/* on older hosts.
51 It didn't work in general, and wasn't documented.
53 * src/sort.c: Include unistd-safer.h.
54 (create_temp_file): Use fd_safer.
55 (xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
56 * src/split.c: Include unistd-safer.h.
57 (cwrite): Use fd_safer. Replace mystery constant 0666 with symbolic
58 version, as POSIX requires.
59 * src/sum.c (bsd_sum_file, sysv_sym_file):
60 Use same pattern as elsewhere for checking for stdin.
61 * src/tac.c: Include unistd-safer.h.
62 (copy_to_temp): Use fd_safer.
63 (tac_file): Don't assume fopen cannot return stdin.
64 * src/tail.c: Include unistd-safer.h rather than fcntl-safer.h.
65 (recheck, tail_file): Use fd_safer rather than open_safer.
66 * src/tee.c: Include stdio-safer.h.
67 (tee): Use fopen_safer.
68 * src/touch.c: Include unistd-safer.h.
69 (touch): Use fd_safer.
70 * src/tsort.c (have_read_stdin): Remove; no longer needed. All uses
72 (tsort): Do not assume fopen can't return stdin.
73 Close stdin before returning. All uses changed.
74 * src/unexpand.c (next_file): Don't assume fopen cannot return stdin.
75 * src/uniq.c: Include stdio_safer.h.
76 (check_file): Don't assume fopen cannot return stdin or stdout.
78 2005-04-09 Jim Meyering <jim@meyering.net>
80 * src/dd.c (quit): Define with ATTRIBUTE_NORETURN.
82 Now that close_stdout closes standard output unconditionally,
83 these workarounds for dd and cat are no longer necessary.
84 * src/dd.c (close_stdout_wrapper): Remove function.
85 (main): Call atexit with close_stdout, instead.
86 * src/cat.c (close_stdout_wrapper): Likewise.
87 Don't close STDOUT_FILENO explicitly; close_stdout does it.
89 * src/system.h (__attribute__): Readability nit:
91 # define __attribute__(x)
93 # define __attribute__(x) /* empty */
95 2005-04-09 Jim Meyering <jim@meyering.net>
97 * src/rm.c (usage): Mention that --recursive removes listed
98 directories too, not just their contents.
99 Say that by default, rm does not remove directories.
101 * src/pr.c: Don't include "timespec.h". system.h does that.
102 * Makefile.maint (sc_system_h_headers): Propagate exit status
105 2005-04-08 Paul Eggert <eggert@cs.ucla.edu>
107 * NEWS: Document that dd no longer treats QUIT or PIPE specially,
108 and when conforming to POSIX no longer treats USR1 specially.
109 Document that dd no longer dumps core when handling signals.
110 * src/system.h (RETSIGTYPE): Remove; no longer needed. All uses
112 * src/csplit.c (SA_NOCLDSTOP): Define to 0 if not defined.
114 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
115 (delete_all_files): New arg IN_SIGNAL_HANDLER, to avoid undefined
116 behavior when called from a signal handler. All uses changed.
117 (main) [!defined SA_NOCLDSTOP]:
118 Use siginterrupt to specify that system calls should be interrupted.
119 * src/dd.c: Do not include safe-read.h or full-write.h; no longer needed.
120 (process_signals): Add forward decl.
121 (SA_NOCLDSTOP, sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
123 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
124 (SA_NODEFER) [!defined SA_NODEFER]: New macro.
125 (SA_RESETHAND) [!defined SA_RESETHAND]: New macro.
126 (caught_signals, interrupt_signal, info_signal_count, catch_siginfo):
128 (usage): Mention -USR1 versus -INFO.
129 (cleanup): Don't invoke print_stats; the caller must do it now.
131 (quit): Process signals just before exiting.
132 (interrupt_handler): Simply record the signal and return.
133 (siginfo_handler): Simply increment the signal counter and return.
134 (install_handler): Remove, replacing with:
135 (install_signal_handlers, process_signals, iread, iwrite):
136 New functions. All callers to safe_read and full_write replaced
137 by iread and iwrite. All callers to install_handler replaced by
139 * src/ls.c (SA_NOCLDSTOP): Define to 0 if not defined.
141 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
142 (main) [! SA_NOCLDSTOP]: Use it.
143 * src/shred.c: Remove all uses of signals; modern hosts have
144 /dev/random and don't need this gorp.
145 Do not include signal.h.
146 (env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
147 * src/sort.c (SA_NOCLDSTOP): Define to 0 if not defined.
149 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
150 (main) [! SA_NOCLDSTOP]: Use it.
152 * src/dd.c: Do not include inttostr.h, no longer needed.
153 (print_stats, main): Rewrite and simplify formats to use PRIuMAX
154 instead of umaxtostr.
155 (print_stats): Work even in languages that have special
156 forms for two of things, for r_truncate and w_bytes. We can't
157 fix delta_s in this way, since ngettext doesn't support floating-point.
158 (main): Rewrite to avoid casts.
160 2005-04-07 Jim Meyering <jim@meyering.net>
162 Placate gcc-4's -Wuninitialized.
163 * src/md5sum.c (digest_check) [lint]: Initialize hex_digest to NULL.
164 * src/test.c (binary_operator) [lint]: Initialize lt and rt to 0.
166 * src/test.c (is_int, age_of, binop): Declare `char *' parameters to
168 (binop): Move function definition to precede first use so we can...
169 (binop): ...remove prototype.
171 2005-04-05 Paul Eggert <eggert@cs.ucla.edu>
173 * man/Makefile.am (.x.1): Remove "COMMAND.td/" from examples.
174 * src/basename.c (usage): Add examples.
175 * src/cat.c (usage): Likewise.
176 * src/chgrp.c (usage): Likewise.
177 * src/chown.c (usage): Likewise.
178 * src/dirname.c (usage): Likewise.
180 2005-04-05 Jim Meyering <jim@meyering.net>
182 * src/nice.c (usage): Mention that some shells provide a
183 built-in function by the same name.
184 * src/nohup.c (usage): Likewise.
185 * src/printenv.c (usage):Likewise.
187 2005-04-04 Dmitry V. Levin <ldv@altlinux.org>
189 * src/tee.c (tee): When closing files, do not close stdout,
190 leave this job to close_stdout() instead.
191 * configure.ac (AC_CONFIG_FILES): Add tests/tee/Makefile.
192 * tests/Makefile.am (SUBDIRS): Add tee.
193 * tests/tee/Makefile.am: New file.
194 * tests/tee/.cvsignore: Likewise.
195 * tests/tee/{basic,dash}: New tee tests.
197 2005-04-04 Jim Meyering <jim@meyering.net>
199 * src/echo.c (usage): Mention that some shells provide a
200 built-in function by the same name.
201 * src/kill.c (usage): Likewise
202 * src/printf.c (usage): Likewise.
203 * src/pwd.c (usage): Likewise.
204 * src/stat.c (usage): Likewise.
205 * src/test.c (usage): Likewise.
206 * src/true.c (usage):
207 * src/system.h (USAGE_BUILTIN_WARNING): New macro.
209 * man/echo.x: Remove `DESCRIPTION' section, now that --help includes it.
210 * man/printf.x: Likewise.
211 * man/pwd.x: Likewise.
213 2005-04-03 Jim Meyering <jim@meyering.net>
215 * src/pr.c (main): Fix off-by-one error.
216 pr -$(perl -e 'print "0"x63 . 1') would write one byte beyond the
217 end of a malloc'd buffer.
219 2005-04-01 Jim Meyering <jim@meyering.net>
221 * src/pr.c (main): Free column_count_string when done with it.
223 Don't let pr treat +1:-1 like +1:18446744073709551615.
224 * src/pr.c (strtoumax): Remove declaration.
225 (first_last_page): Use xstrtoumax in place of strtoumax,
226 so we don't interpret a negative page number (e.g., in an option
227 like --pages=1:-1) as valid.
228 * tests/pr/Test.pm (neg-page): Add a test for this.
230 2005-03-30 Paul Eggert <eggert@cs.ucla.edu>
232 * src/pinky.c (short_pinky): Adjust to read_utmp signature change.
233 * src/uptime.c (uptime): New arg OPTIONS. All uses changed.
234 * src/users.c (users): Likewise.
235 * src/who.c (who): Likewise.
236 * src/uptime.c (main): Check PIDs when invoked with zero arguments.
237 * src/users.c (main): Likewise.
238 * src/who.c (main): Likewise. Also with two arguments.
239 Omit duplicate code in 2-arg case.
240 (UT_PID): Moved to ../lib/readutmp.h.
242 2005-03-29 Jim Meyering <jim@meyering.net>
244 * src/system.h (ptr_align): Declare `ptr' parameter to be a
245 `const' pointer, since this function never writes through it.
247 * src/uname.c: Indent cpp directives to reflect nesting.
249 2005-03-28 Jim Meyering <jim@meyering.net>
251 * src/seq.c (get_width_format) [HAVE_RINT && HAVE_MODF && HAVE_FLOOR]:
252 Add `void' to make this an ANSI-style function declaration.
253 * src/remove.c (ds_init): Likewise.
254 * src/pr.c (print_sep_string): Likewise.
256 * src/stty.c (speeds): Declare this array to be static.
257 * src/Makefile.am (sc_tight_scope): Adjust to catch any
258 new declarations like that of stty.c's `speeds'.
260 * src/system.h (GETOPT_HELP_OPTION_DECL): Use NULL, not `0'.
261 (GETOPT_VERSION_OPTION_DECL): Likewise.
262 * src/chown.c (long_options): Likewise.
263 * src/chgrp.c (long_options): Likewise.
264 * src/chmod.c (long_options): Likewise.
265 * src/cp.c (sparse_type_string, reply_args, decode_preserve_arg):
267 * src/chown-core.c (chopt_init): Likewise.
268 * src/comm.c (long_options): Likewise.
269 * src/copy.c (copy_reg): Likewise.
270 * src/csplit.c (extract_regexp): Likewise.
271 * src/cut.c (longopts): Likewise.
272 * src/date.c (time_spec_string): Likewise.
273 * src/df.c (find_mount_point, show_point): Likewise.
274 * src/expr.c (docolon): Likewise.
275 * src/fmt.c (long_options): Likewise.
276 * src/ls.c (time_style_args, indicator_style_args, long_options)
277 (format_args, sort_args, time_args, decode_switches)
278 (gobble_file): Likewise.
279 * src/md5sum.c (long_options): Likewise.
280 * src/mv.c (reply_args): Likewise.
281 * src/paste.c (longopts): Likewise.
282 * src/pinky.c (print_entry): Likewise.
283 * src/pr.c (long_options): Likewise.
284 * src/ptx.c (long_options, format_args): Likewise.
285 * src/readlink.c (longopts): Likewise.
286 * src/sort.c (long_options, mergefps): Likewise.
287 * src/stat.c (long_options): Likewise.
288 * src/tac.c (main): Likewise.
289 * src/tail.c (follow_mode_string): Likewise.
290 * src/touch.c (longopts, time_args): Likewise.
291 * src/uniq.c (delimit_method_string): Likewise.
292 * src/uptime.c (print_uptime): Likewise.
293 * src/who.c (print_user): Likewise.
295 2005-03-27 Jim Meyering <jim@meyering.net>
297 * src/dcgen: Simplify further, clean up.
298 Add a standard-output-closing global destructor.
300 * src/wheel-gen.pl: Use the same global destructor as dcgen.
302 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
304 * src/dcgen: Squeeze multiple blanks into one. Output a simple
305 array of adjacent strings rather than a more complicated data
306 structure; this saves space in the dircolors executable.
307 * src/dircolors.c (parse_line): Use char *, not unsigned char *.
309 (dc_parse_stream, main): Avoid casts.
310 Adjust to simpler data structure generated by new dcgen.
312 2005-03-25 Eric Blake <ebb9@byu.net> (tiny change)
314 * src/ls.c (usage): Document usage of LS_COLORS.
316 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
318 * src/dircolors.hin: Add "TERM cygwin".
320 2005-03-25 Jim Meyering <jim@meyering.net>
322 * src/system.h (DECIMAL_DIGIT_ACCUMULATE): Reverse the sense of
323 the return value, and update callers:
324 * src/cut.c (set_fields): Update use of DECIMAL_DIGIT_ACCUMULATE.
325 * src/expand.c (parse_tab_stops, main): Likewise.
326 * src/split.c (main): Likewise.
327 * src/unexpand.c (parse_tab_stops, main): Likewise.
328 * src/uniq.c (main): Likewise.
330 2005-03-22 Jim Meyering <jim@meyering.net>
332 * build-aux: New directory. Renamed from config.
333 * configure.ac: Reflect renaming: config -> build-aux.
334 * Makefile.am (dist-hook): Likewise.
335 * Makefile.maint: Likewise.
336 * Makefile.cfg (cvs_files): Likewise.
337 * .x-sc_sun_os_names: Likewise.
338 * .x-sc_trailing_blank: Likewise.
340 * src/ls.c (get_funky_string): Use '\a', rather than 7, for
341 portability to EBCDIC hosts.
343 2005-03-20 Jim Meyering <jim@meyering.net>
345 * src/pr.c (init_header): Add missing `%' in new format string.
346 (init_header): Use zero-filled `.%09d' format, not space-filled `.%9d'.
348 2005-03-19 Jim Meyering <jim@meyering.net>
350 * src/Makefile.am (pr_LDADD): Now that pr uses gettime, add
351 $(LIB_CLOCK_GETTIME) to get the required -lrt on newer Linux systems.
353 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
355 * NEWS: pr -D "FORMAT" now accepts the same formats that
357 * src/pr.c: Include strftime.h, timespec.h.
358 (init_header): Obtain and format nanosecond part of time stamp.
360 * NEWS: nohup now ignores the umask when creating nohup.out.
361 nohup now closes stderr if it is a terminal and stdout is closed.
362 * src/nohup.c (main): Likewise. Be a little more paranoid about
363 return values; e.g., check for any negative return from open.
364 Assume free (NULL) works.
365 Close file descriptor leak when redirecting standard output to a file.
367 2005-03-17 Jim Meyering <jim@meyering.net>
369 * src/cut.c (set_fields): Use DECIMAL_DIGIT_ACCUMULATE macro,
370 in place of functionally-equivalent code.
371 * src/expand.c (parse_tab_stops, main): Likewise.
372 * src/split.c (main): Likewise.
373 * src/unexpand.c (parse_tab_stops, main): Likewise.
374 * src/uniq.c (main): Likewise.
375 * src/od.c: Use VERIFY macro in place of an equivalent open-coded
377 * src/system.h (VERIFY, VERIFY_EXPR, DECIMAL_DIGIT_ACCUMULATE):
380 Before, this command would make uniq skip 11 fields and print
382 $ _POSIX2_VERSION=1 ./uniq -f1 -1 <(seq --format='1 %g' 2)
385 * src/uniq.c (main): Interpret `uniq -f1 -1' like `uniq -f1',
386 not like `uniq -f11'.
388 2005-03-15 Jim Meyering <jim@meyering.net>
390 Both `pr -0' and e.g., `pr -03' would evoke `column count too large'.
391 `pr -0' should give a better diagnostic and `pr -03' should be
392 equivalent to `pr -3'.
393 * src/pr.c (parse_column_count): Change return type to void.
394 Call error (EXIT_FAILURE, ... for an invalid string.
395 (main): Allocate space for column_count_string using malloc.
396 Accumulate all old-style column-count digits before converting.
397 When the number of columns is specified via both old-style,
398 (e.g., -3), and a long option (--columns=5), ensure that only
399 the last one specified takes effect.
400 * tests/pr/Test.pm: Add tests for the above.
402 2005-03-15 Corinna Vinschen <corinna@vinschen.de> (tiny change)
404 * src/copy.c (copy_reg): Copy regular files in binary mode.
406 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
408 * NEWS: Restate why ls limits time stamp lengths.
410 2005-03-12 Jim Meyering <jim@meyering.net>
412 Add a little infrastructure to help prevent future bugs like the
414 * src/stat.c (xstrcat): New function.
415 (print_statfs, print_stat): Add buf_len parameter and convert all
416 uses of strcat to xstrcat. Update callers.
417 (print_it): Call print_func with buf_len parameter.
419 Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,
420 could cause a buffer overrun error.
421 * src/stat.c (print_it): Allocate 2 more bytes, to accommodate our
422 conversion of the stat %s format string to the longer printf %llu one.
423 Patch from Guochun Shi.
425 2005-03-11 Paul Eggert <eggert@cs.ucla.edu>
427 * src/ls.c (TIME_STAMP_LEN_MAXIMUM): New constant.
428 (long_time_expected_width, print_long_format): Use it, to avoid
429 some possible denial-of-service attacks.
430 * NEWS: Document this.
432 2005-03-11 Jim Meyering <jim@meyering.net>
434 Prompt once again for `mv -i A B' when A and B are hard links
435 to the same file. This fixes a bug introduced by my 2003-04-04
436 (coreutils-5.0.1) change. Reported by Thomas Wolff via Eric Blake.
437 * src/copy.c (abandon_move): New function, factored out of
438 copy_internal, now that this code is being used from two places.
439 (copy_internal): Perform the same interactive-related test for
440 whether it's alright to proceed and (usually) overwrite the
442 * tests/mv/i-4: Add tests for the above.
444 Don't segfault for a very long date format string, e.g.,
445 ls -ld --time-style=+%99999999H .
446 * src/ls.c (long_time_expected_width): Use x2nrealloc, not alloca,
447 so format string abuse cannot provoke stack overflow.
448 (print_long_format): Likewise.
450 Don't segfault for a long header date string, e.g.,
451 echo a|pr -D +%9999999A
452 * src/pr.c (init_header): Use x2nrealloc, rather than alloca.
453 Don't bother with fixed-sized initial buffer; always use x*alloc.
455 * src/pr.c (init_header): Use slightly clearer INT_BUFSIZE_BOUND
456 in place of equivalent INT_STRLEN_BOUND + 1.
457 * src/expr.c (tostring, printv): Likewise.
459 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
461 * src/system.h: Include intprops.h.
462 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND): Remove;
463 they are now defined in intprops.h.
465 2005-03-09 Jim Meyering <jim@meyering.net>
467 * TODO: Remove entry about named pipes. It was fixed in 5.3.0.
469 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
471 * src/date.c (usage): Redo to match recent documentation changes.
472 Don't bother documenting which usages are GNU extensions; the list
473 wasn't correct, and is better left to the printed manual anyway.
475 2005-03-06 Jim Meyering <jim@meyering.net>
477 Factor out column-count processing.
478 * src/pr.c: Include "inttostr.h".
479 (parse_column_count): New function.
480 (main): Use the new function for both old-style, -9, and long,
481 --columns=-9, options.
483 * src/cksum.c: Remove `register' keyword.
484 * src/cut.c: Likewise.
485 * src/dd.c: Likewise.
486 * src/env.c: Likewise.
487 * src/factor.c: Likewise.
488 * src/fmt.c: Likewise.
489 * src/fold.c: Likewise.
490 * src/id.c: Likewise.
491 * src/logname.c: Likewise.
492 * src/ls.c: Likewise.
493 * src/pr.c: Likewise.
494 * src/printf.c: Likewise.
495 * src/shred.c: Likewise.
496 * src/sort.c: Likewise.
497 * src/sum.c: Likewise.
498 * src/test.c: Likewise.
499 * src/tsort.c: Likewise.
500 * src/uniq.c: Likewise.
501 * src/wc.c: Likewise.
502 * src/whoami.c: Likewise.
504 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
506 * src/Makefile.am (nanosec_libs): Remove $(LIB_XANOSLEEP); no
509 2005-03-01 Jim Meyering <jim@meyering.net>
511 * src/copy.c (copy_internal): Change test of source type from
512 !S_ISREG to S_ISLNK. Reported by Paul Eggert in
513 http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00050.html.
515 2005-02-28 Jim Meyering <jim@meyering.net>
517 * NEWS: Mention that xnanosleep fixes sleep failure on linux-2.6.8.1.
519 2005-02-21 Paul Eggert <eggert@cs.ucla.edu>
521 * src/Makefile.am (dd_LDADD, shred_LDADD): Add $(LIB_GETHRXTIME).
522 (nanosec_libs): Add $(LIB_XNANOSLEEP). Needed for newer GNU/Linux
523 hosts with clock_gettime.
525 2005-02-20 Paul Eggert <eggert@cs.ucla.edu>
527 * NEWS: Describe user-visible change to dd.
528 * src/Makefile.am (dd_LDADD, shred_LDADD, nanosec_libs):
529 Remove $(LIB_CLOCK_GETTIME). These functions now use
531 * src/dd.c: Include gethrxtime.h, xtime.h.
532 (start_time): Now of type xtime_t, not struct timespec.
533 (print_stats, main): Use gethrxtime rather than gettime.
534 * src/ls.c (time): Remove obsolete decl.
535 (get_current_time): gettimeofday always returns 0, so don't
537 * src/shred.c: Include gethrxtime.h.
538 (isaac_seed): Use gethrxtime rather than a mishmash.
539 * src/touch.c (time): Remove obsolete decl.
541 * tests/misc/split-fail: Don't assume that the current host
542 supports integers wider than 32 bits. Fix comment typo.
543 * tests/od/x8: Likewise.
545 * src/chown-core.c (enum RCH_status): Remove trailing comma,
546 as it's not valid in standard C89.
548 2005-02-15 Jim Meyering <jim@meyering.net>
550 * src/stat.c (human_fstype): Add case/definition for S_MAGIC_XFS
551 so that file systems of type `xfs' are recognized as such.
552 * src/fs.h: Regenerate.
553 Reported by Bernd Eckenfels.
554 * src/stat.c (human_fstype): Likewise for S_MAGIC_JFS/jfs.
555 * src/fs.h: Regenerate.
556 Reported by Andreas Schwab.
558 * src/nice.c (NZERO) [NZERO == 0]: Undefine and define to 20,
559 to work around the invalid definition from Darwin 7.7.0.
560 Test failure reported by Sébastien Maret.
562 2005-02-14 Paul Eggert <eggert@cs.ucla.edu>
564 * src/sort.c (mergefps): Use binary search rather than linear one
565 when comparing new line to lines already in main memory.
566 Idea suggested by James Lemley.
568 2005-02-09 Jim Meyering <jim@meyering.net>
570 * src/copy.c (valid_options): Add an assertion that
571 not both hard_link and symbolic_link are set.
573 2005-02-08 Paul Eggert <eggert@cs.ucla.edu>
575 * NEWS: Document stat -f -c %S, plus changes to default formats.
576 * doc/coreutils.texi (stat invocation): Normalize terminology,
577 capitalization, and sort order to match --help output. Mention %c
578 for file systems. Add new -f -c format %S, and document %s versus %S;
579 problem reported by Jeroen van Wolffelaar.
580 * src/stat.c (usage): Likewise.
581 (STATFS_FRSIZE): New macro.
582 (print_statfs): Use it, for stat -f -c %S.
583 (do_statfs): Change default formats to output %S.
585 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
587 * src/system.h: Include "memrchr.h".
588 (memrchr) [!HAVE_DECL_MEMRCHR]: Remove decl.
590 2005-02-02 Jim Meyering <jim@meyering.net>
592 * tests/du/8gb: Also adjust the test (s/64/128/) to detect
593 systems that don't support sparse files.
594 Check for $2 -ge 128, rather than $2 = 128, in case
595 there is a file system type that doesn't support sparse files,
596 yet for which metadata takes up additional space.
597 Both reported by Andreas Schwab.
599 2005-02-01 Eric Blake <ebb9@byu.net> (tiny change)
601 * tests/du/8gb: Create a larger test file, so we properly
602 detect that sparse files can be created on NTFS under cygwin.
604 2005-01-30 Jim Meyering <jim@meyering.net>
606 * src/head.c (elide_tail_bytes_pipe): Correct wording in diagnostic.
608 * src/stty.c: Remove unnecessary parentheses in all #if directives.
610 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
612 * .cvsignore: Ignore config.cache and config.status.lineno.
613 * src/stty.c [VSWTCH]: Some systems, like Cygwin, use VSWTC
614 instead of VSWTCH, for use with CSWTCH.
616 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
618 * tests/Makefile.am (.PHONY): Add check-root and root-hint.
619 * tests/rwx-to-mode: Ignore ACL designation.
620 * tests/setgid-check: Likewise.
621 * tests/chown/separator: Quote user and group names.
623 2005-01-24 Jim Meyering <jim@meyering.net>
625 * src/cp.c (usage): Merge the descriptions of --no-dereference and -P.
626 Suggestion from Johan Boule.
628 2005-01-17 Eric Blake <ebb9@byu.net> (tiny change)
630 * src/Makefile.am (all_programs.list): Strip $(EXEEXT) and remove
632 * man/Makefile.am (all_programs): Revert previous patch; updated
633 all_programs.list fixes this.
634 (.x.1): No need to add $(EXEEXT).
636 2005-01-03 Corinna Vinschen <corinna@vinschen.de> (tiny change)
638 * src/system.h: Use S_BLKSIZE value for ST_NBLOCKSIZE where
641 2005-01-22 Jim Meyering <jim@meyering.net>
643 * Makefile.maint (v_etc_file): The version string has moved to
644 version-etc-fsf.c, search that new file, not version-etc.c.
646 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
648 * tests/group-names: Use numeric group ids, not symbolic group names,
649 since the latter can have shell metacharacters in them (e.g., spaces).
650 Problem reported by Eric Blake.
651 * tests/chgrp/basic: Assume groups are numeric, not symbolic.
652 * tests/chgrp/deref: Likewise.
653 * tests/chgrp/posix-H: Likewise.
654 * tests/chgrp/recurse: Likewise.
656 2005-01-15 Jim Meyering <jim@meyering.net>
658 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: #if-0 this block,
659 because just calling gethrtime evokes an `illegal instruction'
660 failure when compiled with Sun's c89 on Solaris 8 and 9.
661 Reported by Nelson Beebe.
663 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: Don't call ISAAC_SEED
664 twice with the same value of `t'.
665 Replace nested #if-#else blocks with #if-#elif-#elif chain.
667 2005-01-14 Jim Meyering <jim@meyering.net>
669 The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.
670 * src/tail.c (IS_TAILABLE_FILE_TYPE): Adjust definition also to include
671 sockets, since that's what you get when reading from a command-line-
672 supplied pipe on Darwin 7.7.
673 (IS_PIPE_LIKE_FILE_TYPE): Define.
674 (main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO.
675 Reported by Nelson Beebe.
676 This same change is also required on NetBSD/sparc-1.5.
677 Reported by Adrian Bunk.
679 * src/expr.c (toarith): Rewrite to detect/diagnose integer overflow,
680 rather than suffering silently.
681 Before, expr would silently overflow and wrap around:
682 $ expr 9223372036854775808 = 0 # $(echo 2^63|bc)
684 Now it detects the problem and exits nonzero:
685 $ ./expr $(echo 2^63|bc) = 0
686 ./expr: 9223372036854775808: integer is too large
688 * tests/chown/separator (id_gn): Exit 77, not 1, for a test-framework
689 failure, so that doesn't cause `make check' to stop. Nelson Beebe
690 reported that this test would fail with the diagnostic,
691 `cannot find name for group ID 10', on one of his systems.
693 2005-01-13 Jim Meyering <jim@meyering.net>
695 * src/test.c (is_int): Don't overflow when evaluating integer
696 constants. Before, ./test $(echo 2^64|bc) -eq 0 && echo FAIL
699 * tests/Fetish.pm (run_tests): Add code (if-0'd out) to detect
700 names of temporary files that would clash on 8.3 file systems.
701 * tests/mk-script (validate): Likewise.
703 2005-01-12 Jim Meyering <jim@meyering.net>
705 * tests/dd/skip-seek: Shorten test names to accommodate 8.3 systems.
707 * tests/tr/Test.pm (repeat-xC): Change test name from
708 `repeat-Compl', to avoid 8.3 conflict with `repeat-compl'.
709 Reported by Eric Blake.
710 (repeat-000): Rename to `repeat-zeros' for the same reason.
712 2005-01-11 Jim Meyering <jim@meyering.net>
714 * configure.ac: Update version to 5.3.1.
716 2005-01-11 Eric Blake <ebb9@byu.net>
718 * src/Makefile.am (check-README, check-AUTHORS): Account for $(EXEEXT).
719 * man/Makefile.am (all_programs): Account for $(EXEEXT).
721 2005-01-11 Jim Meyering <jim@meyering.net>
723 * src/unexpand.c (add_tab_stop): Properly diagnose a tabstop list
724 with decreasing values.
726 * src/expand.c (main): Likewise.
727 * src/unexpand.c (main): Check for overflow in tabstop values
728 specified via the obsolete form. E.g., now this command fails:
729 _POSIX2_VERSION=1 ./unexpand -$(echo '2^64+1'|bc)
730 Before it would act like `_POSIX2_VERSION=1 ./unexpand -1'.
731 * tests/unexpand/basic-1 (obs-ovflo): New test for this.
733 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
735 Respond to POSIX interpretations about pathchk -p dated 2005-01-06.
736 * NEWS: Document the changes.
737 * doc/coreutils.texi (pathchk invocation): Likewise.
738 * src/pathchk.c (PORTABILITY_OPTION): New constant.
739 (longopts, usage, main, validate_file_name):
740 Add support for new -P option.
741 Reject empty file names (unless -p is not specified and the
742 current system allows empty file names).
743 Change --portability so that is now equivalent to -p -P.
744 Don't test whether file name is too long, if it is known to exist.
745 (no_leading_hyphen): New function.
746 * tests/misc/pathchk1: Add tests for empty file names and
749 2005-01-08 Jim Meyering <jim@meyering.net>
753 `pr --columns=N' was not equivalent to `pr -N' when also using
756 * src/pr.c (main): Set `explicit_columns' for --columns=N,
757 not just for -N. This bug has existed since the introduction
758 of the --columns=N option on 1998-08-15.
759 * NEWS: Document this.
760 * tests/pr/Test.pm (test_vector): For each -N test, automatically
761 create a new test vector using --columns=N.
763 2005-01-07 Paul Eggert <eggert@twinsun.com>
765 * src/pr.c (main): Check for column count overflow with
766 usages like "pr -2147483648".
768 2005-01-07 Jim Meyering <jim@meyering.net>
770 * src/pr.c (init_fps): Use xnmalloc, rather than xmalloc.
772 2005-01-06 Jim Meyering <jim@meyering.net>
774 * README: List the precise HP-UX version numbers that are affected.
775 Suggestion from Bob Proulx.
777 * Makefile.maint (sc_changelog): Specify find's `-maxdepth 2'
778 predicate before `-name ChangeLog' to avoid a harmless warning
781 2005-01-05 Jim Meyering <jim@meyering.net>
783 * tests/help-version: Punt on the uptime test, since it fails when
784 it can't get boot time, and I don't want that to stop `make check'.
786 * src/du.c (process_file): Evaluate exclusion rules against
787 the entire file name, not just the last component.
788 Reported by Robert Lindgren.
789 * tests/du/exclude: Test for this.
790 * NEWS: Document this.
792 Ensure that tests/Makefile.am's check-root actions stay up to date.
793 * Makefile.maint (sc_root_tests): New rule.
794 (syntax-check-rules): Add it to the list.
796 2005-01-04 Jim Meyering <jim@meyering.net>
798 * man/shred.x: Change one-line summary to reflect that shred does
799 not remove files by default. Suggestion from Helen Faulkner in
800 http://bugs.debian.org/288552
802 * README: Request VERBOSE=yes output when reporting test failures.
805 * tests/Makefile.am (check-root): Update.
807 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
809 * src/system.h: Undo previous change; we now use Autoconf.
811 2005-01-03 Jim Meyering <jim@meyering.net>
813 * tests/stty/row-col-1: Don't set rows or columns to zero, to avoid
814 a bug in the TIOCGWINSZ ioctl on at least Solaris5.9 systems. Setting
815 either (or both) to zero would succeed, but subsequent `stty size'
816 would say `no size information for this device' due to the ioctl
819 * src/system.h: If PRIdMAX, PRIoMAX, PRIuMAX, and PRIxMAX are
820 not all defined and either ULONG_MAX or ULLONG_MAX is not defined,
821 then fail at compile-time rather than let tools like od produce
822 invalid results at run time.
824 2004-12-21 Jim Meyering <jim@meyering.net>
826 * src/csplit.c (usage): Say the default names are `xx00, xx01, ...',
827 not `xx01, xx02, ...'.
828 Reported by Matt Kraai in http://bugs.debian.org/286605
830 * tests/misc/split-fail: Avoid spurious failure on x86 Solaris5.9
833 2004-12-20 Paul Eggert <eggert@cs.ucla.edu>
835 * src/split.c (usage): Mention default size. Suggested by Dan Jacobson.
837 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
839 * NEWS: Mention that one should eval "`dircolors`" rather than
842 2004-12-17 Jim Meyering <jim@meyering.net>
844 * tests/mv/hard-link-1: Rearrange to use newer trap-handling code,
845 so temporary directories aren't left behind upon e.g., interrupt.
847 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
849 * src/ls.c (print_dir): Use "%s: not listing already-listed
850 directory", not "not listing already-listed directory: %s", to
851 format already-listed directories, to be consistent with other
852 diagnostics involving file names and colons.
854 2004-12-15 Jim Meyering <jim@meyering.net>
856 * src/Makefile.am (__LDADD): Define, so that building `[' on
857 Solaris still uses the -lgen library that it requires in order
858 to get a definition of eaccess.
860 2004-12-14 Jim Meyering <jim@meyering.net>
862 tac would exit immediately upon I/O or temp-file creation failure.
863 Now it continues on, processing any remaining command line arguments.
865 * src/tac.c: Include quotearg.h.
866 Use quotearg_colon in most diagnostics.
867 (copy_to_temp): Rewrite not to exit upon I/O or temp-file-creation
868 failure. Before, this command (with /full/tmp being a full partition)
869 TMPDIR=/full/tmp ./tac /proc/modules tac.c
870 would exit immediately upon the write error while trying to copy
871 non-seekable /proc/modules to the full partition. Now it still
872 reports the failure but continues on with the remaining file.
873 (tac_nonseekable): Return false also if copy_to_temp fails.
874 [DONT_UNLINK_WHILE_OPEN]: Add a FIXME comment explaining that
875 using atexit like this is wrong.
876 * NEWS: Document this.
877 * tests/misc/tac-continue: New test for this.
878 * tests/misc/Makefile.am (TESTS): Add tac-continue.
880 * tests/chown/basic: Add a few more tests.
882 2004-12-13 Paul Eggert <eggert@cs.ucla.edu>
884 * src/ls.c (gobble_file): Change arg name to be command_line_arg
885 rather than explicit_arg, for consistency with copy.c.
886 (extract_dirs_from_files): Remove ignore_dot_and_dot_dot arg, since
887 it is deducible from dirname arg. All callers changed.
888 (extract_dirs_from_files, print_dir, queue_directory):
889 Add command_line_arg arg. All callers changed.
890 (struct pending): Add command_line_arg member.
891 (main): Use NULL rather than 0 when appropriate.
892 (set_exit_status, file_failure): New functions.
893 (queue_directory): Store command_line_arg into new structure.
894 (print_dir, gobble_file, get_link_name):
895 Use file_failure to report problems in accessing files,
896 so that the exit status is set consistently.
897 (print_dir): Simplify readdir failure code yet again.
898 If closedir fails, report "closing directory" rather than "reading
900 (xstrcoll): Use set_exit_status to set status on failure.
901 * tests/ls-2/tests (no-a-isdir-b): This now exits with status 2,
904 2004-12-11 Jim Meyering <jim@meyering.net>
906 Avoid a race condition vulnerability in chown, when used with
907 --from=O:G and without the (-h) --no-dereference option.
908 * src/chown-core.c (restricted_chown): New function.
909 (change_file_owner): Call it.
910 Reported by Ulrich Drepper.
911 * NEWS: Mention this.
913 2004-12-09 Paul Eggert <eggert@cs.ucla.edu>
915 * ls now exits with status 1 on minor problems, 2 if serious trouble.
916 * NEWS: Document this.
917 * src/ls.c (LS_MINOR_PROBLEM, LS_FAILURE): New constants.
918 All uses of EXIT_FAILURE replaced with LS_FAILURE, unless
920 (main): Initialize exit failure to LS_FAILURE.
921 (print_dir, gobble_file, get_link_name, xstrcoll):
922 Set exit status to LS_MINOR_PROBLEM if the failure is minor.
923 (print_dir): Do not give up on entire directory merely because readdir
925 (usage): Explain exit status.
926 * tests/help-version: ls and variants now exit with status 2
929 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
931 * NEWS: Document new UTC+HH:MM date syntax, and put date changes
934 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
936 * src/factor.c (factor): Don't list 1 as a factor of 1.
937 Problem reported by Thomas Folz-Donahue.
939 2004-12-06 Jim Meyering <jim@meyering.net>
941 * tests/du/files0-from: Sanitize environment.
942 Otherwise, e.g., BLOCKSIZE=k would cause a failure, and that
943 setting is the default (exported from /etc/profile) on at least one
945 * tests/du/no-deref: Likewise.
946 * tests/cp/symlink-slash: Likewise.
947 * tests/ls/symlink-slash: Likewise
949 2004-12-05 Jim Meyering <jim@meyering.net>
951 * tests/tail/Test.pm (err-6) ["tail -c"]: Avoid test failure when
952 _POSIX2_VERSION=199209 is in the environment, or when building on
955 2004-12-04 Jim Meyering <jim@meyering.net>
957 * NEWS: Mention cut's new --complement option.
959 2004-10-01 Paolo Bonzini <bonzini@gnu.org>
961 * cut.c (complement, COMPLEMENT_OPTION): New.
962 (longopts): Add --complement.
963 (usage): Say not that -b, -c, and -f `print' fields,
964 but rather that they `select' fields for printing.
965 Describe the new --complement option.
966 (mark_range_start): Extracted from set_fields.
967 (print_kth): Support --complement.
968 (compare_ranges): New function.
969 (set_fields): Rewrite the part that populates range_start_ht,
970 merging it with the part that populates printable_field.
971 (main): Handle --complement.
973 2004-12-03 Paul Eggert <eggert@cs.ucla.edu>
975 * src/tail.c (tail_file): Set errnum to -1 if the initial "tail"
976 failed. This works around an assertion failure reported by
978 http://lists.gnu.org/archive/html/bug-coreutils/2004-12/msg00012.html
980 2004-12-02 Jim Meyering <jim@meyering.net>
982 With using --color and with LS_COLORS saying not to color
983 executables, don't stat every file.
984 * src/ls.c (is_colored): New function.
985 (gobble_file): Use it.
986 (main): Use it here, in place of too-strict tests against NULL:
987 if either ORPHAN or MISSING was set to 0 from LS_COLORS, the
990 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
992 * src/comm.c (compare_files): Assume setlocale exists.
993 * src/join.c (keycmp): Likewise.
994 * src/seq.c (decimal_point): Treat like sort. Now char.
996 (main): Assume localeconv exists. Use same code as sort.
997 * src/sort.c (C_DECIMAL_POINT): Remove. Use changed to '.'.
998 Assume setlocale exists.
999 (thousands_sep): Renamed from th_sep.
1000 (IS_THOUSANDS_SEP): Remove. All uses replaced by comparisons.
1001 (NONZERO): Parenthesize use of arg.
1002 (numcompare): Avoid duplicate loads. Use ISDIGIT as boolean, for
1003 consistency. Avoid unnecessary negation by reversing
1005 (main): Rewrite localeconv call to match seq.c.
1006 * src/system.h: Assume locale.h exists.
1007 (HAVE_SETLOCALE): Remove.
1008 * src/uniq.c (different): Assume setlocale exists.
1010 * src/ls.c (sort_files): Minor cleanup. Remove an unnecessary
1011 'volatile' on a local variable. Rewrite to avoid unnecessary
1012 double-assignment to 'func' in the usual case where strcoll does
1015 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1017 * src/pinky.c (gethostname): Remove decl.
1018 (scan_entries): Use IS_USER_PROCESS instead of by-hand code.
1019 * src/uptime.c (print_uptime): Use IS_USER_PROCESS and
1020 UT_TYPE_BOOT_TIME instead of by-hand code.
1021 * src/users.c (list_entries_users): Use IS_USER_PROCESS
1022 instead of by-hand code.
1023 * src/who.c (USER_PROCESS, RUN_LVL, INIT_PROCESS, LOGIN_PROCESS,
1024 DEAD_PROCESS, BOOT_TIME, NEW_TIME, UT_TYPE_UNDEF, UT_TYPE): Remove.
1025 (IS_USER_PROCESS): Move to ../lib/readutmp.h.
1026 (UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS, UT_TYPE_LOGIN_PROCESS,
1027 UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME): New macros.
1028 (gethostname): Remove decl.
1029 (list_entries_who, scan_entries): Use the new macros defined above,
1030 for consistency with pinky, uptime, and users.
1032 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1034 Fix problem reported by Scott S. Tinsley for HP-UX 11.11 using
1035 HP's ANSI C compiler. Declaring int functions causes warnings on
1036 some modern systems and shouldn't be needed to compile on ancient
1038 * src/copy.h (stat, lstat, rename): Remove decls.
1039 * src/install.c (stat): Remove decl.
1040 * src/ln.c (link, symlink): Remove decls.
1042 2004-11-25 Jim Meyering <jim@meyering.net>
1044 * man/help2man: Import help2man-1.35.1.
1045 * man/Makefile.am (.x.1): Remove now-unnecessary use of
1046 locally-added --program-name=NAME option. Now, help2man gets
1047 the name from the [NAME] section (i.e. from our .x file).
1048 * man/install.x: Use `install', not `ginstall' in the one-line
1049 description. Reported by Brendan O'Dea.
1050 * man/sha1sum.x: Use `sha1sum', not `shasum'.
1052 2004-11-24 Jim Meyering <jim@meyering.net>
1054 Since the changes of 2004-05-22, the u.saved_cwd member at
1055 the bottom of the active-directory stack was no longer
1056 strictly necessary. This change removes that member and uses
1057 the newer cwd_state parameter for the final restore_cwd.
1059 * src/remove.c (struct AD_ent) [u]: Remove now-unnecessary union.
1060 [dev_ino]: Rename from `a'.
1061 (AD_pop_and_chdir): Add a parameter to play the role of just-removed
1062 bottom-of-stack cwd-state member.
1063 (AD_pop_and_chdir): No longer return boolean. Adjust caller.
1064 (AD_push_initial): Remove CWD parameter. Adjust caller.
1066 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1068 Minor performance improvements and cleanups for "touch".
1069 * src/touch.c (posix_date): Remove; not needed as a static var.
1071 (touch): Use new futimens function to operate more efficiently
1072 in some cases. Don't stat/fstat existing file when
1073 (!amtime_now && change_times == (CH_ATIME | CH_MTIME)); the
1074 old time stamps aren't needed in that case.
1075 (main): change_times is int, not bool. Simplify test for
1078 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1080 * src/install.c (usage): Avoid usage that runs afoul of Docbook
1081 translation. Problem reported by Eric S. Raymond.
1083 Restore dd's noctty flag, reverting the change of 2004-04-08.
1084 POSIX does not allow "dd" to use O_NOCTTY by default.
1085 * NEWS: Add noctty flag to dd.
1086 * doc/coreutils.texi (dd invocation): Likewise.
1087 * src/dd.c (flags, usage, main): Likewise.
1089 2004-11-19 Alfred M. Szmidt <ams@gnu.org>
1091 * src/ls.c (usage): Clarified description of --no-group (-G),
1092 --human-readable (-h), --inode (-i), --size (-s), --time,
1095 2004-11-19 Jim Meyering <jim@meyering.net>
1097 * src/ls.c (usage): Clarify description of --author.
1098 Tweak indentation so that help2man creates better nroff.
1099 Reported by Dan Jacobson.
1101 * src/uniq.c (check_file): Don't check stdout for errors here.
1103 * src/pwd.c (find_dir_entry): Update comment to match reality.
1105 2004-11-18 Jim Meyering <jim@meyering.net>
1107 * src/pwd.c (robust_getcwd): Correct the comment: this function
1108 constructs the directory name. The caller prints it.
1110 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1112 * src/stat.c (STATFS): New macro, for portability to Solaris 9.
1113 (do_statfs): Use it.
1115 * src/basename.c, src/chroot.c, src/cksum.c, src/dd.c, src/dirname.c,
1116 src/factor.c, src/hostid.c, src/hostname.c, src/link.c, src/logname.c,
1117 src/nohup.c, src/printenv.c, src/pwd.c, src/setuidgid.c, src/sleep.c,
1118 src/sync.c, src/tsort.c, src/unlink.c, src/uptime.c, src/users.c,
1119 src/whoami.c, src/yes.c (main): Use getopt_long rather than getopt.
1120 * src/readlink.c (main): argv is not const.
1122 * src/cut.c (usage): Improve documentation along the lines suggested
1124 * src/echo.c (usage): Likewise.
1125 * src/expr.c (usage): Likewise.
1127 * src/dircolors.hin: Add putty, screen-bce.
1129 * src/pinky.c (print_entry): Fix memory leak.
1130 * src/who.c (print_user): Likewise.
1132 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
1134 * NEWS: New dd operand "status=noxfer".
1135 * src/dd.c (C_ASCII, C_EBCDIC, C_IBM, C_BLOCK, C_UNBLOCK,
1136 C_LCASE, C_UCASE, C_SWAB, C_NOERROR, C_NOTRUNC, C_SYNC, C_TWOBUFS,
1137 C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): Now constants, not
1139 (STATUS_NOXFER, statuses): New constants.
1140 (usage, print_stats, scanargs): Add support for status=noxfer.
1141 (usage): Update status output to match new behavior.
1142 (print_stats): Always output complete byte count.
1143 Put space between numbers and units, as SI requires.
1144 Use ngettext so that i18n can use plurals for "byte" and "second".
1145 Don't multiply by 1e-9 (inexact); divide by 1e9 (which is exact).
1146 (iflag_error_msgid, oflag_error_msgid): Remove; replace uses by
1148 * tests/dd/skip-seek (@Tests): Use status=noxfer to avoid
1149 problems with regression testing.
1151 2004-11-14 Paul Eggert <eggert@cs.ucla.edu>
1153 * NEWS: dd now outputs total bytes, seconds, and bytes per second.
1154 * src/Makefile.am (dd_LDADD): Add $(LIB_CLOCK_GETTIME).
1155 * src/dd.c: Include "human.h".
1156 (w_bytes, start_time): New vars.
1157 (usage): Document new I/O statistics output
1158 (print_stats): Output new I/O statistics.
1159 (cleanup): Do statistics after closing stdin and stdout, so that
1160 the times are more accurate.
1161 (write_output, dd_copy): Count output bytes.
1162 (main): Get initial value of clock.
1164 2004-11-14 Jim Meyering <jim@meyering.net>
1166 Backslash-escape `-'s in email addresses, so that they are
1167 rendered properly in UTF-locales.
1168 * man/help2man (escape_hyphens): New function.
1169 (main): Call it on email addresses.
1171 * src/sort.c (zaptemp): Mark new diagnostic for translation.
1173 * tests/misc/close-stdout: New file. Test today's closeout.c change.
1174 * tests/misc/Makefile.am (TESTS): Add close-stdout.
1176 2004-11-13 Jim Meyering <jim@meyering.net>
1178 * src/test.c (usage): Put the description of `[-n] STRING'
1179 on two lines, one for `-n STRING' and one for `STRING' so that
1180 help2man properly escapes the `-'. Otherwise, the hyphen is
1181 rendered inappropriately in UTF-8 locales.
1182 Reported by Uwe Zeisberger in http://bugs.debian.org/281069.
1184 2004-11-12 Paul Eggert <eggert@cs.ucla.edu>
1186 * NEWS: Document the following changes.
1188 * src/sort.c: Avoid O(N**2) behavior when there are many temporary
1190 (temptail): New variable, so that we can easily append to list.
1191 (create_temp_file): Create new files at end of list, so that
1192 searching the list has O(N*NMERGE) behavior instead of O(N**2).
1193 (zaptemp): Update temptail if needed.
1194 (mergefps, merge): Accept new arg that counts temp files, and keep it
1195 up to date as we create and remove temporaries. This is for
1196 efficiency, so that we don't call zaptemp so often.
1197 All callers changed.
1198 (sort): Don't create array in reverse order, since the list of
1199 temporaries is now in the correct order.
1201 (zaptemp): Protect against race condition: if 'sort' is
1202 interrupted in the middle of zaptemp, it might unlink the
1203 temporary file twice, and the second time this happens the file
1204 might already have been created by some other process.
1206 (zaptemp): Warn if a temporary file is not removed.
1208 (create_temp_file): Use offsetof for clarity.
1209 (die): Move it up earlier, to clean up the code a bit.
1211 * src/pr.c (strtoumax): Declare if not declared.
1212 (skip_to_page, first_page_number, last_page_number, page_number,
1213 first_last_page, print_header):
1214 Use uintmax_t for page numbers.
1215 (first_last_page): Remove unnecessary forward declaration.
1216 Do not modify arg (it is now a const pointer).
1217 Return a true if successful, false (without print a diagnostic)
1219 (main): If +XXX does not specify a valid page range, treat it
1220 as a file name. This follows the response to Open Group XCU ERN 41
1221 <http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>,
1222 which says the behavior is allowed.
1223 (skip_to_page): When starting page number exceeds page count,
1224 print both numbers in the diagnostic.
1225 (print_header): Detect page number overflow.
1227 2004-11-07 Jim Meyering <jim@meyering.net>
1229 * src/uname.c [__APPLE__]: Include <mach/machine.h> and <mach-o/arch.h>.
1230 (main) [__APPLE__]: Get the processor type via syscall rather than
1231 hard-coding "powerpc". From Toby Peterson.
1233 * src/sort.c (merge): Remove declarations of now-unused variables.
1235 2004-11-06 Paul Eggert <eggert@cs.ucla.edu>
1237 * src/sort.c (first_same_file): Remove. Move most of the code to....
1238 (avoid_trashing_input): New function.
1239 (merge): Avoid some silly merges, e.g., copying a single file to
1240 a temporary file when there are exactly 17 input files to merge.
1241 Take a count of temporary files rather than a max_merge arg.
1244 2004-11-06 Jim Meyering <jim@meyering.net>
1246 * src/sort.c (xfclose): Don't close stdout here (just flush it),
1247 since close_stdout now closes stdout unconditionally.
1249 2004-11-05 Paul Eggert <eggert@cs.ucla.edu>
1251 * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps,
1252 first_same_file, merge, sort, main): Use size_t for indexes to arrays.
1253 This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
1255 (getmonth, keycompare, compare): Rewrite to avoid need for alloca,
1256 thus avoiding unchecked stack overflow in some cases. As a side
1257 effect this improve the performance of "sort -M" by a factor of 4
1260 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1262 * src/stty.c: Include "vasprintf.h" since we use vasprintf now.
1264 * src/Makefile.am (check-AUTHORS): Don't assume \? works in a sed
1265 expression; it's not portable. Problem reported by Albert Chin.
1266 Don't invoke a program more than once.
1267 * src/groups.sh (version): New variable, containing author info,
1268 for benefit of AUTHORS check. Use it when acting on --version option.
1269 * AUTHORS: Remove duplicate lines. Remove bogus "chroot:"
1272 * src/system.h: Don't #define and #undef getopt around <stdlib.h>,
1273 as this breaks the new regime that does "#define getopt rpl_getopt".
1274 Problem reported by Albert Chin for Solaris 9 with Sun cc in:
1275 http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00019.html
1276 I suppose this may cause problems on ancient hosts with
1277 incompatible getopt declarations, but we'll cross that bridge if
1278 the problem gets reported to us by someone who can test the fix.
1280 2004-11-03 Jim Meyering <jim@meyering.net>
1282 * src/tac.c: quote(...) file names in diagnostics.
1284 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1286 * NEWS: Document getdate changes.
1288 2004-10-29 Jim Meyering <jim@meyering.net>
1290 * src/tac.c (tac_file): Remove temporary prototype and move this
1291 function `down' so that it precedes definition of tac_nonseekable.
1293 `tac /proc/modules' would print nothing
1294 Reported by Harald Dunkel in http://bugs.debian.org/278604.
1296 * src/tac.c (copy_to_temp): Renamed from save_stdin, since
1297 now it copies a general file descriptor, not just stdin.
1298 (tac_nonseekable): Renamed/adapted from tac_stdin.
1299 (tac_file): Get fd via `open' directly rather than via fopen/fileno,
1300 since we never used the stream. Perform "-" to stdin mapping here
1301 rather than in main. Determine whether a file is seekable,
1302 by trying to `lseek' to its end, and dispatch to tac_seekable or
1303 tac_nonseekable accordingly.
1304 (main): Rewrite argument handling now that it uses only tac_file.
1305 * NEWS: Mention it here.
1307 2004-10-21 Jim Meyering <jim@meyering.net>
1309 * tests/mv/leak-fd: New file.
1310 * tests/mv/Makefile.am (TESTS): Add it.
1311 * tests/rm/dot-rel: New file.
1312 * tests/rm/Makefile.am (TESTS): Add it.
1314 Correct my patch of 2004-10-18.
1315 * src/remove.c (rm): Destroy the saved_cwd here (via cwd_state),
1316 if necessary, not in remove_dir. Otherwise, removing multiple
1317 `.'-relative nonempty directories no longer worked.
1319 2004-10-20 Paul Eggert <eggert@cs.ucla.edu>
1321 * src/fmt.c (usage): Improve description of --prefix.
1322 Problem reported by Edward Welbourne.
1324 * man/uniq.x: Change summary so that it doesn't imply that
1325 uniq writes to its input file. Problem reported by
1328 2004-10-18 Jim Meyering <jim@meyering.net>
1330 Plug a leak that would cause a cross-device mv to fail when
1331 operating on too many command-line-specified nonempty directories.
1332 * src/remove.c (remove_dir): Destroy the `struct saved_cwd' on the
1333 top of the stack before returning. This usually closes the file
1334 descriptor that was used to return to the original working directory.
1335 Reported by Cyril Bouthors in
1336 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/3048
1337 * NEWS: Mention it here.
1339 * src/pathchk.c (validate_file_name): Give a more descriptive
1340 diagnostic when pathconf fails. This also avoids an unwarranted
1341 warning from gcc-3.3.5 about a format not being a string literal.
1343 * src/sleep.c (main): Remove declaration of unused local, c.
1344 * src/printenv.c (main): Likewise.
1345 * src/logname.c (main): Likewise.
1346 * src/uptime.c (main): Likewise, for optc.
1347 * src/tsort.c (main): Likewise, for opt.
1349 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
1351 * AUTHORS: Add self to pathchk.
1352 * src/pathchk.c (AUTHORS): Add self.
1353 Change "path" to "file name" whenever possible.
1354 Remove usage comment, as it was a duplication of the code or doc.
1355 Include <wchar.h> if available.
1356 (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define.
1357 (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX,
1358 pathconf_wrapper, portable_chars, dir_ok): Remove.
1359 (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros.
1360 (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent.
1361 (portable_chars_only): New arg FILELEN.
1362 Don't assume ASCII; we might be on an EBCDIC host.
1363 Don't assume unibyte locale in diagnostic.
1364 (component_start, component_len): New functions.
1365 (validate_file_name): Renamed from validate_path. All uses changed.
1366 Pretty much a complete rewrite.
1367 Don't make copy of file arg. Always append trailing slash to
1368 pathconf arg, just in case it's a symlink (this is pure paranoia;
1369 we don't know of any hosts where the trailing slash is required).
1370 Use size_t instead of long int when possible.
1371 Avoid need to call pathconf in most practical cases.
1372 Don't use euidaccess several times to test searchability;
1373 just use lstat once. Reword diagnostic to put the (often very long)
1376 2004-10-15 Paul Eggert <eggert@cs.ucla.edu>
1378 * src/printf.c (usage): Mention Unicode, and use H for hex digits.
1380 2004-10-13 Jim Meyering <jim@meyering.net>
1382 * NEWS: Mention today's fts.c fix.
1384 2004-10-13 Paul Eggert <eggert@cs.ucla.edu>
1386 * tests/stty/row-col-1: Set LC_ALL=C.
1388 2004-10-12 Jim Meyering <jim@meyering.net>
1390 * src/dircolors.hin: Add .flac and .mpc as audio suffixes.
1391 From Jesus Climent in http://bugs.debian.org/276149.
1393 2004-10-05 Paul Eggert <eggert@cs.ucla.edu>
1395 * src/ls.c (ignore_mode): Renamed from ignore, to avoid shadowing
1396 problems. All uses changed.
1398 2004-10-05 Jim Meyering <jim@meyering.net>
1400 * .x-sc_trailing_blank: Add an exclusion for config/texinfo.tex,
1401 since Karl says its trailing blanks are there to stay :-)
1403 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1405 * src/expr.c (NEW, OLD): Remove, partly to avoid
1406 reference to obsolescent macro XMALLOC.
1407 All uses replaced by xmalloc and free.
1409 2004-09-28 Jim Meyering <jim@meyering.net>
1411 * src/tail.c (usage): Clarify: --retry works only with --follow=name.
1412 Reported by Nik A. Melchior in http://bugs.debian.org/273781.
1414 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
1416 * src/od.c (format_address_paren): c is optional, so don't output
1419 2004-09-26 Paul Eggert <eggert@cs.ucla.edu>
1421 Add support for ls --hide. Idea suggested by Bardur Arantsson.
1422 * NEWS: Document this.
1423 * src/ls.c (file_ignored): Renamed from file_interesting, with
1424 inverted return value. Accept the file name, not a struct dirent *.
1425 All uses changed. Avoid the expense of calling fnmatch if the
1426 file is ignorable due to leading '.'.
1427 (all_files, really_all_files): Removed; replaced by:
1428 (ignore): New variable. All uses changed.
1429 (IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION):
1431 (hide_patterns): New variable.
1432 (long_options, decode_switches, file_ignored, usage):
1433 Add support for --hide.
1434 (patterns_match): New function.
1435 (usage): Replace "hide" with "ignore" in explanation, to avoid
1438 2004-09-25 Paul Eggert <eggert@cs.ucla.edu>
1440 * src/ls.c (gobble_file, print_long_format): Don't assume that
1441 human-readable output has a byte count equal to its column width;
1442 this isn't always true in locales where the radix character is not
1444 (format_user_or_group): Revamp code to match the above fix;
1445 this avoids the (very faint) possibility of integer overflow.
1447 2004-09-24 Paul Eggert <eggert@cs.ucla.edu>
1449 * NEWS: Mention that "chmod -r -w x" now works as expected.
1450 * src/chmod.c (main): Revamp option processing to support this.
1451 * tests/chmod/Makefile.am (TESTS): Add 'usage'.
1452 * tests/chmod/usage: New set of tests for usage like that.
1454 2004-09-24 Jim Meyering <jim@meyering.net>
1456 * Makefile.maint (CVS_LIST): Use --types=AFGM option so that
1457 it lists only cvs-controlled regular files.
1459 * src/csplit.c (xalloc_die): Declare to be `extern', not `static'
1460 to avoid a warning from gcc-3.4.1. Reported by Paul Eggert.
1462 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
1464 * Makefile.maint (CVS_LIST): New macro.
1465 (sc_space_tab, sc_prohibit_atoi_atof, sc_file_system,
1466 sc_prohibit_jm_in_m4, sc_system_h_headers, sc_sun_os_names,
1467 sc_trailing_blank, po-check): Use it instead of the
1468 nonstandard "cvsu --list".
1470 * src/tail.c (parse_obsolete_option): Bring back support
1471 for obsolete option followed by non-obsolete, or by more
1472 than one file. When obsolete, conform to SUSv2 rather than
1473 original POSIX 1003.2-1992, as SUSv2 corrected the case of
1474 "tail -c". Add support for the SUSv2 "b" modifier.
1475 * NEWS: Mention the above.
1476 * tests/tail/Test.pm: New test case obs-b to check the above.
1477 err-[134] no longer need _POSIX2_VERSION=199209.
1478 Fix comments to match revised behavior.
1480 2004-09-22 Jim Meyering <jim@meyering.net>
1482 * Use automake-1.9.2. Regenerate dependent files.
1484 * src/remove.c (struct dirstack_state) [current_arg_jumpbuf]:
1485 Improve the comment.
1487 Clean up scoping etc. so that some make `distcheck' tests pass.
1488 * src/csplit.c (xalloc_die): Declare to be static.
1489 * src/chown-core.c (chown_files): Declare as `extern'.
1490 * src/cp-hash.c (remember_created): Likewise.
1491 * src/copy.c (copy): Likewise.
1492 * src/checksum.h (enum) [ALG_MD5]: Define to be 1, not 0.
1494 * src/id.c, src/nl.c, src/expand.c: Remove trailing blanks.
1495 * src/unexpand.c: Likewise.
1497 * src/Makefile.am (check-AUTHORS): New rule.
1498 (check): Depend on it.
1501 * Makefile.maint (syntax-check-rules): Remove duplicate sc_tight_scope.
1502 (sc_system_h_headers): Also exclude copy.h; it includes <stdbool.h>.
1504 2004-09-22 Paul Eggert <eggert@cs.ucla.edu>
1506 * src/ls.c (decode_switches): Don't compare a short value
1507 to SIZE_MAX: GCC sometimes complains.
1509 2004-09-21 Paul Eggert <eggert@cs.ucla.edu>
1511 * NEWS: The following commands now reject unknown options:
1512 basename dirname factor hostname link nohup sync unlink yes
1513 Also, pathchk no longer accepts trailing options.
1515 * src/basename.c: Include <getopt.h>.
1516 * src/chroot.c: Likewise.
1517 * src/dirname.c: Likewise.
1518 * src/factor.c: Likewise.
1519 * src/hostid.c: Likewise.
1520 * src/hostname.c: Likewise.
1521 * src/nohup.c: Likewise.
1522 * src/pwd.c: Likewise.
1523 * src/setuidgid.c: Likewise.
1524 * src/sync.c: Likewise.
1526 * src/basename.c (main): Reject unknown options.
1527 * src/dirname.c (main): Likewise.
1528 * src/factor.c (main): Likewise.
1529 * src/hostid.c (main): Likewise.
1530 * src/hostname.c (main): Likewise.
1531 * src/link.c (main): Likewise.
1532 * src/nohup.c (main): Likewise.
1533 * src/pwd.c (main): Likewise.
1534 * src/setuidgid.c (main): Likewise.
1535 * src/sync.c (main): Likewise.
1536 * src/unlink.c (main): Likewise.
1537 * src/yes.c (main): Likewise.
1539 * src/cat.c (main): Remove unused "case 0".
1540 * src/chgrp.c (main): Likewise.
1541 * src/chmod.c (main): Likewise.
1542 * src/chown.c (main): Likewise.
1543 * src/comm.c (main): Likewise.
1544 * src/cp.c (main): Likewise.
1545 * src/csplit.c (main): Likewise.
1546 * src/cut.c (main): Likewise.
1547 * src/date.c (main): Likewise.
1548 * src/df.c (main): Likewise.
1549 * src/du.c (main): Likewise.
1550 * src/env.c (main): Likewise.
1551 * src/expand.c (main): Likewise.
1552 * src/fold.c (main): Likewise.
1553 * src/head.c (main): Likewise.
1554 * src/id.c (main): Likewise.
1555 * src/install.c (main): Likewise.
1556 * src/join.c (main): Likewise.
1557 * src/ln.c (main): Likewise.
1558 * src/ls.c (decode_switches): Likewise.
1559 * src/mkdir.c (main): Likewise.
1560 * src/mkfifo.c (main): Likewise.
1561 * src/mknode.c (main): Likewise.
1562 * src/mv.c (main): Likewise.
1563 * src/nl.c (main): Likewise.
1564 * src/paste.c (main): Likewise.
1565 * src/pinky.c (main): Likewise.
1566 * src/pr.c (main): Likewise.
1567 * src/ptx.c (main): Likewise.
1568 * src/readlink.c (main): Likewise.
1569 * src/rm.c (main): Likewise.
1570 * src/rmdir.c (main): Likewise.
1571 * src/seq.c (main): Likewise.
1572 * src/shred.c (main): Likewise.
1573 * src/split.c (main): Likewise.
1574 * src/sum.c (main): Likewise.
1575 * src/tac.c (main): Likewise.
1576 * src/tail.c (main): Likewise.
1577 * src/tee.c (main): Likewise.
1578 * src/touch.c (main): Likewise.
1579 * src/tr.c (main): Likewise.
1580 * src/tty.c (main): Likewise.
1581 * src/uname.c (main): Likewise.
1582 * src/unexpand.c (main): Likewise.
1583 * src/wc.c (main): Likewise.
1584 * src/who.c (main): Likewise.
1586 * src/chroot.c (main): Use getopt where it suffices, not getopt_long.
1587 * src/cksum.c (main): Likewise.
1588 * src/dd.c (main): Likewise.
1589 * src/logname.c (main): Likewise.
1590 * src/printenv.c (main): Likewise.
1591 * src/sleep.c (main): Likewise.
1592 * src/tsort.c (main): Likewise.
1593 * src/uptime.c (main): Likewise.
1594 * src/users.c (main): Likewise.
1595 * src/whoami.c (main): Likewise.
1597 * src/du.c (long_options): Standardize on NULL vs 0.
1598 * src/rm.c (long_opts): Likewise.
1600 * src/logname.c (long_options): Remove.
1601 * src/printenv.c (long_options): Likewise.
1602 * src/sleep.c (long_options): Likewise.
1603 * src/tsort.c (long_options): Likewise.
1604 * src/uptime.c (longopts): Likewise.
1605 * src/users.c (longopts): Likewise.
1606 * src/whoami.c (long_options): Likewise.
1608 * src/pathchk.c (longopts): Add --help, --version.
1609 (main): Use longopts rather than parse_long_options.
1610 * src/stty.c (longpts, main): Likewise.
1612 * src/pathchk.c (main): Don't reorder arguments, so that
1613 we can check weird file names.
1615 * src/readlink.c: Don't include "long-options.h".
1616 * src/sort.c: Likewise.
1617 * src/stty.c: Likewise.
1619 * src/split.c (verbose): Now bool, not int.
1620 (VERBOSE_OPTION): New enum.
1621 (longopts, main): Use it.
1623 * tests/factor/basic: Adjust to new wording in diagnostic
1624 that results from the above changes.
1626 2004-09-21 Jim Meyering <jim@meyering.net>
1628 * man/rm.x: Say "the response is affirmative" rather than "the
1629 response begins with y or Y", so that the documentation is
1630 accurate in non-English locales. Problem reported by Munzir Taha.
1632 2004-09-19 Paul Eggert <eggert@cs.ucla.edu>
1634 * src/echo.c (main): Don't pass NULL to strcmp when
1635 POSIXLY_CORRECT and given no arguments.
1637 * src/md5sum.c (STRING_OPTION): Remove.
1638 (long_options, main): Remove support for undocumented and
1639 obsolete --string option, as suggested in the 1996-09-26 patch.
1640 * NEWS: Document this.
1642 * tests/rm/fail-eperm: Don't try to remove writeable files in a
1643 sticky /tmp directory, as SVR4-like systems (e.g., Solaris 9) let
1644 you remove such files. Problem reported by Bert Fischer in:
1645 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00074.html
1647 2004-09-18 Paul Eggert <eggert@cs.ucla.edu>
1649 * src/md5sum.c (STATUS_OPTION, STRING_OPTION): New enums.
1650 (long_options, main): Use them instead of magic numbers 2 and 1.
1651 For --string, optarg can't possibly be NULL.
1653 * src/dd.c (usage): Distinguish between options and operands.
1654 (scanargs): Don't mess with argc, argv; getopt_long handles this now.
1655 Say "operands" for operands, not "options".
1656 (main): Use getopt_long, so that "dd --" works as POSIX requires.
1657 * tests/dd/misc: Check for "dd --".
1659 * src/chroot.c (main): Reject unknown options instead of
1660 interpreting them as a directory to chroot to.
1662 * src/cksum.c: Remove obsolete comment about POSIX 1003.2/D11.2.
1663 The current standard (POSIX 1003.1-2004) is correct.
1664 (crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid
1665 collision with builtin function.
1666 (main) [defined CRCTAB]: Output in lowercase hexadecimal, and
1667 output the first 0 as 8 digits, to make it easier to compare to
1668 the text of the standard. Output crctab to be a const array.
1669 (crctab): Use result of above changes.
1670 (long_options): Remove; not needed if empty.
1671 (main): getopt_long can't return 0 here, so simplify the code.
1673 2004-09-13 Jim Meyering <jim@meyering.net>
1675 * src/Makefile.am (localedir.h): Don't redirect directly to target.
1677 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1679 * src/id.c (print_full_info): Don't exit with failure status simply
1680 because a user or group number can't be turned into a name.
1681 Problem reported by Felipe Kellermann in:
1682 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00081.html
1684 2004-09-12 Jim Meyering <jim@meyering.net>
1686 * Makefile.maint (my-distcheck): When building with -Werror, also
1689 2004-09-10 Paul Eggert <eggert@cs.ucla.edu>
1691 * NEWS: "tail" now handles obscure POSIX 1003.2-1992 cases better.
1692 * src/tail.c (parse_obsolete_option): Renamed from
1693 parse_obsolescent_option, since the options are obsolete now.
1694 Remove bool *arg; just exit if there's an error. Revamp to follow
1695 POSIX 1003.2-1992 more precisely, to handle cases like "tail -
1696 file" and "tail -10 -- file" correctly when we are conforming to
1698 (main): Adjust to this change.
1699 * tests/tail/Test.pm (test_vector): minus-* requires
1700 _POSIX2_VERSION=199209 now, to work correctly if there is
1701 an input file. err-1 and err-3 no longer errors if there
1704 2004-09-09 Paul Eggert <eggert@cs.ucla.edu>
1706 * src/test.c (usage): Document -r, -w, -x more carefully.
1708 2004-09-08 Paul Eggert <eggert@cs.ucla.edu>
1710 * src/test.c (usage): Document "test" (with no args) and "[ ]".
1711 Document that -h and -L don't dereference.
1713 * NEWS: Document that "tr xy -z" now works as per POSIX.
1714 Sort the descriptions.
1715 * src/tr.c (main): Don't reorder options.
1716 * tests/tr/Test.pm (fowler-1): New test case.
1718 2004-09-06 Paul Eggert <eggert@cs.ucla.edu>
1720 * src/touch.c (main): Fix POSIX-conformance bug: "touch --
1721 MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
1722 conforming to pre-2001 POSIX.
1723 * NEWS: Document this.
1724 * tests/touch/obsolescent: Test for this bug. Also, set
1725 _POSIX2_VERSION=199209 and POSIXLY_CORRECT=1 so that it's
1726 a better test for obsolescent features.
1728 * src/sort.c (main): Emulate Solaris 8 and 9 "sort -y", so that
1729 "sort -y abc" is like "sort abc" whereas "sort -y 100" is like
1732 * src/od.c: Several changes for POSIX and FreeBSD compatibility.
1733 (COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X.
1734 (long_options, main): --strings is now -S, not -s.
1735 (usage): Reflect the usage changes.
1736 (parse_old_offset): Do not issue a diagnostic on failure;
1737 callers now do this as necessary.
1738 (main): Support POSIX syntax. Remove unused case 0 from getopt_long.
1739 Add support for new short options (many undocumented) for
1740 compatibility with FreeBSD. Remove FIXME for -s; it's now
1741 POSIX-compatible. Default format is now oS, not o2.
1742 * NEWS: Describe the above.
1744 2004-09-05 Paul Eggert <eggert@cs.ucla.edu>
1746 * src/stty.c (valid_options): Remove.
1747 (main): Fix some bugs in handling invalid option-combinations
1749 (recover_mode): Arg is now char const *, not char *.
1750 (main): Use STDIN_FILENO, not 0.
1751 Simplify option-parsing code a tad.
1752 * tests/stty/basic-1: Check for the fixed bugs.
1754 2004-09-03 Paul Eggert <eggert@cs.ucla.edu>
1756 * src/stat.c (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
1757 it from ever being nonzero. Reported by Pozsar Balazs in:
1758 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
1759 (human_fstype): Add ramfs, squashfs, sysfs.
1760 Reported by Pozsar Balazs in:
1761 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
1762 (human_fstype): Return char const *, not char *.
1763 Simplify internals a bit, and avoid casts.
1765 * src/dd.c (usage): "alternated EBCDIC" -> "alternate EBCDIC".
1766 (bit_count): Remove. All uses changed to....
1767 (multiple_bits_set): New function.
1768 (scanargs): Use it, and check separately for each set of
1769 incompatible options, to improve diagnostics.
1771 (apply_translations): Move checks for incompatible options
1772 to scanargs, so that they're done consistently.
1774 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
1776 Output correct errno-related diagnostic on "paste" I/O errors.
1777 * src/paste.c (write_error, xputchar): New functions.
1778 (paste_parallel): Use correct errno value after input error.
1779 (paste_parallel, paste_serial): Report errno value after output error.
1781 Port to diet libc. Problem reported by Felix von Leitner in:
1782 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html
1783 * src/paste.c (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove;
1784 it's not portable C to assume FILE is a complete type.
1785 (paste_parallel): Use index test instead of ENDLIST, and NULL
1788 2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
1790 POSIX-conformance fixes for "expand" and "unexpand".
1791 Also, consistently use "tab stop" rather than "tabstop".
1792 * NEWS: Document fixes.
1793 * src/expand.c: Revamp to resemble the new unexpand.c better.
1794 (usage): -i does not convert tabs after non-tabs.
1795 (add_tab_stop): Renamed from add_tabstop. All uses changed.
1796 (parse_tab_stop): Renamed from parse_tabstop. All uses changed.
1797 (validate_tab_stop): Renamed from validate_tabstop. All uses changed.
1798 (next_file, main): Check fclose against 0, not EOF.
1799 (expand): Remove unnecessary casts.
1800 Add another loop nesting level, for lines, so that per-line variables
1801 are initialized cleanly.
1802 Revamp tab checking. Check for write error immediately, rather
1803 than just once at the end of the program.
1804 * src/unexpand.c: Lkewise (for the expand.c changes).
1805 (TAB_STOP_SENTINEL): Remove.
1806 (tab_size): Now size_t, not uintmax_t, since we need to store
1807 the sequences of blanks.
1808 (max_column_width): New var.
1809 (usage): Say "blank" where POSIX requires this.
1810 (add_tab_stop): Calculate maximum column width.
1811 (unexpand): Store the pending blanks, instead of merely counting them.
1812 Follow POSIX's rules about -a requiring two blanks before a tab stop.
1813 Get rid of internal label and goto.
1814 * tests/unexpand/basic-1: Fix infloop-3 to match POSIX.
1815 Add blanks-1 through blanks-13.
1817 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1819 * NEWS: "chown : file", "chown '' file", and "chgrp '' file" now
1820 succeed without changing the uid and gid, like FreeBSD.
1821 * src/chgrp.c (parse_group): Return gid_t rather than storing it
1822 through a pointer. Treat "chgrp '' file" as a no-op change,
1824 (main): Set chopt.group_name to NULL if the group is the empty
1826 * src/chown-core.c (describe_change): Describe changes to -1:-1
1827 without using "to OWNERSHIP" phrase.
1828 * src/chown.c (usage): "chown '' file" is now allowed.
1829 (main): Do not set user name to the empty string if the group
1831 * tests/chgrp/basic: Test "chgrp '' file".
1832 * tests/chown/Makefile.am (TESTS): Add separator.
1833 * tests/chown/separator: New file, partly taken from
1834 Dmitry V. Levin's suggestion in
1835 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1837 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1839 * tests/install/basic-1: Test for the -d regression.
1841 2004-08-11 Dmitry V. Levin <ldv@altlinux.org>
1843 * src/install.c (main): Fix -d regression introduced with
1844 --target-directory support at 2004-06-25.
1846 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1848 * src/copy.c (copy_internal): When preserving links, unlink
1849 a destination with link count greater than one. This is so
1850 that commands like "cp -a" don't get confused when copying into
1851 a destination that already contains many hard links. Problem
1852 reported by Tim Waugh in:
1853 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00053.html
1855 2004-08-10 Paul Eggert <eggert@cs.ucla.edu>
1857 Convert all files to UTF-8.
1858 * tests/fmt/basic (8-bit-pfx): Use UTF-8, not Latin-1.
1859 * tests/sort/Test.pm (16a): Likewise.
1860 * tests/uniq/Test.pm (8): Likewise.
1861 * tests/misc/printf-hex: Use ASCII, not Latin-1.
1863 * NEWS: Document "sort -o -" and "tee -" POSIX-conformance fixes.
1864 * src/shred.c (usage): "-" is an operand, not an option.
1865 * src/sort.c (die, xfopen, mergefps, first_same_file, merge):
1866 A null file arg means standard output.
1867 (main): "-o -" means to write to a file named "-",
1868 not to standard output.
1869 * src/tee.c (usage, tee): "tee -" writes to standard output, not
1870 to a file named "-".
1872 2004-08-10 Dmitry V. Levin <ldv@altlinux.org>
1874 * src/install.c (change_timestamps): Fix int->bool conversion
1875 bugs introduced on 2004-07-29.
1877 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1879 * src/shred.c (wipename): Work even if the directory is writeable
1880 and not readable. Prefer write access, since this should work
1881 better with fdatasync.
1883 * src/csplit.c (xalloc_die): New function.
1884 (main): Remove now-obsolete initialization of xalloc_fail_func.
1886 * src/md5sum.c: Adjust to sha->sha1 renaming.
1888 2004-08-08 Dmitry V. Levin <ldv@altlinux.org>
1891 * src/readlink.c (canonicalize_fname): Remove unneeded proxy function.
1892 (can_mode): Make variable local.
1894 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
1896 * src/system.h (O_BINARY) [!O_BINARY && defined O_BINARY]:
1897 Do not define, to avoid annoying compiler messages on QNX 6.3.
1898 Problem reported by Johan in:
1899 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00050.html
1901 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
1903 * src/system.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX):
1904 Define to a concatenation of string literals, not to an expression;
1905 needed for concatenation contexts.
1906 (INTMAX_MAX, INTMAX_MIN): New macros.
1908 * src/stat.c (print_stat): Don't assume st_ino / st_dev fits in
1909 unsigned long; this isn't true for st_ino on Solaris 9.
1911 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1913 * src/uname.c: Do not depend on HAVE_SYSCTL when deciding
1914 whether to include files. Include <sys/param.h> if
1915 HAVE_SYS_PARAM_H (not HAVE_SYSCTL).
1916 (main) [defined __POWERPC__]: Add a kludge to work around a
1917 Mac OS X bug, so that uname -p defaults to "powerpc" if
1918 sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
1919 fails. Problem reported by Petter Reinholdtsen in:
1920 http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
1922 * src/uniq.c (hard_LC_COLLATE, ignore_case, different, check_file,
1923 main): Use bool for booleans.
1924 (writeline, check_file): Use uintmax_t for line counts.
1925 (check_file): Check for and report line number overflow,
1927 * src/wc.c (iswspace, wc): Use to_uchar rather than a cast.
1928 (print_lines, print_words, print_chars, print_bytes, print_linelength,
1929 have_read_stdin, wc, wc_file, main):
1930 Use bool for booleans.
1931 (exit_status): Remove.
1932 (wc, wc_file): Return bool status. All callers changed.
1933 * src/who.c (scan_entries): 0 -> STDIN_FILENO.
1934 * src/whoami.c (main): Print uids using unsigned long int, not
1937 * src/unexpand.c: Int cleanup and minor reorganization to be more
1939 Include quote.h, xstrndup.h.
1940 (TAB_STOP_SENTINEL): Increase from INT_MAX to INTMAX_MAX.
1941 (convert_entire_line, have_read_stdin, parse_tabstops, next_file,
1943 Use bool for booleans.
1944 (tab_size, tab_list, add_tabstop, validate_tabstops, unexpand):
1945 Use uintmax_t for column counts.
1946 (first_free_tab, validate_tabstops, unexpand): Use size_t for sizes.
1947 (add_tabstop, parse_tabstops, main): Don't reserve UINTMAX_MAX
1949 (parse_tabstops): Don't use ISBLANK on possibly-signed char.
1950 Detect overflow in tab stop string.
1951 (next_file, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
1952 (unexpand): Concatenate input files the same way expand does.
1954 * src/touch.c (no_create, use_ref, posix_date, amtime_now,
1955 touch, main): Use bool for booleans.
1956 (main): Avoid integer overflow when given more than INT_MAX
1958 * src/tsort.c (struct item, n_strings): Use size_t for sizes.
1959 (have_read_stdin, count_items, scan_zeros, detect_loop,
1960 recurse_tree, walk_tree, tsort, main):
1961 Use bool for booleans.
1962 (exit_status): Remove.
1963 (tsort): Return a success flag instead of storing into a global.
1965 * src/tty.c (silent, main): Use bool for booleans.
1966 (main): 0 -> STDIN_FILENO.
1967 * src/uname.c (print_element): Use bool for booleans.
1969 * src/test.c (TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND):
1970 Remove. All uses replaced by C99 boolean primitives.
1971 (TEST_TRUE, TEST_FALSE): New constants, for readability.
1972 (test_unop, binop, unary_operator, binary_operator, two_arguments,
1973 three_arguments, posixtest, expr, term, and, or, is_int, age_of,
1974 one_argument, main): Use bool for booleans.
1975 (advance, unary_advance): Now inline procedures rather than a macros.
1976 (is_int): Renamed from isint, to avoid namespace clash with ctype.h.
1977 (term, and, or): When it's easy, loop instead of recursing.
1978 (term): Avoid integer overflow if there are INT_MAX-3 args (!).
1979 (binary_operator, unary_operator): Simplify by systematically rewriting
1980 true==FOO to FOO (where FOO is a boolean).
1981 (unary_operator): Don't consider a file to be a regular file
1982 merely because its mode&S_IFMT is zero. Just use S_ISREG.
1983 Remove unnecessary casts. Remove ifdefs for things like
1984 S_ISSOCK that are no longer needed, since stat-macros.h always
1987 * src/tac-pipe.c (buf_init_from_stdin, find_bol, tac_mem):
1988 Use bool for booleans.
1989 (buf_init_from_stdin, buf_free, find_bol, print_line):
1990 Use size_t for sizes.
1991 * src/tac.c (separator_ends_record, tac_seekable, tac_file,
1992 tac_stdin, tac_stdin_to_mem, main): Use bool for booleans.
1993 (match_length, G_buffer_size, tac_seekable, main): Use size_t for sizes.
1994 (tac_seekable): Use ptrdiff_t for pointer subtraction.
1995 Report an error if the result is out of range.
1996 (tac_seekable, main): Check for integer overflow in buffer size
1998 (main): Remove unnecessary casts.
2000 * src/su.c (run_shell): Pass a new n_additional_args arg, so that
2001 the callee doesn't have to count 'em. All callers changed.
2002 Don't allocate more space for the arg vector than we'll need.
2003 Use memcpy to copy the args rather than rolling our own loop.
2004 Use size_t for sizes.
2005 (fast_startup, simulate_login, change_environment, log_su,
2006 correct_password, restricted_shell, main): Use bool for booleans.
2007 (longopts): Don't assume change_environment is an int.
2008 Use NULL, not 0, for pointers.
2009 (xsetenv): New function, replacing xputenv and concat.
2010 All callers changed.
2011 (elements): Remove; no longer needed.
2012 (log_su, correct_passwd, main): Prefer !x to x==NULL.
2013 (log_su): 2 -> STDERR_FILENO.
2014 (modify_environment, main): Don't assume that getenv's returned value
2015 has an indefinite lifetime.
2016 (modify_environment): Allocate a larger environ.
2017 (main): Remove an impossible 'case 0'; if it happens now, it'll
2018 get diagnosed. Don't assume getpwnam results outlive endpwent.
2019 Check for null or empty pw_name, pw_dir and for null pw_passwd.
2021 * src/stty.c (VA_START): Remove. All callers now use va_start.
2022 (_POSIX_VDISABLE): Remove unnecessary cast.
2023 (struct control_info, visible): Use cc_t for control chars.
2024 (struct control_info): Use size_t for sizes.
2025 (recover_mode, set_mode, display_speed, display_window_size,
2026 valid_options, main, display_changed):
2027 Use bool for booleans.
2028 (integer_arg): Return unsigned long int, not long int.
2029 Accept new max arg; all callers changed, to specify a maximum
2030 value for integer parameters instead of silently overflowing.
2031 (wrap): Do not overrun the stack buffer if the output contains
2032 more than 1024 bytes. Instead, malloc a buffer.
2033 (main): Remove a "what is this?!?" FIXME. Nobody knows what it is.
2034 Remove unnecessary casts.
2035 (set_control_char): Allow int values only up to cc_t range.
2036 (screen_columns): Don't reject INT_MAX.
2037 (display_changed, display_all, display_speed, recover_mode):
2038 Don't assume cc_t fits in int.
2040 * src/remove.h: Add copyright notice.
2041 (struct rm_options): Use bool for booleans.
2042 * src/rmdir.c (empty_paths, ignore_fail_on_non_empty, verbose,
2043 errno_rmdir_non_empty, remove_parents, main): Likewise.
2044 * src/sum.c (have_read_stdin, bsd_sum_file, sysv_sum_file,
2046 (main): Don't dump core if invoked with argv[0]==NULL.
2047 * src/tee.c (tee, append, ignore_interrupts, main, tee):
2048 Use bool for booleans.
2049 (tee): Use ssize_t for read returns.
2051 * src/ptx.c: Add a FIXME mentioning that there are many
2052 unchecked integer overflows in this file.
2053 (gnu_extensions, auto_reference, input_reference, right_reference,
2054 ignore_case, initialize_regex, fix_output_parameters,
2055 output_one_roff_line, output_one_text_line, output_one_dumb_line, main):
2056 Use bool for booleans.
2057 (SKIP_SOMETHING, compare_words, digest_break_file,
2058 find_occurs_in_text, fix_output_parameters):
2059 Use to_uchar instead of a caset.
2060 (print_field): Rewrite to avoid cast.
2062 * src/printf.c (posixly_correct): Use bool for booleans.
2063 (verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
2064 (STRTOX): Rewrite to avoid casts.
2065 (print_esc_char): Arg is char, not int.
2066 * src/readlink.c (canonicalize): Remove. All uses now merely inspect
2068 (no_newline, verbose): Use bool for booleans.
2069 (can_mode): Now of type int; use -1 to denote otherwise-uninitialized.
2070 * src/shred.c (struct Options, main): Use bool for booleans.
2071 (isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
2072 * src/split.c (cwrite, bytes_split, lines_split, line_bytes_split):
2073 Use bool for booleans.
2074 * src/stat.c (G_fail): Remove.
2075 (print_statfs): Print various gotta-be-nonnegative values using
2076 unsigned long int, not long int or int.
2077 (do_statfs, do_stat): Return a boolean success flag.
2078 (do_stat, main): Use bool for booleans.
2080 * src/pr.c: Add a FIXME mentioning that there are many
2081 unchecked integer overflows in this file.
2082 (TRUE, FALSE): Remove. All uses replaced by true and false.
2083 (struct COLUMN, read_line, print_page, print_stored, open_file,
2084 skip_to_page, init_fps, parallel_files, align_empty_cols,
2085 empty_line, FF_only, explicit_columns, extremities, keep_FF,
2086 print_a_FF, print_a_header, use_form_feed, have_read_stdin,
2087 print_across_flag, storing_columns, balance_columns,
2088 truncate_lines, join_lines, untabify_input, failed_opens,
2089 numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix,
2090 double_space, ignore_failed_opens, use_col_separator,
2091 pad_vertically, last_line, main, init_parameters, skip_read,
2092 read_line, print_stored):
2093 Use bool for booleans.
2094 (struct COLUMN, char_to_clump, store_char, print_char):
2096 (clump_buff, print_clump): Use char[], not int[], for an array whose
2097 elements are always chars.
2098 (first_last_page, main, getoptarg, balance, add_line_number,
2099 char_to_uclump): Remove unnecessary casts.
2100 (init_parameters): Allocate chars, not ints, for clump_buff.
2101 (print_char): Use to_uchar before invoking ISPRINT.
2102 (char_to_clump): Convert to unsigned char before invoking ISPRINT.
2104 * src/nohup.c (main): Use bool for booleans.
2105 * src/paste.c (paste_parallel, paste_serial, main): Likewise.
2106 * src/pathchk.c (validate-path, main, portable_chars_only): Likewise.
2107 (portable_chars_only): Use to_uchar rather than a cast.
2108 * src/printenv.c (main): Use bool for booleans.
2109 Do not assume that the environ has at most one matching entry
2110 for each option (integer overflow was possible otherwise).
2112 * src/od.c (FMT_BYTES_ALLOCATED): Now an enum, not a decimal
2113 constant. Do not assume PRIdMAX etc. are strings of length 3 or
2115 (struct tspec): Use it. fmt_string is now an array, not
2116 a pointer, as there's little point to the indirection here.
2117 (struct tspec, flag_dump_strings,
2118 traditional, flag_pseudo_start, limit_bytes_to_format,
2119 abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul,
2120 decode_one_format, open_next_file, check_and_close,
2121 decode_format_string, skip, write_block, read_char, read_block,
2122 parse_old_offset, dump, dump_strings, main):
2123 Use bool for booleans.
2124 (struct tspec): Use void *, not char *, for generic pointers.
2125 (bytes_to_oct_digits, bytes_to_signed_dec_digits,
2126 bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
2127 Use char, not unsigned int, since char suffices.
2128 (print_s_char, print_char, print_s_short, print_short,
2129 print_int, print_long, print_long_long, print_float,
2130 print_double, print_long_double): Rewrite to avoid casts.
2131 These now take void * arguments, instead of char *.
2132 Use the same body for all functions, except for the choice
2133 of type. Assume C89 to simplify handling of signed char.
2134 (dump_hexl_mode_trailer, print_named_ascii, print_ascii):
2135 Rewrite to avoid casts.
2136 (print_named_ascii, print_ascii): Now takes void *, not char *.
2137 (decode_one_format): Use int for printf field widths, not
2138 unsigned int. Pass void * to subsidiary printers,
2139 not char *. Simplify handling of floating-point formats
2140 by factoring out common code dealing with precision and field width.
2141 (decode_format_string): Avoid need for temporary copy of
2142 each decoded struct tspec.
2143 (get_lcm): Remove unnecessary cast.
2144 (main): Fix bug where more than INT_MAX failed decodes were ignored.
2146 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
2148 * src/nl.c (TRUE, FALSE): Remove; all uses changed to true, false.
2149 (enum number_format): Remove.
2150 (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings,
2152 (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro.
2153 (section_del): Now const.
2154 (print_fmt): Remove.
2155 (starting_line_number, page_incr, blank_join, line_no,
2156 print_lineno, proc_text, main):
2157 Use intmax_t for line numbers.
2158 (reset_numbers, have_read_stdin, build_type_arg, nl_file, main):
2159 Use bool for booleans.
2160 (lineno_format): Now a string, not an enum value.
2161 (build_print_fmt): Remove. All calls removed. This work is
2162 now done within print_lineno.
2163 (build_type_arg): Use size_t for sizes.
2164 (print_lineno): Check for line number overflow.
2165 (proc_text, main): Remove unnecessary cast.
2167 * src/ln.c (symbolic_link, interactive, remove_existing_files,
2168 verbose, hard_dir_link, dereference_dest_dir_symlinks,
2169 do_link, main): Use bool for booleans.
2171 * src/ls.c (struct fileinfo, file_interesting,
2172 extract_dirs_from_files, color_symlink_as_referent,
2173 FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
2174 numeric_ids, print_block_size, dired, print_with_color,
2175 check_symlink_color, print_inode, recursive, immediate_dirs,
2176 all_files, really_all_files, qmark_funny_chars,
2177 print_dir_name, format_needs_stat, format_needs_type, visit_dir,
2178 main, decode_switches, parse_ls_color, print_dir, file_interesting,
2179 gobble_file, make_link_path, basename_is_dot_or_dotdot,
2180 extract_dirs_from_files, print_long_format):
2181 Use bool for booleans.
2182 (dir_defaulted): Remove; no longer needed.
2183 (main): Use int to count files, since it suffices for argv.
2184 Rewrite to avoid need for dir_defaulted.
2185 (main, print_dir, gobble_file, get_link_name,
2187 Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
2188 (decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
2189 Remove unnecessary cast to int. Use int instead of unsigned
2190 int to count from 0 to 1.
2191 (get_funky_string, print_type_indicator): Use char for bytes, not int.
2192 (make_link_path): Use NULL for null pointers.
2193 (quote_name): Use to_uchar instead of cast.
2195 * src/id.c (use_name, main, print_user, xgetgroups, print_group_list,
2196 print_full_info): Use bool for booleans.
2197 (problems): Remove, replacing with....
2198 (ok): New var (inverted from old sense).
2199 (print_user, print_group, print_full_info):
2200 Print uids/gids with %lu, not %u.
2201 (xgetgroups): Don't run out of memory if getgroups or getugroups
2203 * src/setuidgid.c (main): Print uids/gids with %lu, not %ld.
2205 * src/factor.c (wheel_tab): Use unsigned char instead of unsigned
2206 int, since it suffices.
2207 (factor, print_factors): Use size_t for sizes.
2208 (print_factors, do_stdin, main): Use bool for booleans.
2209 * src/fold.c (TAB_WIDTH): New macro; use it instead of "8".
2210 (fold_file, main): Use bool for booleans.
2211 (fold_file, main): Use size_t for sizes.
2212 (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead
2213 of prohibiting widths greater than INT_MAX.
2214 * src/head.c (presume_input_pipe, print_headers, have_read_stdin,
2215 write_header, elide_tail_bytes_pipe, elide_tail_bytes_file,
2216 elide_tail_lines_pipe, elide_tail_lines_seekable,
2217 elide_tail_lines_file, head_bytes, head_lines, head, head_file,
2218 string_to_integer, main):
2219 Use bool for booleans.
2220 (main): Rewrite to avoid cast.
2222 * src/csplit.c (struct line): Use size_t for sizes.
2223 (main): Remove unnecessary cast.
2224 * src/cut.c (cut_fields): Use to_uchar rather than a cast.
2225 * src/cut.c (cut_file, main): Use bool for booleans.
2226 * src/date.c (show_date, rfc_format, batch_convert, main): Likewise.
2227 * src/env.c (main): Likewise.
2228 * src/expr.c (nextarg): Likewise.
2229 * src/env.c (main): Remove unused and nonstandard envp arg.
2231 * src/fmt.c (COST, MAXWORDS): Add a comment describing some of
2232 fmt's arbitrary limits.
2233 (TRUE, FALSE): Remove; all uses changed to (true, false).
2234 (main): Use bool for booleans.
2235 Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol,
2237 (copy_rest): Remove unnecessary cast.
2238 (get_prefix): Rewrite to avoid cast.
2239 (check_punctuation): Use char *, not unsigned char *; C89 requires
2240 this. Avoid off-by-one buffer read overrun when line is empty.
2241 (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX.
2242 Remove unnecessary casts.
2243 * tests/fmt/basic (wide-1, wide-2, bad-suffix): Adjust to above
2246 * src/expand.c (convert_entire_line, have_read_stdin, parse_tabstops,
2247 next_file, expand, main):
2248 Use bool for booleans.
2249 (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops,
2251 Use uintmax_t for column counts.
2252 (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value.
2253 All callers changed.
2254 (parse_tabstops): Don't pass a negative char to isblank.
2255 Avoid memory leak with large tab stops.
2256 (validate_tabstops, expand): Don't assume number of tab stops is
2258 (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when
2259 storing values into exit_status.
2260 (expand): Use same pattern as unexpand for reading chars.
2261 Report an error when input line is too long, instead of silently
2262 screwing up. Do not mishandle tab stops when backspacing left
2265 * src/dircolors.c (have_read_stdin, append_quoted,
2266 dc_parse_stream, dc_parse_file, main): Use bool for booleans.
2267 (dc_parse_stream): Use enum for state, rather than int.
2268 Use ssize_t to store getline result.
2270 * src/dd.c (translation_needed, parse_integer, scanargs,
2271 apply_translations, char_is_saved, swab_buffer, skip_via_lseek):
2272 Use bool for booleans.
2273 (translate_buffer): Use to_uchar rather than a cast.
2274 (swab_buffer, copy_simple, copy_with_unblock):
2275 Use size_t for sizes.
2277 * src/seq.c (equal_width, valid_format, main): Use bool for booleans.
2278 * src/sleep.c (apply_suffix): Likewise.
2279 * src/tail.c (struct File_spec, reopen_inaccessible_files, count_lines,
2280 forever, from_start, print_headers, have_read_stdin, valid_file_spec,
2281 write_header, file_lines, pipe_lines, pipe_bytes, recheck,
2282 tail_forever, tail_bytes, tail_lines, tail, tail_file,
2283 parse_obsolescent_option, parse_options, main): Likewise.
2284 * src/sleep.c (apply_suffix): Invert sense of result.
2285 Use int (not unsigned int) for multiplier, as this generates better
2286 code with some compilers. Simplify code a bit.
2287 * src/tail.c (struct File_spec, max_n_unchanged_stats_between_opens,
2288 parse_options): Use uintmax_t, not unsigned int or unsigned long int,
2290 (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
2291 make it a bit clearer.
2293 * src/hostname.c: Include "xgethostname.h".
2294 (xgethostname): Remove decl; xgethostname.h has it.
2295 (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
2296 && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
2297 prototypes rather than K&R form. Assume any negative value from
2298 sysinfo denotes failure, not just -1.
2299 (main): Simplify use of sethostname.
2301 * src/pinky.c (include_idle, include_heading, include_fullname,
2302 include_project, include_plan, include_home_and_shell, do_short_format,
2303 include_where, main): Use bool for booleans.
2304 (count_ampersands, create_fullname, scan_entries, short_pinky):
2305 Use size_t for sizes.
2306 (create_fullname): Check for overflow in size calculations.
2307 (idle_string): Don't assume that the number of idle days
2308 is less than 10**8 and/or INT_MAX/(24*60*60).
2309 (main): No need to pass a non-NULL last arg to getopt_long.
2310 * src/uptime.c (print_uptime, uptime): Use size_t for sizes.
2311 (print_uptime): Remove unused local variable.
2312 (main): No need to pass a non-NULL last arg to getopt_long.
2313 * src/users.c (list_entries_users, users): Use size_t for sizes.
2314 (list_entries_users): Use char for bytes.
2315 (main): No need to pass a non-NULL last arg to getopt_long.
2316 * src/who.c (do_lookup, short_list, short_output, include_idle,
2317 include_heading, include_mesg, include_exit, need_boottime,
2318 need_deadprocs, need_login, need_initspawn, need_clockchange,
2319 need_runlevel, need_users, my_line_only, main): Use bool for booleans.
2320 (print_runlevel): Use unsigned char for bytes.
2321 (list_entries_who, scan_entries, who): Use size_t for sizes.
2322 (main): No need to pass a non-NULL last arg to getopt_long.
2324 * src/install.c (isdir): Remove decl.
2325 (install_file_to_path): Rely on make_path to fail if the destination
2326 is not a directory, by passing preserve_existing==true to it.
2327 Hence we no longer need to call isdir.
2328 Free dest_dir immediately when it's no longer needed, rather than
2329 waiting until the end of the function.
2330 (copy_file): Don't bother calling isdir, as copy will do the
2331 right thing if the destination is a directory.
2333 * src/du.c (fts_debug, opt_all, apparent_size, opt_count_all,
2334 print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
2335 Use bool for booleans.
2336 (max_depth): Now size_t, not int, to avoid an arbitrary limit
2337 of INT_MAX on depth.
2338 (G_fail): Remove: no longer needed, now that the relevant
2339 functions return bool.
2340 (process_file): Use return value to signal success rather than
2341 setting a global. Remove first_call static var; not needed, since
2342 we can look at n_alloc. Use size_t for depths. Remove FIXME
2343 about size_t casts, as it's now fixed. Use xnrealloc rather
2344 than the obsolescent XREALLOC. Don't bother to check whether
2345 reallocation is needed unless level > prev_level.
2346 (du_files): Invert sense of result, for consistency with
2347 other coreutils code. All callers changed.
2348 (main): Allow --max-depth values up to SIZE_MAX.
2350 * src/df.c (inode_format, show_all_fs, show_local_fs,
2351 show_listed_fs, posix_format, require_sync, print_type,
2352 selected_fstype, excluded_fstype, show_dev, show_point, main):
2353 Use bool for booleans.
2354 (df_readable, show_dev): Use UINTMAX_MAX instead of -1.
2355 (show_dev, show_point, main):
2356 Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2357 Don't assume disk name lengths are <= INT_MAX.
2358 Rewrite pct calculation to avoid cast.
2359 (show_point): Don't assume resolved length is <= SSIZE_MAX.
2361 * src/cut.c (hash_int) [!defined UINTPTR_MAX]: Use size_t
2362 instead of uintptr_t.
2363 * src/shred.c (UINT_MAX_32_BITS): Remove.
2364 (word32): Remove. All uses changed to uint32_t.
2365 (isaac_seed_data): Remove unnecessary cast.
2366 * src/system.h (ptr_align): Use size_t; in practice, this is just as
2367 good as uintptr_t in checking for alignments, and has fewer
2368 configuration hassles.
2370 * src/Makefile.am (localedir.h): Make it readonly; this
2371 undoes part of the 2004-07-27 patch.
2373 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
2375 * src/sort.c (UCHAR): Remove; all uses changed to to_uchar.
2376 (IS_THOUSANDS_SEP): Use bool when appropriate.
2377 (numcompare, main): Use char, not int, when the value is always a char.
2378 (numcompare): Remove "register"; compilers are smart enough these days.
2379 * src/system.h (errno, CHAR_BIT): Remove decls;
2380 no longer needed now we assume C89 or better.
2381 Include <inttypes.h> before <stdint.h>, as it's the
2382 Autoconf-recommended pattern.
2383 (to_uchar): New inline function, moved here from tr.c.
2384 Use full names for int types, e.g. "long int" rather than "long".
2385 * src/tr.c (to_uchar): Remove; now in system.h.
2386 (is_char_class_member): Use bool when appropriate.
2388 * src/mkdir.c (create_parents, main): Use bool when appropriate.
2389 (main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2391 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
2393 * src/mkfifo.c (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.
2395 * src/chmod.c (recurse, force_silent, process_file, process_files,
2396 main): Use bool when appropriate.
2397 * src/cksum.c (cksum, main): Likewise.
2398 * src/comm.c (hard_LC_COLLATE, only_file_1, only_file_2, both,
2399 compare_files, main): Likewise.
2401 * src/copy.h (struct cp_options): Likewise.
2402 * src/copy.c (copy_internal, is_ancestor, copy_dir, copy_reg,
2403 same_file_ok, seen_file, copy_internal, valid_options, copy): Likewise.
2404 * src/cp-hash.h (remember_created): Likewise.
2405 * src/cp-hash.c (remember_created): Likewise.
2406 * src/cp.c (struct dir_attr, flag_path, remove_trailing_slashes,
2407 re_protect, make_path_private, target_directory_operand, do_copy,
2408 cp_option_init, decode_preserve_arg, main): Likewise.
2409 * src/install.c (isdir, change_timestamps, change_attributes,
2410 copy_file, install_file_to_path, install_file_in_dir,
2411 install_file_in_file, strip_files, dir_arg, cp_option_init, main,
2412 change_attributes, change_timestamps): Likewise.
2413 * src/mv.c (remove_trailing_slashes, rm_option_init,
2414 cp_option_init, do_move, movefile, main): Likewise.
2415 * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
2416 AD_push, prompt, remove_dir): Likewise.
2417 * src/rm.c (rm_option_init, main): Likewise.
2419 * src/remove.c (top_dir, pop_dir, full_filename_):
2420 Use size_t for sizes.
2421 * src/cp.c (target_directory_operand): Do not clear *NEW_DST if stat
2422 succeeds. It's not necessary in that case, as *NEW_DST is always
2424 (do_copy): Rewrite slightly to avoid need for "unreachable" comment.
2425 (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
2426 * src/rm.c (main): Likewise.
2428 md5sum, sha1sum integer cleanups.
2430 * src/checksum.h: Don't include config.h, sys/types.h, stdio.h:
2432 (ALG_UNSPECIFIED): Remove.
2433 (ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
2434 * src/md5.c: Don't include any files other than checksum.h.
2435 * src/sha1sum.c: Likewise.
2436 * src/md5sum.c (OPENOPTS, have_read_stdin, status_only, warn,
2437 bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
2438 Use bool when appropriate.
2439 (digest_check): Increase limit of number of input lines to
2440 UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter.
2441 Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
2443 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
2445 * src/cat.c (exit_status): Remove. Now done by passing a boolean
2447 (simple_cat, cat): Return true if successful. All callers changed.
2448 (simple_cat, cat, main): Use bool for booleans.
2449 (simple_cat): Use size_t for sizes.
2450 (cat, main): Use the same names for parameters that we use for
2451 long options, to avoid confusion. This inverts the sense of the
2452 show_tabs (formerly output_tabs) and number_nonblank
2453 (formerly numbers_at_empty_lines) variables.
2454 (main): Don't mess up (due to integer overflow) if we are given
2455 INT_MAX - INT_MIN + 1 options.
2456 [O_BINARY]: Don't invoke isatty unless the other options require it.
2457 (main): When deciding whether to use simple_cat, don't worry
2458 about binary option; it's irrelevant.
2460 * src/dcgen: Remove comments, trailing white space, and empty
2461 lines from the output strings, to save space.
2462 Use a narrower type like 'unsigned char' for line lengths, if
2464 Make the output variables static, not extern.
2466 * src/chgrp.c (parse_group): Require base 10 when parsing
2468 (main): int -> bool when appropriate.
2469 * src/chown.c (main): Likewise.
2470 * src/chown-core.c: Include inttostr.h.
2471 (UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove.
2472 (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr
2473 instead of uint_to_string).
2474 (describe_change): Instead of an int flag, use a char *
2475 auxiliary; this avoids the need for casts.
2476 Assume free (NULL) works.
2477 (change_file_owner): Return true/false, not 0/-1, since
2478 we don't set errno. All callers changed.
2479 Use bool when appropriate.
2480 (chown_files): Likewise.
2481 * src/chown-core.h (chown_files): Likewise.
2483 * tests/chown/basic: Test for proper handling of uids like
2484 "010", which must be parsed as decimal.
2486 * tests/misc/pwd: Don't assume that Perl's getpwd agrees with our
2487 pwd when there are multiple names for the working directory
2488 (which can happen with an automounter, sigh).
2490 * src/Makefile.am ($(SCRIPTS)): Don't depend on Makefile;
2491 this causes Solaris 8 'make' to refuse to build "groups".
2492 (localedir.h): Don't depend on Makefile: this causes Solaris
2493 8 'make' to build localedir.h unnecessarily. The dependence
2494 on Makefile is ineffective anyway, since $(localedir) might
2495 change even if Makefile hasn't.
2497 * src/remove.c (remove_dir): If we can't save the state of the
2498 working directory, pretend we started from "/", not ".".
2499 This avoids a bug on hosts like Solaris that don't let you
2500 remove the working directory.
2502 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
2504 * src/printf.c (strtiomax, strtoumax): Declare if not already
2505 declared: this fixes a portability bug with Solaris 8 + GCC.
2506 (STRTOX): Parenthesize use of macro arg as expression.
2507 (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary
2509 * configure.ac: Check for declaration of strtoumax, for
2512 * src/Makefile.am (cp_LDADD, ginstall_LDADD, mv_LDADD,
2513 pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
2515 * tests/readlink/can-e: Don't assume that we can remove the
2516 working directory: this isn't possible under Solaris 8, say.
2517 * tests/readlink/can-f: Likewise.
2518 * tests/readlink/can-m: Likewise.
2520 * src/copy.c (copy_internal): find_backup_file_name no longer
2521 returns NULL, so don't bother to check for this.
2522 * src/cp.c (do_copy): Likewise.
2523 * src/ln.c (do_link): Likewise.
2525 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
2527 * src/nice.c (GET_NICE_VALUE): Renamed from GET_PRIORITY.
2529 (NZERO): New macro, if system doesn't define it already.
2530 (usage): Distinguish priorities from nice values.
2531 Don't assume NZERO is 20.
2532 (main): Use bool instead of int where appropriate.
2533 If user specifies an adjustment out of range, always truncate it
2534 to an inrange value instead of sometimes giving an error message
2536 Do not assume that -1 is an error return from "nice" or
2537 "getpriority", as it might be the current nice value minus NZERO.
2538 If nice/setpriority fails with errno == EPERM, go ahead and run
2539 the command anyway; POSIX requires this.
2541 * src/pathchk.c: Include euidaccess.h.
2542 (dir_ok): Use euidaccess, not access.
2543 * src/test.c (R_OK, W_OK, X_OK, FOK): Remove; system.h defines them.
2544 (eaccess): Remove. All users changed to use euidaccess instead.
2546 2004-07-24 Paul Eggert <eggert@cs.ucla.edu>
2548 * src/uptime.c (print_uptime) [defined BOOT_MSG]:
2549 Don't assume ut_line is null-terminated.
2550 * src/who.c (print_line): New arguments USERLEN and LINELEN,
2551 since USER and LINE might not be null terminated. All callers
2554 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
2556 Fix bug with "tail -f" reported by Rob Holland in
2557 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00054.html>.
2558 Also, remove the undocumented and unsupported-since-2000
2559 --max-consecutive-size-changes options. Fix another related bug:
2560 "tail" got confused if stdin, stdout, or stderr were closed.
2561 Also, use output buffering even with "tail -f".
2563 * NEWS: Document this, plus yesterday's patch.
2564 * doc/coreutils.texi (tail invocation): "size has remained the same"
2565 -> "file has not changed", which is more accurate for fifos.
2566 * src/tail.c: Include fcntl-safer.h.
2567 (COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong).
2568 (COPY_A_BUFFER): New macro.
2569 (struct File_spec): New members mtime, mode, blocking.
2570 Remove member n_consecutive_size_changes.
2571 (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES,
2572 max_n_consecutive_size_changes_between_opens,
2573 MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove.
2574 (long_options, tail_forever, parse_options):
2575 Remove (non-)support for --max-consecutive-size-changes.
2576 (record_open_fd): New function.
2577 (recheck, tail_file): Use it. Don't assume that stdin is open.
2578 (dump_remainder): Add support for new COPY_A_BUFFER special value.
2579 Treat errno==EAGAIN like EOF, since it might be a nonblocking read.
2580 (recheck): New arg BLOCKING, specifying whether to use blocking reads.
2582 (n_live_files): Remove, replacing with...
2583 (any_live_files): New function. All uses changed.
2584 (tail_forever): Use nonblocking I/O unless we know that blocking I/O
2585 is safe; this avoids some hangs when reading from a fifo.
2586 Avoid invoking fstat or sleep when using blocking I/O.
2587 Do not check for changes to size if the file is not a regular file,
2588 as the size is undefined in that case.
2589 Check for changes to mtime or mode, too; this works for non-regular
2591 (tail_forever, main): Redo fflush strategy to work even when input
2592 is nonblocking. Don't use unbuffered output; just flush when needed.
2594 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
2596 * src/tail.c (main): Ignore -f if no file operand is specified
2597 and standard input is a pipe.
2598 * doc/coreutils.texi (tail invocation): Do not ignore -f for
2599 all pipes, just for when standard input is a pipe and no
2600 file operand is specified.
2601 * tests/tail/Test.pm: Reinstate f-1 test, since we now pass.
2602 Add a new commented-out f-2 test, which we still fail.
2603 (test_vector): All f-* tests are special cases, not just f-1.
2605 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
2607 * src/uptime.c: Include c-strtod.h.
2608 (print_uptime): Use c_strtod instead of setlocale and sscanf.
2609 Use long int rather than int to count days (for 64-bit hosts),
2610 and check for arithmetic overflow when converting double to time_t.
2612 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
2614 * src/printf.c (vstrtold): Renamed from vstrtod.
2615 Now returns long double. All uses changed.
2616 (print_direc): Use "L" length modifier when printing floating point
2617 numbers, since we're now printing long double.
2619 2004-07-06 Paul Eggert <eggert@cs.ucla.edu>
2621 printf cleanup, to avoid undefined behavior, to add support for
2622 formats that Bash supports, and to support wide integers like
2625 * NEWS: Document this.
2626 * src/printf.c (UNSPECIFIED): Remove. All uses now replaced by
2627 booleans, so that we don't reserve any values for precision or
2629 (STRTOX): Use prototype, not K&R-style definition.
2630 (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol
2631 in ../lib), with type change to intmax_t.
2633 (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t.
2635 (vstrtod): Renamed from xstrtod. All uses changed.
2636 (print_direc): Use boolean arg instead of special value to indicate
2637 a missing precision or width. LENGTH no longer includes
2638 length modifiers or conversion character. New arg CONVERSION
2639 now specifies conversion character.
2640 Use intmax_t-width formatting for integers (like Bash).
2641 Add support for C99 %a, %A, %F (like Bash).
2642 Add support for field width with %c (POSIX requires this).
2643 Add a FIXME for lack of support for field width and precision
2645 Add support for '\'', '0' flags.
2646 Check for invalid combinations of flags, field width, precision,
2647 and conversion, to prevent use of undefined behavior.
2648 Allow multiple length modifiers, for formats like "%lld" (like Bash).
2649 Add support for C99 'j', 't', 'z' length modifiers (like Bash).
2650 In error message, output entire invalid conversion specification,
2651 instead of merely outputting % followed by the conversion char.
2652 * tests/misc/printf: Add tests for the above.
2654 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
2656 Change "readlink -f" to be more compatible with prior implementations.
2657 Add more canonicalize options, -e and -m.
2658 Add comprehensive tests for all readlink modes.
2660 * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME):
2661 Do not add canonicalize.c here.
2663 * src/readlink.c (longopts): Add new options.
2664 (usage): Document them.
2665 (canonicalize_fname): New proxy function.
2666 (main): Handle new options.
2667 * doc/coreutils.texi (readlink invocation): Document new
2668 "readlink -f" behaviour and new canonicalize options, -e and -m.
2670 * configure.ac (AC_CONFIG_FILES): Add tests/readlink/Makefile.
2671 * tests/Makefile.am (SUBDIRS): Add readlink.
2672 * tests/readlink/Makefile.am: New file.
2673 * tests/readlink/{rl-1,can-e,can-f,can-m}: New readlink tests.
2674 * tests/misc/Makefile.am (TESTS): Remove basic readlink test.
2675 * tests/misc/readlink: Remove file.
2677 2004-07-04 Jim Meyering <jim@meyering.net>
2679 * src/copy.c (copy_internal): Add a FIXME comment.
2681 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
2683 * src/copy.c (copy_dir): Assume path_concat returns non-NULL.
2684 * src/cp.c (do_copy): Likewise.
2685 * src/mv.c (movefile): Likewise.
2687 * src/cp.c (make_path_private): 2nd arg is now size_t, not int,
2688 to avoid problem when path_concat dir name is longer than 2 GiB (!).
2690 * src/nohup.c (main): Don't pass NULL first argument to path_concat.
2691 This cleans up the semantics a bit, as we no longer try to open the
2694 2004-07-01 Paul Eggert <eggert@cs.ucla.edu>
2696 * NEWS: Add short names -t and -T for --target-directory
2697 and --no-target-directory options, respectively.
2699 * src/cp.c (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
2700 Remove. All uses changed to 'T' and 't', respectively.
2701 * src/install.c, src/ln.c, src/mv.c: Likewise.
2703 * src/cp.c (long_opts, usage, do_copy, main): Add -t and -T as
2704 aliases for --target-directory and --no-target-directory,
2706 * src/install.c (long_options, main, usage): Likewise.
2707 * src/ln.c, src/mv.c: Likewise.
2709 2004-07-01 Jim Meyering <jim@meyering.net>
2711 * Makefile.maint (sc_file_system): New target.
2712 (syntax-check-rules): Add it.
2713 .x-sc_file_system: New file.
2714 * Makefile.am (EXTRA_DIST): Add it.
2716 * man/sync.x: Use "file system" rather than "filesystem".
2717 * man/stat.x, man/df.x: Likewise.
2719 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
2721 * src/df.c (usage, main): Output "file system" rather than
2723 * src/du.c (usage): Likewise.
2724 * src/shred.c (usage): Likewise.
2725 * src/stat.c (usage): Likewise.
2726 * src/stat.c (long_options, usage): Rename "--filesystem" to
2727 "--file-system". But keep the old name around, for compatibility
2730 2004-06-29 Paul Eggert <eggert@cs.ucla.edu>
2732 Add support for --no-target-directory option.
2734 * NEWS: Document it.
2735 * doc/coreutils.texi (Common options, Target directory, cp
2736 invocation, install invocation, mv invocation, ln invocation):
2738 (link invocation): Explain how to rewrite link using ln now
2739 that we have --no-target-directory.
2740 (ln invocation): Explain that --no-target-directory subsumes
2742 (unlink invocation): Modify wording to match new wording in
2745 * src/cp.c (NO_TARGET_DIRECTORY_OPTION): New constant.
2746 (long_opts, usage, do_copy, main): Add support for
2747 --no-target-directory,
2748 * src/install.c (NO_TARGET_DIRECTORY_OPTION, long_options, main,
2750 * src/ln.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
2752 * src/mv.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
2754 * src/mv.c (enum): Sort values.
2756 2004-06-29 Jim Meyering <jim@meyering.net>
2758 Don't let verbose-mode output from a subshell obscure actual differences.
2759 * tests/rm/inaccessible: Turn off command-echoing just before
2760 invoking subshell, then turn it back on if VERBOSE=yes afterward.
2762 2004-06-25 Paul Eggert <eggert@cs.ucla.edu>
2764 Add support for 'install --target-directory', an option
2765 that has been documented for years but not implemented (!).
2766 * doc/coreutils.texi (install invocation): Document
2767 --target-directory in synopsis, too.
2768 * src/install.c (TARGET_DIRECTORY_OPTION): New var.
2769 (long_options, main, usage): Add --target-directory.
2770 (target_directory_operand): New function, stolen from mv.c.
2771 (main): Use it. Check for -d and --target-directory.
2772 Alter wording of diagnostics to match other programs.
2774 2004-06-28 Jim Meyering <jim@meyering.net>
2776 * src/cp.c (usage): Fix copy+paste error in description of
2777 --target-directory: s/move/copy/. From Paul Jarc.
2779 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
2781 Use more-consistent rules among cp, ln, and mv when dealing with
2782 last operands that are (or look like) directories.
2784 * src/cp.c (target_directory_operand): New, nearly-common function,
2785 It reports an error if the destination appears to be a directory
2786 (e.g., because it has a trailing slash) but is not.
2787 * src/ln.c, src/mv.c: Likewise.
2788 * src/cp.c (do_copy): Use it.
2789 * src/ln.c (main): Likewise.
2790 * src/mv.c (main): Likewise.
2792 * src/cp.c (do_copy): Don't assume argc is positive.
2793 Don't bother to lstat dest, since copy() will do that for us.
2794 Use "const" to avoid the need for cast.
2796 * src/cp.c (do_copy): Don't output a usage message because of file
2797 problems (e.g., an operand is not a directory). Use it only for
2798 syntax. Standardize on "target %s is not a directory" for the
2800 * src/ln.c (main): Likewise.
2801 * src/mv.c (main): Likewise.
2803 * src/cp.c (do_copy): Remove test for trailing slash, since
2804 target_directory_operand now does this.
2805 * src/ln.c (main): Likewise.
2806 * src/mv.c (movefile): Likewise.
2808 * src/cp.c (main): Reject multiple target directories.
2809 Check whether a specified target is a directory when parsing the
2810 options, using stat. This gives more-accurate diagnostics.
2811 * src/ln.c (main): Likewise.
2813 * src/ln.c (isdir): Remove decl; no longer needed.
2814 * src/mv.c (isdir, lstat): Likewise.
2816 * src/ln.c (do_link): New arg dest_is_dir. All uses changed.
2817 Don't check the destination ourself; rely on dest_is_dir.
2818 This way we can avoid lstatting the destination in the
2819 usual case, and in the worst case we lstat 1, not 3 times.
2820 Don't bother to unlink unless link failed; this saves a syscall.
2821 Remove unnecessary backup_succeeded flag;
2822 it was identical to "dest_backup != NULL".
2824 * src/ln.c (main): Use int to count to argc, not unsigned int.
2825 This handles negative operand counts.
2826 * src/mv.c (main): Likewise.
2828 * src/mv.c (do_move): Don't call hash_init; expect the caller to
2829 do it, for consistency with cp.c and ln.c. All callers changed.
2830 (movefile): dest_is_dir parameter is now bool, not int.
2831 (main): Standardize on "missing destination file operand after %s"
2832 for the diagnostic, for consistency with cp.c.
2834 * tests/mv/diag: Don't assume "mv --target=nonexistentdir"
2835 will complain about the arg count.
2836 Adjust to new (briefer) diagnostics.
2837 * tests/cp/fail-perm: Add a test to verify that we get the new
2838 diagnostic when failing to copy through a symlink-to-inaccessible-dir.
2840 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
2842 Fix a bug: formerly, if d/x was a directory and x a file, "ln x
2843 d/" incorrectly created a link d/x/x. It also saves some system
2846 * NEWS: Document the fix.
2848 * src/ln.c (main): Don't append basename to dest if this
2849 results in an existing directory name.
2850 * tests/ln/misc: See whether a trailing slash is followed too far.
2852 2004-06-26 Jim Meyering <jim@meyering.net>
2854 * src/printf.c (main): When given no arguments, print the standard
2855 "missing operand\nTry printf --help..." message -- to be consistent.
2857 2004-06-26 Jim Meyering <jim@meyering.net>
2859 * src/mknod.c (main): Add \n at the end of message output via fprintf.
2861 2004-06-25 Jim Meyering <jim@meyering.net>
2863 * tests/ln/misc: Add test for ln subscript error.
2865 2004-06-23 Paul Eggert <eggert@cs.ucla.edu>
2867 * src/ln.c (do_link): Remove unnecessary call to lstat.
2868 (main): Avoid subscript error when the destination is "".
2870 2004-06-23 Jim Meyering <jim@meyering.net>
2872 * tests/*: Replace all occurrences of `(exit N); exit' with
2873 `(exit N); exit N'. Otherwise, those many tests could exit with
2874 improper exit status when exiting via e.g., a trapped interrupt.
2875 Thanks to a report from Bob Proulx.
2877 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
2879 * src/who.c (idle_string, print_user): New arg boottime,
2880 specifying the most recent boot time. All uses changed.
2881 (idle_string) Consider a line to be "old" if it hasn't been used
2882 since the last boot time. Watch out for overflow when computing
2883 times, and for times in the future.
2884 (idle_string): Record latest boot time.
2886 2004-06-22 Jim Meyering <jim@meyering.net>
2888 * src/test.c (usage): Correct description of `-t FD'. The file
2889 descriptor, FD, is no longer optional. Reported by Ton Nijkes.
2891 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
2893 The 2004-06-19 fix for who and pinky was incomplete, as ctime
2894 has undefined behavior if the year precedes -999 or follows 9999.
2895 Since we have to stop using ctime anyway, we might as well use
2896 strftime and fix the FIXME, and support internationalized dates.
2898 * NEWS: Document the new behavior.
2899 * src/who.c: Include "hard-locale.h".
2900 (time_format, time_format_width): New vars.
2901 (time_string, print_line): Use them.
2903 (time_string): Use localtime + strftime instead of
2904 ctime, to avoid problems with years before -999 or after 9999.
2905 * src/pinky.c: Likewise.
2907 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
2909 Fix bug: GNU 'ls' didn't count columns correctly if user or group
2910 names contained multibyte characters where the column count
2911 differed from the byte count. This patch also corrects
2914 * src/ls.c (format_user_or_group): New function, which counts
2916 (format_user, format_group): Use it.
2917 (format_user_or_group_width): New function, which counts columns
2919 (format_user_width, format_group_width): Use it.
2921 2004-06-21 Jim Meyering <jim@meyering.net>
2923 * tests/priv-check: Quote "$PATH" in PATH=$PATH.
2924 Suggestion from Andreas Schwab.
2926 * tests/priv-check: When running as root, be sure to propagate
2927 PATH through to the process we exec as non-root.
2928 Reported by michael@aplatform.com.
2930 * src/mknod.c (main): Don't segfault when calculating the
2931 expected number of operands for `mknod NAME'.
2933 2004-06-20 Jim Meyering <jim@meyering.net>
2935 * src/dd.c (input_seek_errno): Declare file-scoped variable as static.
2937 2004-06-20 Paul Eggert <eggert@cs.ucla.edu>
2939 * src/basename.c (main):
2940 Standardize on the diagnostics given when someone gives
2941 too few operands ("missing operand after `xxx'") or
2942 too many operands ("extra operand `xxx'").
2943 Include "quote.h" and/or "error.h" if it wasn't already being included.
2944 * src/chgrp.c (main): Likewise.
2945 * src/chmod.c (main): Likewise.
2946 * src/chown.c (main): Likewise.
2947 * src/chroot.c (main): Likewise.
2948 * src/comm.c (main): Likewise.
2949 * src/cp.c (do_copy): Likewise.
2950 * src/csplit.c (main): Likewise.
2951 * src/date.c (main): Likewise.
2952 * src/dircolors.c (main): Likewise.
2953 * src/dirname.c (main): Likewise.
2954 * src/du.c (main): Likewise.
2955 * src/expr.c (main): Likewise.
2956 * src/hostid.c (main): Likewise.
2957 * src/hostname.c (main): Likewise.
2958 * src/id.c (main): Likewise.
2959 * src/install.c (main): Likewise.
2960 * src/join.c (add_file_name, main): Likewise.
2961 * src/link.c (main): Likewise.
2962 * src/ln.c (main): Likewise.
2963 * src/logname.c (main): Likewise.
2964 * src/md5sum.c (main): Likewise.
2965 * src/mkdir.c (main): Likewise.
2966 * src/mkfifo.c (main): Likewise.
2967 * src/mknod.c (main): Likewise.
2968 * src/mv.c (main): Likewise.
2969 * src/nohup.c (main): Likewise.
2970 * src/od.c (main): Likewise.
2971 * src/pathchk.c (main): Likewise.
2972 * src/ptx.c (main): Likewise.
2973 * src/readlink.c (main): Likewise.
2974 * src/rm.c (main): Likewise.
2975 * src/rmdir.c (main): Likewise.
2976 * src/seq.c (main): Likewise.
2977 * src/setuidgid.c (main): Likewise.
2978 * src/shred.c (main): Likewise.
2979 * src/sleep.c (main): Likewise.
2980 * src/sort.c (main): Likewise.
2981 * src/split.c (main): Likewise.
2982 * src/stat.c (main): Likewise.
2983 * src/test.c (beyond, main): Likewise.
2984 * src/touch.c (main): Likewise.
2985 * src/tr.c (main): Likewise.
2986 * src/tsort.c (main): Likewise.
2987 * src/tty.c (main): Likewise.
2988 * src/uname.c (main): Likewise.
2989 * src/uniq.c (main): Likewise.
2990 * src/unlink.c (main): Likewise.
2991 * src/uptime.c (main): Likewise.
2992 * src/users.c (main): Likewise.
2993 * src/who.c (main): Likewise.
2994 * src/whoami.c (main): Likewise.
2996 * tests/basename/basic: Adjust to new diagnostics.
2997 * tests/du/files0-from: Likewise.
2998 * tests/expr/basic: Likewise.
2999 * tests/mv/diag: Likewise.
3000 * tests/tsort/basic-1: Likewise.
3002 2004-06-20 Jim Meyering <jim@meyering.net>
3004 * src/ln.c: Remove declaration of yesno.
3005 Instead, include yesno.h.
3006 * src/copy.c: Likewise.
3008 * src/remove.c: Remove declaration of yesno.
3009 Instead, include yesno.h.
3010 (top_dir): Remove now-unnecessary cast of obstack_base.
3011 (pop_dir): Likewise.
3012 (full_filename_): Likewise.
3014 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
3016 Don't dump core if ctime returns NULL; this is possible on
3017 hosts with 64-bit time_t and 32-bit int.
3018 * src/who.c: Include "inttostr.h".
3019 (time_string): If ctime fails, print the raw time as an integer
3020 instead of dumping core.
3021 * src/pinky.c: Likewise, as follows:
3022 Include "inttostr.h".
3023 (time_string): New function, copied from who.c.
3024 (print_entry): Use it.
3026 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
3028 * src/who.c (print_line): Don't truncate user names at 8 bytes.
3029 Problem reported by Guido Leenders in:
3030 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
3031 * NEWS: document this.
3033 2004-06-19 Jim Meyering <jim@meyering.net>
3035 * src/system.h (case_GETOPT_VERSION_CHAR): Switch back to
3036 using GNU_PACKAGE (from PACKAGE) once again. This restores
3037 `GNU' to the parenthesized package name in --version output.
3038 Before, the first argument from AC_INIT, `GNU coreutils', would
3039 be propagated to the PACKAGE variable. Now, `GNU ' is trimmed.
3040 Reported by Richard Stallman.
3042 2004-06-17 Jim Meyering <jim@meyering.net>
3044 * src/tr.c (to_uchar): Rename function from `uchar'. The latter
3045 would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
3047 2004-06-15 Paul Eggert <eggert@cs.ucla.edu>
3049 * NEWS: Remove more special cases for POSIXLY_CORRECT when POSIX
3050 allows the GNU behavior. "--" is now supported by chroot, hostid,
3051 hosname, pwd, sync, yes.
3052 * doc/coreutils.texi (yes invocation, false invocation,
3053 true invocation): Document this.
3054 * src/chroot.c (main): Handle "--".
3055 * src/hostid.c (main): Likewise.
3056 * src/hostname.c (main): Likewise.
3057 * src/pwd.c (main): Likewise.
3058 * src/sync.c (main): Likewise.
3059 * src/yes.c (main): Likewise.
3060 * src/true.c (main): Recognize --help and --version even if
3061 POSIXLY_CORRECT is set.
3062 * src/yes.c (main): Likewise.
3064 2004-06-09 Paul Eggert <eggert@cs.ucla.edu>
3066 * NEWS: Remove special cases for POSIXLY_CORRECT when POSIX allows
3068 * doc/coreutils.texi (pr invocation, unlink invocation): Document this.
3069 * src/ls.c (decode_switches): Pay attention to TABSIZE even if
3070 POSIXLY_CORRECT is set. POSIX reserves upper-case environment
3071 variables to the implementation, so it's OK for ls to depend on
3073 * src/pr.c: Include "hard-locale.h".
3074 (main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
3075 POSIX specifies the behavior only in the POSIX locale.
3076 * src/printf.c (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
3077 since POSIX says the behavior is unspecified here.
3078 * src/tail.c (parse_obsolescent_option): Support multiple file operands
3079 even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
3080 * src/printf.c (main): Recognize --help, --version even if
3081 POSIXLY_CORRECT. POSIX does not specify any options, but it
3082 does not prohibit options either, so "printf" is like "expr" here.
3083 * src/unlink.c (main): Likewise.
3084 * tests/misc/printf: Adjust to the new semantics for \x if
3087 2004-06-14 Jim Meyering <jim@meyering.net>
3089 * tests/misc/pwd: New test, for fix of 2004-04-19.
3090 * tests/misc/Makefile.am (TESTS): Add pwd.
3091 (BUILD_SRC_DIR): Define BUILD_SRC_DIR.
3093 * src/copy.c: Remove declaration of euidaccess.
3094 Instead, include "euidaccess.h".
3096 2004-06-13 Paul Eggert <eggert@cs.ucla.edu>
3098 * src/who.c (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
3099 (UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
3100 as (sizeof "??") reliably returns 3.
3101 (print_line): Guard against idle and pid being too long
3102 (which is possible when printing headers).
3103 (print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
3104 Avoid unnecessary cast of sizeof to int.
3105 (make_id_equals_comment): Do not assume that UT_ID returns
3106 a string; it might return a non-null-terminated array.
3107 Use strncat instead. It's not very often where strncat is
3108 exactly what you want, but this is one of those rare cases.
3110 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
3112 * src/who.c (list_entries_who): Don't output a trailing space.
3114 2004-06-09 Jim Meyering <jim@meyering.net>
3116 * src/touch.c (usage): Improve wording in description of the
3117 --time=WORD option. Reported by Dan Jacobson.
3119 * src/chown-core.c (change_file_owner): Change names of parameters
3120 old_uid and old_gid to required_uid and required_gid respectively.
3122 * src/chmod.c (mode_changed): Return false, not 0, now that the
3123 function returns `bool'.
3125 2004-06-08 Paul Eggert <eggert@cs.ucla.edu>
3127 Adjust chmod and chown to be similar if -c or -v are given. In
3128 particular, a no-op chown is no longer reported as a change; this
3129 reverts to previous behavior. Also, fix both commands so that -v
3130 report failures even if the failure is not due to the chmod or
3133 * src/chmod.c (CH_NOT_APPLIED): New constant.
3134 (describe_change): Handle it.
3135 (process_file): Use it, if a symlink wasn't changed.
3136 (mode_changed): Return bool, not int. Accept new argument
3137 NEW_MODE; all callers changed. This lets us avoid statting the
3138 file unless the new mode has unusual bits.
3139 (process_file): Return -1 on error. With -v, report all errors
3140 verbosely, not just some.
3142 * src/chown-core.c (change_file_owner): Return -1 on error, not
3143 1 sometimes and -1 on others. Our caller ORs together our results,
3144 and (-1 | 1) == 0 on ones-complement hosts.
3145 With -v report all errors verbosely, not just some.
3146 Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
3147 file_stats wasn't set properly in that case.
3149 * tests/chgrp/basic: Adjust to above changes.
3151 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3153 * tests/chgrp/basic: Test that chgrp -h does not fail on
3154 symlinks, even on hosts where that's not supported.
3155 Test that if -R is specified without -H or L, -h is assumed.
3156 Test that chown() is not optimized away.
3158 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
3160 Several fixes to chgrp and chown for compatibility with POSIX and BSD:
3162 Check for incompatible options. When -R and --dereference are
3163 both used, then either -H or -L must also be used. When -R and -h
3164 are both used, then -P must be in effect.
3166 -H, -L, and -P have no effect unless -R is also specified.
3167 If -P and -R are both specified, -h is assumed.
3169 Do not optimize away the chown() system call when the file's owner
3170 and group already have the desired value. This optimization was
3171 incorrect, as it failed to updated the last-changed time and reset
3172 special permission bits, as POSIX requires.
3174 Do not report an error if the owner or group of a
3175 recursively-encountered symbolic link cannot be updated because
3176 the file system does not support it.
3178 * NEWS: Document the above.
3180 * src/chgrp.c (main): Check for incompatible options. -R --dereference
3181 requires either -H or -L, and -R -h requires -P. If -H, specify
3182 FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
3183 file as much like chown.c as possible.
3184 * src/chown.c (main): Likewise.
3186 * src/chown-core.c (change_file_owner): Use ent->fts_statp only if
3187 needed. Chown a directory only after chowning its children; this
3188 avoids problems if the new directory ownership doesn't permit
3189 access to the children. Dereference symlinks before doing
3190 ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
3191 Do not optimize away the chown() system call when the file's owner
3192 and group already have the desired value. POSIX does not permit
3193 this optimization. Rely on chown and lchown to do the right
3194 thing with symlinks and/or -1 arguments, now that we have wrappers
3195 to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
3196 errors, not just command-line errors.
3197 (chown_files): Pass FTS_NOSTAT to xfts_open if we don't need file status.
3199 * src/system.h (ENOTSUP): Remove.
3201 * tests/chgrp/basic: Use chown --from to discover whether the
3202 group changed, since chgrp now changes unconditionally. This
3203 complicates the sed script a bit. Do not specify --dereference,
3204 since it's the default (and we want to test this). Adjust output
3205 to match the fact that chgrp no longer optimizes the case of
3206 changing a file's group to the same value as before.
3207 * tests/chgrp/posix-H: Do not attempt to combine -h and -H; these
3208 options are incompatible, and their behavior is undefined with POSIX.
3209 (changed, not_changed): Adjust to match the fact that -h is no longer
3210 specified. Sort names.
3211 * tests/chown/deref: Adjust error-diagnostic spelling to match new
3214 2004-06-07 Paul Eggert <eggert@cs.ucla.edu>
3216 * src/uname.c (main): Fix typo introduced on 2003-05-10 that
3217 prevented a diagnostic of any operands.
3219 2004-06-08 Jim Meyering <jim@meyering.net>
3221 * src/shred.c (direct_mode): Turn it on/off with directio, too.
3223 2004-06-07 Jim Meyering <jim@meyering.net>
3225 Enable direct-mode I/O (bypassing the buffer cache), if possible.
3226 Prompted by a suggestion from Kalle Olavi Niemitalo
3227 in http://bugs.debian.org/207035.
3228 * src/shred.c (direct_mode): New function.
3229 (do_wipefd): Turn on direct-mode I/O.
3230 (dopass): If a file's first write fails with EINVAL,
3231 turn off direct-mode I/O and retry the write.
3233 2004-06-05 Paul Eggert <eggert@cs.ucla.edu>
3235 * src/tr.c (main): "tr -d a b" is now a fatal error even if
3236 POSIXLY_CORRECT is set. The POSIX SYNOPSIS does not allow this
3239 2004-06-04 Paul Eggert <eggert@cs.ucla.edu>
3241 * src/shred.c (dopass): Don't subtract 1 from the offset after
3242 a write error. Problem reported by Jon Peatfield in:
3243 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
3245 2004-06-02 Paul Eggert <eggert@cs.ucla.edu>
3247 Fix bug reported by Buciuman Adrian in
3248 <http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00105.html>
3249 where 'dd' created a file that was too large. The bug was that dd
3250 assumed that the input file offset does not advance after a failed
3251 read; but POSIX says that the input file offset is undefined after
3254 * src/dd.c (MAX_BLOCKSIZE): New macro.
3255 (input_seekable, input_seek_errno, input_offset,
3256 input_offset_overflow): New vars.
3257 (scanargs): Reject block sizes greater than MAX_BLOCKSIZE.
3258 (advance_input_offset): New function.
3259 (skip_via_lseek): Set errno to zero when reporting our failure,
3260 so that we don't report based on garbage errno.
3261 (skip): If fdesc is standard input, advance the input offset.
3262 Do not quit if reading, and if noerror was specified;
3263 POSIX seems to require this.
3264 If read fails on output file, report the earlier lseek failure
3265 instead; this fixes a FIXME in dd_copy.
3266 (advance_input_after_read_error): New function.
3267 (dd_copy): Use it, instead of assuming that failed reads
3268 do not advance the file pointer. Advance input offset
3269 after nonfailed reads. Advance only a partial block if
3270 the previous read (before the failed read) succeeded, and
3271 do not generate an output block of zeros in this case.
3272 (main): Determine initial input offset, seekability of input,
3273 and error if it wasn't seekable.
3275 2004-06-02 Jim Meyering <jim@meyering.net>
3277 rm (without -f) could hang unnecessarily when attempting to
3278 remove a symlink to a file on an off-line NFS-mounted partition.
3279 Reported by David Howells in https://bugzilla.redhat.com/124699.
3280 * src/remove.c (write_protected_non_symlink): New function.
3281 Don't invoke euidaccess on symlinks.
3282 (prompt): Use write_protected_non_symlink rather than using
3283 euidaccess directly, being careful not to call lstat twice for a file.
3285 Fix a bug in how the --output-delimiter=D option works with
3286 abutting byte or character ranges. Reported by David Krider in
3287 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00132.html
3288 * src/cut.c (print_kth): Remove special case for open-ended range.
3289 (set_fields): Record the range start index for an interval even
3290 when it abuts another interval on its low side.
3291 Also record the range start index of the longest right-open-interval.
3292 * tests/cut/Test.pm: Add tests of --output-delimiter=S with
3293 abutting and overlapping byte ranges.
3295 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3297 Some POSIX-conformance cleanups for tr.
3299 * src/tr.c (posix_pedantic): Remove; no longer needed since
3300 we need to test this in just one place now.
3301 (usage): Mention -C.
3302 (unquote): Note that \055, \n, etc are escaped.
3303 Do not worry about POSIXLY_CORRECT when warning about ambiguous
3305 \ at end of string stands for itself.
3306 Do not diagnose invalid backslash escapes: POSIX says the behavior
3307 is unspecified in this case, so we don't need to diagnose it.
3308 (main): Add support for -C (currently an alias for -c).
3309 Do not diagnose 'tr [:upper:] [:upper:], as POSIX does not require
3311 * tests/tr/Test.pm: New tests bs-055, bs-at-end, repeat-Compl.
3312 Fix comment for range-a-a.
3314 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3316 Improve the efficiency (and in one case, correctness) of code
3317 that reads symlinks.
3319 * src/copy.c (copy_internal): Don't use alloca, as it can mess up
3320 royally if the link length is long (e.g., GNU/Hurd). Use
3321 xreadlink instead, it's safer. Don't bother to read the link if
3322 it's the wrong size. Add a FIXME because this area is a bit murky
3324 * src/ls.c (get_link_name): Update use of xreadlink.
3325 * src/readlink.c (main): Likewise.
3326 * src/stat.c (print_stat): Likewise.
3328 2004-06-01 Jim Meyering <jim@meyering.net>
3330 * src/env.c (main): Prefer the notation `STREQ (a, b)'
3331 over `!strcmp (a, b)'.
3332 * src/sort.c (main, sort_buffer_size): Prefer the notation
3333 `STREQ (a, b)' over `strcmp (a, b) == 0'.
3334 * src/date.c (batch_convert): Likewise.
3335 * src/expr.c (nextarg): Likewise.
3336 * src/su.c (correct_password, restricted_shell, main): Likewise.
3337 * src/ptx.c (swallow_file_in_memory, main): Likewise.
3338 * src/test.c (binary_operator, and, or, main): Likewise.
3340 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3342 * NEWS: echo compatibility cleanup.
3343 * doc/coreutils.texi (echo invocation): Document the changes.
3344 * src/echo.c (V9_ECHO): Remove; always enabled.
3345 (DEFAULT_ECHO_TO_XPG): Renamed from V9_DEFAULT, so that
3346 we use the same naming convention as bash. Now an enum,
3348 (usage): Reword to mention -e/-E more accurately.
3349 Mention \0NNN (the POSIX syntax) rather than \NNN (nonstandard).
3350 (hextobin): New function.
3351 (main): Use bool rather than int for local vars when appropriate.
3352 Do not allow options if POSIXLY_CORRECT, unless we are using
3353 BSD semantics and the first argument is "-n".
3354 Don't pass unnecessary extra arg to parse_long_options.
3355 do_v9 now defaults to DEFAULT_ECHO_TO_XPG, not to allow_options.
3356 Do not look for options if !allow_options.
3357 Use size_t rather than int when appropriate.
3358 Open-code option test rather than using strrchr.
3359 Use faster test for "-".
3360 Avoid redundant argc test.
3361 Add support for \x, for Bash compatibility.
3362 Use e.g. '\a' rather than '\007', for portability to EBCDIC hosts.
3363 When '\c' is encountered, stop printing immediately, as POSIX
3365 Add support for \xhh syntax.
3366 Add support for \0ooo syntax; POSIX requires this.
3368 2004-06-01 Jim Meyering <jim@meyering.net>
3370 * Use automake-1.8b. Regenerate dependent files.
3372 2004-05-31 Jim Meyering <jim@meyering.net>
3374 * tests/Makefile.am.in (TESTS_ENVIRONMENT): Define PATH to include
3375 the build src/ directory -- at the front.
3376 ($(srcdir)/$x-tests): Depend on Makefile.am.
3377 Use $x as the program name, except when it would be `test' (test is
3378 the sole program tested via mk-script that is also a shell built-in).
3379 In that case, use the old ../../src/$x.
3381 2004-05-30 Jim Meyering <jim@meyering.net>
3383 Work around HPUX /bin/cc compiler bug that is exposed, now that
3384 sets are arrays of type `bool'. More details here:
3385 http://lists.gnu.org/archive/html/bug-gnulib/2004-05/msg00094.html
3386 FIXME: verify that the above URL points to the right message
3388 * src/tr.c (card_of_complement): Use cleaner `sizeof in_set'
3389 rather than `N_CHARS * sizeof(in_set[0])'. Using HPUX's /bin/cc
3390 (aC++/ANSI C B3910B A.05.55 [Dec 04 2003]) on an ia64-hp-hpux11.22
3391 system, those two expressions are not the same (256 vs. 1024).
3392 The effect of this problem was that `tr -c x y' would fail:
3393 tr: when not truncating set1, string2 must be non-empty
3394 (set_initialize): Remove unnecessary initialization of the `in_set'
3395 buffer; that initialization triggered the same compiler bug as above.
3397 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3399 tr cleanup, mostly having to do with integer type ranges.
3402 * tests/tr/Test.pm: Add a few tests for the below. Alas, most of
3403 the test cases wouldn't be portable, or would take too much CPU
3406 * src/tr.c (N_CHARS, N_CHAR_CLASSES): Now an enum, not a macro.
3407 This is safe since the code already assumes N_CHARS fits in int.
3408 (Filter): Remove: we want to prototype everything.
3409 (ORD, CHR): Remove. All uses removed. Some replaced with:
3410 (uchar): New function. All places where a char must be converted
3411 to an unsigned char are now done this way, not by ad-hoc methods.
3412 (count): New type. Use it whenever counts or states are needed.
3413 (BEGIN_STATE): Increase from INT_MAX - 1 (which was bogus, anyway,
3414 since we used it in an unsigned int context) to UINTMAX_MAX - 1.
3415 (REPEAT_COUNT_MAXIMUM): New macro. Use it in place of BEGIN_STATE
3416 whenever appropriate.
3417 (NOT_A_CHAR): Remove global macro; now a local enum.
3418 (UL_LOWER, UL_UPPER, UL_NONE): No longer specify values, since
3419 the rest of the code no longer depends on them.
3420 (class_ok): Remove; all uses changed to use inline comparisons.
3421 (RE_NO_TYPE): Remove; wasn't used or needed.
3422 (struct List_element): normal_char and equiv_code are now unsigned
3424 first_char, last_char, and the_repeated_char are now unsigned char,
3425 not unsigned int. repeat_count is now count, not size_t.
3427 (struct Spec_list): state is now count, not unsigned int.
3428 lengthis now count, not size_t.
3429 n_indefinite_repeats is now size_t, not int.
3430 has_equiv_class, has_char_class, and has_restricted_char_class
3431 are now bool, not int. All uses changed.
3432 (struct E_string): s is now char *, not unsigned char *.
3433 escaped is now bool *, not int *. All uses changed.
3434 (ES_MATCH): Remove macro, replacing with:
3435 (es_match): New inline function. All uses changed.
3436 (squeeze_repeats, complement, posix_pedantic, truncate_set1,
3437 translating): Now bool, not int.
3438 (io_buf): Now char array, not unsigned char.
3439 (SET_TYPE): Remove. All uses replaced with bool.
3440 (is_equiv_class_member, unquote, append_range, append_char_class,
3441 append_equiv_class, find_closing_delim, star_digits_closebracket,
3442 build_spec_list, parse_str, homogeneous_spec_list):
3443 Now returns bool, not int. All uses changed.
3444 (is_equiv_class_member): Now inline.
3445 (is_equiv_class_member, is_char_class_member, make_printable_str,
3446 append_normal_char, append_range, append_repeated_char,
3448 Args are now of proper integer type.
3449 (unquote, look_up_char_class, make_printable_str,
3450 append_equiv_class, build_spec_list, squeeze_filter):
3451 Avoid unsigned char *p; gently convert *p to unsigned char instead.
3452 (unquote, get_spec_stats): Do not jump past declarations and then
3453 use them; C doesn't allow this in portable programs.
3454 (make_printable_str): Check for overflow in size calculations.
3455 (xmemdup): Remove. All uses rewritten.
3456 (find_bracketed_repeat): Args are now of proper pointer-to-integer
3457 type. Do not reject [c*0]. Use xstrtoumax, not xstrtoul.
3458 (find_bracketed_repeat, star_digits_closebracket): Check that the
3459 digits are not escaped.
3460 (build_spec_list): Don't bother to copy opnd_str; not needed.
3461 (build_spec_list, get_next): Simplify internal logic a bit.
3462 (card_of_complement): Fix bug due to char overflow.
3463 (get_spec_stats): Don't assume len fits into int.
3464 Check for integer overflow. Use abort() rather than assert(0).
3465 (string2_extend): Fix subscript error: is_char_class_member (..., 255)
3467 (squeeze_filter): READER is never null now; simplify code.
3468 READER arg now has a simpler type. Remove unnecessary casts.
3469 (squeeze_filter, main): Calls to fwrite improperly checked result
3470 against zero, rather than against requested size.
3471 (plain_read): New function.
3472 (read_and_delete, read_and_xlate):
3473 Remove unused filter arg, and don't worry about hit_eof.
3474 Simplify by using plain_read.
3475 (set_initialize): Args are bool and bool *, not int and SET_TYPE *.
3476 (main): Always pass a non-null procedure to squeeze_filter.
3477 Rewrite so that class_ok isn't needed.
3479 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3481 * src/shred.c (dosync): Ignore EBADF errors, as IRIX 6.5
3482 fdatasync reports EBADF when syncing (unwritable) directories.
3483 Problem reported by Albert Chin-A-Young in:
3484 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
3486 2004-05-29 Jim Meyering <jim@meyering.net>
3488 * tests/chown/deref: Fix typo: use ls -ldo, not ls -ldg.
3489 Patch from Albert Chin.
3491 * src/ptx.c (text_buffer_maxend): Remove declaration of unused variable.
3493 * src/remove.c (push_dir): Merge declaration and adjacent assignment
3494 into a single statement.
3496 2004-05-28 Jim Meyering <jim@meyering.net>
3498 * src/remove.c (AD_mark_helper): Eliminate an unnecessary comparison.
3500 2004-05-22 Jim Meyering <jim@meyering.net>
3502 rm -r would get a failed assertion when run from an inaccessible
3503 directory and with two or more command line arguments including an
3504 absolute-named directory followed by a relative-named directory.
3506 * src/remove.h (struct rm_options) [require_restore_cwd]: New member.
3507 * src/remove.c (struct cwd_state): Define.
3508 (AD_pop_and_chdir): Redesign interface so that a restore_cwd failure
3509 can be detected by the caller. Instead of returning a malloc'd
3510 directory name, communicate it to caller via a new parameter, and
3511 return an indication of whether restore_cwd failed. Update caller.
3512 Eliminate an unnecessary call to AC_stack_top.
3513 (remove_dir): Change type of cwd_state parameter to `struct cwd_state'
3514 so we can now communicate to caller whether/how functions like
3515 restore_cwd have failed. Update caller.
3516 (rm_1): Fail if we've failed to restore the working directory
3517 and the name of the next file to remove is `.'-relative.
3518 (rm): Fail if the require_restore_cwd flag is true and we've
3519 failed to restore the working directory.
3520 * src/mv.c (rm_option_init): Initialize new member,
3521 x->require_restore_cwd.
3522 * src/rm.c (rm_option_init): Likewise.
3524 2004-05-21 Jim Meyering <jim@meyering.net>
3526 * tests/rm/inaccessible: New test for the above fix.
3527 * tests/rm/Makefile.am (TESTS): Add inaccessible.
3529 * src/remove.c (rm): Use free rather than XFREE.
3530 (remove_dir): Use xmalloc, not XMALLOC.
3531 (ds_init): Likewise.
3533 2004-05-20 Jim Meyering <jim@meyering.net>
3535 * Makefile.maint (sc_unmarked_diagnostics): Now that the unmarked
3536 diagnostics in shred.c have been fixed, don't exempt shred.c from
3539 * src/shred.c: Use translatable diagnostics, e.g.
3540 change "%s: remove" to _("%s: failed to remove") and
3541 change "%s: close" to _("%s: failed to close").
3543 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3545 * src/shred.c (names): Bring back lower-case letters, "_", and
3546 ".". But continue to omit +, =, %, @, #, as they're either
3547 shell metacharacters (for some shells) or are not in some
3548 character sets, or (in the case of '%') must be a
3549 metacharacter somewhere.
3551 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3553 * src/cut.c (cut_fields): Adjust to new signature of getndelim2.
3555 2004-05-17 Jim Meyering <jim@meyering.net>
3557 * src/shred.c (incname): Decrement `len' only once per loop iteration.
3559 chgrp and chown now dereference symlinks by default, per POSIX.
3560 Reported by Michal Politowski as http://bugs.debian.org/249177.
3562 * src/chown-core.c (chopt_init): Affect each symlink referent by default.
3563 * src/chown.c (usage): Update to reflect this.
3564 * src/chgrp.c (usage): Likewise.
3565 * NEWS: Describe the change.
3566 Adapt tests accordingly.
3567 * tests/chgrp/basic: Use -h where necessary to retain semantics.
3568 * tests/chgrp/deref: Likewise.
3569 * tests/chgrp/posix-H: Likewise.
3571 2004-05-15 Paul Eggert <eggert@cs.ucla.edu>
3573 In shred, check for errors from fdatasync more carefully. If
3574 fdatasync fails with errno==EINVAL, it means this implementation
3575 does not support synchronized I/O for this file. Do not report
3576 this as an error, as (for example) AIX 5.2 fdatasync reports it
3577 for raw disk devices. Problem reported by Albert Chin in
3578 <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.
3580 Check for write errors, though: the old code ignored them.
3581 Improve error checking in a few other cases, too (e.g., close of a
3584 Also, change several 'int' values to 'bool', so that the error
3585 checking is a bit clearer. Similarly, change unsigned values
3586 to size_t where appropriate.
3588 * src/shred.c: Include "dirname.h".
3589 (datasync) [!HAVE_FDATASYNC]: Remove.
3590 (dosync): New function.
3591 (dopass): Use it. Return 1 on write error, -1 on other error.
3592 All callers changed. Report write error if dosync does.
3593 (do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
3594 not int (0/-1). All callers changed. Return false if there's a
3596 (incname): Return bool (true/false), not int (0/1). Accept
3597 size_t length, not unsigned. All callers changed. Do not
3598 bother checking for non-digits; it can't happen. Replace
3599 recursion with iteration.
3600 (wipename): Use dir_name, base_name, etc. instead of assuming
3601 Unix file names. Use size_t for length, not unsigned.
3602 Report error if unlink or close fails.
3603 (wipename, main): Use bool for booleans.
3605 (names): Use only digits and uppercase letters, for greater
3608 2004-05-16 Jim Meyering <jim@meyering.net>
3610 * tests/chown/deref: New test for the yesterday's change.
3611 * tests/chown/Makefile.am (TESTS): Add deref.
3613 2004-05-15 Jim Meyering <jim@meyering.net>
3615 chown --dereference did nothing when the owner/group of a
3616 symlink matched the desired owner/group. Reported by David Malone.
3617 Also reported in 1999 as http://bugs.debian.org/39642.
3619 * src/chown-core.c (change_file_owner): When --dereference has
3620 been specified, and when processing a symlink, stat it to get the
3621 owner and group of the referent.
3623 2004-05-14 Jim Meyering <jim@meyering.net>
3625 * man/pwd.x, man/echo.x, man/printf.x: Fix typo:
3626 s/supercede/supersede/ reported by Andrew Fabbro.
3628 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3630 Improve performance of `sort -m' on large files, at the cost of
3631 making some contrived examples unsafe. POSIX allows this
3632 optimization. Performance problem reported by Jonathan Baker in
3633 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00071.html>.
3635 * src/sort.c (first_same_file): Do not treat input pipes
3636 differently from other files.
3637 * doc/coreutils.texi (sort invocation): Document that "sort -m -o F"
3638 might write F before reading all the input.
3641 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
3643 * src/od.c (print_ascii, dump_strings): Use e.g. '\a' rather than
3644 '\007', for portability to EBCDIC hosts.
3645 * src/printf.c (print_esc_char): Likewise.
3646 * src/tr.c (unquote, make_printable_str): Likewise.
3648 2004-05-12 Jim Meyering <jim@meyering.net>
3650 * src/remove.c (AD_pop_and_chdir): Move lstat-`.' into if-block
3651 where the result is used. This avoids one unnecessary lstat call
3652 per command line argument.
3654 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
3656 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
3658 * src/Makefile.am (all_programs.list): New rule, copied from
3659 man/Makefile.am and tests/Makefile.am, except that we use the
3660 system tr rather than ./tr and we don't use tr -s.
3661 * tests/Makefile.am (all_programs): Use it.
3662 * man/Makefile.am (all_programs): Likewise. Renamed from programs,
3663 for consistency. All uses changed.
3665 2004-05-11 Jim Meyering <jim@meyering.net>
3667 * tests/rm/unread3: New test, for the above fix and today's
3668 lib/save-cwd.c improvement.
3669 * tests/rm/Makefile.am (TESTS): Add unread3.
3671 * src/rm.c: Don't include "save-cwd.h". It's no longer used.
3673 2004-05-10 Jim Meyering <jim@meyering.net>
3675 * tests/install/trap: New file. Test for bug fix of 2004-04-18.
3676 * tests/install/Makefile.am (TESTS): Add trap.
3678 * src/remove.c (AD_push): Don't use errno in diagnostic about
3681 Remove these generated files from CVS.
3682 * tests/cut/cut-tests, tests/date/date-tests, tests/join/join-tests:
3683 * tests/ls/ls-tests, tests/pr/pr-tests, tests/tac/tac-tests:
3684 * tests/tail/tail-tests, tests/test/test-tests, tests/tr/range-tests:
3685 * tests/tr/tr-tests, tests/wc/wc-tests:
3687 2004-05-09 Jim Meyering <jim@meyering.net>
3689 * src/tr.c (unquote): Use xcalloc rather than xmalloc and
3690 a loop initializing the just-allocated memory to zero.
3692 2004-05-08 Jim Meyering <jim@meyering.net>
3694 * tests/rm/no-give-up: New file; check for today's fix.
3695 * tests/rm/Makefile.am (TESTS): Add no-give-up.
3697 2004-05-08 Paul Eggert <eggert@cs.ucla.edu>
3699 Fix bug where "rm" gave up too easily, reported by Dan Jacobsen in
3700 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00013.html>.
3702 * src/remove.c (remove_entry): Check for errno values like ENOENT
3703 that show the file cannot be directory, instead of for errno
3704 values like EPERM that show the file might be a directory. This
3705 is necessary because, when a single unlink() call has multiple
3706 reasons to fail, it can set errno to any of those reasons; it's
3707 only the rare errno value like ENOENT that excludes all the other
3708 possible reasons to fail even when the file is a directory.
3709 (remove_cwd_entries): Don't attempt chdir if the file is known
3710 to not be a directory.
3711 (remove_dir): Use the same method that remove_cwd_entries uses
3712 (for some reason they differed). Don't assert that saved_errno
3713 must be EPERM; it might be just about anything.
3715 2004-05-06 Jim Meyering <jim@meyering.net>
3717 * src/id.c (xgetgroups): Use xnmalloc, rather than xmalloc.
3718 Don't add `1' to the buffer size (it was to protect against malloc
3719 implementations that fail to allocate a buffer of size zero).
3720 That is no longer necessary, since we use a malloc wrapper
3723 * src/wc.c (get_input_fstatus): Use xnmalloc, rather than xmalloc.
3724 * src/head.c (elide_tail_bytes_pipe): Likewise.
3725 * src/df.c (main): Likewise.
3726 * src/shred.c (do_wipefd): Likewise.
3727 * src/users.c (list_entries_users): Likewise.
3728 * src/tail.c (main): Likewise.
3729 * src/md5sum.c (main): Likewise.
3731 2004-04-29 Paul Eggert <eggert@cs.ucla.edu>
3733 * src/df.c (show_disk, show_point): If several filesystems are
3734 mounted on the same mount point, prefer the last one, not the first.
3735 Problem reported by Christian Jones in
3736 <http://mail.gnu.org/archive/html/bug-coreutils/2004-04/msg00200.html>.
3737 (show_disk): Remove unused statp arg. Return bool, not int.
3738 (show_point): Rewrite to avoid gotos. Use the same algorithm
3739 for lofs and dummies for each pass through the mount table,
3740 rather than subtly different algorithms (which are probably
3743 2004-05-03 Jim Meyering <jim@meyering.net>
3745 * Makefile.am (EXTRA_DIST): Add m4/ChangeLog, now that we no longer
3748 2004-05-01 Jim Meyering <jim@meyering.net>
3750 When chown or chgrp is modifying the referent of a symlink,
3751 use the chown(2) function, if possible.
3752 * src/chown-core.c (change_file_owner): Don't hard-code the
3753 open/fchown/close kludge here. Use `chown' instead.
3754 The chown function works just fine on conforming systems.
3755 Other systems now go through the new chown wrapper that
3756 resorts to the old kludge.
3758 * src/chown-core.c (change_file_owner): Add a comment.
3760 2004-04-27 Jim Meyering <jim@meyering.net>
3762 * src/ptx.c: Make over 40 global extern variables `static'.
3763 (syntax_table, re_syntax_table): Remove declarations of two unused
3764 variables (they were exposed by the above change).
3766 * src/du.c (G_fail, opt_nul_terminate_output): Declare `static'.
3767 * src/ln.c (backup_type): Likewise.
3769 * src/remove.c (rm): Add `extern' keyword.
3770 * src/cp-hash.c (forget_created, remember_created)
3771 (src_to_dest_lookup, remember_copied, hash_init, forget_all): Likewise.
3772 * src/copy.c (dest_info_init, src_info_init, copy): Likewise.
3773 * src/chown-core.c (chopt_init, chopt_free, gid_to_name)
3774 (uid_to_name, chown_files): Likewise.
3776 * src/Makefile.am (sc_tight_scope): New rule.
3777 * Makefile.maint (sc_tight_scope): New rule.
3778 (syntax-check-rules): Add it.
3780 2004-04-26 Jim Meyering <jim@meyering.net>
3782 * Use automake-1.8.4. Regenerate dependent files.
3784 * src/sort.c (limfield): Make a comment clearer.
3786 2004-04-25 Paul Eggert <eggert@twinsun.com>
3788 Fix POSIX-conformance bug: "sort -k 3,3.5b" is supposed to skip
3789 leading blanks when computing the location of the field end;
3790 it is not supposed to skip trailing blanks. Solaris 8 "sort"
3791 does conform to POSIX. Also fix the documentation to clarify
3792 this and related issues.
3794 * doc/coreutils.texi (sort invocation): Mention -k earlier, so
3795 that the options are in alphabetical order. Describe how -b works
3796 more-accurately; this involves fixing some examples, too. Mention
3797 what happens if the start field falls after an end field or after
3798 a line end. Warn about using -k without -b, -g, -M, -n, or -t.
3799 Add an example of how to sort IPv4 addresses and Apache Common
3800 Log Format dates. Remove a duplicate example.
3801 (Putting the tools together): Use separate options rather
3802 than agglomerating them.
3803 * src/sort.c (limfield): Use skipeblanks, not skipsblanks, to
3804 decode whether to skip leading blanks.
3805 (trailing_blanks): Remove.
3806 (fillbuf, getmonth, keycompare): Don't trim trailing blanks.
3808 * tests/pr/Test.pm: Fix typo in env_default comment.
3809 * tests/sort/Test.pm: Likewise.
3810 (18c, 18d): Reverse the order of output lines, so that the
3811 test cases conform to POSIX.
3813 2004-04-22 Paul Eggert <eggert@twinsun.com>
3815 More signal-handling cleanup for ls.c. Do not allow signals to
3816 happen between arbitrary output bytes, as the
3817 restore-default-color sequence can bollix up multibyte chars or
3818 color-change sequences in the ordinary output. Instead, process
3819 signals only between printing a file name and changing the color
3820 back to non_filename_text color. That way, if the signal handler
3821 changes the color (to the default), 'ls' will change it back when
3822 'ls' continues (after being suspended).
3824 Also, do not bother with signal-handling unless stdout is a
3825 controlling terminal; this lets stdio buffer better when "ls
3826 --color" is piped or sent to a file.
3828 * src/ls.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros.
3829 Do not include "full-write.h"; no longer needed.
3830 (tcgetpgrp) [! HAVE_TCGETPGRP]: New macro.
3831 (put_indicator_direct): Remove. All callers changed to use
3833 (caught_signals, interrupt_signal, stop_signal_count): New vars.
3834 (restore_default_color): Don't bother checking for put_indicator
3836 (sighandler): Don't handle SIGTSTP; that's another handler now.
3837 Simply set interrupt_signal to the signal, then exit.
3838 (stophandler, process_signals): New functions.
3839 (main): Don't output any color changes until _after_ the signal
3840 handlers are set up. This fixes a race condition where 'ls'
3841 could be interrupted while initializing colors, and leaving the
3842 terminal in an undesirable state.
3843 Don't mess with signal-handling if standard output is not a
3844 controlling terminal.
3845 When exiting, restore the default color, then restore the
3846 default signal handling, then act on any signals that weren't
3848 Do not print //DIRED// etc. in colors; this avoids the need
3849 to catch signals when printing them.
3850 (print_name_with_quoting): Process signals just before switching
3851 color back to non_filename_text.
3853 2004-04-23 Jim Meyering <jim@meyering.net>
3855 Avoid segfault on systems for which SIZE_MAX != (size_t) -1.
3856 * src/ls.c (quote_name): Use SIZE_MAX, not -1, in calls
3857 of quotearg_buffer. Patch by Mikulas Patocka.
3859 2004-04-18 Paul Eggert <eggert@twinsun.com>
3861 tee ignored SIGPIPE, but POSIX doesn't allow this.
3863 * src/tee.c (main): Do not ignore SIGPIPE, as POSIX 1003.1-2001
3864 does not allow this. This undoes the 1996-10-24 patch.
3866 2004-04-18 Paul Eggert <eggert@twinsun.com>
3868 Signal-handling cleanup for coreutils. Here are the highlights:
3870 - csplit sometimes failed to remove files when interrupted.
3871 - csplit didn't clean up if two signals arrived nearly simultaneously.
3872 - install -s would infloop on System V if SIGCHLD was ignored.
3873 - ls could incorrectly restore color if multiple signals
3874 arrived nearly simultaneously.
3876 * src/csplit.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
3878 (filename_space, prefix, suffix, digits, files_created, remove_files):
3880 (caught_signals): New var.
3881 (cleanup): Block signals while deleting all files.
3882 (cleanup_fatal, handle_line_error, regexp_error):
3883 Mark with ATTRIBUTE_NORETURN.
3884 (create_output_file, close_output_file, interrupt_handler):
3885 Block signals while changing the number of output files,
3886 to fix some race conditions.
3887 (delete_all_files): Do nothing if remove_files is zero.
3888 Clear files_created.
3889 (main): Don't mess with signals until after argument processing
3892 * src/csplit.c (main): Rewrite signal-catching code to make it
3893 similar to other coreutils programs. When processing signals,
3894 block all signals that we catch, but do not block signals that we
3895 don't catch. Avoid problems with unsigned int warnings.
3896 * src/ls.c (main): Likewise.
3897 * src/sort.c (main): Likewise.
3899 * src/csplit.c (interrupt_handler):
3900 Use void, not (obsolete) RETSIGTYPE.
3901 * src/shred.c (sigill_handler, isaac_seed_machdep): Likewise.
3903 * src/csplit.c (interrupt_handler) [defined SA_NOCLDSTOP]:
3904 Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
3905 * src/ls.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
3906 * src/sort.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
3907 * src/nohup.c (main) [!defined _POSIX_SOURCE]: Likewise, except
3909 * src/tee.c (main) [!defined _POSIX_SOURCE]: Likewise.
3911 * src/install.c: Include <signal.h>.
3912 (main) [defined SIGCHLD]: Set SIGCHLD handler to the default, if -s is
3913 given, since System V fork+wait does not work if SIGCHLD is ignored.
3915 * src/ls.c (sighandler) [!defined SA_NOCLDSTOP]: Reset signal
3916 handler to self, not to SIG_IGN, since SIGTSTP can be received
3918 (main): Use SA_RESTART, as that is simpler than checking for EINTR
3919 failures all over the place.
3921 2004-04-20 Jim Meyering <jim@meyering.net>
3923 * src/remove.c (is_empty_dir): Clarify comment.
3925 * man/help2man: Accept new option: --program-name=NAME, so that we
3926 can override the one in --version output. This is needed solely
3927 so that test.1 doesn't refer to `[' as the program name.
3928 Reported by Benjamin Cutler as http://bugs.debian.org/205251.
3929 * man/Makefile.am (.x.1): Use help2man's new --program-name option.
3931 * src/pwd.c: Don't include pathmax.h; system.h already does it.
3933 * src/cut.c (cut_fields): Free buffer upon getndelim2 failure.
3935 2004-04-19 Jim Meyering <jim@meyering.net>
3937 * src/shred.c (isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:
3938 Initialize a buffer to avoid warnings from tools like valgrind.
3940 * Makefile.maint (sc_trailing_blank): New rule.
3941 (syntax-check-rules): Add it.
3942 * .x-sc_trailing_blank: New file.
3944 Make pwd work even if the resulting name is so long that getcwd fails.
3945 * src/pwd.c: (path_free, path_init, path_prepend): New functions.
3946 (nth_parent, find_dir_entry, robust_getcwd): New functions.
3947 (main): First try getcwd, then, upon failure, robust_getcwd.
3949 2004-04-18 Jim Meyering <jim@meyering.net>
3951 * src/who.c (print_user): Use xrealloc here, rather than
3952 unchecked realloc. Remove anachronistic casts.
3954 * src/remove.c (full_filename_): Don't leak upon failed realloc.
3956 * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function,
3958 * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h,
3959 renaming it. Update uses.
3961 2004-04-17 Jim Meyering <jim@meyering.net>
3963 * configure.ac: Depend on automake-1.8.3.
3965 * src/join.c (add_file_name): Declare function to be `static'.
3966 (string_to_join_field): Likewise.
3967 * src/remove.c (ds_init, ds_free): Likewise.
3969 * Makefile.maint (sc_prohibit_jm_in_m4): New rule.
3970 (syntax-check-rules): Add to the list.
3972 2004-04-13 Paul Eggert <eggert@twinsun.com>
3974 Use page-aligned buffers whenever we bother to do I/O using buffer
3975 sizes that are tailored for the files.
3977 * src/cat.c: Include getpagesize.h.
3978 * src/copy.c: Likewise.
3979 * src/shred.c: Likewise.
3980 * src/split.c: Likewise.
3981 * src/cat.c (main): Align I/O buffers to page boundaries.
3982 * src/copy.c (copy_reg): Likewise.
3983 * src/shred.c (dopass): Likewise.
3984 * src/split.c (main): Likewise.
3985 * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove.
3986 All uses replaced by ptr_align.
3987 * src/od.c (gcd, lcm): Remove; now in system.h.
3988 * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c.
3990 2004-04-14 Jim Meyering <jim@meyering.net>
3992 Remove m4/Makefile.am: it's no longer needed, with newer automake
3993 * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list.
3994 * Makefile.am (SUBDIRS): Remove `m4' from the list.
3996 2004-04-13 Jim Meyering <jim@meyering.net>
3998 * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'.
4000 2004-03-27 Paul Eggert <eggert@twinsun.com>
4002 * NEWS: cp -pu and mv -u (when copying) now take the destination
4003 file system time stamp resolution into account.
4004 * doc/coreutils.texi (mv invocation): Document this.
4005 (cp invocation): Document -u (it was missing!) with new behavior.
4007 * src/copy.c: Include "utimecmp.h".
4008 (copy_internal): Compare time stamps using utimecmp rather than
4011 2004-04-09 Jim Meyering <jim@meyering.net>
4013 * Makefile.maint (.re-list): New rule/file, to replace
4014 hard-coded list of header file names.
4015 (sc_system_h_headers): Use the new file.
4016 Don't look for sys2.h anymore.
4018 * src/system.h: Include new "stat-macros.h" rather than hard-coding
4019 all of its macro definitions -- the list was slightly out of date.
4020 Suggestion from Dmitry V. Levin.
4022 2004-04-08 Paul Eggert <eggert@cs.ucla.edu>
4024 * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin.
4025 * doc/coreutils.texi (dd invocation): Likewise.
4026 * src/shred.c (O_NOCTTY): Remove redundant decl.
4027 * src/dd.c (flags, usage): Remove noctty flag.
4028 (main): Always use O_NOCTTY when opening files.
4030 2004-04-08 Jim Meyering <jim@meyering.net>
4032 * src/dd.c (dd_copy): Mark two diagnostics for translations.
4033 (set_fd_flags): Undo part of today's change: it's a little
4034 cleaner -- and more efficient in the common case -- to go
4035 ahead and OR in the -1 when fcntl fails.
4037 * Makefile.maint (sc_dd_max_sym_length): New target.
4038 (syntax-check-rules): Add it.
4040 * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]:
4041 Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum.
4043 * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
4044 Rename parameter, flags, to avoid shadowing global.
4045 (LONGEST_SYMBOL): Tweak comment.
4047 2004-04-07 Paul Eggert <eggert@twinsun.com>
4049 * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync,
4050 and new dd options iflag= and oflag=.
4051 * src/dd.c (usage): Likewise.
4052 * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib.
4053 * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro.
4054 (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
4055 (input_flags, output_flags): New vars.
4056 (LONGEST_SYMBOL): New macro.
4057 (struct symbol_value): Renamed from struct conversion. Members
4058 symbol and value renamed from convname and conversion. The
4059 symbol value is now an array instead of a pointer; this saves
4060 a bit of space and time in practice. All uses changed.
4061 (conversions): Add nocreat, excl, fdatasync, fsync. Now const.
4062 (flags): New constant array.
4063 (iflag_error_msgid, oflag_error_msgid): New constants.
4064 (parse_symbols): Renamed from parse_conversion and generalized
4065 to handle either conversion or flag symbols.
4066 (scanargs): Adjust uses of parse_symbols accodingly. Add
4067 support for iflag= and oflag=. Reject attempts to use
4068 both excl and nocreat.
4069 (set_fd_flags): New function.
4070 (dd_copy): Just return X rather than calling quit (X), since our
4071 caller invokes quit with the returned value. Add support for
4072 fdatasync and fsync.
4073 (main): Add support for iflag=, oflag=, and new conv= symbols.
4074 * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW,
4075 O_RSYNC, O_SYNC): Define to 0 if not already defined.
4077 * NEWS: Remove duplicate mention of BLOCKSIZE.
4079 2004-04-02 Andreas Schwab <schwab@suse.de>
4081 * src/stty.c: Add support for IUTF8 input flag.
4083 2004-04-06 Jim Meyering <jim@meyering.net>
4085 * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev.
4086 Interix spells it `mkdev'. Reported by Mark Funkenhauser.
4088 2004-04-04 Jim Meyering <jim@meyering.net>
4090 A specified format is no longer automatically newline terminated.
4091 If you want a newline at the end of your format, use `\n'.
4092 * src/stat.c (print_it): Don't print a newline at the end of
4094 (do_statfs): Add a newline at end of each default format string.
4096 2004-03-30 Paul Eggert <eggert@twinsun.com>
4098 * src/nohup.c (main): Adjust to new calling convention
4099 for set_cloexec_flag.
4101 2004-03-31 Jim Meyering <jim@meyering.net>
4103 * tests/Fetish.pm (run_tests): Remove `.orig' file.
4104 Remove debugging diagnostic.
4106 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
4107 would not elicit an error.
4108 * src/ptx.c: Include "xstrtol.h" and "quotearg.h".
4109 (main): Don't use atoi. Use xstrtoul instead.
4111 2004-03-30 Jim Meyering <jim@meyering.net>
4113 * Makefile.maint (sc_prohibit_atoi_atof): New rule.
4114 (syntax-check-rules): Add it.
4115 * .x-sc_prohibit_atoi_atof: New file.
4117 2004-03-29 Jim Meyering <jim@meyering.net>
4119 * tests/du/files0-from: Use new OUT_SUBST directive, so that this
4120 test is not sensitive to system-dependent block size differences.
4121 Prompted by a report of Solaris 8 differences from Paul Eggert.
4123 * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST.
4124 Rename `%tmp' to `%actual'. Reverse order of last two args to
4125 _compare_files (to $actual, $expected) so as to match declaration.
4127 2004-03-28 Paul Eggert <eggert@twinsun.com>
4129 Fix some gotchas encountered when porting to Solaris 8, using
4130 the Forte 6u2 compiler.
4132 * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]:
4133 Declare sethostname, since no Solaris header does it.
4134 * src/who.c: Include "vasprintf.h", for asprintf.
4136 2004-03-28 Jim Meyering <jim@meyering.net>
4139 * src/du.c (process_file): Don't record dev/inode for directories.
4141 Under some circumstances, without -c, du would mistakenly count the
4142 space of hard-linked files, not just the first one it encountered.
4143 Reported by Anthony Thyssen.
4144 * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.
4146 * src/du.c: Rename global `print_totals' to `print_grand_total'.
4148 * src/du.c (main): Rearrange filtering loop to be a tiny bit
4151 * src/chown-core.c: Don't include savedir.h -- no longer needed.
4152 * src/chmod.c: Likewise.
4154 2004-03-25 Jim Meyering <jim@meyering.net>
4156 * src/du.c (main): Remove now-unused declaration of `i'.
4158 2004-03-24 Paul Eggert <eggert@twinsun.com>
4160 * src/du.c (main): Filter out file names of length zero before
4161 invoking fts, so that they don't cause fatal errors.
4163 2004-03-25 Jim Meyering <jim@meyering.net>
4165 * tests/du/files0-from (zero-len): Add a test for the above.
4167 2004-02-25 Paul Eggert <eggert@twinsun.com>
4169 * NEWS: New environment var BLOCKSIZE.
4170 * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
4171 * tests/envvar-check: Test for it. Factor the code to simplify it.
4173 2004-03-23 Paul Eggert <eggert@twinsun.com>
4175 * NEWS: Shorten the du --files0-from announcement, and say
4176 "NUL-terminated" rather than "NUL-separated".
4177 * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
4179 (usage): Say "NUL-terminated", not "NUL-separated".
4180 (main): Check for I/O error when istream is closed.
4181 Allow --files0-from=F even if F is empty; this specifies no files.
4182 (du_files): Now that we allow the list of files to be empty,
4184 * tests/du/files0-from: Adjust to above changes to src/du.c.
4186 2004-03-24 Jim Meyering <jim@meyering.net>
4188 * tests/tail-2/assert: Avoid race condition that could cause
4189 spurious failure. Based on a patch from Andreas Schwab.
4191 2004-03-23 Jim Meyering <jim@meyering.net>
4193 * src/du.c (main): Free the hash table, too.
4195 2004-03-22 Jim Meyering <jim@meyering.net>
4197 * man/Makefile.am (.x.1): Remove --info-page= option, reverting
4198 the change of 2004-01-22. I can no longer reproduce the problem
4199 that prompted that change, and `info coreutils pr' would display the
4200 `printing text' section of the manual, not the one on `pr invocation'.
4202 * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics
4203 to match corrected output.
4205 * src/du.c: Include "readtokens0.h" rather than "readtokens.h".
4206 (main): Use readtoken0 functions rather than readtokens.
4207 Don't use errno when diagnosing readtokens0 failure.
4208 Fix off-by-one error in the token number reported in a diagnostic.
4209 (du_files): Return bool, rather than int.
4210 (main): Call readtokens0_free.
4212 2004-03-21 Jim Meyering <jim@meyering.net>
4214 * src/remove.c (ds_free): Plug a small leak.
4216 * tests/Fetish.pm: Fix typo in comment.
4218 2004-03-07 Jim Meyering <jim@meyering.net>
4220 * NEWS: du accepts a new option --files0-from=FILE, where FILE
4221 contains a list of NUL-separated file names.
4223 * src/du.c: Include "readtokens.h".
4224 (usage): Describe the new option, and adjust the `Usage':
4225 with this option, no FILE may be specified on the command line.
4226 (main): Handle the new option.
4228 * tests/du/files0-from: New tests, for the above.
4229 * tests/du/Makefile.am (TESTS): Add files0-from.
4231 * src/factor.c (do_stdin): Reflect changes in use of readtoken.
4232 * src/tsort.c (tsort): Likewise.
4234 2004-02-29 Paul Eggert <eggert@twinsun.com>
4236 * NEWS: Add support for a new notation @N to get_date to represent
4237 the time stamp with numeric value N. Improve support for
4238 fractional time stamps. date's -d and -f options now accept them.
4239 Likewise for touch -t. date has a new option --iso-8601=ns.
4241 * doc/coreutils.texi (touch invocation):
4242 Describe use of fractional seconds.
4243 (date invocation, Options for date): Likewise.
4244 * doc/getdate.texi (General date syntax, Time of day items): Likewise.
4245 * doc/coreutils.texi (date invocation): Mention effect of LC_TIME.
4246 (Options for date): Describe new --iso-8601=ns option.
4248 * doc/getdate.texi: Add copyright notice. Change getdate to
4249 get_date when talking about the function name.
4250 (Seconds since the Epoch): New section, containing the time_t
4251 info moved from Date input formats section, along with new
4252 info about the @ syntax. Mention negative time stamps,
4253 fractional time stamps, and leap seconds.
4254 (General date syntax): Modernize examples a bit to reflect new
4256 (General date syntax, Relative items in date strings):
4257 Use ' rather than " to quote formats.
4258 (Time of day items): Add an example with fractional seconds.
4259 Describe fractional-second syntax.
4261 * src/Makefile.am (touch_LDADD): New macro, since `touch' now
4262 needs clock_gettime.
4264 * src/date.c (enum Time_spec): New enum TIME_SPEC_NS.
4265 (time_spec_string, time_spec, show_date): Support it.
4266 (usage): Remove description of -ITIMESPEC, as it's obsolete and
4267 confusing. Mention --iso-8601=ns.
4268 (batch_convert): getline returns ssize_t, not int.
4270 * src/touch.c (newtime): Now an array of two timespecs, one
4271 for access and one for modification.
4272 (ref_stats): Remove.
4273 (get_reldate): Use get_date's parameter profile.
4274 (touch, main): Adjust to above changes.
4275 (main): Work even if tm_year == INT_MAX (so long as long int is wider).
4276 Use gettime instead of gettimeofday, for new get_date signature.
4278 * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32,
4281 2004-03-15 Jim Meyering <jim@meyering.net>
4283 * Makefile.maint (alpha beta major): `Make' the emit_upload_commands
4284 target before updating $(prev_version_file).
4286 * tests/misc/date-sec: New file, to test for just-fixed bug in date.
4287 See today's change in lib/getdate.y.
4288 * tests/misc/Makefile.am (TESTS): Add date-sec.
4290 2004-03-14 Jim Meyering <jim@meyering.net>
4292 * announce-gen (print_changelog_deltas): Use `.sig' suffix for
4293 signature files, not `.asc'. Reported by angico@yahoo.com.
4295 2004-03-13 Jim Meyering <jim@meyering.net>
4297 * src/cp.c (do_copy): Tweak wording in a diagnostic.
4298 Suggestion from Karl Berry.
4299 Include "quoatearg.h".
4300 (do_copy): Use quotearg_colon (not quote) for diagnostics
4301 that begin with `"%s:'.
4303 * src/nl.c (usage): Specify that nl uses _basic_ regular expressions.
4304 Suggestion from Dan Jacobson.
4306 2004-03-12 Jim Meyering <jim@meyering.net>
4310 Sometimes, when source and destination partition are different,
4311 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
4313 * src/copy.c: When moving a set of N hard-linked files between
4314 partitions, via two or more command line arguments where the
4315 command line argument containing the Nth link contains no other
4316 link to that same file, mv would mistakenly copy the file, rather
4317 than hard-linking it to the other(s). That happens because when the
4318 final link is processed, its link count has been reduced to 1 since
4319 the other links have been `copied' to the destination partition
4320 and the source links have been removed.
4321 (copy_internal): When in move mode, use the source dev/inode
4322 pair to look up destination name even when st_nlink == 1.
4323 * src/cp-hash.c (src_to_dest_lookup): New function.
4324 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
4325 * tests/mv/part-hardlink: New file. Test for the above fix.
4326 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
4328 * announce-gen: Sync with autoconf.
4330 * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
4331 This was triggered on a Linux-2.2.19 system using a file system
4332 NFS-mounted from some sort of Sun.
4334 2004-03-11 Jim Meyering <jim@meyering.net>
4336 * Use automake-1.8.3. Regenerate dependent files.
4338 2004-03-10 Jim Meyering <jim@meyering.net>
4340 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
4341 so that this test works with SELinux-enabled systems.
4342 Based on a patch from Tim Waugh.
4344 `join -1 x' would give a misleading diagnostic
4345 * src/join.c (string_to_join_field): Report that a non-numeric field
4346 number is invalid, rather than `so large that it is not representable'.
4347 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
4349 2004-03-06 Jim Meyering <jim@meyering.net>
4351 cp --sparse=always sparse-image-file.img /dev/hda1 could
4352 produce an invalid copy on the destination device.
4354 * src/copy.c (copy_reg): Even with --sparse=always, try to
4355 make `holes' only if the destination is a regular file.
4356 Reported by Szakacsits Szabolcs.
4358 2004-03-03 Paul Eggert <eggert@twinsun.com>
4360 * src/nohup.c (main): Don't invoke set_cloexec_flag with
4361 a file descriptor of -1.
4363 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
4365 * src/nohup.c: Include "cloexec.h".
4366 (main): Set the copy of stderr to close on exec.
4368 2004-03-01 Paul Eggert <eggert@twinsun.com>
4370 * configure.ac: Include <signal.h> when checking for strsignal,
4371 sys_siglist, and friends. Problem reported by Tony Leneis in
4372 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
4374 2004-02-25 Paul Eggert <eggert@twinsun.com>
4376 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
4377 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
4380 2004-02-23 Paul Eggert <eggert@twinsun.com>
4382 * NEWS: Document how chown's USER.GROUP argument is now parsed.
4384 2004-02-23 Jim Meyering <jim@meyering.net>
4386 * src/seq.c (usage): Remove stray space after \n in --help output.
4388 2004-02-22 Jim Meyering <jim@meyering.net>
4390 * src/du.c (usage): Separate -H and --si. Say that the meaning
4391 of -H will soon change to that of --dereference-args (-D).
4393 2004-02-21 Jim Meyering <jim@meyering.net>
4395 * src/comm.c (usage): Tell what comm does when there are no options.
4396 Reword in terms of FILE1 and FILE2 rather than `left file' and
4397 `right file'. Suggestion from Dan Jacobson.
4399 2004-02-15 Paul Eggert <eggert@twinsun.com>
4401 Fix some POSIX-conformance bugs in expr.
4403 * NEWS: document the following changes to src/expr.c.
4404 * doc/coreutils.texi (expr invocation): Likewise.
4405 Document what forms integers may take, and say "integer"
4406 consistently instead of "number". Warn about operands
4407 that "expr" can misinterpret, and how to work around the
4409 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
4410 Accept a bool argument specifying whether to evaluate the
4411 expression. This is to allow short-circuit evaluation. All
4413 (null): Report that a string is zero even if it has
4414 a form like "-0" or "00".
4415 (eval1, eval): Use short-circuit evaluation for | and &.
4416 (eval): Return 0 if both arguments are null or zero, instead
4417 of returning the first argument.
4418 * tests/expr/basic: Add some tests for the above.
4420 2004-02-17 Jim Meyering <jim@meyering.net>
4424 `make check' from a build inside a chroot environment would fail
4425 * tests/help-version: Specify an argument (`/') for df, in the
4426 unusual event that there is no valid entry in /etc/mtab.
4427 Likewise for id: add the -u option, so we don't get spurious
4428 failures when there are no user or group names.
4431 * src/sort.c (usage) [-u]: Add punctuation so that the description in
4432 the help2man-generated (line-joined) man page is more readable.
4433 Reported by Tim Waugh.
4434 [-T]: Add a semicolon, for the same reason.
4436 2004-02-15 Jim Meyering <jim@meyering.net>
4438 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
4440 2004-02-11 Jim Meyering <jim@meyering.net>
4442 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
4443 $(srcdir)/../Makefile.am.in, rather than $<.
4444 Suggestion from Michael Elizabeth Chastain.
4446 2004-02-10 Jim Meyering <jim@meyering.net>
4448 * config/install-sh: Make this script executable.
4449 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
4450 is executable. Otherwise, on systems that lack a suitable install
4451 binary, `make install' would fail, because of the way this script
4452 is invoked (without `$SHELL ' prefix).
4453 Reported by Bob Proulx.
4455 2004-02-08 Jim Meyering <jim@meyering.net>
4459 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
4460 that would cause an unwarranted test failure.
4461 * tests/rm/rm3: Likewise.
4463 2004-02-07 Jim Meyering <jim@meyering.net>
4465 Remove xstat function pointer member. The way it was used was not
4466 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
4467 inline `stat' and `lstat' functions, thus making the tests of
4468 `xstat == lstat' in copy.c always fail.
4469 * src/copy.h (struct cp_options) [xstat]: Remove member.
4471 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
4472 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
4473 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
4474 (valid_options): Remove now-obsolete FIXME comments.
4476 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
4477 `*(x->xstat) (...)'.
4478 (do_copy): Declare/use local xstat rather than x->xstat.
4479 (main): Remove code that set x.xstat.
4480 * src/mv.c (cp_option_init): Don't initialize xstat member.
4481 * src/install.c (cp_option_init): Likewise.
4483 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
4484 so that emit_upload_commands can use these variables, too.
4486 2004-02-06 Jim Meyering <jim@meyering.net>
4488 * tests/rm/deep-1: Remove `du' stack space test.
4489 Apparently, `ulimit -s N' isn't portable enough.
4490 This test will be restored (with a guard against losing ulimit)
4491 in its own file later.
4493 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
4494 since this test doesn't take long enough to merit them.
4495 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
4497 * Makefile.maint (signatures): Remove definition.
4498 Now, automake's gnupload handles this.
4499 (%.sig: %): Remove now-unused rule.
4500 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
4501 `$(distdir).tar.bz2 $(distdir).tar.gz'.
4502 (emit-upload-commands): Adjust to use gnupload.
4504 2004-02-05 Jim Meyering <jim@meyering.net>
4506 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
4507 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4508 Now, those are all defined in timespec.h.
4511 * src/date.c: Don't include timespec.h, now that system.h does it.
4513 2004-02-02 Paul Eggert <eggert@twinsun.com>
4515 Don't dump core if localtime returns NULL (possible on
4516 hosts with 64-bit time_t and 32-bit int).
4517 * src/date.c: Include "inttostr.h".
4518 (batch_convert, main):
4519 If time conversion fails, exit with nonzero status.
4520 (show_date): Return int to report conversion failure.
4521 Print the time as an int if localtime fails.
4522 * src/uptime.c: Print "??" if the current clock can't
4523 be converted by localtime. This won't happen until the year
4524 2*31 + 1900, but we don't want to dump core even if the current
4525 clock has the wrong value.
4527 * src/stat.c: Include "inttostr.h".
4528 (human_time): Print the date/time as a number of seconds since the
4529 epoch if it can't be converted by localtime. This is better than
4530 just saying "invalid", and is consistent with what "ls" does.
4531 Don't dump core if the year has more than 48 digits; this isn't
4532 possible on any contemporary host, but we might as well do it right.
4534 2004-01-31 Paul Eggert <eggert@twinsun.com>
4536 * src/stat.c (human_time): Accept time rather than
4537 pointer-to-const-time parameter, for clarity. All callers changed.
4539 2004-02-02 Jim Meyering <jim@meyering.net>
4541 * src/stat.c (do_stat): Remove extra trailing newline from
4542 default formats. Reported by Nelson H. F. Beebe.
4544 Print actual fractional seconds in time stamps, not just `.00000000'.
4545 * src/stat.c (human_time): Add and use new parameter, t_ns.
4546 (print_stat): Update callers.
4547 * src/ls.c (TIMESPEC_NS): Remove definition.
4548 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
4549 also uses this macro.
4550 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
4551 fractional seconds for files on an XFS file system, but that stat's
4552 fractional seconds were always zero.
4554 2004-01-28 Paul Eggert <eggert@twinsun.com>
4556 * src/seq.c (print_numbers): Use 'double' for loop index, not
4557 'int', to avoid problems with integer overflow. On almost all
4558 machines 'double' works in every case where 'int' works, and
4559 it works on other cases besides.
4561 2004-01-27 Jim Meyering <jim@meyering.net>
4563 * src/seq.c (usage): Mention that if INCREMENT is omitted,
4564 it defaults to 1, even when FIRST is larger than LAST.
4565 Reword so as not to exclude the possibility that INCREMENT be zero.
4567 2004-01-25 Jim Meyering <jim@meyering.net>
4571 * Makefile.maint (signatures): Comment out definition.
4573 2004-01-23 Jim Meyering <jim@meyering.net>
4575 * Makefile.maint (header_regexp): Add exitfail.
4577 * man/Makefile.am (EXTRA_DIST): Add help2man.
4578 Reported by Nelson H. F. Beebe.
4580 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
4581 so it works on systems with Perl installed somewhere other than in
4584 * src/paste.c (paste_parallel): Declare local, chr, to be of type
4585 `int', not `char', since it must hold EOF. This bug would make
4586 paste infloop on some systems. Test failures reported by
4587 Nelson H. F. Beebe and Christian Krackowizer.
4589 2004-01-22 Jim Meyering <jim@meyering.net>
4591 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
4592 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
4594 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
4595 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
4596 Use --info-page='coreutils PROG' option.
4597 Now, readlink.1 refers the user to `info coreutils readlink'
4598 rather than to `info readlink'. Reported by Matt Swift.
4600 2004-01-21 Paul Eggert <eggert@twinsun.com>
4602 Exit status cleanup.
4604 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
4605 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
4606 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
4607 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
4608 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
4609 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
4610 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
4611 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
4612 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
4613 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
4614 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
4615 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
4616 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
4617 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
4618 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
4619 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
4620 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
4622 * src/cat.c (usage): Don't bother normalizing exit status
4623 since the arg is already the correct exit status now.
4624 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
4625 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
4626 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
4627 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
4628 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
4630 * src/chown.c (main): Removed unused local 'fail'.
4632 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
4635 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
4636 * src/env.c, src/nice.c, src/su.c: Likewise.
4637 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
4638 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
4639 * src/expr.c (main): Use initialize_exit_failure rather than
4640 setting exit_failure directly; this optimizes away redundant
4642 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
4644 * src/chroot.c (main): Exit with status 1 rather than 127
4645 if chroot itself fails, as per documentation.
4647 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
4648 rather than roll-your-own symbols or integers.
4649 * src/env.c (main): Likewise.
4650 * src/nohup.c (main): Likewise.
4651 * src/su.c (run_shell): Likewise.
4653 * src/cp.c (exit_status): Remove static var....
4654 (main): Making it local here instead. Use =, not |=, to set it.
4656 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
4658 * src/date.c (batch_convert, main): Likewise.
4659 * src/dd.c (dd_copy): Likewise.
4660 * src/pr.c (first_last_page, main, getoptarg): Likewise.
4661 * src/tr.c (main): Likewise.
4662 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
4663 POSIX doesn't require it.
4664 * src/dd.c (write_output, skip, dd_copy): Likewise.
4665 * src/df.c (main): Likewise.
4666 * src/id.c (main): Likewise.
4667 * src/install.c (main): Likewise.
4668 * src/ln.c (main): Likewise.
4669 * src/ls.c (main): Likewise.
4670 * src/mv.c (main): Likewise.
4671 * src/shred.c (main): Likewise.
4673 * src/env.c (main): Exit with status 1, not 2, on errors detected
4675 * src/hostname.c (main): Likewise.
4676 * src/nl.c (main): Likewise.
4677 * src/stty.c (main): Likewise.
4679 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
4680 consistency with the other programs' naming conventions.
4683 * src/factor.c (main): Do not report a usage error simply
4684 because stdin has bad numbers.
4686 * src/id.c (problems): Now a boolean int, not a counter,
4687 so that we don't have to worry about int overflow. All uses changed.
4688 * src/touch.c (err): Likewise.
4690 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
4692 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
4693 * src/mknod.c: Likewise.
4695 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
4696 on error; this is in case EXIT_FAILURE is unusual.
4697 * src/su.c (main): Likewise.
4699 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
4700 changed to EXIT_CANNOT_INVOKE.
4702 * src/printenv.c (PRINTENV_FAILURE): New constant.
4703 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
4704 command-line syntax problems.
4706 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
4707 (main): Avoid integer overflow when seeing whether errors occurred.
4709 * src/seq.c (print_numbers): Now returns void, not (zero) int.
4710 All callers changed.
4711 (main): Remove unused local variable 'errs'. Always exit successfully
4712 if we reach the end.
4714 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
4715 for consistency with other programs here. All uses changed.
4716 (main): Use 'error' to exit rather than invoking 'exit' here.
4718 * src/sort.c: Don't include <assert.h>.
4719 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
4720 (usage): Don't use 'assert'.
4721 (main): Remove redundant assignment to exit_failure.
4723 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
4725 (initialize_exit_failure): New inline function.
4726 Include exitfail.h here, since we refer to exit_failure.
4727 All callers changed to not include exitfail.h.
4729 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
4730 substitute them for the corresponding integer constants.
4732 * tests/help-version (expected_failure_status_date): Remove, as
4733 'date' is now normal.
4734 (expected_failure_status_nohup): New var.
4736 2004-01-21 Jim Meyering <jim@meyering.net>
4738 * tests/touch/relative: Remove `command' syntax.
4739 Thanks to Nelson H. F. Beebe and Paul Eggert.
4741 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
4742 so as to avoid problems with systems using TAI clocks.
4743 Although it's no longer necessary, set TZ=UTC0 also for the
4744 initial touch command. Reported by Paul Jarc here:
4745 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
4747 2004-01-20 Diego Biurrun <diego@biurrun.de>
4749 * src/dircolors.hin: Add .mov to the list of media files.
4751 2004-01-19 Paul Eggert <eggert@twinsun.com>
4753 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
4754 portable). Problem reported by Christian Krackowizer. Also, use
4755 +0000 rather than +0 to specify a time zone, as the documentation
4756 requires four digits.
4758 2004-01-19 Jim Meyering <jim@meyering.net>
4760 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
4761 * tests/mv/backup-is-src: Likewise.
4762 Problem reported by Peter Horst
4764 2004-01-17 Jim Meyering <jim@meyering.net>
4766 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
4770 2003-12-15 Paul Eggert <eggert@twinsun.com>
4772 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
4773 with -r specifying the origin for -d.
4774 * src/touch.c (flexible_date): Remove static var.
4775 (get_reldate): New function.
4776 (main): Use it, to implement this new behavior.
4778 2004-01-16 Jim Meyering <jim@meyering.net>
4780 * tests/touch/relative: New test for the above.
4781 * tests/touch/Makefile.am (TESTS): Add relative.
4783 2004-01-13 Jim Meyering <jim@meyering.net>
4785 * src/system.h: Include contents of sys2.h.
4786 * src/sys2.h: Remove file.
4787 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
4789 * Use automake-1.8.2. Regenerate dependent files.
4791 * Update to gettext-0.13.1.
4792 * configure.ac: Use gettext-0.13.1.
4793 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
4795 2004-01-12 Jim Meyering <jim@meyering.net>
4797 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
4799 * Makefile.maint (po-check): Ensure that cvsu works before using it.
4800 Reported by Alexandre Duret-Lutz.
4802 * src/tail.c (main): Warn about following stdin only when it's a tty.
4804 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
4806 2004-01-10 Jim Meyering <jim@meyering.net>
4808 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
4810 2004-01-09 Jim Meyering <jim@meyering.net>
4812 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
4814 2004-01-08 Jim Meyering <jim@meyering.net>
4816 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
4817 From Andreas Schwab.
4819 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
4820 remnant) from PATH component. That would cause tests in this directory
4821 not to run the just-built binaries, but rather whatever happened
4822 to be in one's PATH. Reported by Christian Krackowizer.
4824 2004-01-04 Jim Meyering <jim@meyering.net>
4826 * src/csplit.c (new_control_record): Use x2nrealloc
4827 rather than xrealloc.
4829 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
4831 (make_path_private): Likewise.
4833 2004-01-03 Jim Meyering <jim@meyering.net>
4835 * src/paste.c: Use `bool' (not int) as the type for a few
4837 (collapse_escapes): Rewrite to set globals rather than modifying
4839 Use size_t (not int) for all counters and related index variables.
4840 (paste_parallel): Remove needless complexity of
4841 using xrealloc in the loop; just allocate the buffers up front.
4842 Free the two temporary buffers.
4843 Move declarations of locals `down' into scope where used.
4844 (paste_serial): Remove `register' attributes.
4845 (main): Simplify delim-related code.
4846 Free `delims', now that it's malloc'd.
4848 2004-01-02 Jim Meyering <jim@meyering.net>
4850 * src/chroot.c: Include "quote.h".
4851 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
4852 (main): Exit with status of 127, not 1, for too-few-args,
4853 chroot failure, or chdir failure.
4854 Give a better diagnostic upon execvp failure.
4856 * src/du.c (usage): Mention that, with its current meaning,
4859 * src/tail.c (main): Warn about following stdin when it's a tty.
4860 Fail when following by name but no names are specified.
4862 2003-12-30 Jim Meyering <jim@meyering.net>
4864 * src/fold.c (main): Use memcpy, not strcpy.
4866 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
4869 2003-12-28 Jim Meyering <jim@meyering.net>
4871 * src/unexpand.c (n_tabs_allocated): New global.
4872 (add_tabstop): Use x2nrealloc rather than xrealloc.
4873 * src/expand.c: Likewise.
4875 * tests/misc/expand: New file.
4876 * tests/misc/Makefile.am (TESTS): Add expand.
4878 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
4879 (fillbuf): Use x2nrealloc rather than xrealloc.
4880 (sort): Use xnmalloc rather than xmalloc.
4883 2003-12-27 Jim Meyering <jim@meyering.net>
4885 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
4887 2003-12-29 Paul Eggert <eggert@twinsun.com>
4889 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
4890 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
4892 * doc/coreutils.texi (join invocation): Remove documentation
4893 accordingly. Document that -t makes all separators significant.
4895 * src/join.c: Include posixver.h.
4896 (obsolete_usage): New var.
4897 (longopts): Put obsolete options first.
4898 (OBSOLETE_LONG_OPTIONS): New constant.
4899 (get_option, add_file_name): New functions.
4900 (main): Use them to support new behavior.
4901 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
4902 Do not mark -j FIELD as obsolescent; it is longstanding
4903 UNIX tradition and is a valid extension to POSIX.
4905 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
4907 2003-12-28 Paul Eggert <eggert@twinsun.com>
4909 * src/join.c (add_field_list): Don't use alloca with unbounded
4910 size; just modify the argument, which is no longer const *.
4912 Various other minor cleanups, mostly to avoid the need for casts.
4914 (extract_field): Renamed from ADD_FIELD, as it's now a function.
4916 (struct field.beg): Now char *, not unsigned char const *. All
4917 uses changed. It shouldn't be const since xmemcoll writes on its
4919 (extract_field): Likewise, for 2nd arg.
4920 (keycmp): Remove now-unnecessary cast of xmemcoll args.
4922 (is_blank): New function, to avoid need to cast arg to unsigned char.
4923 (extract_field): Use it.
4925 (xfields): Rewrite pretty much from scratch.
4927 (hard_LC_COLLATE): Now bool, not int.
4928 (get_line, getseq, add_field_list): Now returns bool, not int.
4929 (decode_field_spec, add_field_list): Return true on success (not
4930 false), for consistency with the rest of the code. All uses changed.
4932 (tab): Now char, not unsigned char. This wasn't 100% necessary
4933 but is slightly cleaner.
4934 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
4936 (empty_filler): Now const *.
4938 (make_blank): Remove; wasn't needed. Remove all calls.
4939 (main): Don't set uni_blank.nfields; zero is fine.
4941 2003-12-27 Jim Meyering <jim@meyering.net>
4943 * src/join.c: Include "quote.h".
4944 (min, max): Remove definitions.
4945 Make a few function parameters and corresponding
4946 locals `const'. Use bool for boolean variables.
4947 Use size_t (not int) for all counters and related index variables.
4948 (prjoin): Remove now-useless assertion.
4949 (string_to_join_field): New function.
4950 (main): Accept join fields as large as SIZE_MAX.
4951 (keycmp): Rename `min' to MIN and max to MAX.
4953 2003-12-26 Jim Meyering <jim@meyering.net>
4955 fold -s didn't work on e.g., alpha-based systems.
4956 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
4957 x2nrealloc works properly on systems with differing sizes for int
4958 and size_t. Reported by Nelson Beebe.
4960 * src/fold.c: Use `bool' (not int) as the type for a few
4963 2003-12-23 Paul Eggert <eggert@twinsun.com>
4965 * src/ls.c (length_of_file_names_and_frills):
4966 Remove forward decl; not needed.
4967 (print_file_name_and_frills, length_of_file_name_and_frills):
4968 With -m, don't output spaces before inum or size.
4969 (print_with_commas): Don't output space just before newline.
4971 2003-12-24 Jim Meyering <jim@meyering.net>
4973 * tests/ls/Makefile.am (TESTS): Add m-option.
4974 * tests/ls/m-option: New file. Test for above fixes.
4976 2003-12-20 Jim Meyering <jim@meyering.net>
4980 * src/pr.c: Change type of global, buff_allocated, to size_t.
4982 * src/join.c [struct seq]: Change types of members count and alloc
4983 from `int' to `size_t'.
4985 * tests/Makefile.am (root-hint): Tweak wording.
4987 * src/du.c: Accept new option (-0, --null) that makes it so each
4988 output line is NUL-terminated rather than newline-terminated.
4990 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
4991 Reported by Volker Paul.
4992 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
4993 * tests/dd/unblock-sync: New test for the above.
4995 2003-12-19 Jim Meyering <jim@meyering.net>
4997 * tests/misc/nohup: Double quote back-ticked expression,
4998 in case it ends up having an unexpected value.
5000 * tests/ls/no-arg: Use ls's -1 option in both runs.
5002 * src/du.c (fts_debug): New global.
5003 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
5004 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
5005 (main) [DU_DEBUG]: Accept -d option.
5007 2003-12-18 Jim Meyering <jim@meyering.net>
5009 * src/ls.c (format_user): Increment dired_pos via two statements,
5010 `dired_pos += width; dired_pos++;' rather than one,
5011 `dired_pos += width + 1;' since the latter could conceivably overflow.
5012 (format_group): Likewise.
5015 * configure.ac: Require automake-1.8.
5017 2003-12-12 Jim Meyering <jim@meyering.net>
5019 * Use automake-1.8. Regenerate dependent files.
5021 2003-12-08 Jim Meyering <jim@meyering.net>
5023 * Makefile.maint (news-date-check): New rule.
5024 (alpha beta major): Depend on it.
5026 2003-12-03 Paul Eggert <eggert@twinsun.com>
5028 * NEWS: ls -l (and similar options) now adjust all columns to
5029 fit the data. Generalized from a suggestion by Leah Q for file sizes.
5030 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
5031 (format_user_width, format_group_width, unsigned_file_size,
5032 format_group): New functions.
5033 (block_size_width): Renamed from block_size_size.
5034 (inode_number_width, nlink_width, owner_width, group_width,
5035 author_width, major_device_number_width, minor_device_number_width,
5036 file_size_width): New vars.
5037 (clear_files): Initialize them.
5038 (gobble_file): Set them. Don't ceiling block_size_width to 7.
5039 (print_long_file): Use them.
5040 (gobble_file): Use a new local variable 'f' to make the code
5041 smaller and more consistent with other functions.
5042 (format_user): Output to stdout, not to a buffer, so that we
5043 don't have to worry about buffer overrun. Update dired_pos.
5044 (print_long_file): Don't put owner, group, author into buffer;
5045 just print them directly. Don't assume link counts and
5046 major and minor numbers fit into unsigned long int.
5047 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
5048 'ls' output is fixed-width.
5050 2003-12-02 Jim Meyering <jim@meyering.net>
5052 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
5054 2003-11-27 Jim Meyering <jim@meyering.net>
5056 * Use automake-1.7f. Regenerate dependent files.
5058 2003-11-24 Paul Eggert <eggert@twinsun.com>
5060 Parse floating-point operands and options in the C locale.
5061 POSIX requires this for printf, and we might as well be
5062 consistent elsewhere (tail, sleep, seq).
5064 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
5065 needed now that we assume C89. Include "c-strtod.h".
5066 (xstrtod): Call c_strtod, not strtod.
5067 * src/sleep.c: Include "c-strtod.h".
5068 (main): Update xstrtod call to include new argument, c_strtod.
5069 * src/seq.c (scan_double_arg): Likewise.
5070 * src/tail.c (parse_options): Likewise.
5072 2003-11-24 Jim Meyering <jim@meyering.net>
5074 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
5075 Reported by Mark Conty.
5077 2003-11-22 Jim Meyering <jim@meyering.net>
5079 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
5080 (sc_system_h_headers): Do this test only if sys2.h exists.
5082 2003-11-20 Jim Meyering <jim@meyering.net>
5084 * tests/help-version: Ensure that the bug-reporting address is
5085 included in the --help output for every program.
5086 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
5088 * src/ptx.c (usage): Output bug-reporting address.
5089 Reported by Dan Jacobson.
5091 2003-11-19 Jim Meyering <jim@meyering.net>
5093 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
5094 on the join fields. Suggestion from Bruce Robertson.
5096 2003-11-18 Jim Meyering <jim@meyering.net>
5098 `od -c -w9999999' could segfault
5099 * src/od.c (dump): Use xnmalloc/free, not alloca.
5101 2003-11-16 Jim Meyering <jim@meyering.net>
5103 * Use autoconf-2.59. Regenerate dependent files.
5105 * tests/du/hard-link: Minor tweak: use mkdir -p.
5107 Fix read-from-free'd-buffer error detected by valgrind.
5108 * src/csplit.c (remove_line): Don't return a pointer to data in
5109 a freed buffer. Instead, arrange to free the buffer on the
5112 * tests/misc/csplit: New test for above fix.
5114 2003-11-11 Jim Meyering <jim@meyering.net>
5116 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
5117 This avoids a warning from valgrind about memcpy with overlapping
5118 source and destination.
5120 * configure.ac: Require automake-1.7.8.
5122 2003-11-09 Jim Meyering <jim@meyering.net>
5124 * Use automake-1.7.9. Regenerate dependent files.
5126 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
5127 * src/chown.c: Likewise.
5129 * src/chown-core.c: Include "root-dev-ino.h".
5130 (chopt_init): Initialize new member.
5131 (change_file_owner): Support rm's new --preserve-root option.
5133 * src/remove.c: Include "root-dev-ino.h".
5134 (remove_cwd_entries): Remove now-obsolete FIXME comment.
5135 (remove_dir): Support rm's new --preserve-root option.
5137 * src/chown.c: Include "root-dev-ino.h".
5138 Add new options: --preserve-root and --no-preserve-root.
5140 * src/chmod.c: Include "root-dev-ino.h".
5141 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
5142 ROOT_DEV_INO_WARN macros.
5143 (get_root_dev_ino): Remove function definition, now that it's
5144 been moved to a separate file.
5145 (usage): Describe new options.
5147 * src/mv.c (rm_option_init): Initialized new member.
5149 * src/remove.h: Include "dev-ino.h".
5150 (struct rm_options): Add new member: root_dev_ino.
5151 * src/chown-core.h: Include "dev-ino.h".
5152 (struct Chown_option): Add new member: root_dev_ino.
5154 2003-11-06 Jim Meyering <jim@meyering.net>
5156 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
5157 hard-coding `sizeof FILE*'.
5159 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
5161 * src/wc.c (main): Free `fstatus' so there is no confusion about
5162 whether it's leaked or not.
5163 * src/who.c (who): Likewise for `utmp_buf'.
5165 2003-11-05 Paul Eggert <eggert@twinsun.com>
5167 Fix 'cut' problems with size_t overflow and unsigned int.
5168 More generally, resize integer variables to fit use more precisely.
5169 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
5170 (struct range_pair): Make members to be of type size_t, not unsigned.
5171 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
5172 (suppress_non_delimited, output_delimiter_specified,
5173 have_read_stdin, print_kth, set_fields): Now bool, nt int.
5174 (delim): Now unsigned char, not int.
5175 (mark_printable_field, is_printable_field, is_range_start_index,
5176 set_fields, set_fields, cut_bytes, cut_fields):
5177 Use size_t, not unsigned, for field and byte counts.
5178 (hash_int): Use uintptr_t, not unsigned, for pointers converted
5179 to integers. This squeezes more info out of them.
5180 (set_fields, cut_bytes, cut_fields, main):
5181 Use bool, not int, for booleans.
5182 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
5184 2003-11-05 Paul Eggert <eggert@twinsun.com>
5186 * man/Makefile.am (check-programs-vs-x):
5187 Work even if $(programs) contains '$'.
5188 Work even if 'missing=1' in environment.
5189 Don't report an error simply because $(programs) outputs nothing.
5191 2003-11-05 Jim Meyering <jim@meyering.net>
5193 * Use autoconf-2.58. Regenerate dependent files.
5195 * src/tr.c (spec_init): Fix typo in last change.
5197 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
5198 call to variadic version_etc function, so that it works even on systems
5199 for which sizeof char* != sizeof int.
5200 * src/true.c (main): Likewise.
5201 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
5202 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
5203 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
5204 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
5205 Similarly, cast NULL to `(char *)' in call to variadic function,
5206 parse_long_options, so that it works even on systems for which
5207 sizeof char* != sizeof int.
5208 A similar problem was reported by Harti Brandt in
5209 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
5211 * src/users.c (users): Free `utmp_buf' explicitly so that people
5212 don't mistake this for a real leak.
5213 Patch by Dennis Smit <ds@nerds-incorporated.org.
5215 2003-11-04 Paul Eggert <eggert@twinsun.com>
5217 * README: Document _POSIX2_VERSION.
5219 2003-11-04 Jim Meyering <jim@meyering.net>
5221 * src/tac.c (memrchr): Remove #if-0'd function.
5222 (tac_stdin_to_mem): Clean up #if-0'd code.
5224 * src/od.c (decode_format_string): Remove unnecessary casts.
5225 Use more maintainable `sizeof *var'.
5226 (main): Call decode_format_string rather than decode_one_format,
5227 now that `spec' may be NULL.
5229 * src/chmod.c (AUTHORS): Add my name.
5231 * src/split.c (next_file_name): Use `sizeof *var' rather than
5232 hard-coding `sizeof size_t'.
5234 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
5236 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
5237 to avoid potential overflow in pointer arithmetic.
5238 (set_fields): Use not `1', but rather `sizeof *printable_field' as
5239 second argument to xcalloc.
5240 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
5241 rather than xrealloc.
5242 * src/date.c (show_date): Likewise.
5243 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
5244 * src/pr.c (store_char): Likewise.
5245 * src/fold.c (fold_file): Likewise.
5247 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
5248 type changes (unsigned int -> size_t) in hash.c.
5249 * src/cp-hash.c (src_to_dest_hash): Likewise.
5250 * src/du.c (entry_hash): Likewise.
5251 * src/ls.c (dev_ino_hash): Likewise.
5252 * src/cut.c (hash_int): Likewise. Declare function as static.
5254 2003-11-03 Jim Meyering <jim@meyering.net>
5256 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
5257 * tests/misc/fold: Fail the test immediately if we're not running
5258 the expected version of fold.
5260 2003-11-02 Jim Meyering <jim@meyering.net>
5262 * src/tr.c (append_normal_char, append_range, append_char_class)
5263 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
5264 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
5265 and usually shorter.
5266 * src/copy.c (copy_internal): Likewise.
5267 * src/join.c (initseq, add_field, make_blank): Likewise.
5268 * src/od.c (main): Likewise.
5269 * src/cp.c (make_path_private): Likewise.
5270 * src/tsort.c (new_item, record_relation): Likewise.
5272 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
5273 (main): Also remove anachronistic cast of xmalloc return value.
5274 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
5275 (main): Also remove anachronistic cast of xmalloc return value.
5276 * src/sort.c (inittables): Likewise.
5277 (sort): Also Split a long line.
5279 2003-10-25 Jim Meyering <jim@meyering.net>
5281 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
5282 type changes (unsigned int -> size_t) in hash.c.
5283 * src/cp-hash.c (src_to_dest_hash): Likewise.
5284 * src/du.c (entry_hash): Likewise.
5285 * src/ls.c (dev_ino_hash): Likewise.
5286 * src/cut.c (hash_int): Likewise. Declare function as static.
5288 2003-10-21 Jim Meyering <jim@meyering.net>
5290 Don't fail when run with VERBOSE=yes.
5291 * tests/chgrp/basic: Do `set +x' before starting the subshell
5292 from which we invoke chgrp. Otherwise, the output from the
5293 VERBOSE=yes-induced `set -x' would result in spurious differences.
5294 Reported by Russel Coker via Michael Stone.
5296 2003-10-19 Jim Meyering <jim@meyering.net>
5298 chmod now uses fts to perform a directory traversal when -R is
5299 specified. Before, it operated on full path names, and as such
5300 would encounter the PATH_MAX (often 4096) limit.
5302 * src/chmod.c: Include "xfts.h".
5303 (process_file): Rename from change_file_mode.
5304 Adapt to be used with fts.
5305 (process_files): New function.
5307 2003-10-18 Jim Meyering <jim@meyering.net>
5309 * tests/du/deref-args: Ensure that du -D now dereferences all
5310 symlinks specified on the command line, not just those that
5311 reference directories.
5313 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
5314 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
5315 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
5316 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
5317 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
5318 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
5319 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
5320 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
5321 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
5322 Update the call to parse_long_options so that `AUTHORS, NULL' are the
5324 * src/true.c (main): Append NULL to version_etc argument list.
5325 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
5327 2003-10-17 Andreas Schwab <schwab@suse.de>
5329 * tests/mk-script: Get $srcdir from first parameter instead of
5331 (main): Update usage.
5333 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
5334 first argument of mk-script.
5335 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
5337 2003-10-17 Jim Meyering <jim@meyering.net>
5339 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
5340 generated `man' page is more readable. Suggestion from Dan Jacobson.
5342 * src/chown-core.c (change_file_owner): Handle the cases in
5343 which fts_info indicates an error with the given entry.
5345 * src/du.c (main): Simply assign to bit_flags.
5346 Don't bother with bit arithmetic.
5348 * tests/chmod/no-x: New file.
5349 * tests/chgrp/no-x: New file.
5350 * tests/chmod/Makefile.am (TESTS): Add no-x.
5351 * tests/chgrp/Makefile.am (TESTS): Likewise.
5353 * src/du.c: Include "xfts.h".
5354 (du_files): Use xfts_open, rather than fts_open.
5355 * src/chown-core.c (chown_files): Likewise.
5357 2003-10-16 Jim Meyering <jim@meyering.net>
5359 * src/chgrp.c (main): Simply assign to bit_flags.
5360 Don't bother with bit arithmetic.
5361 * src/chown.c (main): Likewise.
5362 Rename a couple of local variables.
5363 Remove unnecessary casts.
5365 * src/tail.c (start_bytes): Rename local, remainder, to avoid
5366 gcc's warning about shadowing a global.
5368 2003-10-15 Jim Meyering <jim@meyering.net>
5370 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
5371 use fts to perform a directory traversal when -R is specified.
5372 Before, they operated on full path names, and as such would
5373 encounter the PATH_MAX (often 4096) limit.
5374 They are more efficient. For example, before, chgrp -R would
5375 take almost 5 seconds to change about 2000 directories and fail
5376 (with `File name too long'), while now it succeeds on a hierarchy
5377 of depth 20,000 in 1/10 the time.
5379 * src/chown.c: Include "userspec.h" and "fts_.h".
5380 (WRITTEN_BY): Add my name.
5381 (getpwnam, getgrnam, getgrgid): Remove declarations.
5382 (endpwent): Remove definition.
5384 (main): Handle new options.
5385 Call new function, chown_files rather than change_file_owner.
5387 * src/chgrp.c: Include "fts_.h".
5388 (WRITTEN_BY): Add my name.
5389 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
5392 (main): Handle new options.
5393 Call new function, chown_files rather than change_file_owner.
5395 Rewrite to iterate through hierarchies using fts rather than
5396 via explicit recursion.
5397 * src/chown-core.c: Include "fts_.h"
5398 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
5399 on a single file at a time.
5400 (chown_files): New function.
5401 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
5402 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
5403 [struct Chown_option] (dereference): Remove member with ambiguous name.
5404 [struct Chown_option] (affect_symlink_referent): New member.
5405 (chown_files): New prototype.
5407 * tests/chgrp/recurse: Update tests accordingly.
5408 * tests/chgrp/posix-H: New tests for the above.
5409 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
5411 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
5412 work even for superuser. Suggestion from Dan Jacobson.
5414 2003-10-14 Paul Eggert <eggert@twinsun.com>
5416 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
5418 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
5419 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
5420 * src/sort.c (parse_field_count): Handle the case where overflow
5421 and invalid suffix char are both reported.
5423 2003-10-14 Jim Meyering <jim@meyering.net>
5425 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
5426 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
5429 2003-10-13 Paul Eggert <eggert@twinsun.com>
5431 Fix to avoid a denial-of-service attack if the display width is
5432 enormous. Also, clean up the code a bit by removing duplicate code.
5434 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
5435 (calculate_columns): New function, that contains code that used
5436 to be common to print_many_per_line and print_horizontal.
5437 (print_many_per_line, print_horizontal): Use it.
5438 (decode_switches): Set max_idx here, not in calculate_columns.
5439 (print_current_files): Don't call init_column_info; calculate_columns
5441 (init_column_info): Don't allocate a lot more space than is needed
5442 to represent the current set of files. Allocate all the new
5443 size_t cells in one call to xnmalloc, rather than a row at a time.
5445 2003-10-13 Jim Meyering <jim@meyering.net>
5447 * src/ls.c (init_column_info): Add another FIXME comment.
5449 2003-10-13 Paul Eggert <eggert@twinsun.com>
5451 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
5452 Remove several arbitrary limits on hosts where int cannot represent
5455 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
5456 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
5457 struct column_info.col_arr[0], max_idx):
5458 Now size_t, not int.
5459 (get_funky_string): Return bool indicating success, instead of
5460 a negative count to indicate failure. Store number of columns
5461 through new parameter OUTPUT_COUNT; that way, they can never
5462 go negative. Change equals_end from int to bool. All uses
5464 (struct column_info.valid_len): Now bool, not int. All uses changed.
5465 (dired_dump_obstack, get_funky_string, clear_files,
5466 extract_dirs_from_files, print_current_files,
5467 print_many_per_line, print_horizontal, init_column_info,
5468 put_indicator, length_of_file_name_and_frills,
5469 print_with_commas): Use size_t, not int, for local variables
5471 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
5472 Check for TIOCGWINSZ returing negative values (or values greater
5474 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
5476 Use xmalloc and xnmalloc, not XMALLOC.
5477 (gobble_file): Use xnrealloc, not XREALLOC.
5478 (print_color_indicator): Remove now-unnecessary cast to size_t.
5480 2003-10-12 Paul Eggert <eggert@twinsun.com>
5482 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
5483 * tests/sort/sort-tests: Remove from CVS; assume that people
5484 brave enough to check coreutils out from CVS can rebuild it.
5486 2003-10-12 Jim Meyering <jim@meyering.net>
5488 New options: --preserve-root and --no-preserve-root.
5489 * src/chmod.c (change_file_mode): Honor new option.
5490 (change_file_mode): Strip trailing slashes on directory
5491 argument passed to change_dir_mode.
5492 (get_root_dev_ino): New function.
5493 (main): Initialize global, root_dev_ino.
5495 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
5496 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
5498 * src/chmod.c (change_file_mode): Likewise.
5500 2003-10-08 Jim Meyering <jim@meyering.net>
5502 * src/csplit.c (main): Remove obsolete FIXME.
5504 2003-10-07 Jim Meyering <jim@meyering.net>
5506 * Use automake-1.7.8. Regenerate dependent files.
5508 2003-09-29 Paul Eggert <eggert@twinsun.com>
5512 * doc/coreutils.texi (csplit invocation):
5513 The regexp offset need not have a sign; POSIX requires support
5514 for signless offets.
5516 Be more careful about int widths. For example, remove some
5517 arbitrary limits by replacing 'unsigned' with 'size_t',
5518 'uintmax_t', etc. Use standard bool rather than a homegrown type.
5519 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5520 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
5521 to <stdbool.h> usage.
5522 (struct control): offset is now intmax_t, not int.
5523 repeat_forever is now bool, not int.
5524 (struct cstring): len is now size_t, not unsigned int.
5525 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
5526 size_t, not unsigned. start_line, first_available are now
5527 uintmax_t, not unsigned.
5528 (hold_count, control_used): Now size_t, not unsigned.
5529 (last_line_number, current_line, bytes_written):
5530 Now uintmax_t, not unsigned.
5531 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
5532 create_new_buffer, get_new_buffer, load_buffer, find_line,
5533 process_regexp, split_file, new_control_record, extract_regexp,
5534 get_format_width, get_format_prec, max_out):
5535 size args, locals, and returned values are now size_t, not unsigned
5537 (get_first_line_in_buffer, find_line, write_to_file,
5538 handle_line_error, process_line_count, regexp_error, process_regexp,
5540 File line, byte, and repetition counts are now uintmax_t, not unsigned.
5541 (check_for_offset): Don't require a sign before the offset.
5542 Use xstrtoimax to do the real work.
5543 (extract_regexp): Remove harmful cast of size to unsigned.
5544 256 -> 1<<CHAR_BIT, for clarity.
5545 (get_format_flags): Return at most 3, to avoid worries about overflow.
5547 (bytes_to_octal_digits): Remove.
5549 (cleanup): Don't check whether output_stream is NULL, since
5550 close_output_file does that for us.
5552 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
5553 (sizeof *p);" instead of the more long-winded alternatives.
5555 (get_new_buffer): Use O(1) algorithm for resizing a buffer
5556 to a much larger size, instead of an O(N) algorithm.
5558 (process_regexp): Use plain NULL rather than casted 0.
5560 (make_filename): Use %u, not %d, to format unsigned file number.
5562 (new_control_record): Use xrealloc exclusively, since it handles
5565 (extract_regexp): Change misspelled word in diagnostic.
5567 (get_format_width): Even if a minimum field width is specified,
5568 allow room for enough octal digits to represent the value of
5569 the maximum representible integer. This fixes a potential
5570 buffer overrun. Calculate this room at compile-time, not
5571 at run-time; this removes the need for bytes_to_octal_digits.
5572 Check for overflow; this removes a FIXME.
5574 (get_format_prec): Don't allow precision to be signed; it's
5575 not ANSI. Check for overflow. Remove hardcoded "11" as
5576 default precision; this fixes a potential buffer overrun
5577 on hosts with wider size_t.
5579 (get_format_conv_type): Change local variable to be of type
5580 unsigned char, not int; this removes a potential subscript
5581 violation on hosts where char is signed.
5583 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
5584 Allow "%%" in format. Don't overflow when
5585 counting lots of percents.
5587 (usage): Default sprintf format is %02u, not %d.
5589 2003-10-05 Jim Meyering <jim@meyering.net>
5591 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
5593 * src/du.c (du_files): Mark diagnostic for translation.
5595 2003-10-04 Jim Meyering <jim@meyering.net>
5597 * src/du.c (du_files): Ignore any failure of fts_close.
5598 Give better diagnostics for failed fts_open.
5600 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
5602 Deprecate existing use of -H (aka --si).
5603 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
5604 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
5605 (main): Warn that the meaning of -H will soon change to be
5608 2003-10-03 Jim Meyering <jim@meyering.net>
5610 * src/du.c: Accept --no-dereference (-P).
5612 2003-10-02 Jim Meyering <jim@meyering.net>
5614 * tests/du/trailing-slash: Adjust for slightly different output.
5616 Rewrite du.c to use fts.
5617 * src/du.c: Include "fts_.h", not ftw.h.
5618 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
5619 (IS_FTW_DIR_TYPE): Remove definition.
5620 (IS_DIR_TYPE): Define.
5621 (is_symlink_to_dir): Remove now-unnecessary function.
5622 (process_file, du_files): Rewrite to use fts.
5624 * tests/du/inaccessible-cwd: Ensure that even when run from an
5625 inaccessible directory, du can still operate on accessible
5626 directories elsewhere.
5627 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
5629 * tests/rm/deep-1: Ensure that du can process a hierarchy
5630 of depth 400 while using no more than 50KB of stack space.
5632 2003-10-01 Akim Demaille <akim@epita.fr>
5634 * announce-gen (print_news_deltas): New function, extracted from main.
5635 (main): Make `news_file' an array.
5636 Use '...=s' => \@var for --news and --url-directory specs.
5637 Before there were a couple of portability problems.
5639 2003-09-28 Jim Meyering <jim@meyering.net>
5641 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
5642 (syntax-check-rules): Add it.
5644 * src/copy.c: Remove unnecessary cast of alloca, since now it's
5645 guaranteed to be (void *).
5646 * src/cp.c: Likewise.
5647 * src/join.c: Likewise.
5648 * src/ln.c: Likewise.
5649 * src/ls.c: Likewise.
5650 * src/od.c: Likewise.
5651 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
5653 2003-09-27 Jim Meyering <jim@meyering.net>
5655 Don't exhaust virtual memory when processing large inputs.
5656 Fix this by removing csplit's internal free-list management;
5657 instead rely on malloc for that.
5659 * src/csplit.c (free_list): Remove global.
5660 (clear_all_line_control): Remove function.
5661 (get_new_buffer): Always use create_new_buffer to obtain a
5662 new buffer, rather than searching free_list.
5663 (free_buffer): Just call free.
5664 Reported by Nikola Milutinovic.
5666 2003-09-26 Jim Meyering <jim@meyering.net>
5668 * man/rm.x: Also list `chattr' in SEE ALSO section.
5669 Suggestion from Mark Hubbart.
5671 2003-09-25 Jim Meyering <jim@meyering.net>
5673 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
5674 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
5676 * Use autoconf-2.57d. Regenerate dependent files.
5678 2003-09-24 Jim Meyering <jim@meyering.net>
5680 Minor efficiency tweak.
5681 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
5682 (do_link): Likewise.
5684 2003-09-23 Jim Meyering <jim@meyering.net>
5686 * src/paste.c (paste_serial): Save errno after input error,
5687 to report proper errno value.
5688 Based on a patch from Paul Eggert.
5690 * src/tee.c (tee): Adjust fwrite arguments so that the return
5691 value is the number of bytes written.
5693 2003-09-16 Paul Eggert <eggert@twinsun.com>
5695 Don't assume ferror sets errno. Bug reported by Bruno Haible.
5697 * src/comm.c (compare_files): Save errno after input error,
5698 to report proper errno value.
5699 * src/fold.c (fold_file): Likewise.
5700 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
5701 * src/unexpand.c (unexpand): Likewise.
5703 * src/csplit.c (close_output_file): Don't report bogus errno value
5704 after ferror discovers an output error. We don't know the proper
5705 errno value, since it might have been caused by any of a whole
5706 bunch of calls, and it might have been trashed in the meantime.
5707 Fixing this problem will require much more extensive changes;
5708 in the meantime just say "write error".
5709 * src/od.c (check_and_close, dump, dump_strings): Likewise.
5710 * src/uniq.c (check_file): Likewise.
5712 * src/join.c (get_line): Report error right away if I/O fails,
5713 so that the proper errno value is used.
5714 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
5715 * src/tee.c (tee): Likewise.
5716 * src/uniq.c (check_file): Likewise.
5718 * src/od.c (skip): If a read fails, don't retry it later, so
5719 that we report the proper errno.
5721 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
5723 * src/tee.c (tee): Once a write failure has occurred, don't bother
5724 writing anything more to that stream.
5726 * src/uniq.c (check_file): Check for ferror (stdout) even if
5729 * src/yes.c (UNROLL): Remove.
5730 (main): Exit immediately when write failure is detected.
5731 Simplify code by assigning to argv when argc == 1.
5733 2003-09-21 Paul Eggert <eggert@twinsun.com>
5735 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
5736 (WRITTEN_BY): Change "Franc,ois" (actually using
5737 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
5740 2003-09-19 Jim Meyering <jim@meyering.net>
5742 `du -D symlink-to-dir' would mistakenly omit the slash in
5743 lines like this: 24 symlink-to-dir/subdir
5744 * src/du.c (process_file): Fix offset calculation.
5745 Reported by Jeff Sheinberg as Debian bug #211591;
5746 http://bugs.debian.org/205251
5748 * tests/du/deref-args: New file/test for the above.
5749 * tests/du/Makefile.am (TESTS): Add deref-args.
5751 * src/du.c (process_file): Remove useless disjunct.
5753 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
5755 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
5756 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
5757 Mark each WRITTEN_BY string as translatable.
5759 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
5760 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
5761 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
5762 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
5763 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
5764 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
5765 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
5766 * who.c, whoami.c, yes.c: Revert yesterday's changes.
5767 Instead, a subsequent change will embed `Written by ' in
5768 each string along with the author names.
5770 * src/true.c: Revert yesterday's changes.
5771 * src/sys2.h: Likewise.
5773 2003-09-18 Jim Meyering <jim@meyering.net>
5775 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
5776 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
5777 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
5778 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
5779 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
5780 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
5781 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
5782 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
5783 comma-separated list of strings and/or update the call to
5784 parse_long_options so that `AUTHORS, NULL' are the last parameters.
5785 * src/true.c (main): Append NULL to version_etc argument list.
5786 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
5788 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
5789 shadowing the math function name. Also rename loga to log_a.
5791 2003-09-14 Jim Meyering <jim@meyering.net>
5793 * src/factor.c (print_factors): Give a separate diagnostic
5794 for numbers that are too large, but otherwise valid.
5795 Reported by Dániel Varga.
5797 2003-09-10 Jim Meyering <jim@meyering.net>
5799 * Use automake-1.7.7. Regenerate dependent files.
5801 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
5802 of `fmt -1'. Using the just-built tr is a little cleaner.
5803 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
5804 * man/Makefile.am (programs, check-x-vs-1): Likewise.
5806 2003-09-09 Jim Meyering <jim@meyering.net>
5808 * src/copy.c: Alphabetize includes.
5809 Remove duplicate inclusion of "same.h".
5811 2003-09-08 Jim Meyering <jim@meyering.net>
5813 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
5814 Didn't give enough of a benefit, mainly because it's not yet
5819 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
5820 (check-programs-vs-x): Fail if $(programs) is empty.
5822 * src/remove.c: Add a comment.
5824 2003-09-07 Jim Meyering <jim@meyering.net>
5826 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
5827 Don't define. These symbols are no longer used.
5829 * tests/misc/tty-eof: Write ^D as \cD.
5830 Complete the change of 2003-08-02.
5832 * Makefile.maint (po-check): Use cvsu, so that a temporary source
5833 file in lib/ or src/ doesn't induce an unwarranted failure.
5834 Add a kludge to filter out the sole generated source file that
5835 also has translatable messages: src/false.c.
5837 2003-09-06 Jim Meyering <jim@meyering.net>
5839 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
5840 (parse_options): Give a diagnostic for (but still accept) the
5841 deprecated --allow-missing option.
5843 2003-09-04 Paul Eggert <eggert@twinsun.com>
5845 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
5846 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
5848 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
5849 size_bound ourselves. if an input file is a pipe and the user
5850 specified a size, use that size instead of trying to guess the
5851 pipe size. This has the beneficial side effect of avoiding the
5852 overhead of default_sort_size in that case. All callers changed.
5853 (sort): Remove static var size; now done by sort_buffer_size.
5855 2003-09-05 Jim Meyering <jim@meyering.net>
5857 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
5859 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
5860 to start, rather than just .1. Upon failure, print unexpected state.
5862 2003-09-04 Paul Eggert <eggert@twinsun.com>
5864 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
5865 SAFE_READ_ERROR to tmp->nbytes.
5866 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
5868 * src/head.c (struct linebuffer): Change nbytes and nlines
5869 from unsigned int to size_t. unsigned int is safe (after the
5870 2003-09-03 patch) but size_t is cleaner.
5871 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
5872 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
5874 Standardize on BUFSIZ as opposed to other macro names and values.
5875 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
5876 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
5877 stdio.h has always defined it,
5878 and other code already assumes it's defined.
5879 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
5880 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
5881 (io_buf): IO_BUF_SIZE -> BUFSIZ.
5883 2003-09-04 Paul Eggert <eggert@twinsun.com>
5885 * src/seq.c (step): Default to 1.
5886 (print_numbers): Allow the output to be empty.
5887 (main): The default step is 1, even if LAST < FIRST;
5888 as per documentation.
5889 * tests/seq/basic (onearg-2): Output should be empty.
5891 2003-09-05 Jim Meyering <jim@meyering.net>
5893 * Makefile.cfg (wget_files): Temporarily disable, until master
5894 versions are restored to ftp.gnu.org.
5896 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
5898 Make seq's --width (-w) option work properly even when the
5899 endpoint requiring the larger width is negative and smaller than
5901 * src/seq.c (get_width_format): Include `-' in the set of bytes
5902 allowed in a `simple' number (no decimal point, no exponent).
5903 Reported by Patrick Mauritz.
5905 2003-09-02 Paul Eggert <eggert@twinsun.com>
5907 * NEWS: sort -t '\0' now uses a NUL tab.
5908 sort option order no longer matters, unless POSIX requires it.
5909 * src/sort.c (usage): Say "blanks" instead of "whitespace",
5910 Similar fixes for many comments.
5911 (TAB_DEFAULT): New constant, so that we can support NUL as
5912 the field separator.
5913 (tab): Now int, not char. Initialize to TAB_DEFAULT.
5914 (specify_sort_size): If multiple sizes are specified, use the largest.
5915 (begfield, limfield): Support NUL tab char.
5916 (set_ordering): Do not let -i override -d.
5917 (main): Report an error if incompatible -o or -t options are given.
5918 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
5920 2003-09-05 Jim Meyering <jim@meyering.net>
5922 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
5924 2003-09-03 Andreas Schwab <schwab@suse.de>
5926 Bug report and patch here:
5927 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
5928 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
5929 * src/head.c (elide_tail_lines_pipe): Likewise.
5931 2003-09-03 Jim Meyering <jim@meyering.net>
5933 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
5934 small amount of code from him was first moved to lib/human.c, and was
5935 subsequently rewritten entirely.
5936 * src/df.c (AUTHORS): Likewise.
5938 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
5940 * src/md5sum.c (split_3): Accept the BSD format for generic
5941 message digest modes. Currently works with BSD's MD5 and SHA1
5942 formats since these are the two algorithms presently used in
5943 coreutils. Updated comments to reflect this change.
5944 (bsd_split_3): Updated comments.
5946 * tests/md5sum/basic-1: New test to make sure that
5947 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
5948 from `check-bsd' test in tests/sha1sum/basic-1).
5950 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
5951 --check exit status and BSD SHA1 format (adapted from tests
5952 in tests/md5sum/basic-1).
5954 2003-08-30 Jim Meyering <jim@meyering.net>
5956 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
5958 When source and destination arguments refer to the same file, reside
5959 on a partition (e.g. VFAT) on which distinct names may refer to the
5960 same directory entry (often due to variations in case), and when the
5961 link count for the file is 1, mv no longer unlinks the file. Instead,
5962 it gives the expected diagnostic that the source and destination are
5963 the same. WARNING: this is an incomplete fix. If the file happens
5964 to have a link count of 2 or greater, such an erroneous mv command
5965 will still unlink it.
5966 Although that is not possible on vfat or umsdos, it is possible on
5967 other file system types, e.g., ntfs, and hpfs.
5968 * src/copy.c (same_file_ok): Invoke same_name (which might still
5969 return false for names that refer to the same directory entry)
5970 only if the link count is 2 or more.
5971 * tests/mv/vfat: Show how to demonstrate the above problem.
5972 This test is not run.
5973 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
5975 2003-08-27 Jim Meyering <jim@meyering.net>
5977 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
5978 who's -l option has been eliciting an unconditional warning about
5979 this impending change since sh-utils-2.0.12 (April 2002).
5981 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
5982 This would happen for nonempty files not ending with a newline.
5983 Reported by Dan Jacobson.
5984 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
5985 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
5987 * src/stat.c (print_it): Avoid buffer overrun that would
5988 occur when the user-specified format string ends with `%'.
5989 Patch by Tommi Kyntola.
5990 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
5991 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
5993 2003-08-26 Jim Meyering <jim@meyering.net>
5995 Apply changes from bison.
5996 * GNUmakefile (SHELL): Define to `sh', if necessary.
5998 * Makefile.maint (WGETFLAGS): Define to `-C off'.
5999 Update all uses of $(WGET).
6001 2003-08-22 Akim Demaille <akim@epita.fr>
6003 * Makefile.cfg (local-checks-to-skip): New.
6004 * Makefile.maint (local-check): Rename as...
6005 (local-checks-available): this.
6008 2003-08-26 Akim Demaille <akim@epita.fr>
6010 * announce-gen (print_changelog_deltas): Neutralize "<#" as
6011 "<\#" to avoid magic from Gnus when posting parts of this script.
6013 2003-08-25 Jim Meyering <jim@meyering.net>
6015 * src/stat.c (main): Warn about use of deprecated `-l' option.
6017 2003-08-22 Jim Meyering <jim@meyering.net>
6019 * src/stat.c (do_stat): For link count at end of line, use %h format,
6020 instead of %-5h. The latter would make stat emit trailing spaces.
6021 Reported by Dan Jacobson.
6023 2003-08-20 Jim Meyering <jim@meyering.net>
6025 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
6027 2003-08-19 Jim Meyering <jim@meyering.net>
6029 * src/system.h: Include stdlib.h unconditionally,
6030 as we're now assuming that part of hosted C89.
6032 2003-08-18 Jim Meyering <jim@meyering.net>
6034 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
6035 to avoid warnings from gcc.
6037 2003-08-17 Jim Meyering <jim@meyering.net>
6039 Avoid unnecessary and sometimes time-consuming hostname lookups.
6040 * src/who.c (print_user): Use strchr, not strrchr.
6041 * src/pinky.c (print_entry): Likewise.
6042 Patch by Michael Stone.
6043 This fixes a typo I introduced in who-users.c on 1996-02-23.
6045 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
6046 disallowed between `@...@'.
6048 2003-08-16 Paul Eggert <eggert@twinsun.com>
6050 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
6051 done by gnulib .m4 files.
6052 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
6053 * src/sys2.h (strtoull): Remove unused declaration.
6055 2003-08-16 Jim Meyering <jim@meyering.net>
6057 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
6060 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
6061 race condition bug. The bug would be triggered when tailing a file
6062 with file pointer not at beginning of file, and where the file was
6063 truncated to have a length of less than the initial offset at just
6064 the right moment (between the two lseek calls in this function).
6066 An invalid initial value for *read_pos would result in
6067 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
6068 busy-wait rather than sleeping between iterations. The bug manifests
6069 itself only when tailing regular files that are initially nonempty.
6070 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
6072 (tail_lines): Likewise, after lseek calls.
6073 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
6074 * tests/tail-2/tail-n0f: New file. Test for above fix.
6075 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
6077 2003-08-15 Jim Meyering <jim@meyering.net>
6079 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
6080 (sc_sun_os_names): Likewise.
6081 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
6083 * man/help2man: Remove some SPACEs before TAB.
6085 2003-08-14 Paul Eggert <eggert@twinsun.com>
6087 * Makefile.maint (LC_ALL): Set to C.
6088 * man/Makefile.am (ASSORT): New var.
6089 (check-x-vs-1, programs): Use it.
6090 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
6091 * tests/Makefile.am (ASSORT, all_programs): Likewise.
6093 2003-08-11 Jim Meyering <jim@meyering.net>
6095 fold -s -wN would infloop for N < 8 with TABs in the input.
6096 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
6097 * src/fold.c (fold_file): Move contents of `else'-block
6098 out of conditional so it's used also for --spaces (-s).
6099 * tests/misc/fold: Test for the above fix.
6100 * tests/misc/Makefile.am (TESTS): Add fold.
6102 2003-08-10 Jim Meyering <jim@meyering.net>
6104 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
6105 system.h so the types from time.h and sys/time.h are available.
6106 It appears that this is necessary for OpenBSD, NetBSD, and
6107 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
6109 2003-08-06 Paul Eggert <eggert@twinsun.com>
6111 * NEWS: Add support for setting file timestamps to microsecond
6112 resolution, on hosts that support this.
6113 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
6114 * src/copy.c (copy_internal):
6115 Set file timestamps with utimens, not utime.
6116 * src/cp.c (re_protect): Likewise.
6117 * src/install.c (change_timestamps): Likewise.
6118 * src/touch.c (newtime, touch, main): Likewise.
6120 2003-08-09 Jim Meyering <jim@meyering.net>
6122 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
6124 (syntax-check-rules): Add it.
6126 * src/tail.c (main): Tweak Solaris OS version number in comment.
6127 * src/wc.c (wc): Likewise
6128 * tests/tail-2/fflush: Likewise.
6130 * src/tail.c: Add new undocumented option, --presume-input-pipe.
6131 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
6133 2003-08-08 Paul Eggert <eggert@twinsun.com>
6135 Use new gnulib 'extensions' module.
6136 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
6139 2003-08-08 Paul Eggert <eggert@twinsun.com>
6141 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
6143 2003-08-09 Jim Meyering <jim@meyering.net>
6145 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
6146 For tests of obsolete behavior, don't presume that unsetting
6147 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
6149 2003-08-07 Paul Eggert <eggert@twinsun.com>
6151 * doc/coreutils.texi (split invocation):
6152 Add -d or --numeric-suffixes option to 'split'.
6153 From a suggestion by Jesse Kornblum.
6154 * src/split.c (suffix_alphabet): New var.
6155 (longopts, usage, next_file_name, main): Support -d.
6156 (next_file_name, main): Allow -a0, as POSIX requires.
6157 (next_file_name): Don't assume ASCII-like encoding;
6158 'a' through 'z' are not contiguous in EBCDIC.
6160 2003-08-05 Paul Eggert <eggert@twinsun.com>
6162 Merge getline from gnulib.
6163 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
6164 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
6165 New files, from gnulib.
6166 * lib/getdelim2.c, lib/getdelim2.h: Remove.
6167 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
6168 getdelim2.h to getndelim2.c and getndelim2.h.
6169 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
6170 checking for getdelim.
6171 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
6172 than rolling our own.
6173 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
6174 (cut_fields): Invoke getndelim2 rather than getdelim2.
6176 2003-08-04 Jim Meyering <jim@meyering.net>
6178 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
6179 and for the indices to iterate through nsigs.
6181 2003-08-02 Paul Eggert <eggert@twinsun.com>
6183 * src/sort.c: Minor code cleanups, mostly to use more accurate
6184 types and to remove unnecessary casts.
6185 (min, max): Remove. All uses changed to MIN and MAX.
6186 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
6187 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
6188 keyfield.numeric, struct keyfield.general_numeric, struct
6189 keyfield.month, struct keyfield.reverse, reverse, unique,
6190 have_read_stdin): Now bool, not int. All uses changed.
6191 (eolchar): Now char, not int.
6192 (struct keyfield.ignore): Now bool const *, not int *.
6193 (struct keyfield.translate): Now char const *, not char *.
6194 (struct month.name): Likewise.
6195 (blanks, nonprinting, nondictionary): Now bool[], not int[].
6196 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
6197 check, sort, main): Use const * pointers when possible.
6198 (month_cmp): Rewrite to avoid casts.
6199 (inittables): Initialize tables unconditionally, to avoid branches.
6200 (fillbuf): Return bool, not int. All uses changed.
6201 (fillbuf, keycompare, new_key, main):
6202 Use SIZE_MAX rather than (size_t) -1.
6203 (trailing_blanks): Renamed from trim_trailing_blanks.
6204 Return the number of blanks to trim. All uses changed.
6205 (getmonth): Use trailing_blanks rather than open code.
6206 (keycompare): Do not cast char * to unsigned char *; not needed.
6207 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
6209 (compare, main): Use | rather than || to avoid jumps.
6210 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
6212 (check, first_same_file, sort, main):
6213 Use bool instead of int local vars when possible.
6214 (check): Merge the old 'checkfp' and 'check' into a single function,
6215 that returns a boolean (true if the file was ordered).
6217 (main): Use int instead of unsigned for iterating through nsigs.
6218 Rename local var "posix_pedantic" to "posixly_correct".
6220 2003-08-02 Jim Meyering <jim@meyering.net>
6222 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
6223 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
6225 * src/cut.c (cut_fields): Don't read again after encountering an
6226 initial EOF. E.g., `cut -f2' would do so.
6227 * tests/misc/tty-eof: Add a test for the above fix.
6229 * src/sort.c (sortlines): Add description and references.
6232 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
6233 the tests in help-version will use the just-built binaries.
6234 Reported by Christian Krackowizer.
6236 2003-07-31 Paul Eggert <eggert@twinsun.com>
6238 * NEWS: Add --rfc-2822 option to GNU date.
6239 * doc/coreutils.texi (Time directives, Options for date, Examples
6241 * src/date.c (long_options, usage, main): Likewise.
6242 * doc/getdate.texi (General date syntax): Likewise.
6243 * doc/coreutils.texi (Options for date): Fix a typo in format:
6244 it's now %d not %_d. Add URLs.
6246 2003-08-01 Jim Meyering <jim@meyering.net>
6248 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
6249 Otherwise, with at least the /bin/sh from HPUX 10.20,
6250 the trap code would end up converting that to exit 1 and thus an
6251 unexpected test failure. Reported by Christian Krackowizer.
6253 2003-07-31 Paul Eggert <eggert@twinsun.com>
6255 * src/ptx.c: Do not include bumpalloc.h.
6256 (WORD_TABLE): New member alloc.
6257 (ALLOC_NEW_WORD): Remove.
6258 (occurs_alloc): New var.
6259 (digest_word_file, find_occurs_in_text): Check for arithmetic
6260 overflow when computing table size. Use xrealloc rather than
6261 bumpalloc primitives.
6263 2003-07-29 Jim Meyering <jim@meyering.net>
6267 * README: When running tests as root, suggest using
6268 sudo with NON_ROOT_USERNAME=$USER.
6270 * tests/Makefile.am (all_programs): Makefile is in ../src, not
6273 2003-07-28 Jim Meyering <jim@meyering.net>
6275 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
6277 2003-07-28 Paul Eggert <eggert@twinsun.com>
6279 * lib/stdbool.hin (_Bool): Make it signed char, instead of
6280 an enum type, so that it's guaranteed to promote to int.
6281 * src/sort.c (sortlines_temp): Undo previous change.
6283 2003-07-28 Jim Meyering <jim@meyering.net>
6285 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
6286 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
6287 would cause lines[-1 - swap] (with swap = false) to evaluate to
6290 2003-07-27 Jim Meyering <jim@meyering.net>
6292 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
6293 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
6295 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
6296 directories, as required by POSIX. Reported by Karl Berry.
6297 * tests/rm/dir-no-w: New file. Test for the above fix.
6298 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
6300 * tests/mk-script: Emit `$xx', not its expansion.
6302 2003-07-27 Paul Eggert <eggert@twinsun.com>
6304 This change was inspired by a similar proposal by Stepan Kasal.
6305 * src/sort.c (mergelines, sortlines_temp): New functions.
6306 (sortlines): Use them, to reduce the number of times that
6307 we need to copy 'struct line' values. This improved CPU
6308 performance by about 30% on one 18 MB test.
6309 (sort): Don't invoke sortlines unless we have 2 or more lines.
6311 2003-07-26 Stepan Kasal <kasal@ucw.cz>
6313 * src/sort.c (sort): Don't require two `struct line's per text line,
6314 the new sort algorithm requires just 1.5.
6316 2003-07-27 Jim Meyering <jim@meyering.net>
6318 * src/pathchk.c (validate_path): Use %lu, not %ld.
6320 * src/cut.c (is_printable_field): Simplify bit arithmetic.
6322 * src/ls.c (sort_files): Put `volatile' in the right place.
6325 2003-07-26 Jim Meyering <jim@meyering.net>
6327 Use only one bit per field/offset in array, not one `int'.
6328 * src/cut.c (printable_field): Change type to `unsigned char'.
6329 (mark_printable_field, is_printable_field): New functions.
6330 Use them in place of all direct accesses of `printable_field'.
6332 * src/expand.c (parse_tabstops): Detect overflow properly.
6333 * src/cut.c (set_fields): Likewise.
6335 * src/rm.c: Include "dirname.h".
6336 (usage): Use base_name (program_name) in body of --help output.
6338 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
6339 Idea from Brendan O'Dea, who suggested using
6340 `program_name = basename (argv[0]);' everywhere --
6341 can't do that, but using base_name works just fine here.
6343 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
6345 2003-07-24 Paul Eggert <eggert@twinsun.com>
6347 Fix some POSIX-compliance problems with 'test'. This makes
6348 'test' more compatible with Bash.
6350 * NEWS, doc/coreutils.texi: Document the following.
6351 * src/test.c: Include exitfail.h.
6352 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
6353 (test-syntax_error): Use it.
6354 (binary_operator): Now takes bool arg specifying whether left operand
6355 is -l ARG, so that caller determines this rather than us.
6357 (term): Use posixtest to evaluate parenthesized subexpressions.
6358 (unary_operator, one_argument): Remove support for -t without operand.
6359 (one_argument): Take argument from argv[pos].
6360 (one_argument, two_arguments, three_arguments): Advance pos.
6361 All callers changed.
6362 (three_arguments): Look for binary ops before "!". Then look
6363 for parenthesized one_argument expressions, instead of trusting
6364 expr () to do the right thing.
6365 (posixtest): Now takes number of args. All callers changed.
6366 Treat "( A B )" like "A B".
6367 (main): Set exit_failure to TEST_FAILURE. Don't depend on
6368 POSIXLY_CORRECT, as we now conform to POSIX by default.
6369 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
6370 * tests/test/Test.pm (test_vector): Add several tests to check
6371 the above. Syntax errors now exit with status 2, not 1.
6372 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
6374 2003-07-26 Jim Meyering <jim@meyering.net>
6376 * tests/help-version: Adjust for above change in test behavior:
6377 `[' exits with 2, not 1, and test doesn't accept --help or --version.
6379 * Makefile.maint (ME): Don't use trick suggested in Make manual.
6380 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
6382 * Makefile.maint (sc_system_h_headers): Another syntax check.
6383 (syntax-check-rules): Add it to the list.
6385 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
6386 so it matches `%ld' format even on 32-bit systems.
6388 * src/fmt.c (flush_paragraph): Cast field width to `int' to
6389 avoid warning on 64-bit systems.
6391 * src/ls.c (sort_files): Make `func' volatile, so it can't be
6392 clobbered by a `longjmp' into this function.
6394 2003-07-25 Jim Meyering <jim@meyering.net>
6396 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
6399 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
6400 because it'd evoke spurious failure on 64-bit systems.
6402 2003-07-24 Jim Meyering <jim@meyering.net>
6404 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
6405 output its current record counts. Reported by Jurriaan.
6407 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
6408 `wc' with no options. This goes along with the change of 2003-07-20.
6410 2003-07-23 Jim Meyering <jim@meyering.net>
6412 Don't include headers already included by system.h:
6413 * src/tr.c: Don't include errno.h.
6414 * src/true.c: Don't include version-etc.h.
6415 * src/test.c: Don't include limits.h or error.h.
6416 * src/stat.c: Don't include unistd.h or time.h.
6417 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
6418 * src/pr.c: Don't include time.h.
6419 * src/pathchk.c: Don't include errno.h.
6420 * src/nice.c: Don't include sys/time.h.
6421 * src/ls.c: Don't include stdlib.h.
6423 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
6424 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
6425 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
6426 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
6427 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
6428 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
6429 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
6430 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
6431 Don't include closeout.h.
6433 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
6434 can access the required version of rm.
6435 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
6437 * tests/cut/Test.pm (out-delim3a): New test.
6439 * man/help2man: Update to version 1.33.
6441 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
6443 * src/dircolors.c: Include xstrndup.h.
6444 (xstrndup): Remove function, now that it's been factored out into
6447 2003-07-22 Paul Eggert <eggert@twinsun.com>
6449 * src/wc.c (wc): Fix typo in computation of file from file_x,
6450 which caused the former to be used uninitialized if file_x was
6453 2003-07-22 Jim Meyering <jim@meyering.net>
6455 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
6457 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
6458 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
6459 Thomas Luzat. See http://bugs.debian.org/202413 for details.
6461 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
6463 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
6465 * src/cut.c (set_fields): Mark all selected indices before trying to
6466 determine range endpoints.
6467 * tests/cut/Test.pm: New test for the above fix.
6469 Begin to address this comment: What if someone wants to
6470 extract the 1,000,000-th field of some huge input file?
6471 The first step is to rearrange things so that the values
6472 in the printable_field array are all 0/1 rather than 0/1/2.
6473 * src/cut.c (RANGE_START_SENTINEL): Remove.
6474 Store range-start indices in a hash table, rather than
6475 overloading the `printable_field' array.
6476 (range_start_ht): New global.
6477 (hash_int, hash_compare_ints, is_range_start_index): New functions.
6478 (print_kth): Use is_range_start_index; don't test printable_field.
6479 (set_fields): Detect overflow.
6480 (set_fields): Insert each range-start index into range_start_ht.
6481 (main): Call set_fields only once, and only after
6482 output_delimiter_specified and (if required) range_start_ht have
6485 2003-07-20 Paul Eggert <eggert@twinsun.com>
6487 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
6488 invoked with a null pointer when there were no file arguments.
6490 2003-07-20 Jim Meyering <jim@meyering.net>
6492 * Makefile.maint (sc_changelog): Add another nit-picky check.
6494 * src/wc.c (write_counts): Add a comment.
6495 (wc): Rename `file' parameter.
6496 Set new local, `file', to be the file name, or (when it's NULL)
6497 _("standard output") so that all uses of `file' use the proper value.
6498 Use STREQ, not strcmp.
6500 2003-07-20 Paul Eggert <eggert@twinsun.com>
6502 wc count field widths now are heuristically adjusted depending
6503 on the input size, if known. If only one count is printed, it
6504 is guaranteed to be printed without leading spaces.
6506 Previously, wc did not align the count fields if
6507 POSIXLY_CORRECT was set, but POSIX did not actually require
6508 this undesirable behavior, so it has been removed.
6510 * NEWS: Document this.
6511 * doc/coreutils.texi (wc invocation): Likewise.
6513 * src/wc.c (number_width): New var.
6514 (posixly_correct): Remove.
6515 (struct fstatus): New struct.
6516 (write_counts): Output fields of width number_width.
6517 Do not worry about POSIXLY_CORRECT.
6518 Use null file, not empty-string file, to denote stdin,
6519 since "" is a valid file name on some hosts.
6520 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
6522 (wc): Avoid problems if end_pos - current_pos overflows.
6523 Do not print odd message if stdin has a read error.
6524 (get_input_fstatus, compute_number_width): New functions.
6525 (main): Use them to implement the new behavior.
6526 Ignore POSIXLY_CORRECT.
6528 * tests/wc/Test.pm: Adjust to the new output widths.
6530 2003-07-19 Jim Meyering <jim@meyering.net>
6532 * tests/rm/fail-eperm: Don't create temporary directory --
6535 * tests/shred/remove: Don't open-code test for UID != 0.
6536 Use priv-check's require-non-root instead.
6537 Update to use newer framework.
6539 * tests/help-version (expected_failure_status_expr): Record that
6540 expr exits with status of 3 for e.g., a write error.
6542 * tests/priv-check: Use `id -u' to see if we're running as root,
6543 rather than trying go write to an write-protected file.
6544 When running as root, ensure $NON_ROOT_USERNAME is valid.
6545 When running as root with `require-non-root', ensure that `.'
6546 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
6547 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
6549 * src/printenv.c: Include "exitfail.h".
6550 (main): Set exit_failure rather than calling close_stdout_set_status.
6551 * src/date.c: Likewise.
6552 * src/sort.c: Likewise.
6553 * src/tty.c: Likewise.
6555 2003-07-18 Jim Meyering <jim@meyering.net>
6557 * tests/touch/not-owner: Update to use newer framework.
6559 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
6560 directory, and remove Perl-coded `you may not run as root' test.
6561 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
6562 hard-coding something not quite equivalent.
6563 Paul Jarc reported the inconsistent diagnostics.
6565 * src/sort.c (main): Use close_stdout via atexit.
6566 Now `sort --version' and `sort --help' fail, as they should
6567 when their output is redirected to /dev/full.
6569 * src/su.c (usage): Don't call close_stdout here.
6570 (main): Use close_stdout via atexit.
6571 Now `su --version > /dev/full' fails, as it should.
6572 Somehow, the change of 2000-05-07 that purports to fix this
6575 * tests/help-version (--help/--version vs. /dev/full): Special-case
6576 `[' to protect it from expected_failure_status-`eval'.
6578 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
6579 count and the corresponding line, as required by POSIX.
6580 Reported by Clement Wang.
6581 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
6583 * tests/expr/basic: Add tests for when exit status is 2.
6585 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
6586 Use an anonymous `enum', rather than #define.
6588 2003-07-17 Paul Eggert <eggert@twinsun.com>
6590 * src/expr.c: Include "exitfail.h", "quotearg.h".
6591 (EXPR_INVALID, EXPR_ERROR): New constants.
6592 (nomoreargs, null, toarith, nextarg): Return bool, not int.
6593 (syntax_error): New function, exiting with status 2. Use it
6594 insteading of printing "syntax error" ourselves.
6595 (main): Initialize exit_failure to EXPR_ERROR.
6596 Exit with EXPR_INVALID on syntax error (too few arguments).
6597 (nextarg): Use strcmp, not strcoll; strcoll might return
6598 an undesirable 0, or might fail.
6599 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
6600 or other such error.
6601 (eval2): Report an error if strcoll fails in a string comparison.
6602 * src/sort.c: Include "exitfail.h".
6603 (main): Set exit_failure, not xalloc_exit_failure and
6604 xmemcoll_exit_failure.
6605 * tests/expr/basic: Invalid value exits with status 3, not 2.
6607 2003-07-16 Jim Meyering <jim@meyering.net>
6609 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
6610 per GNU maintainer guidelines. The next non-beta release will be 5.1.
6612 This script would have caught at least two recent bugs:
6613 those in [ and kill.
6614 * tests/help-version: Revive this script.
6615 It wasn't doing anything useful, since $all_programs wasn't being
6616 defined by the invoking Makefile.am.
6617 Reflect that nohup is no longer a script, so don't exclude it.
6618 Add framework to handle the programs added since it was last run:
6619 kill, stat, unlink, [, link, readlink.
6620 Fix path-related problems deriving from the move of this script
6621 from src/ to its present location.
6622 * tests/Makefile.am (all_programs): Define.
6623 (TESTS_ENVIRONMENT): Use it.
6625 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
6626 whereby kill would always attempt to operate on argv[0] and fail.
6628 * src/test.c (integer_expected_error): Improve diagnostic -- now,
6629 it also matches the one from bash's builtin test.
6630 (binary_operator): Add \n at end of diagnostic.
6632 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
6633 * tests/priv-check: Move setuidgid-related and
6634 NON_ROOT_USERNAME-checking code to this file.
6636 * README: Update section on testing as `root'.
6637 Suggestion from Paul Jarc.
6639 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
6640 names of authors that I just found in bash's builtins/test.def.
6642 Running `[' with no arguments would evoke a segfault.
6643 * src/test.c (main) [LBRACKET]: Move initialization of argv to
6644 precede potential use via test_syntax_error.
6646 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
6647 warning from automake -Wall.
6649 2003-07-15 Jim Meyering <jim@meyering.net>
6653 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
6656 * announce-gen (print_changelog_deltas): Relax tests for matching
6657 version-number line in NEWS.
6658 Change the .sig suffix to .asc here, too.
6660 2003-07-14 Jim Meyering <jim@meyering.net>
6662 * Makefile.maint (%.asc): Renamed from %.sig.
6663 Generate and use ascii-armored signatures.
6664 Use gpg's -o option.
6666 2003-07-13 Jim Meyering <jim@meyering.net>
6668 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
6671 * Makefile.maint (syntax-check): Move each individual check into
6673 (syntax-check-rules): This is the list of syntax-check targets.
6674 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
6675 (sc_cast_of_x_alloc_return_value, sc_space_tab):
6676 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
6678 2003-07-12 Jim Meyering <jim@meyering.net>
6680 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
6681 traces of the nohup script.
6683 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
6684 $(OPTIONAL_BIN_ZCRIPTS).
6686 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
6687 target, not before the `>'.
6689 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
6690 now that that function no longer calls `error'.
6692 * src/df.c (find_mount_point): Emit a diagnostic for each
6693 failed syscall, rather than relying on caller to do that.
6694 The caller couldn't do a good job, anyhow -- too many different
6695 ways to fail (each with a different referent).
6696 Give a diagnostic upon failed save_cwd, now that that function
6697 no longer calls `error'.
6698 (show_point): Don't diagnose find_mount_point's errors, now that
6699 it handles them itself.
6701 * src/df.c (find_mount_point): Don't let free clobber errno upon
6704 * src/sys2.h: Remove alloca-related block.
6705 * src/system.h: Include <alloca.h> here, instead.
6707 It appears that the `#pragma alloca' included via "system.h" is
6708 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
6709 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
6710 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
6712 * src/chown-core.c (change_file_owner): Do not restore any special
6713 permission bits (e.g., set-user-ID, set-group-ID) that are reset
6714 by chown(2) on some systems. Suggestion and insistence :-) from
6717 * tests/input-tty: Also check `test -t 1'.
6718 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
6719 test would block when run in the background.
6721 2003-07-11 Jim Meyering <jim@meyering.net>
6723 * tests/sample-test: Also fail if cat-to-create-expected-output
6724 fails. Otherwise, if both `exp' and `out' were to end up empty
6725 because of e.g., a full disk, they would mistakenly compare equal.
6727 * src/nohup.c: New file. Rewrite of nohup.sh in C.
6728 This solves a portability problem: on at least Solaris systems,
6729 when nohup.sh used the vendor /bin/sh, it would exit with status
6730 of `1' rather than the required 126 or 127 upon failure to exec
6731 the specified program.
6733 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
6734 (bin_PROGRAMS): Add nohup.
6735 (EXTRA_DIST): Remove nohup.sh.
6736 (all_programs): Remove use of $(EXTRA_SCRIPTS).
6737 * src/nohup.sh: Remove file.
6738 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
6740 * tests/misc/nohup: Tests for the above.
6741 * tests/misc/Makefile.am (TESTS): Add nohup.
6743 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
6744 the macro, COPY_FD_DIAGNOSE.
6745 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
6746 (head_file): Likewise.
6748 * src/date.c: Include "quote.h".
6749 (batch_convert): Use the quote function rather than using literal `...'
6752 * src/setuidgid.c (main): Enclose diagnostic in _(...).
6753 * src/fmt.c (main): Likewise.
6754 * src/mknod.c (main): Likewise.
6755 * src/tac.c (tac_seekable): Likewise.
6756 * src/yes.c (main): Likewise.
6757 * src/od.c (main): Likewise.
6758 * src/install.c (change_attributes): Likewise.
6760 2003-07-10 Jim Meyering <jim@meyering.net>
6762 * src/head.c (usage): Use 1024*1024 in place of 1048576.
6763 * src/tail.c (usage): Likewise.
6765 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
6766 place of the kludge in this test. Suggestion from Paul Jarc.
6768 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
6769 * src/setuidgid.c: New program, solely for testing (not installed).
6771 * src/chown-core.c (change_file_owner): Don't leak file descriptors
6772 when dereferencing symlinks.
6774 2003-07-09 Jim Meyering <jim@meyering.net>
6776 * tests/du/slash: New file/test for today's lib/ftw.c fix.
6777 * tests/du/Makefile.am (TESTS): Add slash
6779 * src/tail.c (xlseek): Avoid warning about ``return without value
6780 from function returning non-void''.
6782 2003-07-08 Jim Meyering <jim@meyering.net>
6784 * man/help2man: Update to version 1.29.
6786 * man/help2man: Add END handler to close STDOUT and check for errors.
6788 2003-06-30 Paul Eggert <eggert@twinsun.com>
6790 Add support for a "[" that conforms to the GNU coding standards,
6791 i.e., that does not depend on its name.
6792 * src/lbracket.c: New file.
6794 * man/Makefile.am (programs): Ignore "[", since it doesn't have
6795 a separate man page.
6796 * src/Makefile.am (bin_PROGRAMS): Add "[".
6797 (__SOURCES): New var.
6798 * src/test.c (LBRACKET): Define to 0 if not defined.
6799 (main): Use LBRACKET rather than argv[0].
6801 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
6802 Reported by Paul Jarc and Dan Jacobson.
6804 * src/test.c (main): Do not recognize --help or --version if
6805 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
6806 Do not bother testing that margv[margc] is non-null.
6808 2003-07-04 Jim Meyering <jim@meyering.net>
6810 * src/who.c (print_line): Rewrite to use asprintf, in order to be
6811 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
6813 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
6814 option, and perform the +1600 invocations of head IFF the envvar
6815 RUN_EXPENSIVE_TESTS is set.
6817 2003-07-03 Jim Meyering <jim@meyering.net>
6819 * src/cp.c (do_copy): Give a better diagnostic when failing due
6820 to nonexistent destination directory. Reported by Dmitry Rutsky.
6821 See http://bugs.debian.org/199730 for details.
6823 2003-06-27 Jim Meyering <jim@meyering.net>
6825 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
6826 * src/split.c (longopts): Use `1', not `0' as the value for
6827 for &verbose. Reported by Keith Thompson.
6829 Test for the above fix.
6830 * tests/misc/split-a: Also use --verbose and compare stderr
6831 output with what we'd expect.
6833 2003-06-20 Jim Meyering <jim@meyering.net>
6835 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
6836 Use `error_t' (rather than int) as type for local `err'.
6837 From Alfred M. Szmidt.
6839 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
6841 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
6842 Fix author preservation code.
6844 2003-06-19 Jim Meyering <jim@meyering.net>
6846 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
6847 (do_link): Don't warn about hard link to symlink.
6849 2003-06-18 Jim Meyering <jim@meyering.net>
6851 * src/cut.c: Include "getdelim2.h", not "getstr.h".
6852 Reflect renaming: getstr -> getdelim2.
6854 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
6855 readline -> readlinebuffer.
6857 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
6859 * src/readlink.c: Include <sys/types.h> before system.h (because
6860 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
6862 2003-06-17 Jim Meyering <jim@meyering.net>
6864 * src/system.h (initialize_main): Define.
6865 Use it in every `main'. Applied via this:
6866 p='initialize_main (&argc, &argv);'
6867 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
6868 $(grep -l program_name.=.argv.0 *.c)
6869 test.c uses margc/margv, so I made the change manually for that file.
6870 Based on a patch from Bernard Giroud.
6872 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
6874 Fix for build failure on Ultrix 4.3.
6875 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
6876 Include sys/param.h and sys/mount.h on ultrix.
6878 2003-06-16 Jim Meyering <jim@meyering.net>
6880 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
6882 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
6883 them here instead, but with one change: define EISDIR to -1, not 0.
6885 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
6886 guaranteed to be defined.
6887 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
6889 * README: Mention the CVS repository.
6890 Encourage addition of test cases.
6892 2003-06-12 Jim Meyering <jim@meyering.net>
6894 * src/touch.c (touch): Call close only if necessary.
6897 * src/wc.c (usage): Correct wording: wc prints counts in the order
6898 `newline, word, byte'. Reported by Keith M. Briggs.
6899 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
6901 2003-06-10 Jim Meyering <jim@meyering.net>
6903 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
6905 2003-06-07 Jim Meyering <jim@meyering.net>
6907 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
6910 2003-06-06 Jim Meyering <jim@meyering.net>
6912 * src/extract-magic (main): Avoid newer 3-arg form of open,
6913 so this script works also with e.g., perl5.005_03.
6914 Patch by John David Anglin.
6916 2003-06-04 Paul Eggert <eggert@twinsun.com>
6918 * src/system.h: Include <stdbool.h> unconditionally.
6920 2003-06-04 Jim Meyering <jim@meyering.net>
6922 * man/Makefile.am (check-programs-vs-x): Rename target
6923 from check-programs-vs-1. Adjust rule to check for the
6924 primary (.x) file, not the generated one (.1).
6926 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
6928 * man/kill.x: New file.
6929 * man/Makefile.am (dist_man_MANS): Add kill.1.
6932 2003-06-04 Jim Meyering <jim@meyering.net>
6934 Ensure that the .x file for a new program is never forgotten again.
6935 * man/Makefile.am (programs): Define.
6936 (check-programs-vs-1): New phony target.
6937 (check-local): Depend on it.
6939 2003-06-03 Jim Meyering <jim@meyering.net>
6941 Avoid unnecessary copying of environment.
6942 * src/env.c (main): Rather than clearing the environment and --
6943 unless told to ignore environment -- copying all settings from
6944 the saved, original environment, clear the environment only when
6945 that is requested. Suggested by Jens Elkner.
6947 2003-06-02 Jim Meyering <jim@meyering.net>
6949 * src/system.h: Always include <string.h>, since we assume C89.
6950 Include <limits.h> without checking for HAVE_LIMITS_H.
6952 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
6953 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
6955 2003-06-01 Jim Meyering <jim@meyering.net>
6957 Avoid a race condition in `tail -f' described by Ken Raeburn in
6958 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
6959 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
6960 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
6961 (tail_bytes, tail_lines, tail): Likewise.
6962 (tail_file): Use the new `read_pos' value as the size,
6963 rather than stats.st_size from the fstat call.
6965 2003-05-28 Jim Meyering <jim@meyering.net>
6967 * src/extract-magic: Allow expansion of `$file' in the here-
6968 document corresponding to the comment at the top of fs.h.
6970 2003-05-26 Jim Meyering <jim@meyering.net>
6972 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
6973 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
6974 Use #if/#elif/... cascade so we get only one set of include files.
6975 Reported by Nelson Beebe.
6977 2003-05-24 Jim Meyering <jim@meyering.net>
6979 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
6980 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
6981 accept the BSD format.
6983 2003-03-28 Joe Orton <jorton@redhat.com>
6985 * src/md5sum.c (bsd_split_3): New function.
6986 (split_3): Detect checksums from BSD 'md5' command and handle them
6989 * tests/md5sum/basic-1: New tests for --check exit status, and for
6990 BSD-style checksum files.
6992 2003-05-21 Jim Meyering <jim@meyering.net>
6994 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
6995 This sort of thing is why it'd be *Really Good* to factor
6996 out the common code used here and in tail.c.
6998 2003-05-14 Jim Meyering <jim@meyering.net>
7000 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
7002 * tests/du/slink: Skip this test if `.' is on an XFS file system.
7004 * tests/du/fd-leak: New file. Test for the bug in du that
7005 was fixed by the 2003-05-12 change to lib/ftw.c.
7006 * tests/du/Makefile.am (TESTS): Add fd-leak.
7008 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
7009 includes a translatable word, `and'.
7011 * src/dd.c (usage): Don't use `,' as the thousands separator
7012 in e.g. 1,000,000 and 1,048,576. Instead, do this:
7013 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
7014 * src/df.c (usage): Likewise.
7015 * src/du.c (usage): Likewise.
7016 * src/ls.c (usage): Likewise.
7018 * Makefile.maint (syntax-check): Add another check.
7020 2003-05-13 Paul Eggert <eggert@twinsun.com>
7022 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
7023 must output nothing. Problem reported by Josh Hyman.
7025 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
7026 (output_unique, output_first_repeated, output_later_repeated):
7027 New vars. All uses of "mode" changed to use these variables,
7028 which are not mutually exclusive as "mode" was.
7029 (writeline): New arg "match", used to control whether to
7030 obey output_first_repeated or output_later_repeated.
7031 All callers changed.
7032 (check_file, main): Adjust to above changes.
7034 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
7036 2003-05-14 Jim Meyering <jim@meyering.net>
7038 * tests/rm/rm3: Use tr's \n notation rather than \012.
7039 This package can afford to do that, since its tests are guaranteed use
7040 GNU tr, which has accepted the more modern notation for 10 years.
7041 * tests/rm/rm5: Likewise.
7042 * tests/cp/same-file: Likewise.
7043 * tests/stty/row-col-1: Likewise.
7044 * tests/stty/basic-1: Likewise.
7045 * tests/rm/deep-1: Likewise.
7046 * tests/mv/part-symlink: Likewise.
7047 * tests/mkdir/perm: Likewise.
7048 * tests/misc/nice: Likewise.
7050 2003-05-13 Jim Meyering <jim@meyering.net>
7052 * src/copy.c (struct F_triple) [name]: Remove const attribute.
7053 (triple_free): Don't apply cast to argument of free.
7054 (seen_file): Add cast here instead.
7056 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
7057 (src_to_dest_free): Don't apply cast to argument of free.
7059 * src/sort.c (zaptemp): Don't apply cast to argument of free.
7060 * src/pr.c (init_fps, init_store_cols): Likewise.
7061 * src/join.c (delseq, freeline): Likewise.
7062 * src/expr.c (OLD): Likewise.
7063 * src/sort.c (sort): Likewise.
7064 * src/head.c (elide_tail_lines_pipe): Likewise.
7066 * src/tail.c: Include "quote.h".
7067 Use quote in diagnostics. Change many error format strings
7068 from just `%s' to e.g., `error reading %s'.
7069 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
7070 Rewrite newline-counting loop to use memchr.
7072 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
7073 Now that assert is no longer used, don't include <assert.h>.
7075 2003-05-12 Jim Meyering <jim@meyering.net>
7077 * src/head.c: Include <assert.h>.
7078 (AUTHORS): Add my name.
7079 (elide_tail_lines_pipe): New function.
7081 2003-05-10 Jim Meyering <jim@meyering.net>
7083 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
7085 * src/readlink.c (main): Set program_name before first use.
7086 Remove that (redundant) first use.
7087 Don't exit successfully just because --verbose was specified.
7088 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
7089 parameter is 0, error does not exit.
7091 * src/uname.c (main): When failing due to too many arguments, also say
7092 that, rather than just "Try `uname --help' for more information.".
7093 * src/comm.c (main): Likewise, but for too few arguments.
7094 * src/logname.c: Include error.h.
7095 (main): Say why we're failing.
7097 * src/uniq.c (main): Don't segfault when argc < optind.
7098 * src/who.c (main): Handle argc < optind.
7099 * src/df.c (main): Likewise.
7100 * src/install.c (main): Likewise.
7101 * src/mv.c (main): Likewise.
7102 * src/pwd.c (main): Likewise.
7103 * src/tty.c (main): Likewise.
7104 * src/chroot.c (main): Likewise.
7105 * src/hostname.c: Likewise.
7106 * src/du.c (main): Likewise.
7107 * src/expand.c (main): Likewise.
7108 * src/env.c (main): Likewise.
7109 * src/unexpand.c (main): Likewise.
7110 * src/printenv.c (main): Likewise.
7111 * src/sync.c (main): Handle argc == 0.
7112 * src/expr.c (main): Likewise.
7113 * src/printf.c (main): Likewise.
7114 * src/basename.c (main): Likewise.
7115 * src/ln.c (main): Test for `missing argument' before computing n_files.
7116 * src/tail.c (main): Test for the case of no arguments before
7119 * src/kill.c (send_signals): Don't check command line arguments here.
7120 (main): Check them here instead. Handle argc < optind.
7122 * src/logname.c (main): Use error, rather than fprintf, for the sake
7125 * src/rm.c (main): Don't overrun array bound if argc is 0.
7127 2003-05-09 Jim Meyering <jim@meyering.net>
7129 * src/sort.c (main): Don't overrun array bound if argc is 0.
7130 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
7131 Reported by Wartan Hachaturow.
7133 2003-05-07 Jim Meyering <jim@meyering.net>
7135 Implement support so that `head --lines=-N' works on seekable files.
7136 * src/head.c (enum Copy_fd_status): Define.
7137 (COPY_FD_DIAGNOSE): New macro.
7138 (elide_tail_lines_seekable): New funtion.
7139 (elide_tail_lines_file): Call it here.
7141 2003-05-06 Jim Meyering <jim@meyering.net>
7143 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
7145 2003-05-04 Jim Meyering <jim@meyering.net>
7147 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
7148 caused the addition of thousands of small files to the tar archive.
7149 * tests/misc/head-elide-tail: New file. Add them here instead.
7150 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
7152 2003-05-04 Paul Eggert <eggert@twinsun.com>
7154 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
7155 (IF_READDIR_NEEDS_REWINDDIR): Remove.
7156 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
7157 which was a bit weird because it couldn't be emulated by a function.
7159 2003-05-03 Jim Meyering <jim@meyering.net>
7161 Extend head to accept --lines=-N (--bytes=-N) and to print all
7162 but the N lines (bytes) at the end of the file.
7163 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
7164 Use quote() in diagnostics, rather than literal `' marks.
7165 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
7167 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
7168 (head_file): Reorganize so as to call head from only one place.
7169 (main): Likewise, for head_file.
7170 Handle new, undocumented option, --presume-input-pipe.
7171 Handle negative line and byte counts.
7172 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
7174 * tests/du/8gb: Skip test if the file system of `.' doesn't support
7175 sparse files -- otherwise it'd create a file of size 8GB.
7177 2003-05-02 Jim Meyering <jim@meyering.net>
7179 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
7180 Instead explain about `-' and standard input.
7181 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
7182 Reported by Keith Thompson.
7183 * tests/fmt/basic: Add test for the above fix.
7185 * src/fmt.c: Include "quote.h".
7186 Use quote() in diagnostics, rather than literal `' marks.
7187 (main): Exit nonzero when unable to open an input file.
7188 * tests/fmt/basic: Add test for the above fix.
7190 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
7191 specifications like `-72x'.
7192 * tests/fmt/basic: Add test for the above fix.
7194 Work around nasty readdir bug on Darwin6.5.
7195 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
7196 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
7197 returned NULL and there has been at least one successful unlink or
7198 rmdir call since the opendir or previous rewinddir, then call
7199 rewinddir and reiterate the loop.
7201 Factor out common code.
7202 * src/remove.c (readdir_ignoring_dotdirs): New function.
7203 (is_empty_dir): Use it here.
7204 (remove_cwd_entries): Use it here.
7206 2003-05-01 Jim Meyering <jim@meyering.net>
7208 * tests/rm/r-3: Create 500 rather than just 300 files.
7209 There's a bug in Darwin6.5's readdir that shows up only with
7211 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
7215 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
7216 (dump_remainder): Move two declarations `down' into the scope
7217 where they are used.
7218 (xlseek): Return the resulting offset.
7219 (file_lines): Rename parameter, file_length, to end_pos.
7220 (pipe_lines): Don't coerce safe_read return value to `int'.
7221 Adapt tests accordingly.
7222 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
7224 Change type of `total_bytes' from `int' to `size_t',
7225 since the former wouldn't always be wide enough.
7226 Don't coerce safe_read return value to `int',
7227 and adapt tests accordingly.
7228 Now that testing for a read error no longer involves
7229 using `tmp', handle that case *after* freeing `tmp'.
7230 (start_bytes): Clean up.
7231 (tail_bytes): Now that `n_bytes' may be larger than
7232 OFF_T_MAX, test for that condition and, if it's true, don't
7233 use lseek optimizations.
7234 (parse_options): Don't fail just because N_UNITS is larger than
7235 the maximum size of a file -- tail may be applied to an input
7236 stream (e.g., a pipe) with more data than that.
7238 * Makefile.maint (syntax-check): Rename from alloc-check.
7239 Also check for SPACE-TAB sequences.
7240 Also check for malloc/calloc/realloc casts.
7242 2003-05-01 Jim Meyering <jim@meyering.net>
7244 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
7246 2003-04-28 Jim Meyering <jim@meyering.net>
7248 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
7249 make the now-more-picky tsort fail.
7251 2003-04-24 Jim Meyering <jim@meyering.net>
7253 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
7254 (main): Minor syntactic clean-up.
7256 * src/tsort.c (tsort): Fail if the input contains an odd number of
7257 tokens. Reported by junkio@cox.net.
7259 * tests/tsort/basic-1: Test for the above fix.
7261 2003-04-21 Jim Meyering <jim@meyering.net>
7263 * tests/misc/printf: Add tests for the printf fixes below.
7265 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
7267 2003-04-20 Paul Eggert <eggert@twinsun.com>
7269 Fix printf POSIX compatibility bug reported by Ben Harris in
7270 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
7271 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
7272 \0NNN in the %b operand.
7273 * src/printf.c (usage): Likewise.
7274 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
7275 is desired. All uses changed. Behave like Bash printf if %b
7276 operand uses \NNN where the initial N is not 0.
7278 2003-04-17 Jim Meyering <jim@meyering.net>
7280 * src/stty.c: Remove uses of PROTOTYPE macro.
7282 2003-04-15 Jim Meyering <jim@meyering.net>
7284 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
7285 each sequence of spaces before a TAB character.
7287 2003-04-13 Jim Meyering <jim@meyering.net>
7289 * src/remove.c (is_empty_dir): Don't closedir (NULL).
7291 2003-04-12 Jim Meyering <jim@meyering.net>
7293 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
7294 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
7295 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
7296 * src/nl.c (main): Fix those problems and remove literal quote marks
7297 (e.g., "`%s'") from format string; instead use "%s" in each format
7298 string and `quote (optarg)' as the corresponding argument.
7299 Also, diagnose all invalid command line options before failing.
7301 * src/nl.c (proc_text): Fix a bug that would make nl output extra
7302 newlines in some cases. Details here: http://bugs.debian.org/177256.
7303 This bug was introduced on 2001-11-10 for textutils-2.0.17.
7304 * tests/misc/nl: Add test for the above-fixed bug.
7306 * tests/misc/readlink: New file. Test the --canonicalize option.
7307 * tests/misc/Makefile.am (TESTS): Add readlink.
7309 2003-04-11 Jim Meyering <jim@meyering.net>
7312 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
7313 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
7314 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
7315 retain alignment) each sequence of spaces before a TAB character.
7317 * src/ls.c: Include <stdlib.h> unconditionally.
7319 * Makefile.maint (xalloc-check): Rename from header-check.
7321 * src/yes.c: Include error.h after system.h, not before.
7324 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
7325 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
7326 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
7327 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
7328 * src/tr.c: * src/unexpand.c, src/users.c:
7329 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
7330 return values and of xrealloc's first argument.
7331 Fix the former with this:
7332 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
7334 2003-04-10 Jim Meyering <jim@meyering.net>
7336 * src/stty.c (wrapf): Declare with format attribute.
7338 The S_MAGIC_... names shouldn't be maintained in two places (prior
7339 to this change, one would have to keep stat.c and fs.h in sync).
7340 This change makes it so those names and the corresponding
7341 hexadecimal constants all reside in stat.c. fs.h is now generated.
7342 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
7343 (BUILT_SOURCES): Add fs.h, now that it's generated.
7344 (EXTRA_DIST): Add extract-magic.
7345 * src/extract-magic: New script to extract fs.h definitions from stat.c.
7346 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
7347 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
7349 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
7350 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
7352 * man/unexpand.x: Add `SEE ALSO' reference to expand.
7353 * man/expand.x: Add `SEE ALSO' reference to unexpand.
7354 Suggestion from Dan Jacobson.
7356 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
7358 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
7359 * src/stat.c (human_fstype): Handle Linux's devpts.
7361 2003-04-09 Paul Eggert <eggert@twinsun.com>
7363 * src/split.c (line_bytes_split): Arg is of type size_t, since
7364 that's all that is supported for now.
7365 (main): Check for overflow in obsolescent line count option.
7367 2003-04-09 Jim Meyering <jim@meyering.net>
7369 * tests/misc/split-fail: Add a new test for the above fix.
7371 * src/split.c (bytes_split): Use size_t temporary (rather than
7372 uintmax_t original) in remaining computations. From Paul Eggert.
7374 Handle command line option arguments larger than 2^31.
7375 This allows e.g., splitting into files of size 2GB and larger,
7376 and running split --lines=N with N=2^31 or more.
7377 But for --line-bytes=N, the restriction that N <= SIZE_MAX
7378 remains (for now), due to the way it is implemented.
7380 * src/split.c: Include "inttostr.h".
7381 (bytes_split, lines_split, line_bytes_split, main):
7382 Use uintmax_t, not size_t, for file sizes.
7383 (main): Give a better diagnostic for option arguments == 0.
7384 Use umaxtostr to print file sizes.
7385 Reported by Luke Hassell.
7387 2003-04-08 Jim Meyering <jim@meyering.net>
7389 * src/rm.c (usage): Mention that --directory (-d) works only
7390 on some systems. Suggestion from Samuel Tardieu.
7392 * tests/basename/basic: Run $PERL to see if it is available,
7393 rather than testing its value.
7394 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
7395 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
7396 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
7397 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
7398 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
7399 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
7400 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
7401 * tests/sum/basic-1, tests/seq/basic: Likewise.
7403 * tests/misc/Makefile.am (TESTS): Add split-fail.
7404 * tests/misc/split-fail: New file.
7406 * src/split.c: Rename local variables: nchars -> n_bytes.
7407 (lines_split): Rename local, nlines -> n_lines.
7408 (main): Rename local variable: s/accum/n_units/.
7409 (main): Use STDIN_FILENO, not literal `0'.
7411 2003-04-07 Jim Meyering <jim@meyering.net>
7413 * src/stat.c: Add #include directives for Ultrix 4.4.
7414 Based on a suggested change from Bert Deknuydt.
7416 2003-04-06 Jim Meyering <jim@meyering.net>
7418 * Makefile.maint (makefile-check): New rule.
7419 (local-check): Add it.
7421 2003-04-05 Jim Meyering <jim@meyering.net>
7423 * Makefile.am (nearly all of them):
7424 Use $(VAR) rather than @VAR@, now that we can rely on automake to
7425 emit a definition for each substituted variable.
7426 * tests/Makefile.am.in: Likewise.
7428 * tests/rm/rm5: Add a comment explaining why this test fails when
7429 using Tru64's broken sed.
7430 * tests/rm/rm3: Likewise.
7432 Make `kill -t' output signal descriptions (not `?') on Tru64.
7433 * src/kill.c (sys_siglist): Also check for __sys_siglist.
7434 Patch by Tony Leneis.
7435 * configure.ac: Also check for declaration of __sys_siglist.
7436 Required for Tru64 4.0D, 4.0F, and 5.1.
7437 Reported by Tony Leneis.
7439 2003-04-04 Jim Meyering <jim@meyering.net>
7441 * src/Makefile.am (PERL): Remove unnecessary definition.
7443 Because of inappropriate (but POSIX-mandated) behavior of rename,
7444 `mv a b' would not remove `a' in some unusual cases. Work around
7445 this by unlinking `a' when necessary.
7447 * src/copy.c (same_file_ok): Add an output parameter.
7448 Set it in the offending case.
7449 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
7450 Reported by Ed Avis.
7451 * tests/mv/hard-4: New test for the above.
7452 * tests/mv/Makefile.am (TESTS): Add hard-4.
7454 Clean up rules for automatically generated sources:
7455 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
7456 Make each generated file be read-only.
7457 Add each file name to BUILT_SOURCES separately.
7458 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
7460 Put LOCALEDIR macro definition in new file: localedir.h.
7461 * src/Makefile.am (DEFS): Remove definition.
7462 (localedir.h): New rule.
7463 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
7464 * src/system.h: Include "localedir.h".
7466 2003-04-02 Jim Meyering <jim@meyering.net>
7470 * tests/misc/Makefile.am (TESTS): Add false.
7472 * Makefile.maint (TMPDIR): Make sure it's defined.
7473 (my-distcheck): Build in $(TMPDIR), not `.'.
7475 * src/Makefile.am (false.c): Change all occurrences of
7476 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
7477 unsuccessfully also with --help. Reported by Paul Jarc,
7478 * tests/misc/false: New test for the above.
7480 2003-03-30 Jim Meyering <jim@meyering.net>
7482 * NEWS: Note the location of older NEWS files.
7484 * src/remove.c (is_empty_dir): Don't let a failing closedir
7485 clobber errno. Spotted by Arnold Robbins.
7487 * src/env.c: Fix typo in comment. From Arnold Robbins.
7489 2003-03-29 Jim Meyering <jim@meyering.net>
7493 * README: Note to expect build problems for stat.c on Ultrix 4.3.
7494 Note that there are some harmless test failures when running
7495 `make check' as root on some systems.
7497 2003-03-28 Jim Meyering <jim@meyering.net>
7499 * tests/stty/row-col-1: Skip this test if stty can't get window size.
7500 This happens when connecting to sparc-solaris5.7 via ssh from within
7501 emacs. Reported by Karl Berry.
7503 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
7504 Otherwise, on systems (DJGPP) that emulate pipes using files,
7505 this test would never complete, waiting for `yes' to terminate.
7506 * tests/du/slink: As above, use seq, not `yes' to generate link target.
7507 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
7508 Reported by Rich Dawe.
7510 2003-03-27 Jim Meyering <jim@meyering.net>
7512 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
7513 from `written by...' comment, at his request.
7515 2003-03-24 Paul Eggert <eggert@twinsun.com>
7517 Fix buffer overrun problem reported by TAKAI Kousuke, along
7518 with some other POSIX incompatibilities.
7520 * src/printf.c (print_esc): Do not treat \x specially if
7521 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
7522 in backslash. Treat incomplete escape sequences as strings
7523 of characters, as POSIX requires.
7524 (print_formatted): Allow multiple flags. Avoid buffer overrun
7525 if the format is incomplete.
7527 2003-03-24 Jim Meyering <jim@meyering.net>
7529 * tests/misc/printf: Add tests for the above fixes and changes.
7531 2003-03-26 Jim Meyering <jim@meyering.net>
7533 * src/copy.h (struct cp_options): Add a comment.
7535 2003-03-23 Jim Meyering <jim@meyering.net>
7537 * README: Describe problem with 64-bit mode on HPUX 11.x,
7538 with patch for /usr/include/inttypes.h.
7539 * TODO: Plan to add an autoconf test to work around the bug.
7541 2003-03-22 Jim Meyering <jim@meyering.net>
7543 * src/stat.c: Don't include <sys/sysmacros.h>.
7544 That is already done via system.h. Otherwise, the multiple
7545 inclusion would evoke redefinition warnings from Cray's /bin/cc,
7546 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
7547 (human_fstype): Factor some directives `up', out of this function.
7548 Cast away `const' to avoid error from Cray's /bin/cc.
7550 2003-03-20 Jim Meyering <jim@meyering.net>
7552 * announce-gen (print_changelog_deltas): Ensure that a newline
7553 precedes each row of `*'s.
7555 2003-03-20 Jim Meyering <jim@meyering.net>
7559 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
7560 format flag characters.
7561 Do not require that a field width be specified.
7562 Do not fail when given a field width of `0'.
7563 Reported by Dan Jacobson.
7564 * tests/seq/basic: Add new tests for the above-fixed bug.
7566 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
7567 (install-root): Likewise.
7568 (install-exec-local): Likewise.
7569 Based on a patch from Richard Dawe.
7571 2003-03-19 Jim Meyering <jim@meyering.net>
7573 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
7574 because the DJGPP 2.03 port of 'ln -s' doesn't work.
7575 Include $(EXEEXT) in program names.
7576 Since $(LN_S) may degenerate to `cp -p', be careful
7577 to invoke it from the destination directory.
7578 Mostly from Richard Dawe.
7579 * configure.ac: Use AC_PROG_LN_S.
7581 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
7582 CDPATH shell variable set could cause this test to fail.
7583 Reported by Karl Berry.
7585 2003-03-18 Jim Meyering <jim@meyering.net>
7587 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
7588 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
7589 AIX 5.1's xlc could not compile the former.
7590 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
7592 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
7594 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
7595 program names, since automake only adds $(EXEEXT) to programs
7598 2003-03-16 Jim Meyering <jim@meyering.net>
7600 * src/remove.c (rm): Put two local variables in static storage,
7601 so they can't be clobbered by the potential longjmp.
7603 2003-03-15 Jim Meyering <jim@meyering.net>
7605 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
7606 so that a version number with a two-digit component can still count
7607 as an alpha release. Reported by Richard A Downing.
7608 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
7610 2003-03-14 Jim Meyering <jim@meyering.net>
7612 * src/ansi2knr.c: Remove no-longer-used file.
7613 * src/ansi2knr.1: Likewise.
7615 * Makefile.maint (prev_version_file): Don't use ?= for this particular
7616 assignment, since it causes trouble with old versions of GNU make
7617 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
7618 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
7619 Patch from Alexandre Duret-Lutz.
7621 * Use patched automake-1.7.3. Regenerate Makefile.in files in
7622 subdirectories so that each includes a definition of ACLOCAL_M4.
7624 * announce-gen (main): Label the compressed source URLs.
7628 * tests/du/slink: Relax the test for the `local'ness of a file system,
7629 so that now it works also for tmpfs.
7631 * tests/du/hard-link: Transform output from first du, so that this
7632 test doesn't fail on file systems like tmpfs that order directory
7633 entries differently.
7635 2003-03-13 Jim Meyering <jim@meyering.net>
7637 * tests/du/8gb: Work around what appears to be an NFS failure that
7638 would make this test fail on some systems.
7640 2003-03-11 Jim Meyering <jim@meyering.net>
7642 * tests/du/basic: Make the test file exactly 4k bytes long.
7644 * src/split.c (longopts): Don't hard-code `2' here.
7645 Instead, just specify `&verbose', and ...
7646 (main): ... remove the `case 2:' block for --verbose.
7648 * tests/du/basic: Make the test file larger than 64 bytes, so that
7649 we don't immediately disqualify file systems (e.g., NetApp) on which
7650 smaller files take up zero disk blocks. Reported by Vin Shelton.
7652 2003-03-10 Jim Meyering <jim@meyering.net>
7654 Don't segfault for a negative field width or precision in format string.
7655 Note that this is just a stopgap fix. The longer term solution may
7656 involve adapting bash's builtins/printf.def.
7658 * src/printf.c: (UNSPECIFIED): Define.
7659 (print_direc): Use the special value, UNSPECIFIED, to indicate
7660 that field_width or precision has not been specified.
7661 (print_formatted): Fail if field_width or precision is the
7662 special value, UNSPECIFIED.
7663 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
7665 * src/sys2.h (INT_MIN): Define, if necessary.
7666 * tests/misc/printf: Add a test for the above-fixed bug.
7668 2003-03-09 Jim Meyering <jim@meyering.net>
7670 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
7671 changing its sign. This avoids a warning from gcc on 64-bit systems.
7672 Reported by Bob Proulx.
7673 (pop_dir): Reverse order of sign change and cast, to be consistent
7676 2003-03-08 Jim Meyering <jim@meyering.net>
7678 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
7679 shell variable, but only in the environment. With /bin/sh->bash, the
7680 shell variable is set to `y', and that would cause a spurious warning.
7681 Reported by Bob Proulx.
7683 * tests/Makefile.am (check-root): Remove touch/fifo.
7684 It doesn't appear to have to be run as root.
7686 * tests/rm/fail-2eperm: Rather than simply using the first non-root
7687 user name, make sure that the selected user name has a usable shell.
7688 Reported by Paul Jarc.
7690 Before, when using shred on a device, one had to specify --exact,
7691 or be careful to choose a size that would not be rounded up and
7692 exceed the maximum value; that could result in a failure of
7694 * src/shred.c (do_wipefd): --exact is now the default for non-regular
7695 files. Suggestion from Ben Elliston.
7698 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
7699 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
7700 Patch by Bob Proulx.
7702 * src/Makefile.am (check-misc): Check for use of `defined' in
7704 Change to $(srcdir) before running grep.
7706 * src/sleep.c: Remove now-unused #include and #define directives.
7708 * src/du.c (process_file): If a file's size is not being counted
7709 e.g., because it's a hard link to a file we've already counted,
7710 then don't print a line for it.
7712 * tests/du/hard-link: New test for the above-fixed bug.
7713 * tests/du/Makefile.am (TESTS): Add hard-link.
7716 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
7717 and make the two-array approach work.
7719 * tests/du/basic: Correct/add tests for the above fix.
7720 Set LC_ALL, etc., now that we use sort.
7721 Check the block/size of a small file, too.
7722 Correct expected results for simple dir1/dir2/file case.
7723 Add another test of du -S.
7725 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
7727 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
7728 middle-end/9986). As one of GCC's optimizations, it transforms a
7729 fputs_unlocked call to a fputc_unlocked call when the string is
7730 one character long. However, hpux doesn't have fputc_unlocked.
7732 * expr.c (usage): Use putchar, not fputs, to output a single character.
7733 * ls.c (dired_dump_obstack): Likewise.
7734 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
7735 * stat.c (print_it): Likewise.
7737 2003-03-07 Jim Meyering <jim@meyering.net>
7739 * src/cp.c: Remove everything associated with mmap-stack.c.
7740 This reverts the two changes of 2003-02-21.
7741 * src/du.c: Remove everything associated with mmap-stack.c.
7742 This reverts the change of 2003-02-19.
7744 2003-03-06 Jim Meyering <jim@meyering.net>
7746 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
7747 CDPATH shell variable set could cause this test to fail.
7748 Reported by Karl Berry.
7750 2003-03-05 Jim Meyering <jim@meyering.net>
7754 * src/printf.c (print_esc): Remove pointless comparison of unsigned
7755 integer with zero, to avoid a warning from Intel's ecc.
7756 Reported by Nelson Beebe.
7758 * src/du.c (process_file): Sizes must all be of type uintmax_t.
7759 Otherwise, for files or totals that are too big, numbers would
7760 be truncated. Patch mostly by Michael Stone.
7761 Reported by Ingo Saitz as Debian bug #183210.
7763 * tests/du/8gb: New test for the above-fixed bug.
7764 * tests/du/Makefile.am (TESTS): Add 8gb.
7766 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
7767 rather than UTILS_OPEN_MAX - 10.
7769 2003-03-04 Jim Meyering <jim@meyering.net>
7771 * README: Refer new feature discussion to bug-coreutils@gnu.org,
7772 rather than bug-gnu-utils, now that the former is better known.
7773 Suggestion from Göran Uddeborg.
7775 * src/stat.c (usage): Capitalize consistently.
7776 Reported by Göran Uddeborg.
7778 * Makefile.maint (rel-files): Include $(signatures), so that
7779 those files are also copied into $(release_archive_dir).
7781 * src/df.c (find_mount_point): Call error here, now that restore_cwd
7783 * src/remove.c (AD_pop_and_chdir): Likewise.
7785 * tests/Makefile.am (check-root): Add fail-2eperm.
7787 2003-03-03 Jim Meyering <jim@meyering.net>
7789 * src/remove.c (remove_cwd_entries): Include the full filename of
7790 the offending file, not just the basename.
7792 * tests/misc/tty-eof: Set $ME properly.
7794 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
7795 Remove now-unused variables.
7796 (tag-prev-version, prev-cvs-tag): Likewise.
7798 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
7799 accurate diagnostic when failing to remove a file owned by some other
7800 user. Reported by Ivo Timmermans via Michael Stone.
7801 This fixes Debian bug# 178471.
7803 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
7804 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
7805 Based on a report from Ivo Timmermans.
7807 2003-03-02 Jim Meyering <jim@meyering.net>
7809 * src/copy.c (copy_internal) [un_backup]: When recovering from a
7810 failure to create a hard link, do not remove the entry associating
7811 the source dev/ino with the destination file name.
7812 * tests/mv/Makefile.am (TESTS): Add hard-3.
7813 * tests/mv/hard-3: New test, for the above-fixed bug.
7814 Inspired by a report from Iida Yosiaki.
7816 2003-03-01 Jim Meyering <jim@meyering.net>
7818 * src/df.c (print_header): Don't embed spaces in a separate `Type'
7819 header string. Instead, put `Filesystem' and `Type' headers in the
7820 same string, so translators can use horizontal space as needed.
7821 Reported by Jean Charles Delepine.
7823 2003-02-28 Jim Meyering <jim@meyering.net>
7825 * src/copy.c (copy_internal): When link fails because of an
7826 existing destination file, unlink that file and try again.
7827 Reported by Iida Yosiaki.
7829 * tests/mv/Makefile.am (TESTS): Add hard-2.
7830 * tests/mv/hard-2: New test for the above-fixed bug.
7831 Based on a test case from Iida Yosiaki.
7833 2003-02-26 Jim Meyering <jim@meyering.net>
7835 * tests/du/basic: Don't test du's -b option here. Directory byte
7836 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
7837 and IBM AIX 4.2. Reported by Nelson Beebe.
7839 2003-02-25 Jim Meyering <jim@meyering.net>
7841 * Makefile.maint (announcement): Now that ChangeLog entries
7842 are output by announce-gen, don't do it here.
7843 * announce-gen (print_changelog_deltas): New function.
7846 2003-02-22 Jim Meyering <jim@meyering.net>
7848 * announce-gen: New option: --release-type=TYPE
7849 * Makefile.maint (beta, major): New targets. Remove `release'.
7850 Put them all together on a line.
7851 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
7852 invocation of `announcement'.
7853 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
7855 * announce-gen: New option: --news=NEWS_FILE.
7856 Extract NEWS entries here, not via rules in Makefile.maint.
7857 * Makefile.maint (announcement): Now that NEWS entries are
7858 extracted by announce-gen, don't do it here.
7859 (news-r1, news-r2): Remove now-unused definitions.
7861 2003-02-21 Jim Meyering <jim@meyering.net>
7865 Merge in changes from autoconf's version of this file.
7866 * Makefile.maint (www-gnu): Define.
7867 (standards.texi-url_prefix): Use $(www-gnu).
7868 (make-stds.texi-url_prefix): Likewise.
7870 * src/cp.c: Include "mmap-stack.h".
7871 (main): Invoke `run' through a macro that (when possible) runs it
7872 with a large, mmap'd stack.
7874 * src/cp.c (run): New function, preparing for the above.
7875 Exit from this function, not from main
7878 * src/du.c: New option: --apparent-size.
7879 (enum) [APPARENT_SIZE_OPTION]: New member.
7880 (long_options): Add it.
7881 (usage): Describe it.
7883 ['b']: Set apparent_size.
7884 David Eisner reported that the behavior of --bytes had changed.
7885 Paul Eggert proposed the use of a new option, --apparent-size.
7887 * src/du.c (apparent_size): New global.
7888 (print_only_size): Reflect the fact that we're printing byte counts,
7889 not ST_NBLOCKSIZE-byte-block counts.
7890 (print_size): Call print_only_size rather than duplicating its code.
7891 (process_file): Accumulate byte counts, rather than block counts.
7893 * src/du.c (process_file): Always reset size_to_propagate_to_parent
7894 for --separate-dirs (-S).
7896 2003-02-20 Jim Meyering <jim@meyering.net>
7898 * Use automake-1.7.3. Regenerate dependent files.
7900 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
7901 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
7902 (usage) [%B]: Describe it.
7905 * src/du.c (process_file): Reorganize the code to use only
7906 one `sum' array, and change how -S works back to the way it was
7907 before 2003-01-31. Patch by Bruno Haible.
7909 * tests/du/basic: New test.
7910 * tests/du/Makefile.am (TESTS): Add basic.
7912 * tests/envvar-check: Add checks for the following:
7913 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
7915 * tests/Makefile.am: Rename phony target envvar-check to evar-check
7916 so as not to conflict with the distributed file by the same name.
7918 * src/du.c (process_file): Set info->skip before any possible return.
7920 Report correct usage for directories, not 0.
7921 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
7922 _before_ recording the dev/ino of a directory.
7923 Reported by Bruno Haible.
7925 Now, df always displays the device file name corresponding to the
7926 listed mount point under `Filesystem'. Before, for an unmounted
7927 block- or character-special file argument, it would display the
7928 command-line argument instead.
7929 * src/df.c (show_disk): Return a value indicating whether
7930 there was a match. Don't try to find a mount point here.
7931 (show_entry): If show_disk doesn't find a match, call show_point.
7933 2003-02-19 Jim Meyering <jim@meyering.net>
7935 * src/du.c: Include "mmap-stack.h".
7936 (du_files): Add prototype with ATTRIBUTE_NORETURN.
7937 Exit from this function, not from...
7939 Instead, if possible, invoke du_files through a macro that
7940 runs it with a large, mmap'd stack.
7942 * src/join.c (usage): Change wording in --help output:
7943 use FILENUM instead of `SIDE' and say what FILENUM means.
7944 Reported by Bernhard Gabler.
7946 * src/df.c (print_header): Rather than using a hard-coded literal
7947 string of spaces matching the length of the English `...Type' header,
7948 output the right number of spaces to match the selected translation.
7949 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
7951 * src/split.c (bytes_split): Remove unnecessary `else' after break.
7952 (lines_split): Likewise. and correct misleading indentation.
7954 * src/split.c: Include "full-read.h".
7955 (bytes_split, lines_split, line_bytes_split): Use full_read,
7956 not safe_read. The way split was using the latter, a short read
7957 could cause split to terminate before EOF.
7959 * tests/misc/tty-eof: Test all programs that can read stdin,
7960 requiring no arguments and that write to standard output.
7962 * tests/misc/tty-eof: New file. Renamed from ...
7963 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
7964 * tests/misc/Makefile.am (TESTS): Reflect renaming.
7966 2003-02-18 Jim Meyering <jim@meyering.net>
7968 cksum would perform an extra read after encountering EOF
7969 * src/cksum.c (cksum): Exit the loop upon EOF, too.
7970 Patch by Michael Bacarella.
7972 Test for the bug fixed today in cksum, md5sum, and sha1sum.
7973 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
7974 cat, cksum, md5sum, and sha1sum all in the same loop.
7976 2003-02-14 Jim Meyering <jim@meyering.net>
7978 * src/remove.c: Include "euidaccess.h".
7979 Remove declaration of euidaccess.
7981 2003-02-12 Jim Meyering <jim@meyering.net>
7983 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
7984 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
7986 2003-02-10 Jim Meyering <jim@meyering.net>
7988 * src/test.c: Don't include group-member.h.
7989 Include euidaccess.h.
7990 (eaccess): Rewrite function to set the real uid and gid temporarily
7991 to the effective uid and gid, then invoke 'access', and then set the
7992 real uid and gid back. On systems that lack setreuid or setregid,
7993 fall back on the kludges in euidaccess. Before, it would not work
7994 for e.g., files with ACLs, files that were marked immutable,
7995 or on file systems mounted read-only. Nelson Beebe raised the issue.
7996 Paul Eggert suggested the new implementation.
7998 2003-02-09 Jim Meyering <jim@meyering.net>
8000 * src/test.c (test_stat): Remove function. It's job is done (only
8001 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
8003 2003-02-08 Jim Meyering <jim@meyering.net>
8007 * tests/mv/part-symlink: Don't assume that the file owner username
8008 length is less than 9 in ls output: instead, omit that field
8009 altogether. Reported by, and suggested fix from, Ferdinand.
8011 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
8012 * tests/du/Makefile.am (TESTS): Add restore-wd.
8014 * src/rm.c: Correct now-invalid comment about cycle-detection.
8016 2003-02-06 Jim Meyering <jim@meyering.net>
8018 * NEWS: Add entries from old/*/NEWS
8019 from fileutils-4.1 through 4.1.11 and
8020 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
8024 * src/du.c (process_file): Don't return early for excluded files
8025 or for files whose dev/inode we've already seen.
8027 2003-02-05 Jim Meyering <jim@meyering.net>
8029 * tests/du/exclude: New file.
8030 * tests/du/Makefile.am (TESTS): Add exclude.
8032 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
8034 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
8035 Fix memory allocation arithmetic.
8037 2003-02-04 Jim Meyering <jim@meyering.net>
8039 `df /dev/block-or-char-device-file--not-mounted' now reports
8040 the name of the file system on which the file resides, usually `/'.
8041 Before, it would leave the `Mounted on' field blank.
8042 * src/df.c (show_disk): Move function to precede find_mount_point.
8043 (show_disk): Add parameter: STATP.
8044 If we don't find a matching device name, then resort to calling
8045 find_mount_point. Reported by Bob Proulx.
8047 2003-02-03 Andreas Schwab <schwab@suse.de>
8049 * tests/rm/cycle: Require non-root.
8050 * tests/rm/isatty: Likewise.
8052 2003-02-02 Jim Meyering <jim@meyering.net>
8056 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
8058 Ensure that there are no offending uses of `:'.
8059 * Makefile.maint (makefile_path_separator_check): New rule.
8060 (local-check): Add it to the list.
8062 2003-02-01 Jim Meyering <jim@meyering.net>
8064 * src/du.c (MAX_N_DESCRIPTORS): Define.
8066 * src/stat.c (G_fail): New global.
8067 (human_time): Diagnose failed localtime, not failed nstrftime.
8068 (main): Fail if G_fail is set.
8070 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
8072 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
8073 hard-coding the path-separator. Also double-quote the new PATH,
8074 to avoid problems when the path-separator is a semi-colon or when
8075 `pwd` contains e.g. a space.
8076 * tests/chgrp/Makefile.am: Likewise.
8077 * tests/chmod/Makefile.am: Likewise.
8078 * tests/chown/Makefile.am: Likewise.
8079 * tests/cp/Makefile.am: Likewise.
8080 * tests/dd/Makefile.am: Likewise.
8081 * tests/dircolors/Makefile.am: Likewise.
8082 * tests/du/Makefile.am: Likewise.
8083 * tests/expr/Makefile.am: Likewise.
8084 * tests/factor/Makefile.am: Likewise.
8085 * tests/fmt/Makefile.am: Likewise.
8086 * tests/install/Makefile.am: Likewise.
8087 * tests/ln/Makefile.am: Likewise.
8088 * tests/ls/Makefile.am: Likewise.
8089 * tests/ls-2/Makefile.am: Likewise.
8090 * tests/md5sum/Makefile.am: Likewise.
8091 * tests/misc/Makefile.am: Likewise.
8092 * tests/mkdir/Makefile.am: Likewise.
8093 * tests/mv/Makefile.am: Likewise.
8094 * tests/od/Makefile.am: Likewise.
8095 * tests/rm/Makefile.am: Likewise.
8096 * tests/rmdir/Makefile.am: Likewise.
8097 * tests/seq/Makefile.am: Likewise.
8098 * tests/sha1sum/Makefile.am: Likewise.
8099 * tests/shred/Makefile.am: Likewise.
8100 * tests/stty/Makefile.am: Likewise.
8101 * tests/sum/Makefile.am: Likewise.
8102 * tests/tail-2/Makefile.am: Likewise.
8103 * tests/touch/Makefile.am: Likewise.
8104 * tests/tsort/Makefile.am: Likewise.
8105 * tests/unexpand/Makefile.am: Likewise.
8107 2003-01-31 Jim Meyering <jim@meyering.net>
8109 * src/stat.c: Include "file-type.h"
8110 (print_human_type): Remove function.
8111 (human_access): Rename from print_human_access. Return a string.
8112 (human_time): Rename from print_human_time. Return a string.
8113 (print_stat): Arrange so that field width and an alignment specifier
8114 are honored for the %A, %F, %x, %y, and %z formats.
8115 [%F]: Use file_type; this gives slightly different file type strings,
8116 e.g., `directory' instead of `Directory' and `regular file' or
8117 `regular empty file' instead of `Regular file'.
8118 Prompted by a report from Richard Dawe that the uses of
8119 S_IFSOCK and S_IFIFO in print_human_time were not portable
8120 to systems using e.g., DJGPP.
8122 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
8124 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
8125 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
8127 2003-01-31 Jim Meyering <jim@meyering.net>
8129 * src/du.c (main): Upon processing an invalid option or an invalid
8130 --exclude-from or --max-depth option argument, don't exit right away,
8131 in case there are others. Rather record the failure and exit after
8132 processing other options.
8134 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
8135 tar archive easier to reproduce.
8137 Rewrite to perform directory traversal using nftw.
8139 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
8140 (AUTHORS): Add self.
8141 (opt_one_file_system): Move global into `main'.
8142 (path, xstat, exit_status): Remove declarations.
8143 (arg_length, suffix_length): New globals.
8144 (G_fail): New global, sort of like the old `exit_status'.
8145 (IS_FTW_DIR_TYPE): Define.
8146 (print_only_size): New function.
8147 (process_file): New function.
8148 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
8149 (str_trunc, pop_dir, count_entry): Likewise.
8150 (du_files): Rewrite to use nftw.
8152 2003-01-30 Jim Meyering <jim@meyering.net>
8154 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
8155 symlink-to-directory with -L, even without the trailing slash.
8157 2003-01-27 Jim Meyering <jim@meyering.net>
8159 * src/Makefile.am (check-misc): Check for st_blocks, too.
8161 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
8162 Reported by Richard Dawe.
8164 2003-01-27 Andreas Schwab <schwab@suse.de>
8166 * src/ls.c (quote_name): Add fourth parameter, width, into which to
8167 store the screen columns, and return the number of bytes instead.
8168 (print_dir): Pass NULL as fourth parameter of quote_name.
8169 (print_name_with_quoting): Likewise.
8170 (length_of_file_name_and_frills): Get the width from the fourth
8171 parameter of quote_name instead of return value.
8173 2003-01-27 Jim Meyering <jim@meyering.net>
8175 * src/ls.c (decode_switches): If `dired' is set without
8176 `format == long_format', then silently reset dired. This doesn't
8177 change the behavior of ls (all prior uses of dired were protected
8178 by `&& format == long_format'), and lets us...
8179 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
8180 (PUSH_CURRENT_DIRED_POS): Likewise.
8183 2003-01-22 Jim Meyering <jim@meyering.net>
8185 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
8186 * tests/du/Makefile.am (TESTS): Add no-x.
8188 2003-01-21 Jim Meyering <jim@meyering.net>
8190 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
8191 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
8192 it may still be a directory -- or not (e.g., with FreeBSD on an
8193 NFS-mounted file system), so resort to calling lstat to find out.
8194 Based on a patch by Michael van Elst.
8196 * tests/cp/same-file: Don't assume that the file owner username
8197 length is less than 9 in ls output: instead, omit that field
8198 altogether. Reported by, and suggested fix from, Ferdinand.
8200 2003-01-20 Jim Meyering <jim@meyering.net>
8202 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
8203 large format widths no longer cause strftime to infloop.
8205 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
8207 2003-01-19 Jim Meyering <jim@meyering.net>
8209 * src/readlink.c: Include "canonicalize.h".
8211 2003-01-18 Jim Meyering <jim@meyering.net>
8213 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
8215 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
8216 (long_options): Add option --dereference-command-line-symlink-to-dir.
8217 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
8218 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
8219 -d, -F, -l options is specified.
8220 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
8221 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
8222 Change --dereference-command-line (-H) to dereference *all*
8223 command line arguments, including broken symlinks.
8225 2003-01-15 Paul Eggert <eggert@twinsun.com>
8227 Change ls -H back to the way it was yesterday, since this is
8228 compatible with FreeBSD and the POSIX spec is confusing
8229 and somewhat contradictory.
8231 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
8232 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
8233 (long_options): Change the long option name back.
8234 (usage): Change the usage back.
8235 (gobble_file): When -H is specified, dereference a top-level
8236 arg even if it points to a non-directory.
8238 2003-01-15 Jim Meyering <jim@meyering.net>
8240 * src/ls.c (gobble_file): Fall back on using lstat when required:
8241 when --dereference (-L) is not specified, and
8242 - when operating on a dangling symlink
8243 - when operating on command-line-symlink-to-directories
8244 This fixes numerous problems. Here are examples:
8245 - `ls dangling-symlink' would fail with `no such file...'
8246 Now it prints `dangling-symlink'.
8247 - `ls -i symlink' would mistakenly print the inode of the referent.
8248 Now it prints the inode of the symlink. Likewise for --size (-s).
8249 Based on a patch from Michael Stone.
8250 Reported by Deepak Goel as Debian bug #173793.
8252 Rename ls's --dereference-command-line (-H)
8253 option to --dereference-command-line-symlink-to-dir.
8254 * src/ls.c [enum Dereference_symlink]
8255 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
8256 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
8257 (long_options): Rename the long option.
8258 (usage): Say that --dereference-... changes how ls treats
8259 only symlinks to directories specified on the command line.
8261 2003-01-14 Jim Meyering <jim@meyering.net>
8263 * tests/ls/dangle: New file/test, for the above fix.
8264 * tests/ls/inode: Another new file/test, for the above fix.
8265 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
8267 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
8268 so that ls --color would no longer highlight the names of files with
8269 the execute bit set when not specified on the command line.
8270 Patch by Michael Stone. Reported by Stephen Depooter as
8273 * tests/ls-2/tests (color-exe): New test, for the above fix.
8275 2003-01-13 Jim Meyering <jim@meyering.net>
8277 * tests/shred/exact: Also test for just fixed bug with --zero.
8279 * src/shred.c (long_opts): --zero does not require an argument.
8280 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
8282 2003-01-12 Jim Meyering <jim@meyering.net>
8284 * Makefile.maint (cvs-update): Skip any file with local modifications.
8286 * src/unexpand.c (usage): Document --first-only and mention that
8287 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
8289 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
8291 * src/df.c: Include "canonicalize.h".
8292 Use canonicalize_file_name unconditionally.
8294 2003-01-09 Jim Meyering <jim@meyering.net>
8296 * README: Add readlink.
8298 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
8300 * src/df.c: Include "xgetcwd.h".
8301 * src/pwd.c: Likewise.
8303 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
8305 * src/shred.c: Remove declaration of xstrdup.
8306 We already get it via xalloc.h which is included via system.h.
8308 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
8310 New program: readlink.
8312 * src/Makefile.am (bin_PROGRAMS): Add readlink.
8313 * src/readlink.c: New file.
8315 * man/readlink.x: New file.
8316 * man/Makefile.am (dist_man_MANS): Add readlink.1.
8317 (readlink.1): New rule.
8319 2003-01-09 Jim Meyering <jim@meyering.net>
8321 When selecting ranges of byte offsets (as opposed to ranges of fields)
8322 and when --output-delimiter=STRING is specified, output STRING between
8323 ranges of selected bytes.
8324 * src/cut.c (RANGE_START_SENTINEL): Define.
8325 (output_delimiter_specified): New global.
8326 (print_kth): Add parameter. Adjust all callers.
8327 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
8328 (cut_bytes): When requested, output STRING between ranges of
8330 (main): Make a diagnostic a little clearer.
8331 Based on a patch from Jan Nieuwenhuizen.
8333 * tests/cut/Test.pm: New tests for the above.
8335 * src/cut.c (set_fields): Make code agree with comment:
8336 Don't merge abutting ranges like 4- and 2-3. This makes no
8337 difference currently, but is required to support an upcoming change.
8339 2003-01-07 Jim Meyering <jim@meyering.net>
8341 * src/cut.c (set_fields): Fix typo in comment.
8343 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
8344 * tests/touch/Makefile.am (TESTS): Add not-owner.
8345 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
8346 Now, this tests only the nonexistent-directory diagnostic.
8347 Suggestion from Michael Stone.
8349 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
8351 2003-01-04 Jim Meyering <jim@meyering.net>
8353 * src/copy.h: Remove use of PARAMS.
8354 * src/remove.h: Likewise.
8355 * src/chown-core.h: Likewise.
8357 rm could be tricked into mistakenly reporting a cycle.
8358 * src/remove.c: [cycle_check_state]: New global.
8359 (remove_cwd_entries): Adapt to new semantics of cycle_check.
8360 (rm): Call cycle_check_init and cycle_check_free for each file.
8361 * tests/rm/cycle (rm): New test, for the above fix.
8362 * tests/rm/Makefile.am (TESTS): Add cycle.
8364 When rm detects a cycle, don't abort the entire command,
8365 but rather just the affected command line argument.
8366 * src/remove.c: Include <setjmp.h>
8367 (struct dirstack_state) [current_arg_jumpbuf]: New member.
8368 (remove_cwd_entries): Call longjmp if we detect a cycle.
8369 (rm): Call setjmp here.
8371 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
8372 Instead, include cycle-check.h and use it.
8374 * src/remove.h (struct dev_ino): Remove declaration.
8376 * src/remove.c (remove_cwd_entries): Fix typos in comment.
8378 Don't include trailing /. in diagnostics about directories.
8379 * src/remove.c (full_filename_): When FILENAME is just `.'
8380 and there is a nonempty directory-name part, don't append `/.'.
8381 * tests/rm/unread2: Remove trailing /. from diagnostic.
8382 * tests/rm/rm2: Likewise.
8384 * src/remove.c (struct dirstack_state): Define.
8385 To be used in place of these file-scoped globals ...
8386 (dir_stack, len_stack, Active_dir): Remove globals.
8387 (ds_init, ds_free): New functions.
8388 (full_filename): Define.
8389 (full_filename_): Rename from full_filename.
8391 Begin to make AD_* functions more generic.
8392 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
8393 (AD_push): Likewise.
8394 (AD_INIT_OTHER_MEMBERS): Define.
8395 (remove_dir): Define the `status' member manually after each
8396 call to AD_push or AD_push_initial.
8398 * src/Makefile.am (check-misc): New rule, to ensure that no more
8399 S_IS* macro definitions sneak into the code.
8400 (check): Depend on check-misc.
8402 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
8403 * src/du.c (count_entry) [S_ISLNK]: Don't define.
8404 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
8406 2003-01-03 Jim Meyering <jim@meyering.net>
8408 * src/true.c: Add copyright.
8409 (AUTHORS): I suppose I've written it.
8411 * src/Makefile.am (false.c): Make the generated file be read-only.
8413 2003-01-04 Jim Meyering <jim@meyering.net>
8415 * src/ls.c: Include "dev-ino.h".
8416 [struct dev_ino]: Remove declaration.
8418 2003-01-02 Jim Meyering <jim@meyering.net>
8420 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
8421 from mv: s/missing file arguments/missing file argument/.
8422 With --target-directory=DIR, cp and mv work with a single file argument.
8423 Reported by Karl Berry.
8425 * tests/rm/isatty: Enable this test.
8427 2002-12-31 Jim Meyering <jim@meyering.net>
8429 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
8430 (AD_push): Likewise.
8431 (AD_INIT_OTHER_MEMBERS): Define.
8432 (remove_dir): Define the `status' member manually after each
8433 call to AD_push or AD_push_initial.
8435 * src/ls.c [struct dev_ino]: Remove definition.
8436 Include "dev-ino.h" instead.
8438 2002-12-28 Jim Meyering <jim@meyering.net>
8440 * tests/du/Makefile.am (TESTS): Add no-deref.
8441 * tests/du/no-deref: New script.
8443 2002-12-23 Jim Meyering <jim@meyering.net>
8445 * src/remove.c (remove_cwd_entries): Fix typo in comment.
8447 2002-12-21 Jim Meyering <jim@meyering.net>
8449 * announce-gen: Generate MML-formatted announcement.
8450 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
8452 2002-12-20 Jim Meyering <jim@meyering.net>
8454 * src/touch.c (touch): Change the wording of a diagnostic so
8455 that it makes sense both when the file exists and when it doesn't.
8456 Suggestion from Michael Stone.
8458 2002-12-18 Jim Meyering <jim@meyering.net>
8460 * src/stty.c (valid_options): Declare to be static.
8462 2002-12-15 Jim Meyering <jim@meyering.net>
8464 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
8466 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
8467 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
8468 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
8469 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
8470 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
8472 * src/remove.c (PARAMS): Remove definition.
8473 * src/sys2.h: Likewise.
8475 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
8476 Include strftime.h instead.
8478 2002-12-14 Jim Meyering <jim@meyering.net>
8480 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
8482 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
8483 This is necessary at least for Irix6.5 when using c89.
8484 Reported by Nelson Beebe.
8486 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
8488 * tests/misc/cat-tty-eof: New test.
8490 * src/mknod.c (usage): Specify how major and minor mode numbers
8491 are interpreted. Report forwarded by Kristin E Thomas.
8492 * src/mknod.c: Remove now-redundant usage-specifying comment.
8494 2002-12-13 Jim Meyering <jim@meyering.net>
8498 * tests/du/trailing-slash: Allow for a directory of size `0'.
8499 That happens at least on file systems of type tmpfs on linux-2.4.18.
8501 * announce-gen: New script to begin replacing the commands
8502 associated with the rule here...
8503 * Makefile.maint (announcement): Invoke announce-gen.
8504 * Makefile.am (EXTRA_DIST): Add announce-gen.
8506 * tests/cp/preserve-2: New file/test, for latest fix.
8507 * tests/cp/Makefile.am (TESTS): Add preserve-2.
8509 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
8511 Fix a bug whereby cp would fail to parse an option like
8512 --preserve=mode,ownership.
8513 * src/cp.c (decode_preserve_arg): Advance `comma' to
8514 point the character following the comma.
8516 2002-12-11 Jim Meyering <jim@meyering.net>
8518 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
8519 in case it's already defined.
8521 2002-12-09 Jim Meyering <jim@meyering.net>
8523 * tests/touch/fail-diag: Don't get a test failure if /no exists.
8524 Instead, evoke a framework failure if /no-$$ exists.
8525 Reported by Michael Stone.
8527 2002-12-08 Jim Meyering <jim@meyering.net>
8529 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
8530 Define to rpl_lstat, so that even on systems like Solaris 5.8,
8531 du honors (per POSIX) the trailing slash on an argument referring
8532 to a symlink-to-directory.
8534 2002-12-06 Jim Meyering <jim@meyering.net>
8536 * Use autoconf-2.57. Regenerate dependent files.
8537 * Use automake-1.7.2. Regenerate dependent files.
8539 * src/ls.c (gobble_file): Also stat the file if it's a
8540 regular file and --indicator-style=classify (aka -F).
8541 Thanks to Ed Santiago for opening my eyes.
8543 * tests/ls/file-type: New file. Test for the above.
8544 A test to contrast ls -F and ls --indicator-style=file-type.
8545 * tests/ls/Makefile.am (TESTS): Add file-type.
8547 2002-12-04 Jim Meyering <jim@meyering.net>
8549 * tests/ls/follow-slink: Make sure the symlink was created.
8550 Richard Dawe reported that `ln -s link link' succeeds, but creates
8551 no file on systems running some version of the DJGPP libc.
8553 2002-12-03 Jim Meyering <jim@meyering.net>
8555 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
8556 since this package no longer panders to K&R compilers.
8558 2002-12-02 Jim Meyering <jim@meyering.net>
8560 * tests/du/slink: Skip this test if `.' is on a non-local file system.
8562 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
8563 something to replace.
8565 2002-12-01 Jim Meyering <jim@meyering.net>
8567 * src/stat.c: Don't include <string.h> or <ctype.h>.
8568 That's already done via system.h.
8569 * src/dircolors.c: Don't include <ctype.h>.
8571 2002-11-30 Jim Meyering <jim@meyering.net>
8573 * ls.c (gobble_file): Remove the block of code that caused
8574 `ls --color -F symlink-to-dir' to list the files in
8575 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
8576 like `ls -F symlink-to-dir') but with the addition of highlighting.
8577 Similarly, `ls --color -dF symlink-to-dir' would print
8578 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
8579 Reported by Jeff Sheinberg as Debian bug #168203.
8580 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
8582 ls is now more efficient: with certain options, it no longer needs
8583 to stat each directory entry on systems with valid dirent.d_type.
8584 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
8585 (main): Make --recursive set format_needs_type, not format_needs_stat.
8586 (gobble_file): Remove a FIXME comment, now that it's fixed.
8588 2002-11-24 Jim Meyering <jim@meyering.net>
8590 * src/du.c (du_files): Don't strip any trailing slash.
8591 Rewrite so that `/' is no longer represented internally as
8593 (count_entry): When appending a file name component,
8594 account for the fact that the current path may end in `/'.
8595 François Pinard reported that `du symlink-to-dir/' was not
8596 equivalent to `du symlink-to-dir/.'. Now it is.
8597 * tests/du/trailing-slash: New file/test, for the above fix.
8598 * tests/du/Makefile.am (TESTS): Add trailing-slash.
8600 2002-11-23 Jim Meyering <jim@meyering.net>
8602 * src/tac.c (output): Declare some local variables to be of type size_t,
8603 rather than `int' to avoid warnings from gcc.
8605 2002-11-21 Paul Eggert <eggert@twinsun.com>
8607 * src/ls.c (decode_switches): Use case-sensitive matching to
8608 decode the QUOTING_STYLE environment variable. This is more
8609 consistent with the documentation, and with --quoting-style.
8611 2002-11-21 Martin Buck <martin.buck@ascom.ch
8613 * src/stty.c (struct speeds): Add support for all baud rates defined
8616 2002-11-19 Jim Meyering <jim@meyering.net>
8618 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
8619 run in a UTF locale. Report and suggested fix by Bruno Haible.
8620 * tests/fmt/basic: Likewise.
8622 2002-11-17 Jim Meyering <jim@meyering.net>
8624 * configure.ac: Update via autoupdate.
8625 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
8627 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
8628 Reported by Hans Ginzel.
8630 2002-11-15 Jim Meyering <jim@meyering.net>
8632 * Makefile.cfg (gnu_rel_host): Define.
8633 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
8634 on whether $(VERSION) looks like a major release number.
8636 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
8637 (release): Rename from `alpha'.
8638 (alpha): Depend on release.
8640 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
8642 2002-11-14 Jim Meyering <jim@meyering.net>
8644 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
8645 (announcement): Use the new variable.
8647 * Makefile.maint: Sync with Bison, i.e.:
8648 (po-check): Scan .l and .y files instead of the
8649 .c and the .h files that they generate. This fixes the bug
8650 reported by Tim Van Holder in:
8651 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
8652 Look for N_ as well as for _. Try to avoid matching #define for
8656 2002-11-12 Jim Meyering <jim@meyering.net>
8658 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
8659 Replace sole use with equivalent `#ifdef S_ISLNK'.
8660 Inconsistency reported by Dmitry V. Levin.
8662 2002-11-11 Jim Meyering <jim@meyering.net>
8664 * src/stat.c (usage): Transform --help items output via s/ - / /,
8665 so that help2man produces properly formatted man pages.
8666 Reported by Herbert Xu as Debian bug #168400.
8668 2002-11-10 Jim Meyering <jim@meyering.net>
8670 * src/ls.c (sighandler): Handle SIGTSTP specially.
8671 Based on suggestions from Solar Designer and Dmitry V. Levin.
8674 * Makefile.cfg (cvs_files): Define. From autoconf.
8675 (local_updates): Likewise.
8677 * src/ls.c (restore_default_color_handler, sigtstp_handler):
8679 (sighandler): New function, based on the one in sort.c.
8680 (main): Use sigaction, if possible; otherwise signal.
8681 Handle these signals:
8682 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
8683 Don't register our handler if the signal is already being ignored.
8685 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
8686 * src/csplit.c (interrupt_handler): Likewise.
8687 * src/sort.c (sighandler): Likewise.
8688 (main): Declare `i' and `nsigs' to be unsigned, not int.
8690 2002-11-09 Jim Meyering <jim@meyering.net>
8692 ls --color: restore terminal text color upon signal.
8693 * src/ls.c: Include "full-write.h" and <signal.h>.
8694 (restore_default_color, restore_default_color_handler): New functions.
8695 (sigtstp_handler, put_indicator_direct): New functions.
8696 (main) [print_with_color]: Register signal handlers.
8697 Patch mostly by Solar Designer and Stanislav Ievlev.
8699 Update from autoconf.
8700 * Makefile.maint (AMTAR): Remove definition.
8701 (update, cvs-update, po-update, do-po-update): New rules.
8702 (wget-update): Update (thus renaming to cvs-update).
8703 (automake_repo): Use anoncvs@sources.redhat.com.
8705 2002-11-06 Jim Meyering <jim@meyering.net>
8707 * tests/misc/Makefile.am (TESTS): Add printf-hex.
8709 * tests/misc/printf: Be careful to test the code in this package,
8710 not the shell built-in function.
8712 * src/printf.c (print_esc): A hexadecimal escape sequence has
8713 at most two hex. digits, not three. Reported by Padraig Brady.
8714 (usage): Update description.
8715 * tests/misc/printf-hex: New file/test, for the above fix.
8717 2002-10-07 Paul Eggert <eggert@twinsun.com>
8719 Add support for locale-specific size indications (e.g.,
8720 thousands-separators) and for explicit size suffixes on output.
8722 * doc/coreutils.texi (Block size): Say that:
8723 This affects display format as well as block size.
8724 Fractional block counts are rounded up.
8725 ls file size blocksize defaults to 1.
8726 A block size spec preceded by ' generates thousands separators.
8727 A suffix without a preceding integer generates suffixes.
8728 (tail invocation): 32k -> 32 KiB.
8729 (What information is listed): ls -h is now equivalent to
8730 ls --block-size=human, and ls -H is now equivalent to
8731 ls --block-size=si. Displayed file size is now always affected by
8734 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
8735 lib/umaxtostr.c: New files, taken from GNU tar.
8737 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
8739 (EXTRA_DIST): Add inttostr.c.
8741 * lib/human.c, lib/human.h: Rewrite to support locale-specific
8742 notations like thousands separators.
8743 Specify what includer of include.h must include beforehand.
8744 (human_group_digits, human_suppress_point_zero, human_autoscale,
8745 human_base_1024, human_SI, human_B): New enum values.
8746 (human_readable): Rename from human_readable_inexact; put the
8747 options before the sizes. All uses changed. The old human_readable
8748 function has been removed; use inttostr.h instead.
8749 (human_options): Renamed from human_block_size, with new signature
8750 that allows block sizes up to UINTMAX_MAX. All callers changed.
8752 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
8753 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
8754 freestanding C89. No need to check for stdlib.h or string.h since
8755 autoconf does this now.
8757 * src/cksum.c (cksum): Use primitives from inttostr.h, not
8758 human.h, to print large numbers simply.
8759 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
8760 * src/dd.c (print_stats, main): Likewise.
8761 * src/df.c (print_header): Likewise.
8762 * src/factor.c (print_factors): Likewise.
8763 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
8764 * src/shred.c (dopass): Likewise.
8765 * src/sort.c (checkfp): Likewise.
8766 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
8767 * src/tail.c (xlseek): Likewise.
8768 * src/wc.c (write_counts, wc): Likewise.
8770 * src/df.c (human_output_opts): New var.
8771 (output_block_size): Now uintmax_t, not int, to handle larger
8772 block sizes. All uses changed.
8773 * src/du.c: Likewise.
8774 * src/ls.c: Likewise.
8776 * src/df.c (print_header): In the header line, prefer SI to human
8777 representation if it's shorter; if neither is shorter, try to
8778 intuit what the user would prefer.
8780 * src/expr.c (inttostr): Remove; use new imaxtostr library
8783 * src/ls.c (file_output_block_size): New var, to distinguish
8784 file sizes from other sizes.
8785 (decode_switches): Set it.
8787 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
8788 (dopass): When printing progress, use floor for what has been done
8789 so far (since we should be conservative there), and ceiling for
8790 what needs to be done (since that's what other programs use).
8792 2002-10-19 Jim Meyering <jim@meyering.net>
8794 * src/pinky.c (print_heading): Align TTY and Name headings.
8795 Reported by Karl Eichwalder.
8797 2002-10-18 Jim Meyering <jim@meyering.net>
8799 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
8800 Remove now-useless cast.
8801 (stdread): Remove function.
8802 (bytes_split): Use size_t instead of int.
8803 Use safe_read, not stdread.
8804 (lines_split): Likewise.
8805 Use memchr rather than a `while' loop.
8806 (line_bytes_split): Use size_t instead of int.
8807 Use safe_read, not stdread.
8808 (main): Add some FIXME comments to remind me to remove casts.
8810 * src/system.h (ST_BLKSIZE): Correct comment describing how to
8811 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
8813 2002-10-17 Jim Meyering <jim@meyering.net>
8815 Fix a problem that could make e.g., `cat' misbehave on systems which
8816 give invalid (unreasonably large) values for stat.st_blksize.
8817 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
8818 Reported by Petter Reinholdtsen.
8820 2002-10-14 Jim Meyering <jim@meyering.net>
8822 Specifying a printf conversion specifer as nl's separator string
8823 could cause nl to segfault.
8824 * src/nl.c (build_print_fmt): Don't include separator string
8825 in the printf format; it might contain `%'.
8826 Use a better bound on the length of the print_fmt buffer.
8827 (print_lineno): Print the separator here instead.
8828 Reported by Doug Coleman.
8830 * tests/misc/nl: New file/tests, including a test for the above.
8831 * tests/misc/Makefile.am (TESTS): Add nl.
8833 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
8834 * tests/misc/Makefile.am (TESTS): Add split-l.
8836 2002-10-13 Jim Meyering <jim@meyering.net>
8840 * src/du.c (usage): Tweak description of --dereference-args/-D.
8842 * src/du.c (count_entry): Also save cwd when dereferencing (via
8843 --dereference-args, -D) a command-line argument.
8844 Reported by Michal Svec. Based on a patch by Andreas Schwab.
8846 * src/Makefile.am (../AUTHORS): New target/rule.
8848 2002-10-12 Jim Meyering <jim@meyering.net>
8850 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
8851 of type size_t, since that's the way it's used and avoids a warning.
8853 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
8854 since that's how it's always used and avoids a new warning from gcc.
8855 (read_input): Adapt to new safe_read ABI.
8857 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
8860 * src/pinky.c (print_long_entry): fread returns size_t.
8861 Declare local `bytes' accordingly, to avoid warning.
8863 tail -c +N would perform an extra read after encountering EOF
8864 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
8865 * src/tail.c (start_bytes): Detect EOF, inform caller.
8866 (tail_bytes): Upon EOF in start_bytes, return immediately.
8867 (file_lines): Reorganize to use memrchr rather than an explicit loop.
8868 Adapt to new safe_read ABI.
8870 2002-10-11 Jim Meyering <jim@meyering.net>
8872 * tests/du/deref: New file/test, for the above fix.
8873 * tests/du/Makefile.am (TESTS): Add deref.
8875 2002-10-10 Jim Meyering <jim@meyering.net>
8877 * tests/ln/Makefile.am (TESTS): Add target-1.
8878 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
8880 2002-10-09 Jim Meyering <jim@meyering.net>
8882 * tests/cp/backup-is-src: Ensure that certain environment variables
8883 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
8885 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
8886 consume 4GB of disk space on systems without support for sparse files.
8887 Fix a logic error that'd make it `cat err' even though dd didn't fail.
8889 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
8890 Patch by steven@magelico.net, forwarded by Michael Stone.
8892 * tests/ls/dired: Ensure that ls produces English messages.
8893 Patch by Alexey Vyskubov, forwarded by Michael Stone.
8895 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
8897 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
8899 2002-10-08 Jim Meyering <jim@meyering.net>
8901 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
8902 Fix syntax in test: use =, not ==.
8903 Reported by Bob Proulx.
8904 Change all the rest like this: grep -lR "testing framework'" .\
8905 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
8907 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
8908 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
8909 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
8910 * src/wc.c (wc): Likewise.
8912 2002-10-07 Paul Eggert <eggert@twinsun.com>
8915 Don't advance the write pointer past the end of the write buffer.
8916 * src/sort.c (begfield, limfield): Likewise.
8918 2002-10-07 Jim Meyering <jim@meyering.net>
8920 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
8921 * src/head.c (head_bytes, head_lines): Likewise.
8923 2002-10-06 Jim Meyering <jim@meyering.net>
8925 * src/dd.c (scanargs): Ensure that specified block sizes (specified
8926 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
8927 (skip, dd_copy): Adapt to new safe_read ABI.
8929 * Makefile.maint (signatures): Define.
8931 (announcement): Depend on $(signatures).
8933 * Makefile.maint (announcement): Output all URLs for detached
8934 signatures, not just the last one from the previous loop.
8936 2002-10-05 Jim Meyering <jim@meyering.net>
8940 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
8941 don't recurse into directory, DIR. Prompted by a report from
8944 * tests/rm/i-no-r: New file/test, for the above fix.
8945 * tests/rm/Makefile.am (TESTS): Add i-no-r.
8947 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
8948 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
8950 2002-10-03 Jim Meyering <jim@meyering.net>
8952 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
8953 * src/df.c (AUTHORS): Likewise.
8954 * src/du.c (AUTHORS): Likewise.
8955 * src/tail.c (AUTHORS): Likewise.
8956 * src/touch.c (AUTHORS): Likewise.
8958 2002-10-02 Jim Meyering <jim@meyering.net>
8960 * Makefile.am (SUBDIRS): Remove `old'.
8961 (EXTRA_DIST): List the files in old/.
8962 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
8963 Suggestion from Akim Demaille.
8965 2002-10-01 Jim Meyering <jim@meyering.net>
8967 * src/sys2.h (SSIZE_MAX): Define.
8969 2002-09-30 Jim Meyering <jim@meyering.net>
8971 * src/csplit.c: Don't include stdlib.h here. It's already included
8974 2002-09-29 Jim Meyering <jim@meyering.net>
8976 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
8977 expression to avoid bogus warning from gcc.
8979 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
8980 (cat): Declare insize and outsize to be of type size_t, not int.
8981 Rearrange pointer/integer expressions to avoid bogus warnings.
8982 (main): Declare insize and outsize to be of type size_t, not int.
8984 * src/tail.c (parse_options): Give a sensible diagnostic for
8985 an invalid byte or line count. Reported by Mikko Tuumanen.
8987 * src/touch.c (main): Split a long line.
8989 * tests/du/Makefile.am (TESTS): Add slink.
8990 * tests/du/slink: New test for system.h change of 2002-08-31.
8992 In move mode, always first try to rename. Before, upon failure to
8993 rename a directory, this code would never attempt to rename any
8994 other file in that directory, but would thenceforth always copy.
8995 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
8996 may fail with EXDEV, yet renaming files within that directory to
8997 a newly-created destination directory succeeds.
8998 * src/copy.c (copy_internal): Remove local, move_mode;
8999 use x->move_mode instead. Based on a patch from Tom Haynes.
9001 2002-09-28 Jim Meyering <jim@meyering.net>
9003 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
9004 Factor out some duplication.
9006 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
9008 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
9010 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
9011 to avoid compiler warnings.
9013 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
9016 Fix things so `mkdir -p' can create very deep directories, e.g.,
9017 mkdir -p $(perl -e 'print "a/" x 40000') now works.
9018 * src/mkdir.c (main): For --parents (-p), call make_path with the
9019 entire directory name, so we don't ever require that file operations
9020 like stat or chmod be performed on the entire command line argument.
9021 * makepath.c (make_path): Restore umask *before* creating the final
9024 2002-09-27 Andreas Schwab <schwab@suse.de>
9026 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
9027 to avoid overflow. Reported by Hans Lermen.
9029 2002-09-26 Jim Meyering <jim@meyering.net>
9031 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
9033 2002-09-25 Jim Meyering <jim@meyering.net>
9035 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
9036 and add a cast, to avoid a warning about `signed and unsigned type in
9037 conditional expression'.
9039 2002-09-22 Jim Meyering <jim@meyering.net>
9041 * src/rmdir.c: Include "dirname.h", for declaration of
9042 strip_trailing_slashes.
9044 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
9045 Now they're defined through system.h.
9047 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
9048 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
9049 since it's already included from sys2.h via system.h.
9051 * Use automake-1.6f. Regenerate dependent files.
9053 * src/Makefile.am (PERL): Remove duplicate definition.
9055 fmt's -s, -t, -c options didn't work properly for long lines.
9056 Since get_line may end up calling put_paragraph (for long lines),
9057 be sure to set global, `other_indent', before it is used there.
9059 * src/fmt.c (set_other_indent): New function, factored out of...
9060 (get_paragraph): ... here. Call it.
9061 (get_line): Call set_other_indent before calling flush_paragraph,
9062 which calls fmt_paragraph, which in turn calls put_paragraph,
9063 which uses other_indent.
9065 * tests/fmt/Makefile.am (TESTS): Add long-line.
9066 * tests/fmt/long-line: New file/test, for the above fix.
9068 2002-09-21 Jim Meyering <jim@meyering.net>
9070 * src/od.c: No longer include deprecated <values.h>.
9071 It was required solely for now-removed reference to BITSPERBYTE.
9072 * src/install.c: Likewise.
9073 Suggestion from Bruno Haible.
9075 2002-09-06 Andreas Schwab <schwab@suse.de>
9077 `rmdir -p dir-specified-with-trailing-slash/' would fail.
9078 * src/rmdir.c (remove_parents): Strip trailing slashes.
9080 2002-09-20 Jim Meyering <jim@meyering.net>
9082 * tests/rmdir/t-slash: New file/test, for the above fix.
9083 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
9085 * Makefile.maint (announcement): Arrange to gpg-sign the message.
9086 Add a URL for each detached signature file.
9088 2002-09-07 Bruno Haible <bruno@clisp.org>
9090 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
9092 2002-09-18 Jim Meyering <jim@meyering.net>
9094 `od -t x8' used the wrong (`l'-prefixed) printf format.
9095 Likewise for the o8 and u8 formats.
9096 * src/od.c (ISPEC_TO_FORMAT): Define macro.
9097 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
9098 Reported by Arun Sharma.
9100 2002-09-17 Jim Meyering <jim@meyering.net>
9102 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
9103 From gettext's intl/loadmsgcat.c.
9105 * tests/od/x8: New file/test, for the above fix.
9106 * tests/od/Makefile.am (TESTS): Add x8.
9108 2002-09-15 Jim Meyering <jim@meyering.net>
9110 * Use autoconf-2.54. Regenerate dependent files.
9112 * src/csplit.c (get_format_width): Add cast to avoid
9113 warning about `signed and unsigned type in conditional expression'.
9115 2002-09-14 Jim Meyering <jim@meyering.net>
9117 * src/who.c (print_user): Change type of local to size_t
9118 to avoid warnings about `comparison between signed and unsigned'.
9119 * src/ptx.c (generate_all_output): Likewise.
9121 * src/dd.c (main, skip): Add casts to avoid warnings about
9122 `comparison between signed and unsigned'.
9124 * src/id.c (print_full_info, print_group_list): Add casts to avoid
9125 warnings about `signed and unsigned type in conditional expression'.
9127 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
9128 to avoid warnings about `comparison between signed and unsigned'.
9129 (split_3): Change parameter names to be readable and add comment.
9130 Clean up the test for whether a line may be ignored.
9132 2002-09-13 Jim Meyering <jim@meyering.net>
9134 * src/printf.c (main): Handle leading command line argument of `--'.
9135 Reported by Raul: DervishD <raul@pleyades.net>
9136 * tests/misc/printf: New file: test for the above.
9137 * tests/misc/Makefile.am (TESTS): Add printf.
9139 * src/date.c (usage): Explain that %S's range of [0..60] is required --
9140 rather than 0..59 -- to accommodate the occasional positive leap second.
9141 Reported by Richard Neill.
9143 2002-09-12 Jim Meyering <jim@meyering.net>
9145 * src/Makefile.am (nanosec_libs): Define.
9146 (sleep_LDADD, tail_LDADD): Use it here.
9148 Factor nanosleep-related code into ../lib/xnanosleep.c.
9149 * src/sleep.c: Include xnanosleep.h.
9150 Factor out fenv.h-related code.
9151 (timespec_subtract): Remove function.
9152 (main): Remove code that deals with computing start and stop times
9153 as well as the loop around nanosleep. Now that's in xnanosleep.c.
9155 Allow S (in --sleep-interval=S) to be a floating point value.
9156 * src/tail.c: Include xnanosleep.h and xstrtod.h.
9157 Move declaration of global variable, sleep_interval, to ...
9159 (usage): Update description of --sleep-interval option.
9160 (tail_forever): New parameter, sleep_interval. Update caller.
9161 Use xnanosleep, rather than sleep.
9162 (parse_options): New parameter, sleep_interval. Update caller.
9163 Use xstrtod, now that we accept floating point values.
9164 Prompted by a patch from Augey Mikus.
9166 2002-09-06 Jim Meyering <jim@meyering.net>
9168 * src/remove.c (prompt): Change comment to give a better note to
9169 translators. From Michael Piefel.
9171 2002-09-02 Jim Meyering <jim@meyering.net>
9173 * README: A good problem report/patch includes diffs against
9174 the most recent test release.
9176 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
9177 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
9179 * src/kill.c (print_table_row): Use an unsigned type for widths
9180 to avoid warning about comparison between signed and unsigned.
9181 (list_signals): Likewise.
9183 * src/od.c (skip): Add a cast to avoid warning about comparison
9184 between signed and unsigned.
9185 * src/install.c (get_ids): Likewise. Also rearrange range-checking
9186 comparisons to make them more readable.
9188 2002-09-01 Jim Meyering <jim@meyering.net>
9192 2002-08-31 Jim Meyering <jim@meyering.net>
9194 Symlinks were always reported as using 0 blocks.
9195 * src/system.h (ST_NBLOCKS): Don't depend on file type.
9196 This reverts the change of 2000-01-30.
9197 Based on a report and patch from Neil Brown via Michael Stone.
9198 This fixes Debian Bug#156358.
9200 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
9201 `exit (1)' to `exit (EXIT_FAILURE)', and
9202 `usage (1)' to `usage (EXIT_FAILURE)'.
9204 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
9205 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
9206 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
9207 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
9208 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
9209 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
9210 error never exits successfully.
9212 2002-08-29 Jim Meyering <jim@meyering.net>
9214 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
9215 when ignoring any return value.
9217 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
9218 failures. On some systems (at least EMC Celerra and Solaris5.8),
9219 this appears to be necessary.
9220 (is_empty_dir): Likewise. Also, always close directory handle.
9221 * src/ls.c (print_dir): Likewise.
9222 (print_dir): Rename local variable: reading -> dirp.
9223 Reported by Mike Coleman.
9225 2002-08-28 Jim Meyering <jim@meyering.net>
9227 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
9228 Give a diagnostic and fail if closedir fails.
9230 2002-08-26 Jim Meyering <jim@meyering.net>
9232 * Makefile.am (THANKS-to-translators): New rule.
9233 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
9234 * THANKStt.in: New file.
9236 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
9238 (main): Register it with atexit.
9239 Close STDOUT_FILENO, to avoid a problem when writing to
9240 /dev/audio on at least Solaris 5.7 and 5.8 systems.
9241 Reported by Shing-Shong Shei.
9243 2002-08-25 Jim Meyering <jim@meyering.net>
9245 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
9246 * src/tac.c (main): Likewise.
9247 * src/tail.c (main): Likewise.
9248 * src/tee.c (main): Likewise.
9249 * src/tr.c (main): Likewise.
9250 * src/wc.c (main): Likewise.
9252 2002-08-20 Jim Meyering <jim@meyering.net>
9254 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
9256 2002-08-10 Paul Eggert <eggert@twinsun.com>
9258 * src/nohup.sh: Don't use "exec --"; it's not portable and
9259 shouldn't be needed.
9261 2002-08-09 Jim Meyering <jim@meyering.net>
9263 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
9264 (usage): Clarify help text for the -COLUMN option.
9265 Patch by Padraig Brady.
9266 * tests/pr/Test.pm [col-last]: New test for the above.
9268 * configure.ac: Start with version 4.5.1, chosen so that it's larger
9269 than the latest version numbers of the component packages.
9271 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
9274 2002-08-08 Jim Meyering <jim@meyering.net>
9276 * src/date.c: Guard inclusion of <langinfo.h> with
9277 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
9278 * src/sort.c: Likewise.
9279 Patch by GOTO Masanori.
9281 2002-08-05 Paul Eggert <eggert@twinsun.com>
9283 Fix some minor time-related bugs with POSIX time arguments.
9284 Some valid time stamps were being rejected (notably -1, and
9285 time stamps before 1900 on 64-bit hosts). And some invalid
9286 time stamps were being accepted, e.g. September 31.
9288 * src/date.c (main): Adjust to posixtime signature change.
9289 * src/touch.c (main): Likewise. Remove unnecessary initialization.
9290 Use localtime, not posixtm, to warn about obsolete "touch".
9292 2002-08-05 Jim Meyering <jim@meyering.net>
9294 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
9296 2002-08-04 Jim Meyering <jim@meyering.net>
9298 * src/Makefile.am (check-README): New target/rule.
9299 (check): Depend on it.
9301 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
9303 2002-08-03 Jim Meyering <jim@meyering.net>
9305 * Makefile.am (SUBDIRS): Add old.
9306 * old/: New directory, containing legacy ChangeLog* and NEWS files
9307 from the fileutils, sh-utils, and textutils packages.
9309 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
9311 2002-08-02 Paul Eggert <eggert@twinsun.com>
9313 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
9315 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
9316 (hard_LC_COLLATE): New var.
9317 (different): Args are now char *, not const char *.
9318 Use xmemcoll instead of memcmp to compare lines, so that
9319 LC_COLLATE has effect. However, use memcmp if it is an
9321 (check_file): Do not include newline in comparison, so that
9322 xmemcoll has a byte to stomp on temporarily.
9323 (main): Set hard_LC_COLLATE.
9325 2002-07-29 Jim Meyering <jim@meyering.net>
9327 * Makefile.am (SUBDIRS): Remove djgpp, for now.
9329 2002-07-20 Jim Meyering <jim@meyering.net>
9331 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
9332 into EXIT_FAILURE. Otherwise, false --help and false --version
9335 2002-07-08 Jim Meyering <jim@meyering.net>
9337 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
9338 rather than the hard-coded `sh-utils'.
9340 2002-07-01 Jim Meyering <jim@meyering.net>
9342 * configure.ac: Merge the three files from fileutils,
9343 textutils, and sh-utils.
9344 * Makefile.am: Likewise.
9345 * src/Makefile.am: Likewise.