1 2000-11-27 Jim Meyering <meyering@lucent.com>
5 * tests/touch/no-rights: Use touch with `-d tomorrow' to avoid
8 * tests/Fetish.pm (_compare_files): New function.
9 (_process_file_spec): Likewise.
10 (_at_replace): Likewise.
11 (run_tests): Support new keywords, AUX and CMP and associated
14 * config.sub: Likewise.
15 * config.guess: Likewise.
17 2000-11-26 Jim Meyering <meyering@lucent.com>
19 * src/dd.c (skip): Perform the `records < blocksize' test
20 at the top of the loop, not at the bottom.
22 2000-11-26 Paul Eggert <eggert@twinsun.com>
24 * src/dd.c (skip): New arg COUNT_BYTES. Read with BLOCKSIZE
25 bytes, but consider RECORDS to be a byte count if COUNT_BYTES
28 2000-11-25 Paul Eggert <eggert@twinsun.com>
30 * doc/fileutils.texi: Document seek=nB and skip=nB.
32 * src/dd.c (skip_bytes, seek_bytes): Now booleans, not counts.
33 (seek_records): Renamed from seek_record, for consistency with
34 skip_records and max_records. All uses changed.
36 (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB
38 (enum Unit, Unit): Remove.
39 (skip, dd_copy, main): Undo most recent change.
40 (dd_copy, main): Pass blocksize of 1 as appropriate when
41 skip_bytes or seek_bytes is nonzero.
42 (main): Rework ftruncate failure diagnostic to always use byte count.
44 2000-11-25 Jim Meyering <meyering@lucent.com>
46 * src/dd.c: Add new options, bskip and bseek.
47 Based on a patch from Chris Sylvain.
48 * tests/dd/skip-seek: New tests.
49 * tests/dd/Makefile.am (TESTS): Add skip-seek.
51 2000-11-24 Paul Eggert <eggert@green.twinsun.com>
53 * src/dd.c (S_TYPEISSHM): New macro.
54 (main): Report failed fstat.
55 Complain only when ftruncate fails on a regular file,
56 a directory, or a shared memory object.
58 2000-11-24 Jim Meyering <meyering@lucent.com>
60 * src/dd.c: Declare a pointer parameters to be `const' as appropriate.
62 * src/dd.c (main): Use ftruncate only on regular files.
63 Based on a patch from Michael Stone.
64 Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
66 2000-11-23 Jim Meyering <meyering@lucent.com>
68 * src/df.c (show_point): Before accepting an entry as a match, make
69 sure that the mount directory exists and has the required device number.
70 Before, e.g., `df /floppy' would mistakenly report on the root
71 partition if /floppy were not listed in /etc/mtab but / was.
72 Patch from Eirik Fuller (http://bugs.debian.org/76923).
74 * src/chmod.c (mode_changed): New function.
75 (change_file_mode): Use it to determine accurately when -c should
76 make chmod announce there's been a change.
77 Based on a patch from Michael Stone.
78 Reported by Kai Henningsen as Debian bug #77349.
80 * tests/chmod/c-option: New test for the above fix.
81 * tests/chmod/Makefile.am (TESTS): Add c-option
83 * tests/sticky-check: New file. Factored out of tests/mkdir/parents.
84 * tests/Makefile.am (EXTRA_DIST): Add sticky-check.
85 * tests/mkdir/parents: Source sticky-check instead of open-coding it.
87 2000-11-19 Jim Meyering <meyering@lucent.com>
89 * tests/chmod/equal-x: Update to use its own directory, and better trap.
91 2000-11-18 Paul Eggert <eggert@twinsun.com>
93 * src/ls.c (BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION,
94 INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION,
95 SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum
96 values, to ensure that option values can't collide with chars.
97 (long_options, decode_switches): Use them.
99 2000-11-18 Paul Eggert <eggert@twinsun.com>
101 * src/sys2.h (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum
102 constants rather than macros. Use values that cannot conflict
103 with C characters or with -1, CHAR_MAX + 1, etc.
105 2000-11-18 Jim Meyering <meyering@lucent.com>
107 * src/du.c (count_entry): Don't omit the size of a directory entry
108 merely because we couldn't `chdir' into it. That would give subtly
109 different results in some cases. Reported by Mattias Wadenstein
112 * src/ls.c: Revert change of 2000-11-11. It inadvertently change
113 the output format of `ls -l --full-time'.
115 * src/mkdir.c (main): When failing to create a directory, give only
116 one diagnostic, not two. Reported by Volker Borchert.
118 * src/mkdir.c (main): With --parents, remove any trailing slashes
119 from the argument to the final mkdir call. Required for NetBSD.
120 Reported by Volker Borchert.
121 * tests/mkdir/t-slash: New test for this.
122 * tests/mkdir/Makefile.am (TESTS): Add t-slash.
124 * tests/mv/mv-special-1: Create and `cd' into temporary directory
125 before anything else. Reported by Volker Borchert.
127 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
128 very latest version (in CVS) of autoconf.
130 2000-11-17 Jim Meyering <meyering@lucent.com>
132 * Makefile.am (.NOTPARALLEL): Remove target.
133 * GNUmakefile (.NOTPARALLEL): ... put it here instead, since this
134 file is common to these packages: fileutils, sh-utils, textutils.
136 * Makefile.am (.NOTPARALLEL): New target. Prevent unwanted parallelism.
137 Suggestion from Ulrich Drepper.
138 * po/Makefile.in.in (Makefile): Likewise.
140 * Makefile.maint (sha1): Define.
141 (announcement): Include SHA1 digest of .tar.gz file.
143 2000-11-14 Jim Meyering <meyering@lucent.com>
145 * tests/mkdir/perm: Add an `echo' so that the input to the sed command
146 is NL-terminated. Otherwise, Solaris' /bin/sed generates no output.
147 Reported by Vin Shelton.
149 2000-11-13 Paul Eggert <eggert@twinsun.com>
151 * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
152 be tested with #ifdef, not with #if.
154 2000-11-12 Jim Meyering <meyering@lucent.com>
156 * src/ls.c (print_long_format): Remove obsolete comment.
159 * doc/texinfo.tex: Update from master repository.
161 2000-11-11 Paul Eggert <eggert@sic.twinsun.com>
163 * src/ls.c (<langinfo.h>): Include if HAVE_LANGINFO_H.
164 (DATE_FMT_LANGINFO): New macro, taken from sh-utils/src/date.c.
165 (print_long_format): Use it to determine "date" format.
166 Do not wrap "%b %e %Y" and "%b %e %H:%M" in _(), as it results in
167 incorrect behavior when LC_ALL is unset, LC_TIME is "C", and
168 LC_MESSAGES or LANG is set to something disagreeing with the POSIX
171 2000-11-11 Jim Meyering <meyering@lucent.com>
175 * Makefile.maint (GZIP_ENV): Define to --no-name, so the timestamp
176 is not included in the .tar.gz file.
178 * tests/mkdir/perm (tests): Use `empty' (instead of just blanks) to
179 indicate no `-m' option. Using just blanks wasn't portable to
180 Solaris2.5.1's /bin/sh.
182 * tests/mkdir/perm: Don't put a newline in IFS; that's not portable to
183 NetBSD's /bin/sh. Instead, filter newlines and leading/trailing blanks
184 out of `tests' before the `set -'.
186 * Makefile.maint (announcement): Limit depth of ChangeLog `find' to 2.
188 * src/ls.c (print_long_format): Wrap the `--full-time' date format
189 string in _(...), so it too may be internationalized.
190 Suggestion from Jungshik Shin.
192 2000-11-10 Jim Meyering <meyering@lucent.com>
194 * src/touch.c (main): Interpret a lone numeric argument of 8 or 10
195 digits as a file name, rather than as a date/time in the obsolescent
196 `MMDDhhmm[YY]' format. Reported by Wenjun Zheng.
197 * tests/touch/obsolescent: New test for this.
198 * tests/touch/Makefile.am (TESTS): Add obsolescent.
200 2000-11-06 Jim Meyering <meyering@lucent.com>
202 * tests/cp/cp-parents: Move mkdir tests into ../mkdir.
204 * doc/fileutils.texi: Use Free Documentation Licence.
205 Change GNU to @sc{gnu} in many places.
207 * doc/texinfo.tex: Update from master repository.
208 * config.sub: Likewise.
209 * config.guess: Likewise.
210 * man/help2man: Update from latest version: 1.23.
212 * src/mkdir.c: Do not set the permissions of the final directory
213 component if it was not just created.
214 Based on a patch from Volker Borchert.
216 * tests/rwx-to-mode: New file.
217 * tests/Makefile.am (EXTRA_DIST): Add rwx-to-mode.
218 * tests/mkdir/parents: New test for the above mkdir.c fix.
219 * tests/mkdir/Makefile.am (TESTS): Add parents.
220 (TESTS_ENVIRONMENT): Define srcdir=$(srcdir).
222 2000-11-02 Won-kyu Park <wkpark@chem.skku.ac.kr>
224 * src/df.c (print_header): Mark strings for translation.
226 2000-11-05 Jim Meyering <meyering@lucent.com>
230 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
231 very latest version (in CVS) of autoconf.
233 * src/mkdir.c (main): Use make_dir instead of using mkdir directly.
234 Diagnose as failure when mkdir tries to create (without the
235 --parent (-p) option) a directory that already exists.
236 * tests/cp/cp-parents: Add a test for the above fix.
238 * tests/mv/mv-special-1: Clean up this test.
240 2000-11-01 Jim Meyering <meyering@lucent.com>
244 * src/chmod.c (main): Better diagnostics.
246 2000-10-31 Jim Meyering <meyering@lucent.com>
248 * tests/lang-default: Add all the internationalization-related
249 variable names autoconf uses. Set and export them in a loop.
251 `mkdir -p' would create parent directories with permissions
252 that did not account for the umask. [introduced with the
253 2000-09-30 change that became part of fileutils-4.0.28]
254 * src/mkdir.c: Include dirname.h.
255 Compute the parent directory `mode' unconditionally, effectively
256 as `$(umask -S),u+wx'.
257 Use make_path to create only the parent directories, thus using
258 the same code, both with and without -p, to create the final
259 component in each file name. Reported by Bob Proulx.
261 Add tests for the above fix.
262 * tests/cp/cp-parents: Add some permission tests.
263 * tests/mkdir/perm: Fix the test so it actually does something.
264 Run each test also with mkdir's `-p' option and check permissions
265 on the parent directories.
267 2000-10-23 Paul Eggert <eggert@twinsun.com>
269 * doc/getdate.texi: Use @sc where appropriate. Document the
270 ranges of supported times more precisely. Correct menu
271 spacing. Document old Latin 12m/12pm tradition. Remove list
272 of alphabetic time zone names, as it wasn't correct and people
273 shouldn't be relying on it anyway. Relative items also
274 account for non-DST adjustments. Fix some misspellings.
276 2000-10-30 Jim Meyering <meyering@lucent.com>
278 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
279 very latest version (in CVS) of autoconf.
281 2000-10-29 Jim Meyering <meyering@lucent.com>
285 * src/cp.c (do_copy): When constructing dst_path for use with the
286 --parents option, first remove any trailing slashes from the command
287 line argument. Otherwise, tests/cp/cp-parent would fail on NetBSD.
289 * tests/cp/cp-parents: Add a test.
291 * src/ls.c (DT_INIT): Define.
292 [enum filetype]: Remove the #ifdef, and use DT_INIT on the
293 initializers instead. `unknown' was undefined for some systems.
294 Reported by John David Anglin.
296 * tests/lang-default (LC_COLLATE): Set it to the empty string and
297 export it. Otherwise, tests/cp/cp-mv-backup would fail e.g., when
298 LC_COLLATE was set to en. Reported by Vin Shelton.
300 2000-10-28 Jim Meyering <meyering@lucent.com>
302 * src/ls.c (main): In call to gobble_file with `"."', use `directory'
303 as the type, not `unknown'.
304 [enum filetype] (arg_directory): Rather than `100', use
305 a number that should never conflict with another DT_* value.
310 Make `ls' a lot more efficient on systems (e.g., linux-2.4.*)
311 that store file type information in directory entries.
313 * src/ls.c [enum filetype] (unknown):
314 Add members (as yet unused):
315 (HAVE_STRUCT_DIRENT_D_TYPE): Define.
316 (format_needs_type): New global.
318 (print_dir): Set `type' from directory entry, if possible.
319 (gobble_file): Add a parameter, TYPE.
320 Stat the file only if its type is unknown and we need the type.
321 Patch from Ulrich Drepper.
323 Shred can now determine the size of a block devices (e.g. /dev/fd0)
324 by writing until a write operation fails.
326 * src/shred.c: Include assert.h.
327 (fillrand): Add a parameter, size_max.
330 (dopass): Break out of the `for (;;)' loop if size < offset.
331 That can happen now that dopass is called with SIZE == -1.
332 (do_wipefd): Accept a length of zero only for a regular file.
333 If lseek fails or returns 0 for a non-regular file, let dopass
334 determine the length.
335 Inspired by a patch from Alan Iwi.
337 * tests/Makefile.am (EXTRA_DIST): Add lang-default.
339 * tests/rm/hash: Factor out the expensive-test-checking code, ...
340 * tests/expensive: ... into this new file.
341 * tests/cp/perm: Disable this test by default; it's expensive.
342 Mark this as an expensive test.
343 * tests/Makefile.am (EXTRA_DIST): Add expensive.
345 * doc/fileutils.texi (shred invocation): Give two examples.
347 2000-10-26 Jim Meyering <meyering@lucent.com>
349 * doc/getdate.texi (Authors of getdate): Add Paul Eggert.
351 2000-10-23 Jim Meyering <meyering@lucent.com>
353 * Makefile.am (EXTRA_DIST): Add .prev-version.
355 2000-10-22 Jim Meyering <meyering@lucent.com>
357 * src/cp.c (make_path_private): Add a FIXME comment.
359 * tests/lang-default: New file. Set LANG, LC_ALL, and LANGUAGE to ''
360 (rather than to `C') and export them into the environment.
361 Suggestion from Bruno Haible.
363 * tests/cp/backup-is-src: Source lang-default rather than open-coding
364 the setting/exporting of LANG, LC_ALL, and LANGUAGE.
365 * tests/cp/cp-mv-backup: Likewise.
366 * tests/cp/same-file: Likewise.
367 * tests/cp/slink-2-slink: Likewise.
368 * tests/cp/symlink-slash: Likewise.
369 * tests/ln/sf-1: Likewise.
370 * tests/ls/symlink-slash: Likewise.
371 * tests/ls/time-1: Likewise.
372 * tests/mv/backup-is-src: Likewise.
373 * tests/mv/diag: Likewise.
374 * tests/mv/force: Likewise.
375 * tests/mv/hard-link-1: Likewise.
376 * tests/mv/i-2: Likewise.
377 * tests/mv/into-self: Likewise.
378 * tests/mv/into-self-2: Likewise.
379 * tests/mv/into-self-3: Likewise.
380 * tests/mv/mv-special-1: Likewise.
381 * tests/mv/part-symlink: Likewise.
382 * tests/mv/partition-perm: Likewise.
383 * tests/rm/r-1: Likewise.
384 * tests/rm/r-2: Likewise.
386 2000-10-21 Jim Meyering <meyering@lucent.com>
388 * tests/cp/cp-parents: New test.
389 * tests/cp/Makefile.am (TESTS): Add cp-parents;
391 2000-10-19 Jim Meyering <meyering@lucent.com>
393 * doc/texinfo.tex: Update from master repository.
394 * config.sub: Likewise.
395 * config.guess: Likewise.
398 2000-10-18 Jim Meyering <meyering@lucent.com>
400 * tests/mv/part-symlink: Make sure the programs use C-locale formats
401 and translations. Bruno Haible reported that this test would fail
402 when using other locales, because ls printed a translation of `total'.
404 2000-10-16 Jim Meyering <meyering@lucent.com>
406 * src/ls.c (print_long_format): Wrap date format strings in _(...)
407 so they may be internationalized. Suggestion from Christian Rose.
409 2000-10-13 Jim Meyering <meyering@lucent.com>
411 * src/mv.c (rm_option_init): Remove FIXME-maybe comment.
413 2000-09-30 Jim Meyering <meyering@lucent.com>
415 * tests/du/two-args: Update to use newer template.
417 * src/install.c: Remove big, option-describing comment block.
418 (main): Rename local `symbolic_mode' to `specified_mode'.
420 * src/mkdir.c (main): Don't set the umask to 0 and hand-apply
421 the previously-set umask unconditionally. Do that only when a
422 MODE has been specified. Otherwise, call mkdir with the full
423 creation mask (0777 or 0666) and let the kernel apply the umask.
424 The difference shows up only on file systems with ACL support
425 when the containing directory has a default ACL.
426 Patch by Andreas Gruenbacher.
427 (main): Rename local `symbolic_mode' to `specified_mode'.
428 * src/mknod.c (main): Likewise (but `call mknod', not mkdir).
429 Also, when MODE is specified, call chmod to ensure that the
430 permission bits are set as specified even when the containing
431 directory has a default ACL.
432 Patch by Andreas Gruenbacher.
433 * src/mkfifo.c (main): Likewise (but `call mkfifo', not mkdir).
434 Patch by Andreas Gruenbacher.
436 * tests/mkdir/perm: New test.
437 * tests/mkdir/Makefile.am (TESTS): Add perm.
439 2000-08-17 Andreas Gruenbacher <ag@bestbits.at>
441 * src/chmod.c (change_file_mode): Perform the chmod even if the
442 file mode permission bits are the same as those that should be set.
443 Omitting the chmod call would be alright with minimal 1003.1e DS17
444 ACLs, but eventually there may be other permissions in addition to
445 rwx. E.g., add and delete for directories, and something analogous
446 to NT's take ownership permission.
448 2000-09-25 Jim Meyering <meyering@lucent.com>
450 * tests/cp/same-file: Don't use `diff -u'. It's not portable.
451 Reported by Christian Krackowizer.
452 * tests/cp/same-file: Run `diff -c' only if cmp finds a difference.
453 * tests/mv/part-symlink: Likewise. And clean up.
455 `shred --exact file1 file2' wouldn't touch `file1'
456 * src/shred.c (long_opts): --exact doesn't take an argument.
457 Reported by Alan Iwi.
458 * tests/shred/exact: New test for this.
459 * tests/shred/Makefile.am (TESTS): Add exact.
461 * Makefile.maint (PREV_VERSION): Get the value from a file, rather
462 than trying to derive it from the current version number.
463 This is much more robust.
464 (alpha): Record just-released version number in `.prev-version',
465 and commit (post-tag).
469 2000-09-24 Paul Eggert <eggert@twinsun.com>
471 * doc/fileutils.texi: Update to more closely match changes in 4.0z.
472 * src/cp.c (usage): Match revised documentation better.
474 2000-09-24 Jim Meyering <meyering@lucent.com>
476 * src/cp.c (main): Tweak a relatively new diagnostic.
478 2000-09-23 Jim Meyering <meyering@lucent.com>
480 * tests/ls/time-1: Output more information when a test fails.
482 2000-09-22 Jim Meyering <meyering@lucent.com>
484 * src/install.c (cp_option_init): Once again make it so install always
485 unlinks an existing destination before trying to open it for writing.
486 Otherwise, installing onto a running shared library would make the
487 running program malfunction.
488 Reported by Dan Pascu via Michael Stone.
490 * src/mv.c (do_move): Moving a directory specified with a trailing
491 slash from one partition to another, and giving it a different
492 name at the destination would cause mv to get a failed assertion.
493 Reported by Michael Stone.
494 (strip_trailing_slashes_2): Move function definition to precede
496 * tests/mv/part-rename: New test for the above fix.
497 * tests/mv/Makefile.am (TESTS): Add part-rename.
499 * src/copy.c (copy_internal): Don't try to unlink directories when
500 using --remove-dest with -R.
501 * tests/cp/dir-rm-dest: New test for the above fix.
502 * tests/cp/Makefile.am (TESTS): Add dir-rm-dest.
504 2000-09-19 Jim Meyering <meyering@lucent.com>
506 * doc/fileutils.texi (cp invocation): Describe how --force works.
507 Update description of -P (soon to change meaning to conform w/POSIX).
508 Describe --remove-destination.
510 * src/cp.c (main): When used with --force, each of the --link and
511 --symbolic-link options now implies --remove-destination.
512 Reported by Miles Bader via Mike Stone.
513 * tests/cp/link: New file. Test for the above fix.
514 * tests/cp/same-file: Adjust for this change in behavior.
516 2000-09-15 Volker Borchert <bt@teknon.de>
518 * tests/Makefile.am (check-root, root-hint): New targets.
519 (check-recursive): Depend on root-hint.
520 * Makefile.am (check-root): New target.
522 2000-09-16 Jim Meyering <meyering@lucent.com>
524 * doc/perm.texi (Changing Special Permissions): Remove this statement:
525 ``a' in the USERS part of a symbolic mode does not cause the special
526 permissions to be affected'... It doesn't reflect what the code does
527 and isn't required by POSIX. Reported by aldomel@ix.netcom.com via
530 2000-09-15 Jim Meyering <meyering@lucent.com>
532 * config.sub: Update from master repository.
534 2000-09-10 Jim Meyering <meyering@lucent.com>
536 * tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure
537 that `ls' sorts the same way for everyone. Reported by Vin Shelton.
539 * Makefile.maint (b_host): Use freefriends.org, not tug.org.
541 2000-09-09 Jim Meyering <meyering@lucent.com>
543 * Makefile.maint (announcement): Use a stricter regexp for the
548 * tests/cp/special-bits: New file.
549 * tests/cp/Makefile.am (TESTS): Add special-bits.
550 (TESTS_ENVIRONMENT): Propagate $MAKE into environment, for special-bits.
552 * src/copy.c (SAME_OWNER, SAME_GROUP, SAME_OWNER_AND_GROUP): Define.
553 (copy_internal): Avoid calling chown if we know it's not necessary.
555 * src/copy.c (copy_internal): Call chmod also if we've made the
556 preceding chown call and we're supposed to preserve some special
557 permission bit(s) that would have been reset by chown.
558 Reported by Greg Louis.
560 2000-09-08 Jim Meyering <meyering@lucent.com>
562 * src/mkdir.c (S_IRWXUGO): Remove definition.
563 * src/sys2.h (S_IRWXUGO): Define here, instead.
565 2000-09-07 Jim Meyering <meyering@lucent.com>
567 * doc/texinfo.tex: Update from master repository.
568 * config.sub: Likewise.
569 * config.guess: Likewise.
571 2000-09-05 Jim Meyering <meyering@lucent.com>
573 * tests/mv/part-symlink: Redirect stdout to stderr before trying to
574 remove the temp directory. Otherwise, the `rm -rf' would get an
575 error because the output file wouldn't be closed and the directory
577 * tests/cp/same-file: Likewise.
579 * tests/cp/same-file: Remove the `cp -dl sl1 sl2' case,
580 since it's no longer portable (hard link to a symlink).
581 Likewise for the `cp -bdl symlink foo' case.
583 * config.guess: Update from master repository.
585 2000-09-04 Jim Meyering <meyering@lucent.com>
587 * src/cp.c: Move declaractions of lstat, stat, and rpl_lstat
588 as well as the definition of lstat from here...
589 * src/copy.h: ...to here.
590 * src/copy.c: Remove declaration of lstat, now that it's in copy.h.
592 * tests/mv/force: mv's --force (-f) option is no longer needed for
593 this test, now that all it does is cancel --interactive (-i).
595 * tests/cp/same-file: Add new tests using cp's --rem option.
596 Reflect the fact that cp's -f option no longer causes cp to remove the
597 destination file before trying to open it.
598 Reflect the fact that `cp -bdl' now makes a backup when copying a
599 symlink onto the file it points to (FIXME: look into this, and why
600 cp -bl does *not* do so).
602 * src/ln.c (do_link): Tweak diagnostics.
604 2000-09-03 Jim Meyering <meyering@lucent.com>
606 * src/install.c (cp_option_init): Initialize new members.
608 * src/cp.c (enum): Add UNLINK_DEST_BEFORE_OPENING.
609 [long_options]: Add an entry for --remove-destination.
610 (usage): Describe --remove-destination.
611 (do_copy): Use unlink_dest_after_failed_open member, not `force.'
612 (cp_option_init): Initialize new members.
613 (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
615 * src/mv.c: Remove obsolete comment block.
616 (cp_option_init): Initialize new members.
617 (usage): Reflect the fact that --force (-f) relates only to whether
619 (main): Remove uses of old `force' option member.
621 * src/install.c (cp_option_init): Reflect
623 `force' no longer means unlink-dest-before-opening
624 * src/copy.h (struct cp_options) [force]: Remove member.
625 [unlink_dest_before_opening]: Add member. `cp -f' and `mv -f' used to
626 do this. Now, you must use `cp --remove-destination' to get this
627 behavior. Now, `cp -f' and `mv -f' work as required by POSIX.
628 [unlink_dest_after_failed_open]: Add member.
629 Paul Eggert reported that `cp -f' removes an existing destination
630 file unconditionally, and that is contrary to POSIX.
632 * src/copy.c (same_file_ok): New function, extracted from copy_internal,
634 (copy_internal): Unlink destination file when unlink_dest_before_opening
635 option is set, and when the source is neither a regular file nor a
638 * tests/mv/Makefile.am (TESTS): Add part-symlink.
640 * src/ls.c: Use strcoll (not strcmp) when comparing file names.
641 Suggestion from Ulrich Drepper.
643 2000-08-27 Jim Meyering <meyering@lucent.com>
645 * src/copy.c (copy_reg): New parameters: X and NEW_DST.
646 Remove the SPARSE_MODE parameter. Update caller.
647 Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when copying
648 a regular source file and the destination file exists; upon failure,
649 unlink that existing file, then open again, but with O_WRONLY|O_CREAT.
650 (copy_internal): `force' in not related to interactive; remove
652 Remove the entire `else if (x->force)' block; justifying
653 removal of the non-directory part is easy: POSIX requires we try
654 to open an existing regular file, so we can't unlink it beforehand.
655 The part that changes the mode on a directory to allow overwriting
658 * src/copy.c (copy_reg): Rename two goto labels.
659 (copy_internal): Set `new_dst' when the move_mode rename fails,
660 since we then unlink the destination file.
662 * src/cp.c (usage): --force is independent of --interactive.
664 2000-08-24 Jim Meyering <meyering@lucent.com>
666 Put back the kluge. It's necessary after all.
667 * src/dd.c (buggy_lseek_support): New function.
669 Frank Adler reported that although _llseek returns 0, lseek
670 erroneously returns an offset suggesting the operation succeeded
671 even though it fails.
673 * install-sh: Double quote as needed, to protect against arguments
674 containing spaces or shell metacharacters. Reported by Bruno Haible.
676 2000-08-23 Jim Meyering <meyering@lucent.com>
678 * tests/dd/not-rewound: New test, for the SEEK_CUR vs. SEEK_SET part
679 of the last change. Based on Paul's example.
680 * tests/dd/Makefile.am (TESTS): Add not-rewound.
682 2000-08-22 Paul Eggert <eggert@twinsun.com>
685 Assume lseek failed if it returned zero, since a zero return is
686 impossible and some buggy drivers return zero.
688 Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the
689 file descriptor is not currently rewound.
691 2000-08-23 Jim Meyering <meyering@lucent.com>
693 * src/dd.c: Back out my last change. Paul's (above) is better.
695 2000-08-22 Jim Meyering <meyering@lucent.com>
697 Don't even try to use lseek on character devices.
698 * src/dd.c (buggy_lseek_support): New function.
700 Reported by Martin Gallant via Michael Stone.
702 2000-08-21 Jim Meyering <meyering@lucent.com>
704 * tests/cp/same-file: Clean up traps. Create files in a subdir.
706 * install-sh (oIFS): Remove unmatched double quote, left over from
707 my 2000-08-12 change. From J. David Anglin.
709 * Makefile.maint (wget-update): Get the latest version of depcomp.
711 * depcomp: Update from automake.
713 2000-08-20 Jim Meyering <meyering@lucent.com>
717 Add support for cp's new POSIX-mandated -H and -L options.
718 * src/copy.h (enum Dereference_symlink): Define.
719 (struct cp_options) [dereference]: Change type to Dereference_symlink.
720 * src/copy.c: Declare lstat.
721 (copy_dir): Set `xstat' member to lstat so that with `-H' we don't
722 follow symlinks found via recursive traversal.
723 Update uses of `dereference' to compare against new enum member names.
724 * src/cp.c (long_opts): Add --dereference, -L.
725 (usage): Describe -L and -H.
726 (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'.
727 (main): Add `H' and `-L' to getopt spec string.
728 [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0.
729 [case 'd']: Likewise.
730 [case 'H']: New case.
731 [case 'L']: New case.
732 [case 'R']: Don't set dereference to `0' here.
733 If it's not yet defined, set x.dereference to DEREF_NEVER
734 if -R was specified, else set it to DEREF_ALWAYS.
735 Set x.xstat accordingly for -H.
736 * doc/fileutils.texi (cp invocation): Describe -H and -L.
737 * src/mv.c (cp_option_init): Initialize to DEREF_NEVER, not `0'.
738 * src/install.c (cp_option_init): Initialize to DEREF_ALWAYS, not `1'.
740 * tests/cp/Makefile.am (TESTS): Add cp-HL.
741 * tests/cp/cp-HL: New test.
743 * src/du.c (print_totals): Rename global from opt_combined_arguments.
745 2000-08-17 Paul Eggert <eggert@twinsun.com>
747 * src/copy.c (DO_CHOWN): Do not make a special case for non-root.
748 POSIX.2 requires that cp -p and mv attempt to set the uid of the
749 destination file, even if you're not root. This affects behavior
750 only on hosts that let you give files away via chmod.
751 * NEWS: Describe the above change.
753 2000-08-15 Jim Meyering <meyering@lucent.com>
755 * src/du.c (count_entry): Remember the current directory also for `.'
756 and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu.
757 * tests/du/two-args: Add tests for this.
759 2000-08-14 Jim Meyering <meyering@lucent.com>
761 * src/copy.c (copy_reg): Move declaration of local, `n_read', into
762 the scope where it's used.
763 (copy_internal): In calling copy_reg, pass not the raw `src_mode',
764 but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
766 2000-08-13 Jim Meyering <meyering@lucent.com>
768 * src/copy.c (get_dest_mode): Rename from new_nondir_mode.
769 Honor the umask for `cp', but not for `mv' or `cp -p'.
770 (copy_reg): New 4th parameter, dst_mode. Pass it as 3rd arg. to open.
771 (copy_internal): Change type of locals `src_mode' and `src_type' from
773 Remove unnecessary local, `fix_mode'.
774 Combine two if-stmts into one.
775 Pass `src_mode' as 4th arg to copy_reg.
776 If we've just created a new regular file, return early, skipping the
777 chmod step. copy_reg now sets permissions of such files upon creation.
778 Use get_dest_mode, so there's just one chmod call here.
780 * tests/cp/Makefile.am (TESTS): Add perm.
781 * tests/cp/perm: New tests, to help ensure the above didn't
784 2000-08-12 Jim Meyering <meyering@lucent.com>
786 * tests/mv/into-self-2: Remove test for the VERSION_CONTROL and/or
787 SIMPLE_BACKUP_SUFFIX envvars. Source ../envvar-check instead.
788 * tests/mv/i-2: Likewise.
789 * tests/mv/to-symlink: Likewise.
790 * tests/cp/slink-2-slink: Likewise.
791 * tests/mv/partition-perm: Likewise.
792 * tests/cp/cp-mv-backup: Likewise.
794 * tests/Makefile.am (EXTRA_DIST): Add envvar-check.
795 * tests/envvar-check: New file.
797 * install-sh: Remove trailing blanks.
798 Output diagnostics to stderr, not stdout.
799 Remove many useless curly braces and double quotes.
801 2000-08-11 J. David Anglin <dave@hiauly1.hia.nrc.ca>
803 * install-sh: Improve error handling.
804 Do the job even when the target file is `busy' on systems
805 that don't allow such files to be unlinked.
807 2000-08-12 Jim Meyering <meyering@lucent.com>
809 * README: Remove note about how installation can fail and the
810 work-around, now that it's all automated.
812 2000-08-07 Paul Eggert <eggert@twinsun.com>
814 * src/cp.c (usage, main): For cp -P messages, mention the new
815 behavior as well as the old.
817 2000-08-07 Paul Eggert <eggert@twinsun.com>
819 Standardize on "memory exhausted" instead of "Memory exhausted"
820 or "virtual memory exhausted".
821 Invoke xalloc_die instead of printing our own message.
822 * src/chmod.c (main): Likewise.
823 * src/copy.c (copy_dir, copy_internal): Likewise.
824 * src/cp.c (do_copy): Likewise.
825 * src/dircolors.c (xstrndup): Likewise.
826 * src/install.c (main): Likewise.
827 * src/ln.c (do_link): Likewise.
828 * src/mkdir.c (main): Likewise.
829 * src/mkfifo.c (main): Likewise.
830 * src/mknod.c (main): Likewise.
831 * src/mv.c (movefile): Likewise.
832 * src/remove.c (remove_cwd_entries, rm): Likewise.
833 * src/shred.c (quotearg_colon, xmalloc):
834 "virtual memory exhausted" -> "memory exhausted"
836 2000-08-07 Jim Meyering <meyering@lucent.com>
838 * src/cp.c (enum) [PARENTS_OPTION]: New member.
839 (long_opts): Update "parents" and deprecated "path" entries to use
840 `PARENTS_OPTION', not `P'.
841 (usage): Update --help output.
842 (main): Warn that the meaning of `-P' will soon change.
844 2000-08-06 Jim Meyering <meyering@lucent.com>
846 * doc/fileutils.texi (cp invocation) [-r]: Remove inaccurate mention of
847 `non-symbolic links'.
849 2000-08-05 Jim Meyering <meyering@lucent.com>
851 * config.guess: Update from master repository.
852 * config.sub: Likewise.
854 * Regenerate build/config framework to use the latest CVS versions
855 of automake and autoconf.
857 2000-07-31 Jim Meyering <meyering@lucent.com>
859 * src/shred.c [!HAVE_CONFIG_H]: Use `virtual memory exhausted', not
862 2000-07-30 Jim Meyering <meyering@lucent.com>
864 * src/sys2.h (ISPRINT): Undef before defining to avoid warning.
866 * src/copy.c (copy_internal): Quote the file names that are displayed
867 with --verbose and --backup.
868 * src/remove.c (remove_file): Quote the file names that are displayed
870 (remove_dir): Likewise.
871 * tests/mv/mv-special-1: Add quote marks to match new behavior.
872 * tests/rm/r-1: Likewise.
873 * tests/rm/r-2: Likewise.
875 * src/df.c: Convert "`%s'" in format strings to "%s", and wrap each
876 corresponding argument in a `quote (...)' call.
877 * src/dircolors.c: Likewise.
878 * src/du.c: Likewise.
879 * src/mkdir.c: Likewise.
880 * src/mkfifo.c: Likewise.
881 * src/mknod.c: Likewise.
882 * src/shred.c: Likewise.
883 * src/rmdir.c: Likewise.
884 * src/cp-hash.c: Likewise.
886 * src/chgrp.c: Convert "`%s'" in format strings to "%s", and wrap each
887 corresponding argument in a `quote (...)' call.
888 Add more precise diagnostics.
889 * src/chmod.c: Likewise.
890 * src/chown.c: Likewise.
892 * src/remove.c (remove_cwd_entries): Quote one more file name.
894 * src/help-version: Remove file. Move it to ...
895 * tests/help-version: ...here
896 * tests/Makefile.am (TESTS): Set to help-version.
897 (TESTS_ENVIRONMENT): Define.
898 (EXTRA_DIST): Add $(TESTS).
899 * src/Makefile.am (EXTRA_DIST): Remove help-version.
900 (TESTS): Remove definition.
901 (TESTS_ENVIRONMENT): Remove definition.
903 2000-07-24 Bruno Haible <haible@clisp.cons.org>
905 * src/ls.c: Include <limits.h>, <stdlib.h>, <wchar.h>, <wctype.h>.
906 (quote_name): Use mbrtowc to step through the filename string while
907 replacing nonprintables with question marks. Return the screen width,
908 not the strlen length. Do no output if the out stream is NULL.
909 (length_of_file_name_and_frills): Use the quote_name return value.
911 2000-07-25 Jim Meyering <meyering@lucent.com>
913 * src/chgrp.c (change_file_group): Save errno from a possibly failed
914 chown, and use that later. Otherwise, errno itself could be clobbered
916 * src/chmod.c (change_file_mode): Likewise.
917 * src/chown.c (change_file_owner): Likewise.
919 * src/mv.c (main): Remove unnecessary "%s" argument.
921 * src/ln.c: Convert "`%s'" in format strings to "%s", and wrap each
922 corresponding argument in a `quote (...)' call.
923 Add more precise diagnostics.
924 * src/mv.c: Likewise.
925 * src/cp.c: Likewise.
926 * src/touch.c: Likewise.
928 2000-07-23 Jim Meyering <meyering@lucent.com>
932 * src/dd.c (main): Give a better diagnostic for e.g.,
933 `dd if=/dev/fd0 seek=100000000000'.
934 Convert "`%s'" in format strings to "%s", and wrap each
935 corresponding argument in a `quote (...)' call.
936 Add many, more precise diagnostics.
938 * src/remove.c (ASSIGN_STRDUPA): Remove macro definition.
939 * src/sys2.h (ASSIGN_STRDUPA): New macro (moved here from remove.c).
941 Fix cp so that `cp -r DIR1/ DIR2' works once again.
942 * src/cp.c (ASSIGN_BASENAME_STRDUPA): New macro.
943 (do_copy): Use it here (so we always strip trailing slashes before
944 calling base_name). Reported by Branden Robinson via Michael Stone.
946 Test for the above fix.
947 * tests/cp/Makefile.am (TESTS): Add dir-slash.
948 * tests/cp/dir-slash: New file.
950 2000-07-17 Jim Meyering <meyering@lucent.com>
952 * Makefile.maint (WGET): Define.
954 (wget-update): New rule, based on the one in autoconf.
956 * src/shred.c (usage): Give a little more info.
957 Remove a FIXME comment.
960 * src/ls.c (struct bin_str): Declare `string' member to be `const'.
961 (put_indicator): Declare local `p' to be `const'.
963 2000-07-15 Jim Meyering <meyering@lucent.com>
965 Begin converting "`%s'" in format strings to "%s", and wrap each
966 corresponding argument in a `quote (...)' call -- if there's only one.
967 If there are two or more, then use `quote_n (0, ...),
968 quote_n (1, ...), ...'.
970 Here's the justification, from Paul Eggert (thanks, Paul):
972 [Consider] the following, taken from fileutils/copy.c:
974 error (0, errno, _("cannot create directory `%s'"), dst_path);
976 Now, suppose dst_path is "/'\nrm: removing all files under `/"
977 (expressed in C string syntax). This will cause the user to see
978 the following delightfully ambiguous display:
980 cp: cannot create directory `/'
981 rm: removing all files under `/'
983 It would be better to rewrite the above line to be something
986 error (0, errno, _("cannot create directory %s"), quote (dst_path));
988 using the definition of "quote" [in lib/quote.c]. That way,
989 the user will see the following unambiguous display instead:
991 cp: cannot create directory `/\'\nrm: removing all files under `/'
993 One might object that any user who asks to copy a file with
994 a weird name like that deserves to get confused. But this
995 is not a good objection, as the source of the string may not
996 be under the user's control, or even visible to the user.
998 * src/copy.c: Adapt format strings and args as above. Include quote.h.
999 I have deliberately not changed the output of --verbose.
1000 FIXME: maybe I should.
1001 * src/cp.c: Likewise.
1002 * src/remove.c: Likewise.
1003 * src/install.c: Likewise. and improve a couple diagnostics.
1005 2000-07-13 Paul Eggert <eggert@twinsun.com>
1007 * NEWS: Describe --quoting-style=clocale.
1009 * doc/fileutils.texi: New clocale quoting style.
1010 Undo the previous change to the locale quoting style.
1012 2000-07-09 Jim Meyering <meyering@lucent.com>
1014 * config.guess: Update from FSF.
1015 * config.sub: Likewise.
1017 2000-07-05 Paul Eggert <eggert@twinsun.com>
1019 * doc/fileutils.texi: Don't use ` and ' for quoting.
1021 2000-07-01 Jim Meyering <meyering@lucent.com>
1025 * tests/touch/dangling-symlink: Warn about the problem rather
1026 than failing, on some very recent (at least 2.3.99) versions of
1027 the Linux kernel. Suggestion from Ulrich Drepper.
1028 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Define host_triplet
1029 for use in the dangling-symlink test.
1031 2000-06-28 Jim Meyering <meyering@lucent.com>
1033 * tests/mv/i-2: Don't copy `out' into /tmp.
1035 2000-06-26 Paul Eggert <eggert@twinsun.com>
1037 Now that savedir.c has been cleaned up...
1038 * src/chgrp.c (change_dir_group): Don't set errno before
1039 invoking savedir, and assume that errno is nonzero if savedir fails.
1040 * src/chmod.c (change_dir_mode): Likewise.
1041 * src/chown.c (change_dir_owner): Likewise.
1042 * src/copy.c (copy_dir): Likewise.
1043 * src/du.c (count_entry): Likewise.
1045 2000-06-26 Paul Eggert <eggert@twinsun.com>
1047 * src/df.c (show_dev): Round disk usage percentage up, not to
1048 nearest value. Use integer arithmetic if it's easy. Fix bug
1049 when converting twos-complement negative values to floating point.
1051 2000-06-25 Jim Meyering <meyering@lucent.com>
1053 * src/copy.c (copy_internal): Don't return immediately after a failed
1054 copy_dir call -- otherwise, the failure to read a single file in a
1055 source directory would cause the containing destination directory
1056 not to have the owner and/or permissions set properly.
1057 Reported by Piotr and Maciej Kwapulinski.
1058 * tests/cp/fail-perm: Test for it.
1059 * tests/cp/Makefile.am (TESTS): Add fail-perm.
1063 2000-06-18 Jim Meyering <meyering@lucent.com>
1065 * README-alpha: Update.
1067 2000-06-17 Jim Meyering <meyering@lucent.com>
1069 * tests/install/basic-1: Don't fail (just exit 77) if strip doesn't
1070 work. Suggestion from Ulrich Drepper.
1071 Add canonical trap/mkdir/cd, plus exit portability cruft.
1073 2000-06-16 Jim Meyering <meyering@lucent.com>
1075 * src/copy.c (copy_reg): Give a slightly better diagnostic upon
1078 2000-06-15 Paul Eggert <eggert@twinsun.com>
1080 * NEWS, doc/fileutils.texi: df, du, and ls now round disk
1081 usage up and disk free space down.
1083 * src/df.c (df_readable): New arg for rounding style.
1084 Round negative numbers correctly.
1085 (show_dev): Round disk usage up and disk free space down.
1087 * src/ls.c: (print_dir, gobble_file, print_long_format,
1088 print_file_name_and_frills): Round disk usage up.
1089 * src/du.c (print_size): Likewise.
1091 2000-06-14 Andreas Schwab <schwab@suse.de>
1093 * tests/rm/r-1 (framework_failure): Initialize this instead of
1096 2000-06-12 Jim Meyering <meyering@lucent.com>
1100 * tests/rm/r-1: Clean up.
1101 Be careful to remove temp directory upon interrupt.
1103 * src/mv.c (main): Give the correct diagnostic when using the
1104 --target-dir=DIR option, but no arguments.
1105 Patch from Michael Stone. Reported by Herbert Xu.
1106 * tests/mv/diag: New test for this.
1107 * tests/mv/Makefile.am (TESTS): Add diag.
1109 2000-06-08 Brian Youmans <3diff@gnu.org>
1111 * doc/perm.texi (Multiple Changes): Fix typo.
1112 * doc/fileutils.texi: A few typos and minor formatting fixes.
1113 * doc/getdate.texi: Likewise.
1115 2000-06-06 Jim Meyering <meyering@lucent.com>
1117 * Makefile.maint (alpha_subdir): Factor out `gnu/fetish'.
1119 2000-06-04 Jim Meyering <meyering@lucent.com>
1123 * src/df.c (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]:
1124 Cast undeclared `realpath' to char* to avoid warning.
1126 2000-06-03 Jim Meyering <meyering@lucent.com>
1128 * src/install.c (usage): Document that -v is a synonym for --verbose.
1129 * src/mkdir.c: Allow -v as synonym for --verbose, to be consistent
1130 with other fileutils.
1131 * src/rmdir.c: Likewise.
1132 Suggestion from François Pinard.
1134 2000-06-02 Jim Meyering <meyering@lucent.com>
1136 * configure.in (ALL_LINGUAS): Add Danish (da).
1138 2000-05-29 Jim Meyering <meyering@lucent.com>
1140 Allow `cp -d -u' to copy one symlink onto another that's identical.
1141 * src/copy.c (copy_internal): Change the || to ^ in the big sameness
1142 test, so copying one symlink onto another, identical one doesn't fail
1144 If the symlink call fails, don't report the failure if the destination
1145 already exists and is a symlink pointing to the proper name.
1146 Reported by Andrew Burgess.
1147 * tests/cp/slink-2-slink: New test.
1148 * tests/cp/Makefile.am (TESTS): Add slink-2-slink.
1149 * tests/cp/same-file: Adapt to fit new semantics of `cp -d'.
1151 2000-05-25 Jim Meyering <meyering@lucent.com>
1153 * src/dd.c (close_stdout_wrapper): Don't dereference NULL pointer.
1156 2000-05-23 Jim Meyering <meyering@lucent.com>
1158 * tests/shred/remove: Add traps to clean up.
1159 Correct broken running-as-root test.
1161 * tests/mv/i-2: Exit 77 when run as root. Reported by Andreas Schwab.
1163 2000-05-20 Jim Meyering <meyering@lucent.com>
1167 * tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change.
1169 * tests/rm/r-2: Clean up.
1170 * tests/ls/time-1 (LC_ALL): Set it unconditionally.
1172 2000-05-19 Jim Meyering <meyering@lucent.com>
1174 Save device number as well as inode number for each directory,
1175 and use both in comparisons. This makes the directory cycle
1176 test more robust, and closes the small remaining hole whereby
1177 an attacker could subvert a running `rm -r' command.
1179 * src/remove.c (struct active_dir_ent) [st_dev]: New member.
1180 [st_ino]: Rename from `inum'.
1181 (make_active_dir_ent) [device]: New parameter.
1182 (hash_compare_active_dir_ents): Compare using SAME_INODE macro.
1183 (fspec_init_common): New function, factored out.
1184 (fspec_init_file): Initialize have_device member.
1185 (fspec_get_full_mode): Remove parameter. Update caller.
1186 Set have_device and st_dev members.
1187 * src/remove.h (struct File_spec) [have_device, st_dev]: New members
1189 2000-05-18 Jim Meyering <meyering@lucent.com>
1191 * src/remove.c (rm): Combine adjacent fputc and fprintf.
1193 * tests/rm/Makefile.am (TESTS): Add hash.
1194 * tests/rm/hash: New test for the fix in lib/hash.c.
1196 2000-05-17 Jim Meyering <meyering@lucent.com>
1198 * src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert
1199 a running `rm -r'. Reported by Morten Welinder.
1201 2000-05-15 Jim Meyering <meyering@lucent.com>
1203 * src/ln.c (do_link): Use complete strings in diagnostics so they
1204 are easier to translate. Reported by Michel Robitaille.
1205 (main): Drop support for the case in which S_ISLNK wasn't defined.
1206 It was broken in any case.
1208 * tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the
1209 current locale is not C (POSIX). From Matthew Clarke.
1211 2000-05-13 Jim Meyering <meyering@lucent.com>
1213 * src/help-version: New test.
1214 * src/Makefile.am (TESTS): Define.
1215 (TESTS_ENVIRONMENT): Likewise.
1216 (EXTRA_DIST): Add help-version.
1218 * src/chgrp.c: Arrange to call close_stdout only upon exit.
1219 * src/chmod.c: Likewise.
1220 * src/chown.c: Likewise.
1221 * src/cp.c: Likewise.
1222 * src/df.c: Likewise.
1223 * src/dircolors.c: Likewise.
1224 * src/du.c: Likewise.
1225 * src/install.c: Likewise.
1226 * src/ln.c: Likewise.
1227 * src/ls.c: Likewise.
1228 * src/mkdir.c: Likewise.
1229 * src/mkfifo.c: Likewise.
1230 * src/mknod.c: Likewise.
1231 * src/mv.c: Likewise.
1232 * src/rm.c: Likewise.
1233 * src/rmdir.c: Likewise.
1234 * src/shred.c: Likewise.
1235 * src/sync.c: Likewise.
1236 * src/touch.c: Likewise.
1238 * src/dd.c: Include closeout.h.
1239 (usage): Don't call close_stdout here.
1240 (close_stdout_wrapper): New, kludgey, function and file-scoped global.
1241 (main): Register it with atexit.
1243 2000-05-12 Jim Meyering <meyering@lucent.com>
1245 Unlike for mv, -i doesn't cancel the effect of -f
1246 and -f doesn't cancel the effect of -i.
1247 * src/cp.c (main) ['f']: Don't reset `x.interactive'.
1248 ['i']: Don't reset `x.force'.
1249 * src/copy.c (copy_internal): Fix force and interactive tests.
1250 Patch from Michael Stone, reported by Jeff Sheinberg.
1252 2000-05-09 Jim Meyering <meyering@lucent.com>
1254 * src/shred.c: Include sys/types.h in shred.c before including
1255 sys/stat.h or system.h. From John David Anglin.
1257 2000-05-08 Jim Meyering <meyering@lucent.com>
1259 * tests/shred/remove: Don't use touch in root test. Instead, append to
1260 the test file, since now touch operates even on files which deny owner
1263 2000-05-06 Jim Meyering <meyering@lucent.com>
1265 * src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@.
1267 * src/rmdir.c (EEXIST): Remove now-unused definition.
1268 (ENOTEMPTY): Likewise.
1269 (errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
1270 which is determined by the autoconf test in m4/rmdir-errno.m4.
1272 2000-05-03 Bruno Haible <haible@clisp.cons.org>
1274 Don't fail when running `make check' with non-`C' locale.
1275 * tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext)
1276 and LC_ALL (for systems which look at LC_MESSAGES).
1277 * tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has
1278 LC_CTYPE or LC_ALL set. Define it and LANGUAGE before the first use
1281 2000-05-03 Jim Meyering <meyering@lucent.com>
1283 With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro.
1284 * src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup.
1285 * src/dircolors.c: Remove declaration of strndup.
1286 Reported by Bruno Haible.
1288 2000-05-02 Jim Meyering <meyering@lucent.com>
1290 * src/rm.c (usage): Add the answer to `How do I remove a file named -f?'
1292 2000-05-01 Jim Meyering <meyering@lucent.com>
1294 * src/install.c (change_attributes): Don't even attempt the chmod
1295 if the chown fails. Before, when a non-root user ran `install -m 4755
1296 -o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to
1297 the ID of the installing user. Reported by Marc Olzheim.
1299 2000-04-30 Jim Meyering <meyering@lucent.com>
1301 * src/touch.c (O_NOCTTY): Define if not defined already.
1302 (touch): Add O_NOCTTY to the flags passed to open.
1304 2000-04-29 Jim Meyering <meyering@lucent.com>
1308 * src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat.
1310 2000-04-27 Jim Meyering <meyering@lucent.com>
1313 * tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR.
1314 * tests/mkdir/p-1: Use mkdir, not $MKDIR.
1315 * tests/mkdir/p-2: Likewise.
1317 * configure.in (AC_OUTPUT): Add tests/du/Makefile.
1318 * tests/Makefile.am (SUBDIRS): Add du.
1319 * tests/du: New directory.
1320 * tests/du/two-args: New test.
1322 * tests/mkdir/special-1: New test.
1323 * tests/mkdir/Makefile.am (TESTS): Add special-1.
1325 2000-04-25 Paul Eggert <eggert@twinsun.com>
1327 * src/du.c (pop_dir): Remove through_symlink arg; use null cwd
1328 for that purpose instead.
1329 (count_entry): Also save the directory if we're saving more
1331 Fix file descriptor and memory leak when chdir fails.
1333 2000-04-26 Jim Meyering <meyering@lucent.com>
1335 * src/mkdir.c: Rename global: s/path_mode/create_parents/.
1336 (main): No longer perform explicit chmod when creating
1337 parent directories, since make_path now does the chmod.
1339 2000-04-17 Jim Meyering <meyering@lucent.com>
1341 * src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP.
1342 (enum) [FROM_OPTION]: New member.
1343 (long_options): New getopt spec.
1344 (change_file_owner): Add old_user, old_group parameters. Use them.
1345 (change_dir_owner): Likewise.
1348 From Andries Brouwer.
1349 * doc/fileutils.texi (invoking chown): Document it.
1351 2000-04-16 Jim Meyering <meyering@lucent.com>
1353 * src/cp.c: New option: --strip-trailing-slashes.
1354 (enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
1355 (remove_trailing_slashes): New global.
1356 (long_opts): New getopt spec.
1358 (do_copy): Strip trailing slashes on SOURCE names only if the new
1359 option has been specified.
1362 * tests/cp/symlink-slash: New test for the change in behavior.
1363 * tests/cp/Makefile.am (TESTS): Add symlink-slash.
1365 * doc/fileutils.texi (Trailing slashes): Factor out discussion on
1366 trailing slashes into its own node.
1367 Cross reference from cp and mv.
1369 2000-04-14 Jim Meyering <meyering@lucent.com>
1371 * src/touch.c (touch): Add O_NOCTTY to the list of open-time flags.
1373 2000-04-13 Jim Meyering <meyering@lucent.com>
1375 Move some code into m4/.
1376 * configure.in (_GNU_SOURCE): Don't define here.
1377 (AC_SYS_LARGEFILE): Don't use here.
1378 (AM_C_PROTOTYPES): Don't use here.
1379 * acconfig.h: Remove now-unused file.
1381 2000-04-08 Jim Meyering <meyering@lucent.com>
1383 * doc/fileutils.texi (cp invocation): Mention that there is an
1384 application for cp's --sparse=never option. From Martin Hippe.
1385 (cp invocation): Describe how --backup and --force
1386 can be useful together.
1388 2000-03-10 Alan Iwi <iwi@atm.ox.ac.uk>
1390 * src/ls.c: Add support for "ln=target" in the LS_COLORS variable,
1391 to colorize links as for the file/directory pointed to.
1392 * src/dircolors.hin: Add a few words of documentation of the above.
1394 2000-04-08 Jim Meyering <meyering@lucent.com>
1396 * src/cp.c (usage): Document that while the --backup option takes an
1397 optional argument, the -b option accepts none.
1398 (main): Use `backup type' in call to xget_version, not the
1399 now-deprecated `--version-control'.
1400 * src/install.c: Likewise.
1401 * src/ln.c: Likewise.
1402 * src/mv.c: Likewise.
1404 2000-03-12 Jim Meyering <meyering@lucent.com>
1406 Merge from textutils.
1407 * src/system.h: (O_BINARY, O_TEXT): Define if necessary.
1408 (SET_BINARY, SET_BINARY2): Define.
1409 (DEV_BSIZE): Define to BBSIZE if appropriate.
1411 2000-03-10 Jim Meyering <meyering@lucent.com>
1413 * tests/mv/mv-special-1: Make the message more like that in the
1414 similar touch and shred tests.
1415 * tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
1416 bug and `exit 77' if the fifo cannot be created.
1417 Report and suggestion from Volker Borchert.
1419 2000-03-03 Jim Meyering <meyering@lucent.com>
1421 * po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a
1422 space optimization anyway) to populate $(distdir). Otherwise, the dist
1423 rules that change permissions would end up affecting the master sources.
1425 2000-03-01 Paul Eggert <eggert@twinsun.com>
1427 * src/df.c (show_point): Ignore shortcuts based on path
1428 prefixes that are loop file system mount points, since they
1429 yield undesirable output.
1431 2000-02-29 Jim Meyering <meyering@lucent.com>
1433 * src/ls.c (decode_switches): Remove `e' from getopt_long's list of
1434 option characters. Reported by John Summerfield.
1436 2000-02-28 Jim Meyering <meyering@lucent.com>
1438 * tests/install/basic-1: Use ginstall, not install.
1440 2000-02-27 Jim Meyering <meyering@lucent.com>
1444 * src/sys2.h: Guard declaration of strtoull also with
1445 `&& HAVE_UNSIGNED_LONG_LONG'.
1447 * src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...'
1448 now that autoconf always defines the HAVE_DECL_ symbols.
1450 * src/install.c (install_file_to_path): Always use install_file_in_file.
1451 Based on a patch from Adam Klein via Michael Stone.
1453 * tests/install/Makefile.am (TESTS): Add create-leading.
1454 * tests/install/create-leading: New file.
1456 * tests/install/basic-1: Clean up.
1457 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft.
1459 2000-02-26 Jim Meyering <meyering@lucent.com>
1461 Tranform the generated src/Makefile.in file so it falls back on
1462 using /bin/rm when necessary. The old rule didn't always work.
1463 This is necessary only on certain losing systems, and because this
1464 package builds an `rm' executable and some people put `.' too
1465 early in their PATH.
1466 * Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment.
1467 (EXTRA_DIST): Add .kludge-stamp.
1468 (.kludge-stamp): New rule.
1469 * src/Makefile.am (AUTOMAKE): Remove definition.
1470 (Makefile.in): Remove dependency on automake-wrap script.
1471 (EXTRA_DIST): Remove automake-wrap.
1472 * src/automake-wrap: Remove file.
1474 * tests/rm/r-2: Don't make the success of the test depend on the
1475 order in which directory entries are processed.
1476 Reported by Andreas Schwab.
1478 2000-02-12 Jim Meyering <meyering@lucent.com>
1480 * po/POTFILES.in: Add lib/userspec.c.
1482 * doc/fileutils.texi (chown invocation): Deprecate use of `.'.
1484 * src/chown.c (usage): Mention only `:', and not `.' as the separator,
1485 since POSIX allows only the former.
1486 Prompted by a report from Manas Garg.
1488 2000-02-11 Jim Meyering <meyering@lucent.com>
1490 * src/df.c (main): Count the stat'able arguments.
1491 Print the header line only if there is at least one valid argument.
1492 Reported by Andy Longton <alongton@metamark.com>
1494 2000-02-10 Jim Meyering <meyering@lucent.com>
1496 Make du work when invoked from an unreadable directory.
1498 * src/du.c (pop_dir): New function.
1499 (count_entry): Factor out common code (pop_dir), and call the new
1501 Move declaration of global, `stat_buf' into this function.
1502 (du_files): Don't stat `.' or call save_cwd, since count_entry
1503 never returns with a changed working directory.
1505 2000-02-09 Jim Meyering <meyering@lucent.com>
1507 * tests/mv/mv-special-1: Use $null and $dir in place of literals
1509 Exit 77 if we can't set up the framework (Volker Borchert reported
1510 that this test would fail because mknod failed when run on SunOS4.1.4
1511 using NFS-mounted disk from an OpenBSD system).
1513 2000-02-05 Jim Meyering <meyering@lucent.com>
1515 * src/copy.c (copy_internal): Don't allow mv to move a directory onto
1516 a non-directory. Reported by Brian Kimball via Michael Stone.
1518 2000-02-03 Jim Meyering <meyering@lucent.com>
1520 * tests/mv/Makefile.am (TESTS): Add dir-file.
1521 (TESTS_ENVIRONMENT): Remove vestiges of old tests.
1522 * tests/mv/dir-file: New file.
1524 2000-02-02 Jim Meyering <meyering@lucent.com>
1526 * tests/touch/Makefile.am (TESTS): Add fifo.
1527 * tests/touch/fifo: New file.
1529 2000-02-01 Jim Meyering <meyering@lucent.com>
1531 * src/touch.c (O_NDELAY): Define to 0 if not defined.
1532 (O_NONBLOCK): Define to O_NDELAY if not defined.
1533 (touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
1534 Reported by Eric G. Miller via Michael Stone.
1536 * man/*.x: Change ." to .\".
1537 Reported by Andreas Schwab and Brendan O'Dea.
1539 2000-01-31 Jim Meyering <meyering@lucent.com>
1541 * man/Makefile.maint (ginstall_filter): Define.
1542 ($(man_MANS)): Use it here so that the install.1 man page refers
1543 to `install', not `ginstall'. Reported by Andreas Schwab.
1545 2000-01-30 Jim Meyering <meyering@lucent.com>
1549 * configure.in: Move library-related tests into m4/lib-check.m4.
1551 * src/system.h (ST_NBLOCKS): Use st_size only for regular files and
1552 for directories. From H. J. Lu.
1554 * src/dd.c (main): Exit with nonzero status if ftruncate fails.
1556 2000-01-24 Jim Meyering <meyering@lucent.com>
1558 * src/ln.c (usage): Describe behavior when LINK_NAME is omitted.
1561 * src/mv.c (main): Don't expect array index `n_files - 1' to evaluate
1562 to `-1' for unsigned int n_files == 0. Doing so lead to a segfault on
1563 alpha. From Michael Stone.
1565 2000-01-23 Jim Meyering <meyering@lucent.com>
1567 * configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.)
1568 Remove nearly all function checks (moved to m4/.)
1569 (AC_SUBST(DF_PROG)): Move this to m4/.
1570 (ftruncate test): Move into new file: m4/ftruncate.m4.
1571 (AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/.
1572 Remove df-related tests. i.e., move jm_LIST_MOUNTED_FILESYSTEMS,
1573 jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/.
1575 2000-01-22 Jim Meyering <meyering@lucent.com>
1577 * configure.in: Move addext.c prerequisites from this file into m4/.
1578 (AC_CHECK_HEADERS): Move these checks into m4/.
1580 2000-01-17 Paul Eggert <eggert@twinsun.com>
1582 * src/dd.c (interrupt_handler): Likewise.
1583 (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
1584 to decide whether to call sigaction; this fixes an old typo.
1586 2000-01-16 Jim Meyering <meyering@lucent.com>
1588 * lib/Makefile.am: Sync with sh-utils/lib/Makefile.am.
1590 * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME,
1591 jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and
1592 AC_FUNC_ALLOCA. They're now in m4/.
1594 Sync with the version from emacs-20.5.
1596 (<string.h>): Include if HAVE_STRING_H.
1597 (<stdlib.h>): Include if HAVE_STDLIB_H.
1598 (alloca): Abort if malloc fails.
1599 Reported by Paul Eggert.
1601 2000-01-15 Jim Meyering <meyering@lucent.com>
1603 * configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy
1604 memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol
1605 strtoul strverscmp. Now they're in m4/.
1607 2000-01-12 Jim Meyering <meyering@lucent.com>
1609 * tests/shred/remove: Make the warning that this shred test may not
1610 be run as root more prominent. Suggestion from Volker Borchert.
1612 2000-01-11 Paul Eggert <eggert@twinsun.com>
1614 Quote multibyte characters correctly.
1616 * lib/quotearg.c (ISGRAPH): Remove.
1617 (ISPRINT): New macro.
1618 (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
1619 (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
1620 defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1621 (quotearg_buffer_restyled): New function, with most of the old
1622 quotearg_buffer's contents.
1623 Major rewrite to support multibyte characters.
1624 (quotearg_buffer): Now just calls quotearg_buffer_restyled.
1626 * m4/c-bs-a.m4: New file.
1627 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
1628 (jm_PREREQ): Use it.
1630 2000-01-11 Paul Eggert <eggert@twinsun.com>
1632 * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned
1633 long, to parse numeric modes. Check for any unknown bits, not
1634 just unknown bits left of the leftmost known bit.
1636 2000-01-11 Paul Eggert <eggert@twinsun.com>
1638 * lib/getdate.y: Update copyright notice.
1640 2000-01-11 Paul Eggert <eggert@twinsun.com>
1642 * COPYING: Sync with latest FSF version (fixing a minor Y2k problem).
1644 2000-01-11 Paul Eggert <eggert@twinsun.com>
1646 * lib/exclude.c, lib/exclude.h: Sync to the slightly more
1647 general version of GNU tar.
1649 * src/du.c (count_entry):
1650 Adjust to new calling convention for excluded_filename.
1651 (main): Likewise, for add_exclude_file.
1653 2000-01-11 Jim Meyering <meyering@lucent.com>
1655 * lib/memcpy.c (memcpy): Protoize.
1657 Prepare to sync lib/ directories of fileutils, sh-utils, and textutils.
1658 * lib/Makefile.am: s/fu/fetish/
1659 * src/Makefile.am: s/libfu/libfetish/
1661 * lib/hash.c (hash_initialize): Fix typo in comment.
1662 From François Pinard.
1664 2000-01-10 Jim Meyering <meyering@lucent.com>
1668 * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
1670 2000-01-09 Jim Meyering <meyering@lucent.com>
1674 * src/ln.c (do_link): Produce the same sort of one-line output for
1675 `--backup --verbose' as cp, mv, install. Before this, the backup
1676 file name wasn't printed at all.
1678 This affects cp, install, and mv.
1679 * src/copy.c (copy_internal): When making backup files in verbose
1680 mode, print the backup file name on the same line as the rest of the
1681 information, e.g., `a -> b (backup: b.~13~)' rather than on a separate
1682 line by itself. Suggestion from Karl Berry.
1684 2000-01-08 Jim Meyering <meyering@ascend.com>
1686 * lib/error.c (error): Use __strerror_r's return value only if
1687 HAVE_WORKING_STRERROR_R.
1688 (error_at_line): Likewise.
1690 * Makefile.maint (null_AM_MAKEFLAGS): Define.
1691 (my-distcheck): Use it to avoid distributing out of date files
1692 whose derivation would require a maintainer tool.
1694 2000-01-07 Jim Meyering <meyering@ascend.com>
1696 * lib/euidaccess.c: Sync with the GNU C library.
1698 * tests/dir/Makefile.am: (TESTS_ENVIRONMENT): Add `pwd`/ prefix
1699 to exported PATH value (though not strictly necessary, here).
1700 * tests/dd/Makefile.am: Likewise.
1701 * tests/dircolors/Makefile.am: Likewise.
1702 * tests/rm/Makefile.am: Likewise.
1703 * tests/rmdir/Makefile.am: Likewise.
1704 * tests/shred/Makefile.am: Likewise.
1705 * tests/touch/Makefile.am: Likewise.
1706 * tests/shred/Makefile.am: Likewise.
1708 2000-01-06 Jim Meyering <meyering@ascend.com>
1710 * man/help2man: Import version 1.020.
1712 * lib/strftime.c: Sync with the GNU C Library.
1714 2000-01-06 Paul Eggert <eggert@set.twinsun.com>
1716 * tar/lib/getdate.y: Sync tm_diff with the GNU C Library.
1717 (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed.
1718 (tm_diff): Renamed from difftm. All uses changed.
1719 Replace body with that taken from GNU C Library 2.1.3pre1.
1720 (get_date): Prefer tm_gmtoff to tm_diff if available.
1722 2000-01-04 Paul Eggert <eggert@twinsun.com>
1724 * savedir.c (savedir): Don't store past the end of an array if
1725 name_size is zero and the directory is empty.
1727 * Makefile.maint (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0.
1728 (alpha): Create xdelta diffs.
1730 2000-01-02 Jim Meyering <meyering@ascend.com>
1734 * src/mv.c: New option: --strip-trailing-slashes.
1736 1999-11-18 Paul Eggert <eggert@twinsun.com>
1738 * lib/strftime.c (my_strftime): Some old compilers object to
1739 '\a', so don't bother optimizing for it.
1741 2000-01-01 Paul Eggert <eggert@twinsun.com>
1743 Fix bug: `df PATH' sometimes misbehaves when there is an
1744 inaccessible mount point unrelated to PATH.
1745 * configure.in (AC_CHECK_FUNCS): Add realpath, resolvepath.
1746 * src/df.c (#pragma alloca): Add if _AIX is defined.
1747 (path-concat.h): Include.
1748 (show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined,
1749 find the real absolute path for PATH, and use that to find the
1752 (show_point): Prefer non-dummy entries in shortcuts, too.
1753 Disable bogus mount dirs instead of restatting them each time.
1755 1999-12-30 Jim Meyering <meyering@ascend.com>
1756 1999-12-17 Kalle Olavi Niemitalo <tosi@stekt.oulu.fi>
1758 * src/rmdir.c (remove_parents, main): Don't pass errno to error
1759 when printing "removing directory" message. Failure of rmdir is
1762 1999-12-23 Jim Meyering <meyering@ascend.com>
1764 * configure.in: Remove clock_gettime tests.
1765 Now they're in m4/jm-macros.m4.
1767 * src/ln.c (usage): Correct typos.
1768 List new --target-directory=... usage.
1769 Reported by Göran Uddeborg
1771 * src/mv.c (usage): List new --target-directory=... usage.
1773 1999-12-22 Jim Meyering <meyering@ascend.com>
1775 * lib/getdate.y (get_date): Fix typo in time_t overflow test.
1778 1999-12-21 Andreas Schwab <schwab@suse.de>
1780 * tests/shred/remove: Use $file, not $tmp/file. Exit 77 if run as
1783 1999-12-20 Paul Eggert <eggert@twinsun.com>
1785 * src/df.c (ceil_percent): Remove.
1786 (show_dev): Avoid overflow problems when calculating percent.
1787 Do not display negative percents.
1789 1999-12-19 Jim Meyering <meyering@ascend.com>
1793 * doc/fileutils.texi: Clarify and combine descriptions of -c and of
1795 Likewise for -u/--time=atime.
1797 * src/ls.c [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper.
1798 [Notice the new configure-time test in m4/lstat-slash.m4. ]
1799 (main): Back out change from 1999-02-19 that made ls remove
1800 trailing slashes from command line arguments to accommodate early
1801 versions of Linux. Now, `ls symlink-to-dir/' acts like
1802 `ls symlink-to-dir/.' thus following the symbolic link, as POSIX says
1803 it should. Suggestion from Bruno Haible and Andreas Schwab.
1805 * lib/xstat.in (slash_aware_lstat): New function.
1806 (rpl_@xstat@): Use it.
1807 * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
1808 (lstat.c): Likewise.
1810 Make sure ls does the right thing with symlinks and trailing slashes.
1811 * tests/ls/Makefile.am (TESTS): Add symlink-slash.
1812 * tests/ls/symlink-slash: New test, for above-fixed bug.
1814 1999-12-18 Jim Meyering <meyering@ascend.com>
1816 * src/shred.c (wipename): When repeatedly renaming a file, making the
1817 name shorter and shorter, skip to the next shorter length length if a
1818 rename fails (e.g. due to permission denied). Otherwise, this loop
1819 would iterate for so long that shred would appear to be stuck in an
1820 infinite loop for any but the shortest file names.
1821 Reported by Joe Orton.
1823 * configure.in (AC_OUTPUT): Add tests/shred/Makefile.
1824 * tests/Makefile.am (SUBDIRS): Add shred.
1825 * tests/shred: New directory
1826 * tests/shred/remove: New file. Tests for the above-fixed bug.
1828 1999-12-13 Jim Meyering <meyering@ascend.com>
1830 * lib/makepath.c (make_path): Consistently use `error' to output
1831 the verbose, `created directory ...' messages.
1832 Reported by Bernhard Rosenkraenzer.
1834 1999-12-12 Jim Meyering <meyering@ascend.com>
1836 Move 120+ lines of stat.h-related macros from system.h (not shared)
1837 to sys2.h, which is shared between fileutils, sh-utils, textutils.
1838 * src/system.h: Move them from here...
1839 * src/sys2.h: ... to here.
1841 * src/system.h (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define
1842 if not defined. This was necessary on a NeXT Turbostation running
1843 Mach 3.3. Reported by Nelson H. F. Beebe.
1845 * src/ls.c (decode_switches): If -c or -u is specified and not -l
1846 (or any other option that implies -l), and no sort-type was specified,
1847 then sort by the ctime (-c) or atime (-u). Part of this change reverts
1848 the 1998-01-10 delta.
1849 (usage): Update to reflect this change.
1850 Reported by Paul Slootman via Michael Stone.
1852 1999-12-09 Jim Meyering <meyering@ascend.com>
1854 * src/df.c (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define
1855 these and use them instead of `CHAR_MAX + n'.
1856 * src/du.c (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION):
1858 * src/touch.c (TIME_OPTION): Likewise.
1859 * src/rmdir.c (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise.
1861 * tests/ls/time-1: Test more of the framework (touch's -a and -m
1862 options) before running the actual ls test.
1864 1999-12-07 Jim Meyering <meyering@ascend.com>
1866 * tests/cp/cp-mv-backup: Use 1>&2 rather than `1<&-'.
1867 Suggestion from Volker Borchert.
1869 1999-12-05 Jim Meyering <meyering@ascend.com>
1871 * Makefile.maint: Remove ftp.enst.fr.
1873 1999-12-04 Jim Meyering <meyering@ascend.com>
1877 * tests/mv/into-self-2: Adapt to reflect this change in behavior.
1878 Make sure the VERSION_CONTROL envvar is not set.
1879 Run diff if comparison fails.
1881 * src/copy.c (copy_internal): In move mode, if the rename attempt
1882 fails, then unlink any existing destination file. This makes a
1883 cross-device `mv' more consistent with the intra-device behavior.
1884 This change is required by POSIX to make a cross-device move act with
1885 semantics similar to those of the rename syscall. For example now
1886 `mv' can move a file onto a symlink to itself when that symlink
1887 is on a separate partition. With fileutils-4.0j, it would fail with
1888 a diagnostic saying they were the same file.
1889 Reported by Bruno Haible.
1891 * tests/mv/to-symlink: New file. Adds test for the above.
1892 * tests/mv/Makefile.am (TESTS): Add to-symlink.
1894 * tests/cp/cp-mv-backup (trap): Be careful to close $actual before
1895 removing the containing directory. Otherwise, on some systems rmdir
1896 fails to remove the containing directory.
1898 * tests/ls/time-1: List --full-time dates upon failure.
1900 1999-12-02 Andreas Schwab <schwab@suse.de>
1902 * src/ls.c (check_symlink_color): New variable.
1903 (main): Set it if we need to check for dangling symlinks when
1905 (gobble_file): Check check_symlink_color instead of print_with_color.
1907 1999-11-30 Paul Eggert <eggert@twinsun.com>
1909 * src/ls.c (usage): Shorten help for --show-control-chars.
1911 1999-11-30 Jim Meyering <meyering@ascend.com>
1913 Give the right diagnostic when failing to create a file in an
1914 unwritable directory.
1915 * src/touch.c (touch): Record errno upon failed errno and use that
1916 saved value if a subsequent fstat, stat or utime call fails.
1917 Reported by Wichert Akkerman via Michael Stone.
1919 1999-11-27 Jim Meyering <meyering@ascend.com>
1921 Clean up test scripts.
1922 * tests/mv/setup: Don't set/use DF or MKDIR. Use df and mkdir instead.
1923 * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH
1924 * tests/mv/backup-is-src: Likewise for RM and MV.
1925 * tests/mv/hard-link-1: Likewise.
1926 * tests/mv/into-self: Likewise.
1927 * tests/mv/into-self-3: Likewise.
1929 Add test for 1999-05-23 change to src/copy.c (copy_internal).
1930 * tests/mv/partition-perm: New file.
1931 * tests/mv/Makefile.am (TESTS): Add partition-perm.
1935 1999-11-22 Paul Eggert <eggert@twinsun.com>
1937 * src/df.c (df_readable): Now returns char const *, not char *.
1939 (ceil_percent): Now returns double, not int.
1940 Be more careful about adding 1 to a wild value.
1941 (show_dev): Don't filter out wild sizes from the underlying operating
1942 system; instead, show them to the user as faithfully as possible.
1944 1999-11-23 Jim Meyering <meyering@ascend.com>
1946 * doc/getdate.texi (Calendar date item): Correction regarding 0..68/
1947 69-99 split for 1900 vs 2000. From Peter Moulder.
1949 1999-11-22 Jim Meyering <meyering@ascend.com>
1951 * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c.
1953 1999-11-20 Jim Meyering <meyering@ascend.com>
1955 * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate
1957 (remove_parents): Use it.
1960 * tests/cp/cp-mv-backup: Run `diff -c' if the test fails.
1962 * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH.
1963 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc.
1965 * src/chgrp.c: Declare lstat; needed on e.g. SunOS4.
1966 Reported by Tom Tromey.
1968 1999-11-19 Jim Meyering <meyering@ascend.com>
1970 * lib/strstr.c (strstr): Include config.h.
1971 Add a `;' between shloop label and `}'.
1974 1999-11-17 Jim Meyering <meyering@ascend.com>
1976 * src/mkdir.c (S_IRWXUGO): Define if necessary.
1977 (main): Use chmod to set the permissions if bits other than those
1978 of S_IRWXUGO were requested. Reported by Sami Farin.
1980 1999-11-14 Paul Eggert <eggert@twinsun.com>
1982 * touch.c (touch): Simplify code a tad, using fd == -1 instead
1983 of separate valid_fd variable.
1985 1999-11-13 Jim Meyering <meyering@ascend.com>
1987 * src/touch.c (touch): Don't fail just because we couldn't open
1988 an existing file. This makes it so that touching a read-only
1989 file now works. Also clean up and simplify.
1990 Based on a patch from Chip Salzenberg.
1991 * tests/touch/no-rights: New test for this.
1992 * tests/touch/Makefile.am (TESTS): Add no-rights.
1994 1999-11-12 Jim Meyering <meyering@ascend.com>
1996 * src/remove.c (print_nth_dir): Write one fewer byte so we don't print
1998 (rm): Fix bugs in (and test, this time) the very rarely used code
1999 to warn about directory cycles.
2000 Reported by michael@roka.net.
2002 1999-11-11 Jim Meyering <meyering@ascend.com>
2004 * src/copy.c (copy_internal): Treat src and dest as the `same' in
2005 `mv src symlink-to-src' when src and dest are on different partitions.
2006 Otherwise, that `mv' command would silently remove `src'.
2007 Reported by Michael Stone.
2008 * tests/mv/into-self-2: Add a test for this fix.
2010 * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others
2011 just like that also dated back to 1992 were fixed in 1998-01-02).
2012 Richard Braakman reported that using `install -d -g foo 1/2`
2013 only sets the group on the intermediate directory, not the final
2014 component. From Michael Stone.
2016 1999-11-07 Paul Eggert <eggert@set.twinsun.com>
2018 * human.c (default_block_size): New function.
2019 (humblock): Use it if no block size is specified.
2020 (human_block_size): If the specified block size is zero, report an
2021 error if report_errors is nonzero; otherwise use the default.
2023 1999-11-07 Jim Meyering <meyering@ascend.com>
2025 * src/dircolors.hin: Add several more TERM types.
2027 Add .png for real this time.
2028 Change the image types colors to be visible in a black-on-white xterm.
2031 * src/chgrp.c (xstat): New global.
2033 (change_file_group): Use it. Before this change, when running chgrp
2034 on a symlink without --dereference (-h) and when the requested group
2035 is the same as the group for the *symlink*, chgrp would do nothing.
2036 Now it changes the group of the file referenced through the symlink.
2037 Reported by Martin Mitchell.
2039 * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
2040 * src/chown.c: Define and use REFERENCE_FILE_OPTION and
2041 DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
2042 * src/chgrp.c: Likewise.
2044 * tests/ln/misc: Add hard-link-to-symlink test.
2045 Move framework_failure test to the end.
2046 Fix a typo: s/||/&&/.
2048 * src/ln.c (do_link): Warn that making a hard link to a symbolic link
2051 * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'.
2052 * tests/ln/backup-1: Likewise.
2054 * configure.in (AC_OUTPUT): Add tests/rmdir/Makefile.
2055 * tests/Makefile.am (SUBDIRS): Add rmdir.
2056 * tests/rmdir: New directory
2057 * tests/rmdir/ignore: New file.
2059 * src/rmdir.c (remove_parents): Use the correct test (just as in
2060 main) in handling --ignore-fail-on-non-empty. From Michael Stone.
2061 (usage): Improve description of --parents. Based on suggestion from
2064 1999-11-06 Jim Meyering <meyering@ascend.com>
2066 Allow hard links to symlinks on systems that support it.
2067 * src/ln.c (STAT_LIKE_LINK): Define.
2068 (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
2069 the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
2071 * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is
2072 accepted as the short form of --file-type, per the documentation.
2073 From James Sneeringer.
2075 * src/ln.c (do_link): Fix typo (in which the function name `symlink'
2076 was tested instead of the variable `symbolic_link') that could make
2077 ln perform an unneeded `stat' call.
2079 1999-11-05 Jim Meyering <meyering@ascend.com>
2081 * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated
2083 * src/copy.c: Likewise.
2084 * lib/fileblocks.c: Likewise.
2086 * configure.in: Move some type/header/member tests into
2087 m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
2088 fileutils, textutils, and sh-utils.
2090 1999-11-02 Jim Meyering <meyering@ascend.com>
2092 * man/help2man: Import version 1.018.
2093 * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
2094 * man/*.x: Include one-line summary in [NAME] section.
2095 * man/Makefile.summ: Remove the one-line summaries.
2096 Suggestion for clean-up from Akim Demaille.
2098 * configure.in (ALL_LINGUAS): Add Galician (gl).
2100 1999-11-01 Jim Meyering <meyering@ascend.com>
2102 * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and
2103 other special files like /dev/zero.
2105 * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2107 1999-10-31 Jim Meyering <meyering@ascend.com>
2109 * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around
2112 * doc/fileutils.texi: Document new --backup[=METHOD] option for
2113 cp, mv, ln, and install.
2115 * src/ln.c: Convert --backup to take an optional argument.
2116 Deprecate --version-control (-V) in comments.
2117 (usage): Remove mention of --version-control.
2118 (main): Make -V warn then fall through into --backup case.
2119 [--backup case]: Handle optional arg.
2120 * src/install.c: Likewise.
2122 1999-10-24 Jim Meyering <meyering@ascend.com>
2124 * src/cp.c (do_copy): Constify `dest', and cast-away the new
2125 const in assignment to new_dest.
2127 1999-10-23 Jim Meyering <meyering@ascend.com>
2129 * tests/touch/Makefile.am (TESTS): Add dangling-symlink.
2130 * tests/touch/dangling-symlink: New file.
2132 1999-10-23 Paul Eggert <eggert@twinsun.com>
2134 * src/touch.c (full_write): Remove unused decl.
2135 (open_maybe_create): Remove.
2136 (touch): Don't record whether the file was created; this isn't
2137 possible to do reliably and portably without race conditions.
2138 If the file was created and if amtime_now is nonzero, this
2139 change means we'll have to do another utime system call, but
2140 that's no more harmful than the previous version of this code.
2141 Reported by Gabor Z. Papp.
2143 1999-10-21 Jim Meyering <meyering@ascend.com>
2145 * configure.in (ALL_LINGUAS): Add Japanese (pa).
2147 1999-10-17 Jim Meyering <meyering@ascend.com>
2149 * tests/mv/backup-is-src: Remove use of mv's now-deprecated
2150 -V option. Use --b=simple instead of -b -V simple.
2152 * src/mv.c: Convert --backup to take an optional argument.
2153 Deprecate --version-control (-V) in comments.
2154 (usage): Remove mention of --version-control.
2155 (main): Make -V warn then fall through into --backup case.
2156 [--backup case]: Handle optional arg.
2158 Accept new option: --target-directory=DIR
2159 * src/cp.c (TARGET_DIRECTORY_OPTION): Define.
2160 (SPARSE_OPTION): Define.
2161 (usage): Describe it.
2162 (do_copy): Change meanings/names of first two parameters: use `n_files'
2163 in place of `argc - optind', and `file' instead of `argv + optind'.
2164 Add parameter, target_directory.
2165 (main): Pass new arg, target_directory.
2167 1999-10-16 Jim Meyering <meyering@ascend.com>
2169 * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option.
2170 Use --b=simple instead of -b -V simple.
2171 * tests/cp/backup-1: Replace use of cp's now-deprecated
2172 --version-control option with use of --backup=simple.
2174 * src/cp.c: Convert --backup to take an optional argument.
2175 Deprecate --version-control (-V) in comments.
2176 (usage): Remove mention of --version-control.
2177 (main): Make -V warn then fall through into --backup case.
2178 [--backup case]: Handle optional arg.
2180 * tests/cp/Makefile.am (TESTS): Add cp-mv-backup.
2181 * tests/cp/cp-mv-backup: New file.
2183 1999-10-11 Jim Meyering <meyering@ascend.com>
2185 * lib/getopt.c: Merge changes from latest glibc.
2186 * lib/getopt.h: Likewise.
2187 * lib/getopt1.c: Likewise.
2189 1999-10-09 Jim Meyering <meyering@ascend.com>
2191 Accept new option: --target-directory=DIR
2192 * src/ln.c (TARGET_DIRECTORY_OPTION): Define.
2193 (usage): Describe it.
2194 (main): Implement it.
2195 Make code clearer: use new variable `n_files' in place of
2196 `argc - optind'. Use `file' instead of `argv + optind'.
2198 1999-10-04 Jim Meyering <meyering@ascend.com>
2200 * depcomp: New file, for automake's new dependency support.
2201 * missing: New version, from automake's user-dep-gen-branch.
2203 * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too.
2204 * src/sys2.h (__attribute__): Likewise.
2205 Wrap with #ifndef __attribute__.
2207 1999-10-03 Paul Eggert <eggert@twinsun.com>
2209 * getdate.y (__attribute__): Define to empty if GCC claims to
2210 be before 2.8; this is needed for OPENStep 4.2 cc. Also,
2211 define to empty if strict ANSI.
2213 1999-10-03 Jim Meyering <meyering@ascend.com>
2215 Accept new option: --target-directory=DIR
2216 * src/mv.c (TARGET_DIRECTORY_OPTION): Define.
2217 (usage): Describe it.
2218 (main): Implement it.
2219 Remove unused variable, stdin_tty.
2220 Make code clearer: use new variable `n_files' in place of
2221 `argc - optind'. Use `file' instead of `argv + optind'.
2223 1999-09-28 Jim Meyering <meyering@ascend.com>
2225 * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
2226 Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
2227 * src/sys2.h: Likewise.
2229 * lib/xalloc.h (__attribute__): Protect against redefinition.
2232 1999-09-26 Jim Meyering <meyering@ascend.com>
2234 * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and
2236 Use explicit exit to help avoid warnings.
2239 * lib/path-concat.c (DIRECTORY_SEPARATOR): Define.
2241 (path_concat): Allow parameter DIR to be NULL.
2242 (xpath_concat): New function.
2245 * lib/xalloc.h (__attribute__): Define.
2246 (ATTRIBUTE_NORETURN): Define.
2247 (xalloc_die): Declare.
2248 (NEW): Define as yet unused macro.
2254 * lib/basename.c (base_name): Add prototype. From Akim Demaille.
2256 1999-09-19 Jim Meyering <meyering@ascend.com>
2258 * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
2259 (S_ISLNK): Define if necessary.
2260 This is necessary on a NEC SX-4 with SUPER-UX 9.1.
2261 Based on a patch from Holger Berger.
2263 * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
2264 Change many counter and index variables to be of unsigned type.
2265 (dd_copy): Add new unsigned variable, n_bytes_read, in place of
2266 many uses of `nread'.
2268 * src/sys2.h (__attribute__): Define.
2269 (ATTRIBUTE_NORETURN): Remove #else clause.
2270 (ATTRIBUTE_UNUSED): Define.
2272 1999-09-17 Jim Meyering <meyering@ascend.com>
2274 * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this
2275 is done in m4/jm-macros.m4.
2277 1999-09-09 Jim Meyering <meyering@ascend.com>
2279 * src/touch.c (usage): Remove misleading sentence in --help output.
2282 * src/Makefile.am (EXTRAdir): Remove unused variable.
2284 1999-09-03 Paul Eggert <eggert@twinsun.com>
2286 * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
2289 1999-09-01 Jim Meyering <meyering@ascend.com>
2291 * src/cp.c: Remove declaration of xstrdup.
2292 * src/df.c: Likewise.
2293 * src/ls.c: Likewise.
2295 1999-09-01 Akim Demaille <akim@epita.fr>
2297 * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'.
2298 * lib/xalloc.h (xalloc_fail_func): Likewise.
2299 (xstrdup): Add protoype.
2301 * lib/version-etc.c (version_etc_copyright): Default copyright string.
2302 (version_etc): Use it.
2303 * lib/version-etc.h: Declare it.
2305 1999-08-29 Jim Meyering <meyering@ascend.com>
2307 * configure.in (AC_YACC): Remove use, now that we require bison.
2309 * src/dircolors.hin: Add .rpm, .png, and .fli.
2312 1999-08-28 Paul Eggert <eggert@twinsun.com>
2314 * getdate.y: Add copyright notice.
2316 (number): Handle `Nov 11 1996' example; see Risks Digest 20.55
2317 http://catless.ncl.ac.uk/Risks/20.55.html#subj18
2320 (<stdio.h>): Include only if testing.
2322 (ISLOWER, PC): New macros.
2323 (<string.h>): Include if HAVE_STRING_H, not USG.
2325 (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
2327 (EPOCH_YEAR): Renamed from EPOCH.
2328 (table): Renamed from TABLE.
2329 (meridian): Now an anonymous enum.
2330 (struct parser_control): New type.
2331 (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
2332 (yyInput, ..., yyRelYear): Migrated into struct parser_control.
2333 (%pure_parser): Added, so that the parser is pure.
2334 (%union): Removed; the type is now just plain int.
2335 All %type directives removed.
2336 (tLOCAL_ZONE): New %token.
2337 (month_day_table): Renamed from MonthDayTable.
2338 (gmtime, localtime, mktime, time): Declare only if not defined.
2339 (meridian_table): New table.
2340 (dst_table): New table.
2341 (units_table): renamed from UnitsTable.
2342 (relative_time_table): Renamed from OtherTable.
2343 (time_zone_table): Renamed from TimezoneTable. Modernized data.
2344 (military_table): Renamed from MilitaryTable.
2345 (to_hour): Renamed from ToHour.
2346 (to_year): Renamed from ToYear.
2347 (lookup_zone): New function.
2348 (LookupWord): Renamed from lookup_word.
2349 Use lookup_zone for time zones.
2350 (yylex): Now reentrant. All callers changed.
2351 (get_date): Add support for local time zone abbreviations.
2354 1999-08-22 Jim Meyering <meyering@ascend.com>
2356 * src/sys2.h (IF_LINT): Define new macro.
2357 * src/df.c (main): Rename locals i and j.
2358 Use IF_LINT macro instead of #ifdef lint...
2360 * src/dd.c (parse_integer): Add `const' to char* parameter and
2361 add a separate `suffix' variable.
2363 1999-08-20 Jim Meyering <meyering@ascend.com>
2365 * src/chown.c (usage): Tweak --help output to make it more consistent
2367 * src/chgrp.c (usage): Tweak --help output to make it more consistent
2370 1999-08-17 Jim Meyering <meyering@ascend.com>
2372 * configure.in: Remove check for rename and the code that would
2373 enable building of the `mvdir' program.
2374 * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@.
2375 (EXTRA_PROGRAMS): Remove obsolete mvdir.
2376 * lib/rename.c: Remove obsolete file. (it had a bug, too)
2377 * src/mvdir.c: Remove obsolete file.
2378 * po/POTFILES.in: Remove mvdir.c
2380 * doc/fileutils.texi (chown, chgrp invocation): Make these sections
2381 consistent with each other.
2383 1999-08-16 Jim Meyering <meyering@ascend.com>
2385 * src/chown.c (groupname): Declare to be `const'.
2386 (change_dir_owner): Declare statp parameter to be `const'.
2387 (usage): Make the output be more consistent with that from chgrp.
2389 This change is nearly identical to the chown.c change of 1998-05-24
2390 * src/chgrp.c: Accept new option, --dereference.
2391 --no-dereference is now the default. Include lchown.h.
2392 (enum Change_status) [CH_NOT_APPLIED]: New member.
2393 (change_symlinks): Enable this by default, now.
2394 (describe_change): Handle new case.
2395 (change_file_group): Add new parameter: cmdline_arg. Update callers.
2396 Reorganize to reflect changed semantics.
2397 (LCHOWN): Remove definitions.
2400 1999-08-10 Jim Meyering <meyering@ascend.com>
2402 * po/POTFILES.in: Add lib/quotearg.c.
2404 1999-08-09 Paul Eggert <eggert@twinsun.com>
2406 * NEWS, doc/fileutils.texi, src/ls.c (usage):
2407 Add ls --quoting-style=locale.
2409 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE):
2410 Change from escape_quoting_style to locale_quoting_style.
2411 (argmatch_invalid): Use new quotearg_style primitive for simplicity.
2412 Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
2414 * lib/quotearg.h (locale_quoting_style): New enum value.
2415 (quotearg_n_style, quotearg_style): New decls.
2417 * lib/quotearg.c: Include <libintl.h> if ENABLE_NLS.
2419 (quoting_style_args, quoting_style_v, quotearg_buffer): Add support
2420 for locale_quoting_style, using _("`") and _("'") for open and close
2422 Do not quote spaces in escape_quoting_style.
2423 (quotearg_n_style, quotearg_style): New functions.
2425 1999-08-08 Jim Meyering <meyering@ascend.com>
2427 * src/touch.c (usage): Clarify description of --time=WORD.
2430 * lib/savedir.c (savedir): Change type of name_size parameter to off_t.
2431 * lib/savedir.h (savedir): Update prototype.
2432 * src/chmod.c (change_dir_mode): Remove cast of savedir arg.
2433 * src/chown.c (change_dir_owner): Likewise.
2434 * src/chgrp.c (change_dir_group): Likewise.
2435 * src/copy.c (copy_dir): Likewise.
2436 * src/du.c (count_entry): Likewise.
2437 Suggestion from Bob Proulx.
2439 1999-08-07 Jim Meyering <meyering@ascend.com>
2441 * po/POTFILES.in: Add lots of lib/*.c files.
2442 Remove src/cp-hash.c, since it doesn't use _().
2444 1999-08-04 Jim Meyering <meyering@ascend.com>
2446 * configure.in: Remove getline-testing code. Now it's in m4/.
2448 1999-08-01 Paul Eggert <eggert@twinsun.com>
2450 * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
2452 1999-07-30 Jim Meyering <meyering@ascend.com>
2454 * src/ls.c (usage): Explain about default wrt --hide-control-chars and
2455 --show-control-chars. Reported by Germano Leichsenring.
2457 1999-07-28 Jim Meyering <meyering@ascend.com>
2459 * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
2461 1999-07-24 Jim Meyering <meyering@ascend.com>
2463 * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
2464 (dd_copy): Use those to page-align both the input and output buffers.
2466 1999-06-01 Volker Borchert <bt@teknon.de>
2468 * tests/Makefile.am: Make envvar-check depend on check-recursive rather
2469 than on `check' so that its tests are performed before any real tests.
2471 1999-07-15 Jim Meyering <meyering@ascend.com>
2473 * src/dd.c: Include getpagesize.h.
2474 (dd_copy): Page-align the input buffer.
2475 Based on a patch from Scott Lurndal.
2477 * getpagesize.h: New file.
2478 * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h.
2480 * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
2481 Work around SunOS botch also when block size is different from 1k.
2484 1999-07-10 Jim Meyering <meyering@ascend.com>
2486 * man/help2man: Import version 1.012.
2488 1999-07-04 Jim Meyering <meyering@ascend.com>
2490 * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax.
2492 1999-07-04 Paul Eggert <eggert@twinsun.com>
2494 * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
2495 expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
2496 (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
2499 1999-06-27 Paul Eggert <eggert@twinsun.com>
2501 Fix some incompatibilities between `df -P' and POSIX.2.
2503 * lib/human.h (enum human_inexact_style): New enum.
2504 (human_readable_inexact): New decl.
2506 * lib/human.c (human_readable): New function.
2507 (human_readable_inexact): Renamed from human_readable, with new arg
2508 INEXACT_STYLE. Add support for ceiling and floor.
2510 * src/df.c (print_header): Conform to POSIX if posix_format).
2511 (df_readable): Take ceiling if posix_format.
2512 (ceil_percent): New function.
2513 (show_dev): Take ceiling of percent if posix_format.
2514 Align with POSIX-conforming header if posix_format.
2516 * doc/fileutils.texi: Document these changes.
2518 1999-05-27 Volker Borchert <bt@teknon.de>
2520 * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
2522 1999-05-23 Jim Meyering <meyering@ascend.com>
2524 * src/copy.c (copy_internal): Don't apply the umask in move_mode.
2525 Otherwise, `mv' would not preserve the permissions when copying
2526 between partitions. Reported by David Godfrey
2530 * tests/cp/same-file: Correct erroneous expected output from
2531 the `cp -f foo foo' tests.
2532 * po/POTFILES.in: Add same.c.
2533 * lib/same.h: New file.
2534 * lib/same.c: New file (function extracted from ln.c).
2535 * lib/Makefile.am (libfu_a_SOURCES): Add same.c.
2536 (noinst_HEADERS): Add same.h.
2537 * src/copy.c: Include same.h.
2538 * src/ln.c (same_name): Remove function.
2539 <same.h>: Include this instead.
2540 <dirname.h>: No longer include this.
2541 * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'.
2543 * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not
2544 remove FILE. Suggestion from Chris Yeo.
2545 * tests/mv/force: New test, for the above fix.
2546 * tests/mv/Makefile.am (TESTS): Add force.
2547 (TESTS_ENVIRONMENT): Change PATH to be absolute.
2549 * tests/mv/force (mv): New test.
2551 1999-05-17 Paul Eggert <eggert@twinsun.com>
2553 * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we
2554 have an absolute timestamp, or if the relative timestamp
2555 mentions days, months, or years. Reported by Volker Borchert.
2557 * lib/human.c (human_readable): Allow from_block_size to be zero.
2559 1999-05-14 Jim Meyering <meyering@ascend.com>
2561 * tests/Makefile.am (envvar-check): Renamed from check-local.
2562 (check): Depend on envvar-check so the envvar check is performed
2563 before all other tests. Reported by Volker Borchert.
2564 * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
2565 so CDPATH is mentioned in the message. Reported by Volker Borchert.
2567 * src/df.c (main): When asking for info on an explicit file name,
2568 just warn rather than failing if the table of mounted filesystems
2569 cannot be read. Based on a patch from Mark Kettenis.
2571 * lib/version-etc.c (version_etc): Put version info and author names
2572 on the first two lines respectively rather than putting the three
2573 lines of copyright info between them.
2575 * src/touch.c (open_maybe_create): Handle Solaris' failure mode when
2576 FILE is a directory. Reported by Vin Shelton.
2578 * lib/human.c: Include <string.h> or <strings.h> for strlen prototype.
2579 * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes.
2580 * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on
2581 64-bit systems. From Ulrich Drepper.
2583 1999-05-12 Jim Meyering <meyering@ascend.com>
2585 * src/shred.c (main): Put `u' for -u in getopt_long's string argument.
2588 1999-05-07 Jim Meyering <meyering@ascend.com>
2592 * tests/touch/dir-1: New test.
2593 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual
2594 upper-case program names. Add a definition of PATH.
2597 * src/mkdir.c (main): Use better wording in diagnostic: `cannot
2598 create directory' rather than `cannot make directory'. The former
2599 also matches the one in makepath.c.
2601 * src/dd.c: (apply_translations): Use TOUPPER and TOLOWER,
2602 not toupper and tolower.
2604 1999-05-05 Jim Meyering <meyering@ascend.com>
2606 * lib/makepath.c (make_dir): When reporting a mkdir failure and the
2607 target cannot be `stat'ed, use the errno from the failed mkdir call,
2608 not the one from the stat call. Before this change, running
2609 `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
2610 elicit `No such file or directory' instead of `Permission denied'.
2612 * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
2613 (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
2614 Based on a patch from Kaveh Ghazi.
2616 * src/ls.c (USE_ACL): Define this only #if
2617 (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
2618 Use `USE_ACL' in place of `HAVE_ACL' everywhere else. From Kaveh Ghazi.
2620 1999-05-04 Jim Meyering <meyering@ascend.com>
2622 * lib/makepath.c: Include makepath.h libintl.h, not after it.
2623 Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
2624 (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
2625 which is necessary on Irix4 since cc doesn't define __STDC__.)
2628 1999-04-30 Jim Meyering <meyering@ascend.com>
2630 * Makefile.maint: Define several tag-related make variables.
2631 (cvs-dist): Use the make variables instead of shell ones.
2632 (announcement): Automatically generate diffs for all ChangeLog files,
2633 not just the top level one.
2635 1999-04-30 Paul Eggert <eggert@twinsun.com>
2637 * lib/dup2.c: New file.
2639 1999-04-30 Jim Meyering <meyering@ascend.com>
2641 * src/touch.c (touch): Only do the fstat if we need to.
2642 Resort to calling stat for directories, but only when necessary.
2643 (usage): Mention --no-create.
2645 * src/copy.c (copy_internal): Move the one-file-system test so that
2646 it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
2647 Prior to this change, `cp --one-file-system' would traverse a file-
2648 system boundary if the destination directory existed. From Ton Hospel.
2650 1999-04-27 Paul Eggert <eggert@twinsun.com>
2652 * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO
2653 for output, to avoid confusion with closed input and output fds.
2654 (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
2656 (open_fd): New function.
2657 (main): Use it, instead of open, to ensure that file descriptors
2660 1999-04-26 Paul Eggert <eggert@twinsun.com>
2662 * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead
2665 * src/dd.c (skip): Don't fstat the input file; the result is
2668 1999-04-26 Jim Meyering <meyering@ascend.com>
2670 * tests/mv/into-self-2: Update to reflect this change by reversing
2671 the order of arguments so the symlink is the source, not the
2672 destination (otherwise, the mv command would now succeed).
2674 * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail.
2675 That is, even though source and destination are `the same,' don't fail
2676 if the destination is a symlink. From Peter Samuelson.
2678 1999-04-26 Paul Eggert <eggert@twinsun.com>
2680 * src/dd.c (main): If you can't open an output file (with
2681 seek=...) read-write, then open it for write and report an
2682 error if we can't seek.
2684 * lib/filemode.c (setst, ftypelet, mode_string):
2685 * lib/mkdir.c (mkdir):
2686 * lib/makepath.c (make_path):
2687 * lib/modechange.c (make_node_op_equals, mode_compile,
2688 mode_create_from_ref, mode_adjust):
2689 * lib/modechange.h (mode_adjust):
2690 * src/chmod.c (describe_change, change_file_mode):
2691 * src/copy.c (copy_reg, copy_internal):
2692 * src/copy.h (struct cp_options.umask_kill):
2693 * src/cp.c (do_copy, cp_option_init, main):
2695 * src/install.c (mode, cp_option_init, DIR_MODE):
2696 * src/mkdir.c (main):
2697 * src/mkfifo.c (main):
2698 * src/mknod.c (main):
2699 * src/mv.c (cp_option_init):
2700 * src/touch.c (open_maybe_create):
2701 Use proper mode_t types and macros.
2702 Don't assume the traditional Unix values for mode bits.
2704 * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH,
2705 S_IXOTH): Define if not defined.
2707 * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
2708 * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU):
2709 Define if not defined.
2710 * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
2711 Define if not defined.
2712 (CHMOD_MODE_BITS): New macro.
2713 * src/install.c (isodigit): Remove unused macro.
2715 * src/mkfifo.c, src/mknod.c (usage):
2716 Use symbolic mode as default, not octal.
2718 * lib/utime.c (utime_null):
2719 Don't pass 0666 to open; it's not needed and isn't
2720 guaranteed to be portable.
2722 * lib/filemode.h: <config.h>, <sys/types.h>: Include for mode_t.
2723 (mode_string): Now takes mode_t.
2725 * lib/modechange.h: Include <config.h>, <sys/types.h> for mode_t.
2726 (struct mode_change): Members affected and value are now mode_t instead
2729 * doc/fileutils.texi, doc/perm.texi:
2730 Don't assume traditional Unix mode numbering.
2732 * lib/modechange.c: modechange.h now includes sys/types.h.
2734 (isodigit, oatoi): Remove.
2735 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
2736 S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
2737 S_IRWXO): Define if not defined.
2738 (CHMOD_MODE_BITS): New macro.
2739 (mode_compile): Convert from octal with xstrtoul, not our own routine.
2741 1999-04-24 Jim Meyering <meyering@ascend.com>
2745 1999-04-22 Jim Meyering <meyering@ascend.com>
2747 * src/shred.c (word32): Don't use `#error'; it runs afoul of
2748 SunOS 4.1.4 cc. From Paul Eggert.
2750 * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
2752 1999-04-20 Paul Eggert <eggert@twinsun.com>
2754 Replace our temporary hack implementation of strtoumax with
2755 something very close to the real code in glibc.
2757 * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
2758 we now have a true replacement in strtoumax.c.
2759 (__strtol): Always define to strtoumax.
2760 (<stdlib.h>): No need to include.
2762 (my_strtoumax): Move this to strtoumax.c,
2763 rename it to strtoumax, and simplify.
2765 * lib/strtoull.c, lib/strtoumax.c: New files.
2767 * lib/strtol.c: Update to glibc 2.1.1 version.
2769 1999-04-20 Jim Meyering <meyering@ascend.com>
2771 * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
2772 (check-local): Also test and warn if CDPATH is set.
2774 1999-04-20 Paul Eggert <eggert@twinsun.com>
2776 * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
2778 * config.guess: New file (from autoconf).
2779 * config.sub: New file (from autoconf).
2781 * src/shred.c <config.h>: Include first, since it can do
2782 things like #define const, and this must be done before
2783 including any system headers.
2785 * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
2786 whether overflow occurred. Improve overflow-detection to use
2787 only one conditional branch total, rather than 2N+1
2788 conditional branches for an N-digit number.
2790 1999-04-18 Jim Meyering <meyering@ascend.com>
2792 * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
2793 strtouq, now that they're checked in m4/xstrtoumax.m4.
2795 1999-04-18 Paul Eggert <eggert@twinsun.com>
2797 * doc/fileutils.texi, src/shred.c (main, longopts):
2798 Use -u instead of -R for --remove, so that we can preserve
2799 future compatibility with rm.
2801 1999-04-18 Jim Meyering <meyering@ascend.com>
2803 * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
2804 (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
2807 1999-04-18 Paul Eggert <eggert@twinsun.com>
2809 Fix shred to do the right thing with off_t longer than long.
2810 Merge large-integer parsing code with similar code in dd.c,
2811 and put the resulting in lib/xstrtoumax.c so that other programs
2812 can use it. Instead of adding a new lib/xstrtoumax.h I thought
2813 it cleaner to put all the xstroto* declarations into a single
2814 header, which for now is lib/xstrtol.h for lack of a better place.
2815 (Mayby lib/xstdlib.h would be better? :-)
2817 I thought of several other problems with shredding regular files;
2818 shredding devices is much more reliable. So I changed the defaults
2819 to be more suitable for shredding devices; this should help encourage
2820 users to do the right thing.
2822 pfstatus isn't portable to environments with varying width
2823 fonts, or with internationalized environments where the byte
2824 count of the message is not the same as its print width.
2825 Rather than deal with this, I just simplified it to not do
2826 tricks with carriage-returns and spaces. (I'm also worried
2827 that vprintf may not return the right value on some hosts; I
2828 vaguelly recall this being a problem.) As a result, -v and -
2831 When removing a special file, try to truncate it first, but don't
2832 worry if this reports an error.
2834 Try to find the size of a non-regular file by seeking to its end.
2836 Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
2838 Some other minor bug fixes.
2840 * lib/xstrtoul.h: Remove this file.
2841 * lib/xstrtoumax.c: New file.
2843 * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
2845 * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
2846 (__strtol, __strtol_t, __xstrtol): New macros.
2848 * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
2849 New macros to specify the
2850 underlying function, its returned type, and our function. Default to
2851 values suitable for xstrtol.
2853 Include <ctype.h>, since we use its macros.
2855 (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
2856 (ISSPACE): New macro.
2858 (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
2861 (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
2862 whether STRING_TO_UNSIGNED is defined. Skip isspace chars, not
2863 isblank chars, to match strtol. When returning
2864 LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
2867 * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
2868 <inttypes.h>: Include if HAVE_INTTYPES_H.
2869 (_DECLARE_XSTRTOL): New macro.
2870 (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
2871 we need only one include file, not three.
2872 (_STRTOL_ERROR): Do not undef, as this is no longer needed.
2873 Reword overflow message so that it's independent of type.
2875 * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
2876 (noinst_HEADERS): Remove xstrtoul.h.
2878 * lib/xmalloc.c (xalloc_fail):
2879 Pass xalloc_msg_memory_exhausted through gettext.
2882 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
2883 (LookupWord, yylex): Don't pass negative char to ctype macros.
2885 * doc/fileutils.texi:
2886 Explain why shredding devices is more reliable, and why the
2887 default options are more suitable for devices.
2889 Remove withdrawn options -b or --no-contents, -c or --freed-contents,
2890 -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
2893 Add -R or --remove, -s or --size.
2895 -v can no longer be doubled.
2897 `file system' --> `filesystem' uniformly.
2899 * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
2901 * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
2902 "human.h", "xalloc.h": Include.
2903 (attribute): Remove; no longer needed.
2904 (xstrdup): New decl.
2905 (STDOUT_FILENO): New macro.
2906 (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
2908 The following changes have effect only if !HAVE_CONFIG_H.
2909 <ctype.h>: New include.
2910 (RETSIGTYPE): Remove bogus semicolon at end.
2911 (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
2913 (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
2914 Handle suffixes like the real routine does.
2915 (error): Remove bogus assignment of errno to errnum.
2916 (xmalloc, xstrdup): New functions.
2918 (O_NOCTTY): Define even if !HAVE_CONFIG_H.
2919 (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
2920 (OUTPUT_BLOCK_SIZE): New macro.
2921 (struct Options.verbose): Now a boolean, since we no longer have two
2922 levels of verbosity.
2923 (long_opts, usage, main): Remove -D or --device option. Invert -p or
2924 --preserve option, and rename it to -R or --remove.
2925 (usage): Describe G suffix.
2926 (usage): "-" no longer conflicts with -v.
2927 (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
2928 (ind): Portability fixes: return word32, not unsigned; multiply by
2929 sizeof (word32) instead of shifting left by 2.
2930 (isaac_refill, isaac_mix): Comment out size of array parameter, as
2931 ansi2knr mishandles this.
2932 (status_visible, status_pos, pfstatus, flushstatus): Remove, since
2933 pfstatus isn't portable to users with varying width fonts, or
2934 internationalized messages, and vfprintf is problematic. All callers
2935 of pfstatus changed to use error instead; this removes incompatibility
2936 of -v with -. All calls to flushstatus removed.
2937 (dopass, do_wipefd): Do not translate non-English msgs with gettext.
2939 (dopass): Cast lseek constant arguments to (off_t) for benefit
2940 of pre-ANSI compilers; fix one lseek call whose args were interchanged.
2941 Remove unnecessary casts to (off_t). Do not check for EIO
2942 when determining file size; this was just my earlier wild guess.
2943 Use human_readable to print off_t, instead of casting to unsigned long
2944 (which doesn't work in Solaris 2.6, where off_t is longer than long).
2945 Output human-readable sizes, instead of always using "K".
2946 Check for offset overflow (it happened to me in SunOS 4.1.4).
2947 (do_wipefd): Do not insist on regular files, but do check for special
2948 files that cannot possibly be shredded.
2949 Use xmalloc instead of malloc + check.
2950 Do not inspect st_size for non-regular files.
2951 Try to find the size of a non-regular file by seeking to its end.
2952 Do not assume that a regular file of size-0 has unknown size.
2953 Check for regular files with negative sizes,
2954 and for overflow after rounding to next block.
2955 Always try to truncate, even for special files, but do not report an
2956 error if truncation fails on a special file.
2958 (dopass, wipefile): Do not return 1 for special files; the caller
2959 doesn't care any more.
2961 (wipefd): Remove unnecessary (and nonportable) check for
2962 whether the file descriptor is read-only. Remove
2963 no-longer-needed check for `-v -'.
2965 (incname): Return 1 for carry bit, like the documentation says.
2967 (wipename, wipefile): Accept new argument, specifying the
2968 quoted file name. All callers changed.
2970 (wipename): Use xstrdup instead of strdup+error check.
2972 (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
2973 errors in NNN more carefully. Restore errno after the check.
2974 Check for errors when closing the file descriptor.
2975 Use more consistent wording when unable to remove a file.
2977 (main): Do not remove files by default.
2978 Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
2979 exist if !HAVE_CONFIG_H.
2980 In diagnostics, quote invalid operands to -n and -s options.
2981 Allow T, P, E, Z, and Y suffixes in -s operand.
2982 flags.verbose is now a boolean, not a counter.
2983 Use STDOUT_FILENO instead of 1, for clarity.
2986 Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
2987 xstrto... functions.
2989 * src/dd.c: Include xstrtol.h.
2990 (parse_integer): Migrate most of the work into the new xstrtoumax fn.
2992 * lib/xstrtoumax.c: New file.
2994 1999-04-18 Jim Meyering <meyering@ascend.com>
2996 * src/dd.c (main): Open the output file with *read* access
2997 only if we might need to read to satisfy a `seek=' request.
2998 From Matthias Urlichs.
3000 1999-04-10 Jim Meyering <meyering@ascend.com>
3002 * Makefile.maint (alpha): Add trailing slash for ncftp.
3006 * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
3007 * tests/Makefile.am (SUBDIRS): Add dd.
3008 * tests/dd: New directory
3009 * tests/dd/misc: New file.
3011 `ls --color' would segfault
3012 * src/ls.c: Include assert.h.
3013 (color_indicator[]): Add an entry for the type, `door.'
3014 (main): Assert that the lengths of the color_indicator and
3015 indicator_name arrays are appropriately related.
3016 Reported by John Gotts.
3018 * src/dd.c (scanargs): Fix bug introduced with last change: now that
3019 the loop is gone, manually decrement argc and increment argv.
3020 Reported by Andreas Jaeger and jvogel@linkny.com.
3022 1999-04-07 Jim Meyering <meyering@ascend.com>
3024 * lib/getdate.y (difftm): Protoize.
3026 1999-04-06 Jim Meyering <meyering@ascend.com>
3028 * lib/strftime.c: Update from master source in libc.
3030 1999-04-04 Jim Meyering <meyering@ascend.com>
3032 * tests/ln/misc: Comment out the test added on 1999-01-31.
3034 * Makefile.maint (url_dir_list): Define properly.
3035 (real_dir_list): Likewise.
3037 * src/shred.c: Don't include string.h.
3038 [!HAVE_CONFIG_H]: Include string.h here.
3039 [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
3040 (sigill_handler): Change return type and type of local `oldhandler' to
3042 (isaac_seed_machdep): Change and type of local `oldhandler' to
3048 * tests/cp/same-file: Change the sed command used to extract the
3049 filename from ls -l output, to accommodate the change in format.
3051 * src/ls.c (print_long_format): Add a space between %s and %3u. This
3052 assures that even when modebuf has the trailing `+' and there are more
3053 than 99 hard links to a file, the permissions string and the link count
3056 1999-04-03 Jim Meyering <meyering@ascend.com>
3058 * src/shred.c (dopass): add curly braces to avoid warning about
3060 (wipefd): Add parentheses suggested by gcc.
3061 (do_wipefd): Remove declaration of unused local.
3063 1999-04-02 Colin Plumb <colin@nyx.net>
3065 * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
3066 to allow standalone compilation.
3068 (wipefile): Added support for emulating /dev/fd/# files even if
3069 the OS doesn't support them. From Paul Eggert.
3071 (main, usage): Changed --device short option to -D.
3073 (wipefd, do_wipefd): Renamed function to do_wipefd and added
3074 separate wipefd that performs sanity checks on externally-opened file
3075 descriptors, such as not append-only. From Paul Eggert.
3077 (do_wipefd, isaac_seedfd): Do not read file for any reason.
3078 if the file is low-entropy, it's a security hole.
3079 (wipefile) Changed to open O_WRONLY and chmod to write-only when
3081 (isaac_seedfd) Function deleted as unnecessary.
3084 (dopass): Dynamically fall back to fsync() if fdatasync() fails,
3085 since POSIX, in their infinitesimal wisdom, encourage implementations
3086 that return constant -1, making compile-time testing useless.
3089 (dopass): Changed to support a size of -1 to mean "unknown".
3090 This entailed changing to a counting-up offset rather than couting-down
3091 cursize for the central state variable. Also changed size argument to
3092 be call-by-reference so that it can be passed back once known.
3093 (sizer) Function deleted as unnecessary.
3094 (wipefd): Changed to match. From Paul Eggert
3096 (dopass): Try to skip over bad blocks in destination files.
3097 Also added ftruncate() for more complete destruction of metadata.
3099 (main, usage): Changed "-" to stand for standard output.
3100 (wipefd): Added error message to detect conflict with -v.
3102 (dopass): Added periodic fsync() calls to keep the pass progress
3103 display in sync with reality. Hopefully they're sufficiently far spaced
3104 that throughput isn't affected. It might be a good thing to do even in
3105 non-verbose mode, to avoid filling up the kernel caches with dirty data.
3106 Also added ftruncate() for more complete destruction of metadata.
3108 (quotearg_colon): New function to print
3109 pathological filenames properly.
3110 [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
3111 that does most of the work.
3112 (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
3113 (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
3114 Error messages are also in a more uniform format.
3117 (struct Options, main, do_wipefd): Added -s/--size=N flag.
3118 (xstrtoul): Added support for valid_suffixes to help this.
3119 (usage) Documented it.
3121 (error): Changed some arguments from N_() to _(), since error()
3122 does not translate its argument. I think this is a bug.
3124 (struct Options do_wipefd, wipefd, wipefile, main): moved passes
3125 argument into the Options structure as n_iterations, which is now a
3126 size_t. From Paul Eggert.
3128 (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
3129 to manage seeding of RNG with arbitrary-sized data.
3130 (isaac_init): commented out as dead code.
3131 (isaac_seed): changed to use new functions to prevent any possibility of
3134 (isaac_seed): Added support for Solaris' gethrtime()
3135 configure.in: Corresponding feature test. From Paul Eggert.
3137 (wipename): Change remove() to unlink() for speed & portability.
3138 Use lstat() instead of access() to see if a filename is taken. This
3139 works even on dangling symlinks and avoids the suid problems of
3140 access(2). From Paul Eggert.
3142 (isaac_seed_machdep): New function for reading cycle counters
3144 1999-04-02 Paul Eggert <eggert@shade.twinsun.com>
3146 * configure.in (AC_CHECK_FUNCS): Add gethrtime.
3148 * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
3149 Use gethrtime if available. Don't assume that clock_gettime succeeds.
3150 Put most random sources first.
3152 1999-04-02 Paul Eggert <eggert@twinsun.com>
3154 shred: Add new options -bcCklL and fix some porting problems.
3155 Remove options -dp. Do not read output files.
3157 * src/shred.c (long_opts, usage, main, wipefile): Adjust to
3159 ("human.h", "quotearg.h"): New includes.
3160 (struct Options): New members contents, links, n_iterations.
3161 Remove allow_devices, remove_file. Change n_iterations to size_t.
3163 (output_block_size): New var.
3164 (usage): Declare __noreturn__ attribute.
3165 (fdatasync): Define to -1 if not present, since we need to invoke both
3166 fdatasync and fsync if both are present. All invokers of fdatasync
3167 now try fdatasync, then fsync.
3169 (isaac_seed): Use it to mix in values. Add uid, gid to mix.
3170 Don't use gettimeofday, as it has too many porting problems.
3171 (isaac_seedfd): Remove, since we no longer read the output files.
3172 (sizefd): Remove; we now determine size by writing sequentially.
3173 (dopass, wipename, wipefile, main): Clean up error messages.
3174 (dopass): Keep track of offset relative to start of file, not
3175 end, since we may not know how large the file is. If size is
3176 negative, write until we fall off the end of the file.
3177 (wipefd): Do not read output file.
3178 Return 0 if successful, -1 if not; do not make a special case for
3179 non-regular files, since our callers have that info now.
3180 (wipename): Now static. Return errno if error.
3181 (main): "-" now stands for standard output.
3182 Do not shred append-only standard output.
3183 (wipefile): Do not grant read permission to file when wiping it.
3184 Use symbolic permission (S_IWUSR), not octal.
3186 * src/system.h (S_IWUSR): Define if not already defined.
3188 * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
3189 (AC_CHECK_FUNCS): Remove gettimeofday.
3191 * doc/fileutils.texi: Document recent changes.
3193 1999-04-01 Jim Meyering <meyering@ascend.com>
3195 * configure.in (AC_CHECK_FUNCS): Add acl.
3196 (AC_CHECK_HEADERS): Add sys/acl.h.
3197 * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
3198 (struct fileinfo): New member `have_acl'.
3199 (gobble_file): Initialize it.
3200 (print_long_format): Use it.
3201 Mostly from Alen Muzinic.
3203 * src/touch.c (open_maybe_create): New function.
3204 (touch): Rewrite not to use `creat' and to eliminate a race
3205 condition that could make touch truncate a nonempty file.
3206 Report and suggestions from Andrew Tridgell.
3208 1999-03-31 Jim Meyering <meyering@ascend.com>
3210 * src/du.c: Remove prototypes and tsort function definitions.
3212 * src/chown.c (main): Move the declaration of `e' into the scope
3213 where it's used and make it `const'.
3215 * src/install.c (main): Qualify a char* with the `const' keyword.
3216 (install_file_in_dir): Likewise.
3217 * src/ln.c (main): Likewise.
3218 * src/mkdir.c (main): Likewise.
3219 * src/mkfifo.c (main): Likewise.
3220 * src/mknod.c (main): Likewise.
3221 * src/mv.c (main): Likewise.
3222 * src/touch.c (touch): Likewise.
3224 1999-03-30 Jim Meyering <meyering@ascend.com>
3226 * src/*.c: Don't include closeout.h or version-etc.h explicitly.
3227 Now, they're included via sys2.h.
3229 1999-03-29 Jim Meyering <meyering@ascend.com>
3231 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
3232 the catch-all for shared autoconf code, m4/jm-macros.m4.
3233 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
3236 1999-03-29 Paul Eggert <eggert@twinsun.com>
3238 Minor lint removal in code that forks and execs.
3240 * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
3241 against zero. This is to improve portability.
3242 * lib/rename.c (rename): Likewise.
3243 * lib/rmdir.c (rmdir): Likewise.
3245 * lib/rename.c (rename):
3246 (rename): Do not print any error messages, so that the messages
3247 are internationalized properly.
3249 * src/install.c (strip): Use standard "cannot fork" message.
3250 Check for strip nonzero exit status.
3252 1999-03-28 Jim Meyering <meyering@ascend.com>
3254 `chmod =OP' did not properly apply the umask
3255 * lib/modechange.c (make_node_op_equals): New function.
3256 (mode_append_entry): Likewise.
3257 (mode_compile): When none of [ugoa] is specified in an `=OP' change
3258 mode request, insert a `=0' entry into the linked list so that all
3259 bits are cleared first. Use the new functions.
3260 Reported by Andrew Dalke.
3262 New test for the above.
3263 * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
3264 * tests/Makefile.am (SUBDIRS): Add chmod.
3265 * tests/chmod: New directory
3266 * tests/chmod/equal-x: New file.
3268 1999-03-27 Jim Meyering <meyering@ascend.com>
3270 * lib/modechange.c (mode_compile): Upon allocation failure, free
3271 everything starting with the head, not the tail.
3273 * src/install.c (strip): Use pid_t, not int. From John Bley.
3275 1999-03-26 Jim Meyering <meyering@ascend.com>
3277 * src/dd.c (PROGRAM_NAME, AUTHORS): Define
3278 (long_options): Remove unused struct.
3279 (scanargs): Remove useless loop.
3280 (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
3281 * src/mvdir.c: Likewise.
3282 * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
3284 1999-03-25 Jim Meyering <meyering@ascend.com>
3286 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
3287 (noinst_HEADERS): Add version-etc.h.
3289 * lib/long-options.c (parse_long_options): Remove version-, copyright-,
3290 and author-printing code. Do it via version_etc.
3292 * lib/version-etc.c: New file.
3293 * lib/version-etc.h: Prototype for same.
3295 * src/sys2.h (GETOPT_HELP_CHAR): Define.
3296 (GETOPT_VERSION_CHAR): Define.
3297 (GETOPT_HELP_OPTION_DECL): Define.
3298 (GETOPT_VERSION_OPTION_DECL): Define.
3299 (case_GETOPT_HELP_CHAR): Define.
3300 (case_GETOPT_VERSION_CHAR): Define.
3302 * src/chgrp.c: No longer include long-options.h.
3303 Include version-etc.h instead.
3304 (PROGRAM_NAME, AUTHORS): Define.
3305 [long_options]: Add entries for --help and --version.
3306 Remove parse_long_options call.
3307 (main) [getopt switch]: Add a case for each of --help and --version.
3308 * src/chgrp.c: Likewise.
3309 * src/chmod.c: Likewise.
3310 * src/cp.c: Likewise.
3311 * src/df.c: Likewise.
3312 * src/dircolors.c: Likewise.
3313 * src/du.c: Likewise.
3314 * src/install.c: Likewise.
3315 * src/ln.c: Likewise.
3316 * src/ls.c: Likewise.
3317 * src/mkdir.c: Likewise.
3318 * src/mkfifo.c: Likewise.
3319 * src/mknod.c: Likewise.
3320 * src/mv.c: Likewise.
3321 * src/rm.c: Likewise.
3322 * src/rmdir.c: Likewise.
3323 * src/shred.c: Likewise.
3324 * src/touch.c: Likewise.
3326 1999-03-24 Jim Meyering <meyering@ascend.com>
3328 * man/help2man: Import version 1.010.
3330 1999-03-22 Jim Meyering <meyering@ascend.com>
3332 * src/chmod.c (usage): Add one-liner. Suggestion from Karl Berry.
3334 1999-03-19 Jim Meyering <meyering@ascend.com>
3336 * src/automake-wrap: Rewrite the automake-generated rule for
3337 clean-binPROGRAMS so that it removes rm even with a losing PATH on a
3338 losing system (PATH with `.' before /bin on a system where you can't
3339 unlink a running executable). Reported by William Bader.
3341 * configure.in: Use jm_WINSIZE_IN_PTEM.
3342 * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
3343 Required by SCO ODT 2.0 systems. Reported by William Bader.
3345 1999-03-18 Jim Meyering <meyering@ascend.com>
3347 * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
3348 (remove_init): Call hash_initialize with one more argument.
3350 1999-03-15 Jim Meyering <meyering@ascend.com>
3352 Revamp to allow fine-tuning to control when and by how
3353 much the table grows and shrinks.
3354 * lib/hash.c (next_prime): Don't assert.
3355 (hash_reset_tuning): New function.
3356 (check_tuning): New function.
3357 (hash_initialize): Accept and use new tuning parameter.
3358 (hash_rehash): Rewrite, updating for tuning.
3359 (hash_insert): Honor tuning semantics.
3360 (hash_delete): Likewise.
3361 From François Pinard.
3363 * lib/hash.h (struct hash_tuning): Define.
3364 (struct hash_table) [tuning]: Add member.
3365 (hash_initialize): Add `tuning' parameter.
3367 * lib/hash.c (hash_insert): Remove last parameter and change semantics.
3368 * lib/hash.h (hash_insert): Update prototype.
3370 * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
3371 otherwise, we'd do so even when the insertion failed.
3372 From François Pinard.
3374 1999-03-07 Jim Meyering <meyering@ascend.com>
3376 * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
3377 have to be scanned for % signs. Suggestion from François Pinard.
3379 * Makefile.maint: Add two more URLs and the loops to use them.
3381 * lib/long-options.c (parse_long_options): Include `Copyright...' line
3382 in --version output.
3383 Add the `...NO warranty...' message.
3385 1999-03-03 Jim Meyering <meyering@ascend.com>
3387 * lib/long-options.c (_): Define it.
3388 (parse_long_options): Accept new parameter, authors, and print it.
3390 * lib/long-options.h: Update prototype.
3392 * src/chgrp.c: Include long-options.h
3393 [long_options]: Remove the "help" and "version" entries.
3394 (main): Use parse_long_options, including author name(s).
3395 Remove the show_version and show_help blocks.
3396 * src/chmod.c: Likewise.
3397 * src/chown.c: Likewise.
3398 * src/cp.c: Likewise.
3399 * src/dd.c: Likewise.
3400 * src/df.c: Likewise.
3401 * src/dircolors.c: Likewise.
3402 * src/du.c: Likewise.
3403 * src/install.c: Likewise.
3404 * src/ln.c: Likewise.
3405 * src/ls.c: Likewise.
3406 * src/mkdir.c: Likewise.
3407 * src/mkfifo.c: Likewise.
3408 * src/mknod.c: Likewise.
3409 * src/mv.c: Likewise.
3410 * src/mvdir.c: Likewise.
3411 * src/rm.c: Likewise.
3412 * src/rmdir.c: Likewise.
3413 * src/shred.c: Likewise.
3414 * src/sync.c: Likewise.
3415 * src/touch.c: Likewise.
3417 1999-02-18 Paul Eggert <eggert@twinsun.com>
3419 * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
3420 The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
3422 1999-02-17 Jim Meyering <meyering@ascend.com>
3424 * src/shred.c (wipename): Fix string thinko. Now, shredding files
3425 in subdirectories works (dir/file). From Janos Farkas.
3427 1999-02-13 Jim Meyering <meyering@ascend.com>
3429 * src/dircolors.c (dc_parse_stream): Don't try to dereference
3430 NULL if there's an error in our built-in list.
3431 Suggestion from François Pinard.
3433 1999-02-13 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
3435 * src/install.c (main): Set x.backup_type only if backups are requested.
3436 (cp_option_init): Initialize backup_type.
3437 (backup_type): Remove unused variable.
3439 * doc/fileutils.texi: Fix use of @item vs @itemx.
3441 1999-02-08 Jim Meyering <meyering@ascend.com>
3443 * src/dircolors.c (slack_codes): Add "DOOR".
3444 (ls_codes): Add corresponding "do".
3445 Reported by John Gotts.
3447 * configure.in (ALL_LINGUAS): Add Italian (it).
3449 1999-02-07 Jim Meyering <meyering@ascend.com>
3451 * Version 4.0d (aka 4.1-b4).
3453 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
3454 is hooked up to the distcheck rule.
3455 * Makefile.am (distcheck-hook): New target and rule -- link to shared
3456 rule, my-distcheck, in Makefile.maint.
3458 * doc/fileutils.texi (shred invocation): New section. From Colin Plumb.
3460 * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
3461 group-member.m4, and just use this new macro.
3462 Use `.$ac_objext', not the literal `.o'.
3464 1999-02-02 Jim Meyering <meyering@ascend.com>
3466 * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
3467 Define to zero if not already defined.
3468 (HAVE_SYMLINKS): Define.
3469 (gobble_file): Remove #ifdef.
3470 (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
3471 rather than #ifdef S_ISLNK.
3472 (print_type_indicator): Remove #ifdefs and reorganize.
3473 (print_color_indicator): Remove #ifdefs.
3474 (length_of_file_name_and_frills): Likewise.
3476 1999-02-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3478 * src/dircolors.hin: Handle DOOR.
3480 * src/ls.c (print_type_indicator): Print doors as '>'.
3481 (length_of_file_name_and_frills): Account for this.
3482 (indicator_no): Define C_DOOR.
3483 (indicator_name): Add corresponding name.
3485 * lib/filemode.c (ftypelet): Handle doors.
3487 * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
3489 1999-02-01 Jim Meyering <meyering@ascend.com>
3491 * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
3492 argument list. From Akim Demaille.
3494 1999-01-31 Jim Meyering <meyering@ascend.com>
3496 * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
3497 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
3499 * tests/ln/misc: Add test for this.
3500 * src/ln.c (do_link): Allow creation of a hard link to a dangling
3501 symlink. Reported by Alexey Solovyov.
3503 * src/copy.c (copy_internal): Describe any backup-related renaming
3504 operations when in verbose mode.
3505 (copy_internal): Likewise.
3506 Based on changes from Marty Leisner.
3508 * lib/lchown.c: Declare chown.
3510 1999-01-30 Jim Meyering <meyering@ascend.com>
3512 * acconfig.h: Remove uintmax and STAT* #undefs.
3513 * configure.in: Require autoconf 2.13.
3514 Remove test for AFS.
3515 Use 3-argument form of AC_DEFINE*.
3517 1999-01-28 Jim Meyering <meyering@ascend.com>
3519 * po/POTFILES.in: Add src/shred.c.
3521 * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
3522 TM_IN_SYS_TIME based one (for shred).
3524 * acconfig.h: Remove lots of `#undef's, now that we use the
3525 3-argument forms of AC_DEFINE* macros.
3527 1999-01-25 Jim Meyering <meyering@ascend.com>
3529 * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
3531 (AC_CHECK_FUNCS): Add clock_gettime.
3533 * src/shred.c (isaac_seed): Guard clock_gettime with test of
3534 HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
3535 (wipename): Rename local dirfd to dir_fd to avoid shadowing the
3536 function declared in Linux's dirent.h.
3538 1999-01-25 Akim Demaille <demaille@inf.enst.fr>
3540 * lib/argmatch.h (ARRAY_CARDINALITY): Define.
3541 (ARGMATCH_ASSERT): New macro.
3543 * lib/argmatch.c (program_name): Remove dcl.
3545 (argmatch_invalid): Use error rather than fprintf.
3547 1999-01-24 Jim Meyering <meyering@ascend.com>
3549 * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
3550 New version from L. Peter Deutsch.
3552 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
3553 (and hence that of the local `n1', too) to `int' at Paul's request.
3555 * lib/closeout.c: Add comments.
3557 * src/shred.c (fdatasync): Remove function. instead, ...
3558 (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
3561 1999-01-23 Jim Meyering <meyering@ascend.com>
3563 * src/Makefile.am (bin_PROGRAMS): Add shred.
3564 * src/shred.c: New file.
3567 (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
3568 only when in verbose mode.
3569 (fdatasync) [! HAVE_FDATASYNC]: New function.
3571 * man/Makefile.am (man_MANS): Add shred.1.
3572 * man/Makefile.summ (shred-summary): Define.
3573 * man/shred.x: New file.
3575 * src/shred.c: New file. From Colin Plumb.
3576 Include config.h, getopt.h, system.h and error.h.
3577 Use #else/#if, not #elif.
3579 1998-11-05 Paul Eggert <eggert@twinsun.com>
3581 * lib/mktime.c (__mktime_internal): Adopt the traditional (and
3582 problematic) notion of what to do when tm_isdst doesn't match.
3584 1999-01-17 Jim Meyering <meyering@ascend.com>
3586 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
3587 than setting RM and CP.
3588 * tests/cp/*: Now that PATH is set properly, use rm and cp rather
3591 * tests/ln/Makefile.am (TESTS): Add backup-1.
3592 (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
3593 * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
3594 * tests/ln/backup-1: New test for this.
3595 * src/ln.c (do_link): Try to remove DEST even after renaming it.
3596 This fixes a bug reported by Jamie Lokier.
3598 * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
3600 1999-01-16 Jim Meyering <meyering@ascend.com>
3602 * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
3604 * acconfig.h: Remove @BOTTOM@ section.
3605 Instead, add the define and decl via m4/jm-macros.m4.
3607 * src/ls.c: Don't declare base_name.
3608 Use function-style XARGMATCH once again.
3609 * src/touch.c: Likewise.
3610 * acconfig.h: Add a @BOTTOM@ section.
3611 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
3615 * src/cp.c: Remove declarations of base_name and get_version.
3616 (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
3617 Use xget_version and function-style XARGMATCH.
3618 * src/mv.c (main): Likewise.
3619 * src/ln.c (main): Likewise.
3620 * src/install.c (main): Likewise.
3621 * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
3622 unsigned int, not just int.
3623 * lib/backupfile.h (get_version): Adjust prototype.
3624 (xget_version): Add prototype.
3625 (base_name): Remove prototype.
3626 * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
3627 (backup_args): Reorder enum members.
3628 (backup_types): Likewise.
3629 (get_version): Take an additional parameter, `context'.
3630 (xget_version): Like get_version, but if the `version' argument is NULL,
3631 use the value of the envvar VERSION_CONTROL.
3632 (base_name): Declare.
3633 Mostly from Akim Demaille.
3635 * lib/addext.c: (base_name): Declare.
3636 * src/sys2.h: Add prototype for base_name.
3638 * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
3639 * lib/argmatch.h: Likewise.
3641 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
3642 (XARGCASEMATCH): Likewise.
3644 * lib/argmatch.c (EXIT_FAILURE): Define.
3645 (ARGMATCH_DIE): Provide default.
3646 (__xargmatch_internal): New function.
3647 s/rogram_name/program_name.
3650 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
3652 * src/touch.c (usage): Don't make it static so that it can be
3653 called from libfu.a by xargmatch.
3654 * src/chgrp.c (usage): Likewise
3655 * src/chmod.c (usage): Likewise
3656 * src/chown.c (usage): Likewise
3657 * src/cp.c (usage): Likewise
3658 * src/dd.c (usage): Likewise
3659 * src/df.c (usage): Likewise
3660 * src/dircolors.c (usage): Likewise
3661 * src/du.c (usage): Likewise
3662 * src/install.c (usage): Likewise
3663 * src/ln.c (usage): Likewise
3664 * src/ls.c (usage): Likewise
3665 * src/mkdir.c (usage): Likewise
3666 * src/mkfifo.c (usage): Likewise
3667 * src/mknod.c (usage): Likewise
3668 * src/mv.c (usage): Likewise
3669 * src/mvdir.c (usage): Likewise
3670 * src/rm.c (usage): Likewise
3671 * src/rmdir.c (usage): Likewise
3672 * src/sync.c (usage): Likewise
3674 1999-01-12 Akim Demaille <demaille@inf.enst.fr>
3676 * lib/backupfile.c (get_version): added the parameters KIND.
3677 (xget_version): like get_version, but if argument is NULL, honor
3678 the envvar VERSION_CONTROL.
3679 * src/cp.c: Remove declarations of base_name and get_version.
3680 (main): Use xget_version.
3681 * src/mv.c (main): Likewise.
3682 * src/ln.c (main): Likewise.
3683 * src/install.c (main): Likewise.
3685 1999-01-12 Jim Meyering <meyering@ascend.com>
3687 * configure.in (ALL_LINGUAS): Add Greek (el).
3688 * po/el.po: New file.
3690 * install-sh: New version from autoconf.
3691 * missing: New version from automake.
3692 * src/ansi2knr.c: Likewise.
3693 * lib/getopt.c: New version from glibc.
3694 * lib/getopt.h: Likewise.
3695 * lib/getopt1.c: Likewise.
3696 * lib/regex.c: Likewise.
3697 * lib/regex.h: Likewise.
3698 * lib/ylwrap: Remove unused file.
3700 1999-01-10 Jim Meyering <meyering@ascend.com>
3702 * Version 4.0c (aka 4.1-b3).
3704 * Upgrade to autoconf-2.13 and automake-1.3b.
3706 * src/copy.c (copy_internal): Handle two more values of errno from
3707 failed rename of a directory into a subdirectory of itself.
3708 Thanks to Volker Borchert for testing many types and combinations
3711 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
3712 to escape_quoting_style.
3713 (argmatch_invalid): Now that the quoted quantity is no longer double
3714 quoted, remove the code that removed leading and trailing double quotes.
3716 * src/ls.c (decode_switches): Now that escape_quoting_style no longer
3717 escapes the SPACE character, arrange for SPACEs to be quoted here.
3718 * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
3719 it no longer escapes ` '.
3720 Suggestion from Paul Eggert.
3722 1999-01-05 Jim Meyering <meyering@ascend.com>
3724 * configure.in (space): Add `for' in message of statvfs check.
3725 From Ulrich Drepper.
3727 1999-01-04 Jim Meyering <meyering@ascend.com>
3731 1999-01-02 Jim Meyering <meyering@ascend.com>
3733 * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
3734 offending quoted argument before using it in explanatory diagnostic.
3735 Use a single fprintf stmt.
3737 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
3738 modify a parameter. Add a `Die_stmt' parameter.
3740 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
3741 (argmatch_to_argument): Add `const' attribute to first parameter.
3743 * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
3744 done in m4/jm-macros.m4).
3746 * lib/backupfile.c (get_version): Adapt to use new interface to
3748 * src/cp.c: Likewise.
3749 * src/ls.c: Likewise.
3750 * src/touch.c: Likewise.
3752 1999-01-01 Jim Meyering <meyering@ascend.com>
3754 * lib/makepath.c (make_dir): New function, factored out of make_path.
3755 (make_path): Use make_dir rather than open-coding it twice.
3756 This effectively reverses the order of the latter pair of stat/mkdir
3757 calls and fixes a race condition bug whereby one of two concurrent
3758 `mkdir -p' processes could fail with EEXIST.
3759 Include locale.h and libintl.h, and define `_()'.
3760 Mark translatable strings.
3762 * lib/xmalloc.c: Add comments.
3763 (xcalloc, xmalloc, xrealloc): Remove prototypes.
3764 (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
3765 * lib/xalloc.h: Add comments.
3766 (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
3767 (xcalloc, xmalloc, xrealloc): Add prototypes here.
3768 Based on changes from Akim Demaille.
3770 * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
3771 (quotearg_n): Change type of 1st parameter from int to unsigned int.
3772 (quotearg_n_options): Likewise.
3773 * lib/quotearg.h (quoting_style_vals): New public array.
3775 (quotearg_n_options): Declare `options' parameter to be `const'.
3777 * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
3779 * lib/backupfile.c (get_version): Use XARGMATCH in place of
3782 1998-12-31 Jim Meyering <meyering@ascend.com>
3784 * src/ls.c (indicator_style_types): New variable.
3785 (format_types): Rename from `formats'.
3786 (color_args): Remove unnecessary `no' string.
3787 (color_types): Remove corresponding `color_never' entry.
3788 (main): Use ARGMATCH_TO_ARGUMENT.
3789 (decode_switches): Use ARGMATCH instead of argmatch code
3790 in each of several cases.
3793 * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
3794 * src/touch.c (main): Likewise.
3795 * lib/backupfile.c (get_version): Likewise.
3798 * lib/strncasecmp.c: New file.
3799 * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
3800 * lib/argmatch.c (strncasecmp): Move to a separate file.
3801 Add curly braces around some one-stmt-but-multiline blocks.
3803 * lib/argmatch.c: Improvements from Akim Demaille.
3804 * lib/argmatch.h: Likewise.
3806 * lib/addext.c (addext): Protoize.
3807 Indent cpp directives to match nesting.
3809 Fix warnings from gcc -W -Wall
3810 * lib/posixtm.c (posix_time_parse): Change type of index `i' from
3811 int to unsigned int.
3812 * lib/getdate.y (__attribute__): Define.
3813 (ATTRIBUTE_UNUSED): Define.
3814 (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
3815 (MonthDayTable): Add initializers for last entry.
3816 (UnitsTable): Likewise.
3817 (OtherTable): Likewise.
3818 (MilitaryTable): Likewise.
3820 1998-12-22 Jim Meyering <meyering@ascend.com>
3824 * configure.in (ALL_LINGUAS): Add chinese (zh).
3826 1998-12-19 Jim Meyering <meyering@ascend.com>
3828 * tests/ln/misc: Use absolute path for final rm.
3830 * Makefile.maint (my-distcheck): Run make with
3831 CFLAGS='-Wformat -Werror'.
3833 1998-12-18 Jim Meyering <meyering@ascend.com>
3835 * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
3836 from format string. From Michiel Bacchiani.
3838 * src/chgrp.c (MAXGID): Define.
3839 Use gid_t (not int) as the type for `group' variables.
3840 (parse_group): Use MAXGID, not INT_MAX.
3842 * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
3843 * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
3845 1998-12-13 Jim Meyering <meyering@ascend.com>
3847 * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
3849 1998-12-12 Jim Meyering <meyering@ascend.com>
3851 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
3852 * src/ls.c: Group DIRED's code together.
3853 (full_time, inhibit_group, col_ext_type): Declare static.
3854 (dired_dump_obstack): Apply sizeof to variable, instead of its type.
3855 (parse_ls_color): Rename ext2 as e2. Move into the block where it
3858 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
3859 * src/ls.c: In order to distinguish col(umn|or):
3860 (init_column_info): Renamed from init_col_info.
3861 (struct column_info): Renamed from struct col_info.
3862 (struct color_ext_type): Renamed from struct col_ext_type.
3864 1998-12-11 Jim Meyering <meyering@ascend.com>
3866 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
3868 * lib/stat.c: Remove file.
3869 * lib/lstat.c: Remove file.
3870 * lib/xstat.in (xstat@): New file.
3872 * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
3874 * tests/ls-2/tests: Add a test for this.
3876 * man/help2man: import version 1.006.
3878 1998-12-07 Jim Meyering <meyering@ascend.com>
3880 * src/copy.c: Use dir_name, not dirname. Include dirname.h.
3881 * src/cp.c: Likewise.
3882 * src/df.c: Likewise.
3883 * src/install.c: Likewise.
3884 * src/ln.c: Likewise.
3885 * src/mvdir.c: Likewise.
3887 * lib/dirname.c (dir_name): Rename from dirname.
3888 Make argument `const'. Include "dirname.h"
3889 * lib/dirname.h: New file.
3890 * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
3892 1998-12-06 Jim Meyering <meyering@ascend.com>
3894 * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
3895 `^[yY]' and `^[nN]' (avoiding regex). From Karl Heuer.
3897 * lib/*.c: Ansideclify.
3899 Fix `ls -R .' formatting bug that broke mktexlsr.
3900 * src/ls.c: Include path-concat.h.
3901 (basename_is_dot_or_dotdot): New function, derived from
3902 is_not_dot_or_dotdot.
3903 (is_not_dot_or_dotdot): Remove function.
3904 (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
3905 instead of is_not_dot_or_dotdot and use path_concat instead of attach.
3907 * tests/ls-2/tests: New file (renamed from quoting),
3908 with new test for the `ls -R .' fix.
3909 * tests/ls-2/quoting: Remove file.
3910 * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
3912 1998-11-29 Jim Meyering <meyering@ascend.com>
3914 * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
3915 * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
3917 * src/dd.c (dd_copy): Rename function from `copy'.
3919 * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
3921 Per Kristian Hove reported that a certain move-directory-into-self
3922 wasn't properly diagnosed.
3924 * tests/mv/into-self-3: New file.
3925 * tests/mv/Makefile.am (TESTS): Add into-self-3.
3926 * src/copy.c (copy_internal): Remove earlier (but less effective)
3927 test for move/copy-into-self.
3928 Instead, deduce the move-into-self condition from errno==EINVAL
3929 after a failed rename.
3930 * src/mv.c (do_move): Don't arrange to remove DEST in the
3931 copied-into-self case.
3933 1998-11-15 Jim Meyering <meyering@ascend.com>
3935 Bob McCracken reported that mv couldn't handle certain combinations
3936 of hard linked source files.
3938 * tests/mv/hard-link-1: New file.
3939 * tests/mv/Makefile.am (TESTS): Add hard-link-1.
3940 * src/mv.c (movefile): Don't free new_dest.
3942 * lib/error.c (error): Don't use strerror_r's return value.
3943 From Johan Danielsson.
3945 1998-11-14 Jim Meyering <meyering@ascend.com>
3949 * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
3950 to avoid matching a prefix of another tag.
3952 1998-11-10 Jim Meyering <meyering@ascend.com>
3954 * configure.in (ALL_LINGUAS): Add Greek (el).
3955 * po/el.po: New file.
3957 1998-11-07 Jim Meyering <meyering@ascend.com>
3961 Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
3962 work on Hurd systems because of an inline definition of lstat in a
3963 system header file). This also makes it so that you may run `ls '' '
3964 on systems that let l?stat operate on the empty string.
3966 * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
3967 and declare the latter.
3968 * lib/stat.c [stat]: Remove #undef.
3969 (rpl_stat): Protoize.
3970 * lib/lstat.c [lstat]: Remove #undef.
3971 (rpl_lstat): Protoize. Use ENOENT, not EINVAL, to be consistent
3973 * acconfig.h: Remove #undef's for lstat and stat.
3975 1998-10-31 Jim Meyering <meyering@ascend.com>
3977 * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
3979 * tests/rm/empty-name: New file.
3981 * acconfig.h (stat): New #undef.
3982 This omission was uncovered when Mark Kettenis reported that
3983 `rm -r ''' got a failed assertion on the Hurd. This change
3984 doesn't fix *that* problem -- see above.
3986 1998-10-25 Jim Meyering <meyering@ascend.com>
3990 * README: Man pages will now be supported to the extent that
3991 people send patches.
3993 * tests/rm/unreadable: Two new tests.
3994 * tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
3995 it out since we're so close to release and since the test compares the
3996 text of diagnostics that are likely to vary between systems.
3997 (TEST_ENVIRONMENT): Add required framework.
3999 * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
4000 pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
4001 Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
4002 (remove_dir): Return `status', rather than always RM_OK.
4004 1998-10-18 Jim Meyering <meyering@ascend.com>
4008 * lib/mktime.c: Update from libc with this additional change from Paul.
4009 * lib/strftime.c: Likewise.
4011 1998-10-17 Paul Eggert <eggert@twinsun.com>
4013 Don't invoke localtime_r or gmtime_r unless it's the GNU C
4014 library's localtime_r and gmtime_r; there are too many buggy
4015 implementations of localtime_r and gmtime_r out there, and
4016 it's not worth keeping track of all the different bugs.
4018 * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
4019 (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
4020 Base it on localtime unless _LIBC.
4022 * strftime.c (__EXTENSIONS__): Remove.
4023 (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
4024 (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
4025 Base them on localtime/gmtime if not _LIBC.
4027 1998-10-17 Jim Meyering <meyering@ascend.com>
4031 * lib/mktime.c: Declare localtime_r if necessary.
4032 * lib/strftime.c: Likewise.
4034 * tests/Fetish.pm (run_tests): Run $prog with --version only
4037 1998-10-11 Jim Meyering <meyering@ascend.com>
4041 1998-10-08 Paul Eggert <eggert@twinsun.com>
4043 * mktime.c (__mktime_internal): When the requested time falls
4044 in a spring-forward gap of size DT, return a time that is DT
4045 away from the requested time, preferring a time whose tm_isdst
4046 differs from the requested value. Bump the max number of
4047 probes from 4 to 6 to account for the extra probes needed to
4048 discover a spring-forward gap in the worst case.
4050 1998-10-08 Paul Eggert <eggert@twinsun.com>
4052 * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
4053 Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
4054 a body that merely expands localtime_r; this works around a
4055 bug in Digital Unix 4.0A and 4.0D.
4057 1998-10-05 Jim Meyering <meyering@ascend.com>
4059 * po/Makefile.in.in (uninstall): Remove (historical?) command that
4060 removed po-Makefile.in.in. From Akim Demaille.
4062 * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
4065 1998-10-04 Jim Meyering <meyering@ascend.com>
4067 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
4070 1998-10-03 Jim Meyering <meyering@ascend.com>
4074 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
4076 * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
4077 Instead, depend on corresponding source file and on configure.in.
4078 Based on suggestion and code from Akim Demaille.
4079 Factor out irregular men into Makefile.summ.
4081 * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
4083 * man/Makefile.summ: New file.
4084 * man/Makefile.maint: Include it.
4086 * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
4088 * tests/mv/Makefile.am (TESTS): Add i-1.
4089 * tests/mv/i-1: New test.
4091 1998-10-02 Jim Meyering <meyering@ascend.com>
4093 * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
4094 * tests/ls-2/run-test: Remove file.
4095 * tests/ls-2/quoting: Include /bin/sh driver framework.
4097 * tests/dircolors/simple: Remove file.
4098 * tests/dircolors/run-test: Embed it here instead.
4099 * tests/dircolors/simple: Rename from run-test.
4101 1998-10-01 Jim Meyering <meyering@ascend.com>
4103 * tests/Makefile.am (EXTRA_DIST): Remove README.
4106 1998-09-28 Jim Meyering <meyering@ascend.com>
4110 * Use automake-1.3b. See notes in README.
4112 * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
4113 Otherwise, `touch a b; echo n|mv -i a b' would remove b.
4116 1998-09-27 Jim Meyering <meyering@ascend.com>
4120 * Makefile.maint (alpha): New target.
4121 (my-distcheck): Tweak.
4123 * lib/backupfile.h: Protect against multiple inclusion.
4126 * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
4127 Now, it is invoked through jm_MACROS.
4129 * lib/strftime.c (my_strftime): Update from FSF.
4131 1998-09-26 Jim Meyering <meyering@ascend.com>
4133 * src/copy.c (copy_internal): Don't preserve hard-linked directories
4134 to avoid damaging the destination filesystem when copying from a
4135 Netapp snapshot directory. With code from Kjetil Torgrim Hollstein
4138 1998-09-24 Jim Meyering <meyering@ascend.com>
4140 * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
4143 1998-09-21 Jim Meyering <meyering@ascend.com>
4145 * man/Makefile.maint ($(man_MANS)): Remove `echo'.
4147 1998-09-20 Jim Meyering <meyering@ascend.com>
4151 * src/install.c (install_file_to_path) [-D]: Create any leading
4152 directories with permissions of 0755.
4154 1998-09-19 Jim Meyering <meyering@ascend.com>
4156 * src/install.c (install_file_to_path): Copy the file after creating
4157 any leading directories.
4158 (main) [case 'v']: Set `x.verbose' to 1, not 0.
4159 Reported by Marty Leisner.
4161 * man/Makefile.am (transform): Define.
4162 (man_MANS): Include ginstall.1, not install.1, to match the name
4163 of the executable in ../src.
4164 * man/ginstall.x: New file.
4165 * man/install.x: Remove file.
4166 * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
4168 * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
4169 Reported by Akim Demaille.
4171 * lib/modechange.c: Fix post-protoization typo.
4173 * lib/posixtm.h (PARAMS): Define and use.
4176 1998-09-12 Jim Meyering <meyering@ascend.com>
4180 * src/remove.c (remove_cwd_entries): Declare to be static.
4182 Automatically generate man pages from combination of --help
4183 output and the contents of new, man/*.x files.
4184 * man/Makefile.am (HELP2MAN): Define.
4186 (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
4187 (MAINTAINERCLEANFILES): Add $(man_MANS).
4188 * man/*.x: New files.
4189 * man/GNUmakefile: New file.
4190 * man/Makefile.maint: New file.
4191 * man/help2man: New file.
4193 1998-09-09 Jim Meyering <meyering@ascend.com>
4195 * lib/modechange.c: Protoize.
4197 1998-09-07 Jim Meyering <meyering@ascend.com>
4201 * src/df.c (show_dev) [!posix_format]: When using --print-type,
4202 let the device path and the file system type share a single (wider)
4203 field if their combined lengths allow it. From Andries Brouwer.
4205 * tests/touch/empty-file: Upon failure, suggest how to rerun the test
4206 with longer delay, in case NFS clock skew was the cause of the failure.
4207 Reported by Kaveh Ghazi.
4209 * tests/ls-2/quoting: Add tests.
4210 * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
4211 (_create_file): Don't include $$ in temp file name.
4212 (run_tests): Use shorter suffixes for temp file names.
4214 1998-09-06 Jim Meyering <meyering@ascend.com>
4216 * src/touch.c: Include posixtm.h.
4217 (usage): Correct the description of the format of the
4218 date string argument to -t option.
4219 (main): Update to use rewritten posixtime function.
4220 Reported by Andries Brouwer.
4222 * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
4223 (noinst_HEADERS): Add posixtm.h.
4225 * lib/posixtm.h: New file.
4226 * lib/posixtm.c: New file. Rewritten based on posixtm.y.
4227 * lib/posixtm.y: Remove file.
4229 1998-09-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4231 * src/ls.c (print_dir_name): Put back.
4232 (print_dir): Also print directory name header if print_dir_name is
4235 1998-08-29 Jim Meyering <meyering@ascend.com>
4239 * src/du.c (long_options): Use corresponding short-option character
4240 in place of `1', and `NULL' in place of pointer in initialization.
4241 * src/cp.c (long_opts): Likewise.
4242 * src/ln.c (long_options): Likewise.
4243 * src/mkdir.c (longopts): Likewise.
4244 * src/rmdir.c (longopts): Likewise.
4245 * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
4247 * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
4248 * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
4250 * tests/Fetish.pm: New file -- moved from ls-2/.
4251 * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
4252 * tests/Makefile.am (SUBDIRS): Add dircolors.
4253 (EXTRA_DIST): Add Fetish.pm.
4254 * tests/dircolors: New directory
4256 * src/ls.c (print_dir_name): Remove global variable.
4257 (print_dir): When trace_dirs is set, always print the directory
4260 1998-08-26 Jim Meyering <meyering@ascend.com>
4262 * src/dircolors.c (dc_parse_stream): Don't segfault when a line
4263 contains only one token. Reported by Olav Morkrid.
4265 1998-08-24 Paul Eggert <eggert@twinsun.com>
4267 * src/system.h (CHAR_MIN, CHAR_MAX):
4268 Renamed from SCHAR_MIN, SCHAR_MAX, since these
4269 macros apply to char, not signed char.
4271 * src/df.c, src/du.c, src/touch.c (long_options, main):
4274 1998-08-18 Paul Eggert <eggert@twinsun.com>
4276 Port nanosecond-resolution times to UnixWare 2.1.2 and
4277 pedantic Solaris 2.6.
4279 * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
4280 * acconfig.h (ST_MTIM_NSEC): New #undef.
4281 * src/system.h: (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
4282 Use new ST_MTIM_NSEC macro.
4284 1998-08-16 Jim Meyering <meyering@ascend.com>
4286 * lib/filemode.h (PARAMS): Define and use.
4289 1998-08-15 Jim Meyering <meyering@ascend.com>
4293 * Makefile.maint (announcement): New target.
4295 * tests/mv/into-self: Update to reflect changed behavior of mv.
4296 * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
4297 With prodding from François Pinard :-)
4299 * tests/ls-2/Fetish.pm: New file
4300 * tests/ls-2/run-test: New file
4302 * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
4303 directories (but none of their entries). This makes `cp --archive
4304 --one-file-system' use the same policy `tar --one-file-system' does.
4307 * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
4309 1998-08-14 Jim Meyering <meyering@ascend.com>
4311 * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
4312 Reported by Christian von Roques.
4314 * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
4315 * tests/Makefile.am (SUBDIRS): Add ls-2.
4316 * tests/ls-2: New directory
4318 1998-08-14 Christian von Roques <roques@pond.sub.org>
4320 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
4321 infloop on getmnt(2) returning 0.
4323 * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
4324 not initializing output redirection of : command.
4325 * tests/mv/backup-is-src: Likewise.
4326 * tests/rm/i-1: Likewise.
4328 1998-08-12 Jim Meyering <meyering@ascend.com>
4330 * po/Makefile.in.in: Provide automake-style DESTDIR support.
4331 From Johan Danielsson.
4332 (DISTFILES): Remove ChangeLog.
4333 po/ChangeLog: Remove empty file.
4335 * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
4337 * src/ls.c: Include filemode.h.
4338 * src/chmod.c: Likewise.
4340 * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
4341 From Johan Danielsson.
4342 Protoize. Tsort function definitions and remove prototypes of
4344 (mode_string): Remove prototype.
4345 * lib/filemode.h (mode_string): New file.
4346 * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
4348 1998-08-09 Jim Meyering <meyering@ascend.com>
4352 1998-07-31 Paul Eggert <eggert@twinsun.com>
4354 Add support for filesystems whose timestamps have better resolution
4355 than 1 second (e.g. Solaris 2.6, recent Linux kernels).
4357 * configure.in (AC_STRUCT_ST_MTIM): Add.
4359 * src/copy.c (copy_internal): Compare time stamps with
4360 subsecond resolution if available.
4362 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
4363 rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
4364 stamps with subsecond resolution if available.
4366 * src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
4367 CTIME_CMP, MTIME_CMP): New macros.
4369 1998-08-01 Jim Meyering <meyering@ascend.com>
4371 * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
4373 1998-07-28 Paul Eggert <eggert@twinsun.com>
4375 * lib/mountlist.c (read_filesystem_list): Remove all_fs
4376 argument, but put the necessary information into the result so
4377 that the caller can ignore filesystems that he's not
4380 * lib/mountlist.h (struct mount_entry):
4381 New members me_dummy, me_remote.
4382 (read_filesystem_list): Remove all_fs argument.
4383 (REMOTE_FS_TYPE): Remove.
4384 (ME_DUMMY, ME_REMOTE): New macros.
4386 * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
4388 * src/df.c (show_all_fs):
4389 Revert to boolean value; the old negative value is
4390 now in show_local_fs.
4391 (show_local_fs): New variable.
4392 (show_dev): New args me_dummy and me_class. Use show_local_fs
4393 and boolean show_all_fs in combination with these new args
4394 to decide whether to show a device.
4395 (show_disk): Pass flags to show_dev.
4396 (show_point): Use a non-dummy mount entry if possible.
4397 (show_all_entries): Pass flags to show_dev.
4398 (main): --local sets show_local_fs now. Ask for file system types if
4399 show_local_fs is nonzero, since ME_REMOTE might need them.
4401 1998-07-27 Jim Meyering <meyering@ascend.com>
4403 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
4405 * tests/install/basic-1: Add a test for this.
4406 * src/install.c: Make copy create each destination file initially
4407 with mode 0600 so strip will work, then apply specified mode.
4408 Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
4410 1998-07-25 Jim Meyering <meyering@ascend.com>
4412 * src/mv.c (chown): Remove unused definition.
4413 Reported by Kaveh Ghazi.
4415 * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
4416 Handle that, so --ignore-fail-on-non-empty works.
4417 (EEXIST): Define to zero if not defined.
4418 (ENOTEMPTY): Likewise.
4420 * tests/cp/same-file: Remove `diff' I'd put in for debugging.
4421 Exit with the status from cmp.
4425 * tests/cp/same-file: Skip three more unportable tests.
4426 These failed on SunOS4.1.4.
4428 * src/copy.c (SAME_INODE): Remove definition.
4429 * src/sys2.h (SAME_INODE): Define it here instead.
4431 * src/remove.c (same_file): New function.
4432 (remove_dir): Use it to give a better diagnostic when rmdir fails
4433 because it can't remove the current directory.
4435 * src/df.c (long_options): Changes table entries not to use this form:
4436 {"all", no_argument, &show_all_fs, 1},
4437 but rather this form:
4438 {"all", no_argument, NULL, 'a'},
4439 Using the latter, all the option handling in one place: the getopt loop.
4441 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
4443 (fsp_to_string): Don't xmalloc return value (yet).
4444 (xatoi): Ansideclify.
4445 (fstype_to_string): Ansideclify.
4446 * lib/mountlist.h: Define and use PARAMS macro.
4448 * lib/utime.c: New file.
4449 * src/touch.c (utime_now): Moved into m4/utimes.m4.
4450 (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
4453 * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
4455 1998-07-22 Paul Eggert <eggert@twinsun.com>
4457 * lib/human.c (human_readable): amt -> damt, to fix typo when
4458 computing which power to use after overflow occurs during
4461 * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
4464 1998-07-21 Paul Eggert <eggert@twinsun.com>
4466 Add df -l or --local option.
4467 * doc/fileutils.texi: Document it.
4468 * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
4469 * lib/mountlist.c (read_filesystem_list):
4470 If all_fs is negative, omit non-local filesytems.
4472 * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
4473 (show_all_fs): If negative, omit non-local filesystems.
4474 All uses of (all_fs != 0) changed to (all_fs > 0).
4475 (long_options, usage, main): Add -l or --local option.
4476 (main): When asking for df of an explicit file name, get all
4477 the mount points, so that we're more likely to find it when
4480 1998-07-18 Jim Meyering <meyering@ascend.com>
4482 * src/copy.c (copy_internal): Add another exclusion from the
4483 sameness test: when --force has been specified, the destination
4484 is unlinked before any copy.
4485 (copy_internal): Add yet another: when both src and dest are symlinks.
4487 * tests/touch: New subdir.
4488 * tests/Makefile.am (SUBDIRS): Add touch.
4489 * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
4491 * tests/mv/into-self-2: New test.
4492 * tests/mv/Makefile.am (TESTS): Add into-self-2.
4494 1998-07-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4496 * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
4499 1998-07-16 Jim Meyering <meyering@ascend.com>
4501 Work around failure of chown calls on m68k-motorola-sysv systems.
4502 * src/chown.c: Include lchown.h.
4503 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
4504 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
4505 * lib/lchown.c: Include lchown.h.
4506 Reported by and with suggestions from Manfred Hollstein.
4508 1998-07-12 Paul Eggert <eggert@twinsun.com>
4510 * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
4512 1998-07-07 Jim Meyering <meyering@ascend.com>
4514 * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
4515 Suggestion from Ulrich Drepper.
4517 1998-07-04 Jim Meyering <meyering@ascend.com>
4519 * lib/safe-read.c (safe_read): Change type of pointer parameter to
4520 `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi.
4521 * lib/safe-read.h: Update prototype.
4523 * src/dircolors.c (parse_line): Add casts to avoid errors from
4524 Irix4's `cc' C compiler. From Kaveh Ghazi.
4526 * lib/xstrtol.c: Include stdio.h. Required on some systems when
4527 using assert. From Kaveh Ghazi.
4529 * tests/mv/backup-is-src: Use cmp, not diff.
4530 Reported by Kaveh Ghazi.
4532 1998-07-03 Jim Meyering <meyering@ascend.com>
4536 * src/remove.c (remove_dir): Use fprintf (not error) to avoid
4539 1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
4541 * lib/mountlist.c: (read_filesystem_list):
4542 Don't leak memory on failure.
4543 Don't create a dummy struct mount_entry entry;
4544 use the address-of-the-tail-address method instead.
4545 Preserve errno if possible on failure, setting it to 0 if inapplicable.
4546 Close file descriptor leak if the F_SETLKW failed.
4547 Report an error if SVR4 lock file cannot be opened for some reason
4548 other than a nonexistent lock file.
4550 1998-07-03 Jim Meyering <meyering@ascend.com>
4552 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
4553 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
4554 * acconfig.h (WITH_REGEX): Remove undef.
4555 * lib/Makefile.am (noinst_HEADERS): Add regex.h.
4556 * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
4557 * lib/rx.c: Remove file.
4558 * lib/rx.h: Remove file.
4560 * src/df.c (df_readable): Rename local so as not to shadow global.
4562 * src/copy.c (SAME_INODE): New macro.
4563 Use it to replace open-coded equivalents.
4564 (copy_internal): Rename variable and reverse sense of tests
4565 to make the code a little clearer.
4567 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4569 * src/copy.c (copy_internal): Try harder identifying a relative
4570 symbolic link in the current directory.
4572 * src/copy.c (copy_internal): Don't skip test for same file if
4573 creating a hardlink from symlink over a non-symlink while making
4575 * tests/cp/same-file: Skip tests that depend on link(2) not
4578 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4580 * src/copy.c (copy_internal): Don't call chown on a symlink.
4582 1998-07-01 Jim Meyering <meyering@ascend.com>
4584 * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
4585 configure's --disable-assert option.
4587 1998-06-29 Paul Eggert <eggert@twinsun.com>
4589 * lib/mountlist.c (read_filesystem_list):
4590 Plug file descriptor leak on failure.
4591 Report failure if lock file can't be opened for some reason
4592 other than nonexistence.
4594 1998-06-29 Jim Meyering <meyering@ascend.com>
4598 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
4599 Always close stream and file descriptor before returning.
4601 * src/df.c (main): Move the test of the result of the
4602 read_filesystem_list call up out of if-block -- code in the
4603 else-block depends on it too.
4605 1998-06-29 Paul Eggert <eggert@twinsun.com>
4607 * lib/mountlist.c: (read_filesystem_list): If SVR4, lock
4608 /etc/.mnttab.lock if available, to avoid race conditions
4609 (e.g. with the automounter on Solaris 2.6).
4611 Include <errno.h>, <fcntl.h>, <unistd.h>.
4613 1998-06-29 Jim Meyering <meyering@ascend.com>
4615 * lib/mountlist.c (fstype_to_string): Guard with
4616 #if ! HAVE_F_FSTYPENAME_IN_STATFS.
4618 1998-06-28 Paul Eggert <eggert@twinsun.com>
4620 Add support for new --block-size option and
4621 BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
4622 Adjust df output slightly to accommodate larger filesystems.
4624 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
4625 into one, for convenience. All callers changed.
4626 (human_block_size): New function.
4627 * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
4628 Include <stdlib.h> if HAVE_STDLIB_H;
4629 declare getenv unless HAVE_DECL_GETENV.
4631 Include <argmatch.h>, <error.h>, <xstrtoul.h>.
4632 (DEFAULT_BLOCK_SIZE): New macro.
4633 (block_size_args, block_size_types): New constants.
4634 (humblock): New function.
4635 * lib/xstrtol.h (__ZLONG_MAX): Remove.
4636 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
4637 unsigned long to double without losing information.
4638 (bkm_scale_by_power): New function.
4640 * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
4641 Add support for SI-like suffixes like "GB" and "TD".
4642 * src/dd.c (usage): Describe it.
4644 * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
4645 Remove; replace with new variable output_block_size. All uses changed.
4646 (long_options, usage, main): Add --block-size.
4647 (main, decode_switches): Use new human_block_size function to
4648 initialize output block size consistently with other programs.
4650 * src/df.c (print_header, show_dev): Shrink some columns and expand
4651 others, to squeeze in support for today's larger filesystems.
4652 (print_header): Print output block size using power-of-1024 SI format.
4653 (df_readable): Coalesce last two args into one, for convenience.
4654 All callers changed.
4655 (main): Remove check for portable output format and larger
4656 or human-readable block sizes.
4658 * NEWS, doc/fileutils.texi: Describe above changes.
4660 1998-06-28 Jim Meyering <meyering@ascend.com>
4662 * src/ls.c (usage): Make --kilobytes description consistent with
4663 that in du and df. From Göran Uddeborg.
4665 * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
4666 now that we're using the jm_FSTYPENAME autoconf macro.
4667 James Tanis reported the old version didn't compile on BSDI3.
4669 * configure.in: Move big block of list_mounted_fs checks into
4670 new jm_LIST_MOUNTED_FILESYSTEMS macro.
4671 Use new jm_FSTYPENAME macro.
4673 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
4674 * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
4677 1998-06-27 Jim Meyering <meyering@ascend.com>
4679 * src/copy.c (copy_reg): Detect identical source and dest here.
4680 (copy_internal): Make the test symmetric.
4682 * tests/cp/same-file: New file.
4683 * tests/cp/Makefile.am (TESTS): Add it.
4685 1998-06-26 Jim Meyering <meyering@ascend.com>
4687 * src/remove.c (remove_file): Remove `non-directory' part of
4688 `removing non-directory FILE' verbose message.
4690 1998-06-23 Jim Meyering <meyering@ascend.com>
4692 * src/df.c (show_dev): Increase field width for blocks, used,
4693 and available columns from 7 to 8.
4695 1998-06-21 Jim Meyering <meyering@ascend.com>
4697 * aclocal.m4: Regenerate with fixed gettext.m4 installed.
4698 See README-alpha for details.
4700 1998-06-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4702 * src/automake-wrap: Quote `&' in sed replacement text.
4704 1998-05-31 Jim Meyering <meyering@ascend.com>
4708 * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
4709 Reported by Don Parsons.
4711 1998-05-30 Jim Meyering <meyering@ascend.com>
4713 * tests/ls/time-1: Clean up ctime test. Note that it fails also
4714 on Solaris5.5.1 tmpfs file systems.
4716 Solve the `rm -f rm' problem more cleanly.
4717 * src/.rm-warning: Remove file.
4718 * src/automake-wrap: New file.
4719 * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
4720 (Makefile.in): Depend on automake-wrap.
4721 (EXTRA_DIST): Add automake-wrap.
4722 (DISTCLEANFILES): Remove definition.
4723 (rm_DEPENDENCIES): Likewise.
4724 (.rm-warn-stamp): Remove rule.
4726 1998-05-27 Jim Meyering <meyering@ascend.com>
4728 * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
4729 * tests/ls/rt-1: New file, renamed from cr-1.
4731 1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4733 * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
4735 * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
4738 1998-05-25 Jim Meyering <meyering@ascend.com>
4740 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
4741 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
4742 [!_GNU_SOURCE]: Add #undef instead.
4744 1998-05-24 Jim Meyering <meyering@ascend.com>
4748 * src/ansi2knr.c: Use new version from automake-1.3.
4750 * src/chown.c: Accept new option, --dereference.
4751 --no-dereference is now the default.
4752 (enum Change_status) [CH_NOT_APPLIED]: New member.
4753 (change_symlinks): Enable this by default, now.
4754 (describe_change): Handle new case.
4755 (change_file_owner): Add new parameter: cmdline_arg. Update callers.
4756 Reorganize to reflect changed semantics.
4757 (LCHOWN): Remove definitions.
4759 * lib/lchown.c: New file.
4761 1998-05-21 Jim Meyering <meyering@ascend.com>
4763 * configure.in (ALL_LINGUAS): Add russian (ru).
4765 1998-05-16 Jim Meyering <meyering@ascend.com>
4767 * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
4768 (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
4770 * lib/hash.c (is_prime): Ansideclify.
4771 (next_prime): Ansideclify. Add an assertion.
4773 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
4774 lines from the m4/*.m4 macros, so the hack of including some
4775 custom-replaced C source file names here is no longer needed.
4777 * configure.in (jm_MACROS): New wrapper macro.
4778 Remove uses of most jm_* macros.
4780 * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
4781 as part of utimbuf.m4.
4782 (memcmp): Add #undef.
4784 1998-05-12 Jim Meyering <meyering@ascend.com>
4786 * configure.in: Use my replacement AC_ISC_POSIX rather than
4789 * src/copy.c (copy_internal): Plug a small leak.
4791 1998-05-10 Jim Meyering <meyering@ascend.com>
4793 * src/mv.c (do_move): Remove lots of code that was duplicated in
4794 copy.c (copy), now that copy() has better support for mv. This fixes
4795 a bug with cross-filesystem `mv -i' whereby you could get two prompts
4796 for the same destination file and eventually remove the destination
4797 file even though one of the responses was negative.
4798 Reported by Dirk Lattermann.
4800 * src/copy.h: Better support for mv:
4801 [struct cp_options] (move_mode): New member.
4802 * src/copy.c (copy_internal): Use new move_mode member.
4804 (copy): Add parameter.
4806 * tests/cp/Makefile.am (TESTS): Add backup-is-src.
4807 * tests/mv/Makefile.am (TESTS): Likewise.
4809 * lib/userspec.c: Don't declare strdup if it's defined as a macro.
4810 Reported by Lorne Baker.
4812 * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
4814 * src/mv.c (cp_option_init): Initialize new members.
4815 * src/cp.c (cp_option_init): Likewise.
4816 (main): Set new preserve_* options.
4818 1998-05-09 Jim Meyering <meyering@ascend.com>
4820 * src/copy.h: Support for install:
4821 [struct cp_options] (failed_unlink_is_fatal): New member.
4822 (preserve_owner_and_group): New member.
4823 (preserve_chmod_bits): New member.
4824 (preserve_timestamps): New member.
4825 (preserve): Remove member.
4826 (set_mode): New member.
4828 * src/copy.c (new_nondir_mode): New function. Use where appropriate.
4829 Use more-specific preserve_* members in place of removed `preserve'.
4830 (copy_internal): Honor failed_unlink_is_fatal.
4832 * src/install.c (main): Rewrite argv-handling to be clearer.
4833 (copy_file): Rewrite to use copy.c (copy).
4834 (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
4835 `no_need_to_chown' parameter. Fix caller.
4836 (install_file_in_file): Remove now-unnecessary `to_created' parameter.
4837 (cp_option_init): New function.
4838 Update several functions to take new parameter specifying copy options.
4840 * tests/install: New subdir, with one basic test.
4841 * tests/Makefile.am (SUBDIRS): Add install.
4842 * configure.in (AC_OUTPUT): Add tests/install/Makefile.
4844 * src/dd.c: Include safe-read.h.
4845 Don't declare safe_read.
4846 * src/touch.c: Likewise.
4848 * configure.in (jm_TYPE_SSIZE_T): Use it.
4849 * acconfig.h (ssize_t): Add undef.
4851 1998-05-03 Jim Meyering <meyering@ascend.com>
4853 * po/: Update from gettext-0.10.35.
4855 * configure.in: Remove use of AC_LINK_FILES.
4856 (AC_OUTPUT): Remove po/Makefile-generating sed command.
4858 1998-04-28 Jim Meyering <meyering@ascend.com>
4860 * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
4861 Use unsigned char * pointers, not potentially signed ones, to avoid
4864 1998-04-26 Jim Meyering <meyering@ascend.com>
4866 * configure.in: Use jm_ASSERT.
4867 * acconfig.h: Add NDEBUG.
4869 * src/mv.c: Don't define NDEBUG.
4870 * src/cp.c: Likewise.
4872 1998-04-14 Jim Meyering <meyering@ascend.com>
4874 * src/.rm-warning: New file.
4875 * src/Makefile.am (EXTRA_DIST): Add .rm-warning
4876 (DISTCLEANFILES): Add .rm-warn-stamp.
4877 (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
4878 (.rm-warn-stamp): New rule.
4879 (rm_prep): Comment out rule.
4881 * src/df.c (main): Use STREQ in string equality tests, not strcmp.
4882 * src/dircolors.c (dc_parse_stream): Likewise.
4883 (dc_parse_file): Likewise.
4884 * src/du.c (main): Likewise.
4885 * src/ls.c (decode_switches): Likewise.
4886 * src/remove.c (hash_compare_strings): Likewise.
4887 * src/touch.c (main): Likewise.
4889 1998-04-13 Jim Meyering <meyering@ascend.com>
4891 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
4893 1998-04-11 Jim Meyering <meyering@ascend.com>
4895 * lib/hash.c: Add curly braces around statements in
4896 if/else/while/do/etc. that span more than a line -- even around
4897 multiline simple statements or single-line simple statements
4898 preceded by a comment line.
4900 1998-04-09 Jim Meyering <meyering@ascend.com>
4902 * configure.in: Don't use AC_PATH_PROG to check for perl, now that
4905 1998-04-06 Jim Meyering <meyering@ascend.com>
4907 * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
4908 hash_insert. Also declare to be static.
4909 * src/cp-hash.h (hash_insert): Remove declaration.
4911 * lib/hash.c: Lots of minor spec and name changes, and new comments.
4912 (hash_rehash): Rewrite to be easier on the allocator.
4913 From François Pinard.
4914 * lib/hash.h: More comments.
4915 * src/remove.c: Change names/usage of hash-related functions to work
4918 1998-04-05 Jim Meyering <meyering@ascend.com>
4920 * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
4921 This now depends on HAVE_BTOWC so systems that lack btowc (like
4922 solaris-2.5.1) don't lose.
4924 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
4926 * GNUmakefile: Add conditionals so that running `make' in an
4927 unconfigured source directory will get a reasonable diagnostic.
4929 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
4930 know about the m4/ subdirectory.
4931 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
4932 automake-1.2h and the above change) aclocal-related rules and includes.
4934 1998-04-01 Jim Meyering <meyering@eng.ascend.com>
4936 * tests/ls/cr-1: New file.
4937 * tests/ls/Makefile.am (TESTS): Add cr-1.
4939 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
4941 * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
4942 works with `unsigned char'.
4944 (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
4946 * lib/xstrtol.c: Merge with the version from textutils.
4948 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
4950 1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4952 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
4953 rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
4954 rev_cmp_size): Use file name as secondary sort key to get
4957 1998-03-28 Jim Meyering <meyering@eng.ascend.com>
4959 * src/copy.c: Add copyright.
4960 * src/remove.c: Add copyright.
4961 [_AIX]: Add #pragma alloca.
4963 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
4965 * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
4966 dependency and the := assignment of ACLOCAL to make the default
4967 rule use the `-I m4' option.
4969 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
4971 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
4973 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
4974 automatically handles it.
4976 1998-03-21 Jim Meyering <meyering@eng.ascend.com>
4978 * lib/quotearg.h: Update from patch-2.5.3.
4979 * lib/quotearg.c: Likewise.
4980 * src/ls.c (decode_switches): Pass a null pointer instead of address
4981 of quotearg_quoting_options.
4983 1998-03-19 Paul Eggert <eggert@twinsun.com>
4985 * lib/fsusage.h (struct fs_usage): New member
4986 fsu_bavail_top_bit_set.
4987 * lib/fsusage.c: Include <limits.h>.
4988 (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
4989 (get_fs_usage): If top bit of system variable corresponding to
4990 fsu_bavail is set, then set fsu_bavail_top_bit_set, and
4991 sign-extend the value when storing it into fsu_bavail.
4992 * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
4993 assume the original value corresponding to fsu_bavail was negative.
4994 Reported by Arne Juul.
4996 1998-03-18 Jim Meyering <meyering@eng.ascend.com>
4998 * src/Makefile.am (rm-prep): Add dependency and rule to save users
4999 with `.' too early in their PATH from the `rm: cannot unlink `rm':
5000 Text file busy' error. Suggestion from Philippe De Muyter.
5002 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
5006 * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
5007 * lib/closeout.c: Likewise.
5008 * lib/dirname.c: Likewise.
5009 * lib/euidaccess.c: Likewise.
5010 * lib/fileblocks.c: Likewise.
5011 * lib/filemode.c: Likewise.
5012 * lib/ftruncate.c: Likewise.
5013 * lib/group-member.c: Likewise.
5014 * lib/isdir.c: Likewise.
5015 * lib/long-options.c: Likewise.
5016 * lib/mountlist.c: Likewise.
5017 * lib/path-concat.c: Likewise.
5018 * lib/save-cwd.c: Likewise.
5019 * lib/savedir.c: Likewise.
5020 * lib/strcasecmp.c: Likewise.
5021 * lib/strdup.c: Likewise.
5022 * lib/userspec.c: Likewise.
5023 * lib/yesno.c:: Likewise.
5025 * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
5026 Use #if !, not #ifndef with HAVE_ macros.
5027 * src/chown.c: Likewise.
5028 * src/copy.c: Likewise.
5029 * src/dd.c: Likewise.
5030 * src/dircolors.c: Likewise.
5031 * src/install.c: Likewise.
5032 * src/ls.c: Likewise.
5033 * src/mv.c: Likewise.
5034 * src/touch.c: Likewise.
5036 * configure.in: Use jm_PREREQ.
5038 1998-03-14 Jim Meyering <meyering@eng.ascend.com>
5040 Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
5041 With automake-1.2f, that hack is no longer needed.
5043 * src/remove.c: Use `virtual memory exhausted' message, not
5044 `Memory exhausted' to be consistent with the majority of other
5046 Say `removing all...', not `removing any...'.
5047 * src/rmdir.c (remove_parents): Be consistent with documentation of
5048 --verbose option and with remove.c in saying `removing...' before
5049 the operation is attempted.
5051 Suggestions from Santiago Vila.
5053 * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
5054 (copy_internal): Likewise.
5057 * src/copy.h (copy): Update prototype.
5058 * src/cp.c (do_copy): Add unused arg in calls to copy.
5059 * src/mv.c (do_move): Add ©_into_self arg in call to copy.
5060 Don't remove source directory when copy_into_self is nonzero.
5061 Reported by Arne Henrik Juul.
5063 * tests/mv/into-self: Test for the above.
5064 * tests/mv/Makefile.am (TESTS): Add into-self.
5066 1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
5068 * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
5069 about any arbitrary user and group by pretending to be the user
5070 and to belong to the group specified in `spec_arg' argument.
5072 * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
5073 any arbitrary user name.
5074 (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
5077 1998-02-24 Jim Meyering <meyering@eng.ascend.com>
5079 * lib/xstrtol.c (TYPE_SIGNED): Define.
5080 (TYPE_MAXIMUM): Define.
5081 (ULONG_MAX): Use TYPE_MAXIMUM.
5082 (LONG_MAX): Use TYPE_MAXIMUM.
5084 * lib/fnmatch.c: Update from libit.
5085 * lib/idcache.c: Update from libit.
5087 1998-02-23 Paul Eggert <eggert@twinsun.com>
5089 * lib/quotearg.h, lib/quotearg.c: New files.
5090 * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
5091 (noinst_HEADERS): Add quotearg.h.
5093 * src/ls.c: Include new file quotearg.h.
5094 (enum indicator_style): Rename all to classify, and not_programs
5095 to file_type, to match option spellings. All users changed.
5096 (indicator_style_args): New constant.
5097 (quote_funny_chars, quote_as_string, quote_shell): Remove;
5098 (filename_quoting_options, dirname_quoting_options): Use these
5100 (long_options): Add --indicator-style, --quoting-style,
5101 --show-control-chars. Remove --quote-shell.
5102 (dired_dump_obstack): Remove style parameter and don't output style.
5103 (main): Go back to previous method of outputting //DIRED//
5104 and //SUBDIRED// lines, without style. But add a new
5105 //DIRED-OPTIONS// line that does output style.
5106 (decode_switches, usage): Add --indicator-style, --quoting-style,
5107 --show-control-chars. Remove --quote-shell.
5108 (decode_switches): Default from QUOTING_STYLE environment variable.
5109 Set new quoting vars.
5110 (quote_name): Renamed from quote_filename.
5111 Take new arg specifying quoting options.
5112 Always print; do not have a special case for null FILE * argument.
5113 All callers changed.
5114 Move the guts of this function to new file quotearg.c.
5115 (length_of_file_name_and_frills): Use quotearg_buffer instead
5116 of (old) quote_filename to find length of file name.
5118 (decode_switches, parse_ls_color, print_dir, gobble_file,
5119 get_link_name): Quote output in diagnostics.
5121 * NEWS, doc/fileutils.texi: Describe above changes.
5122 * doc/fileutils.texi: Mention that control characters are output
5123 as question marks if output is a terminal.
5125 1998-02-22 Jim Meyering <meyering@eng.ascend.com>
5129 * ChangeLog-1997: New file.
5130 * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
5132 1998-02-21 Jim Meyering <meyering@eng.ascend.com>
5134 * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
5135 * tests/Makefile.am (SUBDIRS): Add mv.
5136 * tests/mv: New directory
5137 * tests/mv/mv-special-1: New test.
5139 1998-02-20 Jim Meyering <meyering@eng.ascend.com>
5141 * src/touch.c: Include get-date.h.
5142 Remove get_date decl.
5144 * lib/getdate.h: Removed. Could cause confusion with an
5145 automake-generated `.y.h' rule.
5146 * lib/get-date.h: Renamed from getdate.h.
5147 * lib/getdate.y: s/getdate.h/get-date.h/
5148 * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
5150 1998-02-19 Jim Meyering <meyering@eng.ascend.com>
5152 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
5153 * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
5155 1998-02-13 Jim Meyering <meyering@eng.ascend.com>
5157 * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
5158 Otherwise, mv tries to open special files.
5159 Reported by Kjetil Torgrim Homme.
5161 1998-02-08 Jim Meyering <meyering@eng.ascend.com>
5163 * Makefile.maint (cvs-dist): Update po/ to clear modified status
5164 of *.po files before running cvs tag -c.
5166 * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
5169 1998-02-07 Jim Meyering <meyering@eng.ascend.com>
5171 * GNUmakefile: New file.
5172 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
5173 Don't include Makefile.maint from here. It's included from GNUmakefile.
5175 * configure.in: Don't use AM_MAINTAINER_MODE.
5176 (jm_PERL): Use this.
5178 * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen.
5179 (CLEANFILES): Remove dcgen.
5180 (dircolors.h): Use $(PERL).
5183 1998-02-01 Jim Meyering <meyering@na-net.ornl.gov>
5185 * POTFILES.in: Add remove.c. Reported by Santiago Vila.
5187 1998-01-28 Jim Meyering <meyering@na-net.ornl.gov>
5189 * src/df.c (print_header): Tweak format to align heading over
5190 last column of `df -i' output. From Andreas Schwab.
5192 1998-01-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5194 * Makefile.am: Include Makefile.maint from $(srcdir).
5196 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
5200 * Makefile.maint: New file.
5201 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
5202 into Makefile.maint.
5203 Include Makefile.maint.
5204 (EXTRA_DIST): Add Makefile.maint.
5206 * src/cp.c (re_protect): Don't fail for non-root when chown fails
5207 due not only to lack of permission (EPERM), but also to lack of
5208 support (EINVAL). Reported by Bengt Martensson.
5209 * src/copy.c (DO_CHOWN): Likewise.
5211 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
5213 * tests/ls/time-1 (test_failure): Rename does not update ctime;
5214 link does -- so use ln, not mv.
5215 Note that the SunOS4.1.4 failure of the ctime test is expected.
5217 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
5218 bug in Cray C 5.0.3.0 when T == time_t.
5220 * tests/rm/r-1: Adjust expected output for changed format of
5222 * tests/rm/r-2: Likewise.
5224 1998-01-23 Jim Meyering <meyering@na-net.ornl.gov>
5226 * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
5227 C compiler. From Kaveh Ghazi.
5228 (TYPE_MINIMUM): Define.
5229 (TYPE_MAXIMUM): Define.
5230 (TIME_T_MIN): Use TYPE_MINIMUM.
5231 (TIME_T_MAX): Use TYPE_MAXIMUM.
5233 1998-01-22 Jim Meyering <meyering@na-net.ornl.gov>
5235 * src/dd.c: Reorder functions to obviate forward dcls.
5236 (quit): Declare to be inline to stifle compile warning.
5238 * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
5240 * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a
5243 * tests/ls/time-1: Use GNU touch to work around problems with NFS
5244 caching and/or clock skew. Reported by Kaveh Ghazi.
5246 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
5248 * src/Makefile.am (noinst_HEADERS): Add remove.h.
5249 (mv_SOURCES): Define.
5250 (rm_SOURCES): Define.
5252 1998-01-21 Jim Meyering <meyering@na-net.ornl.gov>
5254 * src/install.c: Declare new global, backup_type.
5255 (main): Initialize backup_type unconditionally.
5256 (copy_file): Call find_backup_file_name with new argument, backup_type.
5257 * src/ln.c: Declare new global, backup_type.
5258 (main): Initialize backup_type unconditionally.
5259 (do_link): Call find_backup_file_name with new argument, backup_type.
5261 * src/copy.c (copy_internal): Use x->backup_type, not the global.
5262 (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
5264 * src/copy.h: (VALID_SPARSE_MODE): Define.
5265 [struct cp_options] (backup_type): New member.
5267 * src/cp.c [NDEBUG]: Comment out definition.
5268 (do_copy): Use x->backup_type, not the global.
5270 * src/remove.c: New file. Contains guts of old rm.c.
5271 (remove_init): New function.
5272 (remove_fini): New function.
5273 (rm): Take third argument, specifying options.
5274 * src/remove.h: New file. Associated dcls.
5275 * src/rm.c: Remove and minimally librarify guts for use in mv.c.
5276 (main): Pass options (`&x') to rm.
5277 Call remove_init and remove_fini instead of open-coding them.
5279 * src/mv.c (rm_option_init): New function.
5280 (cp_option_init): New function.
5281 (copy_reg): Remove now-unused function.
5282 (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
5283 Set up for and use `remove.c (rm)' in place of unlink.
5285 1998-01-20 Jim Meyering <meyering@na-net.ornl.gov>
5287 * lib/backupfile.c: Use ANSI function definitions.
5288 Remove global declaration of backup_type.
5289 (simple_backup_suffix): Default to `~', not `.orig'.
5290 Use PARAMS, not __BACKUPFILE_P.
5291 (find_backup_file_name): Add parameter, backup_type.
5292 * lib/backupfile.h: Remove extern declaration of backup_type.
5293 Use PARAMS, not __BACKUPFILE_P.
5294 (VALID_BACKUP_TYPE): Define.
5295 (find_backup_file_name): Adjust prototype.
5297 1998-01-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5299 * src/df.c (print_header): Fix inode format header to line it up
5300 with the rest of the output.
5302 1998-01-13 Jim Meyering <meyering@na-net.ornl.gov>
5304 * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent
5305 with most other implementations.
5307 1998-01-12 Jim Meyering <meyering@na-net.ornl.gov>
5309 * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
5310 Move function-spanning `#if ...BSIZE' directive to follow inclusion
5311 of sys/param.h since BSIZE is sometimes defined in sys/param.h.
5312 Reported by Philippe De Muyter.
5314 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
5318 * src/install.c (install_file_to_path): New function.
5319 FIXME: update fileutils.texi.
5320 (main): Handle new option, -D.
5321 Based on a patch from Marty Leisner.
5322 (usage): Describe -D.
5324 * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
5325 with -l or -t. Now, -u (like -c) implies --sort=time.
5326 (usage): Correct descriptions of --sort, --time, and -t.
5327 Suggestions from Andreas Schwab.
5329 Add test for the above fix.
5330 * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
5331 * tests/Makefile.am (SUBDIRS): Add ls.
5332 * tests/ls: New directory.
5333 * tests/ls/Makefile.am: New file.
5334 * tests/ls/time-1: New file.
5336 * lib/makepath.c (make_path): Reformat 3 if-stmts to test
5337 `if (newly_created_dir)' only once. Suggestion from Andreas Schwab.
5339 1998-01-06 Jim Meyering <meyering@na-net.ornl.gov>
5341 * lib/getdate.y: Move inclusion of getdate.h and dependent extern
5342 declarations down so getdate.h's prototype follows the sometimes-
5343 enabled definition of `const' to nothing. Otherwise, the prototype
5344 wouldn't match the definition because of the defined-away `const'.
5346 (get_date): ANSI-fy definition.
5347 Add %expect directive.
5349 1998-01-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5351 * lib/makepath.c (make_path): Put only newly created directories
5352 on the LEADING_DIRS list.
5354 1998-01-05 Paul Eggert <eggert@twinsun.com>
5356 * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
5357 (get_fs_usage): If a value consists entirely of 1 bits,
5358 propagate this info to the output by setting it to (uintmax_t) -1.
5359 * src/df.c (df_readable): New function.
5360 (show_dev): If a value consists entirely of 1 bits, or is derived
5361 from some other value that consists entirely of 1 bits, report "-".
5362 Check inode and block counts more carefully for plausibility,
5363 to avoid arithmetic overflow when computing percentages.
5365 1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
5369 * lib/Makefile.in: Regenerated with patched automake-1.2d.
5372 * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
5373 the two booleans, verbose and changes_only. This fixes a bug whereby
5374 --change had the same effect as --verbose.
5375 * src/chmod.c: Likewise.
5376 * src/chown.c: Likewise.
5377 Reported by Paul Eggert.
5379 1998-01-04 Paul Eggert <eggert@twinsun.com>
5381 Check for write errors more carefully.
5383 * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
5384 (noinst_HEADERS): Add closeout.h.
5385 * lib/closeout.c, lib/closeout.h: New files.
5386 * lib/long-options.c (parse_long_options),
5387 src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
5388 src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
5389 src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
5390 src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
5391 (main, usage): Check for write error to stdout before exiting.
5392 Include "closeout.h".
5394 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
5396 * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
5397 just like `fsu.fsu_blocks == 0' as an indicator that usage information
5398 is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
5400 * lib/save-cwd.h: Guard PARAMS-enabling definition with
5401 `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
5402 problems with Irix4's cc. From Kaveh Ghazi.
5403 * lib/getdate.h: Likewise, but just to be consistent.
5405 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
5406 those files will be built via the ANSI2KNR-filtering rules if necessary.
5407 Reported by Kaveh Ghazi.
5409 1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
5413 Fix problem with `install -d'. Reported by Marty Leisner.
5415 * src/install.c (get_ids): When otherwise unspecified,
5416 set uid and gid to -1.
5417 * lib/makepath.c (make_path): Try to change ownership only if we've
5418 just created the directory. Fix latent bug (s/&&/||/ in two places --
5419 also, note that it could not be exercised via install or mkdir)
5420 whereby chown would not be invoked when only one of owner/group is
5423 1998-01-01 Jim Meyering <meyering@na-net.ornl.gov>
5425 * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
5426 only once and never free it.
5429 version-control: never