1 2003-12-20 Jim Meyering <jim@meyering.net>
5 * tests/Makefile.am (root-hint): Tweak wording.
7 * src/du.c: Accept new option (-0, --null) that makes it so each
8 output line is NUL-terminated rather than newline-terminated.
10 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
11 Reported by Volker Paul.
12 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
13 * tests/dd/unblock-sync: New test for the above.
15 2003-12-19 Jim Meyering <jim@meyering.net>
17 * tests/misc/nohup: Double quote back-ticked expression,
18 in case it ends up having an unexpected value.
20 * tests/ls/no-arg: Use ls's -1 option in both runs.
22 * src/du.c (fts_debug): New global.
23 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
24 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
25 (main) [DU_DEBUG]: Accept -d option.
27 2003-12-18 Jim Meyering <jim@meyering.net>
29 * src/ls.c (format_user): Increment dired_pos via two statements,
30 `dired_pos += width; dired_pos++;' rather than one,
31 `dired_pos += width + 1;' since the latter could conceivably overflow.
32 (format_group): Likewise.
35 * configure.ac: Require automake-1.8.
37 2003-12-12 Jim Meyering <jim@meyering.net>
39 * Use automake-1.8. Regenerate dependent files.
41 2003-12-08 Jim Meyering <jim@meyering.net>
43 * Makefile.maint (news-date-check): New rule.
44 (alpha beta major): Depend on it.
46 2003-12-03 Paul Eggert <eggert@twinsun.com>
48 * NEWS: ls -l (and similar options) now adjust all columns to
49 fit the data. Generalized from a suggestion by Leah Q for file sizes.
50 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
51 (format_user_width, format_group_width, unsigned_file_size,
52 format_group): New functions.
53 (block_size_width): Renamed from block_size_size.
54 (inode_number_width, nlink_width, owner_width, group_width,
55 author_width, major_device_number_width, minor_device_number_width,
56 file_size_width): New vars.
57 (clear_files): Initialize them.
58 (gobble_file): Set them. Don't ceiling block_size_width to 7.
59 (print_long_file): Use them.
60 (gobble_file): Use a new local variable 'f' to make the code
61 smaller and more consistent with other functions.
62 (format_user): Output to stdout, not to a buffer, so that we
63 don't have to worry about buffer overrun. Update dired_pos.
64 (print_long_file): Don't put owner, group, author into buffer;
65 just print them directly. Don't assume link counts and
66 major and minor numbers fit into unsigned long int.
67 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
68 'ls' output is fixed-width.
70 2003-12-02 Jim Meyering <jim@meyering.net>
72 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
74 2003-11-27 Jim Meyering <jim@meyering.net>
76 * Use automake-1.7f. Regenerate dependent files.
78 2003-11-24 Paul Eggert <eggert@twinsun.com>
80 Parse floating-point operands and options in the C locale.
81 POSIX requires this for printf, and we might as well be
82 consistent elsewhere (tail, sleep, seq).
84 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
85 needed now that we assume C89. Include "c-strtod.h".
86 (xstrtod): Call c_strtod, not strtod.
87 * src/sleep.c: Include "c-strtod.h".
88 (main): Update xstrtod call to include new argument, c_strtod.
89 * src/seq.c (scan_double_arg): Likewise.
90 * src/tail.c (parse_options): Likewise.
92 2003-11-24 Jim Meyering <jim@meyering.net>
94 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
95 Reported by Mark Conty.
97 2003-11-22 Jim Meyering <jim@meyering.net>
99 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
100 (sc_system_h_headers): Do this test only if sys2.h exists.
102 2003-11-20 Jim Meyering <jim@meyering.net>
104 * tests/help-version: Ensure that the bug-reporting address is
105 included in the --help output for every program.
106 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
108 * src/ptx.c (usage): Output bug-reporting address.
109 Reported by Dan Jacobson.
111 2003-11-19 Jim Meyering <jim@meyering.net>
113 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
114 on the join fields. Suggestion from Bruce Robertson.
116 2003-11-18 Jim Meyering <jim@meyering.net>
118 `od -c -w9999999' could segfault
119 * src/od.c (dump): Use xnmalloc/free, not alloca.
121 2003-11-16 Jim Meyering <jim@meyering.net>
123 * Use autoconf-2.59. Regenerate dependent files.
125 * tests/du/hard-link: Minor tweak: use mkdir -p.
127 Fix read-from-free'd-buffer error detected by valgrind.
128 * src/csplit.c (remove_line): Don't return a pointer to data in
129 a freed buffer. Instead, arrange to free the buffer on the
132 * tests/misc/csplit: New test for above fix.
134 2003-11-11 Jim Meyering <jim@meyering.net>
136 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
137 This avoids a warning from valgrind about memcpy with overlapping
138 source and destination.
140 * configure.ac: Require automake-1.7.8.
142 2003-11-09 Jim Meyering <jim@meyering.net>
144 * Use automake-1.7.9. Regenerate dependent files.
146 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
147 * src/chown.c: Likewise.
149 * src/chown-core.c: Include "root-dev-ino.h".
150 (chopt_init): Initialize new member.
151 (change_file_owner): Support rm's new --preserve-root option.
153 * src/remove.c: Include "root-dev-ino.h".
154 (remove_cwd_entries): Remove now-obsolete FIXME comment.
155 (remove_dir): Support rm's new --preserve-root option.
157 * src/chown.c: Include "root-dev-ino.h".
158 Add new options: --preserve-root and --no-preserve-root.
160 * src/chmod.c: Include "root-dev-ino.h".
161 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
162 ROOT_DEV_INO_WARN macros.
163 (get_root_dev_ino): Remove function definition, now that it's
164 been moved to a separate file.
165 (usage): Describe new options.
167 * src/mv.c (rm_option_init): Initialized new member.
169 * src/remove.h: Include "dev-ino.h".
170 (struct rm_options): Add new member: root_dev_ino.
171 * src/chown-core.h: Include "dev-ino.h".
172 (struct Chown_option): Add new member: root_dev_ino.
174 2003-11-06 Jim Meyering <jim@meyering.net>
176 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
177 hard-coding `sizeof FILE*'.
179 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
181 * src/wc.c (main): Free `fstatus' so there is no confusion about
182 whether it's leaked or not.
183 * src/who.c (who): Likewise for `utmp_buf'.
185 2003-11-05 Paul Eggert <eggert@twinsun.com>
187 Fix 'cut' problems with size_t overflow and unsigned int.
188 More generally, resize integer variables to fit use more precisely.
189 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
190 (struct range_pair): Make members to be of type size_t, not unsigned.
191 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
192 (suppress_non_delimited, output_delimiter_specified,
193 have_read_stdin, print_kth, set_fields): Now bool, nt int.
194 (delim): Now unsigned char, not int.
195 (mark_printable_field, is_printable_field, is_range_start_index,
196 set_fields, set_fields, cut_bytes, cut_fields):
197 Use size_t, not unsigned, for field and byte counts.
198 (hash_int): Use uintptr_t, not unsigned, for pointers converted
199 to integers. This squeezes more info out of them.
200 (set_fields, cut_bytes, cut_fields, main):
201 Use bool, not int, for booleans.
202 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
204 2003-11-05 Paul Eggert <eggert@twinsun.com>
206 * man/Makefile.am (check-programs-vs-x):
207 Work even if $(programs) contains '$'.
208 Work even if 'missing=1' in environment.
209 Don't report an error simply because $(programs) outputs nothing.
211 2003-11-05 Jim Meyering <jim@meyering.net>
213 * Use autoconf-2.58. Regenerate dependent files.
215 * src/tr.c (spec_init): Fix typo in last change.
217 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
218 call to variadic version_etc function, so that it works even on systems
219 for which sizeof char* != sizeof int.
220 * src/true.c (main): Likewise.
221 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
222 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
223 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
224 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
225 Similarly, cast NULL to `(char *)' in call to variadic function,
226 parse_long_options, so that it works even on systems for which
227 sizeof char* != sizeof int.
228 A similar problem was reported by Harti Brandt in
229 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
231 * src/users.c (users): Free `utmp_buf' explicitly so that people
232 don't mistake this for a real leak.
233 Patch by Dennis Smit <ds@nerds-incorporated.org.
235 2003-11-04 Paul Eggert <eggert@twinsun.com>
237 * README: Document _POSIX2_VERSION.
239 2003-11-04 Jim Meyering <jim@meyering.net>
241 * src/tac.c (memrchr): Remove #if-0'd function.
242 (tac_stdin_to_mem): Clean up #if-0'd code.
244 * src/od.c (decode_format_string): Remove unnecessary casts.
245 Use more maintainable `sizeof *var'.
246 (main): Call decode_format_string rather than decode_one_format,
247 now that `spec' may be NULL.
249 * src/chmod.c (AUTHORS): Add my name.
251 * src/split.c (next_file_name): Use `sizeof *var' rather than
252 hard-coding `sizeof size_t'.
254 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
256 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
257 to avoid potential overflow in pointer arithmetic.
258 (set_fields): Use not `1', but rather `sizeof *printable_field' as
259 second argument to xcalloc.
260 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
261 rather than xrealloc.
262 * src/date.c (show_date): Likewise.
263 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
264 * src/pr.c (store_char): Likewise.
265 * src/fold.c (fold_file): Likewise.
267 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
268 type changes (unsigned int -> size_t) in hash.c.
269 * src/cp-hash.c (src_to_dest_hash): Likewise.
270 * src/du.c (entry_hash): Likewise.
271 * src/ls.c (dev_ino_hash): Likewise.
272 * src/cut.c (hash_int): Likewise. Declare function as static.
274 2003-11-03 Jim Meyering <jim@meyering.net>
276 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
277 * tests/misc/fold: Fail the test immediately if we're not running
278 the expected version of fold.
280 2003-11-02 Jim Meyering <jim@meyering.net>
282 * src/tr.c (append_normal_char, append_range, append_char_class)
283 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
284 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
286 * src/copy.c (copy_internal): Likewise.
287 * src/join.c (initseq, add_field, make_blank): Likewise.
288 * src/od.c (main): Likewise.
289 * src/cp.c (make_path_private): Likewise.
290 * src/tsort.c (new_item, record_relation): Likewise.
292 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
293 (main): Also remove anachronistic cast of xmalloc return value.
294 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
295 (main): Also remove anachronistic cast of xmalloc return value.
296 * src/sort.c (inittables): Likewise.
297 (sort): Also Split a long line.
299 2003-10-25 Jim Meyering <meyering@lucent.com>
301 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
302 type changes (unsigned int -> size_t) in hash.c.
303 * src/cp-hash.c (src_to_dest_hash): Likewise.
304 * src/du.c (entry_hash): Likewise.
305 * src/ls.c (dev_ino_hash): Likewise.
306 * src/cut.c (hash_int): Likewise. Declare function as static.
308 2003-10-21 Jim Meyering <jim@meyering.net>
310 Don't fail when run with VERBOSE=yes.
311 * tests/chgrp/basic: Do `set +x' before starting the subshell
312 from which we invoke chgrp. Otherwise, the output from the
313 VERBOSE=yes-induced `set -x' would result in spurious differences.
314 Reported by Russel Coker via Michael Stone.
316 2003-10-19 Jim Meyering <jim@meyering.net>
318 chmod now uses fts to perform a directory traversal when -R is
319 specified. Before, it operated on full path names, and as such
320 would encounter the PATH_MAX (often 4096) limit.
322 * src/chmod.c: Include "xfts.h".
323 (process_file): Rename from change_file_mode.
324 Adapt to be used with fts.
325 (process_files): New function.
327 2003-10-18 Jim Meyering <jim@meyering.net>
329 * tests/du/deref-args: Ensure that du -D now dereferences all
330 symlinks specified on the command line, not just those that
331 reference directories.
333 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
334 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
335 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
336 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
337 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
338 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
339 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
340 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
341 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
342 Update the call to parse_long_options so that `AUTHORS, NULL' are the
344 * src/true.c (main): Append NULL to version_etc argument list.
345 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
347 2003-10-17 Andreas Schwab <schwab@suse.de>
349 * tests/mk-script: Get $srcdir from first parameter instead of
351 (main): Update usage.
353 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
354 first argument of mk-script.
355 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
357 2003-10-17 Jim Meyering <jim@meyering.net>
359 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
360 generated `man' page is more readable. Suggestion from Dan Jacobson.
362 * src/chown-core.c (change_file_owner): Handle the cases in
363 which fts_info indicates an error with the given entry.
365 * src/du.c (main): Simply assign to bit_flags.
366 Don't bother with bit arithmetic.
368 * tests/chmod/no-x: New file.
369 * tests/chgrp/no-x: New file.
370 * tests/chmod/Makefile.am (TESTS): Add no-x.
371 * tests/chgrp/Makefile.am (TESTS): Likewise.
373 * src/du.c: Include "xfts.h".
374 (du_files): Use xfts_open, rather than fts_open.
375 * src/chown-core.c (chown_files): Likewise.
377 2003-10-16 Jim Meyering <jim@meyering.net>
379 * src/chgrp.c (main): Simply assign to bit_flags.
380 Don't bother with bit arithmetic.
381 * src/chown.c (main): Likewise.
382 Rename a couple of local variables.
383 Remove unnecessary casts.
385 * src/tail.c (start_bytes): Rename local, remainder, to avoid
386 gcc's warning about shadowing a global.
388 2003-10-15 Jim Meyering <jim@meyering.net>
390 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
391 use fts to perform a directory traversal when -R is specified.
392 Before, they operated on full path names, and as such would
393 encounter the PATH_MAX (often 4096) limit.
394 They are more efficient. For example, before, chgrp -R would
395 take almost 5 seconds to change about 2000 directories and fail
396 (with `File name too long'), while now it succeeds on a hierarchy
397 of depth 20,000 in 1/10 the time.
399 * src/chown.c: Include "userspec.h" and "fts_.h".
400 (WRITTEN_BY): Add my name.
401 (getpwnam, getgrnam, getgrgid): Remove declarations.
402 (endpwent): Remove definition.
404 (main): Handle new options.
405 Call new function, chown_files rather than change_file_owner.
407 * src/chgrp.c: Include "fts_.h".
408 (WRITTEN_BY): Add my name.
409 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
412 (main): Handle new options.
413 Call new function, chown_files rather than change_file_owner.
415 Rewrite to iterate through hierarchies using fts rather than
416 via explicit recursion.
417 * src/chown-core.c: Include "fts_.h"
418 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
419 on a single file at a time.
420 (chown_files): New function.
421 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
422 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
423 [struct Chown_option] (dereference): Remove member with ambiguous name.
424 [struct Chown_option] (affect_symlink_referent): New member.
425 (chown_files): New prototype.
427 * tests/chgrp/recurse: Update tests accordingly.
428 * tests/chgrp/posix-H: New tests for the above.
429 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
431 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
432 work even for superuser. Suggestion from Dan Jacobson.
434 2003-10-14 Paul Eggert <eggert@twinsun.com>
436 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
438 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
439 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
440 * src/sort.c (parse_field_count): Handle the case where overflow
441 and invalid suffix char are both reported.
443 2003-10-14 Jim Meyering <jim@meyering.net>
445 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
446 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
449 2003-10-13 Paul Eggert <eggert@twinsun.com>
451 Fix to avoid a denial-of-service attack if the display width is
452 enormous. Also, clean up the code a bit by removing duplicate code.
454 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
455 (calculate_columns): New function, that contains code that used
456 to be common to print_many_per_line and print_horizontal.
457 (print_many_per_line, print_horizontal): Use it.
458 (decode_switches): Set max_idx here, not in calculate_columns.
459 (print_current_files): Don't call init_column_info; calculate_columns
461 (init_column_info): Don't allocate a lot more space than is needed
462 to represent the current set of files. Allocate all the new
463 size_t cells in one call to xnmalloc, rather than a row at a time.
465 2003-10-13 Jim Meyering <jim@meyering.net>
467 * src/ls.c (init_column_info): Add another FIXME comment.
469 2003-10-13 Paul Eggert <eggert@twinsun.com>
471 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
472 Remove several arbitrary limits on hosts where int cannot represent
475 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
476 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
477 struct column_info.col_arr[0], max_idx):
479 (get_funky_string): Return bool indicating success, instead of
480 a negative count to indicate failure. Store number of columns
481 through new parameter OUTPUT_COUNT; that way, they can never
482 go negative. Change equals_end from int to bool. All uses
484 (struct column_info.valid_len): Now bool, not int. All uses changed.
485 (dired_dump_obstack, get_funky_string, clear_files,
486 extract_dirs_from_files, print_current_files,
487 print_many_per_line, print_horizontal, init_column_info,
488 put_indicator, length_of_file_name_and_frills,
489 print_with_commas): Use size_t, not int, for local variables
491 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
492 Check for TIOCGWINSZ returing negative values (or values greater
494 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
496 Use xmalloc and xnmalloc, not XMALLOC.
497 (gobble_file): Use xnrealloc, not XREALLOC.
498 (print_color_indicator): Remove now-unnecessary cast to size_t.
500 2003-10-12 Paul Eggert <eggert@twinsun.com>
502 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
503 * tests/sort/sort-tests: Remove from CVS; assume that people
504 brave enough to check coreutils out from CVS can rebuild it.
506 2003-10-12 Jim Meyering <jim@meyering.net>
508 New options: --preserve-root and --no-preserve-root.
509 * src/chmod.c (change_file_mode): Honor new option.
510 (change_file_mode): Strip trailing slashes on directory
511 argument passed to change_dir_mode.
512 (get_root_dev_ino): New function.
513 (main): Initialize global, root_dev_ino.
515 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
516 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
518 * src/chmod.c (change_file_mode): Likewise.
520 2003-10-08 Jim Meyering <jim@meyering.net>
522 * src/csplit.c (main): Remove obsolete FIXME.
524 2003-10-07 Jim Meyering <jim@meyering.net>
526 * Use automake-1.7.8. Regenerate dependent files.
528 2003-09-29 Paul Eggert <eggert@twinsun.com>
532 * doc/coreutils.texi (csplit invocation):
533 The regexp offset need not have a sign; POSIX requires support
536 Be more careful about int widths. For example, remove some
537 arbitrary limits by replacing 'unsigned' with 'size_t',
538 'uintmax_t', etc. Use standard bool rather than a homegrown type.
539 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
540 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
541 to <stdbool.h> usage.
542 (struct control): offset is now intmax_t, not int.
543 repeat_forever is now bool, not int.
544 (struct cstring): len is now size_t, not unsigned int.
545 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
546 size_t, not unsigned. start_line, first_available are now
547 uintmax_t, not unsigned.
548 (hold_count, control_used): Now size_t, not unsigned.
549 (last_line_number, current_line, bytes_written):
550 Now uintmax_t, not unsigned.
551 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
552 create_new_buffer, get_new_buffer, load_buffer, find_line,
553 process_regexp, split_file, new_control_record, extract_regexp,
554 get_format_width, get_format_prec, max_out):
555 size args, locals, and returned values are now size_t, not unsigned
557 (get_first_line_in_buffer, find_line, write_to_file,
558 handle_line_error, process_line_count, regexp_error, process_regexp,
560 File line, byte, and repetition counts are now uintmax_t, not unsigned.
561 (check_for_offset): Don't require a sign before the offset.
562 Use xstrtoimax to do the real work.
563 (extract_regexp): Remove harmful cast of size to unsigned.
564 256 -> 1<<CHAR_BIT, for clarity.
565 (get_format_flags): Return at most 3, to avoid worries about overflow.
567 (bytes_to_octal_digits): Remove.
569 (cleanup): Don't check whether output_stream is NULL, since
570 close_output_file does that for us.
572 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
573 (sizeof *p);" instead of the more long-winded alternatives.
575 (get_new_buffer): Use O(1) algorithm for resizing a buffer
576 to a much larger size, instead of an O(N) algorithm.
578 (process_regexp): Use plain NULL rather than casted 0.
580 (make_filename): Use %u, not %d, to format unsigned file number.
582 (new_control_record): Use xrealloc exclusively, since it handles
585 (extract_regexp): Change misspelled word in diagnostic.
587 (get_format_width): Even if a minimum field width is specified,
588 allow room for enough octal digits to represent the value of
589 the maximum representible integer. This fixes a potential
590 buffer overrun. Calculate this room at compile-time, not
591 at run-time; this removes the need for bytes_to_octal_digits.
592 Check for overflow; this removes a FIXME.
594 (get_format_prec): Don't allow precision to be signed; it's
595 not ANSI. Check for overflow. Remove hardcoded "11" as
596 default precision; this fixes a potential buffer overrun
597 on hosts with wider size_t.
599 (get_format_conv_type): Change local variable to be of type
600 unsigned char, not int; this removes a potential subscript
601 violation on hosts where char is signed.
603 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
604 Allow "%%" in format. Don't overflow when
605 counting lots of percents.
607 (usage): Default sprintf format is %02u, not %d.
609 2003-10-05 Jim Meyering <jim@meyering.net>
611 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
613 * src/du.c (du_files): Mark diagnostic for translation.
615 2003-10-04 Jim Meyering <jim@meyering.net>
617 * src/du.c (du_files): Ignore any failure of fts_close.
618 Give better diagnostics for failed fts_open.
620 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
622 Deprecate existing use of -H (aka --si).
623 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
624 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
625 (main): Warn that the meaning of -H will soon change to be
628 2003-10-03 Jim Meyering <jim@meyering.net>
630 * src/du.c: Accept --no-dereference (-P).
632 2003-10-02 Jim Meyering <jim@meyering.net>
634 * tests/du/trailing-slash: Adjust for slightly different output.
636 Rewrite du.c to use fts.
637 * src/du.c: Include "fts_.h", not ftw.h.
638 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
639 (IS_FTW_DIR_TYPE): Remove definition.
640 (IS_DIR_TYPE): Define.
641 (is_symlink_to_dir): Remove now-unnecessary function.
642 (process_file, du_files): Rewrite to use fts.
644 * tests/du/inaccessible-cwd: Ensure that even when run from an
645 inaccessible directory, du can still operate on accessible
646 directories elsewhere.
647 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
649 * tests/rm/deep-1: Ensure that du can process a hierarchy
650 of depth 400 while using no more than 50KB of stack space.
652 2003-10-01 Akim Demaille <akim@epita.fr>
654 * announce-gen (print_news_deltas): New function, extracted from main.
655 (main): Make `news_file' an array.
656 Use '...=s' => \@var for --news and --url-directory specs.
657 Before there were a couple of portability problems.
659 2003-09-28 Jim Meyering <jim@meyering.net>
661 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
662 (syntax-check-rules): Add it.
664 * src/copy.c: Remove unnecessary cast of alloca, since now it's
665 guaranteed to be (void *).
666 * src/cp.c: Likewise.
667 * src/join.c: Likewise.
668 * src/ln.c: Likewise.
669 * src/ls.c: Likewise.
670 * src/od.c: Likewise.
671 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
673 2003-09-27 Jim Meyering <jim@meyering.net>
675 Don't exhaust virtual memory when processing large inputs.
676 Fix this by removing csplit's internal free-list management;
677 instead rely on malloc for that.
679 * src/csplit.c (free_list): Remove global.
680 (clear_all_line_control): Remove function.
681 (get_new_buffer): Always use create_new_buffer to obtain a
682 new buffer, rather than searching free_list.
683 (free_buffer): Just call free.
684 Reported by Nikola Milutinovic.
686 2003-09-26 Jim Meyering <jim@meyering.net>
688 * man/rm.x: Also list `chattr' in SEE ALSO section.
689 Suggestion from Mark Hubbart.
691 2003-09-25 Jim Meyering <jim@meyering.net>
693 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
694 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
696 * Use autoconf-2.57d. Regenerate dependent files.
698 2003-09-24 Jim Meyering <jim@meyering.net>
700 Minor efficiency tweak.
701 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
704 2003-09-23 Jim Meyering <jim@meyering.net>
706 * src/paste.c (paste_serial): Save errno after input error,
707 to report proper errno value.
708 Based on a patch from Paul Eggert.
710 * src/tee.c (tee): Adjust fwrite arguments so that the return
711 value is the number of bytes written.
713 2003-09-16 Paul Eggert <eggert@twinsun.com>
715 Don't assume ferror sets errno. Bug reported by Bruno Haible.
717 * src/comm.c (compare_files): Save errno after input error,
718 to report proper errno value.
719 * src/fold.c (fold_file): Likewise.
720 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
721 * src/unexpand.c (unexpand): Likewise.
723 * src/csplit.c (close_output_file): Don't report bogus errno value
724 after ferror discovers an output error. We don't know the proper
725 errno value, since it might have been caused by any of a whole
726 bunch of calls, and it might have been trashed in the meantime.
727 Fixing this problem will require much more extensive changes;
728 in the meantime just say "write error".
729 * src/od.c (check_and_close, dump, dump_strings): Likewise.
730 * src/uniq.c (check_file): Likewise.
732 * src/join.c (get_line): Report error right away if I/O fails,
733 so that the proper errno value is used.
734 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
735 * src/tee.c (tee): Likewise.
736 * src/uniq.c (check_file): Likewise.
738 * src/od.c (skip): If a read fails, don't retry it later, so
739 that we report the proper errno.
741 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
743 * src/tee.c (tee): Once a write failure has occurred, don't bother
744 writing anything more to that stream.
746 * src/uniq.c (check_file): Check for ferror (stdout) even if
749 * src/yes.c (UNROLL): Remove.
750 (main): Exit immediately when write failure is detected.
751 Simplify code by assigning to argv when argc == 1.
753 2003-09-21 Paul Eggert <eggert@twinsun.com>
755 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
756 (WRITTEN_BY): Change "Franc,ois" (actually using
757 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
760 2003-09-19 Jim Meyering <jim@meyering.net>
762 `du -D symlink-to-dir' would mistakenly omit the slash in
763 lines like this: 24 symlink-to-dir/subdir
764 * src/du.c (process_file): Fix offset calculation.
765 Reported by Jeff Sheinberg as Debian bug #211591;
766 http://bugs.debian.org/205251
768 * tests/du/deref-args: New file/test for the above.
769 * tests/du/Makefile.am (TESTS): Add deref-args.
771 * src/du.c (process_file): Remove useless disjunct.
773 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
775 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
776 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
777 Mark each WRITTEN_BY string as translatable.
779 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
780 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
781 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
782 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
783 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
784 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
785 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
786 * who.c, whoami.c, yes.c: Revert yesterday's changes.
787 Instead, a subsequent change will embed `Written by ' in
788 each string along with the author names.
790 * src/true.c: Revert yesterday's changes.
791 * src/sys2.h: Likewise.
793 2003-09-18 Jim Meyering <jim@meyering.net>
795 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
796 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
797 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
798 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
799 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
800 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
801 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
802 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
803 comma-separated list of strings and/or update the call to
804 parse_long_options so that `AUTHORS, NULL' are the last parameters.
805 * src/true.c (main): Append NULL to version_etc argument list.
806 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
808 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
809 shadowing the math function name. Also rename loga to log_a.
811 2003-09-14 Jim Meyering <jim@meyering.net>
813 * src/factor.c (print_factors): Give a separate diagnostic
814 for numbers that are too large, but otherwise valid.
815 Reported by Dániel Varga.
817 2003-09-10 Jim Meyering <jim@meyering.net>
819 * Use automake-1.7.7. Regenerate dependent files.
821 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
822 of `fmt -1'. Using the just-built tr is a little cleaner.
823 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
824 * man/Makefile.am (programs, check-x-vs-1): Likewise.
826 2003-09-09 Jim Meyering <jim@meyering.net>
828 * src/copy.c: Alphabetize includes.
829 Remove duplicate inclusion of "same.h".
831 2003-09-08 Jim Meyering <jim@meyering.net>
833 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
834 Didn't give enough of a benefit, mainly because it's not yet
839 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
840 (check-programs-vs-x): Fail if $(programs) is empty.
842 * src/remove.c: Add a comment.
844 2003-09-07 Jim Meyering <jim@meyering.net>
846 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
847 Don't define. These symbols are no longer used.
849 * tests/misc/tty-eof: Write ^D as \cD.
850 Complete the change of 2003-08-02.
852 * Makefile.maint (po-check): Use cvsu, so that a temporary source
853 file in lib/ or src/ doesn't induce an unwarranted failure.
854 Add a kludge to filter out the sole generated source file that
855 also has translatable messages: src/false.c.
857 2003-09-06 Jim Meyering <jim@meyering.net>
859 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
860 (parse_options): Give a diagnostic for (but still accept) the
861 deprecated --allow-missing option.
863 2003-09-04 Paul Eggert <eggert@twinsun.com>
865 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
866 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
868 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
869 size_bound ourselves. if an input file is a pipe and the user
870 specified a size, use that size instead of trying to guess the
871 pipe size. This has the beneficial side effect of avoiding the
872 overhead of default_sort_size in that case. All callers changed.
873 (sort): Remove static var size; now done by sort_buffer_size.
875 2003-09-05 Jim Meyering <jim@meyering.net>
877 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
879 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
880 to start, rather than just .1. Upon failure, print unexpected state.
882 2003-09-04 Paul Eggert <eggert@twinsun.com>
884 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
885 SAFE_READ_ERROR to tmp->nbytes.
886 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
888 * src/head.c (struct linebuffer): Change nbytes and nlines
889 from unsigned int to size_t. unsigned int is safe (after the
890 2003-09-03 patch) but size_t is cleaner.
891 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
892 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
894 Standardize on BUFSIZ as opposed to other macro names and values.
895 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
896 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
897 stdio.h has always defined it,
898 and other code already assumes it's defined.
899 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
900 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
901 (io_buf): IO_BUF_SIZE -> BUFSIZ.
903 2003-09-04 Paul Eggert <eggert@twinsun.com>
905 * src/seq.c (step): Default to 1.
906 (print_numbers): Allow the output to be empty.
907 (main): The default step is 1, even if LAST < FIRST;
908 as per documentation.
909 * tests/seq/basic (onearg-2): Output should be empty.
911 2003-09-05 Jim Meyering <jim@meyering.net>
913 * Makefile.cfg (wget_files): Temporarily disable, until master
914 versions are restored to ftp.gnu.org.
916 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
918 Make seq's --width (-w) option work properly even when the
919 endpoint requiring the larger width is negative and smaller than
921 * src/seq.c (get_width_format): Include `-' in the set of bytes
922 allowed in a `simple' number (no decimal point, no exponent).
923 Reported by Patrick Mauritz.
925 2003-09-02 Paul Eggert <eggert@twinsun.com>
927 * NEWS: sort -t '\0' now uses a NUL tab.
928 sort option order no longer matters, unless POSIX requires it.
929 * src/sort.c (usage): Say "blanks" instead of "whitespace",
930 Similar fixes for many comments.
931 (TAB_DEFAULT): New constant, so that we can support NUL as
933 (tab): Now int, not char. Initialize to TAB_DEFAULT.
934 (specify_sort_size): If multiple sizes are specified, use the largest.
935 (begfield, limfield): Support NUL tab char.
936 (set_ordering): Do not let -i override -d.
937 (main): Report an error if incompatible -o or -t options are given.
938 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
940 2003-09-05 Jim Meyering <jim@meyering.net>
942 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
944 2003-09-03 Andreas Schwab <schwab@suse.de>
946 Bug report and patch here:
947 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
948 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
949 * src/head.c (elide_tail_lines_pipe): Likewise.
951 2003-09-03 Jim Meyering <jim@meyering.net>
953 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
954 small amount of code from him was first moved to lib/human.c, and was
955 subsequently rewritten entirely.
956 * src/df.c (AUTHORS): Likewise.
958 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
960 * src/md5sum.c (split_3): Accept the BSD format for generic
961 message digest modes. Currently works with BSD's MD5 and SHA1
962 formats since these are the two algorithms presently used in
963 coreutils. Updated comments to reflect this change.
964 (bsd_split_3): Updated comments.
966 * tests/md5sum/basic-1: New test to make sure that
967 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
968 from `check-bsd' test in tests/sha1sum/basic-1).
970 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
971 --check exit status and BSD SHA1 format (adapted from tests
972 in tests/md5sum/basic-1).
974 2003-08-30 Jim Meyering <jim@meyering.net>
976 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
978 When source and destination arguments refer to the same file, reside
979 on a partition (e.g. VFAT) on which distinct names may refer to the
980 same directory entry (often due to variations in case), and when the
981 link count for the file is 1, mv no longer unlinks the file. Instead,
982 it gives the expected diagnostic that the source and destination are
983 the same. WARNING: this is an incomplete fix. If the file happens
984 to have a link count of 2 or greater, such an erroneous mv command
985 will still unlink it.
986 Although that is not possible on vfat or umsdos, it is possible on
987 other file system types, e.g., ntfs, and hpfs.
988 * src/copy.c (same_file_ok): Invoke same_name (which might still
989 return false for names that refer to the same directory entry)
990 only if the link count is 2 or more.
991 * tests/mv/vfat: Show how to demonstrate the above problem.
992 This test is not run.
993 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
995 2003-08-27 Jim Meyering <jim@meyering.net>
997 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
998 who's -l option has been eliciting an unconditional warning about
999 this impending change since sh-utils-2.0.12 (April 2002).
1001 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1002 This would happen for nonempty files not ending with a newline.
1003 Reported by Dan Jacobson.
1004 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1005 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1007 * src/stat.c (print_it): Avoid buffer overrun that would
1008 occur when the user-specified format string ends with `%'.
1009 Patch by Tommi Kyntola.
1010 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1011 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1013 2003-08-26 Jim Meyering <jim@meyering.net>
1015 Apply changes from bison.
1016 * GNUmakefile (SHELL): Define to `sh', if necessary.
1018 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1019 Update all uses of $(WGET).
1021 2003-08-22 Akim Demaille <akim@epita.fr>
1023 * Makefile.cfg (local-checks-to-skip): New.
1024 * Makefile.maint (local-check): Rename as...
1025 (local-checks-available): this.
1028 2003-08-26 Akim Demaille <akim@epita.fr>
1030 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1031 "<\#" to avoid magic from Gnus when posting parts of this script.
1033 2003-08-25 Jim Meyering <jim@meyering.net>
1035 * src/stat.c (main): Warn about use of deprecated `-l' option.
1037 2003-08-22 Jim Meyering <jim@meyering.net>
1039 * src/stat.c (do_stat): For link count at end of line, use %h format,
1040 instead of %-5h. The latter would make stat emit trailing spaces.
1041 Reported by Dan Jacobson.
1043 2003-08-20 Jim Meyering <jim@meyering.net>
1045 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1047 2003-08-19 Jim Meyering <jim@meyering.net>
1049 * src/system.h: Include stdlib.h unconditionally,
1050 as we're now assuming that part of hosted C89.
1052 2003-08-18 Jim Meyering <jim@meyering.net>
1054 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1055 to avoid warnings from gcc.
1057 2003-08-17 Jim Meyering <jim@meyering.net>
1059 Avoid unnecessary and sometimes time-consuming hostname lookups.
1060 * src/who.c (print_user): Use strchr, not strrchr.
1061 * src/pinky.c (print_entry): Likewise.
1062 Patch by Michael Stone.
1063 This fixes a typo I introduced in who-users.c on 1996-02-23.
1065 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1066 disallowed between `@...@'.
1068 2003-08-16 Paul Eggert <eggert@twinsun.com>
1070 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1071 done by gnulib .m4 files.
1072 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1073 * src/sys2.h (strtoull): Remove unused declaration.
1075 2003-08-16 Jim Meyering <jim@meyering.net>
1077 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1080 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1081 race condition bug. The bug would be triggered when tailing a file
1082 with file pointer not at beginning of file, and where the file was
1083 truncated to have a length of less than the initial offset at just
1084 the right moment (between the two lseek calls in this function).
1086 An invalid initial value for *read_pos would result in
1087 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1088 busy-wait rather than sleeping between iterations. The bug manifests
1089 itself only when tailing regular files that are initially nonempty.
1090 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1092 (tail_lines): Likewise, after lseek calls.
1093 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1094 * tests/tail-2/tail-n0f: New file. Test for above fix.
1095 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1097 2003-08-15 Jim Meyering <jim@meyering.net>
1099 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1100 (sc_sun_os_names): Likewise.
1101 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1103 * man/help2man: Remove some SPACEs before TAB.
1105 2003-08-14 Paul Eggert <eggert@twinsun.com>
1107 * Makefile.maint (LC_ALL): Set to C.
1108 * man/Makefile.am (ASSORT): New var.
1109 (check-x-vs-1, programs): Use it.
1110 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1111 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1113 2003-08-11 Jim Meyering <jim@meyering.net>
1115 fold -s -wN would infloop for N < 8 with TABs in the input.
1116 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1117 * src/fold.c (fold_file): Move contents of `else'-block
1118 out of conditional so it's used also for --spaces (-s).
1119 * tests/misc/fold: Test for the above fix.
1120 * tests/misc/Makefile.am (TESTS): Add fold.
1122 2003-08-10 Jim Meyering <jim@meyering.net>
1124 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1125 system.h so the types from time.h and sys/time.h are available.
1126 It appears that this is necessary for OpenBSD, NetBSD, and
1127 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1129 2003-08-06 Paul Eggert <eggert@twinsun.com>
1131 * NEWS: Add support for setting file timestamps to microsecond
1132 resolution, on hosts that support this.
1133 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1134 * src/copy.c (copy_internal):
1135 Set file timestamps with utimens, not utime.
1136 * src/cp.c (re_protect): Likewise.
1137 * src/install.c (change_timestamps): Likewise.
1138 * src/touch.c (newtime, touch, main): Likewise.
1140 2003-08-09 Jim Meyering <jim@meyering.net>
1142 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1144 (syntax-check-rules): Add it.
1146 * src/tail.c (main): Tweak Solaris OS version number in comment.
1147 * src/wc.c (wc): Likewise
1148 * tests/tail-2/fflush: Likewise.
1150 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1151 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1153 2003-08-08 Paul Eggert <eggert@twinsun.com>
1155 Use new gnulib 'extensions' module.
1156 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1159 2003-08-08 Paul Eggert <eggert@twinsun.com>
1161 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1163 2003-08-09 Jim Meyering <jim@meyering.net>
1165 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1166 For tests of obsolete behavior, don't presume that unsetting
1167 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1169 2003-08-07 Paul Eggert <eggert@twinsun.com>
1171 * doc/coreutils.texi (split invocation):
1172 Add -d or --numeric-suffixes option to 'split'.
1173 From a suggestion by Jesse Kornblum.
1174 * src/split.c (suffix_alphabet): New var.
1175 (longopts, usage, next_file_name, main): Support -d.
1176 (next_file_name, main): Allow -a0, as POSIX requires.
1177 (next_file_name): Don't assume ASCII-like encoding;
1178 'a' through 'z' are not contiguous in EBCDIC.
1180 2003-08-05 Paul Eggert <eggert@twinsun.com>
1182 Merge getline from gnulib.
1183 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1184 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1185 New files, from gnulib.
1186 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1187 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1188 getdelim2.h to getndelim2.c and getndelim2.h.
1189 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1190 checking for getdelim.
1191 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1192 than rolling our own.
1193 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1194 (cut_fields): Invoke getndelim2 rather than getdelim2.
1196 2003-08-04 Jim Meyering <jim@meyering.net>
1198 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1199 and for the indices to iterate through nsigs.
1201 2003-08-02 Paul Eggert <eggert@twinsun.com>
1203 * src/sort.c: Minor code cleanups, mostly to use more accurate
1204 types and to remove unnecessary casts.
1205 (min, max): Remove. All uses changed to MIN and MAX.
1206 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1207 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1208 keyfield.numeric, struct keyfield.general_numeric, struct
1209 keyfield.month, struct keyfield.reverse, reverse, unique,
1210 have_read_stdin): Now bool, not int. All uses changed.
1211 (eolchar): Now char, not int.
1212 (struct keyfield.ignore): Now bool const *, not int *.
1213 (struct keyfield.translate): Now char const *, not char *.
1214 (struct month.name): Likewise.
1215 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1216 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1217 check, sort, main): Use const * pointers when possible.
1218 (month_cmp): Rewrite to avoid casts.
1219 (inittables): Initialize tables unconditionally, to avoid branches.
1220 (fillbuf): Return bool, not int. All uses changed.
1221 (fillbuf, keycompare, new_key, main):
1222 Use SIZE_MAX rather than (size_t) -1.
1223 (trailing_blanks): Renamed from trim_trailing_blanks.
1224 Return the number of blanks to trim. All uses changed.
1225 (getmonth): Use trailing_blanks rather than open code.
1226 (keycompare): Do not cast char * to unsigned char *; not needed.
1227 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1229 (compare, main): Use | rather than || to avoid jumps.
1230 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1232 (check, first_same_file, sort, main):
1233 Use bool instead of int local vars when possible.
1234 (check): Merge the old 'checkfp' and 'check' into a single function,
1235 that returns a boolean (true if the file was ordered).
1237 (main): Use int instead of unsigned for iterating through nsigs.
1238 Rename local var "posix_pedantic" to "posixly_correct".
1240 2003-08-02 Jim Meyering <jim@meyering.net>
1242 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1243 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1245 * src/cut.c (cut_fields): Don't read again after encountering an
1246 initial EOF. E.g., `cut -f2' would do so.
1247 * tests/misc/tty-eof: Add a test for the above fix.
1249 * src/sort.c (sortlines): Add description and references.
1252 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1253 the tests in help-version will use the just-built binaries.
1254 Reported by Christian Krackowizer.
1256 2003-07-31 Paul Eggert <eggert@twinsun.com>
1258 * NEWS: Add --rfc-2822 option to GNU date.
1259 * doc/coreutils.texi (Time directives, Options for date, Examples
1261 * src/date.c (long_options, usage, main): Likewise.
1262 * doc/getdate.texi (General date syntax): Likewise.
1263 * doc/coreutils.texi (Options for date): Fix a typo in format:
1264 it's now %d not %_d. Add URLs.
1266 2003-08-01 Jim Meyering <jim@meyering.net>
1268 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1269 Otherwise, with at least the /bin/sh from HPUX 10.20,
1270 the trap code would end up converting that to exit 1 and thus an
1271 unexpected test failure. Reported by Christian Krackowizer.
1273 2003-07-31 Paul Eggert <eggert@twinsun.com>
1275 * src/ptx.c: Do not include bumpalloc.h.
1276 (WORD_TABLE): New member alloc.
1277 (ALLOC_NEW_WORD): Remove.
1278 (occurs_alloc): New var.
1279 (digest_word_file, find_occurs_in_text): Check for arithmetic
1280 overflow when computing table size. Use xrealloc rather than
1281 bumpalloc primitives.
1283 2003-07-29 Jim Meyering <jim@meyering.net>
1287 * README: When running tests as root, suggest using
1288 sudo with NON_ROOT_USERNAME=$USER.
1290 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1293 2003-07-28 Jim Meyering <jim@meyering.net>
1295 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1297 2003-07-28 Paul Eggert <eggert@twinsun.com>
1299 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1300 an enum type, so that it's guaranteed to promote to int.
1301 * src/sort.c (sortlines_temp): Undo previous change.
1303 2003-07-28 Jim Meyering <jim@meyering.net>
1305 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1306 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1307 would cause lines[-1 - swap] (with swap = false) to evaluate to
1310 2003-07-27 Jim Meyering <jim@meyering.net>
1312 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1313 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1315 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1316 directories, as required by POSIX. Reported by Karl Berry.
1317 * tests/rm/dir-no-w: New file. Test for the above fix.
1318 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1320 * tests/mk-script: Emit `$xx', not its expansion.
1322 2003-07-27 Paul Eggert <eggert@twinsun.com>
1324 This change was inspired by a similar proposal by Stepan Kasal.
1325 * src/sort.c (mergelines, sortlines_temp): New functions.
1326 (sortlines): Use them, to reduce the number of times that
1327 we need to copy 'struct line' values. This improved CPU
1328 performance by about 30% on one 18 MB test.
1329 (sort): Don't invoke sortlines unless we have 2 or more lines.
1331 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1333 * src/sort.c (sort): Don't require two `struct line's per text line,
1334 the new sort algorithm requires just 1.5.
1336 2003-07-27 Jim Meyering <jim@meyering.net>
1338 * src/pathchk.c (validate_path): Use %lu, not %ld.
1340 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1342 * src/ls.c (sort_files): Put `volatile' in the right place.
1345 2003-07-26 Jim Meyering <jim@meyering.net>
1347 Use only one bit per field/offset in array, not one `int'.
1348 * src/cut.c (printable_field): Change type to `unsigned char'.
1349 (mark_printable_field, is_printable_field): New functions.
1350 Use them in place of all direct accesses of `printable_field'.
1352 * src/expand.c (parse_tabstops): Detect overflow properly.
1353 * src/cut.c (set_fields): Likewise.
1355 * src/rm.c: Include "dirname.h".
1356 (usage): Use base_name (program_name) in body of --help output.
1358 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1359 Idea from Brendan O'Dea, who suggested using
1360 `program_name = basename (argv[0]);' everywhere --
1361 can't do that, but using base_name works just fine here.
1363 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1365 2003-07-24 Paul Eggert <eggert@twinsun.com>
1367 Fix some POSIX-compliance problems with 'test'. This makes
1368 'test' more compatible with Bash.
1370 * NEWS, doc/coreutils.texi: Document the following.
1371 * src/test.c: Include exitfail.h.
1372 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1373 (test-syntax_error): Use it.
1374 (binary_operator): Now takes bool arg specifying whether left operand
1375 is -l ARG, so that caller determines this rather than us.
1377 (term): Use posixtest to evaluate parenthesized subexpressions.
1378 (unary_operator, one_argument): Remove support for -t without operand.
1379 (one_argument): Take argument from argv[pos].
1380 (one_argument, two_arguments, three_arguments): Advance pos.
1381 All callers changed.
1382 (three_arguments): Look for binary ops before "!". Then look
1383 for parenthesized one_argument expressions, instead of trusting
1384 expr () to do the right thing.
1385 (posixtest): Now takes number of args. All callers changed.
1386 Treat "( A B )" like "A B".
1387 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1388 POSIXLY_CORRECT, as we now conform to POSIX by default.
1389 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1390 * tests/test/Test.pm (test_vector): Add several tests to check
1391 the above. Syntax errors now exit with status 2, not 1.
1392 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1394 2003-07-26 Jim Meyering <jim@meyering.net>
1396 * tests/help-version: Adjust for above change in test behavior:
1397 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1399 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1400 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1402 * Makefile.maint (sc_system_h_headers): Another syntax check.
1403 (syntax-check-rules): Add it to the list.
1405 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1406 so it matches `%ld' format even on 32-bit systems.
1408 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1409 avoid warning on 64-bit systems.
1411 * src/ls.c (sort_files): Make `func' volatile, so it can't be
1412 clobbered by a `longjmp' into this function.
1414 2003-07-25 Jim Meyering <jim@meyering.net>
1416 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
1419 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
1420 because it'd evoke spurious failure on 64-bit systems.
1422 2003-07-24 Jim Meyering <jim@meyering.net>
1424 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
1425 output its current record counts. Reported by Jurriaan.
1427 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
1428 `wc' with no options. This goes along with the change of 2003-07-20.
1430 2003-07-23 Jim Meyering <jim@meyering.net>
1432 Don't include headers already included by system.h:
1433 * src/tr.c: Don't include errno.h.
1434 * src/true.c: Don't include version-etc.h.
1435 * src/test.c: Don't include limits.h or error.h.
1436 * src/stat.c: Don't include unistd.h or time.h.
1437 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
1438 * src/pr.c: Don't include time.h.
1439 * src/pathchk.c: Don't include errno.h.
1440 * src/nice.c: Don't include sys/time.h.
1441 * src/ls.c: Don't include stdlib.h.
1443 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
1444 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
1445 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
1446 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
1447 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
1448 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
1449 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
1450 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
1451 Don't include closeout.h.
1453 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
1454 can access the required version of rm.
1455 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
1457 * tests/cut/Test.pm (out-delim3a): New test.
1459 * man/help2man: Update to version 1.33.
1461 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
1463 * src/dircolors.c: Include xstrndup.h.
1464 (xstrndup): Remove function, now that it's been factored out into
1467 2003-07-22 Paul Eggert <eggert@twinsun.com>
1469 * src/wc.c (wc): Fix typo in computation of file from file_x,
1470 which caused the former to be used uninitialized if file_x was
1473 2003-07-22 Jim Meyering <jim@meyering.net>
1475 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
1477 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
1478 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
1479 Thomas Luzat. See http://bugs.debian.org/202413 for details.
1481 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
1483 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
1485 * src/cut.c (set_fields): Mark all selected indices before trying to
1486 determine range endpoints.
1487 * tests/cut/Test.pm: New test for the above fix.
1489 Begin to address this comment: What if someone wants to
1490 extract the 1,000,000-th field of some huge input file?
1491 The first step is to rearrange things so that the values
1492 in the printable_field array are all 0/1 rather than 0/1/2.
1493 * src/cut.c (RANGE_START_SENTINEL): Remove.
1494 Store range-start indices in a hash table, rather than
1495 overloading the `printable_field' array.
1496 (range_start_ht): New global.
1497 (hash_int, hash_compare_ints, is_range_start_index): New functions.
1498 (print_kth): Use is_range_start_index; don't test printable_field.
1499 (set_fields): Detect overflow.
1500 (set_fields): Insert each range-start index into range_start_ht.
1501 (main): Call set_fields only once, and only after
1502 output_delimiter_specified and (if required) range_start_ht have
1505 2003-07-20 Paul Eggert <eggert@twinsun.com>
1507 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
1508 invoked with a null pointer when there were no file arguments.
1510 2003-07-20 Jim Meyering <jim@meyering.net>
1512 * Makefile.maint (sc_changelog): Add another nit-picky check.
1514 * src/wc.c (write_counts): Add a comment.
1515 (wc): Rename `file' parameter.
1516 Set new local, `file', to be the file name, or (when it's NULL)
1517 _("standard output") so that all uses of `file' use the proper value.
1518 Use STREQ, not strcmp.
1520 2003-07-20 Paul Eggert <eggert@twinsun.com>
1522 wc count field widths now are heuristically adjusted depending
1523 on the input size, if known. If only one count is printed, it
1524 is guaranteed to be printed without leading spaces.
1526 Previously, wc did not align the count fields if
1527 POSIXLY_CORRECT was set, but POSIX did not actually require
1528 this undesirable behavior, so it has been removed.
1530 * NEWS: Document this.
1531 * doc/coreutils.texi (wc invocation): Likewise.
1533 * src/wc.c (number_width): New var.
1534 (posixly_correct): Remove.
1535 (struct fstatus): New struct.
1536 (write_counts): Output fields of width number_width.
1537 Do not worry about POSIXLY_CORRECT.
1538 Use null file, not empty-string file, to denote stdin,
1539 since "" is a valid file name on some hosts.
1540 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
1542 (wc): Avoid problems if end_pos - current_pos overflows.
1543 Do not print odd message if stdin has a read error.
1544 (get_input_fstatus, compute_number_width): New functions.
1545 (main): Use them to implement the new behavior.
1546 Ignore POSIXLY_CORRECT.
1548 * tests/wc/Test.pm: Adjust to the new output widths.
1550 2003-07-19 Jim Meyering <jim@meyering.net>
1552 * tests/rm/fail-eperm: Don't create temporary directory --
1555 * tests/shred/remove: Don't open-code test for UID != 0.
1556 Use priv-check's require-non-root instead.
1557 Update to use newer framework.
1559 * tests/help-version (expected_failure_status_expr): Record that
1560 expr exits with status of 3 for e.g., a write error.
1562 * tests/priv-check: Use `id -u' to see if we're running as root,
1563 rather than trying go write to an write-protected file.
1564 When running as root, ensure $NON_ROOT_USERNAME is valid.
1565 When running as root with `require-non-root', ensure that `.'
1566 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
1567 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
1569 * src/printenv.c: Include "exitfail.h".
1570 (main): Set exit_failure rather than calling close_stdout_set_status.
1571 * src/date.c: Likewise.
1572 * src/sort.c: Likewise.
1573 * src/tty.c: Likewise.
1575 2003-07-18 Jim Meyering <jim@meyering.net>
1577 * tests/touch/not-owner: Update to use newer framework.
1579 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
1580 directory, and remove Perl-coded `you may not run as root' test.
1581 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
1582 hard-coding something not quite equivalent.
1583 Paul Jarc reported the inconsistent diagnostics.
1585 * src/sort.c (main): Use close_stdout via atexit.
1586 Now `sort --version' and `sort --help' fail, as they should
1587 when their output is redirected to /dev/full.
1589 * src/su.c (usage): Don't call close_stdout here.
1590 (main): Use close_stdout via atexit.
1591 Now `su --version > /dev/full' fails, as it should.
1592 Somehow, the change of 2000-05-07 that purports to fix this
1595 * tests/help-version (--help/--version vs. /dev/full): Special-case
1596 `[' to protect it from expected_failure_status-`eval'.
1598 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
1599 count and the corresponding line, as required by POSIX.
1600 Reported by Clement Wang.
1601 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
1603 * tests/expr/basic: Add tests for when exit status is 2.
1605 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
1606 Use an anonymous `enum', rather than #define.
1608 2003-07-17 Paul Eggert <eggert@twinsun.com>
1610 * src/expr.c: Include "exitfail.h", "quotearg.h".
1611 (EXPR_INVALID, EXPR_ERROR): New constants.
1612 (nomoreargs, null, toarith, nextarg): Return bool, not int.
1613 (syntax_error): New function, exiting with status 2. Use it
1614 insteading of printing "syntax error" ourselves.
1615 (main): Initialize exit_failure to EXPR_ERROR.
1616 Exit with EXPR_INVALID on syntax error (too few arguments).
1617 (nextarg): Use strcmp, not strcoll; strcoll might return
1618 an undesirable 0, or might fail.
1619 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
1620 or other such error.
1621 (eval2): Report an error if strcoll fails in a string comparison.
1622 * src/sort.c: Include "exitfail.h".
1623 (main): Set exit_failure, not xalloc_exit_failure and
1624 xmemcoll_exit_failure.
1625 * tests/expr/basic: Invalid value exits with status 3, not 2.
1627 2003-07-16 Jim Meyering <jim@meyering.net>
1629 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
1630 per GNU maintainer guidelines. The next non-beta release will be 5.1.
1632 This script would have caught at least two recent bugs:
1633 those in [ and kill.
1634 * tests/help-version: Revive this script.
1635 It wasn't doing anything useful, since $all_programs wasn't being
1636 defined by the invoking Makefile.am.
1637 Reflect that nohup is no longer a script, so don't exclude it.
1638 Add framework to handle the programs added since it was last run:
1639 kill, stat, unlink, [, link, readlink.
1640 Fix path-related problems deriving from the move of this script
1641 from src/ to its present location.
1642 * tests/Makefile.am (all_programs): Define.
1643 (TESTS_ENVIRONMENT): Use it.
1645 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
1646 whereby kill would always attempt to operate on argv[0] and fail.
1648 * src/test.c (integer_expected_error): Improve diagnostic -- now,
1649 it also matches the one from bash's builtin test.
1650 (binary_operator): Add \n at end of diagnostic.
1652 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
1653 * tests/priv-check: Move setuidgid-related and
1654 NON_ROOT_USERNAME-checking code to this file.
1656 * README: Update section on testing as `root'.
1657 Suggestion from Paul Jarc.
1659 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
1660 names of authors that I just found in bash's builtins/test.def.
1662 Running `[' with no arguments would evoke a segfault.
1663 * src/test.c (main) [LBRACKET]: Move initialization of argv to
1664 precede potential use via test_syntax_error.
1666 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
1667 warning from automake -Wall.
1669 2003-07-15 Jim Meyering <jim@meyering.net>
1673 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
1676 * announce-gen (print_changelog_deltas): Relax tests for matching
1677 version-number line in NEWS.
1678 Change the .sig suffix to .asc here, too.
1680 2003-07-14 Jim Meyering <jim@meyering.net>
1682 * Makefile.maint (%.asc): Renamed from %.sig.
1683 Generate and use ascii-armored signatures.
1684 Use gpg's -o option.
1686 2003-07-13 Jim Meyering <jim@meyering.net>
1688 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
1691 * Makefile.maint (syntax-check): Move each individual check into
1693 (syntax-check-rules): This is the list of syntax-check targets.
1694 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
1695 (sc_cast_of_x_alloc_return_value, sc_space_tab):
1696 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
1698 2003-07-12 Jim Meyering <jim@meyering.net>
1700 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
1701 traces of the nohup script.
1703 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
1704 $(OPTIONAL_BIN_ZCRIPTS).
1706 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
1707 target, not before the `>'.
1709 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
1710 now that that function no longer calls `error'.
1712 * src/df.c (find_mount_point): Emit a diagnostic for each
1713 failed syscall, rather than relying on caller to do that.
1714 The caller couldn't do a good job, anyhow -- too many different
1715 ways to fail (each with a different referent).
1716 Give a diagnostic upon failed save_cwd, now that that function
1717 no longer calls `error'.
1718 (show_point): Don't diagnose find_mount_point's errors, now that
1719 it handles them itself.
1721 * src/df.c (find_mount_point): Don't let free clobber errno upon
1724 * src/sys2.h: Remove alloca-related block.
1725 * src/system.h: Include <alloca.h> here, instead.
1727 It appears that the `#pragma alloca' included via "system.h" is
1728 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
1729 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
1730 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
1732 * src/chown-core.c (change_file_owner): Do not restore any special
1733 permission bits (e.g., set-user-ID, set-group-ID) that are reset
1734 by chown(2) on some systems. Suggestion and insistence :-) from
1737 * tests/input-tty: Also check `test -t 1'.
1738 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
1739 test would block when run in the background.
1741 2003-07-11 Jim Meyering <jim@meyering.net>
1743 * tests/sample-test: Also fail if cat-to-create-expected-output
1744 fails. Otherwise, if both `exp' and `out' were to end up empty
1745 because of e.g., a full disk, they would mistakenly compare equal.
1747 * src/nohup.c: New file. Rewrite of nohup.sh in C.
1748 This solves a portability problem: on at least Solaris systems,
1749 when nohup.sh used the vendor /bin/sh, it would exit with status
1750 of `1' rather than the required 126 or 127 upon failure to exec
1751 the specified program.
1753 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
1754 (bin_PROGRAMS): Add nohup.
1755 (EXTRA_DIST): Remove nohup.sh.
1756 (all_programs): Remove use of $(EXTRA_SCRIPTS).
1757 * src/nohup.sh: Remove file.
1758 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
1760 * tests/misc/nohup: Tests for the above.
1761 * tests/misc/Makefile.am (TESTS): Add nohup.
1763 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
1764 the macro, COPY_FD_DIAGNOSE.
1765 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
1766 (head_file): Likewise.
1768 * src/date.c: Include "quote.h".
1769 (batch_convert): Use the quote function rather than using literal `...'
1772 * src/setuidgid.c (main): Enclose diagnostic in _(...).
1773 * src/fmt.c (main): Likewise.
1774 * src/mknod.c (main): Likewise.
1775 * src/tac.c (tac_seekable): Likewise.
1776 * src/yes.c (main): Likewise.
1777 * src/od.c (main): Likewise.
1778 * src/install.c (change_attributes): Likewise.
1780 2003-07-10 Jim Meyering <jim@meyering.net>
1782 * src/head.c (usage): Use 1024*1024 in place of 1048576.
1783 * src/tail.c (usage): Likewise.
1785 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
1786 place of the kludge in this test. Suggestion from Paul Jarc.
1788 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
1789 * src/setuidgid.c: New program, solely for testing (not installed).
1791 * src/chown-core.c (change_file_owner): Don't leak file descriptors
1792 when dereferencing symlinks.
1794 2003-07-09 Jim Meyering <jim@meyering.net>
1796 * tests/du/slash: New file/test for today's lib/ftw.c fix.
1797 * tests/du/Makefile.am (TESTS): Add slash
1799 * src/tail.c (xlseek): Avoid warning about ``return without value
1800 from function returning non-void''.
1802 2003-07-08 Jim Meyering <jim@meyering.net>
1804 * man/help2man: Update to version 1.29.
1806 * man/help2man: Add END handler to close STDOUT and check for errors.
1808 2003-06-30 Paul Eggert <eggert@twinsun.com>
1810 Add support for a "[" that conforms to the GNU coding standards,
1811 i.e., that does not depend on its name.
1812 * src/lbracket.c: New file.
1814 * man/Makefile.am (programs): Ignore "[", since it doesn't have
1815 a separate man page.
1816 * src/Makefile.am (bin_PROGRAMS): Add "[".
1817 (__SOURCES): New var.
1818 * src/test.c (LBRACKET): Define to 0 if not defined.
1819 (main): Use LBRACKET rather than argv[0].
1821 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
1822 Reported by Paul Jarc and Dan Jacobson.
1824 * src/test.c (main): Do not recognize --help or --version if
1825 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
1826 Do not bother testing that margv[margc] is non-null.
1828 2003-07-04 Jim Meyering <jim@meyering.net>
1830 * src/who.c (print_line): Rewrite to use asprintf, in order to be
1831 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
1833 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
1834 option, and perform the +1600 invocations of head IFF the envvar
1835 RUN_EXPENSIVE_TESTS is set.
1837 2003-07-03 Jim Meyering <jim@meyering.net>
1839 * src/cp.c (do_copy): Give a better diagnostic when failing due
1840 to nonexistent destination directory. Reported by Dmitry Rutsky.
1841 See http://bugs.debian.org/199730 for details.
1843 2003-06-27 Jim Meyering <jim@meyering.net>
1845 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
1846 * src/split.c (longopts): Use `1', not `0' as the value for
1847 for &verbose. Reported by Keith Thompson.
1849 Test for the above fix.
1850 * tests/misc/split-a: Also use --verbose and compare stderr
1851 output with what we'd expect.
1853 2003-06-20 Jim Meyering <jim@meyering.net>
1855 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
1856 Use `error_t' (rather than int) as type for local `err'.
1857 From Alfred M. Szmidt.
1859 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
1861 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
1862 Fix author preservation code.
1864 2003-06-19 Jim Meyering <jim@meyering.net>
1866 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
1867 (do_link): Don't warn about hard link to symlink.
1869 2003-06-18 Jim Meyering <jim@meyering.net>
1871 * src/cut.c: Include "getdelim2.h", not "getstr.h".
1872 Reflect renaming: getstr -> getdelim2.
1874 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
1875 readline -> readlinebuffer.
1877 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1879 * src/readlink.c: Include <sys/types.h> before system.h (because
1880 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
1882 2003-06-17 Jim Meyering <jim@meyering.net>
1884 * src/system.h (initialize_main): Define.
1885 Use it in every `main'. Applied via this:
1886 p='initialize_main (&argc, &argv);'
1887 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
1888 $(grep -l program_name.=.argv.0 *.c)
1889 test.c uses margc/margv, so I made the change manually for that file.
1890 Based on a patch from Bernard Giroud.
1892 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1894 Fix for build failure on Ultrix 4.3.
1895 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
1896 Include sys/param.h and sys/mount.h on ultrix.
1898 2003-06-16 Jim Meyering <jim@meyering.net>
1900 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
1902 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
1903 them here instead, but with one change: define EISDIR to -1, not 0.
1905 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
1906 guaranteed to be defined.
1907 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
1909 * README: Mention the CVS repository.
1910 Encourage addition of test cases.
1912 2003-06-12 Jim Meyering <jim@meyering.net>
1914 * src/touch.c (touch): Call close only if necessary.
1917 * src/wc.c (usage): Correct wording: wc prints counts in the order
1918 `newline, word, byte'. Reported by Keith M. Briggs.
1919 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
1921 2003-06-10 Jim Meyering <jim@meyering.net>
1923 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
1925 2003-06-07 Jim Meyering <jim@meyering.net>
1927 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
1930 2003-06-06 Jim Meyering <jim@meyering.net>
1932 * src/extract-magic (main): Avoid newer 3-arg form of open,
1933 so this script works also with e.g., perl5.005_03.
1934 Patch by John David Anglin.
1936 2003-06-04 Paul Eggert <eggert@twinsun.com>
1938 * src/system.h: Include <stdbool.h> unconditionally.
1940 2003-06-04 Jim Meyering <jim@meyering.net>
1942 * man/Makefile.am (check-programs-vs-x): Rename target
1943 from check-programs-vs-1. Adjust rule to check for the
1944 primary (.x) file, not the generated one (.1).
1946 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
1948 * man/kill.x: New file.
1949 * man/Makefile.am (dist_man_MANS): Add kill.1.
1952 2003-06-04 Jim Meyering <jim@meyering.net>
1954 Ensure that the .x file for a new program is never forgotten again.
1955 * man/Makefile.am (programs): Define.
1956 (check-programs-vs-1): New phony target.
1957 (check-local): Depend on it.
1959 2003-06-03 Jim Meyering <jim@meyering.net>
1961 Avoid unnecessary copying of environment.
1962 * src/env.c (main): Rather than clearing the environment and --
1963 unless told to ignore environment -- copying all settings from
1964 the saved, original environment, clear the environment only when
1965 that is requested. Suggested by Jens Elkner.
1967 2003-06-02 Jim Meyering <jim@meyering.net>
1969 * src/system.h: Always include <string.h>, since we assume C89.
1970 Include <limits.h> without checking for HAVE_LIMITS_H.
1972 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
1973 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
1975 2003-06-01 Jim Meyering <jim@meyering.net>
1977 Avoid a race condition in `tail -f' described by Ken Raeburn in
1978 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
1979 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
1980 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
1981 (tail_bytes, tail_lines, tail): Likewise.
1982 (tail_file): Use the new `read_pos' value as the size,
1983 rather than stats.st_size from the fstat call.
1985 2003-05-28 Jim Meyering <jim@meyering.net>
1987 * src/extract-magic: Allow expansion of `$file' in the here-
1988 document corresponding to the comment at the top of fs.h.
1990 2003-05-26 Jim Meyering <jim@meyering.net>
1992 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
1993 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
1994 Use #if/#elif/... cascade so we get only one set of include files.
1995 Reported by Nelson Beebe.
1997 2003-05-24 Jim Meyering <jim@meyering.net>
1999 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2000 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2001 accept the BSD format.
2003 2003-03-28 Joe Orton <jorton@redhat.com>
2005 * src/md5sum.c (bsd_split_3): New function.
2006 (split_3): Detect checksums from BSD 'md5' command and handle them
2009 * tests/md5sum/basic-1: New tests for --check exit status, and for
2010 BSD-style checksum files.
2012 2003-05-21 Jim Meyering <jim@meyering.net>
2014 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2015 This sort of thing is why it'd be *Really Good* to factor
2016 out the common code used here and in tail.c.
2018 2003-05-14 Jim Meyering <jim@meyering.net>
2020 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2022 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2024 * tests/du/fd-leak: New file. Test for the bug in du that
2025 was fixed by the 2003-05-12 change to lib/ftw.c.
2026 * tests/du/Makefile.am (TESTS): Add fd-leak.
2028 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2029 includes a translatable word, `and'.
2031 * src/dd.c (usage): Don't use `,' as the thousands separator
2032 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2033 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2034 * src/df.c (usage): Likewise.
2035 * src/du.c (usage): Likewise.
2036 * src/ls.c (usage): Likewise.
2038 * Makefile.maint (syntax-check): Add another check.
2040 2003-05-13 Paul Eggert <eggert@twinsun.com>
2042 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2043 must output nothing. Problem reported by Josh Hyman.
2045 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2046 (output_unique, output_first_repeated, output_later_repeated):
2047 New vars. All uses of "mode" changed to use these variables,
2048 which are not mutually exclusive as "mode" was.
2049 (writeline): New arg "match", used to control whether to
2050 obey output_first_repeated or output_later_repeated.
2051 All callers changed.
2052 (check_file, main): Adjust to above changes.
2054 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2056 2003-05-14 Jim Meyering <jim@meyering.net>
2058 * tests/rm/rm3: Use tr's \n notation rather than \012.
2059 This package can afford to do that, since its tests are guaranteed use
2060 GNU tr, which has accepted the more modern notation for 10 years.
2061 * tests/rm/rm5: Likewise.
2062 * tests/cp/same-file: Likewise.
2063 * tests/stty/row-col-1: Likewise.
2064 * tests/stty/basic-1: Likewise.
2065 * tests/rm/deep-1: Likewise.
2066 * tests/mv/part-symlink: Likewise.
2067 * tests/mkdir/perm: Likewise.
2068 * tests/misc/nice: Likewise.
2070 2003-05-13 Jim Meyering <jim@meyering.net>
2072 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2073 (triple_free): Don't apply cast to argument of free.
2074 (seen_file): Add cast here instead.
2076 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2077 (src_to_dest_free): Don't apply cast to argument of free.
2079 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2080 * src/pr.c (init_fps, init_store_cols): Likewise.
2081 * src/join.c (delseq, freeline): Likewise.
2082 * src/expr.c (OLD): Likewise.
2083 * src/sort.c (sort): Likewise.
2084 * src/head.c (elide_tail_lines_pipe): Likewise.
2086 * src/tail.c: Include "quote.h".
2087 Use quote in diagnostics. Change many error format strings
2088 from just `%s' to e.g., `error reading %s'.
2089 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2090 Rewrite newline-counting loop to use memchr.
2092 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2093 Now that assert is no longer used, don't include <assert.h>.
2095 2003-05-12 Jim Meyering <jim@meyering.net>
2097 * src/head.c: Include <assert.h>.
2098 (AUTHORS): Add my name.
2099 (elide_tail_lines_pipe): New function.
2101 2003-05-10 Jim Meyering <jim@meyering.net>
2103 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2105 * src/readlink.c (main): Set program_name before first use.
2106 Remove that (redundant) first use.
2107 Don't exit successfully just because --verbose was specified.
2108 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2109 parameter is 0, error does not exit.
2111 * src/uname.c (main): When failing due to too many arguments, also say
2112 that, rather than just "Try `uname --help' for more information.".
2113 * src/comm.c (main): Likewise, but for too few arguments.
2114 * src/logname.c: Include error.h.
2115 (main): Say why we're failing.
2117 * src/uniq.c (main): Don't segfault when argc < optind.
2118 * src/who.c (main): Handle argc < optind.
2119 * src/df.c (main): Likewise.
2120 * src/install.c (main): Likewise.
2121 * src/mv.c (main): Likewise.
2122 * src/pwd.c (main): Likewise.
2123 * src/tty.c (main): Likewise.
2124 * src/chroot.c (main): Likewise.
2125 * src/hostname.c: Likewise.
2126 * src/du.c (main): Likewise.
2127 * src/expand.c (main): Likewise.
2128 * src/env.c (main): Likewise.
2129 * src/unexpand.c (main): Likewise.
2130 * src/printenv.c (main): Likewise.
2131 * src/sync.c (main): Handle argc == 0.
2132 * src/expr.c (main): Likewise.
2133 * src/printf.c (main): Likewise.
2134 * src/basename.c (main): Likewise.
2135 * src/ln.c (main): Test for `missing argument' before computing n_files.
2136 * src/tail.c (main): Test for the case of no arguments before
2139 * src/kill.c (send_signals): Don't check command line arguments here.
2140 (main): Check them here instead. Handle argc < optind.
2142 * src/logname.c (main): Use error, rather than fprintf, for the sake
2145 * src/rm.c (main): Don't overrun array bound if argc is 0.
2147 2003-05-09 Jim Meyering <jim@meyering.net>
2149 * src/sort.c (main): Don't overrun array bound if argc is 0.
2150 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2151 Reported by Wartan Hachaturow.
2153 2003-05-07 Jim Meyering <jim@meyering.net>
2155 Implement support so that `head --lines=-N' works on seekable files.
2156 * src/head.c (enum Copy_fd_status): Define.
2157 (COPY_FD_DIAGNOSE): New macro.
2158 (elide_tail_lines_seekable): New funtion.
2159 (elide_tail_lines_file): Call it here.
2161 2003-05-06 Jim Meyering <jim@meyering.net>
2163 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2165 2003-05-04 Jim Meyering <jim@meyering.net>
2167 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2168 caused the addition of thousands of small files to the tar archive.
2169 * tests/misc/head-elide-tail: New file. Add them here instead.
2170 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2172 2003-05-04 Paul Eggert <eggert@twinsun.com>
2174 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2175 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2176 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2177 which was a bit weird because it couldn't be emulated by a function.
2179 2003-05-03 Jim Meyering <jim@meyering.net>
2181 Extend head to accept --lines=-N (--bytes=-N) and to print all
2182 but the N lines (bytes) at the end of the file.
2183 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2184 Use quote() in diagnostics, rather than literal `' marks.
2185 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2187 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2188 (head_file): Reorganize so as to call head from only one place.
2189 (main): Likewise, for head_file.
2190 Handle new, undocumented option, --presume-input-pipe.
2191 Handle negative line and byte counts.
2192 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2194 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2195 sparse files -- otherwise it'd create a file of size 8GB.
2197 2003-05-02 Jim Meyering <jim@meyering.net>
2199 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2200 Instead explain about `-' and standard input.
2201 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2202 Reported by Keith Thompson.
2203 * tests/fmt/basic: Add test for the above fix.
2205 * src/fmt.c: Include "quote.h".
2206 Use quote() in diagnostics, rather than literal `' marks.
2207 (main): Exit nonzero when unable to open an input file.
2208 * tests/fmt/basic: Add test for the above fix.
2210 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2211 specifications like `-72x'.
2212 * tests/fmt/basic: Add test for the above fix.
2214 Work around nasty readdir bug on Darwin6.5.
2215 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2216 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2217 returned NULL and there has been at least one successful unlink or
2218 rmdir call since the opendir or previous rewinddir, then call
2219 rewinddir and reiterate the loop.
2221 Factor out common code.
2222 * src/remove.c (readdir_ignoring_dotdirs): New function.
2223 (is_empty_dir): Use it here.
2224 (remove_cwd_entries): Use it here.
2226 2003-05-01 Jim Meyering <jim@meyering.net>
2228 * tests/rm/r-3: Create 500 rather than just 300 files.
2229 There's a bug in Darwin6.5's readdir that shows up only with
2231 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2235 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2236 (dump_remainder): Move two declarations `down' into the scope
2237 where they are used.
2238 (xlseek): Return the resulting offset.
2239 (file_lines): Rename parameter, file_length, to end_pos.
2240 (pipe_lines): Don't coerce safe_read return value to `int'.
2241 Adapt tests accordingly.
2242 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2244 Change type of `total_bytes' from `int' to `size_t',
2245 since the former wouldn't always be wide enough.
2246 Don't coerce safe_read return value to `int',
2247 and adapt tests accordingly.
2248 Now that testing for a read error no longer involves
2249 using `tmp', handle that case *after* freeing `tmp'.
2250 (start_bytes): Clean up.
2251 (tail_bytes): Now that `n_bytes' may be larger than
2252 OFF_T_MAX, test for that condition and, if it's true, don't
2253 use lseek optimizations.
2254 (parse_options): Don't fail just because N_UNITS is larger than
2255 the maximum size of a file -- tail may be applied to an input
2256 stream (e.g., a pipe) with more data than that.
2258 * Makefile.maint (syntax-check): Rename from alloc-check.
2259 Also check for SPACE-TAB sequences.
2260 Also check for malloc/calloc/realloc casts.
2262 2003-05-01 Jim Meyering <jim@meyering.net>
2264 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2266 2003-04-28 Jim Meyering <jim@meyering.net>
2268 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2269 make the now-more-picky tsort fail.
2271 2003-04-24 Jim Meyering <jim@meyering.net>
2273 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2274 (main): Minor syntactic clean-up.
2276 * src/tsort.c (tsort): Fail if the input contains an odd number of
2277 tokens. Reported by junkio@cox.net.
2279 * tests/tsort/basic-1: Test for the above fix.
2281 2003-04-21 Jim Meyering <jim@meyering.net>
2283 * tests/misc/printf: Add tests for the printf fixes below.
2285 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2287 2003-04-20 Paul Eggert <eggert@twinsun.com>
2289 Fix printf POSIX compatibility bug reported by Ben Harris in
2290 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2291 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2292 \0NNN in the %b operand.
2293 * src/printf.c (usage): Likewise.
2294 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2295 is desired. All uses changed. Behave like Bash printf if %b
2296 operand uses \NNN where the initial N is not 0.
2298 2003-04-17 Jim Meyering <jim@meyering.net>
2300 * src/stty.c: Remove uses of PROTOTYPE macro.
2302 2003-04-15 Jim Meyering <jim@meyering.net>
2304 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2305 each sequence of spaces before a TAB character.
2307 2003-04-13 Jim Meyering <jim@meyering.net>
2309 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2311 2003-04-12 Jim Meyering <jim@meyering.net>
2313 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2314 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2315 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2316 * src/nl.c (main): Fix those problems and remove literal quote marks
2317 (e.g., "`%s'") from format string; instead use "%s" in each format
2318 string and `quote (optarg)' as the corresponding argument.
2319 Also, diagnose all invalid command line options before failing.
2321 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2322 newlines in some cases. Details here: http://bugs.debian.org/177256.
2323 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2324 * tests/misc/nl: Add test for the above-fixed bug.
2326 * tests/misc/readlink: New file. Test the --canonicalize option.
2327 * tests/misc/Makefile.am (TESTS): Add readlink.
2329 2003-04-11 Jim Meyering <jim@meyering.net>
2332 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2333 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2334 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2335 retain alignment) each sequence of spaces before a TAB character.
2337 * src/ls.c: Include <stdlib.h> unconditionally.
2339 * Makefile.maint (xalloc-check): Rename from header-check.
2341 * src/yes.c: Include error.h after system.h, not before.
2344 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2345 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2346 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2347 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2348 * src/tr.c: * src/unexpand.c, src/users.c:
2349 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2350 return values and of xrealloc's first argument.
2351 Fix the former with this:
2352 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2354 2003-04-10 Jim Meyering <jim@meyering.net>
2356 * src/stty.c (wrapf): Declare with format attribute.
2358 The S_MAGIC_... names shouldn't be maintained in two places (prior
2359 to this change, one would have to keep stat.c and fs.h in sync).
2360 This change makes it so those names and the corresponding
2361 hexadecimal constants all reside in stat.c. fs.h is now generated.
2362 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2363 (BUILT_SOURCES): Add fs.h, now that it's generated.
2364 (EXTRA_DIST): Add extract-magic.
2365 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2366 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2367 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2369 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2370 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2372 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2373 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2374 Suggestion from Dan Jacobson.
2376 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2378 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2379 * src/stat.c (human_fstype): Handle Linux's devpts.
2381 2003-04-09 Paul Eggert <eggert@twinsun.com>
2383 * src/split.c (line_bytes_split): Arg is of type size_t, since
2384 that's all that is supported for now.
2385 (main): Check for overflow in obsolescent line count option.
2387 2003-04-09 Jim Meyering <jim@meyering.net>
2389 * tests/misc/split-fail: Add a new test for the above fix.
2391 * src/split.c (bytes_split): Use size_t temporary (rather than
2392 uintmax_t original) in remaining computations. From Paul Eggert.
2394 Handle command line option arguments larger than 2^31.
2395 This allows e.g., splitting into files of size 2GB and larger,
2396 and running split --lines=N with N=2^31 or more.
2397 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2398 remains (for now), due to the way it is implemented.
2400 * src/split.c: Include "inttostr.h".
2401 (bytes_split, lines_split, line_bytes_split, main):
2402 Use uintmax_t, not size_t, for file sizes.
2403 (main): Give a better diagnostic for option arguments == 0.
2404 Use umaxtostr to print file sizes.
2405 Reported by Luke Hassell.
2407 2003-04-08 Jim Meyering <jim@meyering.net>
2409 * src/rm.c (usage): Mention that --directory (-d) works only
2410 on some systems. Suggestion from Samuel Tardieu.
2412 * tests/basename/basic: Run $PERL to see if it is available,
2413 rather than testing its value.
2414 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
2415 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
2416 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
2417 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
2418 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
2419 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
2420 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
2421 * tests/sum/basic-1, tests/seq/basic: Likewise.
2423 * tests/misc/Makefile.am (TESTS): Add split-fail.
2424 * tests/misc/split-fail: New file.
2426 * src/split.c: Rename local variables: nchars -> n_bytes.
2427 (lines_split): Rename local, nlines -> n_lines.
2428 (main): Rename local variable: s/accum/n_units/.
2429 (main): Use STDIN_FILENO, not literal `0'.
2431 2003-04-07 Jim Meyering <jim@meyering.net>
2433 * src/stat.c: Add #include directives for Ultrix 4.4.
2434 Based on a suggested change from Bert Deknuydt.
2436 2003-04-06 Jim Meyering <jim@meyering.net>
2438 * Makefile.maint (makefile-check): New rule.
2439 (local-check): Add it.
2441 2003-04-05 Jim Meyering <jim@meyering.net>
2443 * Makefile.am (nearly all of them):
2444 Use $(VAR) rather than @VAR@, now that we can rely on automake to
2445 emit a definition for each substituted variable.
2446 * tests/Makefile.am.in: Likewise.
2448 * tests/rm/rm5: Add a comment explaining why this test fails when
2449 using Tru64's broken sed.
2450 * tests/rm/rm3: Likewise.
2452 Make `kill -t' output signal descriptions (not `?') on Tru64.
2453 * src/kill.c (sys_siglist): Also check for __sys_siglist.
2454 Patch by Tony Leneis.
2455 * configure.ac: Also check for declaration of __sys_siglist.
2456 Required for Tru64 4.0D, 4.0F, and 5.1.
2457 Reported by Tony Leneis.
2459 2003-04-04 Jim Meyering <jim@meyering.net>
2461 * src/Makefile.am (PERL): Remove unnecessary definition.
2463 Because of inappropriate (but POSIX-mandated) behavior of rename,
2464 `mv a b' would not remove `a' in some unusual cases. Work around
2465 this by unlinking `a' when necessary.
2467 * src/copy.c (same_file_ok): Add an output parameter.
2468 Set it in the offending case.
2469 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
2470 Reported by Ed Avis.
2471 * tests/mv/hard-4: New test for the above.
2472 * tests/mv/Makefile.am (TESTS): Add hard-4.
2474 Clean up rules for automatically generated sources:
2475 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
2476 Make each generated file be read-only.
2477 Add each file name to BUILT_SOURCES separately.
2478 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2480 Put LOCALEDIR macro definition in new file: localedir.h.
2481 * src/Makefile.am (DEFS): Remove definition.
2482 (localedir.h): New rule.
2483 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
2484 * src/system.h: Include "localedir.h".
2486 2003-04-02 Jim Meyering <jim@meyering.net>
2490 * tests/misc/Makefile.am (TESTS): Add false.
2492 * Makefile.maint (TMPDIR): Make sure it's defined.
2493 (my-distcheck): Build in $(TMPDIR), not `.'.
2495 * src/Makefile.am (false.c): Change all occurrences of
2496 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
2497 unsuccessfully also with --help. Reported by Paul Jarc,
2498 * tests/misc/false: New test for the above.
2500 2003-03-30 Jim Meyering <jim@meyering.net>
2502 * NEWS: Note the location of older NEWS files.
2504 * src/remove.c (is_empty_dir): Don't let a failing closedir
2505 clobber errno. Spotted by Arnold Robbins.
2507 * src/env.c: Fix typo in comment. From Arnold Robbins.
2509 2003-03-29 Jim Meyering <jim@meyering.net>
2513 * README: Note to expect build problems for stat.c on Ultrix 4.3.
2514 Note that there are some harmless test failures when running
2515 `make check' as root on some systems.
2517 2003-03-28 Jim Meyering <jim@meyering.net>
2519 * tests/stty/row-col-1: Skip this test if stty can't get window size.
2520 This happens when connecting to sparc-solaris5.7 via ssh from within
2521 emacs. Reported by Karl Berry.
2523 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
2524 Otherwise, on systems (DJGPP) that emulate pipes using files,
2525 this test would never complete, waiting for `yes' to terminate.
2526 * tests/du/slink: As above, use seq, not `yes' to generate link target.
2527 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
2528 Reported by Rich Dawe.
2530 2003-03-27 Jim Meyering <jim@meyering.net>
2532 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
2533 from `written by...' comment, at his request.
2535 2003-03-24 Paul Eggert <eggert@twinsun.com>
2537 Fix buffer overrun problem reported by TAKAI Kousuke, along
2538 with some other POSIX incompatibilities.
2540 * src/printf.c (print_esc): Do not treat \x specially if
2541 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
2542 in backslash. Treat incomplete escape sequences as strings
2543 of characters, as POSIX requires.
2544 (print_formatted): Allow multiple flags. Avoid buffer overrun
2545 if the format is incomplete.
2547 2003-03-24 Jim Meyering <jim@meyering.net>
2549 * tests/misc/printf: Add tests for the above fixes and changes.
2551 2003-03-26 Jim Meyering <jim@meyering.net>
2553 * src/copy.h (struct cp_options): Add a comment.
2555 2003-03-23 Jim Meyering <jim@meyering.net>
2557 * README: Describe problem with 64-bit mode on HPUX 11.x,
2558 with patch for /usr/include/inttypes.h.
2559 * TODO: Plan to add an autoconf test to work around the bug.
2561 2003-03-22 Jim Meyering <jim@meyering.net>
2563 * src/stat.c: Don't include <sys/sysmacros.h>.
2564 That is already done via system.h. Otherwise, the multiple
2565 inclusion would evoke redefinition warnings from Cray's /bin/cc,
2566 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
2567 (human_fstype): Factor some directives `up', out of this function.
2568 Cast away `const' to avoid error from Cray's /bin/cc.
2570 2003-03-20 Jim Meyering <jim@meyering.net>
2572 * announce-gen (print_changelog_deltas): Ensure that a newline
2573 precedes each row of `*'s.
2575 2003-03-20 Jim Meyering <jim@meyering.net>
2579 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
2580 format flag characters.
2581 Do not require that a field width be specified.
2582 Do not fail when given a field width of `0'.
2583 Reported by Dan Jacobson.
2584 * tests/seq/basic: Add new tests for the above-fixed bug.
2586 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
2587 (install-root): Likewise.
2588 (install-exec-local): Likewise.
2589 Based on a patch from Richard Dawe.
2591 2003-03-19 Jim Meyering <jim@meyering.net>
2593 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
2594 because the DJGPP 2.03 port of 'ln -s' doesn't work.
2595 Include $(EXEEXT) in program names.
2596 Since $(LN_S) may degenerate to `cp -p', be careful
2597 to invoke it from the destination directory.
2598 Mostly from Richard Dawe.
2599 * configure.ac: Use AC_PROG_LN_S.
2601 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
2602 CDPATH shell variable set could cause this test to fail.
2603 Reported by Karl Berry.
2605 2003-03-18 Jim Meyering <jim@meyering.net>
2607 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
2608 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
2609 AIX 5.1's xlc could not compile the former.
2610 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
2612 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
2614 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
2615 program names, since automake only adds $(EXEEXT) to programs
2618 2003-03-16 Jim Meyering <jim@meyering.net>
2620 * src/remove.c (rm): Put two local variables in static storage,
2621 so they can't be clobbered by the potential longjmp.
2623 2003-03-15 Jim Meyering <jim@meyering.net>
2625 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
2626 so that a version number with a two-digit component can still count
2627 as an alpha release. Reported by Richard A Downing.
2628 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
2630 2003-03-14 Jim Meyering <jim@meyering.net>
2632 * src/ansi2knr.c: Remove no-longer-used file.
2633 * src/ansi2knr.1: Likewise.
2635 * Makefile.maint (prev_version_file): Don't use ?= for this particular
2636 assignment, since it causes trouble with old versions of GNU make
2637 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
2638 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
2639 Patch from Alexandre Duret-Lutz.
2641 * Use patched automake-1.7.3. Regenerate Makefile.in files in
2642 subdirectories so that each includes a definition of ACLOCAL_M4.
2644 * announce-gen (main): Label the compressed source URLs.
2648 * tests/du/slink: Relax the test for the `local'ness of a file system,
2649 so that now it works also for tmpfs.
2651 * tests/du/hard-link: Transform output from first du, so that this
2652 test doesn't fail on file systems like tmpfs that order directory
2653 entries differently.
2655 2003-03-13 Jim Meyering <jim@meyering.net>
2657 * tests/du/8gb: Work around what appears to be an NFS failure that
2658 would make this test fail on some systems.
2660 2003-03-11 Jim Meyering <jim@meyering.net>
2662 * tests/du/basic: Make the test file exactly 4k bytes long.
2664 * src/split.c (longopts): Don't hard-code `2' here.
2665 Instead, just specify `&verbose', and ...
2666 (main): ... remove the `case 2:' block for --verbose.
2668 * tests/du/basic: Make the test file larger than 64 bytes, so that
2669 we don't immediately disqualify file systems (e.g., NetApp) on which
2670 smaller files take up zero disk blocks. Reported by Vin Shelton.
2672 2003-03-10 Jim Meyering <jim@meyering.net>
2674 Don't segfault for a negative field width or precision in format string.
2675 Note that this is just a stopgap fix. The longer term solution may
2676 involve adapting bash's builtins/printf.def.
2678 * src/printf.c: (UNSPECIFIED): Define.
2679 (print_direc): Use the special value, UNSPECIFIED, to indicate
2680 that field_width or precision has not been specified.
2681 (print_formatted): Fail if field_width or precision is the
2682 special value, UNSPECIFIED.
2683 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
2685 * src/sys2.h (INT_MIN): Define, if necessary.
2686 * tests/misc/printf: Add a test for the above-fixed bug.
2688 2003-03-09 Jim Meyering <jim@meyering.net>
2690 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
2691 changing its sign. This avoids a warning from gcc on 64-bit systems.
2692 Reported by Bob Proulx.
2693 (pop_dir): Reverse order of sign change and cast, to be consistent
2696 2003-03-08 Jim Meyering <jim@meyering.net>
2698 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
2699 shell variable, but only in the environment. With /bin/sh->bash, the
2700 shell variable is set to `y', and that would cause a spurious warning.
2701 Reported by Bob Proulx.
2703 * tests/Makefile.am (check-root): Remove touch/fifo.
2704 It doesn't appear to have to be run as root.
2706 * tests/rm/fail-2eperm: Rather than simply using the first non-root
2707 user name, make sure that the selected user name has a usable shell.
2708 Reported by Paul Jarc.
2710 Before, when using shred on a device, one had to specify --exact,
2711 or be careful to choose a size that would not be rounded up and
2712 exceed the maximum value; that could result in a failure of
2714 * src/shred.c (do_wipefd): --exact is now the default for non-regular
2715 files. Suggestion from Ben Elliston.
2718 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
2719 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
2720 Patch by Bob Proulx.
2722 * src/Makefile.am (check-misc): Check for use of `defined' in
2724 Change to $(srcdir) before running grep.
2726 * src/sleep.c: Remove now-unused #include and #define directives.
2728 * src/du.c (process_file): If a file's size is not being counted
2729 e.g., because it's a hard link to a file we've already counted,
2730 then don't print a line for it.
2732 * tests/du/hard-link: New test for the above-fixed bug.
2733 * tests/du/Makefile.am (TESTS): Add hard-link.
2736 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
2737 and make the two-array approach work.
2739 * tests/du/basic: Correct/add tests for the above fix.
2740 Set LC_ALL, etc., now that we use sort.
2741 Check the block/size of a small file, too.
2742 Correct expected results for simple dir1/dir2/file case.
2743 Add another test of du -S.
2745 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2747 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
2748 middle-end/9986). As one of GCC's optimizations, it transforms a
2749 fputs_unlocked call to a fputc_unlocked call when the string is
2750 one character long. However, hpux doesn't have fputc_unlocked.
2752 * expr.c (usage): Use putchar, not fputs, to output a single character.
2753 * ls.c (dired_dump_obstack): Likewise.
2754 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
2755 * stat.c (print_it): Likewise.
2757 2003-03-07 Jim Meyering <jim@meyering.net>
2759 * src/cp.c: Remove everything associated with mmap-stack.c.
2760 This reverts the two changes of 2003-02-21.
2761 * src/du.c: Remove everything associated with mmap-stack.c.
2762 This reverts the change of 2003-02-19.
2764 2003-03-06 Jim Meyering <jim@meyering.net>
2766 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
2767 CDPATH shell variable set could cause this test to fail.
2768 Reported by Karl Berry.
2770 2003-03-05 Jim Meyering <jim@meyering.net>
2774 * src/printf.c (print_esc): Remove pointless comparison of unsigned
2775 integer with zero, to avoid a warning from Intel's ecc.
2776 Reported by Nelson Beebe.
2778 * src/du.c (process_file): Sizes must all be of type uintmax_t.
2779 Otherwise, for files or totals that are too big, numbers would
2780 be truncated. Patch mostly by Michael Stone.
2781 Reported by Ingo Saitz as Debian bug #183210.
2783 * tests/du/8gb: New test for the above-fixed bug.
2784 * tests/du/Makefile.am (TESTS): Add 8gb.
2786 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
2787 rather than UTILS_OPEN_MAX - 10.
2789 2003-03-04 Jim Meyering <jim@meyering.net>
2791 * README: Refer new feature discussion to bug-coreutils@gnu.org,
2792 rather than bug-gnu-utils, now that the former is better known.
2793 Suggestion from Göran Uddeborg.
2795 * src/stat.c (usage): Capitalize consistently.
2796 Reported by Göran Uddeborg.
2798 * Makefile.maint (rel-files): Include $(signatures), so that
2799 those files are also copied into $(release_archive_dir).
2801 * src/df.c (find_mount_point): Call error here, now that restore_cwd
2803 * src/remove.c (AD_pop_and_chdir): Likewise.
2805 * tests/Makefile.am (check-root): Add fail-2eperm.
2807 2003-03-03 Jim Meyering <jim@meyering.net>
2809 * src/remove.c (remove_cwd_entries): Include the full filename of
2810 the offending file, not just the basename.
2812 * tests/misc/tty-eof: Set $ME properly.
2814 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
2815 Remove now-unused variables.
2816 (tag-prev-version, prev-cvs-tag): Likewise.
2818 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
2819 accurate diagnostic when failing to remove a file owned by some other
2820 user. Reported by Ivo Timmermans via Michael Stone.
2821 This fixes Debian bug# 178471.
2823 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
2824 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
2825 Based on a report from Ivo Timmermans.
2827 2003-03-02 Jim Meyering <jim@meyering.net>
2829 * src/copy.c (copy_internal) [un_backup]: When recovering from a
2830 failure to create a hard link, do not remove the entry associating
2831 the source dev/ino with the destination file name.
2832 * tests/mv/Makefile.am (TESTS): Add hard-3.
2833 * tests/mv/hard-3: New test, for the above-fixed bug.
2834 Inspired by a report from Iida Yosiaki.
2836 2003-03-01 Jim Meyering <jim@meyering.net>
2838 * src/df.c (print_header): Don't embed spaces in a separate `Type'
2839 header string. Instead, put `Filesystem' and `Type' headers in the
2840 same string, so translators can use horizontal space as needed.
2841 Reported by Jean Charles Delepine.
2843 2003-02-28 Jim Meyering <jim@meyering.net>
2845 * src/copy.c (copy_internal): When link fails because of an
2846 existing destination file, unlink that file and try again.
2847 Reported by Iida Yosiaki.
2849 * tests/mv/Makefile.am (TESTS): Add hard-2.
2850 * tests/mv/hard-2: New test for the above-fixed bug.
2851 Based on a test case from Iida Yosiaki.
2853 2003-02-26 Jim Meyering <jim@meyering.net>
2855 * tests/du/basic: Don't test du's -b option here. Directory byte
2856 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
2857 and IBM AIX 4.2. Reported by Nelson Beebe.
2859 2003-02-25 Jim Meyering <jim@meyering.net>
2861 * Makefile.maint (announcement): Now that ChangeLog entries
2862 are output by announce-gen, don't do it here.
2863 * announce-gen (print_changelog_deltas): New function.
2866 2003-02-22 Jim Meyering <jim@meyering.net>
2868 * announce-gen: New option: --release-type=TYPE
2869 * Makefile.maint (beta, major): New targets. Remove `release'.
2870 Put them all together on a line.
2871 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
2872 invocation of `announcement'.
2873 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
2875 * announce-gen: New option: --news=NEWS_FILE.
2876 Extract NEWS entries here, not via rules in Makefile.maint.
2877 * Makefile.maint (announcement): Now that NEWS entries are
2878 extracted by announce-gen, don't do it here.
2879 (news-r1, news-r2): Remove now-unused definitions.
2881 2003-02-21 Jim Meyering <jim@meyering.net>
2885 Merge in changes from autoconf's version of this file.
2886 * Makefile.maint (www-gnu): Define.
2887 (standards.texi-url_prefix): Use $(www-gnu).
2888 (make-stds.texi-url_prefix): Likewise.
2890 * src/cp.c: Include "mmap-stack.h".
2891 (main): Invoke `run' through a macro that (when possible) runs it
2892 with a large, mmap'd stack.
2894 * src/cp.c (run): New function, preparing for the above.
2895 Exit from this function, not from main
2898 * src/du.c: New option: --apparent-size.
2899 (enum) [APPARENT_SIZE_OPTION]: New member.
2900 (long_options): Add it.
2901 (usage): Describe it.
2903 ['b']: Set apparent_size.
2904 David Eisner reported that the behavior of --bytes had changed.
2905 Paul Eggert proposed the use of a new option, --apparent-size.
2907 * src/du.c (apparent_size): New global.
2908 (print_only_size): Reflect the fact that we're printing byte counts,
2909 not ST_NBLOCKSIZE-byte-block counts.
2910 (print_size): Call print_only_size rather than duplicating its code.
2911 (process_file): Accumulate byte counts, rather than block counts.
2913 * src/du.c (process_file): Always reset size_to_propagate_to_parent
2914 for --separate-dirs (-S).
2916 2003-02-20 Jim Meyering <jim@meyering.net>
2918 * Use automake-1.7.3. Regenerate dependent files.
2920 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
2921 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
2922 (usage) [%B]: Describe it.
2925 * src/du.c (process_file): Reorganize the code to use only
2926 one `sum' array, and change how -S works back to the way it was
2927 before 2003-01-31. Patch by Bruno Haible.
2929 * tests/du/basic: New test.
2930 * tests/du/Makefile.am (TESTS): Add basic.
2932 * tests/envvar-check: Add checks for the following:
2933 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
2935 * tests/Makefile.am: Rename phony target envvar-check to evar-check
2936 so as not to conflict with the distributed file by the same name.
2938 * src/du.c (process_file): Set info->skip before any possible return.
2940 Report correct usage for directories, not 0.
2941 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
2942 _before_ recording the dev/ino of a directory.
2943 Reported by Bruno Haible.
2945 Now, df always displays the device file name corresponding to the
2946 listed mount point under `Filesystem'. Before, for an unmounted
2947 block- or character-special file argument, it would display the
2948 command-line argument instead.
2949 * src/df.c (show_disk): Return a value indicating whether
2950 there was a match. Don't try to find a mount point here.
2951 (show_entry): If show_disk doesn't find a match, call show_point.
2953 2003-02-19 Jim Meyering <jim@meyering.net>
2955 * src/du.c: Include "mmap-stack.h".
2956 (du_files): Add prototype with ATTRIBUTE_NORETURN.
2957 Exit from this function, not from...
2959 Instead, if possible, invoke du_files through a macro that
2960 runs it with a large, mmap'd stack.
2962 * src/join.c (usage): Change wording in --help output:
2963 use FILENUM instead of `SIDE' and say what FILENUM means.
2964 Reported by Bernhard Gabler.
2966 * src/df.c (print_header): Rather than using a hard-coded literal
2967 string of spaces matching the length of the English `...Type' header,
2968 output the right number of spaces to match the selected translation.
2969 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
2971 * src/split.c (bytes_split): Remove unnecessary `else' after break.
2972 (lines_split): Likewise. and correct misleading indentation.
2974 * src/split.c: Include "full-read.h".
2975 (bytes_split, lines_split, line_bytes_split): Use full_read,
2976 not safe_read. The way split was using the latter, a short read
2977 could cause split to terminate before EOF.
2979 * tests/misc/tty-eof: Test all programs that can read stdin,
2980 requiring no arguments and that write to standard output.
2982 * tests/misc/tty-eof: New file. Renamed from ...
2983 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
2984 * tests/misc/Makefile.am (TESTS): Reflect renaming.
2986 2003-02-18 Jim Meyering <jim@meyering.net>
2988 cksum would perform an extra read after encountering EOF
2989 * src/cksum.c (cksum): Exit the loop upon EOF, too.
2990 Patch by Michael Bacarella.
2992 Test for the bug fixed today in cksum, md5sum, and sha1sum.
2993 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
2994 cat, cksum, md5sum, and sha1sum all in the same loop.
2996 2003-02-14 Jim Meyering <jim@meyering.net>
2998 * src/remove.c: Include "euidaccess.h".
2999 Remove declaration of euidaccess.
3001 2003-02-12 Jim Meyering <jim@meyering.net>
3003 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3004 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3006 2003-02-10 Jim Meyering <jim@meyering.net>
3008 * src/test.c: Don't include group-member.h.
3009 Include euidaccess.h.
3010 (eaccess): Rewrite function to set the real uid and gid temporarily
3011 to the effective uid and gid, then invoke 'access', and then set the
3012 real uid and gid back. On systems that lack setreuid or setregid,
3013 fall back on the kludges in euidaccess. Before, it would not work
3014 for e.g., files with ACLs, files that were marked immutable,
3015 or on file systems mounted read-only. Nelson Beebe raised the issue.
3016 Paul Eggert suggested the new implementation.
3018 2003-02-09 Jim Meyering <jim@meyering.net>
3020 * src/test.c (test_stat): Remove function. It's job is done (only
3021 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3023 2003-02-08 Jim Meyering <jim@meyering.net>
3027 * tests/mv/part-symlink: Don't assume that the file owner username
3028 length is less than 9 in ls output: instead, omit that field
3029 altogether. Reported by, and suggested fix from, Ferdinand.
3031 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3032 * tests/du/Makefile.am (TESTS): Add restore-wd.
3034 * src/rm.c: Correct now-invalid comment about cycle-detection.
3036 2003-02-06 Jim Meyering <jim@meyering.net>
3038 * NEWS: Add entries from old/*/NEWS
3039 from fileutils-4.1 through 4.1.11 and
3040 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3044 * src/du.c (process_file): Don't return early for excluded files
3045 or for files whose dev/inode we've already seen.
3047 2003-02-05 Jim Meyering <jim@meyering.net>
3049 * tests/du/exclude: New file.
3050 * tests/du/Makefile.am (TESTS): Add exclude.
3052 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3054 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3055 Fix memory allocation arithmetic.
3057 2003-02-04 Jim Meyering <jim@meyering.net>
3059 `df /dev/block-or-char-device-file--not-mounted' now reports
3060 the name of the file system on which the file resides, usually `/'.
3061 Before, it would leave the `Mounted on' field blank.
3062 * src/df.c (show_disk): Move function to precede find_mount_point.
3063 (show_disk): Add parameter: STATP.
3064 If we don't find a matching device name, then resort to calling
3065 find_mount_point. Reported by Bob Proulx.
3067 2003-02-03 Andreas Schwab <schwab@suse.de>
3069 * tests/rm/cycle: Require non-root.
3070 * tests/rm/isatty: Likewise.
3072 2003-02-02 Jim Meyering <jim@meyering.net>
3076 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3078 Ensure that there are no offending uses of `:'.
3079 * Makefile.maint (makefile_path_separator_check): New rule.
3080 (local-check): Add it to the list.
3082 2003-02-01 Jim Meyering <jim@meyering.net>
3084 * src/du.c (MAX_N_DESCRIPTORS): Define.
3086 * src/stat.c (G_fail): New global.
3087 (human_time): Diagnose failed localtime, not failed nstrftime.
3088 (main): Fail if G_fail is set.
3090 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3092 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3093 hard-coding the path-separator. Also double-quote the new PATH,
3094 to avoid problems when the path-separator is a semi-colon or when
3095 `pwd` contains e.g. a space.
3096 * tests/chgrp/Makefile.am: Likewise.
3097 * tests/chmod/Makefile.am: Likewise.
3098 * tests/chown/Makefile.am: Likewise.
3099 * tests/cp/Makefile.am: Likewise.
3100 * tests/dd/Makefile.am: Likewise.
3101 * tests/dircolors/Makefile.am: Likewise.
3102 * tests/du/Makefile.am: Likewise.
3103 * tests/expr/Makefile.am: Likewise.
3104 * tests/factor/Makefile.am: Likewise.
3105 * tests/fmt/Makefile.am: Likewise.
3106 * tests/install/Makefile.am: Likewise.
3107 * tests/ln/Makefile.am: Likewise.
3108 * tests/ls/Makefile.am: Likewise.
3109 * tests/ls-2/Makefile.am: Likewise.
3110 * tests/md5sum/Makefile.am: Likewise.
3111 * tests/misc/Makefile.am: Likewise.
3112 * tests/mkdir/Makefile.am: Likewise.
3113 * tests/mv/Makefile.am: Likewise.
3114 * tests/od/Makefile.am: Likewise.
3115 * tests/rm/Makefile.am: Likewise.
3116 * tests/rmdir/Makefile.am: Likewise.
3117 * tests/seq/Makefile.am: Likewise.
3118 * tests/sha1sum/Makefile.am: Likewise.
3119 * tests/shred/Makefile.am: Likewise.
3120 * tests/stty/Makefile.am: Likewise.
3121 * tests/sum/Makefile.am: Likewise.
3122 * tests/tail-2/Makefile.am: Likewise.
3123 * tests/touch/Makefile.am: Likewise.
3124 * tests/tsort/Makefile.am: Likewise.
3125 * tests/unexpand/Makefile.am: Likewise.
3127 2003-01-31 Jim Meyering <jim@meyering.net>
3129 * src/stat.c: Include "file-type.h"
3130 (print_human_type): Remove function.
3131 (human_access): Rename from print_human_access. Return a string.
3132 (human_time): Rename from print_human_time. Return a string.
3133 (print_stat): Arrange so that field width and an alignment specifier
3134 are honored for the %A, %F, %x, %y, and %z formats.
3135 [%F]: Use file_type; this gives slightly different file type strings,
3136 e.g., `directory' instead of `Directory' and `regular file' or
3137 `regular empty file' instead of `Regular file'.
3138 Prompted by a report from Richard Dawe that the uses of
3139 S_IFSOCK and S_IFIFO in print_human_time were not portable
3140 to systems using e.g., DJGPP.
3142 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3144 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3145 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3147 2003-01-31 Jim Meyering <jim@meyering.net>
3149 * src/du.c (main): Upon processing an invalid option or an invalid
3150 --exclude-from or --max-depth option argument, don't exit right away,
3151 in case there are others. Rather record the failure and exit after
3152 processing other options.
3154 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3155 tar archive easier to reproduce.
3157 Rewrite to perform directory traversal using nftw.
3159 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3160 (AUTHORS): Add self.
3161 (opt_one_file_system): Move global into `main'.
3162 (path, xstat, exit_status): Remove declarations.
3163 (arg_length, suffix_length): New globals.
3164 (G_fail): New global, sort of like the old `exit_status'.
3165 (IS_FTW_DIR_TYPE): Define.
3166 (print_only_size): New function.
3167 (process_file): New function.
3168 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3169 (str_trunc, pop_dir, count_entry): Likewise.
3170 (du_files): Rewrite to use nftw.
3172 2003-01-30 Jim Meyering <jim@meyering.net>
3174 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3175 symlink-to-directory with -L, even without the trailing slash.
3177 2003-01-27 Jim Meyering <jim@meyering.net>
3179 * src/Makefile.am (check-misc): Check for st_blocks, too.
3181 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3182 Reported by Richard Dawe.
3184 2003-01-27 Andreas Schwab <schwab@suse.de>
3186 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3187 store the screen columns, and return the number of bytes instead.
3188 (print_dir): Pass NULL as fourth parameter of quote_name.
3189 (print_name_with_quoting): Likewise.
3190 (length_of_file_name_and_frills): Get the width from the fourth
3191 parameter of quote_name instead of return value.
3193 2003-01-27 Jim Meyering <jim@meyering.net>
3195 * src/ls.c (decode_switches): If `dired' is set without
3196 `format == long_format', then silently reset dired. This doesn't
3197 change the behavior of ls (all prior uses of dired were protected
3198 by `&& format == long_format'), and lets us...
3199 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3200 (PUSH_CURRENT_DIRED_POS): Likewise.
3203 2003-01-22 Jim Meyering <jim@meyering.net>
3205 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3206 * tests/du/Makefile.am (TESTS): Add no-x.
3208 2003-01-21 Jim Meyering <jim@meyering.net>
3210 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3211 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3212 it may still be a directory -- or not (e.g., with FreeBSD on an
3213 NFS-mounted file system), so resort to calling lstat to find out.
3214 Based on a patch by Michael van Elst.
3216 * tests/cp/same-file: Don't assume that the file owner username
3217 length is less than 9 in ls output: instead, omit that field
3218 altogether. Reported by, and suggested fix from, Ferdinand.
3220 2003-01-20 Jim Meyering <jim@meyering.net>
3222 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3223 large format widths no longer cause strftime to infloop.
3225 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3227 2003-01-19 Jim Meyering <jim@meyering.net>
3229 * src/readlink.c: Include "canonicalize.h".
3231 2003-01-18 Jim Meyering <jim@meyering.net>
3233 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3235 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3236 (long_options): Add option --dereference-command-line-symlink-to-dir.
3237 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3238 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3239 -d, -F, -l options is specified.
3240 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3241 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3242 Change --dereference-command-line (-H) to dereference *all*
3243 command line arguments, including broken symlinks.
3245 2003-01-15 Paul Eggert <eggert@twinsun.com>
3247 Change ls -H back to the way it was yesterday, since this is
3248 compatible with FreeBSD and the POSIX spec is confusing
3249 and somewhat contradictory.
3251 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3252 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3253 (long_options): Change the long option name back.
3254 (usage): Change the usage back.
3255 (gobble_file): When -H is specified, dereference a top-level
3256 arg even if it points to a non-directory.
3258 2003-01-15 Jim Meyering <jim@meyering.net>
3260 * src/ls.c (gobble_file): Fall back on using lstat when required:
3261 when --dereference (-L) is not specified, and
3262 - when operating on a dangling symlink
3263 - when operating on command-line-symlink-to-directories
3264 This fixes numerous problems. Here are examples:
3265 - `ls dangling-symlink' would fail with `no such file...'
3266 Now it prints `dangling-symlink'.
3267 - `ls -i symlink' would mistakenly print the inode of the referent.
3268 Now it prints the inode of the symlink. Likewise for --size (-s).
3269 Based on a patch from Michael Stone.
3270 Reported by Deepak Goel as Debian bug #173793.
3272 Rename ls's --dereference-command-line (-H)
3273 option to --dereference-command-line-symlink-to-dir.
3274 * src/ls.c [enum Dereference_symlink]
3275 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3276 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3277 (long_options): Rename the long option.
3278 (usage): Say that --dereference-... changes how ls treats
3279 only symlinks to directories specified on the command line.
3281 2003-01-14 Jim Meyering <jim@meyering.net>
3283 * tests/ls/dangle: New file/test, for the above fix.
3284 * tests/ls/inode: Another new file/test, for the above fix.
3285 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3287 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3288 so that ls --color would no longer highlight the names of files with
3289 the execute bit set when not specified on the command line.
3290 Patch by Michael Stone. Reported by Stephen Depooter as
3293 * tests/ls-2/tests (color-exe): New test, for the above fix.
3295 2003-01-13 Jim Meyering <jim@meyering.net>
3297 * tests/shred/exact: Also test for just fixed bug with --zero.
3299 * src/shred.c (long_opts): --zero does not require an argument.
3300 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3302 2003-01-12 Jim Meyering <jim@meyering.net>
3304 * Makefile.maint (cvs-update): Skip any file with local modifications.
3306 * src/unexpand.c (usage): Document --first-only and mention that
3307 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3309 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3311 * src/df.c: Include "canonicalize.h".
3312 Use canonicalize_file_name unconditionally.
3314 2003-01-09 Jim Meyering <jim@meyering.net>
3316 * README: Add readlink.
3318 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3320 * src/df.c: Include "xgetcwd.h".
3321 * src/pwd.c: Likewise.
3323 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3325 * src/shred.c: Remove declaration of xstrdup.
3326 We already get it via xalloc.h which is included via system.h.
3328 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3330 New program: readlink.
3332 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3333 * src/readlink.c: New file.
3335 * man/readlink.x: New file.
3336 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3337 (readlink.1): New rule.
3339 2003-01-09 Jim Meyering <jim@meyering.net>
3341 When selecting ranges of byte offsets (as opposed to ranges of fields)
3342 and when --output-delimiter=STRING is specified, output STRING between
3343 ranges of selected bytes.
3344 * src/cut.c (RANGE_START_SENTINEL): Define.
3345 (output_delimiter_specified): New global.
3346 (print_kth): Add parameter. Adjust all callers.
3347 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3348 (cut_bytes): When requested, output STRING between ranges of
3350 (main): Make a diagnostic a little clearer.
3351 Based on a patch from Jan Nieuwenhuizen.
3353 * tests/cut/Test.pm: New tests for the above.
3355 * src/cut.c (set_fields): Make code agree with comment:
3356 Don't merge abutting ranges like 4- and 2-3. This makes no
3357 difference currently, but is required to support an upcoming change.
3359 2003-01-07 Jim Meyering <jim@meyering.net>
3361 * src/cut.c (set_fields): Fix typo in comment.
3363 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3364 * tests/touch/Makefile.am (TESTS): Add not-owner.
3365 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3366 Now, this tests only the nonexistent-directory diagnostic.
3367 Suggestion from Michael Stone.
3369 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3371 2003-01-04 Jim Meyering <jim@meyering.net>
3373 * src/copy.h: Remove use of PARAMS.
3374 * src/remove.h: Likewise.
3375 * src/chown-core.h: Likewise.
3377 rm could be tricked into mistakenly reporting a cycle.
3378 * src/remove.c: [cycle_check_state]: New global.
3379 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3380 (rm): Call cycle_check_init and cycle_check_free for each file.
3381 * tests/rm/cycle (rm): New test, for the above fix.
3382 * tests/rm/Makefile.am (TESTS): Add cycle.
3384 When rm detects a cycle, don't abort the entire command,
3385 but rather just the affected command line argument.
3386 * src/remove.c: Include <setjmp.h>
3387 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3388 (remove_cwd_entries): Call longjmp if we detect a cycle.
3389 (rm): Call setjmp here.
3391 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3392 Instead, include cycle-check.h and use it.
3394 * src/remove.h (struct dev_ino): Remove declaration.
3396 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3398 Don't include trailing /. in diagnostics about directories.
3399 * src/remove.c (full_filename_): When FILENAME is just `.'
3400 and there is a nonempty directory-name part, don't append `/.'.
3401 * tests/rm/unread2: Remove trailing /. from diagnostic.
3402 * tests/rm/rm2: Likewise.
3404 * src/remove.c (struct dirstack_state): Define.
3405 To be used in place of these file-scoped globals ...
3406 (dir_stack, len_stack, Active_dir): Remove globals.
3407 (ds_init, ds_free): New functions.
3408 (full_filename): Define.
3409 (full_filename_): Rename from full_filename.
3411 Begin to make AD_* functions more generic.
3412 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3413 (AD_push): Likewise.
3414 (AD_INIT_OTHER_MEMBERS): Define.
3415 (remove_dir): Define the `status' member manually after each
3416 call to AD_push or AD_push_initial.
3418 * src/Makefile.am (check-misc): New rule, to ensure that no more
3419 S_IS* macro definitions sneak into the code.
3420 (check): Depend on check-misc.
3422 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
3423 * src/du.c (count_entry) [S_ISLNK]: Don't define.
3424 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
3426 2003-01-03 Jim Meyering <jim@meyering.net>
3428 * src/true.c: Add copyright.
3429 (AUTHORS): I suppose I've written it.
3431 * src/Makefile.am (false.c): Make the generated file be read-only.
3433 2003-01-04 Jim Meyering <meyering@lucent.com>
3435 * src/ls.c: Include "dev-ino.h".
3436 [struct dev_ino]: Remove declaration.
3438 2003-01-02 Jim Meyering <meyering@lucent.com>
3440 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
3441 from mv: s/missing file arguments/missing file argument/.
3442 With --target-directory=DIR, cp and mv work with a single file argument.
3443 Reported by Karl Berry.
3445 * tests/rm/isatty: Enable this test.
3447 2002-12-31 Jim Meyering <meyering@lucent.com>
3449 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3450 (AD_push): Likewise.
3451 (AD_INIT_OTHER_MEMBERS): Define.
3452 (remove_dir): Define the `status' member manually after each
3453 call to AD_push or AD_push_initial.
3455 * src/ls.c [struct dev_ino]: Remove definition.
3456 Include "dev-ino.h" instead.
3458 2002-12-28 Jim Meyering <meyering@lucent.com>
3460 * tests/du/Makefile.am (TESTS): Add no-deref.
3461 * tests/du/no-deref: New script.
3463 2002-12-23 Jim Meyering <meyering@lucent.com>
3465 * src/remove.c (remove_cwd_entries): Fix typo in comment.
3467 2002-12-21 Jim Meyering <jim@meyering.net>
3469 * announce-gen: Generate MML-formatted announcement.
3470 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
3472 2002-12-20 Jim Meyering <jim@meyering.net>
3474 * src/touch.c (touch): Change the wording of a diagnostic so
3475 that it makes sense both when the file exists and when it doesn't.
3476 Suggestion from Michael Stone.
3478 2002-12-18 Jim Meyering <jim@meyering.net>
3480 * src/stty.c (valid_options): Declare to be static.
3482 2002-12-15 Jim Meyering <jim@meyering.net>
3484 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
3486 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
3487 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
3488 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
3489 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
3490 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
3492 * src/remove.c (PARAMS): Remove definition.
3493 * src/sys2.h: Likewise.
3495 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
3496 Include strftime.h instead.
3498 2002-12-14 Jim Meyering <jim@meyering.net>
3500 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
3502 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
3503 This is necessary at least for Irix6.5 when using c89.
3504 Reported by Nelson Beebe.
3506 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
3508 * tests/misc/cat-tty-eof: New test.
3510 * src/mknod.c (usage): Specify how major and minor mode numbers
3511 are interpreted. Report forwarded by Kristin E Thomas.
3512 * src/mknod.c: Remove now-redundant usage-specifying comment.
3514 2002-12-13 Jim Meyering <jim@meyering.net>
3518 * tests/du/trailing-slash: Allow for a directory of size `0'.
3519 That happens at least on file systems of type tmpfs on linux-2.4.18.
3521 * announce-gen: New script to begin replacing the commands
3522 associated with the rule here...
3523 * Makefile.maint (announcement): Invoke announce-gen.
3524 * Makefile.am (EXTRA_DIST): Add announce-gen.
3526 * tests/cp/preserve-2: New file/test, for latest fix.
3527 * tests/cp/Makefile.am (TESTS): Add preserve-2.
3529 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
3531 Fix a bug whereby cp would fail to parse an option like
3532 --preserve=mode,ownership.
3533 * src/cp.c (decode_preserve_arg): Advance `comma' to
3534 point the character following the comma.
3536 2002-12-11 Jim Meyering <jim@meyering.net>
3538 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
3539 in case it's already defined.
3541 2002-12-09 Jim Meyering <jim@meyering.net>
3543 * tests/touch/fail-diag: Don't get a test failure if /no exists.
3544 Instead, evoke a framework failure if /no-$$ exists.
3545 Reported by Michael Stone.
3547 2002-12-08 Jim Meyering <jim@meyering.net>
3549 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
3550 Define to rpl_lstat, so that even on systems like Solaris 5.8,
3551 du honors (per POSIX) the trailing slash on an argument referring
3552 to a symlink-to-directory.
3554 2002-12-06 Jim Meyering <jim@meyering.net>
3556 * Use autoconf-2.57. Regenerate dependent files.
3557 * Use automake-1.7.2. Regenerate dependent files.
3559 * src/ls.c (gobble_file): Also stat the file if it's a
3560 regular file and --indicator-style=classify (aka -F).
3561 Thanks to Ed Santiago for opening my eyes.
3563 * tests/ls/file-type: New file. Test for the above.
3564 A test to contrast ls -F and ls --indicator-style=file-type.
3565 * tests/ls/Makefile.am (TESTS): Add file-type.
3567 2002-12-04 Jim Meyering <jim@meyering.net>
3569 * tests/ls/follow-slink: Make sure the symlink was created.
3570 Richard Dawe reported that `ln -s link link' succeeds, but creates
3571 no file on systems running some version of the DJGPP libc.
3573 2002-12-03 Jim Meyering <jim@meyering.net>
3575 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
3576 since this package no longer panders to K&R compilers.
3578 2002-12-02 Jim Meyering <jim@meyering.net>
3580 * tests/du/slink: Skip this test if `.' is on a non-local file system.
3582 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
3583 something to replace.
3585 2002-12-01 Jim Meyering <jim@meyering.net>
3587 * src/stat.c: Don't include <string.h> or <ctype.h>.
3588 That's already done via system.h.
3589 * src/dircolors.c: Don't include <ctype.h>.
3591 2002-11-30 Jim Meyering <jim@meyering.net>
3593 * ls.c (gobble_file): Remove the block of code that caused
3594 `ls --color -F symlink-to-dir' to list the files in
3595 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
3596 like `ls -F symlink-to-dir') but with the addition of highlighting.
3597 Similarly, `ls --color -dF symlink-to-dir' would print
3598 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
3599 Reported by Jeff Sheinberg as Debian bug #168203.
3600 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
3602 ls is now more efficient: with certain options, it no longer needs
3603 to stat each directory entry on systems with valid dirent.d_type.
3604 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
3605 (main): Make --recursive set format_needs_type, not format_needs_stat.
3606 (gobble_file): Remove a FIXME comment, now that it's fixed.
3608 2002-11-24 Jim Meyering <jim@meyering.net>
3610 * src/du.c (du_files): Don't strip any trailing slash.
3611 Rewrite so that `/' is no longer represented internally as
3613 (count_entry): When appending a file name component,
3614 account for the fact that the current path may end in `/'.
3615 François Pinard reported that `du symlink-to-dir/' was not
3616 equivalent to `du symlink-to-dir/.'. Now it is.
3617 * tests/du/trailing-slash: New file/test, for the above fix.
3618 * tests/du/Makefile.am (TESTS): Add trailing-slash.
3620 2002-11-23 Jim Meyering <jim@meyering.net>
3622 * src/tac.c (output): Declare some local variables to be of type size_t,
3623 rather than `int' to avoid warnings from gcc.
3625 2002-11-21 Paul Eggert <eggert@twinsun.com>
3627 * src/ls.c (decode_switches): Use case-sensitive matching to
3628 decode the QUOTING_STYLE environment variable. This is more
3629 consistent with the documentation, and with --quoting-style.
3631 2002-11-21 Martin Buck <martin.buck@ascom.ch
3633 * src/stty.c (struct speeds): Add support for all baud rates defined
3636 2002-11-19 Jim Meyering <jim@meyering.net>
3638 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
3639 run in a UTF locale. Report and suggested fix by Bruno Haible.
3640 * tests/fmt/basic: Likewise.
3642 2002-11-17 Jim Meyering <jim@meyering.net>
3644 * configure.ac: Update via autoupdate.
3645 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
3647 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
3648 Reported by Hans Ginzel.
3650 2002-11-15 Jim Meyering <jim@meyering.net>
3652 * Makefile.cfg (gnu_rel_host): Define.
3653 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
3654 on whether $(VERSION) looks like a major release number.
3656 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
3657 (release): Rename from `alpha'.
3658 (alpha): Depend on release.
3660 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
3662 2002-11-14 Jim Meyering <jim@meyering.net>
3664 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
3665 (announcement): Use the new variable.
3667 * Makefile.maint: Sync with Bison, i.e.:
3668 (po-check): Scan .l and .y files instead of the
3669 .c and the .h files that they generate. This fixes the bug
3670 reported by Tim Van Holder in:
3671 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
3672 Look for N_ as well as for _. Try to avoid matching #define for
3676 2002-11-12 Jim Meyering <jim@meyering.net>
3678 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
3679 Replace sole use with equivalent `#ifdef S_ISLNK'.
3680 Inconsistency reported by Dmitry V. Levin.
3682 2002-11-11 Jim Meyering <jim@meyering.net>
3684 * src/stat.c (usage): Transform --help items output via s/ - / /,
3685 so that help2man produces properly formatted man pages.
3686 Reported by Herbert Xu as Debian bug #168400.
3688 2002-11-10 Jim Meyering <jim@meyering.net>
3690 * src/ls.c (sighandler): Handle SIGTSTP specially.
3691 Based on suggestions from Solar Designer and Dmitry V. Levin.
3694 * Makefile.cfg (cvs_files): Define. From autoconf.
3695 (local_updates): Likewise.
3697 * src/ls.c (restore_default_color_handler, sigtstp_handler):
3699 (sighandler): New function, based on the one in sort.c.
3700 (main): Use sigaction, if possible; otherwise signal.
3701 Handle these signals:
3702 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
3703 Don't register our handler if the signal is already being ignored.
3705 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
3706 * src/csplit.c (interrupt_handler): Likewise.
3707 * src/sort.c (sighandler): Likewise.
3708 (main): Declare `i' and `nsigs' to be unsigned, not int.
3710 2002-11-09 Jim Meyering <jim@meyering.net>
3712 ls --color: restore terminal text color upon signal.
3713 * src/ls.c: Include "full-write.h" and <signal.h>.
3714 (restore_default_color, restore_default_color_handler): New functions.
3715 (sigtstp_handler, put_indicator_direct): New functions.
3716 (main) [print_with_color]: Register signal handlers.
3717 Patch mostly by Solar Designer and Stanislav Ievlev.
3719 Update from autoconf.
3720 * Makefile.maint (AMTAR): Remove definition.
3721 (update, cvs-update, po-update, do-po-update): New rules.
3722 (wget-update): Update (thus renaming to cvs-update).
3723 (automake_repo): Use anoncvs@sources.redhat.com.
3725 2002-11-06 Jim Meyering <jim@meyering.net>
3727 * tests/misc/Makefile.am (TESTS): Add printf-hex.
3729 * tests/misc/printf: Be careful to test the code in this package,
3730 not the shell built-in function.
3732 * src/printf.c (print_esc): A hexadecimal escape sequence has
3733 at most two hex. digits, not three. Reported by Padraig Brady.
3734 (usage): Update description.
3735 * tests/misc/printf-hex: New file/test, for the above fix.
3737 2002-10-07 Paul Eggert <eggert@twinsun.com>
3739 Add support for locale-specific size indications (e.g.,
3740 thousands-separators) and for explicit size suffixes on output.
3742 * doc/coreutils.texi (Block size): Say that:
3743 This affects display format as well as block size.
3744 Fractional block counts are rounded up.
3745 ls file size blocksize defaults to 1.
3746 A block size spec preceded by ' generates thousands separators.
3747 A suffix without a preceding integer generates suffixes.
3748 (tail invocation): 32k -> 32 KiB.
3749 (What information is listed): ls -h is now equivalent to
3750 ls --block-size=human, and ls -H is now equivalent to
3751 ls --block-size=si. Displayed file size is now always affected by
3754 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
3755 lib/umaxtostr.c: New files, taken from GNU tar.
3757 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
3759 (EXTRA_DIST): Add inttostr.c.
3761 * lib/human.c, lib/human.h: Rewrite to support locale-specific
3762 notations like thousands separators.
3763 Specify what includer of include.h must include beforehand.
3764 (human_group_digits, human_suppress_point_zero, human_autoscale,
3765 human_base_1024, human_SI, human_B): New enum values.
3766 (human_readable): Rename from human_readable_inexact; put the
3767 options before the sizes. All uses changed. The old human_readable
3768 function has been removed; use inttostr.h instead.
3769 (human_options): Renamed from human_block_size, with new signature
3770 that allows block sizes up to UINTMAX_MAX. All callers changed.
3772 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
3773 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
3774 freestanding C89. No need to check for stdlib.h or string.h since
3775 autoconf does this now.
3777 * src/cksum.c (cksum): Use primitives from inttostr.h, not
3778 human.h, to print large numbers simply.
3779 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
3780 * src/dd.c (print_stats, main): Likewise.
3781 * src/df.c (print_header): Likewise.
3782 * src/factor.c (print_factors): Likewise.
3783 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
3784 * src/shred.c (dopass): Likewise.
3785 * src/sort.c (checkfp): Likewise.
3786 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
3787 * src/tail.c (xlseek): Likewise.
3788 * src/wc.c (write_counts, wc): Likewise.
3790 * src/df.c (human_output_opts): New var.
3791 (output_block_size): Now uintmax_t, not int, to handle larger
3792 block sizes. All uses changed.
3793 * src/du.c: Likewise.
3794 * src/ls.c: Likewise.
3796 * src/df.c (print_header): In the header line, prefer SI to human
3797 representation if it's shorter; if neither is shorter, try to
3798 intuit what the user would prefer.
3800 * src/expr.c (inttostr): Remove; use new imaxtostr library
3803 * src/ls.c (file_output_block_size): New var, to distinguish
3804 file sizes from other sizes.
3805 (decode_switches): Set it.
3807 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
3808 (dopass): When printing progress, use floor for what has been done
3809 so far (since we should be conservative there), and ceiling for
3810 what needs to be done (since that's what other programs use).
3812 2002-10-19 Jim Meyering <jim@meyering.net>
3814 * src/pinky.c (print_heading): Align TTY and Name headings.
3815 Reported by Karl Eichwalder.
3817 2002-10-18 Jim Meyering <jim@meyering.net>
3819 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
3820 Remove now-useless cast.
3821 (stdread): Remove function.
3822 (bytes_split): Use size_t instead of int.
3823 Use safe_read, not stdread.
3824 (lines_split): Likewise.
3825 Use memchr rather than a `while' loop.
3826 (line_bytes_split): Use size_t instead of int.
3827 Use safe_read, not stdread.
3828 (main): Add some FIXME comments to remind me to remove casts.
3830 * src/system.h (ST_BLKSIZE): Correct comment describing how to
3831 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
3833 2002-10-17 Jim Meyering <jim@meyering.net>
3835 Fix a problem that could make e.g., `cat' misbehave on systems which
3836 give invalid (unreasonably large) values for stat.st_blksize.
3837 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
3838 Reported by Petter Reinholdtsen.
3840 2002-10-14 Jim Meyering <jim@meyering.net>
3842 Specifying a printf conversion specifer as nl's separator string
3843 could cause nl to segfault.
3844 * src/nl.c (build_print_fmt): Don't include separator string
3845 in the printf format; it might contain `%'.
3846 Use a better bound on the length of the print_fmt buffer.
3847 (print_lineno): Print the separator here instead.
3848 Reported by Doug Coleman.
3850 * tests/misc/nl: New file/tests, including a test for the above.
3851 * tests/misc/Makefile.am (TESTS): Add nl.
3853 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
3854 * tests/misc/Makefile.am (TESTS): Add split-l.
3856 2002-10-13 Jim Meyering <jim@meyering.net>
3860 * src/du.c (usage): Tweak description of --dereference-args/-D.
3862 * src/du.c (count_entry): Also save cwd when dereferencing (via
3863 --dereference-args, -D) a command-line argument.
3864 Reported by Michal Svec. Based on a patch by Andreas Schwab.
3866 * src/Makefile.am (../AUTHORS): New target/rule.
3868 2002-10-12 Jim Meyering <jim@meyering.net>
3870 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
3871 of type size_t, since that's the way it's used and avoids a warning.
3873 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
3874 since that's how it's always used and avoids a new warning from gcc.
3875 (read_input): Adapt to new safe_read ABI.
3877 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
3880 * src/pinky.c (print_long_entry): fread returns size_t.
3881 Declare local `bytes' accordingly, to avoid warning.
3883 tail -c +N would perform an extra read after encountering EOF
3884 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
3885 * src/tail.c (start_bytes): Detect EOF, inform caller.
3886 (tail_bytes): Upon EOF in start_bytes, return immediately.
3887 (file_lines): Reorganize to use memrchr rather than an explicit loop.
3888 Adapt to new safe_read ABI.
3890 2002-10-11 Jim Meyering <jim@meyering.net>
3892 * tests/du/deref: New file/test, for the above fix.
3893 * tests/du/Makefile.am (TESTS): Add deref.
3895 2002-10-10 Jim Meyering <jim@meyering.net>
3897 * tests/ln/Makefile.am (TESTS): Add target-1.
3898 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
3900 2002-10-09 Jim Meyering <jim@meyering.net>
3902 * tests/cp/backup-is-src: Ensure that certain environment variables
3903 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
3905 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
3906 consume 4GB of disk space on systems without support for sparse files.
3907 Fix a logic error that'd make it `cat err' even though dd didn't fail.
3909 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
3910 Patch by steven@magelico.net, forwarded by Michael Stone.
3912 * tests/ls/dired: Ensure that ls produces English messages.
3913 Patch by Alexey Vyskubov, forwarded by Michael Stone.
3915 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
3917 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
3919 2002-10-08 Jim Meyering <jim@meyering.net>
3921 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
3922 Fix syntax in test: use =, not ==.
3923 Reported by Bob Proulx.
3924 Change all the rest like this: grep -lR "testing framework'" .\
3925 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
3927 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
3928 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
3929 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
3930 * src/wc.c (wc): Likewise.
3932 2002-10-07 Paul Eggert <eggert@twinsun.com>
3935 Don't advance the write pointer past the end of the write buffer.
3936 * src/sort.c (begfield, limfield): Likewise.
3938 2002-10-07 Jim Meyering <jim@meyering.net>
3940 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
3941 * src/head.c (head_bytes, head_lines): Likewise.
3943 2002-10-06 Jim Meyering <jim@meyering.net>
3945 * src/dd.c (scanargs): Ensure that specified block sizes (specified
3946 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
3947 (skip, dd_copy): Adapt to new safe_read ABI.
3949 * Makefile.maint (signatures): Define.
3951 (announcement): Depend on $(signatures).
3953 * Makefile.maint (announcement): Output all URLs for detached
3954 signatures, not just the last one from the previous loop.
3956 2002-10-05 Jim Meyering <jim@meyering.net>
3960 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
3961 don't recurse into directory, DIR. Prompted by a report from
3964 * tests/rm/i-no-r: New file/test, for the above fix.
3965 * tests/rm/Makefile.am (TESTS): Add i-no-r.
3967 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
3968 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
3970 2002-10-03 Jim Meyering <jim@meyering.net>
3972 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
3973 * src/df.c (AUTHORS): Likewise.
3974 * src/du.c (AUTHORS): Likewise.
3975 * src/tail.c (AUTHORS): Likewise.
3976 * src/touch.c (AUTHORS): Likewise.
3978 2002-10-02 Jim Meyering <jim@meyering.net>
3980 * Makefile.am (SUBDIRS): Remove `old'.
3981 (EXTRA_DIST): List the files in old/.
3982 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
3983 Suggestion from Akim Demaille.
3985 2002-10-01 Jim Meyering <jim@meyering.net>
3987 * src/sys2.h (SSIZE_MAX): Define.
3989 2002-09-30 Jim Meyering <jim@meyering.net>
3991 * src/csplit.c: Don't include stdlib.h here. It's already included
3994 2002-09-29 Jim Meyering <jim@meyering.net>
3996 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
3997 expression to avoid bogus warning from gcc.
3999 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4000 (cat): Declare insize and outsize to be of type size_t, not int.
4001 Rearrange pointer/integer expressions to avoid bogus warnings.
4002 (main): Declare insize and outsize to be of type size_t, not int.
4004 * src/tail.c (parse_options): Give a sensible diagnostic for
4005 an invalid byte or line count. Reported by Mikko Tuumanen.
4007 * src/touch.c (main): Split a long line.
4009 * tests/du/Makefile.am (TESTS): Add slink.
4010 * tests/du/slink: New test for system.h change of 2002-08-31.
4012 In move mode, always first try to rename. Before, upon failure to
4013 rename a directory, this code would never attempt to rename any
4014 other file in that directory, but would thenceforth always copy.
4015 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4016 may fail with EXDEV, yet renaming files within that directory to
4017 a newly-created destination directory succeeds.
4018 * src/copy.c (copy_internal): Remove local, move_mode;
4019 use x->move_mode instead. Based on a patch from Tom Haynes.
4021 2002-09-28 Jim Meyering <jim@meyering.net>
4023 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4024 Factor out some duplication.
4026 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4028 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4030 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4031 to avoid compiler warnings.
4033 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4036 Fix things so `mkdir -p' can create very deep directories, e.g.,
4037 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4038 * src/mkdir.c (main): For --parents (-p), call make_path with the
4039 entire directory name, so we don't ever require that file operations
4040 like stat or chmod be performed on the entire command line argument.
4041 * makepath.c (make_path): Restore umask *before* creating the final
4044 2002-09-27 Andreas Schwab <schwab@suse.de>
4046 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4047 to avoid overflow. Reported by Hans Lermen.
4049 2002-09-26 Jim Meyering <jim@meyering.net>
4051 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4053 2002-09-25 Jim Meyering <jim@meyering.net>
4055 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4056 and add a cast, to avoid a warning about `signed and unsigned type in
4057 conditional expression'.
4059 2002-09-22 Jim Meyering <jim@meyering.net>
4061 * src/rmdir.c: Include "dirname.h", for declaration of
4062 strip_trailing_slashes.
4064 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4065 Now they're defined through system.h.
4067 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4068 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4069 since it's already included from sys2.h via system.h.
4071 * Use automake-1.6f. Regenerate dependent files.
4073 * src/Makefile.am (PERL): Remove duplicate definition.
4075 fmt's -s, -t, -c options didn't work properly for long lines.
4076 Since get_line may end up calling put_paragraph (for long lines),
4077 be sure to set global, `other_indent', before it is used there.
4079 * src/fmt.c (set_other_indent): New function, factored out of...
4080 (get_paragraph): ... here. Call it.
4081 (get_line): Call set_other_indent before calling flush_paragraph,
4082 which calls fmt_paragraph, which in turn calls put_paragraph,
4083 which uses other_indent.
4085 * tests/fmt/Makefile.am (TESTS): Add long-line.
4086 * tests/fmt/long-line: New file/test, for the above fix.
4088 2002-09-21 Jim Meyering <jim@meyering.net>
4090 * src/od.c: No longer include deprecated <values.h>.
4091 It was required solely for now-removed reference to BITSPERBYTE.
4092 * src/install.c: Likewise.
4093 Suggestion from Bruno Haible.
4095 2002-09-06 Andreas Schwab <schwab@suse.de>
4097 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4098 * src/rmdir.c (remove_parents): Strip trailing slashes.
4100 2002-09-20 Jim Meyering <jim@meyering.net>
4102 * tests/rmdir/t-slash: New file/test, for the above fix.
4103 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4105 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4106 Add a URL for each detached signature file.
4108 2002-09-07 Bruno Haible <bruno@clisp.org>
4110 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4112 2002-09-18 Jim Meyering <jim@meyering.net>
4114 `od -t x8' used the wrong (`l'-prefixed) printf format.
4115 Likewise for the o8 and u8 formats.
4116 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4117 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4118 Reported by Arun Sharma.
4120 2002-09-17 Jim Meyering <jim@meyering.net>
4122 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4123 From gettext's intl/loadmsgcat.c.
4125 * tests/od/x8: New file/test, for the above fix.
4126 * tests/od/Makefile.am (TESTS): Add x8.
4128 2002-09-15 Jim Meyering <jim@meyering.net>
4130 * Use autoconf-2.54. Regenerate dependent files.
4132 * src/csplit.c (get_format_width): Add cast to avoid
4133 warning about `signed and unsigned type in conditional expression'.
4135 2002-09-14 Jim Meyering <jim@meyering.net>
4137 * src/who.c (print_user): Change type of local to size_t
4138 to avoid warnings about `comparison between signed and unsigned'.
4139 * src/ptx.c (generate_all_output): Likewise.
4141 * src/dd.c (main, skip): Add casts to avoid warnings about
4142 `comparison between signed and unsigned'.
4144 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4145 warnings about `signed and unsigned type in conditional expression'.
4147 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4148 to avoid warnings about `comparison between signed and unsigned'.
4149 (split_3): Change parameter names to be readable and add comment.
4150 Clean up the test for whether a line may be ignored.
4152 2002-09-13 Jim Meyering <jim@meyering.net>
4154 * src/printf.c (main): Handle leading command line argument of `--'.
4155 Reported by Raul: DervishD <raul@pleyades.net>
4156 * tests/misc/printf: New file: test for the above.
4157 * tests/misc/Makefile.am (TESTS): Add printf.
4159 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4160 rather than 0..59 -- to accommodate the occasional positive leap second.
4161 Reported by Richard Neill.
4163 2002-09-12 Jim Meyering <jim@meyering.net>
4165 * src/Makefile.am (nanosec_libs): Define.
4166 (sleep_LDADD, tail_LDADD): Use it here.
4168 Factor nanosleep-related code into ../lib/xnanosleep.c.
4169 * src/sleep.c: Include xnanosleep.h.
4170 Factor out fenv.h-related code.
4171 (timespec_subtract): Remove function.
4172 (main): Remove code that deals with computing start and stop times
4173 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4175 Allow S (in --sleep-interval=S) to be a floating point value.
4176 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4177 Move declaration of global variable, sleep_interval, to ...
4179 (usage): Update description of --sleep-interval option.
4180 (tail_forever): New parameter, sleep_interval. Update caller.
4181 Use xnanosleep, rather than sleep.
4182 (parse_options): New parameter, sleep_interval. Update caller.
4183 Use xstrtod, now that we accept floating point values.
4184 Prompted by a patch from Augey Mikus.
4186 2002-09-06 Jim Meyering <jim@meyering.net>
4188 * src/remove.c (prompt): Change comment to give a better note to
4189 translators. From Michael Piefel.
4191 2002-09-02 Jim Meyering <jim@meyering.net>
4193 * README: A good problem report/patch includes diffs against
4194 the most recent test release.
4196 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4197 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4199 * src/kill.c (print_table_row): Use an unsigned type for widths
4200 to avoid warning about comparison between signed and unsigned.
4201 (list_signals): Likewise.
4203 * src/od.c (skip): Add a cast to avoid warning about comparison
4204 between signed and unsigned.
4205 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4206 comparisons to make them more readable.
4208 2002-09-01 Jim Meyering <jim@meyering.net>
4212 2002-08-31 Jim Meyering <jim@meyering.net>
4214 Symlinks were always reported as using 0 blocks.
4215 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4216 This reverts the change of 2000-01-30.
4217 Based on a report and patch from Neil Brown via Michael Stone.
4218 This fixes Debian Bug#156358.
4220 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4221 `exit (1)' to `exit (EXIT_FAILURE)', and
4222 `usage (1)' to `usage (EXIT_FAILURE)'.
4224 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4225 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4226 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4227 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4228 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4229 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4230 error never exits successfully.
4232 2002-08-29 Jim Meyering <jim@meyering.net>
4234 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4235 when ignoring any return value.
4237 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4238 failures. On some systems (at least EMC Celerra and Solaris5.8),
4239 this appears to be necessary.
4240 (is_empty_dir): Likewise. Also, always close directory handle.
4241 * src/ls.c (print_dir): Likewise.
4242 (print_dir): Rename local variable: reading -> dirp.
4243 Reported by Mike Coleman.
4245 2002-08-28 Jim Meyering <jim@meyering.net>
4247 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4248 Give a diagnostic and fail if closedir fails.
4250 2002-08-26 Jim Meyering <jim@meyering.net>
4252 * Makefile.am (THANKS-to-translators): New rule.
4253 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4254 * THANKStt.in: New file.
4256 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4258 (main): Register it with atexit.
4259 Close STDOUT_FILENO, to avoid a problem when writing to
4260 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4261 Reported by Shing-Shong Shei.
4263 2002-08-25 Jim Meyering <jim@meyering.net>
4265 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4266 * src/tac.c (main): Likewise.
4267 * src/tail.c (main): Likewise.
4268 * src/tee.c (main): Likewise.
4269 * src/tr.c (main): Likewise.
4270 * src/wc.c (main): Likewise.
4272 2002-08-20 Jim Meyering <jim@meyering.net>
4274 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4276 2002-08-10 Paul Eggert <eggert@twinsun.com>
4278 * src/nohup.sh: Don't use "exec --"; it's not portable and
4279 shouldn't be needed.
4281 2002-08-09 Jim Meyering <jim@meyering.net>
4283 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4284 (usage): Clarify help text for the -COLUMN option.
4285 Patch by Padraig Brady.
4286 * tests/pr/Test.pm [col-last]: New test for the above.
4288 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4289 than the latest version numbers of the component packages.
4291 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4294 2002-08-08 Jim Meyering <jim@meyering.net>
4296 * src/date.c: Guard inclusion of <langinfo.h> with
4297 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4298 * src/sort.c: Likewise.
4299 Patch by GOTO Masanori.
4301 2002-08-05 Paul Eggert <eggert@twinsun.com>
4303 Fix some minor time-related bugs with POSIX time arguments.
4304 Some valid time stamps were being rejected (notably -1, and
4305 time stamps before 1900 on 64-bit hosts). And some invalid
4306 time stamps were being accepted, e.g. September 31.
4308 * src/date.c (main): Adjust to posixtime signature change.
4309 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4310 Use localtime, not posixtm, to warn about obsolete "touch".
4312 2002-08-05 Jim Meyering <jim@meyering.net>
4314 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4316 2002-08-04 Jim Meyering <jim@meyering.net>
4318 * src/Makefile.am (check-README): New target/rule.
4319 (check): Depend on it.
4321 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4323 2002-08-03 Jim Meyering <jim@meyering.net>
4325 * Makefile.am (SUBDIRS): Add old.
4326 * old/: New directory, containing legacy ChangeLog* and NEWS files
4327 from the fileutils, sh-utils, and textutils packages.
4329 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4331 2002-08-02 Paul Eggert <eggert@twinsun.com>
4333 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4335 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4336 (hard_LC_COLLATE): New var.
4337 (different): Args are now char *, not const char *.
4338 Use xmemcoll instead of memcmp to compare lines, so that
4339 LC_COLLATE has effect. However, use memcmp if it is an
4341 (check_file): Do not include newline in comparison, so that
4342 xmemcoll has a byte to stomp on temporarily.
4343 (main): Set hard_LC_COLLATE.
4345 2002-07-29 Jim Meyering <jim@meyering.net>
4347 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4349 2002-07-20 Jim Meyering <jim@meyering.net>
4351 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4352 into EXIT_FAILURE. Otherwise, false --help and false --version
4355 2002-07-08 Jim Meyering <jim@meyering.net>
4357 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4358 rather than the hard-coded `sh-utils'.
4360 2002-07-01 Jim Meyering <jim@meyering.net>
4362 * configure.ac: Merge the three files from fileutils,
4363 textutils, and sh-utils.
4364 * Makefile.am: Likewise.
4365 * src/Makefile.am: Likewise.