*** empty log message ***
[coreutils.git] / old / fileutils / ChangeLog
blob9b2b60309dca1d0c11482733d744e6ea7a7b3991
1 2001-02-18  Jim Meyering  <meyering@lucent.com>
3         * Version 4.0.41.
5         * depcomp: New version, from automake.
7         `chmod 0 file; rm file' would no longer prompt before removal.
8         * src/remove.c (remove_file): Revert last change.
9         Reported by Vin Shelton.
11 2001-02-17  Jim Meyering  <meyering@lucent.com>
13         * Version 4.0.40.
15         * src/chown.c (main): `quote' the offending argument.
17 2001-02-17  Paul Eggert  <eggert@twinsun.com>
19         Stop trying to support hosts that have nonstandard declarations for
20         mbrtowc and/or mbstate_t.  It's not worth the portability hassle.
22         * m4/mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC.
23         * m4/mbswidth.m4 (jm_PREREQ_MBSWIDTH):
24         Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc).
25         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Likewise.
26         * lib/mbswidth.c, lib/quotearg.c, src/ls.c (mbrtowc, mbsinit):
27         Remove workaround macros for hosts that have mbrtowc but not
28         mbstate_t, as we now insist on proper declarations for both
29         before using mbrtowc.
30         Reported by Matt Schalit.
32 2001-02-17  Jim Meyering  <meyering@lucent.com>
34         * config.sub: Update from master repository.
35         * config.guess: Likewise.
37 2001-02-16  Paul Eggert  <eggert@twinsun.com>
39         * doc/getdate.texi: Mention that only English is supported.
40         Show how to use "date" so that the output is acceptable to getdate.
41         Mention Z as an abbreviation for UTC.
43 2001-02-11  Jim Meyering  <meyering@lucent.com>
45         * Makefile.maint (emit-rsync-commands): Define.
46         (alpha): Use it here.
48 2001-02-10  Jim Meyering  <meyering@lucent.com>
50         * Makefile.maint (alpha): Fix previous, incomplete change.
52         * Version 4.0.39.
54         * depcomp: New version, from automake.
56 2001-02-04  Jim Meyering  <meyering@lucent.com>
58         * README: Remove note about now-ancient Sequents.
60 2001-02-03  Jim Meyering  <meyering@lucent.com>
62         * src/ln.c (main): Change type of index variable to `unsigned int'
63         to avoid a warning.
65         * config.guess: Update from master repository.
67         * Makefile.maint (a_host): Use fencepost.
68         (real_dir): Use the same name for both.
69         (alpha): Print commands for both hosts.
71         * src/mv.c (long_options): Use `strip-trailing-slashes',
72         per the documetation, not `strip-trailing-slash'.
73         * src/cp.c (long_opts): Likewise.
74         Reported by Oskar Liljeblad.
76         * doc/fileutils.texi (mv invocation): Add a warning about how a trailing
77         slash makes a difference.  Prompted by a report from Oskar Liljeblad
78         via Michael Stone (Debian bug#83991).
80 2001-01-31  Jim Meyering  <meyering@lucent.com>
82         * config.sub: Update from master repository.
83         * config.guess: Likewise.
85 2001-01-28  Jim Meyering  <meyering@lucent.com>
87         * Version 4.0.38.
89         * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49c.
91         * src/ls.c (gobble_file): Add a FIXME comment.
93         * TODO: Add a few items.
95         * src/ls.c (enum) [FULL_TIME]: Define.
96         (long_options): Use it.
97         (decode_switches): Make --full-time imply -l.
98         Prompted by a report from Karl Eichwalder.
100 2001-01-22  Jim Meyering  <meyering@lucent.com>
102         * src/remove.c (remove_file): Correct an expression to avoid making
103         an unnecessary call to euidaccess for each file.
105 2001-01-21  Jim Meyering  <meyering@lucent.com>
107         * Version 4.0.37.
109 2001-01-20  Jim Meyering  <meyering@lucent.com>
111         * configure.in: Remove jm_CHECK_ALL_TYPES.
112         Now it's invoked by jm_MACROS.
114 2001-01-17  Jim Meyering  <meyering@lucent.com>
116         * src/sys2.h (case_GETOPT_VERSION_CHAR): Use PACKAGE, not GNU_PACKAGE.
117         * src/sync.c (main): Likewise.
118         * src/shred.c (PACKAGE): Likewise.
119         * src/dd.c (main): Likewise.
121 2001-01-14  Jim Meyering  <meyering@lucent.com>
123         * Version 4.0.36.
125         * src/shred.c (UINT_MAX_32_BITS): Define.
126         Use UINT_MAX_32_BITS in the cpp conditions that determine
127         the `word32' typedef.  Using a literal `0xffffffff' failed with
128         HPUX10.20's /bin/cc.
130         * config.sub: Update from master repository.
131         * config.guess: Likewise.
133 2001-01-02  Volker Borchert  <bt@teknon.de>
135         Work around a broken rename system call, e.g. on SunOS 4.1.1_U1,
136         that fails when the source path has a trailing slash.
137         * src/copy.h [RENAME_TRAILING_SLASH_BUG]: Use the rename wrapper.
138         * tests/mv/trailing-slash: Test whether the workaround works.
139         * tests/m4/Makefile.am (TESTS): Add trailing-slash.
141 2001-01-03  Alexandre Duret-Lutz  <duret_g@epita.fr>
143         * po/Makefile.in.in (update-po): Merge po-files in temporary files
144         in the build directory, and update the source directory only when
145         the merged catalog differs from the original.  This fixes the known
146         `make distcheck' failure due to `make update-po' being called
147         on up-to-date but read-only files.
149 2001-01-13  Jim Meyering  <meyering@lucent.com>
151         * src/copy.c (same_file_ok): When moving a symlink onto itself,
152         don't remove the symlink.  Reported by David Luyer as Debian bug#82089,
153         via Michael Stone.
154         * tests/mv/into-self-4: New test for the above.
155         * tests/mv/Makefile.am (TESTS): Add into-self-4.
157         * tests/chmod/setgid: If `chmod g+s d' fails, then try to chgrp
158         to a group of which we're a member, then try the chmod again.
160 2001-01-11  Jim Meyering  <meyering@lucent.com>
162         * depcomp: New version, from automake.
164 2001-01-10  Jim Meyering  <meyering@lucent.com>
166         * src/copy.c (copy_internal): Add a comment.
167         Set *copy_into_self in the new code that detects that.
168         Make diagnostic more consistent: s/won't/will not/.
169         [move_mode, copy_into_self]: Give a diagnstic here, now that
170         we have the top_level_* globals.  Remove the corresponding diagnostic
171         from mv.c.
172         Add a FIXME comment.
173         * src/mv.c (do_move): Remove diagnostic, now that copy.c issues it.
174         Set `fail' to nonzero in the primary `if (copy_into_self)' block
175         rather than in its own tiny one below.
177         * src/copy.c (copy_internal): Don't allow cp (or mv, when working
178         across a partition boundary) to overwrite a non-directory with a
179         directory.  Reported by Michael J. Croghan.
180         * tests/cp/dir-vs-file: New test for the above.
181         * tests/cp/Makefile.am (TESTS): Add dir-vs-file.
183 2001-01-09  Jim Meyering  <meyering@lucent.com>
185         Give a better diagnostic for `cp -R a a'.
186         * src/copy.c (top_level_src_path, top_level_dst_path): New globals.
187         (copy_internal): Use them.
188         (copy): Set them.
189         * src/cp-hash.c [struct entry] (node): Describe how it's used,
190         now that we've overloaded it, in order to detect and diagnose
191         the copying-directory-into-self problem.
192         (new_file): Remove global.
193         (htab): Declare global to be static.
194         (remember_created): Insert file name instead of dummy pointer, so
195         that copy.c can use the just-created directory name to detect
196         the copying-directory-into-self problem.
197         * tests/cp/into-self: New test for the above.
198         * tests/cp/Makefile.am (TESTS): Add into-self.
200 2001-01-07  Jim Meyering  <meyering@lucent.com>
202         * src/cp.c (usage): Split a string that was longer than 2048 bytes.
204         * doc/perm.texi: s/can not/cannot/
206 2001-01-07  Karl Eichwalder  <ke@suse.de>
208         * src/chown.c (usage): Split long message string.
210 2001-01-07  Karl Eichwalder  <ke@suse.de>
212         * src/ls.c (usage): Untabify.
214         * src/chgrp.c (parse_group): Normalize spelling.
216 2001-01-03  Paul Eggert  <eggert@twinsun.com>
218         * NEWS: Document the planned --full-time change.
219         * doc/fileutils.texi: Likewise.
220         * NEWS: Document that time stamps depend on LC_TIME, not LC_MESSAGES.
222 2001-01-03  Paul Eggert  <eggert@twinsun.com>
224         Use the more precise algorithm of GNU "make" to decide whether
225         a file is in the future, by looking at high-resolution time
226         stamps if available.
228         * src/ls.c:
229         (TIMESPEC_NS): New macro.
230         (current_time): Initialize to the minimum value.
231         (current_time_ns): New var.
232         (main): Do not bother to initialize current_time;
233         it's no longer needed.
234         (get_current_time): New function.
235         (print_long_format): Use it when a file appears to be in the future.
236         Get the nanoseconds of the file's time stamp, if available,
237         and use that to decide whether the file appears to be in the future.
239         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): New macros.
241 2001-01-02  Paul Eggert  <eggert@twinsun.com>
243         * src/ls.c (long_time_expected_width, print_long_format): Fix
244         bug: the initial byte passed to strftime wasn't initialized to
245         a nonzero value after the buffer was reallocated.
247 2001-01-02  Paul Eggert  <eggert@twinsun.com>
249         Make ls -l compatible with POSIX, which requires that the
250         behavior of time formats must depend only on LC_TIME, not on
251         LC_MESSAGES.
253         * po/Makefile.in.in (install-data-yes): If the package is
254         fileutils, install LC_TIME as an alias for LC_MESSAGES.
255         * src/sys2.h (dcgettext): New macro.
256         * src/ls.c (decode_switches): Use dcgettext with LC_TIME,
257         not plain gettext, to get the translations of time formats.
259 2001-01-02  Paul Eggert  <eggert@twinsun.com>
261         * src/ls.c (long_time_expected_width): New function.
262         (print_long_format): Use it, so that we don't assume a
263         particular width for time stamps in an internationalized
264         environment.
266 2001-01-01  Paul Eggert  <eggert@twinsun.com>
268         * doc/fileutils.texi, NEWS:
269         ls -l now reports the year for files even slightly in the future, as
270         POSIX requires.  This helps warn users about clock skew problems.
272         * src/ls.c (print_long_format):
273         Report the year for files even slightly in the future.
274         Avoid overflow problems near Y2038 on 32-bit hosts.
275         To calculate "six months", take half the average Gregorian
276         year, not 180 days.
278 2001-01-01  Jim Meyering  <meyering@lucent.com>
280         * tests/chmod/Makefile.am (TESTS): Add setgid.
281         * tests/chmod/setgid: Test for chmod's existing behavior.
282         Based on a report from Paul Eggert.
284 2000-12-29  Paul Eggert  <eggert@twinsun.com>
286         Clean up the terminology a tad: some directories were called "sticky"
287         when they were really setgid.
288         * tests/Makefile.am (EXTRA_DIST): sticky-check -> setgid-check
289         * tests/chmod/c-option, tests/cp/cp-parents, tests/mkdir/parents,
290         tests/mkdir/perm: Likewise.
291         * tests/setgid-check: File renamed from tests/sticky-check.
292         All uses of "sticky" changed to "setgid".
294 2000-12-31  Jim Meyering  <meyering@lucent.com>
296         * tests/cp/Makefile.am (TESTS): Add deref-slink.
297         * tests/cp/deref-slink: New file.  Test for the bug fixed by my
298         2000-12-28 change to copy.c.
300 2000-12-30  Paul Eggert  <eggert@twinsun.com>
302         * src/ls.c: Improve performance by invoking gettext twice at the start,
303         instead of once for each file.
304         (long_time_format): New var.
305         (decode_switches): Initialize it, if format == long_format.
306         (print_long_format): Use it.
308 2000-12-30  Paul Eggert  <eggert@twinsun.com>
310         * src/ls.c (print_long_format): Don't dump core if strftime
311         returns the empty string.
313 2000-12-30  Paul Eggert  <eggert@twinsun.com>
315         * src/ls.c (gobble_file): If not using long format, don't
316         invoke acl; it's not needed.
318 2000-12-30  Jim Meyering  <meyering@lucent.com>
320         Avoid an unnecessary `stat' when using --dereference.
321         * src/copy.c (same_file_ok): Use stat only if lstat reported that
322         the file was a symbolic link.
324 2000-12-29  Paul Eggert  <eggert@twinsun.com>
326         * doc/perm.texi: append-only directories -> restricted deletion flag,
327         which is the term that POSIX d5 uses for this notion.
329 2000-12-28  Paul Eggert  <eggert@twinsun.com>
331         * tests/group-names: Try /usr/xpg4/bin/id (Solaris 7) if plain
332         'id' doesn't work.
334 2000-12-28  Jim Meyering  <meyering@lucent.com>
336         * tests/cp/cp-parents: Run sticky-check from just-created directory.
338 2000-12-28  Jim Meyering  <meyering@lucent.com>
340         * src/copy.c (same_file_ok): Fix two typos from my 2000-09-03 change:
341         s/tmp_dst_sb/tmp_src_sb/.
343 2000-12-27  Paul Eggert  <eggert@twinsun.com>
345         * tests/sticky-check: Turn off the working directory's sticky
346         bit, so that we don't have to worry about it later.
348         * src/copy.c (same_file_ok): Use a single auto var for
349         tmp_dst_sb, instead of two static vars.  Likewise for
350         tmp_src_sb.
352 2000-12-26  Jim Meyering  <meyering@lucent.com>
354         * Version 4.0.35.
356         * Regenerate build/config framework to use automake-1.4b and
357         the latest CVS version autoconf.
359         * tests/mkdir/perm: Disable the test if the working directory has
360         the sticky bit set.
361         * tests/cp/cp-parents: Likewise.
362         Reported by Nelson Beebe.
364 2000-12-25  Jim Meyering  <meyering@lucent.com>
366         Clean-up to avoid warnings from Irix's c89.
368         * src/remove.c (hash_compare_active_dir_ents): Return explicit `true'
369         or `false', rather than relying on implicit int-to-enum cast.
370         * src/copy.c (same_file_ok): Remove declaration and set of unused
371         variables: src_sb_no_link, dst_sb_no_link.
372         * src/ls.c (extract_dirs_from_files): Remove unused variable.
373         Reported by Nelson Beebe.
375         * src/ls.c (gobble_file): Move decl of local, val, into the scope
376         where it's used.
378 2000-12-24  Jim Meyering  <meyering@lucent.com>
380         For both ln and install, when using `--backup=simple --suffix=S',
381         the suffix `S' wasn't used.
383         * src/ln.c (main): Actually use the local variable,
384         `backup_suffix_string'.
385         * src/install.c (main): Likewise.
386         Nelson Beebe reported the unused variables.
387         * tests/ln/misc: Add a test for this (for all of cp, mv, ln, install).
389         * man/help2man: Update to version 1.24.
391 2000-12-22  Jim Meyering  <meyering@lucent.com>
393         * Version 4.0.34.
395         * src/shred.c (isaac_seed_machdep) [_ARCH_PPC]: Disable the code
396         that would use the PPC mfspr `asm' code.  Suggestion from Michael Stone.
398 2000-12-19  Jim Meyering  <meyering@lucent.com>
400         * doc/fileutils.texi: Use `ref_file' in place of `file' to make
401         descriptions of the various --reference=... options clearer.
403 2000-12-17  Jim Meyering  <meyering@lucent.com>
405         * doc/texinfo.tex: Update from master repository.
406         * config.sub: Likewise.
407         * config.guess: Likewise.
409 2000-12-16  Jim Meyering  <meyering@lucent.com>
411         * src/chown-core.c (uint_to_string): New function.
412         (uid_to_name): Use it.
413         (gid_to_name): Use it.
414         Rename locals, user/group, to uid/gid.
416         * src/chown-core.h (enum Change_status): Start with 1.
418         * src/chown.c (main): Rename locals, user/group, to uid/gid.
419         * src/chgrp.c (main): Rename local, group, to gid.
421         * tests/group-names: New file.
422         * tests/Makefile.am (EXTRA_DIST): Add group-names.
423         * tests/chgrp/basic: Use group-names.
424         * tests/chgrp/deref: Likewise.
425         * tests/chgrp/recurse: Likewise.
427         * tests/chgrp/basic: Don't assume that creating a file gives it
428         group $g1.
430         * tests/chgrp/Makefile.am (TESTS): Add recurse.
432 2000-12-15  Jim Meyering  <meyering@lucent.com>
434         * src/chown-core.h [enum Dereference_symlink] (dereference): Rename
435         from change_symlinks.
436         * src/chown-core.c: Declare lstat.
437         Rename change_symlinks member to `dereference' and use the DEREF_*
438         enum values.
439         (describe_change): Merge the chgrp and chown switch statements.
440         Use xmalloc to form the `user:group' string.
441         (change_file_owner): Record (and later, use) is_symlink and is_directory
442         from the lstat stats, in order to control whether we operate on symlinks
443         and whether (with -R) we traverse symlinks to directories.
444         When dereferencing, use open/fchown (rather than chown) on symlinks.
445         * src/chown.c (main): Reflect renaming: s/dereference/change_symlinks/.
446         * src/chgrp.c (main): Likewise.
448         * src/chown-core.c (describe_change): Use `:' (not `.') to separate the
449         username and group in messages evoked by the --verbose and --changes
450         options.
452 2000-12-09  Jim Meyering  <meyering@lucent.com>
454         * src/Makefile.am (noinst_HEADERS): Add chown-core.h.
455         (chown_SOURCES): Define.
456         (chgrp_SOURCES): Define.
458         * src/chgrp.c: Include "chown-core.h".
459         [enum Change_status, enum Verbosity]: Remove declarations.
460         Remove decls of globals that are now part of struct Chown_option.
461         Remove decl of xstat.
462         (describe_change): Remove function.
463         (change_file_group): Likewise.
464         (change_dir_group): Likewise.
465         (parse_group): Don't set global, groupname, here...
466         (main): ... instead, initialize `chopt.group_name' here.
467         Initialize chopt and update uses of the now-members.
468         Set group_name also when it's obtained via a --reference=FILE option.
469         Call change_file_owner (with -1 for uids), not change_file_group.
471         * src/chown.c: Don't include pwd.h or grp.h -- no longer needed.
472         Include "chown-core.h".
473         [enum Change_status, enum Verbosity]: Remove declarations.
474         Remove decls of globals that are now part of struct Chown_option.
475         (describe_change): Remove function.
476         (change_file_owner): Likewise.
477         (change_dir_owner): Likewise.
478         (main): Initialize chopt and update uses of the now-members.
479         Set user_name and group_name also when they're obtained via a
480         --reference=FILE option.
481         Pass `chopt' to change_file_owner.
483         * src/chown-core.c: Include <pwd.h>, <grp.h>, and "xalloc.h".
484         [!_POSIX_VERSION]: Declare getgrnam and getgrgid.
485         (gid_to_name): New function.
486         (uid_to_name): Likewise.
487         (chopt_free): Likewise.
489         Factor out code that's common to chgrp.c and chown.c.
490         * src/chown-core.h: New file.
491         * src/chown-core.c (chopt_init): New function.
492         (describe_change): Extracted/combined from chgrp.c and chown.c.
493         (change_dir_owner): Likewise.
494         (change_file_owner): Likewise.
495         * po/POTFILES.in: Add src/chown-core.c.
497         * configure.in (AC_OUTPUT): Add tests/chgrp/Makefile.
498         * tests/Makefile.am (SUBDIRS): Add chgrp.
499         * tests/chgrp: New directory.
500         * tests/chgrp/basic: New test.
501         * tests/chgrp/deref: Likewise.
502         * tests/chgrp/Makefile.am: New file.
504         * src/chown.c (change_file_owner): Restore special file permission
505         bits, since calling chown resets them on some systems.
506         Reported by Matt Perry.
508 2000-12-08  Andreas Schwab  <schwab@suse.de>
510         * tests/mv/mv-special-1: Don't make the success of the test depend
511         on the order in which directory entries are processed.
513 2000-12-03  Jim Meyering  <meyering@lucent.com>
515         * src/ls.c (gobble_file) [USE_ACL]: Set have_acl member unconditionally
516         to avoid uninitialized memory reference via FILE_HAS_ACL.
518         * Makefile.maint (alpha): Use rsync rather than scp, so the destination
519         file is created only after the successful completion of the copy.
521 2000-12-02  Jim Meyering  <meyering@lucent.com>
523         * tests/ls/Makefile.am (TESTS): Add follow-slink.
524         * tests/ls/follow-slink: New file.
526 2000-12-01  Paul Eggert  <eggert@twinsun.com>
528         * src/ls.c (gobble_file): Do not fall back on lstat if stat
529         fails; POSIX.2 does not allow this.  Invoke acl only on
530         non-symlinks, and only if lstat or stat succeeds.
532 2000-12-02  Jim Meyering  <meyering@lucent.com>
534         * configure: Regenerate using the very latest version (in CVS) of
535         autoconf.
537         * tests/dd/skip-seek: Remove test #2, now that support for the
538         `B' suffix is gone.
539         * tests/dd/Makefile.am (TESTS): Add skip-seek2
540         * tests/dd/skip-seek2: New file.
542 2000-12-01  Paul Eggert  <eggert@twinsun.com>
544         * src/dd.c (skip, dd_copy): Use ssize_t to store result of
545         safe_read, to avoid overflow e.g. on 64-bit Solaris sparc.
546         (dd_copy): Remove unnecessary cast.
548 2000-12-01  Paul Eggert  <eggert@twinsun.com>
550         * doc/fileutils.texi: Remove B suffix.  Document how to have
551         the desired effect without it.
553         * src/dd.c: Undo most of the changes since 2000-11-24, since we've
554         documented a standard way to do it.
555         (skip_bytes, seek_bytes): Remove.
556         (usage): Remove B suffix.
557         (scanargs, skip, dd_copy, main): Remove support for B suffix.
559 2000-11-28  Jim Meyering  <meyering@lucent.com>
561         * src/mkdir.c (main): Remove any trailing slash unconditionally.
562         Reported by Volker Borchert.
563         * tests/mkdir/t-slash: Add a test for this.
565 2000-11-27  Jim Meyering  <meyering@lucent.com>
567         * Version 4.0.33.
569         * tests/touch/no-rights: Use touch with `-d tomorrow' to avoid a
570         race condition.
572         * tests/Fetish.pm (_compare_files): New function.
573         (_process_file_spec): Likewise.
574         (_at_replace): Likewise.
575         (run_tests): Support new keywords, AUX and CMP and associated
576         syntax and semantics.
578         * config.sub: Likewise.
579         * config.guess: Likewise.
581 2000-11-26  Jim Meyering  <meyering@lucent.com>
583         * src/dd.c (skip): Perform the `records < blocksize' test
584         at the top of the loop, not at the bottom.
586 2000-11-26  Paul Eggert  <eggert@twinsun.com>
588         * src/dd.c (skip): New arg COUNT_BYTES.  Read with BLOCKSIZE
589         bytes, but consider RECORDS to be a byte count if COUNT_BYTES
590         is nonzero.
592 2000-11-25  Paul Eggert  <eggert@twinsun.com>
594         * doc/fileutils.texi: Document seek=nB and skip=nB.
596         * src/dd.c (skip_bytes, seek_bytes): Now booleans, not counts.
597         (seek_records): Renamed from seek_record, for consistency with
598         skip_records and max_records.  All uses changed.
600         (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB
601         and skip=nB.
602         (enum Unit, Unit): Remove.
603         (skip, dd_copy, main): Undo most recent change.
604         (dd_copy, main): Pass blocksize of 1 as appropriate when
605         skip_bytes or seek_bytes is nonzero.
606         (main): Rework ftruncate failure diagnostic to always use byte count.
608 2000-11-25  Jim Meyering  <meyering@lucent.com>
610         * src/dd.c: Add new options, bskip and bseek.
611         Based on a patch from Chris Sylvain.
612         * tests/dd/skip-seek: New tests.
613         * tests/dd/Makefile.am (TESTS): Add skip-seek.
615 2000-11-24  Paul Eggert  <eggert@green.twinsun.com>
617         * src/dd.c (S_TYPEISSHM): New macro.
618         (main): Report failed fstat.
619         Complain only when ftruncate fails on a regular file,
620         a directory, or a shared memory object.
622 2000-11-24  Jim Meyering  <meyering@lucent.com>
624         * src/dd.c: Declare a pointer parameters to be `const' as appropriate.
626         * src/dd.c (main): Use ftruncate only on regular files.
627         Based on a patch from Michael Stone.
628         Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
630 2000-11-23  Jim Meyering  <meyering@lucent.com>
632         * src/df.c (show_point): Before accepting an entry as a match, make
633         sure that the mount directory exists and has the required device number.
634         Before, e.g., `df /floppy' would mistakenly report on the root
635         partition if /floppy were not listed in /etc/mtab but / was.
636         Patch from Eirik Fuller (http://bugs.debian.org/76923).
638         * src/chmod.c (mode_changed): New function.
639         (change_file_mode): Use it to determine accurately when -c should
640         make chmod announce there's been a change.
641         Based on a patch from Michael Stone.
642         Reported by Kai Henningsen as Debian bug #77349.
644         * tests/chmod/c-option: New test for the above fix.
645         * tests/chmod/Makefile.am (TESTS): Add c-option
647         * tests/sticky-check: New file.  Factored out of tests/mkdir/parents.
648         * tests/Makefile.am (EXTRA_DIST): Add sticky-check.
649         * tests/mkdir/parents: Source sticky-check instead of open-coding it.
651 2000-11-19  Jim Meyering  <meyering@lucent.com>
653         * tests/chmod/equal-x: Update to use its own directory, and better trap.
655 2000-11-18  Paul Eggert  <eggert@twinsun.com>
657         * src/ls.c (BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION,
658         INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION,
659         SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum
660         values, to ensure that option values can't collide with chars.
661         (long_options, decode_switches): Use them.
663 2000-11-18  Paul Eggert  <eggert@twinsun.com>
665         * src/sys2.h (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum
666         constants rather than macros.  Use values that cannot conflict
667         with C characters or with -1, CHAR_MAX + 1, etc.
669 2000-11-18  Jim Meyering  <meyering@lucent.com>
671         * src/du.c (count_entry): Don't omit the size of a directory entry
672         merely because we couldn't `chdir' into it.  That would give subtly
673         different results in some cases.  Reported by Mattias Wadenstein
674         via Michael Stone.
676         * src/ls.c: Revert change of 2000-11-11.  It inadvertently change
677         the output format of `ls -l --full-time'.
679         * src/mkdir.c (main): When failing to create a directory, give only
680         one diagnostic, not two.  Reported by Volker Borchert.
682         * src/mkdir.c (main): With --parents, remove any trailing slashes
683         from the argument to the final mkdir call.  Required for NetBSD.
684         Reported by Volker Borchert.
685         * tests/mkdir/t-slash: New test for this.
686         * tests/mkdir/Makefile.am (TESTS): Add t-slash.
688         * tests/mv/mv-special-1: Create and `cd' into temporary directory
689         before anything else.  Reported by Volker Borchert.
691         * configure, config.h.in, Makefile.in, etc.: Regenerate using the
692         very latest version (in CVS) of autoconf.
694 2000-11-17  Jim Meyering  <meyering@lucent.com>
696         * Makefile.am (.NOTPARALLEL): Remove target.
697         * GNUmakefile (.NOTPARALLEL): ... put it here instead, since this
698         file is common to these packages: fileutils, sh-utils, textutils.
700         * Makefile.am (.NOTPARALLEL): New target.  Prevent unwanted parallelism.
701         Suggestion from Ulrich Drepper.
702         * po/Makefile.in.in (Makefile): Likewise.
704         * Makefile.maint (sha1): Define.
705         (announcement): Include SHA1 digest of .tar.gz file.
707 2000-11-14  Jim Meyering  <meyering@lucent.com>
709         * tests/mkdir/perm: Add an `echo' so that the input to the sed command
710         is NL-terminated.  Otherwise, Solaris' /bin/sed generates no output.
711         Reported by Vin Shelton.
713 2000-11-13  Paul Eggert  <eggert@twinsun.com>
715         * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
716         be tested with #ifdef, not with #if.
718 2000-11-12  Jim Meyering  <meyering@lucent.com>
720         * src/ls.c (print_long_format): Remove obsolete comment.
721         From Paul Eggert.
723         * doc/texinfo.tex: Update from master repository.
725 2000-11-11  Paul Eggert  <eggert@sic.twinsun.com>
727         * src/ls.c (<langinfo.h>): Include if HAVE_LANGINFO_H.
728         (DATE_FMT_LANGINFO): New macro, taken from sh-utils/src/date.c.
729         (print_long_format): Use it to determine "date" format.
730         Do not wrap "%b %e %Y" and "%b %e %H:%M" in _(), as it results in
731         incorrect behavior when LC_ALL is unset, LC_TIME is "C", and
732         LC_MESSAGES or LANG is set to something disagreeing with the POSIX
733         locale.
735 2000-11-11  Jim Meyering  <meyering@lucent.com>
737         * Version 4.0.32.
739         * Makefile.maint (GZIP_ENV): Define to --no-name, so the timestamp
740         is not included in the .tar.gz file.
742         * tests/mkdir/perm (tests): Use `empty' (instead of just blanks) to
743         indicate no `-m' option.  Using just blanks wasn't portable to
744         Solaris2.5.1's /bin/sh.
746         * tests/mkdir/perm: Don't put a newline in IFS;  that's not portable to
747         NetBSD's /bin/sh.  Instead, filter newlines and leading/trailing blanks
748         out of `tests' before the `set -'.
750         * Makefile.maint (announcement): Limit depth of ChangeLog `find' to 2.
752         * src/ls.c (print_long_format): Wrap the `--full-time' date format
753         string in _(...), so it too may be internationalized.
754         Suggestion from Jungshik Shin.
756 2000-11-10  Jim Meyering  <meyering@lucent.com>
758         * src/touch.c (main): Interpret a lone numeric argument of 8 or 10
759         digits as a file name, rather than as a date/time in the obsolescent
760         `MMDDhhmm[YY]' format.  Reported by Wenjun Zheng.
761         * tests/touch/obsolescent: New test for this.
762         * tests/touch/Makefile.am (TESTS): Add obsolescent.
764 2000-11-06  Jim Meyering  <meyering@lucent.com>
766         * tests/cp/cp-parents: Move mkdir tests into ../mkdir.
768         * doc/fileutils.texi: Use Free Documentation Licence.
769         Change GNU to @sc{gnu} in many places.
771         * doc/texinfo.tex: Update from master repository.
772         * config.sub: Likewise.
773         * config.guess: Likewise.
774         * man/help2man: Update from latest version: 1.23.
776         * src/mkdir.c: Do not set the permissions of the final directory
777         component if it was not just created.
778         Based on a patch from Volker Borchert.
780         * tests/rwx-to-mode: New file.
781         * tests/Makefile.am (EXTRA_DIST): Add rwx-to-mode.
782         * tests/mkdir/parents: New test for the above mkdir.c fix.
783         * tests/mkdir/Makefile.am (TESTS): Add parents.
784         (TESTS_ENVIRONMENT): Define srcdir=$(srcdir).
786 2000-11-02  Won-kyu Park  <wkpark@chem.skku.ac.kr>
788         * src/df.c (print_header): Mark strings for translation.
790 2000-11-05  Jim Meyering  <meyering@lucent.com>
792         * Version 4.0.31.
794         * configure, config.h.in, Makefile.in, etc.: Regenerate using the
795         very latest version (in CVS) of autoconf.
797         * src/mkdir.c (main): Use make_dir instead of using mkdir directly.
798         Diagnose as failure when mkdir tries to create (without the
799         --parent (-p) option) a directory that already exists.
800         * tests/cp/cp-parents: Add a test for the above fix.
802         * tests/mv/mv-special-1: Clean up this test.
804 2000-11-01  Jim Meyering  <meyering@lucent.com>
806         * Version 4.0.30.
808         * src/chmod.c (main): Better diagnostics.
810 2000-10-31  Jim Meyering  <meyering@lucent.com>
812         * tests/lang-default: Add all the internationalization-related
813         variable names autoconf uses.  Set and export them in a loop.
815         `mkdir -p' would create parent directories with permissions
816         that did not account for the umask. [introduced with the
817         2000-09-30 change that became part of fileutils-4.0.28]
818         * src/mkdir.c: Include dirname.h.
819         Compute the parent directory `mode' unconditionally, effectively
820         as `$(umask -S),u+wx'.
821         Use make_path to create only the parent directories, thus using
822         the same code, both with and without -p, to create the final
823         component in each file name.  Reported by Bob Proulx.
825         Add tests for the above fix.
826         * tests/cp/cp-parents: Add some permission tests.
827         * tests/mkdir/perm: Fix the test so it actually does something.
828         Run each test also with mkdir's `-p' option and check permissions
829         on the parent directories.
831 2000-10-23  Paul Eggert  <eggert@twinsun.com>
833         * doc/getdate.texi: Use @sc where appropriate.  Document the
834         ranges of supported times more precisely.  Correct menu
835         spacing.  Document old Latin 12m/12pm tradition.  Remove list
836         of alphabetic time zone names, as it wasn't correct and people
837         shouldn't be relying on it anyway.  Relative items also
838         account for non-DST adjustments.  Fix some misspellings.
840 2000-10-30  Jim Meyering  <meyering@lucent.com>
842         * configure, config.h.in, Makefile.in, etc.: Regenerate using the
843         very latest version (in CVS) of autoconf.
845 2000-10-29  Jim Meyering  <meyering@lucent.com>
847         * Version 4.0.29.
849         * src/cp.c (do_copy): When constructing dst_path for use with the
850         --parents option, first remove any trailing slashes from the command
851         line argument.  Otherwise, tests/cp/cp-parent would fail on NetBSD.
853         * tests/cp/cp-parents: Add a test.
855         * src/ls.c (DT_INIT): Define.
856         [enum filetype]: Remove the #ifdef, and use DT_INIT on the
857         initializers instead.  `unknown' was undefined for some systems.
858         Reported by John David Anglin.
860         * tests/lang-default (LC_COLLATE): Set it to the empty string and
861         export it.  Otherwise, tests/cp/cp-mv-backup would fail e.g., when
862         LC_COLLATE was set to en.  Reported by Vin Shelton.
864 2000-10-28  Jim Meyering  <meyering@lucent.com>
866         * src/ls.c (main): In call to gobble_file with `"."', use `directory'
867         as the type, not `unknown'.
868         [enum filetype] (arg_directory): Rather than `100', use
869         a number that should never conflict with another DT_* value.
870         From Ulrich Drepper.
872         * Version 4.0.28.
874         Make `ls' a lot more efficient on systems (e.g., linux-2.4.*)
875         that store file type information in directory entries.
877         * src/ls.c [enum filetype] (unknown):
878         Add members (as yet unused):
879         (HAVE_STRUCT_DIRENT_D_TYPE): Define.
880         (format_needs_type): New global.
881         (main): Set it.
882         (print_dir): Set `type' from directory entry, if possible.
883         (gobble_file): Add a parameter, TYPE.
884         Stat the file only if its type is unknown and we need the type.
885         Patch from Ulrich Drepper.
887         Shred can now determine the size of a block devices (e.g. /dev/fd0)
888         by writing until a write operation fails.
890         * src/shred.c: Include assert.h.
891         (fillrand): Add a parameter, size_max.
892         Adjust caller.
893         Add an assertion.
894         (dopass): Break out of the `for (;;)' loop if size < offset.
895         That can happen now that dopass is called with SIZE == -1.
896         (do_wipefd): Accept a length of zero only for a regular file.
897         If lseek fails or returns 0 for a non-regular file, let dopass
898         determine the length.
899         Inspired by a patch from Alan Iwi.
901         * tests/Makefile.am (EXTRA_DIST): Add lang-default.
903         * tests/rm/hash: Factor out the expensive-test-checking code, ...
904         * tests/expensive: ... into this new file.
905         * tests/cp/perm: Disable this test by default; it's expensive.
906         Mark this as an expensive test.
907         * tests/Makefile.am (EXTRA_DIST): Add expensive.
909         * doc/fileutils.texi (shred invocation): Give two examples.
911 2000-10-26  Jim Meyering  <meyering@lucent.com>
913         * doc/getdate.texi (Authors of getdate): Add Paul Eggert.
915 2000-10-23  Jim Meyering  <meyering@lucent.com>
917         * Makefile.am (EXTRA_DIST): Add .prev-version.
919 2000-10-22  Jim Meyering  <meyering@lucent.com>
921         * src/cp.c (make_path_private): Add a FIXME comment.
923         * tests/lang-default: New file.  Set LANG, LC_ALL, and LANGUAGE to ''
924         (rather than to `C') and export them into the environment.
925         Suggestion from Bruno Haible.
927         * tests/cp/backup-is-src: Source lang-default rather than open-coding
928         the setting/exporting of LANG, LC_ALL, and LANGUAGE.
929         * tests/cp/cp-mv-backup: Likewise.
930         * tests/cp/same-file: Likewise.
931         * tests/cp/slink-2-slink: Likewise.
932         * tests/cp/symlink-slash: Likewise.
933         * tests/ln/sf-1: Likewise.
934         * tests/ls/symlink-slash: Likewise.
935         * tests/ls/time-1: Likewise.
936         * tests/mv/backup-is-src: Likewise.
937         * tests/mv/diag: Likewise.
938         * tests/mv/force: Likewise.
939         * tests/mv/hard-link-1: Likewise.
940         * tests/mv/i-2: Likewise.
941         * tests/mv/into-self: Likewise.
942         * tests/mv/into-self-2: Likewise.
943         * tests/mv/into-self-3: Likewise.
944         * tests/mv/mv-special-1: Likewise.
945         * tests/mv/part-symlink: Likewise.
946         * tests/mv/partition-perm: Likewise.
947         * tests/rm/r-1: Likewise.
948         * tests/rm/r-2: Likewise.
950 2000-10-21  Jim Meyering  <meyering@lucent.com>
952         * tests/cp/cp-parents: New test.
953         * tests/cp/Makefile.am (TESTS): Add cp-parents;
955 2000-10-19  Jim Meyering  <meyering@lucent.com>
957         * doc/texinfo.tex: Update from master repository.
958         * config.sub: Likewise.
959         * config.guess: Likewise.
960         * depcomp: Likewise.
962 2000-10-18  Jim Meyering  <meyering@lucent.com>
964         * tests/mv/part-symlink: Make sure the programs use C-locale formats
965         and translations.  Bruno Haible reported that this test would fail
966         when using other locales, because ls printed a translation of `total'.
968 2000-10-16  Jim Meyering  <meyering@lucent.com>
970         * src/ls.c (print_long_format): Wrap date format strings in _(...)
971         so they may be internationalized.  Suggestion from Christian Rose.
973 2000-10-13  Jim Meyering  <meyering@lucent.com>
975         * src/mv.c (rm_option_init): Remove FIXME-maybe comment.
977 2000-09-30  Jim Meyering  <meyering@lucent.com>
979         * tests/du/two-args: Update to use newer template.
981         * src/install.c: Remove big, option-describing comment block.
982         (main): Rename local `symbolic_mode' to `specified_mode'.
984         * src/mkdir.c (main): Don't set the umask to 0 and hand-apply
985         the previously-set umask unconditionally.  Do that only when a
986         MODE has been specified.  Otherwise, call mkdir with the full
987         creation mask (0777 or 0666) and let the kernel apply the umask.
988         The difference shows up only on file systems with ACL support
989         when the containing directory has a default ACL.
990         Patch by Andreas Gruenbacher.
991         (main): Rename local `symbolic_mode' to `specified_mode'.
992         * src/mknod.c (main): Likewise (but `call mknod', not mkdir).
993         Also, when MODE is specified, call chmod to ensure that the
994         permission bits are set as specified even when the containing
995         directory has a default ACL.
996         Patch by Andreas Gruenbacher.
997         * src/mkfifo.c (main): Likewise (but `call mkfifo', not mkdir).
998         Patch by Andreas Gruenbacher.
1000         * tests/mkdir/perm: New test.
1001         * tests/mkdir/Makefile.am (TESTS): Add perm.
1003 2000-08-17  Andreas Gruenbacher  <ag@bestbits.at>
1005         * src/chmod.c (change_file_mode): Perform the chmod even if the
1006         file mode permission bits are the same as those that should be set.
1007         Omitting the chmod call would be alright with minimal 1003.1e DS17
1008         ACLs, but eventually there may be other permissions in addition to
1009         rwx.  E.g., add and delete for directories, and something analogous
1010         to NT's take ownership permission.
1012 2000-09-25  Jim Meyering  <meyering@lucent.com>
1014         * tests/cp/same-file: Don't use `diff -u'.  It's not portable.
1015         Reported by Christian Krackowizer.
1016         * tests/cp/same-file: Run `diff -c' only if cmp finds a difference.
1017         * tests/mv/part-symlink: Likewise.  And clean up.
1019         `shred --exact file1 file2' wouldn't touch `file1'
1020         * src/shred.c (long_opts): --exact doesn't take an argument.
1021         Reported by Alan Iwi.
1022         * tests/shred/exact: New test for this.
1023         * tests/shred/Makefile.am (TESTS): Add exact.
1025         * Makefile.maint (PREV_VERSION): Get the value from a file, rather
1026         than trying to derive it from the current version number.
1027         This is much more robust.
1028         (alpha): Record just-released version number in `.prev-version',
1029         and commit (post-tag).
1031         * Version 4.0.27.
1033 2000-09-24  Paul Eggert  <eggert@twinsun.com>
1035         * doc/fileutils.texi: Update to more closely match changes in 4.0z.
1036         * src/cp.c (usage): Match revised documentation better.
1038 2000-09-24  Jim Meyering  <meyering@lucent.com>
1040         * src/cp.c (main): Tweak a relatively new diagnostic.
1042 2000-09-23  Jim Meyering  <meyering@lucent.com>
1044         * tests/ls/time-1: Output more information when a test fails.
1046 2000-09-22  Jim Meyering  <meyering@lucent.com>
1048         * src/install.c (cp_option_init): Once again make it so install always
1049         unlinks an existing destination before trying to open it for writing.
1050         Otherwise, installing onto a running shared library would make the
1051         running program malfunction.
1052         Reported by Dan Pascu via Michael Stone.
1054         * src/mv.c (do_move): Moving a directory specified with a trailing
1055         slash from one partition to another, and giving it a different
1056         name at the destination would cause mv to get a failed assertion.
1057         Reported by Michael Stone.
1058         (strip_trailing_slashes_2): Move function definition to precede
1059         new first use.
1060         * tests/mv/part-rename: New test for the above fix.
1061         * tests/mv/Makefile.am (TESTS): Add part-rename.
1063         * src/copy.c (copy_internal): Don't try to unlink directories when
1064         using --remove-dest with -R.
1065         * tests/cp/dir-rm-dest: New test for the above fix.
1066         * tests/cp/Makefile.am (TESTS): Add dir-rm-dest.
1068 2000-09-19  Jim Meyering  <meyering@lucent.com>
1070         * doc/fileutils.texi (cp invocation): Describe how --force works.
1071         Update description of -P (soon to change meaning to conform w/POSIX).
1072         Describe --remove-destination.
1074         * src/cp.c (main): When used with --force, each of the --link and
1075         --symbolic-link options now implies --remove-destination.
1076         Reported by Miles Bader via Mike Stone.
1077         * tests/cp/link: New file.  Test for the above fix.
1078         * tests/cp/same-file: Adjust for this change in behavior.
1080 2000-09-15  Volker Borchert  <bt@teknon.de>
1082         * tests/Makefile.am (check-root, root-hint): New targets.
1083         (check-recursive): Depend on root-hint.
1084         * Makefile.am (check-root): New target.
1086 2000-09-16  Jim Meyering  <meyering@lucent.com>
1088         * doc/perm.texi (Changing Special Permissions): Remove this statement:
1089         ``a' in the USERS part of a symbolic mode does not cause the special
1090         permissions to be affected'...  It doesn't reflect what the code does
1091         and isn't required by POSIX.  Reported by aldomel@ix.netcom.com via
1092         Mike Stone.
1094 2000-09-15  Jim Meyering  <meyering@lucent.com>
1096         * config.sub: Update from master repository.
1098 2000-09-10  Jim Meyering  <meyering@lucent.com>
1100         * tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure
1101         that `ls' sorts the same way for everyone.  Reported by Vin Shelton.
1103         * Makefile.maint (b_host): Use freefriends.org, not tug.org.
1105 2000-09-09  Jim Meyering  <meyering@lucent.com>
1107         * Makefile.maint (announcement): Use a stricter regexp for the
1108         previous version.
1110         * Version 4.0z.
1112         * tests/cp/special-bits: New file.
1113         * tests/cp/Makefile.am (TESTS): Add special-bits.
1114         (TESTS_ENVIRONMENT): Propagate $MAKE into environment, for special-bits.
1116         * src/copy.c (SAME_OWNER, SAME_GROUP, SAME_OWNER_AND_GROUP): Define.
1117         (copy_internal): Avoid calling chown if we know it's not necessary.
1119         * src/copy.c (copy_internal): Call chmod also if we've made the
1120         preceding chown call and we're supposed to preserve some special
1121         permission bit(s) that would have been reset by chown.
1122         Reported by Greg Louis.
1124 2000-09-08  Jim Meyering  <meyering@lucent.com>
1126         * src/mkdir.c (S_IRWXUGO): Remove definition.
1127         * src/sys2.h (S_IRWXUGO): Define here, instead.
1129 2000-09-07  Jim Meyering  <meyering@lucent.com>
1131         * doc/texinfo.tex: Update from master repository.
1132         * config.sub: Likewise.
1133         * config.guess: Likewise.
1135 2000-09-05  Jim Meyering  <meyering@lucent.com>
1137         * tests/mv/part-symlink: Redirect stdout to stderr before trying to
1138         remove the temp directory.  Otherwise, the `rm -rf' would get an
1139         error because the output file wouldn't be closed and the directory
1140         wouldn't be `empty'.
1141         * tests/cp/same-file: Likewise.
1143         * tests/cp/same-file: Remove the `cp -dl sl1 sl2' case,
1144         since it's no longer portable (hard link to a symlink).
1145         Likewise for the `cp -bdl symlink foo' case.
1147         * config.guess: Update from master repository.
1149 2000-09-04  Jim Meyering  <meyering@lucent.com>
1151         * src/cp.c: Move declaractions of lstat, stat, and rpl_lstat
1152         as well as the definition of lstat from here...
1153         * src/copy.h: ...to here.
1154         * src/copy.c: Remove declaration of lstat, now that it's in copy.h.
1156         * tests/mv/force: mv's --force (-f) option is no longer needed for
1157         this test, now that all it does is cancel --interactive (-i).
1159         * tests/cp/same-file: Add new tests using cp's --rem option.
1160         Reflect the fact that cp's -f option no longer causes cp to remove the
1161         destination file before trying to open it.
1162         Reflect the fact that `cp -bdl' now makes a backup when copying a
1163         symlink onto the file it points to (FIXME: look into this, and why
1164         cp -bl does *not* do so).
1166         * src/ln.c (do_link): Tweak diagnostics.
1168 2000-09-03  Jim Meyering  <meyering@lucent.com>
1170         * src/install.c (cp_option_init): Initialize new members.
1172         * src/cp.c (enum): Add UNLINK_DEST_BEFORE_OPENING.
1173         [long_options]: Add an entry for --remove-destination.
1174         (usage): Describe --remove-destination.
1175         (do_copy): Use unlink_dest_after_failed_open member, not `force.'
1176         (cp_option_init): Initialize new members.
1177         (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
1179         * src/mv.c: Remove obsolete comment block.
1180         (cp_option_init): Initialize new members.
1181         (usage): Reflect the fact that --force (-f) relates only to whether
1182         mv prompts.
1183         (main): Remove uses of old `force' option member.
1185         * src/install.c (cp_option_init): Reflect
1187         `force' no longer means unlink-dest-before-opening
1188         * src/copy.h (struct cp_options) [force]: Remove member.
1189         [unlink_dest_before_opening]: Add member.  `cp -f' and `mv -f' used to
1190         do this.  Now, you must use `cp --remove-destination' to get this
1191         behavior.  Now, `cp -f' and `mv -f' work as required by POSIX.
1192         [unlink_dest_after_failed_open]: Add member.
1193         Paul Eggert reported that `cp -f' removes an existing destination
1194         file unconditionally, and that is contrary to POSIX.
1196         * src/copy.c (same_file_ok): New function, extracted from copy_internal,
1197         and rewritten.
1198         (copy_internal): Unlink destination file when unlink_dest_before_opening
1199         option is set, and when the source is neither a regular file nor a
1200         directory.
1202         * tests/mv/Makefile.am (TESTS): Add part-symlink.
1204         * src/ls.c: Use strcoll (not strcmp) when comparing file names.
1205         Suggestion from Ulrich Drepper.
1207 2000-08-27  Jim Meyering  <meyering@lucent.com>
1209         * src/copy.c (copy_reg): New parameters: X and NEW_DST.
1210         Remove the SPARSE_MODE parameter.  Update caller.
1211         Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when copying
1212         a regular source file and the destination file exists;  upon failure,
1213         unlink that existing file, then open again, but with O_WRONLY|O_CREAT.
1214         (copy_internal): `force' in not related to interactive; remove
1215         the conjunct.
1216         Remove the entire `else if (x->force)' block;  justifying
1217         removal of the non-directory part is easy:  POSIX requires we try
1218         to open an existing regular file, so we can't unlink it beforehand.
1219         The part that changes the mode on a directory to allow overwriting
1220         isn't necessary.
1222         * src/copy.c (copy_reg): Rename two goto labels.
1223         (copy_internal): Set `new_dst' when the move_mode rename fails,
1224         since we then unlink the destination file.
1226         * src/cp.c (usage): --force is independent of --interactive.
1228 2000-08-24  Jim Meyering  <meyering@lucent.com>
1230         Put back the kluge.  It's necessary after all.
1231         * src/dd.c (buggy_lseek_support): New function.
1232         (skip): Use it.
1233         Frank Adler reported that although _llseek returns 0, lseek
1234         erroneously returns an offset suggesting the operation succeeded
1235         even though it fails.
1237         * install-sh: Double quote as needed, to protect against arguments
1238         containing spaces or shell metacharacters.  Reported by Bruno Haible.
1240 2000-08-23  Jim Meyering  <meyering@lucent.com>
1242         * tests/dd/not-rewound: New test, for the SEEK_CUR vs. SEEK_SET part
1243         of the last change.  Based on Paul's example.
1244         * tests/dd/Makefile.am (TESTS): Add not-rewound.
1246 2000-08-22  Paul Eggert  <eggert@twinsun.com>
1248         * src/dd.c (skip):
1249         Assume lseek failed if it returned zero, since a zero return is
1250         impossible and some buggy drivers return zero.
1252         Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the
1253         file descriptor is not currently rewound.
1255 2000-08-23  Jim Meyering  <meyering@lucent.com>
1257         * src/dd.c: Back out my last change.  Paul's (above) is better.
1259 2000-08-22  Jim Meyering  <meyering@lucent.com>
1261         Don't even try to use lseek on character devices.
1262         * src/dd.c (buggy_lseek_support): New function.
1263         (skip): Use it.
1264         Reported by Martin Gallant via Michael Stone.
1266 2000-08-21  Jim Meyering  <meyering@lucent.com>
1268         * tests/cp/same-file: Clean up traps.  Create files in a subdir.
1270         * install-sh (oIFS): Remove unmatched double quote, left over from
1271         my 2000-08-12 change.  From J. David Anglin.
1273         * Makefile.maint (wget-update): Get the latest version of depcomp.
1275         * depcomp: Update from automake.
1277 2000-08-20  Jim Meyering  <meyering@lucent.com>
1279         * Version 4.0y.
1281         Add support for cp's new POSIX-mandated -H and -L options.
1282         * src/copy.h (enum Dereference_symlink): Define.
1283         (struct cp_options) [dereference]: Change type to Dereference_symlink.
1284         * src/copy.c: Declare lstat.
1285         (copy_dir): Set `xstat' member to lstat so that with `-H' we don't
1286         follow symlinks found via recursive traversal.
1287         Update uses of `dereference' to compare against new enum member names.
1288         * src/cp.c (long_opts): Add --dereference, -L.
1289         (usage): Describe -L and -H.
1290         (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'.
1291         (main): Add `H' and `-L' to getopt spec string.
1292         [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0.
1293         [case 'd']: Likewise.
1294         [case 'H']: New case.
1295         [case 'L']: New case.
1296         [case 'R']: Don't set dereference to `0' here.
1297         If it's not yet defined, set x.dereference to DEREF_NEVER
1298         if -R was specified, else set it to DEREF_ALWAYS.
1299         Set x.xstat accordingly for -H.
1300         * doc/fileutils.texi (cp invocation): Describe -H and -L.
1301         * src/mv.c (cp_option_init): Initialize to DEREF_NEVER, not `0'.
1302         * src/install.c (cp_option_init): Initialize to DEREF_ALWAYS, not `1'.
1304         * tests/cp/Makefile.am (TESTS): Add cp-HL.
1305         * tests/cp/cp-HL: New test.
1307         * src/du.c (print_totals): Rename global from opt_combined_arguments.
1309 2000-08-17  Paul Eggert  <eggert@twinsun.com>
1311         * src/copy.c (DO_CHOWN): Do not make a special case for non-root.
1312         POSIX.2 requires that cp -p and mv attempt to set the uid of the
1313         destination file, even if you're not root.  This affects behavior
1314         only on hosts that let you give files away via chmod.
1315         * NEWS: Describe the above change.
1317 2000-08-15  Jim Meyering  <meyering@lucent.com>
1319         * src/du.c (count_entry): Remember the current directory also for `.'
1320         and `..'.  Reported by Stephen Smoogen, based on a patch from H.J. Lu.
1321         * tests/du/two-args: Add tests for this.
1323 2000-08-14  Jim Meyering  <meyering@lucent.com>
1325         * src/copy.c (copy_reg): Move declaration of local, `n_read', into
1326         the scope where it's used.
1327         (copy_internal): In calling copy_reg, pass not the raw `src_mode',
1328         but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
1330 2000-08-13  Jim Meyering  <meyering@lucent.com>
1332         * src/copy.c (get_dest_mode): Rename from new_nondir_mode.
1333         Honor the umask for `cp', but not for `mv' or `cp -p'.
1334         (copy_reg): New 4th parameter, dst_mode.  Pass it as 3rd arg. to open.
1335         (copy_internal): Change type of locals `src_mode' and `src_type' from
1336         int to mode_t.
1337         Remove unnecessary local, `fix_mode'.
1338         Combine two if-stmts into one.
1339         Pass `src_mode' as 4th arg to copy_reg.
1340         If we've just created a new regular file, return early, skipping the
1341         chmod step.  copy_reg now sets permissions of such files upon creation.
1342         Use get_dest_mode, so there's just one chmod call here.
1344         * tests/cp/Makefile.am (TESTS): Add perm.
1345         * tests/cp/perm: New tests, to help ensure the above didn't
1346         change anything.
1348 2000-08-12  Jim Meyering  <meyering@lucent.com>
1350         * tests/mv/into-self-2: Remove test for the VERSION_CONTROL and/or
1351         SIMPLE_BACKUP_SUFFIX envvars.  Source ../envvar-check instead.
1352         * tests/mv/i-2: Likewise.
1353         * tests/mv/to-symlink: Likewise.
1354         * tests/cp/slink-2-slink: Likewise.
1355         * tests/mv/partition-perm: Likewise.
1356         * tests/cp/cp-mv-backup: Likewise.
1358         * tests/Makefile.am (EXTRA_DIST): Add envvar-check.
1359         * tests/envvar-check: New file.
1361         * install-sh: Remove trailing blanks.
1362         Output diagnostics to stderr, not stdout.
1363         Remove many useless curly braces and double quotes.
1365 2000-08-11  J. David Anglin  <dave@hiauly1.hia.nrc.ca>
1367         * install-sh: Improve error handling.
1368         Do the job even when the target file is `busy' on systems
1369         that don't allow such files to be unlinked.
1371 2000-08-12  Jim Meyering  <meyering@lucent.com>
1373         * README: Remove note about how installation can fail and the
1374         work-around, now that it's all automated.
1376 2000-08-07  Paul Eggert  <eggert@twinsun.com>
1378         * src/cp.c (usage, main): For cp -P messages, mention the new
1379         behavior as well as the old.
1381 2000-08-07  Paul Eggert  <eggert@twinsun.com>
1383         Standardize on "memory exhausted" instead of "Memory exhausted"
1384         or "virtual memory exhausted".
1385         Invoke xalloc_die instead of printing our own message.
1386         * src/chmod.c (main): Likewise.
1387         * src/copy.c (copy_dir, copy_internal): Likewise.
1388         * src/cp.c (do_copy): Likewise.
1389         * src/dircolors.c (xstrndup): Likewise.
1390         * src/install.c (main): Likewise.
1391         * src/ln.c (do_link): Likewise.
1392         * src/mkdir.c (main): Likewise.
1393         * src/mkfifo.c (main): Likewise.
1394         * src/mknod.c (main): Likewise.
1395         * src/mv.c (movefile): Likewise.
1396         * src/remove.c (remove_cwd_entries, rm): Likewise.
1397         * src/shred.c (quotearg_colon, xmalloc):
1398         "virtual memory exhausted" -> "memory exhausted"
1400 2000-08-07  Jim Meyering  <meyering@lucent.com>
1402         * src/cp.c (enum) [PARENTS_OPTION]: New member.
1403         (long_opts): Update "parents" and deprecated "path" entries to use
1404         `PARENTS_OPTION', not `P'.
1405         (usage): Update --help output.
1406         (main): Warn that the meaning of `-P' will soon change.
1408 2000-08-06  Jim Meyering  <meyering@lucent.com>
1410         * doc/fileutils.texi (cp invocation) [-r]: Remove inaccurate mention of
1411         `non-symbolic links'.
1413 2000-08-05  Jim Meyering  <meyering@lucent.com>
1415         * config.guess: Update from master repository.
1416         * config.sub: Likewise.
1418         * Regenerate build/config framework to use the latest CVS versions
1419         of automake and autoconf.
1421 2000-07-31  Jim Meyering  <meyering@lucent.com>
1423         * src/shred.c [!HAVE_CONFIG_H]: Use `virtual memory exhausted', not
1424         `Memory exhausted'.
1426 2000-07-30  Jim Meyering  <meyering@lucent.com>
1428         * src/sys2.h (ISPRINT): Undef before defining to avoid warning.
1430         * src/copy.c (copy_internal): Quote the file names that are displayed
1431         with --verbose and --backup.
1432         * src/remove.c (remove_file): Quote the file names that are displayed
1433         with --verbose.
1434         (remove_dir): Likewise.
1435         * tests/mv/mv-special-1: Add quote marks to match new behavior.
1436         * tests/rm/r-1: Likewise.
1437         * tests/rm/r-2: Likewise.
1439         * src/df.c: Convert "`%s'" in format strings to "%s", and wrap each
1440         corresponding argument in a `quote (...)' call.
1441         * src/dircolors.c: Likewise.
1442         * src/du.c: Likewise.
1443         * src/mkdir.c: Likewise.
1444         * src/mkfifo.c: Likewise.
1445         * src/mknod.c: Likewise.
1446         * src/shred.c: Likewise.
1447         * src/rmdir.c: Likewise.
1448         * src/cp-hash.c: Likewise.
1450         * src/chgrp.c: Convert "`%s'" in format strings to "%s", and wrap each
1451         corresponding argument in a `quote (...)' call.
1452         Add more precise diagnostics.
1453         * src/chmod.c: Likewise.
1454         * src/chown.c: Likewise.
1456         * src/remove.c (remove_cwd_entries): Quote one more file name.
1458         * src/help-version: Remove file.  Move it to ...
1459         * tests/help-version: ...here
1460         * tests/Makefile.am (TESTS): Set to help-version.
1461         (TESTS_ENVIRONMENT): Define.
1462         (EXTRA_DIST): Add $(TESTS).
1463         * src/Makefile.am (EXTRA_DIST): Remove help-version.
1464         (TESTS): Remove definition.
1465         (TESTS_ENVIRONMENT): Remove definition.
1467 2000-07-24  Bruno Haible  <haible@clisp.cons.org>
1469         * src/ls.c: Include <limits.h>, <stdlib.h>, <wchar.h>, <wctype.h>.
1470         (quote_name): Use mbrtowc to step through the filename string while
1471         replacing nonprintables with question marks. Return the screen width,
1472         not the strlen length. Do no output if the out stream is NULL.
1473         (length_of_file_name_and_frills): Use the quote_name return value.
1475 2000-07-25  Jim Meyering  <meyering@lucent.com>
1477         * src/chgrp.c (change_file_group): Save errno from a possibly failed
1478         chown, and use that later.  Otherwise, errno itself could be clobbered
1479         before used.
1480         * src/chmod.c (change_file_mode): Likewise.
1481         * src/chown.c (change_file_owner): Likewise.
1483         * src/mv.c (main): Remove unnecessary "%s" argument.
1485         * src/ln.c: Convert "`%s'" in format strings to "%s", and wrap each
1486         corresponding argument in a `quote (...)' call.
1487         Add more precise diagnostics.
1488         * src/mv.c: Likewise.
1489         * src/cp.c: Likewise.
1490         * src/touch.c: Likewise.
1492 2000-07-23  Jim Meyering  <meyering@lucent.com>
1494         * Version 4.0x.
1496         * src/dd.c (main): Give a better diagnostic for e.g.,
1497         `dd if=/dev/fd0 seek=100000000000'.
1498         Convert "`%s'" in format strings to "%s", and wrap each
1499         corresponding argument in a `quote (...)' call.
1500         Add many, more precise diagnostics.
1502         * src/remove.c (ASSIGN_STRDUPA): Remove macro definition.
1503         * src/sys2.h (ASSIGN_STRDUPA): New macro (moved here from remove.c).
1505         Fix cp so that `cp -r DIR1/ DIR2' works once again.
1506         * src/cp.c (ASSIGN_BASENAME_STRDUPA): New macro.
1507         (do_copy): Use it here (so we always strip trailing slashes before
1508         calling base_name).  Reported by Branden Robinson via Michael Stone.
1510         Test for the above fix.
1511         * tests/cp/Makefile.am (TESTS): Add dir-slash.
1512         * tests/cp/dir-slash: New file.
1514 2000-07-17  Jim Meyering  <meyering@lucent.com>
1516         * Makefile.maint (WGET): Define.
1517         (ftp-gnu): Define.
1518         (wget-update): New rule, based on the one in autoconf.
1520         * src/shred.c (usage): Give a little more info.
1521         Remove a FIXME comment.
1523         Avoid warnings.
1524         * src/ls.c (struct bin_str): Declare `string' member to be `const'.
1525         (put_indicator): Declare local `p' to be `const'.
1527 2000-07-15  Jim Meyering  <meyering@lucent.com>
1529         Begin converting "`%s'" in format strings to "%s", and wrap each
1530         corresponding argument in a `quote (...)' call -- if there's only one.
1531         If there are two or more, then use `quote_n (0, ...),
1532         quote_n (1, ...), ...'.
1534         Here's the justification, from Paul Eggert (thanks, Paul):
1536           [Consider] the following, taken from fileutils/copy.c:
1538              error (0, errno, _("cannot create directory `%s'"), dst_path);
1540           Now, suppose dst_path is "/'\nrm: removing all files under `/"
1541           (expressed in C string syntax).  This will cause the user to see
1542           the following delightfully ambiguous display:
1544             cp: cannot create directory `/'
1545             rm: removing all files under `/'
1547           It would be better to rewrite the above line to be something
1548           like this:
1550             error (0, errno, _("cannot create directory %s"), quote (dst_path));
1552           using the definition of "quote" [in lib/quote.c].  That way,
1553           the user will see the following unambiguous display instead:
1555             cp: cannot create directory `/\'\nrm: removing all files under `/'
1557           One might object that any user who asks to copy a file with
1558           a weird name like that deserves to get confused.  But this
1559           is not a good objection, as the source of the string may not
1560           be under the user's control, or even visible to the user.
1562         * src/copy.c: Adapt format strings and args as above.  Include quote.h.
1563         I have deliberately not changed the output of --verbose.
1564         FIXME: maybe I should.
1565         * src/cp.c: Likewise.
1566         * src/remove.c: Likewise.
1567         * src/install.c: Likewise.  and improve a couple diagnostics.
1569 2000-07-13  Paul Eggert  <eggert@twinsun.com>
1571         * NEWS: Describe --quoting-style=clocale.
1573         * doc/fileutils.texi: New clocale quoting style.
1574         Undo the previous change to the locale quoting style.
1576 2000-07-09  Jim Meyering  <meyering@lucent.com>
1578         * config.guess: Update from FSF.
1579         * config.sub: Likewise.
1581 2000-07-05  Paul Eggert  <eggert@twinsun.com>
1583         * doc/fileutils.texi: Don't use ` and ' for quoting.
1585 2000-07-01  Jim Meyering  <meyering@lucent.com>
1587         * Version 4.0w.
1589         * tests/touch/dangling-symlink: Warn about the problem rather
1590         than failing, on some very recent (at least 2.3.99) versions of
1591         the Linux kernel.  Suggestion from Ulrich Drepper.
1592         * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Define host_triplet
1593         for use in the dangling-symlink test.
1595 2000-06-28  Jim Meyering  <meyering@lucent.com>
1597         * tests/mv/i-2: Don't copy `out' into /tmp.
1599 2000-06-26  Paul Eggert  <eggert@twinsun.com>
1601         Now that savedir.c has been cleaned up...
1602         * src/chgrp.c (change_dir_group): Don't set errno before
1603         invoking savedir, and assume that errno is nonzero if savedir fails.
1604         * src/chmod.c (change_dir_mode): Likewise.
1605         * src/chown.c (change_dir_owner): Likewise.
1606         * src/copy.c (copy_dir): Likewise.
1607         * src/du.c (count_entry): Likewise.
1609 2000-06-26  Paul Eggert  <eggert@twinsun.com>
1611         * src/df.c (show_dev): Round disk usage percentage up, not to
1612         nearest value.  Use integer arithmetic if it's easy.  Fix bug
1613         when converting twos-complement negative values to floating point.
1615 2000-06-25  Jim Meyering  <meyering@lucent.com>
1617         * src/copy.c (copy_internal): Don't return immediately after a failed
1618         copy_dir call -- otherwise, the failure to read a single file in a
1619         source directory would cause the containing destination directory
1620         not to have the owner and/or permissions set properly.
1621         Reported by Piotr and Maciej Kwapulinski.
1622         * tests/cp/fail-perm: Test for it.
1623         * tests/cp/Makefile.am (TESTS): Add fail-perm.
1625         * Version 4.0v.
1627 2000-06-18  Jim Meyering  <meyering@lucent.com>
1629         * README-alpha: Update.
1631 2000-06-17  Jim Meyering  <meyering@lucent.com>
1633         * tests/install/basic-1: Don't fail (just exit 77) if strip doesn't
1634         work.  Suggestion from Ulrich Drepper.
1635         Add canonical trap/mkdir/cd, plus exit portability cruft.
1637 2000-06-16  Jim Meyering  <meyering@lucent.com>
1639         * src/copy.c (copy_reg): Give a slightly better diagnostic upon
1640         open failure.
1642 2000-06-15  Paul Eggert  <eggert@twinsun.com>
1644         * NEWS, doc/fileutils.texi: df, du, and ls now round disk
1645         usage up and disk free space down.
1647         * src/df.c (df_readable): New arg for rounding style.
1648         Round negative numbers correctly.
1649         (show_dev): Round disk usage up and disk free space down.
1651         * src/ls.c: (print_dir, gobble_file, print_long_format,
1652         print_file_name_and_frills): Round disk usage up.
1653         * src/du.c (print_size): Likewise.
1655 2000-06-14  Andreas Schwab  <schwab@suse.de>
1657         * tests/rm/r-1 (framework_failure): Initialize this instead of
1658         test_failure.
1660 2000-06-12  Jim Meyering  <meyering@lucent.com>
1662         * Version 4.0u.
1664         * tests/rm/r-1: Clean up.
1665         Be careful to remove temp directory upon interrupt.
1667         * src/mv.c (main): Give the correct diagnostic when using the
1668         --target-dir=DIR option, but no arguments.
1669         Patch from Michael Stone.  Reported by Herbert Xu.
1670         * tests/mv/diag: New test for this.
1671         * tests/mv/Makefile.am (TESTS): Add diag.
1673 2000-06-08  Brian Youmans  <3diff@gnu.org>
1675         * doc/perm.texi (Multiple Changes): Fix typo.
1676         * doc/fileutils.texi: A few typos and minor formatting fixes.
1677         * doc/getdate.texi: Likewise.
1679 2000-06-06  Jim Meyering  <meyering@lucent.com>
1681         * Makefile.maint (alpha_subdir): Factor out `gnu/fetish'.
1683 2000-06-04  Jim Meyering  <meyering@lucent.com>
1685         * Version 4.0t.
1687         * src/df.c (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]:
1688         Cast undeclared `realpath' to char* to avoid warning.
1690 2000-06-03  Jim Meyering  <meyering@lucent.com>
1692         * src/install.c (usage): Document that -v is a synonym for --verbose.
1693         * src/mkdir.c: Allow -v as synonym for --verbose, to be consistent
1694         with other fileutils.
1695         * src/rmdir.c: Likewise.
1696         Suggestion from François Pinard.
1698 2000-06-02  Jim Meyering  <meyering@lucent.com>
1700         * configure.in (ALL_LINGUAS): Add Danish (da).
1702 2000-05-29  Jim Meyering  <meyering@lucent.com>
1704         Allow `cp -d -u' to copy one symlink onto another that's identical.
1705         * src/copy.c (copy_internal): Change the || to ^ in the big sameness
1706         test, so copying one symlink onto another, identical one doesn't fail
1707         here.
1708         If the symlink call fails, don't report the failure if the destination
1709         already exists and is a symlink pointing to the proper name.
1710         Reported by Andrew Burgess.
1711         * tests/cp/slink-2-slink: New test.
1712         * tests/cp/Makefile.am (TESTS): Add slink-2-slink.
1713         * tests/cp/same-file: Adapt to fit new semantics of `cp -d'.
1715 2000-05-25  Jim Meyering  <meyering@lucent.com>
1717         * src/dd.c (close_stdout_wrapper): Don't dereference NULL pointer.
1718         From Bob Proulx.
1720 2000-05-23  Jim Meyering  <meyering@lucent.com>
1722         * tests/shred/remove: Add traps to clean up.
1723         Correct broken running-as-root test.
1725         * tests/mv/i-2: Exit 77 when run as root.  Reported by Andreas Schwab.
1727 2000-05-20  Jim Meyering  <meyering@lucent.com>
1729         * Version 4.0s.
1731         * tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change.
1733         * tests/rm/r-2: Clean up.
1734         * tests/ls/time-1 (LC_ALL): Set it unconditionally.
1736 2000-05-19  Jim Meyering  <meyering@lucent.com>
1738         Save device number as well as inode number for each directory,
1739         and use both in comparisons.  This makes the directory cycle
1740         test more robust, and closes the small remaining hole whereby
1741         an attacker could subvert a running `rm -r' command.
1743         * src/remove.c (struct active_dir_ent) [st_dev]: New member.
1744         [st_ino]: Rename from `inum'.
1745         (make_active_dir_ent) [device]: New parameter.
1746         (hash_compare_active_dir_ents): Compare using SAME_INODE macro.
1747         (fspec_init_common): New function, factored out.
1748         (fspec_init_file): Initialize have_device member.
1749         (fspec_get_full_mode): Remove parameter.  Update caller.
1750         Set have_device and st_dev members.
1751         * src/remove.h (struct File_spec) [have_device, st_dev]:  New members
1753 2000-05-18  Jim Meyering  <meyering@lucent.com>
1755         * src/remove.c (rm): Combine adjacent fputc and fprintf.
1757         * tests/rm/Makefile.am (TESTS): Add hash.
1758         * tests/rm/hash: New test for the fix in lib/hash.c.
1760 2000-05-17  Jim Meyering  <meyering@lucent.com>
1762         * src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert
1763         a running `rm -r'.  Reported by Morten Welinder.
1765 2000-05-15  Jim Meyering  <meyering@lucent.com>
1767         * src/ln.c (do_link): Use complete strings in diagnostics so they
1768         are easier to translate.  Reported by Michel Robitaille.
1769         (main): Drop support for the case in which S_ISLNK wasn't defined.
1770         It was broken in any case.
1772         * tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the
1773         current locale is not C (POSIX).  From Matthew Clarke.
1775 2000-05-13  Jim Meyering  <meyering@lucent.com>
1777         * src/help-version: New test.
1778         * src/Makefile.am (TESTS): Define.
1779         (TESTS_ENVIRONMENT): Likewise.
1780         (EXTRA_DIST): Add help-version.
1782         * src/chgrp.c: Arrange to call close_stdout only upon exit.
1783         * src/chmod.c: Likewise.
1784         * src/chown.c: Likewise.
1785         * src/cp.c: Likewise.
1786         * src/df.c: Likewise.
1787         * src/dircolors.c: Likewise.
1788         * src/du.c: Likewise.
1789         * src/install.c: Likewise.
1790         * src/ln.c: Likewise.
1791         * src/ls.c: Likewise.
1792         * src/mkdir.c: Likewise.
1793         * src/mkfifo.c: Likewise.
1794         * src/mknod.c: Likewise.
1795         * src/mv.c: Likewise.
1796         * src/rm.c: Likewise.
1797         * src/rmdir.c: Likewise.
1798         * src/shred.c: Likewise.
1799         * src/sync.c: Likewise.
1800         * src/touch.c: Likewise.
1802         * src/dd.c: Include closeout.h.
1803         (usage): Don't call close_stdout here.
1804         (close_stdout_wrapper): New, kludgey, function and file-scoped global.
1805         (main): Register it with atexit.
1807 2000-05-12  Jim Meyering  <meyering@lucent.com>
1809         Unlike for mv, -i doesn't cancel the effect of -f
1810         and -f doesn't cancel the effect of -i.
1811         * src/cp.c (main) ['f']: Don't reset `x.interactive'.
1812         ['i']: Don't reset `x.force'.
1813         * src/copy.c (copy_internal): Fix force and interactive tests.
1814         Patch from Michael Stone, reported by Jeff Sheinberg.
1816 2000-05-09  Jim Meyering  <meyering@lucent.com>
1818         * src/shred.c: Include sys/types.h in shred.c before including
1819         sys/stat.h or system.h.  From John David Anglin.
1821 2000-05-08  Jim Meyering  <meyering@lucent.com>
1823         * tests/shred/remove: Don't use touch in root test.  Instead, append to
1824         the test file, since now touch operates even on files which deny owner
1825         write access.
1827 2000-05-06  Jim Meyering  <meyering@lucent.com>
1829         * src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@.
1831         * src/rmdir.c (EEXIST): Remove now-unused definition.
1832         (ENOTEMPTY): Likewise.
1833         (errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
1834         which is determined by the autoconf test in m4/rmdir-errno.m4.
1836 2000-05-03  Bruno Haible  <haible@clisp.cons.org>
1838         Don't fail when running `make check' with non-`C' locale.
1839         * tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext)
1840         and LC_ALL (for systems which look at LC_MESSAGES).
1841         * tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has
1842         LC_CTYPE or LC_ALL set.  Define it and LANGUAGE before the first use
1843         of sort.
1845 2000-05-03  Jim Meyering  <meyering@lucent.com>
1847         With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro.
1848         * src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup.
1849         * src/dircolors.c: Remove declaration of strndup.
1850         Reported by Bruno Haible.
1852 2000-05-02  Jim Meyering  <meyering@lucent.com>
1854         * src/rm.c (usage): Add the answer to `How do I remove a file named -f?'
1856 2000-05-01  Jim Meyering  <meyering@lucent.com>
1858         * src/install.c (change_attributes): Don't even attempt the chmod
1859         if the chown fails.  Before, when a non-root user ran `install -m 4755
1860         -o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to
1861         the ID of the installing user.  Reported by Marc Olzheim.
1863 2000-04-30  Jim Meyering  <meyering@lucent.com>
1865         * src/touch.c (O_NOCTTY): Define if not defined already.
1866         (touch): Add O_NOCTTY to the flags passed to open.
1868 2000-04-29  Jim Meyering  <meyering@lucent.com>
1870         * Version 4.0r.
1872         * src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat.
1874 2000-04-27  Jim Meyering  <meyering@lucent.com>
1876         Clean up.
1877         * tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR.
1878         * tests/mkdir/p-1: Use mkdir, not $MKDIR.
1879         * tests/mkdir/p-2: Likewise.
1881         * configure.in (AC_OUTPUT): Add tests/du/Makefile.
1882         * tests/Makefile.am (SUBDIRS): Add du.
1883         * tests/du: New directory.
1884         * tests/du/two-args: New test.
1886         * tests/mkdir/special-1: New test.
1887         * tests/mkdir/Makefile.am (TESTS): Add special-1.
1889 2000-04-25  Paul Eggert  <eggert@twinsun.com>
1891         * src/du.c (pop_dir): Remove through_symlink arg; use null cwd
1892         for that purpose instead.
1893         (count_entry): Also save the directory if we're saving more
1894         than one level.
1895         Fix file descriptor and memory leak when chdir fails.
1897 2000-04-26  Jim Meyering  <meyering@lucent.com>
1899         * src/mkdir.c: Rename global: s/path_mode/create_parents/.
1900         (main): No longer perform explicit chmod when creating
1901         parent directories, since make_path now does the chmod.
1903 2000-04-17  Jim Meyering  <meyering@lucent.com>
1905         * src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP.
1906         (enum) [FROM_OPTION]: New member.
1907         (long_options): New getopt spec.
1908         (change_file_owner): Add old_user, old_group parameters.  Use them.
1909         (change_dir_owner): Likewise.
1910         (usage): Describe.
1911         (main): New case.
1912         From Andries Brouwer.
1913         * doc/fileutils.texi (invoking chown): Document it.
1915 2000-04-16  Jim Meyering  <meyering@lucent.com>
1917         * src/cp.c: New option: --strip-trailing-slashes.
1918         (enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
1919         (remove_trailing_slashes): New global.
1920         (long_opts): New getopt spec.
1921         (usage): Describe.
1922         (do_copy): Strip trailing slashes on SOURCE names only if the new
1923         option has been specified.
1924         (main): New case.
1926         * tests/cp/symlink-slash: New test for the change in behavior.
1927         * tests/cp/Makefile.am (TESTS): Add symlink-slash.
1929         * doc/fileutils.texi (Trailing slashes): Factor out discussion on
1930         trailing slashes into its own node.
1931         Cross reference from cp and mv.
1933 2000-04-14  Jim Meyering  <meyering@lucent.com>
1935         * src/touch.c (touch): Add O_NOCTTY to the list of open-time flags.
1937 2000-04-13  Jim Meyering  <meyering@lucent.com>
1939         Move some code into m4/.
1940         * configure.in (_GNU_SOURCE): Don't define here.
1941         (AC_SYS_LARGEFILE): Don't use here.
1942         (AM_C_PROTOTYPES): Don't use here.
1943         * acconfig.h: Remove now-unused file.
1945 2000-04-08  Jim Meyering  <meyering@lucent.com>
1947         * doc/fileutils.texi (cp invocation): Mention that there is an
1948         application for cp's --sparse=never option.  From Martin Hippe.
1949         (cp invocation): Describe how --backup and --force
1950         can be useful together.
1952 2000-03-10  Alan Iwi <iwi@atm.ox.ac.uk>
1954         * src/ls.c: Add support for "ln=target" in the LS_COLORS variable,
1955         to colorize links as for the file/directory pointed to.
1956         * src/dircolors.hin: Add a few words of documentation of the above.
1958 2000-04-08  Jim Meyering  <meyering@lucent.com>
1960         * src/cp.c (usage): Document that while the --backup option takes an
1961         optional argument, the -b option accepts none.
1962         (main): Use `backup type' in call to xget_version, not the
1963         now-deprecated `--version-control'.
1964         * src/install.c: Likewise.
1965         * src/ln.c: Likewise.
1966         * src/mv.c: Likewise.
1968 2000-03-12  Jim Meyering  <meyering@lucent.com>
1970         Merge from textutils.
1971         * src/system.h: (O_BINARY, O_TEXT): Define if necessary.
1972         (SET_BINARY, SET_BINARY2): Define.
1973         (DEV_BSIZE): Define to BBSIZE if appropriate.
1975 2000-03-10  Jim Meyering  <meyering@lucent.com>
1977         * tests/mv/mv-special-1: Make the message more like that in the
1978         similar touch and shred tests.
1979         * tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
1980         bug and `exit 77' if the fifo cannot be created.
1981         Report and suggestion from Volker Borchert.
1983 2000-03-03  Jim Meyering  <meyering@lucent.com>
1985         * po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a
1986         space optimization anyway) to populate $(distdir).  Otherwise, the dist
1987         rules that change permissions would end up affecting the master sources.
1989 2000-03-01  Paul Eggert  <eggert@twinsun.com>
1991         * src/df.c (show_point): Ignore shortcuts based on path
1992         prefixes that are loop file system mount points, since they
1993         yield undesirable output.
1995 2000-02-29  Jim Meyering  <meyering@lucent.com>
1997         * src/ls.c (decode_switches): Remove `e' from getopt_long's list of
1998         option characters.  Reported by John Summerfield.
2000 2000-02-28  Jim Meyering  <meyering@lucent.com>
2002         * tests/install/basic-1: Use ginstall, not install.
2004 2000-02-27  Jim Meyering  <meyering@lucent.com>
2006         * Version 4.0q.
2008         * src/sys2.h: Guard declaration of strtoull also with
2009         `&& HAVE_UNSIGNED_LONG_LONG'.
2011         * src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...'
2012         now that autoconf always defines the HAVE_DECL_ symbols.
2014         * src/install.c (install_file_to_path): Always use install_file_in_file.
2015         Based on a patch from Adam Klein via Michael Stone.
2017         * tests/install/Makefile.am (TESTS): Add create-leading.
2018         * tests/install/create-leading: New file.
2020         * tests/install/basic-1: Clean up.
2021         * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft.
2023 2000-02-26  Jim Meyering  <meyering@lucent.com>
2025         Tranform the generated src/Makefile.in file so it falls back on
2026         using /bin/rm when necessary.  The old rule didn't always work.
2027         This is necessary only on certain losing systems, and because this
2028         package builds an `rm' executable and some people put `.' too
2029         early in their PATH.
2030         * Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment.
2031         (EXTRA_DIST): Add .kludge-stamp.
2032         (.kludge-stamp): New rule.
2033         * src/Makefile.am (AUTOMAKE): Remove definition.
2034         (Makefile.in): Remove dependency on automake-wrap script.
2035         (EXTRA_DIST): Remove automake-wrap.
2036         * src/automake-wrap: Remove file.
2038         * tests/rm/r-2: Don't make the success of the test depend on the
2039         order in which directory entries are processed.
2040         Reported by Andreas Schwab.
2042 2000-02-12  Jim Meyering  <meyering@lucent.com>
2044         * po/POTFILES.in: Add lib/userspec.c.
2046         * doc/fileutils.texi (chown invocation): Deprecate use of `.'.
2048         * src/chown.c (usage): Mention only `:', and not `.' as the separator,
2049         since POSIX allows only the former.
2050         Prompted by a report from Manas Garg.
2052 2000-02-11  Jim Meyering  <meyering@lucent.com>
2054         * src/df.c (main): Count the stat'able arguments.
2055         Print the header line only if there is at least one valid argument.
2056         Reported by Andy Longton <alongton@metamark.com>
2058 2000-02-10  Jim Meyering  <meyering@lucent.com>
2060         Make du work when invoked from an unreadable directory.
2062         * src/du.c (pop_dir): New function.
2063         (count_entry): Factor out common code (pop_dir), and call the new
2064         function instead.
2065         Move declaration of global, `stat_buf' into this function.
2066         (du_files): Don't stat `.' or call save_cwd, since count_entry
2067         never returns with a changed working directory.
2069 2000-02-09  Jim Meyering  <meyering@lucent.com>
2071         * tests/mv/mv-special-1: Use $null and $dir in place of literals
2072         in `here' script.
2073         Exit 77 if we can't set up the framework (Volker Borchert reported
2074         that this test would fail because mknod failed when run on SunOS4.1.4
2075         using NFS-mounted disk from an OpenBSD system).
2077 2000-02-05  Jim Meyering  <meyering@lucent.com>
2079         * src/copy.c (copy_internal): Don't allow mv to move a directory onto
2080         a non-directory.  Reported by Brian Kimball via Michael Stone.
2082 2000-02-03  Jim Meyering  <meyering@lucent.com>
2084         * tests/mv/Makefile.am (TESTS): Add dir-file.
2085         (TESTS_ENVIRONMENT): Remove vestiges of old tests.
2086         * tests/mv/dir-file: New file.
2088 2000-02-02  Jim Meyering  <meyering@lucent.com>
2090         * tests/touch/Makefile.am (TESTS): Add fifo.
2091         * tests/touch/fifo: New file.
2093 2000-02-01  Jim Meyering  <meyering@lucent.com>
2095         * src/touch.c (O_NDELAY): Define to 0 if not defined.
2096         (O_NONBLOCK): Define to O_NDELAY if not defined.
2097         (touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
2098         Reported by Eric G. Miller via Michael Stone.
2100         * man/*.x: Change ." to .\".
2101         Reported by Andreas Schwab and Brendan O'Dea.
2103 2000-01-31  Jim Meyering  <meyering@lucent.com>
2105         * man/Makefile.maint (ginstall_filter): Define.
2106         ($(man_MANS)): Use it here so that the install.1 man page refers
2107         to `install', not `ginstall'.  Reported by Andreas Schwab.
2109 2000-01-30  Jim Meyering  <meyering@lucent.com>
2111         * Version 4.0p.
2113         * configure.in: Move library-related tests into m4/lib-check.m4.
2115         * src/system.h (ST_NBLOCKS): Use st_size only for regular files and
2116         for directories.  From H. J. Lu.
2118         * src/dd.c (main): Exit with nonzero status if ftruncate fails.
2120 2000-01-24  Jim Meyering  <meyering@lucent.com>
2122         * src/ln.c (usage): Describe behavior when LINK_NAME is omitted.
2123         From Michael Stone.
2125         * src/mv.c (main): Don't expect array index `n_files - 1' to evaluate
2126         to `-1' for unsigned int n_files == 0.  Doing so lead to a segfault on
2127         alpha.  From Michael Stone.
2129 2000-01-23  Jim Meyering  <meyering@lucent.com>
2131         * configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.)
2132         Remove nearly all function checks (moved to m4/.)
2133         (AC_SUBST(DF_PROG)): Move this to m4/.
2134         (ftruncate test): Move into new file: m4/ftruncate.m4.
2135         (AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/.
2136         Remove df-related tests.  i.e., move jm_LIST_MOUNTED_FILESYSTEMS,
2137         jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/.
2139 2000-01-22  Jim Meyering  <meyering@lucent.com>
2141         * configure.in: Move addext.c prerequisites from this file into m4/.
2142         (AC_CHECK_HEADERS): Move these checks into m4/.
2144 2000-01-17  Paul Eggert  <eggert@twinsun.com>
2146         * src/dd.c (interrupt_handler): Likewise.
2147         (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
2148         to decide whether to call sigaction; this fixes an old typo.
2150 2000-01-16  Jim Meyering  <meyering@lucent.com>
2152         * lib/Makefile.am: Sync with sh-utils/lib/Makefile.am.
2154         * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME,
2155         jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and
2156         AC_FUNC_ALLOCA.  They're now in m4/.
2158         Sync with the version from emacs-20.5.
2159         * lib/alloca.c
2160         (<string.h>): Include if HAVE_STRING_H.
2161         (<stdlib.h>): Include if HAVE_STDLIB_H.
2162         (alloca): Abort if malloc fails.
2163         Reported by Paul Eggert.
2165 2000-01-15  Jim Meyering  <meyering@lucent.com>
2167         * configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy
2168         memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol
2169         strtoul strverscmp.  Now they're in m4/.
2171 2000-01-12  Jim Meyering  <meyering@lucent.com>
2173         * tests/shred/remove: Make the warning that this shred test may not
2174         be run as root more prominent.  Suggestion from Volker Borchert.
2176 2000-01-11  Paul Eggert  <eggert@twinsun.com>
2178         Quote multibyte characters correctly.
2180         * lib/quotearg.c (ISGRAPH): Remove.
2181         (ISPRINT): New macro.
2182         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
2183         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
2184         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
2185         (quotearg_buffer_restyled): New function, with most of the old
2186         quotearg_buffer's contents.
2187         Major rewrite to support multibyte characters.
2188         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
2190         * m4/c-bs-a.m4: New file.
2191         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
2192         (jm_PREREQ): Use it.
2194 2000-01-11  Paul Eggert  <eggert@twinsun.com>
2196         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned
2197         long, to parse numeric modes.  Check for any unknown bits, not
2198         just unknown bits left of the leftmost known bit.
2200 2000-01-11  Paul Eggert  <eggert@twinsun.com>
2202         * lib/getdate.y: Update copyright notice.
2204 2000-01-11  Paul Eggert  <eggert@twinsun.com>
2206         * COPYING: Sync with latest FSF version (fixing a minor Y2k problem).
2208 2000-01-11  Paul Eggert  <eggert@twinsun.com>
2210         * lib/exclude.c, lib/exclude.h: Sync to the slightly more
2211         general version of GNU tar.
2213         * src/du.c (count_entry):
2214         Adjust to new calling convention for excluded_filename.
2215         (main): Likewise, for add_exclude_file.
2217 2000-01-11  Jim Meyering  <meyering@lucent.com>
2219         * lib/memcpy.c (memcpy): Protoize.
2221         Prepare to sync lib/ directories of fileutils, sh-utils, and textutils.
2222         * lib/Makefile.am: s/fu/fetish/
2223         * src/Makefile.am: s/libfu/libfetish/
2225         * lib/hash.c (hash_initialize): Fix typo in comment.
2226         From François Pinard.
2228 2000-01-10  Jim Meyering  <meyering@lucent.com>
2230         * Version 4.0o.
2232         * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
2234 2000-01-09  Jim Meyering  <meyering@lucent.com>
2236         * Version 4.0n.
2238         * src/ln.c (do_link): Produce the same sort of one-line output for
2239         `--backup --verbose' as cp, mv, install.  Before this, the backup
2240         file name wasn't printed at all.
2242         This affects cp, install, and mv.
2243         * src/copy.c (copy_internal): When making backup files in verbose
2244         mode, print the backup file name on the same line as the rest of the
2245         information, e.g., `a -> b (backup: b.~13~)' rather than on a separate
2246         line by itself.  Suggestion from Karl Berry.
2248 2000-01-08  Jim Meyering  <meyering@ascend.com>
2250         * lib/error.c (error): Use __strerror_r's return value only if
2251         HAVE_WORKING_STRERROR_R.
2252         (error_at_line): Likewise.
2254         * Makefile.maint (null_AM_MAKEFLAGS): Define.
2255         (my-distcheck): Use it to avoid distributing out of date files
2256         whose derivation would require a maintainer tool.
2258 2000-01-07  Jim Meyering  <meyering@ascend.com>
2260         * lib/euidaccess.c: Sync with the GNU C library.
2262         * tests/dir/Makefile.am: (TESTS_ENVIRONMENT): Add `pwd`/ prefix
2263         to exported PATH value (though not strictly necessary, here).
2264         * tests/dd/Makefile.am: Likewise.
2265         * tests/dircolors/Makefile.am: Likewise.
2266         * tests/rm/Makefile.am: Likewise.
2267         * tests/rmdir/Makefile.am: Likewise.
2268         * tests/shred/Makefile.am: Likewise.
2269         * tests/touch/Makefile.am: Likewise.
2270         * tests/shred/Makefile.am: Likewise.
2272 2000-01-06  Jim Meyering  <meyering@ascend.com>
2274         * man/help2man: Import version 1.020.
2276         * lib/strftime.c: Sync with the GNU C Library.
2278 2000-01-06  Paul Eggert  <eggert@set.twinsun.com>
2280         * tar/lib/getdate.y: Sync tm_diff with the GNU C Library.
2281         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
2282         (tm_diff): Renamed from difftm.  All uses changed.
2283         Replace body with that taken from GNU C Library 2.1.3pre1.
2284         (get_date): Prefer tm_gmtoff to tm_diff if available.
2286 2000-01-04  Paul Eggert  <eggert@twinsun.com>
2288         * savedir.c (savedir): Don't store past the end of an array if
2289         name_size is zero and the directory is empty.
2291         * Makefile.maint (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0.
2292         (alpha): Create xdelta diffs.
2294 2000-01-02  Jim Meyering  <meyering@ascend.com>
2296         * Version 4.0m.
2298         * src/mv.c: New option: --strip-trailing-slashes.
2300         1999-11-18  Paul Eggert  <eggert@twinsun.com>
2302         * lib/strftime.c (my_strftime): Some old compilers object to
2303         '\a', so don't bother optimizing for it.
2305 2000-01-01  Paul Eggert  <eggert@twinsun.com>
2307         Fix bug: `df PATH' sometimes misbehaves when there is an
2308         inaccessible mount point unrelated to PATH.
2309         * configure.in (AC_CHECK_FUNCS): Add realpath, resolvepath.
2310         * src/df.c (#pragma alloca): Add if _AIX is defined.
2311         (path-concat.h): Include.
2312         (show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined,
2313         find the real absolute path for PATH, and use that to find the
2314         mount point.
2316         (show_point): Prefer non-dummy entries in shortcuts, too.
2317         Disable bogus mount dirs instead of restatting them each time.
2319 1999-12-30  Jim Meyering  <meyering@ascend.com>
2320         1999-12-17  Kalle Olavi Niemitalo  <tosi@stekt.oulu.fi>
2322         * src/rmdir.c (remove_parents, main): Don't pass errno to error
2323         when printing "removing directory" message.  Failure of rmdir is
2324         handled elsewhere.
2326 1999-12-23  Jim Meyering  <meyering@ascend.com>
2328         * configure.in: Remove clock_gettime tests.
2329         Now they're in m4/jm-macros.m4.
2331         * src/ln.c (usage): Correct typos.
2332         List new --target-directory=... usage.
2333         Reported by Göran Uddeborg
2335         * src/mv.c (usage): List new --target-directory=... usage.
2337 1999-12-22  Jim Meyering  <meyering@ascend.com>
2339         * lib/getdate.y (get_date): Fix typo in time_t overflow test.
2340         From Michael Stone.
2342 1999-12-21  Andreas Schwab  <schwab@suse.de>
2344         * tests/shred/remove: Use $file, not $tmp/file.  Exit 77 if run as
2345         root.
2347 1999-12-20  Paul Eggert  <eggert@twinsun.com>
2349         * src/df.c (ceil_percent): Remove.
2350         (show_dev): Avoid overflow problems when calculating percent.
2351         Do not display negative percents.
2353 1999-12-19  Jim Meyering  <meyering@ascend.com>
2355         * Version 4.0l.
2357         * doc/fileutils.texi: Clarify and combine descriptions of -c and of
2358         --time=ctime.
2359         Likewise for -u/--time=atime.
2361         * src/ls.c [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper.
2362         [Notice the new configure-time test in m4/lstat-slash.m4. ]
2363         (main): Back out change from 1999-02-19 that made ls remove
2364         trailing slashes from command line arguments to accommodate early
2365         versions of Linux.  Now, `ls symlink-to-dir/' acts like
2366         `ls symlink-to-dir/.' thus following the symbolic link, as POSIX says
2367         it should.  Suggestion from Bruno Haible and Andreas Schwab.
2369         * lib/xstat.in (slash_aware_lstat): New function.
2370         (rpl_@xstat@): Use it.
2371         * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
2372         (lstat.c): Likewise.
2374         Make sure ls does the right thing with symlinks and trailing slashes.
2375         * tests/ls/Makefile.am (TESTS): Add symlink-slash.
2376         * tests/ls/symlink-slash: New test, for above-fixed bug.
2378 1999-12-18  Jim Meyering  <meyering@ascend.com>
2380         * src/shred.c (wipename): When repeatedly renaming a file, making the
2381         name shorter and shorter, skip to the next shorter length length if a
2382         rename fails (e.g. due to permission denied).  Otherwise, this loop
2383         would iterate for so long that shred would appear to be stuck in an
2384         infinite loop for any but the shortest file names.
2385         Reported by Joe Orton.
2387         * configure.in (AC_OUTPUT): Add tests/shred/Makefile.
2388         * tests/Makefile.am (SUBDIRS): Add shred.
2389         * tests/shred: New directory
2390         * tests/shred/remove: New file.  Tests for the above-fixed bug.
2392 1999-12-13  Jim Meyering  <meyering@ascend.com>
2394         * lib/makepath.c (make_path): Consistently use `error' to output
2395         the verbose, `created directory ...' messages.
2396         Reported by Bernhard Rosenkraenzer.
2398 1999-12-12  Jim Meyering  <meyering@ascend.com>
2400         Move 120+ lines of stat.h-related macros from system.h (not shared)
2401         to sys2.h, which is shared between fileutils, sh-utils, textutils.
2402         * src/system.h: Move them from here...
2403         * src/sys2.h: ... to here.
2405         * src/system.h (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define
2406         if not defined.  This was necessary on a NeXT Turbostation running
2407         Mach 3.3.  Reported by Nelson H. F. Beebe.
2409         * src/ls.c (decode_switches): If -c or -u is specified and not -l
2410         (or any other option that implies -l), and no sort-type was specified,
2411         then sort by the ctime (-c) or atime (-u).  Part of this change reverts
2412         the 1998-01-10 delta.
2413         (usage): Update to reflect this change.
2414         Reported by Paul Slootman via Michael Stone.
2416 1999-12-09  Jim Meyering  <meyering@ascend.com>
2418         * src/df.c (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define
2419         these and use them instead of `CHAR_MAX + n'.
2420         * src/du.c (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION):
2421         Likewise.
2422         * src/touch.c (TIME_OPTION): Likewise.
2423         * src/rmdir.c (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise.
2425         * tests/ls/time-1: Test more of the framework (touch's -a and -m
2426         options) before running the actual ls test.
2428 1999-12-07  Jim Meyering  <meyering@ascend.com>
2430         * tests/cp/cp-mv-backup: Use 1>&2 rather than `1<&-'.
2431         Suggestion from Volker Borchert.
2433 1999-12-05  Jim Meyering  <meyering@ascend.com>
2435         * Makefile.maint: Remove ftp.enst.fr.
2437 1999-12-04  Jim Meyering  <meyering@ascend.com>
2439         * Version 4.0k.
2441         * tests/mv/into-self-2: Adapt to reflect this change in behavior.
2442         Make sure the VERSION_CONTROL envvar is not set.
2443         Run diff if comparison fails.
2445         * src/copy.c (copy_internal): In move mode, if the rename attempt
2446         fails, then unlink any existing destination file.  This makes a
2447         cross-device `mv' more consistent with the intra-device behavior.
2448         This change is required by POSIX to make a cross-device move act with
2449         semantics similar to those of the rename syscall.  For example now
2450         `mv' can move a file onto a symlink to itself when that symlink
2451         is on a separate partition.  With fileutils-4.0j, it would fail with
2452         a diagnostic saying they were the same file.
2453         Reported by Bruno Haible.
2455         * tests/mv/to-symlink: New file.  Adds test for the above.
2456         * tests/mv/Makefile.am (TESTS): Add to-symlink.
2458         * tests/cp/cp-mv-backup (trap): Be careful to close $actual before
2459         removing the containing directory.  Otherwise, on some systems rmdir
2460         fails to remove the containing directory.
2462         * tests/ls/time-1: List --full-time dates upon failure.
2464 1999-12-02  Andreas Schwab  <schwab@suse.de>
2466         * src/ls.c (check_symlink_color): New variable.
2467         (main): Set it if we need to check for dangling symlinks when
2468         displaying colors.
2469         (gobble_file): Check check_symlink_color instead of print_with_color.
2471 1999-11-30  Paul Eggert  <eggert@twinsun.com>
2473         * src/ls.c (usage): Shorten help for --show-control-chars.
2475 1999-11-30  Jim Meyering  <meyering@ascend.com>
2477         Give the right diagnostic when failing to create a file in an
2478         unwritable directory.
2479         * src/touch.c (touch): Record errno upon failed errno and use that
2480         saved value if a subsequent fstat, stat or utime call fails.
2481         Reported by Wichert Akkerman via Michael Stone.
2483 1999-11-27  Jim Meyering  <meyering@ascend.com>
2485         Clean up test scripts.
2486         * tests/mv/setup: Don't set/use DF or MKDIR.  Use df and mkdir instead.
2487         * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH
2488         * tests/mv/backup-is-src: Likewise for RM and MV.
2489         * tests/mv/hard-link-1: Likewise.
2490         * tests/mv/into-self: Likewise.
2491         * tests/mv/into-self-3: Likewise.
2493         Add test for 1999-05-23 change to src/copy.c (copy_internal).
2494         * tests/mv/partition-perm: New file.
2495         * tests/mv/Makefile.am (TESTS): Add partition-perm.
2497         * Version 4.0j.
2499 1999-11-22  Paul Eggert  <eggert@twinsun.com>
2501         * src/df.c (df_readable): Now returns char const *, not char *.
2502         New arg NEGATIVE.
2503         (ceil_percent): Now returns double, not int.
2504         Be more careful about adding 1 to a wild value.
2505         (show_dev): Don't filter out wild sizes from the underlying operating
2506         system; instead, show them to the user as faithfully as possible.
2508 1999-11-23  Jim Meyering  <meyering@ascend.com>
2510         * doc/getdate.texi (Calendar date item): Correction regarding 0..68/
2511         69-99 split for 1900 vs 2000.  From Peter Moulder.
2513 1999-11-22  Jim Meyering  <meyering@ascend.com>
2515         * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c.
2517 1999-11-20  Jim Meyering  <meyering@ascend.com>
2519         * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate
2520         errno comparison.
2521         (remove_parents): Use it.
2522         (main): Use it.
2524         * tests/cp/cp-mv-backup: Run `diff -c' if the test fails.
2526         * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH.
2527         * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc.
2529         * src/chgrp.c: Declare lstat;  needed on e.g. SunOS4.
2530         Reported by Tom Tromey.
2532 1999-11-19  Jim Meyering  <meyering@ascend.com>
2534         * lib/strstr.c (strstr): Include config.h.
2535         Add a `;' between shloop label and `}'.
2536         From Akim Demaille.
2538 1999-11-17  Jim Meyering  <meyering@ascend.com>
2540         * src/mkdir.c (S_IRWXUGO): Define if necessary.
2541         (main): Use chmod to set the permissions if bits other than those
2542         of S_IRWXUGO were requested.  Reported by Sami Farin.
2544 1999-11-14  Paul Eggert  <eggert@twinsun.com>
2546         * touch.c (touch): Simplify code a tad, using fd == -1 instead
2547         of separate valid_fd variable.
2549 1999-11-13  Jim Meyering  <meyering@ascend.com>
2551         * src/touch.c (touch): Don't fail just because we couldn't open
2552         an existing file.  This makes it so that touching a read-only
2553         file now works.  Also clean up and simplify.
2554         Based on a patch from Chip Salzenberg.
2555         * tests/touch/no-rights: New test for this.
2556         * tests/touch/Makefile.am (TESTS): Add no-rights.
2558 1999-11-12  Jim Meyering  <meyering@ascend.com>
2560         * src/remove.c (print_nth_dir): Write one fewer byte so we don't print
2561         a trailing slash.
2562         (rm): Fix bugs in (and test, this time) the very rarely used code
2563         to warn about directory cycles.
2564         Reported by michael@roka.net.
2566 1999-11-11  Jim Meyering  <meyering@ascend.com>
2568         * src/copy.c (copy_internal): Treat src and dest as the `same' in
2569         `mv src symlink-to-src' when src and dest are on different partitions.
2570         Otherwise, that `mv' command would silently remove `src'.
2571         Reported by Michael Stone.
2572         * tests/mv/into-self-2: Add a test for this fix.
2574         * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others
2575         just like that also dated back to 1992 were fixed in 1998-01-02).
2576         Richard Braakman reported that using `install -d -g foo 1/2`
2577         only sets the group on the intermediate directory, not the final
2578         component.  From Michael Stone.
2580 1999-11-07  Paul Eggert  <eggert@set.twinsun.com>
2582         * human.c (default_block_size): New function.
2583         (humblock): Use it if no block size is specified.
2584         (human_block_size): If the specified block size is zero, report an
2585         error if report_errors is nonzero; otherwise use the default.
2587 1999-11-07  Jim Meyering  <meyering@ascend.com>
2589         * src/dircolors.hin: Add several more TERM types.
2590         Add .bz2 suffix.
2591         Add .png for real this time.
2592         Change the image types colors to be visible in a black-on-white xterm.
2593         From Michael Stone.
2595         * src/chgrp.c (xstat): New global.
2596         (main): Define it.
2597         (change_file_group): Use it.  Before this change, when running chgrp
2598         on a symlink without --dereference (-h) and when the requested group
2599         is the same as the group for the *symlink*, chgrp would do nothing.
2600         Now it changes the group of the file referenced through the symlink.
2601         Reported by Martin Mitchell.
2603         * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
2604         * src/chown.c: Define and use REFERENCE_FILE_OPTION and
2605         DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
2606         * src/chgrp.c: Likewise.
2608         * tests/ln/misc: Add hard-link-to-symlink test.
2609         Move framework_failure test to the end.
2610         Fix a typo: s/||/&&/.
2612         * src/ln.c (do_link): Warn that making a hard link to a symbolic link
2613         is not portable.
2615         * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'.
2616         * tests/ln/backup-1: Likewise.
2618         * configure.in (AC_OUTPUT): Add tests/rmdir/Makefile.
2619         * tests/Makefile.am (SUBDIRS): Add rmdir.
2620         * tests/rmdir: New directory
2621         * tests/rmdir/ignore: New file.
2623         * src/rmdir.c (remove_parents): Use the correct test (just as in
2624         main) in handling --ignore-fail-on-non-empty.  From Michael Stone.
2625         (usage): Improve description of --parents.  Based on suggestion from
2626         Torsten Landschoff.
2628 1999-11-06  Jim Meyering  <meyering@ascend.com>
2630         Allow hard links to symlinks on systems that support it.
2631         * src/ln.c (STAT_LIKE_LINK): Define.
2632         (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
2633         the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
2635         * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is
2636         accepted as the short form of --file-type, per the documentation.
2637         From James Sneeringer.
2639         * src/ln.c (do_link): Fix typo (in which the function name `symlink'
2640         was tested instead of the variable `symbolic_link') that could make
2641         ln perform an unneeded `stat' call.
2643 1999-11-05  Jim Meyering  <meyering@ascend.com>
2645         * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated
2646         HAVE_ST_BLOCKS.
2647         * src/copy.c: Likewise.
2648         * lib/fileblocks.c: Likewise.
2650         * configure.in: Move some type/header/member tests into
2651         m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
2652         fileutils, textutils, and sh-utils.
2654 1999-11-02  Jim Meyering  <meyering@ascend.com>
2656         * man/help2man: Import version 1.018.
2657         * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
2658         * man/*.x: Include one-line summary in [NAME] section.
2659         * man/Makefile.summ: Remove the one-line summaries.
2660         Suggestion for clean-up from Akim Demaille.
2662         * configure.in (ALL_LINGUAS): Add Galician (gl).
2664 1999-11-01  Jim Meyering  <meyering@ascend.com>
2666         * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and
2667         other special files like /dev/zero.
2669         * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2671 1999-10-31  Jim Meyering  <meyering@ascend.com>
2673         * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around
2674         automake bug.
2676         * doc/fileutils.texi: Document new --backup[=METHOD] option for
2677         cp, mv, ln, and install.
2679         * src/ln.c: Convert --backup to take an optional argument.
2680         Deprecate --version-control (-V) in comments.
2681         (usage): Remove mention of --version-control.
2682         (main): Make -V warn then fall through into --backup case.
2683         [--backup case]: Handle optional arg.
2684         * src/install.c: Likewise.
2686 1999-10-24  Jim Meyering  <meyering@ascend.com>
2688         * src/cp.c (do_copy): Constify `dest', and cast-away the new
2689         const in assignment to new_dest.
2691 1999-10-23  Jim Meyering  <meyering@ascend.com>
2693         * tests/touch/Makefile.am (TESTS): Add dangling-symlink.
2694         * tests/touch/dangling-symlink: New file.
2696 1999-10-23  Paul Eggert  <eggert@twinsun.com>
2698         * src/touch.c (full_write): Remove unused decl.
2699         (open_maybe_create): Remove.
2700         (touch): Don't record whether the file was created; this isn't
2701         possible to do reliably and portably without race conditions.
2702         If the file was created and if amtime_now is nonzero, this
2703         change means we'll have to do another utime system call, but
2704         that's no more harmful than the previous version of this code.
2705         Reported by Gabor Z. Papp.
2707 1999-10-21  Jim Meyering  <meyering@ascend.com>
2709         * configure.in (ALL_LINGUAS): Add Japanese (pa).
2711 1999-10-17  Jim Meyering  <meyering@ascend.com>
2713         * tests/mv/backup-is-src: Remove use of mv's now-deprecated
2714         -V option.  Use --b=simple instead of -b -V simple.
2716         * src/mv.c: Convert --backup to take an optional argument.
2717         Deprecate --version-control (-V) in comments.
2718         (usage): Remove mention of --version-control.
2719         (main): Make -V warn then fall through into --backup case.
2720         [--backup case]: Handle optional arg.
2722         Accept new option: --target-directory=DIR
2723         * src/cp.c (TARGET_DIRECTORY_OPTION): Define.
2724         (SPARSE_OPTION): Define.
2725         (usage): Describe it.
2726         (do_copy): Change meanings/names of first two parameters: use `n_files'
2727         in place of `argc - optind', and `file' instead of `argv + optind'.
2728         Add parameter, target_directory.
2729         (main): Pass new arg, target_directory.
2731 1999-10-16  Jim Meyering  <meyering@ascend.com>
2733         * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option.
2734         Use --b=simple instead of -b -V simple.
2735         * tests/cp/backup-1: Replace use of cp's now-deprecated
2736         --version-control option with use of --backup=simple.
2738         * src/cp.c: Convert --backup to take an optional argument.
2739         Deprecate --version-control (-V) in comments.
2740         (usage): Remove mention of --version-control.
2741         (main): Make -V warn then fall through into --backup case.
2742         [--backup case]: Handle optional arg.
2744         * tests/cp/Makefile.am (TESTS): Add cp-mv-backup.
2745         * tests/cp/cp-mv-backup: New file.
2747 1999-10-11  Jim Meyering  <meyering@ascend.com>
2749         * lib/getopt.c: Merge changes from latest glibc.
2750         * lib/getopt.h: Likewise.
2751         * lib/getopt1.c: Likewise.
2753 1999-10-09  Jim Meyering  <meyering@ascend.com>
2755         Accept new option: --target-directory=DIR
2756         * src/ln.c (TARGET_DIRECTORY_OPTION): Define.
2757         (usage): Describe it.
2758         (main): Implement it.
2759         Make code clearer:  use new variable `n_files' in place of
2760         `argc - optind'.  Use `file' instead of `argv + optind'.
2762 1999-10-04  Jim Meyering  <meyering@ascend.com>
2764         * depcomp: New file, for automake's new dependency support.
2765         * missing: New version, from automake's user-dep-gen-branch.
2767         * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too.
2768         * src/sys2.h (__attribute__): Likewise.
2769         Wrap with #ifndef __attribute__.
2771 1999-10-03  Paul Eggert  <eggert@twinsun.com>
2773         * getdate.y (__attribute__): Define to empty if GCC claims to
2774         be before 2.8; this is needed for OPENStep 4.2 cc.  Also,
2775         define to empty if strict ANSI.
2777 1999-10-03  Jim Meyering  <meyering@ascend.com>
2779         Accept new option: --target-directory=DIR
2780         * src/mv.c (TARGET_DIRECTORY_OPTION): Define.
2781         (usage): Describe it.
2782         (main): Implement it.
2783         Remove unused variable, stdin_tty.
2784         Make code clearer:  use new variable `n_files' in place of
2785         `argc - optind'.  Use `file' instead of `argv + optind'.
2787 1999-09-28  Jim Meyering  <meyering@ascend.com>
2789         * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
2790         Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
2791         * src/sys2.h: Likewise.
2793         * lib/xalloc.h (__attribute__): Protect against redefinition.
2794         From Akim Demaille.
2796 1999-09-26  Jim Meyering  <meyering@ascend.com>
2798         * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and
2799         update callers.
2800         Use explicit exit to help avoid warnings.
2801         From Akim Demaille.
2803         * lib/path-concat.c (DIRECTORY_SEPARATOR): Define.
2804         (ISSLASH): Define.
2805         (path_concat): Allow parameter DIR to be NULL.
2806         (xpath_concat): New function.
2807         From Akim Demaille.
2809         * lib/xalloc.h (__attribute__): Define.
2810         (ATTRIBUTE_NORETURN): Define.
2811         (xalloc_die): Declare.
2812         (NEW): Define as yet unused macro.
2813         (XFREE): Likewise
2814         (CCLONE): Likewise.
2815         (CLONE): Likewise.
2816         From Akim Demaille.
2818         * lib/basename.c (base_name): Add prototype.  From Akim Demaille.
2820 1999-09-19  Jim Meyering  <meyering@ascend.com>
2822         * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
2823         (S_ISLNK): Define if necessary.
2824         This is necessary on a NEC SX-4 with SUPER-UX 9.1.
2825         Based on a patch from Holger Berger.
2827         * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
2828         Change many counter and index variables to be of unsigned type.
2829         (dd_copy): Add new unsigned variable, n_bytes_read, in place of
2830         many uses of `nread'.
2832         * src/sys2.h (__attribute__): Define.
2833         (ATTRIBUTE_NORETURN): Remove #else clause.
2834         (ATTRIBUTE_UNUSED): Define.
2836 1999-09-17  Jim Meyering  <meyering@ascend.com>
2838         * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this
2839         is done in m4/jm-macros.m4.
2841 1999-09-09  Jim Meyering  <meyering@ascend.com>
2843         * src/touch.c (usage): Remove misleading sentence in --help output.
2844         From Karl Heuer.
2846         * src/Makefile.am (EXTRAdir): Remove unused variable.
2848 1999-09-03  Paul Eggert  <eggert@twinsun.com>
2850         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
2851         Use EINVAL instead.
2853 1999-09-01  Jim Meyering  <meyering@ascend.com>
2855         * src/cp.c: Remove declaration of xstrdup.
2856         * src/df.c: Likewise.
2857         * src/ls.c: Likewise.
2859 1999-09-01  Akim Demaille  <akim@epita.fr>
2861         * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'.
2862         * lib/xalloc.h (xalloc_fail_func): Likewise.
2863         (xstrdup): Add protoype.
2865         * lib/version-etc.c (version_etc_copyright): Default copyright string.
2866         (version_etc): Use it.
2867         * lib/version-etc.h: Declare it.
2869 1999-08-29  Jim Meyering  <meyering@ascend.com>
2871         * configure.in (AC_YACC): Remove use, now that we require bison.
2873         * src/dircolors.hin: Add .rpm, .png, and .fli.
2874         From Andres Soolo.
2876 1999-08-28  Paul Eggert  <eggert@twinsun.com>
2878         * getdate.y: Add copyright notice.
2880         (number): Handle `Nov 11 1996' example; see Risks Digest 20.55
2881         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
2882         (1999-08-27)
2884         (<stdio.h>): Include only if testing.
2885         (ISUPPER): Remove.
2886         (ISLOWER, PC): New macros.
2887         (<string.h>): Include if HAVE_STRING_H, not USG.
2888         (bcopy): Remove.
2889         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
2890         bison.
2891         (EPOCH_YEAR): Renamed from EPOCH.
2892         (table): Renamed from TABLE.
2893         (meridian): Now an anonymous enum.
2894         (struct parser_control): New type.
2895         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
2896         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
2897         (%pure_parser): Added, so that the parser is pure.
2898         (%union): Removed; the type is now just plain int.
2899         All %type directives removed.
2900         (tLOCAL_ZONE): New %token.
2901         (month_day_table): Renamed from MonthDayTable.
2902         (gmtime, localtime, mktime, time): Declare only if not defined.
2903         (meridian_table): New table.
2904         (dst_table): New table.
2905         (units_table): renamed from UnitsTable.
2906         (relative_time_table): Renamed from OtherTable.
2907         (time_zone_table): Renamed from TimezoneTable.  Modernized data.
2908         (military_table): Renamed from MilitaryTable.
2909         (to_hour): Renamed from ToHour.
2910         (to_year): Renamed from ToYear.
2911         (lookup_zone): New function.
2912         (LookupWord): Renamed from lookup_word.
2913         Use lookup_zone for time zones.
2914         (yylex): Now reentrant.  All callers changed.
2915         (get_date): Add support for local time zone abbreviations.
2916         Make it reentrant.
2918 1999-08-22  Jim Meyering  <meyering@ascend.com>
2920         * src/sys2.h (IF_LINT): Define new macro.
2921         * src/df.c (main): Rename locals i and j.
2922         Use IF_LINT macro instead of #ifdef lint...
2924         * src/dd.c (parse_integer): Add `const' to char* parameter and
2925         add a separate `suffix' variable.
2927 1999-08-20  Jim Meyering  <meyering@ascend.com>
2929         * src/chown.c (usage): Tweak --help output to make it more consistent
2930         with that of chgrp.
2931         * src/chgrp.c (usage): Tweak --help output to make it more consistent
2932         with that of chown.
2934 1999-08-17  Jim Meyering  <meyering@ascend.com>
2936         * configure.in: Remove check for rename and the code that would
2937         enable building of the `mvdir' program.
2938         * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@.
2939         (EXTRA_PROGRAMS): Remove obsolete mvdir.
2940         * lib/rename.c: Remove obsolete file. (it had a bug, too)
2941         * src/mvdir.c: Remove obsolete file.
2942         * po/POTFILES.in: Remove mvdir.c
2944         * doc/fileutils.texi (chown, chgrp invocation): Make these sections
2945         consistent with each other.
2947 1999-08-16  Jim Meyering  <meyering@ascend.com>
2949         * src/chown.c (groupname): Declare to be `const'.
2950         (change_dir_owner): Declare statp parameter to be `const'.
2951         (usage): Make the output be more consistent with that from chgrp.
2953         This change is nearly identical to the chown.c change of 1998-05-24
2954         * src/chgrp.c: Accept new option, --dereference.
2955         --no-dereference is now the default. Include lchown.h.
2956         (enum Change_status) [CH_NOT_APPLIED]: New member.
2957         (change_symlinks): Enable this by default, now.
2958         (describe_change): Handle new case.
2959         (change_file_group): Add new parameter: cmdline_arg.  Update callers.
2960         Reorganize to reflect changed semantics.
2961         (LCHOWN): Remove definitions.
2962         From Bruno Haible.
2964 1999-08-10  Jim Meyering  <meyering@ascend.com>
2966         * po/POTFILES.in: Add lib/quotearg.c.
2968 1999-08-09  Paul Eggert  <eggert@twinsun.com>
2970         * NEWS, doc/fileutils.texi, src/ls.c (usage):
2971         Add ls --quoting-style=locale.
2973         * lib/argmatch.c (ARGMATCH_QUOTING_STYLE):
2974         Change from escape_quoting_style to locale_quoting_style.
2975         (argmatch_invalid): Use new quotearg_style primitive for simplicity.
2976         Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
2978         * lib/quotearg.h (locale_quoting_style): New enum value.
2979         (quotearg_n_style, quotearg_style): New decls.
2981         * lib/quotearg.c: Include <libintl.h> if ENABLE_NLS.
2982         (_): New macro.
2983         (quoting_style_args, quoting_style_v, quotearg_buffer): Add support
2984         for locale_quoting_style, using _("`") and _("'") for open and close
2985         quote symbols.
2986         Do not quote spaces in escape_quoting_style.
2987         (quotearg_n_style, quotearg_style): New functions.
2989 1999-08-08  Jim Meyering  <meyering@ascend.com>
2991         * src/touch.c (usage): Clarify description of --time=WORD.
2992         From Karl Berry.
2994         * lib/savedir.c (savedir): Change type of name_size parameter to off_t.
2995         * lib/savedir.h (savedir): Update prototype.
2996         * src/chmod.c (change_dir_mode): Remove cast of savedir arg.
2997         * src/chown.c (change_dir_owner): Likewise.
2998         * src/chgrp.c (change_dir_group): Likewise.
2999         * src/copy.c (copy_dir): Likewise.
3000         * src/du.c (count_entry): Likewise.
3001         Suggestion from Bob Proulx.
3003 1999-08-07  Jim Meyering  <meyering@ascend.com>
3005         * po/POTFILES.in: Add lots of lib/*.c files.
3006         Remove src/cp-hash.c, since it doesn't use _().
3008 1999-08-04  Jim Meyering  <meyering@ascend.com>
3010         * configure.in: Remove getline-testing code.  Now it's in m4/.
3012 1999-08-01  Paul Eggert  <eggert@twinsun.com>
3014         * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
3016 1999-07-30  Jim Meyering  <meyering@ascend.com>
3018         * src/ls.c (usage): Explain about default wrt --hide-control-chars and
3019         --show-control-chars.  Reported by Germano Leichsenring.
3021 1999-07-28  Jim Meyering  <meyering@ascend.com>
3023         * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
3025 1999-07-24  Jim Meyering  <meyering@ascend.com>
3027         * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
3028         (dd_copy): Use those to page-align both the input and output buffers.
3030 1999-06-01  Volker Borchert  <bt@teknon.de>
3032         * tests/Makefile.am: Make envvar-check depend on check-recursive rather
3033         than on `check' so that its tests are performed before any real tests.
3035 1999-07-15  Jim Meyering  <meyering@ascend.com>
3037         * src/dd.c: Include getpagesize.h.
3038         (dd_copy): Page-align the input buffer.
3039         Based on a patch from Scott Lurndal.
3041         * getpagesize.h: New file.
3042         * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h.
3044         * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
3045         Work around SunOS botch also when block size is different from 1k.
3046         From Jürgen Fluk.
3048 1999-07-10  Jim Meyering  <meyering@ascend.com>
3050         * man/help2man: Import version 1.012.
3052 1999-07-04  Jim Meyering  <meyering@ascend.com>
3054         * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax.
3056 1999-07-04  Paul Eggert  <eggert@twinsun.com>
3058         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
3059         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
3060         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
3061         the above decl.
3063 1999-06-27  Paul Eggert  <eggert@twinsun.com>
3065         Fix some incompatibilities between `df -P' and POSIX.2.
3067         * lib/human.h (enum human_inexact_style): New enum.
3068         (human_readable_inexact): New decl.
3070         * lib/human.c (human_readable): New function.
3071         (human_readable_inexact): Renamed from human_readable, with new arg
3072         INEXACT_STYLE.  Add support for ceiling and floor.
3074         * src/df.c (print_header): Conform to POSIX if posix_format).
3075         (df_readable): Take ceiling if posix_format.
3076         (ceil_percent): New function.
3077         (show_dev): Take ceiling of percent if posix_format.
3078         Align with POSIX-conforming header if posix_format.
3080         * doc/fileutils.texi: Document these changes.
3082 1999-05-27  Volker Borchert  <bt@teknon.de>
3084         * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
3086 1999-05-23  Jim Meyering  <meyering@ascend.com>
3088         * src/copy.c (copy_internal): Don't apply the umask in move_mode.
3089         Otherwise, `mv' would not preserve the permissions when copying
3090         between partitions.  Reported by David Godfrey
3092         * Version 4.0i.
3094         * tests/cp/same-file: Correct erroneous expected output from
3095         the `cp -f foo foo' tests.
3096         * po/POTFILES.in: Add same.c.
3097         * lib/same.h: New file.
3098         * lib/same.c: New file (function extracted from ln.c).
3099         * lib/Makefile.am (libfu_a_SOURCES): Add same.c.
3100         (noinst_HEADERS): Add same.h.
3101         * src/copy.c: Include same.h.
3102         * src/ln.c (same_name): Remove function.
3103         <same.h>: Include this instead.
3104         <dirname.h>: No longer include this.
3105         * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'.
3107         * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not
3108         remove FILE.  Suggestion from Chris Yeo.
3109         * tests/mv/force: New test, for the above fix.
3110         * tests/mv/Makefile.am (TESTS): Add force.
3111         (TESTS_ENVIRONMENT): Change PATH to be absolute.
3113         * tests/mv/force (mv): New test.
3115 1999-05-17  Paul Eggert  <eggert@twinsun.com>
3117         * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we
3118         have an absolute timestamp, or if the relative timestamp
3119         mentions days, months, or years.  Reported by Volker Borchert.
3121         * lib/human.c (human_readable): Allow from_block_size to be zero.
3123 1999-05-14  Jim Meyering  <meyering@ascend.com>
3125         * tests/Makefile.am (envvar-check): Renamed from check-local.
3126         (check): Depend on envvar-check so the envvar check is performed
3127         before all other tests.  Reported by Volker Borchert.
3128         * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
3129         so CDPATH is mentioned in the message.  Reported by Volker Borchert.
3131         * src/df.c (main): When asking for info on an explicit file name,
3132         just warn rather than failing if the table of mounted filesystems
3133         cannot be read.  Based on a patch from Mark Kettenis.
3135         * lib/version-etc.c (version_etc): Put version info and author names
3136         on the first two lines respectively rather than putting the three
3137         lines of copyright info between them.
3139         * src/touch.c (open_maybe_create): Handle Solaris' failure mode when
3140         FILE is a directory.  Reported by Vin Shelton.
3142         * lib/human.c: Include <string.h> or <strings.h> for strlen prototype.
3143         * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes.
3144         * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on
3145         64-bit systems.  From Ulrich Drepper.
3147 1999-05-12  Jim Meyering  <meyering@ascend.com>
3149         * src/shred.c (main): Put `u' for -u in getopt_long's string argument.
3150         Remove the `R'.
3152 1999-05-07  Jim Meyering  <meyering@ascend.com>
3154         * Version 4.0h.
3156         * tests/touch/dir-1: New test.
3157         * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual
3158         upper-case program names.  Add a definition of PATH.
3159         (TESTS): Add dir-1.
3161         * src/mkdir.c (main): Use better wording in diagnostic: `cannot
3162         create directory' rather than `cannot make directory'.  The former
3163         also matches the one in makepath.c.
3165         * src/dd.c: (apply_translations): Use TOUPPER and TOLOWER,
3166         not toupper and tolower.
3168 1999-05-05  Jim Meyering  <meyering@ascend.com>
3170         * lib/makepath.c (make_dir): When reporting a mkdir failure and the
3171         target cannot be `stat'ed, use the errno from the failed mkdir call,
3172         not the one from the stat call.  Before this change, running
3173         `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
3174         elicit `No such file or directory' instead of `Permission denied'.
3176         * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
3177         (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
3178         Based on a patch from Kaveh Ghazi.
3180         * src/ls.c (USE_ACL): Define this only #if
3181         (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
3182         Use `USE_ACL' in place of `HAVE_ACL' everywhere else.  From Kaveh Ghazi.
3184 1999-05-04  Jim Meyering  <meyering@ascend.com>
3186         * lib/makepath.c: Include makepath.h libintl.h, not after it.
3187         Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
3188         (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
3189         which is necessary on Irix4 since cc doesn't define __STDC__.)
3190         From Kaveh Ghazi.
3192 1999-04-30  Jim Meyering  <meyering@ascend.com>
3194         * Makefile.maint: Define several tag-related make variables.
3195         (cvs-dist): Use the make variables instead of shell ones.
3196         (announcement): Automatically generate diffs for all ChangeLog files,
3197         not just the top level one.
3199 1999-04-30  Paul Eggert  <eggert@twinsun.com>
3201         * lib/dup2.c: New file.
3203 1999-04-30  Jim Meyering  <meyering@ascend.com>
3205         * src/touch.c (touch): Only do the fstat if we need to.
3206         Resort to calling stat for directories, but only when necessary.
3207         (usage): Mention --no-create.
3209         * src/copy.c (copy_internal): Move the one-file-system test so that
3210         it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
3211         Prior to this change, `cp --one-file-system' would traverse a file-
3212         system boundary if the destination directory existed.  From Ton Hospel.
3214 1999-04-27  Paul Eggert  <eggert@twinsun.com>
3216         * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO
3217         for output, to avoid confusion with closed input and output fds.
3218         (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
3219         and STDOUT_FILENO.
3220         (open_fd): New function.
3221         (main): Use it, instead of open, to ensure that file descriptors
3222         don't get confused.
3224 1999-04-26  Paul Eggert  <eggert@twinsun.com>
3226         * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead
3227         of 0, 1.
3229         * src/dd.c (skip): Don't fstat the input file; the result is
3230         no longer used.
3232 1999-04-26  Jim Meyering  <meyering@ascend.com>
3234         * tests/mv/into-self-2: Update to reflect this change by reversing
3235         the order of arguments so the symlink is the source, not the
3236         destination (otherwise, the mv command would now succeed).
3238         * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail.
3239         That is, even though source and destination are `the same,' don't fail
3240         if the destination is a symlink.  From Peter Samuelson.
3242 1999-04-26  Paul Eggert  <eggert@twinsun.com>
3244         * src/dd.c (main): If you can't open an output file (with
3245         seek=...) read-write, then open it for write and report an
3246         error if we can't seek.
3248         * lib/filemode.c (setst, ftypelet, mode_string):
3249         * lib/mkdir.c (mkdir):
3250         * lib/makepath.c (make_path):
3251         * lib/modechange.c (make_node_op_equals, mode_compile,
3252           mode_create_from_ref, mode_adjust):
3253         * lib/modechange.h (mode_adjust):
3254         * src/chmod.c (describe_change, change_file_mode):
3255         * src/copy.c (copy_reg, copy_internal):
3256         * src/copy.h (struct cp_options.umask_kill):
3257         * src/cp.c (do_copy, cp_option_init, main):
3258         * src/dd.c (main):
3259         * src/install.c (mode, cp_option_init, DIR_MODE):
3260         * src/mkdir.c (main):
3261         * src/mkfifo.c (main):
3262         * src/mknod.c (main):
3263         * src/mv.c (cp_option_init):
3264         * src/touch.c (open_maybe_create):
3265         Use proper mode_t types and macros.
3266         Don't assume the traditional Unix values for mode bits.
3268         * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH,
3269         S_IXOTH): Define if not defined.
3270         (rwx): Remove.
3271         * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
3272         * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU):
3273         Define if not defined.
3274         * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
3275         Define if not defined.
3276         (CHMOD_MODE_BITS): New macro.
3277         * src/install.c (isodigit): Remove unused macro.
3279         * src/mkfifo.c, src/mknod.c (usage):
3280         Use symbolic mode as default, not octal.
3282         * lib/utime.c (utime_null):
3283         Don't pass 0666 to open; it's not needed and isn't
3284         guaranteed to be portable.
3286         * lib/filemode.h: <config.h>, <sys/types.h>: Include for mode_t.
3287         (mode_string): Now takes mode_t.
3289         * lib/modechange.h: Include <config.h>, <sys/types.h> for mode_t.
3290         (struct mode_change): Members affected and value are now mode_t instead
3291         of unsigned short.
3293         * doc/fileutils.texi, doc/perm.texi:
3294         Don't assume traditional Unix mode numbering.
3296         * lib/modechange.c: modechange.h now includes sys/types.h.
3297         Include xstrtol.h.
3298         (isodigit, oatoi): Remove.
3299         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
3300         S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
3301         S_IRWXO): Define if not defined.
3302         (CHMOD_MODE_BITS): New macro.
3303         (mode_compile): Convert from octal with xstrtoul, not our own routine.
3305 1999-04-24  Jim Meyering  <meyering@ascend.com>
3307         * Version 4.0g.
3309 1999-04-22  Jim Meyering  <meyering@ascend.com>
3311         * src/shred.c (word32): Don't use `#error'; it runs afoul of
3312         SunOS 4.1.4 cc.  From Paul Eggert.
3314         * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
3316 1999-04-20  Paul Eggert  <eggert@twinsun.com>
3318         Replace our temporary hack implementation of strtoumax with
3319         something very close to the real code in glibc.
3321         * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
3322         we now have a true replacement in strtoumax.c.
3323         (__strtol): Always define to strtoumax.
3324         (<stdlib.h>): No need to include.
3325         (PARAMS): Remove.
3326         (my_strtoumax): Move this to strtoumax.c,
3327         rename it to strtoumax, and simplify.
3329         * lib/strtoull.c, lib/strtoumax.c: New files.
3331         * lib/strtol.c: Update to glibc 2.1.1 version.
3333 1999-04-20  Jim Meyering  <meyering@ascend.com>
3335         * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
3336         (check-local): Also test and warn if CDPATH is set.
3338 1999-04-20  Paul Eggert  <eggert@twinsun.com>
3340         * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
3341         cross-compilation.
3342         * config.guess: New file (from autoconf).
3343         * config.sub: New file (from autoconf).
3345         * src/shred.c <config.h>: Include first, since it can do
3346         things like #define const, and this must be done before
3347         including any system headers.
3349         * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
3350         whether overflow occurred.  Improve overflow-detection to use
3351         only one conditional branch total, rather than 2N+1
3352         conditional branches for an N-digit number.
3354 1999-04-18  Jim Meyering  <meyering@ascend.com>
3356         * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
3357         strtouq, now that they're checked in m4/xstrtoumax.m4.
3359 1999-04-18  Paul Eggert  <eggert@twinsun.com>
3361         * doc/fileutils.texi, src/shred.c (main, longopts):
3362         Use -u instead of -R for --remove, so that we can preserve
3363         future compatibility with rm.
3365 1999-04-18  Jim Meyering  <meyering@ascend.com>
3367         * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
3368         (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
3369         member directly.
3371 1999-04-18  Paul Eggert  <eggert@twinsun.com>
3373         Fix shred to do the right thing with off_t longer than long.
3374         Merge large-integer parsing code with similar code in dd.c,
3375         and put the resulting in lib/xstrtoumax.c so that other programs
3376         can use it.  Instead of adding a new lib/xstrtoumax.h I thought
3377         it cleaner to put all the xstroto* declarations into a single
3378         header, which for now is lib/xstrtol.h for lack of a better place.
3379         (Mayby lib/xstdlib.h would be better?  :-)
3381         I thought of several other problems with shredding regular files;
3382         shredding devices is much more reliable.  So I changed the defaults
3383         to be more suitable for shredding devices; this should help encourage
3384         users to do the right thing.
3386         pfstatus isn't portable to environments with varying width
3387         fonts, or with internationalized environments where the byte
3388         count of the message is not the same as its print width.
3389         Rather than deal with this, I just simplified it to not do
3390         tricks with carriage-returns and spaces.  (I'm also worried
3391         that vprintf may not return the right value on some hosts; I
3392         vaguelly recall this being a problem.)  As a result, -v and -
3393         no longer conflict.
3395         When removing a special file, try to truncate it first, but don't
3396         worry if this reports an error.
3398         Try to find the size of a non-regular file by seeking to its end.
3400         Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
3402         Some other minor bug fixes.
3404         * lib/xstrtoul.h: Remove this file.
3405         * lib/xstrtoumax.c: New file.
3407         * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
3409         * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
3410         (__strtol, __strtol_t, __xstrtol): New macros.
3412         * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
3413         New macros to specify the
3414         underlying function, its returned type, and our function.  Default to
3415         values suitable for xstrtol.
3417         Include <ctype.h>, since we use its macros.
3419         (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
3420         (ISSPACE): New macro.
3422         (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
3423         -> __strtol_t.
3425         (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
3426         whether STRING_TO_UNSIGNED is defined.  Skip isspace chars, not
3427         isblank chars, to match strtol.  When returning
3428         LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
3429         *val.
3431         * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
3432         <inttypes.h>: Include if HAVE_INTTYPES_H.
3433         (_DECLARE_XSTRTOL): New macro.
3434         (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
3435         we need only one include file, not three.
3436         (_STRTOL_ERROR): Do not undef, as this is no longer needed.
3437         Reword overflow message so that it's independent of type.
3439         * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
3440         (noinst_HEADERS): Remove xstrtoul.h.
3442         * lib/xmalloc.c (xalloc_fail):
3443         Pass xalloc_msg_memory_exhausted through gettext.
3445         * lib/getdate.y:
3446         <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
3447         (LookupWord, yylex): Don't pass negative char to ctype macros.
3449         * doc/fileutils.texi:
3450         Explain why shredding devices is more reliable, and why the
3451         default options are more suitable for devices.
3453         Remove withdrawn options -b or --no-contents, -c or --freed-contents,
3454         -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
3455         --all-links.
3457         Add -R or --remove, -s or --size.
3459         -v can no longer be doubled.
3461         `file system' --> `filesystem' uniformly.
3463         * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
3465         * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
3466         "human.h", "xalloc.h": Include.
3467         (attribute): Remove; no longer needed.
3468         (xstrdup): New decl.
3469         (STDOUT_FILENO): New macro.
3470         (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
3472         The following changes have effect only if !HAVE_CONFIG_H.
3473         <ctype.h>: New include.
3474         (RETSIGTYPE): Remove bogus semicolon at end.
3475         (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
3476         New macros.
3477         (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
3478         Handle suffixes like the real routine does.
3479         (error): Remove bogus assignment of errno to errnum.
3480         (xmalloc, xstrdup): New functions.
3482         (O_NOCTTY): Define even if !HAVE_CONFIG_H.
3483         (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
3484         (OUTPUT_BLOCK_SIZE): New macro.
3485         (struct Options.verbose): Now a boolean, since we no longer have two
3486         levels of verbosity.
3487         (long_opts, usage, main): Remove -D or --device option.  Invert -p or
3488         --preserve option, and rename it to -R or --remove.
3489         (usage): Describe G suffix.
3490         (usage): "-" no longer conflicts with -v.
3491         (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
3492         (ind): Portability fixes: return word32, not unsigned; multiply by
3493         sizeof (word32) instead of shifting left by 2.
3494         (isaac_refill, isaac_mix): Comment out size of array parameter, as
3495         ansi2knr mishandles this.
3496         (status_visible, status_pos, pfstatus, flushstatus): Remove, since
3497         pfstatus isn't portable to users with varying width fonts, or
3498         internationalized messages, and vfprintf is problematic.  All callers
3499         of pfstatus changed to use error instead; this removes incompatibility
3500         of -v with -.  All calls to flushstatus removed.
3501         (dopass, do_wipefd): Do not translate non-English msgs with gettext.
3503         (dopass): Cast lseek constant arguments to (off_t) for benefit
3504         of pre-ANSI compilers; fix one lseek call whose args were interchanged.
3505         Remove unnecessary casts to (off_t).  Do not check for EIO
3506         when determining file size; this was just my earlier wild guess.
3507         Use human_readable to print off_t, instead of casting to unsigned long
3508         (which doesn't work in Solaris 2.6, where off_t is longer than long).
3509         Output human-readable sizes, instead of always using "K".
3510         Check for offset overflow (it happened to me in SunOS 4.1.4).
3511         (do_wipefd): Do not insist on regular files, but do check for special
3512         files that cannot possibly be shredded.
3513         Use xmalloc instead of malloc + check.
3514         Do not inspect st_size for non-regular files.
3515         Try to find the size of a non-regular file by seeking to its end.
3516         Do not assume that a regular file of size-0 has unknown size.
3517         Check for regular files with negative sizes,
3518         and for overflow after rounding to next block.
3519         Always try to truncate, even for special files, but do not report an
3520         error if truncation fails on a special file.
3522         (dopass, wipefile): Do not return 1 for special files; the caller
3523         doesn't care any more.
3525         (wipefd): Remove unnecessary (and nonportable) check for
3526         whether the file descriptor is read-only.  Remove
3527         no-longer-needed check for `-v -'.
3529         (incname): Return 1 for carry bit, like the documentation says.
3531         (wipename, wipefile): Accept new argument, specifying the
3532         quoted file name.  All callers changed.
3534         (wipename): Use xstrdup instead of strdup+error check.
3536         (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
3537         errors in NNN more carefully. Restore errno after the check.
3538         Check for errors when closing the file descriptor.
3539         Use more consistent wording when unable to remove a file.
3541         (main): Do not remove files by default.
3542         Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
3543         exist if !HAVE_CONFIG_H.
3544         In diagnostics, quote invalid operands to -n and -s options.
3545         Allow T, P, E, Z, and Y suffixes in -s operand.
3546         flags.verbose is now a boolean, not a counter.
3547         Use STDOUT_FILENO instead of 1, for clarity.
3549         * lib/human.c:
3550         Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
3551         xstrto... functions.
3553         * src/dd.c: Include xstrtol.h.
3554         (parse_integer): Migrate most of the work into the new xstrtoumax fn.
3556         * lib/xstrtoumax.c: New file.
3558 1999-04-18  Jim Meyering  <meyering@ascend.com>
3560         * src/dd.c (main): Open the output file with *read* access
3561         only if we might need to read to satisfy a `seek=' request.
3562         From Matthias Urlichs.
3564 1999-04-10  Jim Meyering  <meyering@ascend.com>
3566         * Makefile.maint (alpha): Add trailing slash for ncftp.
3568         * Version 4.0f.
3570         * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
3571         * tests/Makefile.am (SUBDIRS): Add dd.
3572         * tests/dd: New directory
3573         * tests/dd/misc: New file.
3575         `ls --color' would segfault
3576         * src/ls.c: Include assert.h.
3577         (color_indicator[]): Add an entry for the type, `door.'
3578         (main): Assert that the lengths of the color_indicator and
3579         indicator_name arrays are appropriately related.
3580         Reported by John Gotts.
3582         * src/dd.c (scanargs): Fix bug introduced with last change: now that
3583         the loop is gone, manually decrement argc and increment argv.
3584         Reported by Andreas Jaeger and jvogel@linkny.com.
3586 1999-04-07  Jim Meyering  <meyering@ascend.com>
3588         * lib/getdate.y (difftm): Protoize.
3590 1999-04-06  Jim Meyering  <meyering@ascend.com>
3592         * lib/strftime.c: Update from master source in libc.
3594 1999-04-04  Jim Meyering  <meyering@ascend.com>
3596         * tests/ln/misc: Comment out the test added on 1999-01-31.
3598         * Makefile.maint (url_dir_list): Define properly.
3599         (real_dir_list): Likewise.
3601         * src/shred.c: Don't include string.h.
3602         [!HAVE_CONFIG_H]: Include string.h here.
3603         [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
3604         (sigill_handler): Change return type and type of local `oldhandler' to
3605         RETSIGTYPE.
3606         (isaac_seed_machdep): Change and type of local `oldhandler' to
3607         RETSIGTYPE.
3608         From Colin Plumb.
3610         * Version 4.0e
3612         * tests/cp/same-file: Change the sed command used to extract the
3613         filename from ls -l output, to accommodate the change in format.
3615         * src/ls.c (print_long_format): Add a space between %s and %3u.  This
3616         assures that even when modebuf has the trailing `+' and there are more
3617         than 99 hard links to a file, the permissions string and the link count
3618         will be separated.
3620 1999-04-03  Jim Meyering  <meyering@ascend.com>
3622         * src/shred.c (dopass): add curly braces to avoid warning about
3623         ambiguous `else'.
3624         (wipefd): Add parentheses suggested by gcc.
3625         (do_wipefd): Remove declaration of unused local.
3627 1999-04-02  Colin Plumb  <colin@nyx.net>
3629         * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
3630         to allow standalone compilation.
3632         (wipefile): Added support for emulating /dev/fd/# files even if
3633         the OS doesn't support them.  From Paul Eggert.
3635         (main, usage): Changed --device short option to -D.
3637         (wipefd, do_wipefd): Renamed function to do_wipefd and added
3638         separate wipefd that performs sanity checks on externally-opened file
3639         descriptors, such as not append-only.  From Paul Eggert.
3641         (do_wipefd, isaac_seedfd): Do not read file for any reason.
3642         if the file is low-entropy, it's a security hole.
3643         (wipefile) Changed to open O_WRONLY and chmod to write-only when
3644         forcing.
3645         (isaac_seedfd) Function deleted as unnecessary.
3646         From Paul Eggert.
3648         (dopass): Dynamically fall back to fsync() if fdatasync() fails,
3649         since POSIX, in their infinitesimal wisdom, encourage implementations
3650         that return constant -1, making compile-time testing useless.
3651         From Paul Eggert.
3653         (dopass): Changed to support a size of -1 to mean "unknown".
3654         This entailed changing to a counting-up offset rather than couting-down
3655         cursize for the central state variable.  Also changed size argument to
3656         be call-by-reference so that it can be passed back once known.
3657         (sizer) Function deleted as unnecessary.
3658         (wipefd): Changed to match.  From Paul Eggert
3660         (dopass): Try to skip over bad blocks in destination files.
3661         Also added ftruncate() for more complete destruction of metadata.
3663         (main, usage): Changed "-" to stand for standard output.
3664         (wipefd): Added error message to detect conflict with -v.
3666         (dopass): Added periodic fsync() calls to keep the pass progress
3667         display in sync with reality.  Hopefully they're sufficiently far spaced
3668         that throughput isn't affected.  It might be a good thing to do even in
3669         non-verbose mode, to avoid filling up the kernel caches with dirty data.
3670         Also added ftruncate() for more complete destruction of metadata.
3672         (quotearg_colon): New function to print
3673         pathological filenames properly.
3674         [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
3675         that does most of the work.
3676         (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
3677         (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
3678         Error messages are also in a more uniform format.
3679         From Paul Eggert.
3681         (struct Options, main, do_wipefd): Added -s/--size=N flag.
3682         (xstrtoul): Added support for valid_suffixes to help this.
3683         (usage) Documented it.
3685         (error): Changed some arguments from N_() to _(), since error()
3686         does not translate its argument.  I think this is a bug.
3688         (struct Options do_wipefd, wipefd, wipefile, main): moved passes
3689         argument into the Options structure as n_iterations, which is now a
3690         size_t.  From Paul Eggert.
3692         (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
3693         to manage seeding of RNG with arbitrary-sized data.
3694         (isaac_init): commented out as dead code.
3695         (isaac_seed): changed to use new functions to prevent any possibility of
3696         a buffer overflow.
3698         (isaac_seed): Added support for Solaris' gethrtime()
3699         configure.in: Corresponding feature test.  From Paul Eggert.
3701         (wipename): Change remove() to unlink() for speed & portability.
3702         Use lstat() instead of access() to see if a filename is taken.  This
3703         works even on dangling symlinks and avoids the suid problems of
3704         access(2).  From Paul Eggert.
3706         (isaac_seed_machdep): New function for reading cycle counters
3708 1999-04-02  Paul Eggert  <eggert@shade.twinsun.com>
3710         * configure.in (AC_CHECK_FUNCS): Add gethrtime.
3712         * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
3713         Use gethrtime if available.  Don't assume that clock_gettime succeeds.
3714         Put most random sources first.
3716 1999-04-02  Paul Eggert  <eggert@twinsun.com>
3718         shred: Add new options -bcCklL and fix some porting problems.
3719         Remove options -dp.  Do not read output files.
3721         * src/shred.c (long_opts, usage, main, wipefile): Adjust to
3722         new options.
3723         ("human.h", "quotearg.h"): New includes.
3724         (struct Options): New members contents, links, n_iterations.
3725         Remove allow_devices, remove_file.  Change n_iterations to size_t.
3726         All uses changed.
3727         (output_block_size): New var.
3728         (usage): Declare __noreturn__ attribute.
3729         (fdatasync): Define to -1 if not present, since we need to invoke both
3730         fdatasync and fsync if both are present.  All invokers of fdatasync
3731         now try fdatasync, then fsync.
3732         (MIXIN): New macro.
3733         (isaac_seed): Use it to mix in values.  Add uid, gid to mix.
3734         Don't use gettimeofday, as it has too many porting problems.
3735         (isaac_seedfd): Remove, since we no longer read the output files.
3736         (sizefd): Remove; we now determine size by writing sequentially.
3737         (dopass, wipename, wipefile, main): Clean up error messages.
3738         (dopass): Keep track of offset relative to start of file, not
3739         end, since we may not know how large the file is.  If size is
3740         negative, write until we fall off the end of the file.
3741         (wipefd): Do not read output file.
3742         Return 0 if successful, -1 if not; do not make a special case for
3743         non-regular files, since our callers have that info now.
3744         (wipename): Now static.  Return errno if error.
3745         (main): "-" now stands for standard output.
3746         Do not shred append-only standard output.
3747         (wipefile): Do not grant read permission to file when wiping it.
3748         Use symbolic permission (S_IWUSR), not octal.
3750         * src/system.h (S_IWUSR): Define if not already defined.
3752         * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
3753         (AC_CHECK_FUNCS): Remove gettimeofday.
3755         * doc/fileutils.texi: Document recent changes.
3757 1999-04-01  Jim Meyering  <meyering@ascend.com>
3759         * configure.in (AC_CHECK_FUNCS): Add acl.
3760         (AC_CHECK_HEADERS): Add sys/acl.h.
3761         * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
3762         (struct fileinfo): New member `have_acl'.
3763         (gobble_file): Initialize it.
3764         (print_long_format): Use it.
3765         Mostly from Alen Muzinic.
3767         * src/touch.c (open_maybe_create): New function.
3768         (touch): Rewrite not to use `creat' and to eliminate a race
3769         condition that could make touch truncate a nonempty file.
3770         Report and suggestions from Andrew Tridgell.
3772 1999-03-31  Jim Meyering  <meyering@ascend.com>
3774         * src/du.c: Remove prototypes and tsort function definitions.
3776         * src/chown.c (main): Move the declaration of `e' into the scope
3777         where it's used and make it `const'.
3779         * src/install.c (main): Qualify a char* with the `const' keyword.
3780         (install_file_in_dir): Likewise.
3781         * src/ln.c (main): Likewise.
3782         * src/mkdir.c (main): Likewise.
3783         * src/mkfifo.c (main): Likewise.
3784         * src/mknod.c (main): Likewise.
3785         * src/mv.c (main): Likewise.
3786         * src/touch.c (touch): Likewise.
3788 1999-03-30  Jim Meyering  <meyering@ascend.com>
3790         * src/*.c: Don't include closeout.h or version-etc.h explicitly.
3791         Now, they're included via sys2.h.
3793 1999-03-29  Jim Meyering  <meyering@ascend.com>
3795         * configure.in (GNU_PACKAGE): Remove related code -- now it's in
3796         the catch-all for shared autoconf code, m4/jm-macros.m4.
3797         (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
3798         this instead.
3800 1999-03-29  Paul Eggert  <eggert@twinsun.com>
3802         Minor lint removal in code that forks and execs.
3804         * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
3805         against zero.  This is to improve portability.
3806         * lib/rename.c (rename): Likewise.
3807         * lib/rmdir.c (rmdir): Likewise.
3809         * lib/rename.c (rename):
3810         (rename): Do not print any error messages, so that the messages
3811         are internationalized properly.
3813         * src/install.c (strip): Use standard "cannot fork" message.
3814         Check for strip nonzero exit status.
3816 1999-03-28  Jim Meyering  <meyering@ascend.com>
3818         `chmod =OP' did not properly apply the umask
3819         * lib/modechange.c (make_node_op_equals): New function.
3820         (mode_append_entry): Likewise.
3821         (mode_compile): When none of [ugoa] is specified in an `=OP' change
3822         mode request, insert a `=0' entry into the linked list so that all
3823         bits are cleared first.  Use the new functions.
3824         Reported by Andrew Dalke.
3826         New test for the above.
3827         * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
3828         * tests/Makefile.am (SUBDIRS): Add chmod.
3829         * tests/chmod: New directory
3830         * tests/chmod/equal-x: New file.
3832 1999-03-27  Jim Meyering  <meyering@ascend.com>
3834         * lib/modechange.c (mode_compile): Upon allocation failure, free
3835         everything starting with the head, not the tail.
3837         * src/install.c (strip): Use pid_t, not int.  From John Bley.
3839 1999-03-26  Jim Meyering  <meyering@ascend.com>
3841         * src/dd.c (PROGRAM_NAME, AUTHORS): Define
3842         (long_options): Remove unused struct.
3843         (scanargs): Remove useless loop.
3844         (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
3845         * src/mvdir.c: Likewise.
3846         * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
3848 1999-03-25  Jim Meyering  <meyering@ascend.com>
3850         * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
3851         (noinst_HEADERS): Add version-etc.h.
3853         * lib/long-options.c (parse_long_options): Remove version-, copyright-,
3854         and author-printing code.  Do it via version_etc.
3856         * lib/version-etc.c: New file.
3857         * lib/version-etc.h: Prototype for same.
3859         * src/sys2.h (GETOPT_HELP_CHAR): Define.
3860         (GETOPT_VERSION_CHAR): Define.
3861         (GETOPT_HELP_OPTION_DECL): Define.
3862         (GETOPT_VERSION_OPTION_DECL): Define.
3863         (case_GETOPT_HELP_CHAR): Define.
3864         (case_GETOPT_VERSION_CHAR): Define.
3866         * src/chgrp.c: No longer include long-options.h.
3867         Include version-etc.h instead.
3868         (PROGRAM_NAME, AUTHORS): Define.
3869         [long_options]: Add entries for --help and --version.
3870         Remove parse_long_options call.
3871         (main) [getopt switch]: Add a case for each of --help and --version.
3872         * src/chgrp.c: Likewise.
3873         * src/chmod.c: Likewise.
3874         * src/cp.c: Likewise.
3875         * src/df.c: Likewise.
3876         * src/dircolors.c: Likewise.
3877         * src/du.c: Likewise.
3878         * src/install.c: Likewise.
3879         * src/ln.c: Likewise.
3880         * src/ls.c: Likewise.
3881         * src/mkdir.c: Likewise.
3882         * src/mkfifo.c: Likewise.
3883         * src/mknod.c: Likewise.
3884         * src/mv.c: Likewise.
3885         * src/rm.c: Likewise.
3886         * src/rmdir.c: Likewise.
3887         * src/shred.c: Likewise.
3888         * src/touch.c: Likewise.
3890 1999-03-24  Jim Meyering  <meyering@ascend.com>
3892         * man/help2man: Import version 1.010.
3894 1999-03-22  Jim Meyering  <meyering@ascend.com>
3896         * src/chmod.c (usage): Add one-liner.  Suggestion from Karl Berry.
3898 1999-03-19  Jim Meyering  <meyering@ascend.com>
3900         * src/automake-wrap: Rewrite the automake-generated rule for
3901         clean-binPROGRAMS so that it removes rm even with a losing PATH on a
3902         losing system (PATH with `.' before /bin on a system where you can't
3903         unlink a running executable).  Reported by William Bader.
3905         * configure.in: Use jm_WINSIZE_IN_PTEM.
3906         * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
3907         Required by SCO ODT 2.0 systems.  Reported by William Bader.
3909 1999-03-18  Jim Meyering  <meyering@ascend.com>
3911         * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
3912         (remove_init): Call hash_initialize with one more argument.
3914 1999-03-15  Jim Meyering  <meyering@ascend.com>
3916         Revamp to allow fine-tuning to control when and by how
3917         much the table grows and shrinks.
3918         * lib/hash.c (next_prime): Don't assert.
3919         (hash_reset_tuning): New function.
3920         (check_tuning): New function.
3921         (hash_initialize): Accept and use new tuning parameter.
3922         (hash_rehash): Rewrite, updating for tuning.
3923         (hash_insert): Honor tuning semantics.
3924         (hash_delete): Likewise.
3925         From François Pinard.
3927         * lib/hash.h (struct hash_tuning): Define.
3928         (struct hash_table) [tuning]: Add member.
3929         (hash_initialize): Add `tuning' parameter.
3931         * lib/hash.c (hash_insert): Remove last parameter and change semantics.
3932         * lib/hash.h (hash_insert): Update prototype.
3934         * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
3935         otherwise, we'd do so even when the insertion failed.
3936         From François Pinard.
3938 1999-03-07  Jim Meyering  <meyering@ascend.com>
3940         * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
3941         have to be scanned for % signs.  Suggestion from François Pinard.
3943         * Makefile.maint: Add two more URLs and the loops to use them.
3945         * lib/long-options.c (parse_long_options): Include `Copyright...' line
3946         in --version output.
3947         Add the `...NO warranty...' message.
3949 1999-03-03  Jim Meyering  <meyering@ascend.com>
3951         * lib/long-options.c (_): Define it.
3952         (parse_long_options): Accept new parameter, authors, and print it.
3954         * lib/long-options.h: Update prototype.
3956         * src/chgrp.c: Include long-options.h
3957         [long_options]: Remove the "help" and "version" entries.
3958         (main): Use parse_long_options, including author name(s).
3959         Remove the show_version and show_help blocks.
3960         * src/chmod.c: Likewise.
3961         * src/chown.c: Likewise.
3962         * src/cp.c: Likewise.
3963         * src/dd.c: Likewise.
3964         * src/df.c: Likewise.
3965         * src/dircolors.c: Likewise.
3966         * src/du.c: Likewise.
3967         * src/install.c: Likewise.
3968         * src/ln.c: Likewise.
3969         * src/ls.c: Likewise.
3970         * src/mkdir.c: Likewise.
3971         * src/mkfifo.c: Likewise.
3972         * src/mknod.c: Likewise.
3973         * src/mv.c: Likewise.
3974         * src/mvdir.c: Likewise.
3975         * src/rm.c: Likewise.
3976         * src/rmdir.c: Likewise.
3977         * src/shred.c: Likewise.
3978         * src/sync.c: Likewise.
3979         * src/touch.c: Likewise.
3981 1999-02-18  Paul Eggert  <eggert@twinsun.com>
3983         * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
3984         The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
3986 1999-02-17  Jim Meyering  <meyering@ascend.com>
3988         * src/shred.c (wipename): Fix string thinko.  Now, shredding files
3989         in subdirectories works (dir/file).  From Janos Farkas.
3991 1999-02-13  Jim Meyering  <meyering@ascend.com>
3993         * src/dircolors.c (dc_parse_stream): Don't try to dereference
3994         NULL if there's an error in our built-in list.
3995         Suggestion from François Pinard.
3997 1999-02-13  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
3999         * src/install.c (main): Set x.backup_type only if backups are requested.
4000         (cp_option_init): Initialize backup_type.
4001         (backup_type): Remove unused variable.
4003         * doc/fileutils.texi: Fix use of @item vs @itemx.
4005 1999-02-08  Jim Meyering  <meyering@ascend.com>
4007         * src/dircolors.c (slack_codes): Add "DOOR".
4008         (ls_codes): Add corresponding "do".
4009         Reported by John Gotts.
4011         * configure.in (ALL_LINGUAS): Add Italian (it).
4013 1999-02-07  Jim Meyering  <meyering@ascend.com>
4015         * Version 4.0d (aka 4.1-b4).
4017         * Makefile.maint (my-distcheck): Don't depend on dist, now that this
4018         is hooked up to the distcheck rule.
4019         * Makefile.am (distcheck-hook): New target and rule -- link to shared
4020         rule, my-distcheck, in Makefile.maint.
4022         * doc/fileutils.texi (shred invocation): New section.  From Colin Plumb.
4024         * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
4025         group-member.m4, and just use this new macro.
4026         Use `.$ac_objext', not the literal `.o'.
4028 1999-02-02  Jim Meyering  <meyering@ascend.com>
4030         * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
4031         Define to zero if not already defined.
4032         (HAVE_SYMLINKS): Define.
4033         (gobble_file): Remove #ifdef.
4034         (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
4035         rather than #ifdef S_ISLNK.
4036         (print_type_indicator): Remove #ifdefs and reorganize.
4037         (print_color_indicator): Remove #ifdefs.
4038         (length_of_file_name_and_frills): Likewise.
4040 1999-02-01  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
4042         * src/dircolors.hin: Handle DOOR.
4044         * src/ls.c (print_type_indicator): Print doors as '>'.
4045         (length_of_file_name_and_frills): Account for this.
4046         (indicator_no): Define C_DOOR.
4047         (indicator_name): Add corresponding name.
4049         * lib/filemode.c (ftypelet): Handle doors.
4051         * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
4053 1999-02-01  Jim Meyering  <meyering@ascend.com>
4055         * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
4056         argument list.  From Akim Demaille.
4058 1999-01-31  Jim Meyering  <meyering@ascend.com>
4060         * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
4061         @ifinfo so `makeinfo --html ...' works.  From Karl Berry.
4063         * tests/ln/misc: Add test for this.
4064         * src/ln.c (do_link): Allow creation of a hard link to a dangling
4065         symlink.  Reported by Alexey Solovyov.
4067         * src/copy.c (copy_internal): Describe any backup-related renaming
4068         operations when in verbose mode.
4069         (copy_internal): Likewise.
4070         Based on changes from Marty Leisner.
4072         * lib/lchown.c: Declare chown.
4074 1999-01-30  Jim Meyering  <meyering@ascend.com>
4076         * acconfig.h: Remove uintmax and STAT* #undefs.
4077         * configure.in: Require autoconf 2.13.
4078         Remove test for AFS.
4079         Use 3-argument form of AC_DEFINE*.
4081 1999-01-28  Jim Meyering  <meyering@ascend.com>
4083         * po/POTFILES.in: Add src/shred.c.
4085         * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
4086         TM_IN_SYS_TIME based one (for shred).
4088         * acconfig.h: Remove lots of `#undef's, now that we use the
4089         3-argument forms of AC_DEFINE* macros.
4091 1999-01-25  Jim Meyering  <meyering@ascend.com>
4093         * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
4094         AC_REPLACE_FUNCS.
4095         (AC_CHECK_FUNCS): Add clock_gettime.
4097         * src/shred.c (isaac_seed): Guard clock_gettime with test of
4098         HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
4099         (wipename): Rename local dirfd to dir_fd to avoid shadowing the
4100         function declared in Linux's dirent.h.
4102 1999-01-25  Akim Demaille  <demaille@inf.enst.fr>
4104         * lib/argmatch.h (ARRAY_CARDINALITY): Define.
4105         (ARGMATCH_ASSERT): New macro.
4107         * lib/argmatch.c (program_name): Remove dcl.
4108         Include error.h.
4109         (argmatch_invalid): Use error rather than fprintf.
4111 1999-01-24  Jim Meyering  <meyering@ascend.com>
4113         * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
4114         New version from L. Peter Deutsch.
4116         * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
4117         (and hence that of the local `n1', too) to `int' at Paul's request.
4119         * lib/closeout.c: Add comments.
4121         * src/shred.c (fdatasync): Remove function.  instead, ...
4122         (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
4123         From Colin Plumb.
4125 1999-01-23  Jim Meyering  <meyering@ascend.com>
4127         * src/Makefile.am (bin_PROGRAMS): Add shred.
4128         * src/shred.c: New file.
4129         Portability tweaks.
4130         Internationalize.
4131         (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
4132         only when in verbose mode.
4133         (fdatasync) [! HAVE_FDATASYNC]: New function.
4135         * man/Makefile.am (man_MANS): Add shred.1.
4136         * man/Makefile.summ (shred-summary): Define.
4137         * man/shred.x: New file.
4139         * src/shred.c: New file.  From Colin Plumb.
4140         Include config.h, getopt.h, system.h and error.h.
4141         Use #else/#if, not #elif.
4143 1998-11-05  Paul Eggert  <eggert@twinsun.com>
4145         * lib/mktime.c (__mktime_internal): Adopt the traditional (and
4146         problematic) notion of what to do when tm_isdst doesn't match.
4148 1999-01-17  Jim Meyering  <meyering@ascend.com>
4150         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
4151         than setting RM and CP.
4152         * tests/cp/*: Now that PATH is set properly, use rm and cp rather
4153         than $RM and $CP.
4155         * tests/ln/Makefile.am (TESTS): Add backup-1.
4156         (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
4157         * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
4158         * tests/ln/backup-1: New test for this.
4159         * src/ln.c (do_link): Try to remove DEST even after renaming it.
4160         This fixes a bug reported by Jamie Lokier.
4162         * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
4164 1999-01-16  Jim Meyering  <meyering@ascend.com>
4166         * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
4168         * acconfig.h: Remove @BOTTOM@ section.
4169         Instead, add the define and decl via m4/jm-macros.m4.
4171         * src/ls.c: Don't declare base_name.
4172         Use function-style XARGMATCH once again.
4173         * src/touch.c: Likewise.
4174         * acconfig.h: Add a @BOTTOM@ section.
4175         (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
4176         Declare usage.
4177         From Akim Demaille.
4179         * src/cp.c: Remove declarations of base_name and get_version.
4180         (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
4181         Use xget_version and function-style XARGMATCH.
4182         * src/mv.c (main): Likewise.
4183         * src/ln.c (main): Likewise.
4184         * src/install.c (main): Likewise.
4185         * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
4186         unsigned int, not just int.
4187         * lib/backupfile.h (get_version): Adjust prototype.
4188         (xget_version): Add prototype.
4189         (base_name): Remove prototype.
4190         * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
4191         (backup_args): Reorder enum members.
4192         (backup_types): Likewise.
4193         (get_version): Take an additional parameter, `context'.
4194         (xget_version): Like get_version, but if the `version' argument is NULL,
4195         use the value of the envvar VERSION_CONTROL.
4196         (base_name): Declare.
4197         Mostly from Akim Demaille.
4199         * lib/addext.c: (base_name): Declare.
4200         * src/sys2.h: Add prototype for base_name.
4202         * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
4203         * lib/argmatch.h: Likewise.
4205         * lib/argmatch.h (XARGMATCH): Define to return a value once again.
4206         (XARGCASEMATCH): Likewise.
4208         * lib/argmatch.c (EXIT_FAILURE): Define.
4209         (ARGMATCH_DIE): Provide default.
4210         (__xargmatch_internal): New function.
4211         s/rogram_name/program_name.
4212         From Akim Demaille.
4214 1999-01-14  Akim Demaille  <demaille@inf.enst.fr>
4216         * src/touch.c (usage): Don't make it static so that it can be
4217         called from libfu.a by xargmatch.
4218         * src/chgrp.c (usage): Likewise
4219         * src/chmod.c (usage): Likewise
4220         * src/chown.c (usage): Likewise
4221         * src/cp.c (usage): Likewise
4222         * src/dd.c (usage): Likewise
4223         * src/df.c (usage): Likewise
4224         * src/dircolors.c (usage): Likewise
4225         * src/du.c (usage): Likewise
4226         * src/install.c (usage): Likewise
4227         * src/ln.c (usage): Likewise
4228         * src/ls.c (usage): Likewise
4229         * src/mkdir.c (usage): Likewise
4230         * src/mkfifo.c (usage): Likewise
4231         * src/mknod.c (usage): Likewise
4232         * src/mv.c (usage): Likewise
4233         * src/mvdir.c (usage): Likewise
4234         * src/rm.c (usage): Likewise
4235         * src/rmdir.c (usage): Likewise
4236         * src/sync.c (usage): Likewise
4238 1999-01-12  Akim Demaille  <demaille@inf.enst.fr>
4240         * lib/backupfile.c (get_version): added the parameters KIND.
4241         (xget_version): like get_version, but if argument is NULL, honor
4242         the envvar VERSION_CONTROL.
4243         * src/cp.c: Remove declarations of base_name and get_version.
4244         (main): Use xget_version.
4245         * src/mv.c (main): Likewise.
4246         * src/ln.c (main): Likewise.
4247         * src/install.c (main): Likewise.
4249 1999-01-12  Jim Meyering  <meyering@ascend.com>
4251         * configure.in (ALL_LINGUAS): Add Greek (el).
4252         * po/el.po: New file.
4254         * install-sh: New version from autoconf.
4255         * missing: New version from automake.
4256         * src/ansi2knr.c: Likewise.
4257         * lib/getopt.c: New version from glibc.
4258         * lib/getopt.h: Likewise.
4259         * lib/getopt1.c: Likewise.
4260         * lib/regex.c: Likewise.
4261         * lib/regex.h: Likewise.
4262         * lib/ylwrap: Remove unused file.
4264 1999-01-10  Jim Meyering  <meyering@ascend.com>
4266         * Version 4.0c (aka 4.1-b3).
4268         * Upgrade to autoconf-2.13 and automake-1.3b.
4270         * src/copy.c (copy_internal): Handle two more values of errno from
4271         failed rename of a directory into a subdirectory of itself.
4272         Thanks to Volker Borchert for testing many types and combinations
4273         of systems.
4275         * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
4276         to escape_quoting_style.
4277         (argmatch_invalid): Now that the quoted quantity is no longer double
4278         quoted, remove the code that removed leading and trailing double quotes.
4280         * src/ls.c (decode_switches): Now that escape_quoting_style no longer
4281         escapes the SPACE character, arrange for SPACEs to be quoted here.
4282         * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
4283         it no longer escapes ` '.
4284         Suggestion from Paul Eggert.
4286 1999-01-05  Jim Meyering  <meyering@ascend.com>
4288         * configure.in (space): Add `for' in message of statvfs check.
4289         From Ulrich Drepper.
4291 1999-01-04  Jim Meyering  <meyering@ascend.com>
4293         * Version 4.1-b2.
4295 1999-01-02  Jim Meyering  <meyering@ascend.com>
4297         * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
4298         offending quoted argument before using it in explanatory diagnostic.
4299         Use a single fprintf stmt.
4301         * lib/argmatch.h (XARGMATCH): Don't return a value;  instead,
4302         modify a parameter.  Add a `Die_stmt' parameter.
4303         Add parentheses.
4304         * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
4305         (argmatch_to_argument): Add `const' attribute to first parameter.
4307         * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
4308         done in m4/jm-macros.m4).
4310         * lib/backupfile.c (get_version): Adapt to use new interface to
4311         XARGMATCH.
4312         * src/cp.c: Likewise.
4313         * src/ls.c: Likewise.
4314         * src/touch.c: Likewise.
4316 1999-01-01  Jim Meyering  <meyering@ascend.com>
4318         * lib/makepath.c (make_dir): New function, factored out of make_path.
4319         (make_path): Use make_dir rather than open-coding it twice.
4320         This effectively reverses the order of the latter pair of stat/mkdir
4321         calls and fixes a race condition bug whereby one of two concurrent
4322         `mkdir -p' processes could fail with EEXIST.
4323         Include locale.h and libintl.h, and define `_()'.
4324         Mark translatable strings.
4326         * lib/xmalloc.c: Add comments.
4327         (xcalloc, xmalloc, xrealloc): Remove prototypes.
4328         (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
4329         * lib/xalloc.h: Add comments.
4330         (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
4331         (xcalloc, xmalloc, xrealloc): Add prototypes here.
4332         Based on changes from Akim Demaille.
4334         * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
4335         (quotearg_n): Change type of 1st parameter from int to unsigned int.
4336         (quotearg_n_options): Likewise.
4337         * lib/quotearg.h (quoting_style_vals): New public array.
4338         From Akim Demaille.
4339         (quotearg_n_options): Declare `options' parameter to be `const'.
4341         * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
4343         * lib/backupfile.c (get_version): Use XARGMATCH in place of
4344         argmatch & co.
4346 1998-12-31  Jim Meyering  <meyering@ascend.com>
4348         * src/ls.c (indicator_style_types): New variable.
4349         (format_types): Rename from `formats'.
4350         (color_args): Remove unnecessary `no' string.
4351         (color_types): Remove corresponding `color_never' entry.
4352         (main): Use ARGMATCH_TO_ARGUMENT.
4353         (decode_switches): Use ARGMATCH instead of argmatch code
4354         in each of several cases.
4355         From Akim Demaille.
4357         * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
4358         * src/touch.c (main): Likewise.
4359         * lib/backupfile.c (get_version): Likewise.
4360         From Akim Demaille.
4362         * lib/strncasecmp.c: New file.
4363         * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
4364         * lib/argmatch.c (strncasecmp): Move to a separate file.
4365         Add curly braces around some one-stmt-but-multiline blocks.
4367         * lib/argmatch.c: Improvements from Akim Demaille.
4368         * lib/argmatch.h: Likewise.
4370         * lib/addext.c (addext): Protoize.
4371         Indent cpp directives to match nesting.
4373         Fix warnings from gcc -W -Wall
4374         * lib/posixtm.c (posix_time_parse): Change type of index `i' from
4375         int to unsigned int.
4376         * lib/getdate.y (__attribute__): Define.
4377         (ATTRIBUTE_UNUSED): Define.
4378         (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
4379         (MonthDayTable): Add initializers for last entry.
4380         (UnitsTable): Likewise.
4381         (OtherTable): Likewise.
4382         (MilitaryTable): Likewise.
4384 1998-12-22  Jim Meyering  <meyering@ascend.com>
4386         * Version 4.1-b1.
4388         * configure.in (ALL_LINGUAS): Add chinese (zh).
4390 1998-12-19  Jim Meyering  <meyering@ascend.com>
4392         * tests/ln/misc: Use absolute path for final rm.
4394         * Makefile.maint (my-distcheck): Run make with
4395         CFLAGS='-Wformat -Werror'.
4397 1998-12-18  Jim Meyering  <meyering@ascend.com>
4399         * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
4400         from format string.  From Michiel Bacchiani.
4402         * src/chgrp.c (MAXGID): Define.
4403         Use gid_t (not int) as the type for `group' variables.
4404         (parse_group): Use MAXGID, not INT_MAX.
4406         * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
4407         * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
4409 1998-12-13  Jim Meyering  <meyering@ascend.com>
4411         * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
4413 1998-12-12  Jim Meyering  <meyering@ascend.com>
4415         1998-10-15  Akim Demaille  <demaille@inf.enst.fr>
4416         * src/ls.c: Group DIRED's code together.
4417         (full_time, inhibit_group, col_ext_type): Declare static.
4418         (dired_dump_obstack): Apply sizeof to variable, instead of its type.
4419         (parse_ls_color): Rename ext2 as e2.  Move into the block where it
4420         is used.
4422         1998-10-15  Akim Demaille  <demaille@inf.enst.fr>
4423         * src/ls.c: In order to distinguish col(umn|or):
4424         (init_column_info): Renamed from init_col_info.
4425         (struct column_info): Renamed from struct col_info.
4426         (struct color_ext_type): Renamed from struct col_ext_type.
4428 1998-12-11  Jim Meyering  <meyering@ascend.com>
4430         * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
4431         (stat.c): Likewise.
4432         * lib/stat.c: Remove file.
4433         * lib/lstat.c: Remove file.
4434         * lib/xstat.in (xstat@): New file.
4436         * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
4437         From Bruno Haible.
4438         * tests/ls-2/tests: Add a test for this.
4440         * man/help2man: import version 1.006.
4442 1998-12-07  Jim Meyering  <meyering@ascend.com>
4444         * src/copy.c: Use dir_name, not dirname.  Include dirname.h.
4445         * src/cp.c: Likewise.
4446         * src/df.c: Likewise.
4447         * src/install.c: Likewise.
4448         * src/ln.c: Likewise.
4449         * src/mvdir.c: Likewise.
4451         * lib/dirname.c (dir_name): Rename from dirname.
4452         Make argument `const'.  Include "dirname.h"
4453         * lib/dirname.h: New file.
4454         * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
4456 1998-12-06  Jim Meyering  <meyering@ascend.com>
4458         * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
4459         `^[yY]' and `^[nN]' (avoiding regex).  From Karl Heuer.
4461         * lib/*.c: Ansideclify.
4463         Fix `ls -R .' formatting bug that broke mktexlsr.
4464         * src/ls.c: Include path-concat.h.
4465         (basename_is_dot_or_dotdot): New function, derived from
4466         is_not_dot_or_dotdot.
4467         (is_not_dot_or_dotdot): Remove function.
4468         (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
4469         instead of is_not_dot_or_dotdot and use path_concat instead of attach.
4471         * tests/ls-2/tests: New file (renamed from quoting),
4472         with new test for the `ls -R .' fix.
4473         * tests/ls-2/quoting: Remove file.
4474         * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
4476 1998-11-29  Jim Meyering  <meyering@ascend.com>
4478         * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
4479         * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
4481         * src/dd.c (dd_copy): Rename function from `copy'.
4483         * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
4485         Per Kristian Hove reported that a certain move-directory-into-self
4486         wasn't properly diagnosed.
4488         * tests/mv/into-self-3: New file.
4489         * tests/mv/Makefile.am (TESTS): Add into-self-3.
4490         * src/copy.c (copy_internal): Remove earlier (but less effective)
4491         test for move/copy-into-self.
4492         Instead, deduce the move-into-self condition from errno==EINVAL
4493         after a failed rename.
4494         * src/mv.c (do_move): Don't arrange to remove DEST in the
4495         copied-into-self case.
4497 1998-11-15  Jim Meyering  <meyering@ascend.com>
4499         Bob McCracken reported that mv couldn't handle certain combinations
4500         of hard linked source files.
4502         * tests/mv/hard-link-1: New file.
4503         * tests/mv/Makefile.am (TESTS): Add hard-link-1.
4504         * src/mv.c (movefile): Don't free new_dest.
4506         * lib/error.c (error): Don't use strerror_r's return value.
4507         From Johan Danielsson.
4509 1998-11-14  Jim Meyering  <meyering@ascend.com>
4511         * Version 4.0.
4513         * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
4514         to avoid matching a prefix of another tag.
4516 1998-11-10  Jim Meyering  <meyering@ascend.com>
4518         * configure.in (ALL_LINGUAS): Add Greek (el).
4519         * po/el.po: New file.
4521 1998-11-07  Jim Meyering  <meyering@ascend.com>
4523         * Version 4.0-b7.
4525         Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
4526         work on Hurd systems because of an inline definition of lstat in a
4527         system header file).  This also makes it so that you may run `ls '' '
4528         on systems that let l?stat operate on the empty string.
4530         * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
4531         and declare the latter.
4532         * lib/stat.c [stat]: Remove #undef.
4533         (rpl_stat): Protoize.
4534         * lib/lstat.c [lstat]: Remove #undef.
4535         (rpl_lstat): Protoize.  Use ENOENT, not EINVAL, to be consistent
4536         with lib/stat.c.
4537         * acconfig.h: Remove #undef's for lstat and stat.
4539 1998-10-31  Jim Meyering  <meyering@ascend.com>
4541         * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
4542         but comment it out.
4543         * tests/rm/empty-name: New file.
4545         * acconfig.h (stat): New #undef.
4546         This omission was uncovered when Mark Kettenis reported that
4547         `rm -r ''' got a failed assertion on the Hurd.  This change
4548         doesn't fix *that* problem -- see above.
4550 1998-10-25  Jim Meyering  <meyering@ascend.com>
4552         * Version 4.0-b6.
4554         * README: Man pages will now be supported to the extent that
4555         people send patches.
4557         * tests/rm/unreadable: Two new tests.
4558         * tests/rm/Makefile.am (TESTS): Add new test `unreadable'.  But comment
4559         it out since we're so close to release and since the test compares the
4560         text of diagnostics that are likely to vary between systems.
4561         (TEST_ENVIRONMENT): Add required framework.
4563         * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
4564         pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
4565         Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
4566         (remove_dir): Return `status', rather than always RM_OK.
4568 1998-10-18  Jim Meyering  <meyering@ascend.com>
4570         * Version 4.0-b5.
4572         * lib/mktime.c: Update from libc with this additional change from Paul.
4573         * lib/strftime.c: Likewise.
4575         1998-10-17  Paul Eggert  <eggert@twinsun.com>
4577         Don't invoke localtime_r or gmtime_r unless it's the GNU C
4578         library's localtime_r and gmtime_r; there are too many buggy
4579         implementations of localtime_r and gmtime_r out there, and
4580         it's not worth keeping track of all the different bugs.
4582         * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
4583         (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
4584         Base it on localtime unless _LIBC.
4586         * strftime.c (__EXTENSIONS__): Remove.
4587         (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
4588         (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
4589         Base them on localtime/gmtime if not _LIBC.
4591 1998-10-17  Jim Meyering  <meyering@ascend.com>
4593         * Version 4.0-b4.
4595         * lib/mktime.c: Declare localtime_r if necessary.
4596         * lib/strftime.c: Likewise.
4598         * tests/Fetish.pm (run_tests): Run $prog with --version only
4599         if $verbose.
4601 1998-10-11  Jim Meyering  <meyering@ascend.com>
4603         * Version 4.0-b3.
4605 1998-10-08  Paul Eggert  <eggert@twinsun.com>
4607         * mktime.c (__mktime_internal): When the requested time falls
4608         in a spring-forward gap of size DT, return a time that is DT
4609         away from the requested time, preferring a time whose tm_isdst
4610         differs from the requested value.  Bump the max number of
4611         probes from 4 to 6 to account for the extra probes needed to
4612         discover a spring-forward gap in the worst case.
4614 1998-10-08  Paul Eggert  <eggert@twinsun.com>
4616         * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
4617         Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
4618         a body that merely expands localtime_r; this works around a
4619         bug in Digital Unix 4.0A and 4.0D.
4621 1998-10-05  Jim Meyering  <meyering@ascend.com>
4623         * po/Makefile.in.in (uninstall): Remove (historical?) command that
4624         removed po-Makefile.in.in.  From Akim Demaille.
4626         * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
4627         From aldomel.
4629 1998-10-04  Jim Meyering  <meyering@ascend.com>
4631         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
4632         From Kaveh Ghazi.
4634 1998-10-03  Jim Meyering  <meyering@ascend.com>
4636         * Version 4.0-b2.
4638         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
4640         * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
4641         Instead, depend on corresponding source file and on configure.in.
4642         Based on suggestion and code from Akim Demaille.
4643         Factor out irregular men into Makefile.summ.
4645         * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
4647         * man/Makefile.summ: New file.
4648         * man/Makefile.maint: Include it.
4650         * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
4652         * tests/mv/Makefile.am (TESTS): Add i-1.
4653         * tests/mv/i-1: New test.
4655 1998-10-02  Jim Meyering  <meyering@ascend.com>
4657         * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
4658         * tests/ls-2/run-test: Remove file.
4659         * tests/ls-2/quoting: Include /bin/sh driver framework.
4661         * tests/dircolors/simple: Remove file.
4662         * tests/dircolors/run-test: Embed it here instead.
4663         * tests/dircolors/simple: Rename from run-test.
4665 1998-10-01  Jim Meyering  <meyering@ascend.com>
4667         * tests/Makefile.am (EXTRA_DIST): Remove README.
4668         From Akim Demaille.
4670 1998-09-28  Jim Meyering  <meyering@ascend.com>
4672         * Version 4.0-pre1.
4674         * Use automake-1.3b.  See notes in README.
4676         * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
4677         Otherwise, `touch a b; echo n|mv -i a b' would remove b.
4678         From Bernd Leibing.
4680 1998-09-27  Jim Meyering  <meyering@ascend.com>
4682         * Version 3.16z.
4684         * Makefile.maint (alpha): New target.
4685         (my-distcheck): Tweak.
4687         * lib/backupfile.h: Protect against multiple inclusion.
4688         From Akim Demaille.
4690         * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
4691         Now, it is invoked through jm_MACROS.
4693         * lib/strftime.c (my_strftime): Update from FSF.
4695 1998-09-26  Jim Meyering  <meyering@ascend.com>
4697         * src/copy.c (copy_internal): Don't preserve hard-linked directories
4698         to avoid damaging the destination filesystem when copying from a
4699         Netapp snapshot directory.  With code from Kjetil Torgrim Hollstein
4700         and Paul Eggert.
4702 1998-09-24  Jim Meyering  <meyering@ascend.com>
4704         * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
4705         From Akim Demaille.
4707 1998-09-21  Jim Meyering  <meyering@ascend.com>
4709         * man/Makefile.maint ($(man_MANS)): Remove `echo'.
4711 1998-09-20  Jim Meyering  <meyering@ascend.com>
4713         * Version 3.16y.
4715         * src/install.c (install_file_to_path) [-D]: Create any leading
4716         directories with permissions of 0755.
4718 1998-09-19  Jim Meyering  <meyering@ascend.com>
4720         * src/install.c (install_file_to_path): Copy the file after creating
4721         any leading directories.
4722         (main) [case 'v']: Set `x.verbose' to 1, not 0.
4723         Reported by Marty Leisner.
4725         * man/Makefile.am (transform): Define.
4726         (man_MANS): Include ginstall.1, not install.1, to match the name
4727         of the executable in ../src.
4728         * man/ginstall.x: New file.
4729         * man/install.x: Remove file.
4730         * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
4732         * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
4733         Reported by Akim Demaille.
4735         * lib/modechange.c: Fix post-protoization typo.
4737         * lib/posixtm.h (PARAMS): Define and use.
4738         From Kaveh Ghazi.
4740 1998-09-12  Jim Meyering  <meyering@ascend.com>
4742         * Version 3.16x.
4744         * src/remove.c (remove_cwd_entries): Declare to be static.
4746         Automatically generate man pages from combination of --help
4747         output and the contents of new, man/*.x files.
4748         * man/Makefile.am (HELP2MAN): Define.
4749         (man_aux): Define.
4750         (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
4751         (MAINTAINERCLEANFILES): Add $(man_MANS).
4752         * man/*.x: New files.
4753         * man/GNUmakefile: New file.
4754         * man/Makefile.maint: New file.
4755         * man/help2man: New file.
4757 1998-09-09  Jim Meyering  <meyering@ascend.com>
4759         * lib/modechange.c: Protoize.
4761 1998-09-07  Jim Meyering  <meyering@ascend.com>
4763         * Version 3.16w.
4765         * src/df.c (show_dev) [!posix_format]: When using --print-type,
4766         let the device path and the file system type share a single (wider)
4767         field if their combined lengths allow it.  From Andries Brouwer.
4769         * tests/touch/empty-file: Upon failure, suggest how to rerun the test
4770         with longer delay, in case NFS clock skew was the cause of the failure.
4771         Reported by Kaveh Ghazi.
4773         * tests/ls-2/quoting: Add tests.
4774         * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
4775         (_create_file): Don't include $$ in temp file name.
4776         (run_tests): Use shorter suffixes for temp file names.
4778 1998-09-06  Jim Meyering  <meyering@ascend.com>
4780         * src/touch.c: Include posixtm.h.
4781         (usage): Correct the description of the format of the
4782         date string argument to -t option.
4783         (main): Update to use rewritten posixtime function.
4784         Reported by Andries Brouwer.
4786         * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
4787         (noinst_HEADERS): Add posixtm.h.
4789         * lib/posixtm.h: New file.
4790         * lib/posixtm.c: New file.  Rewritten based on posixtm.y.
4791         * lib/posixtm.y: Remove file.
4793 1998-09-05  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
4795         * src/ls.c (print_dir_name): Put back.
4796         (print_dir): Also print directory name header if print_dir_name is
4797         true.
4799 1998-08-29  Jim Meyering  <meyering@ascend.com>
4801         * Version 3.16v.
4803         * src/du.c (long_options): Use corresponding short-option character
4804         in place of `1', and `NULL' in place of pointer in initialization.
4805         * src/cp.c (long_opts): Likewise.
4806         * src/ln.c (long_options): Likewise.
4807         * src/mkdir.c (longopts): Likewise.
4808         * src/rmdir.c (longopts): Likewise.
4809         * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
4810         respectively.
4811         * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
4812         * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
4814         * tests/Fetish.pm: New file -- moved from ls-2/.
4815         * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
4816         * tests/Makefile.am (SUBDIRS): Add dircolors.
4817         (EXTRA_DIST): Add Fetish.pm.
4818         * tests/dircolors: New directory
4820         * src/ls.c (print_dir_name): Remove global variable.
4821         (print_dir): When trace_dirs is set, always print the directory
4822         name header.
4824 1998-08-26  Jim Meyering  <meyering@ascend.com>
4826         * src/dircolors.c (dc_parse_stream): Don't segfault when a line
4827         contains only one token.  Reported by Olav Morkrid.
4829 1998-08-24  Paul Eggert  <eggert@twinsun.com>
4831         * src/system.h (CHAR_MIN, CHAR_MAX):
4832         Renamed from SCHAR_MIN, SCHAR_MAX, since these
4833         macros apply to char, not signed char.
4835         * src/df.c, src/du.c, src/touch.c (long_options, main):
4836         Don't assume ASCII.
4838 1998-08-18  Paul Eggert  <eggert@twinsun.com>
4840         Port nanosecond-resolution times to UnixWare 2.1.2 and
4841         pedantic Solaris 2.6.
4843         * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
4844         * acconfig.h (ST_MTIM_NSEC): New #undef.
4845         * src/system.h: (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
4846         Use new ST_MTIM_NSEC macro.
4848 1998-08-16  Jim Meyering  <meyering@ascend.com>
4850         * lib/filemode.h (PARAMS): Define and use.
4851         From Kaveh Ghazi.
4853 1998-08-15  Jim Meyering  <meyering@ascend.com>
4855         * Version 3.16u.
4857         * Makefile.maint (announcement): New target.
4859         * tests/mv/into-self: Update to reflect changed behavior of mv.
4860         * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
4861         With prodding from François Pinard :-)
4863         * tests/ls-2/Fetish.pm: New file
4864         * tests/ls-2/run-test: New file
4866         * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
4867         directories (but none of their entries).  This makes `cp --archive
4868          --one-file-system' use the same policy `tar --one-file-system' does.
4869         From Marty Leisner.
4871         * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
4873 1998-08-14  Jim Meyering  <meyering@ascend.com>
4875         * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
4876         Reported by Christian von Roques.
4878         * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
4879         * tests/Makefile.am (SUBDIRS): Add ls-2.
4880         * tests/ls-2: New directory
4882 1998-08-14  Christian von Roques  <roques@pond.sub.org>
4884         * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
4885         infloop on getmnt(2) returning 0.
4887         * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
4888         not initializing output redirection of : command.
4889         * tests/mv/backup-is-src: Likewise.
4890         * tests/rm/i-1: Likewise.
4892 1998-08-12  Jim Meyering  <meyering@ascend.com>
4894         * po/Makefile.in.in: Provide automake-style DESTDIR support.
4895         From Johan Danielsson.
4896         (DISTFILES): Remove ChangeLog.
4897         po/ChangeLog: Remove empty file.
4899         * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
4901         * src/ls.c: Include filemode.h.
4902         * src/chmod.c: Likewise.
4904         * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
4905         From Johan Danielsson.
4906         Protoize.  Tsort function definitions and remove prototypes of
4907         static functions.
4908         (mode_string): Remove prototype.
4909         * lib/filemode.h (mode_string): New file.
4910         * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
4912 1998-08-09  Jim Meyering  <meyering@ascend.com>
4914         * Version 3.16t.
4916 1998-07-31  Paul Eggert  <eggert@twinsun.com>
4918         Add support for filesystems whose timestamps have better resolution
4919         than 1 second (e.g. Solaris 2.6, recent Linux kernels).
4921         * configure.in (AC_STRUCT_ST_MTIM): Add.
4923         * src/copy.c (copy_internal): Compare time stamps with
4924         subsecond resolution if available.
4926         * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
4927         rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
4928         stamps with subsecond resolution if available.
4930         * src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
4931         CTIME_CMP, MTIME_CMP): New macros.
4933 1998-08-01  Jim Meyering  <meyering@ascend.com>
4935         * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
4937 1998-07-28  Paul Eggert  <eggert@twinsun.com>
4939         * lib/mountlist.c (read_filesystem_list): Remove all_fs
4940         argument, but put the necessary information into the result so
4941         that the caller can ignore filesystems that he's not
4942         interested in.
4944         * lib/mountlist.h (struct mount_entry):
4945         New members me_dummy, me_remote.
4946         (read_filesystem_list): Remove all_fs argument.
4947         (REMOTE_FS_TYPE): Remove.
4948         (ME_DUMMY, ME_REMOTE): New macros.
4950         * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
4952         * src/df.c (show_all_fs):
4953         Revert to boolean value; the old negative value is
4954         now in show_local_fs.
4955         (show_local_fs): New variable.
4956         (show_dev): New args me_dummy and me_class.  Use show_local_fs
4957         and boolean show_all_fs in combination with these new args
4958         to decide whether to show a device.
4959         (show_disk): Pass flags to show_dev.
4960         (show_point): Use a non-dummy mount entry if possible.
4961         (show_all_entries): Pass flags to show_dev.
4962         (main): --local sets show_local_fs now.  Ask for file system types if
4963         show_local_fs is nonzero, since ME_REMOTE might need them.
4965 1998-07-27  Jim Meyering  <meyering@ascend.com>
4967         * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
4969         * tests/install/basic-1: Add a test for this.
4970         * src/install.c: Make copy create each destination file initially
4971         with mode 0600 so strip will work, then apply specified mode.
4972         Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
4974 1998-07-25  Jim Meyering  <meyering@ascend.com>
4976         * src/mv.c (chown): Remove unused definition.
4977         Reported by Kaveh Ghazi.
4979         * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
4980         Handle that, so --ignore-fail-on-non-empty works.
4981         (EEXIST): Define to zero if not defined.
4982         (ENOTEMPTY): Likewise.
4984         * tests/cp/same-file: Remove `diff' I'd put in for debugging.
4985         Exit with the status from cmp.
4987         * Version 3.16s.
4989         * tests/cp/same-file: Skip three more unportable tests.
4990         These failed on SunOS4.1.4.
4992         * src/copy.c (SAME_INODE): Remove definition.
4993         * src/sys2.h (SAME_INODE): Define it here instead.
4995         * src/remove.c (same_file): New function.
4996         (remove_dir): Use it to give a better diagnostic when rmdir fails
4997         because it can't remove the current directory.
4999         * src/df.c (long_options): Changes table entries not to use this form:
5000         {"all", no_argument, &show_all_fs, 1},
5001         but rather this form:
5002         {"all", no_argument, NULL, 'a'},
5003         Using the latter, all the option handling in one place: the getopt loop.
5005         * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
5006         Use fsp_to_string.
5007         (fsp_to_string): Don't xmalloc return value (yet).
5008         (xatoi): Ansideclify.
5009         (fstype_to_string): Ansideclify.
5010         * lib/mountlist.h: Define and use PARAMS macro.
5012         * lib/utime.c: New file.
5013         * src/touch.c (utime_now): Moved into m4/utimes.m4.
5014         (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
5015         in the if-block.
5017         * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
5019 1998-07-22  Paul Eggert  <eggert@twinsun.com>
5021         * lib/human.c (human_readable): amt -> damt, to fix typo when
5022         computing which power to use after overflow occurs during
5023         multiplication.
5025         * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
5026         needed on SunOS 4.
5028 1998-07-21  Paul Eggert  <eggert@twinsun.com>
5030         Add df -l or --local option.
5031         * doc/fileutils.texi: Document it.
5032         * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
5033         * lib/mountlist.c (read_filesystem_list):
5034         If all_fs is negative, omit non-local filesytems.
5036         * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
5037         (show_all_fs): If negative, omit non-local filesystems.
5038         All uses of (all_fs != 0) changed to (all_fs > 0).
5039         (long_options, usage, main): Add -l or --local option.
5040         (main): When asking for df of an explicit file name, get all
5041         the mount points, so that we're more likely to find it when
5042         we look it up.
5044 1998-07-18  Jim Meyering  <meyering@ascend.com>
5046         * src/copy.c (copy_internal): Add another exclusion from the
5047         sameness test: when --force has been specified, the destination
5048         is unlinked before any copy.
5049         (copy_internal): Add yet another: when both src and dest are symlinks.
5051         * tests/touch: New subdir.
5052         * tests/Makefile.am (SUBDIRS): Add touch.
5053         * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
5055         * tests/mv/into-self-2: New test.
5056         * tests/mv/Makefile.am (TESTS): Add into-self-2.
5058 1998-07-06  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5060         * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
5061         failure.
5063 1998-07-16  Jim Meyering  <meyering@ascend.com>
5065         Work around failure of chown calls on m68k-motorola-sysv systems.
5066         * src/chown.c: Include lchown.h.
5067         * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
5068         * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
5069         * lib/lchown.c: Include lchown.h.
5070         Reported by and with suggestions from Manfred Hollstein.
5072 1998-07-12  Paul Eggert  <eggert@twinsun.com>
5074         * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
5076 1998-07-07  Jim Meyering  <meyering@ascend.com>
5078         * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
5079         Suggestion from Ulrich Drepper.
5081 1998-07-04  Jim Meyering  <meyering@ascend.com>
5083         * lib/safe-read.c (safe_read): Change type of pointer parameter to
5084         `void' to avoid Irix4 cc errors.  Reported by Kaveh Ghazi.
5085         * lib/safe-read.h: Update prototype.
5087         * src/dircolors.c (parse_line): Add casts to avoid errors from
5088         Irix4's `cc' C compiler.  From Kaveh Ghazi.
5090         * lib/xstrtol.c: Include stdio.h.  Required on some systems when
5091         using assert.  From Kaveh Ghazi.
5093         * tests/mv/backup-is-src: Use cmp, not diff.
5094         Reported by Kaveh Ghazi.
5096 1998-07-03  Jim Meyering  <meyering@ascend.com>
5098         * Version 3.16r.
5100         * src/remove.c (remove_dir): Use fprintf (not error) to avoid
5101         newline in prompt.
5103 1998-06-30  Paul Eggert  <eggert@shade.twinsun.com>
5105         * lib/mountlist.c: (read_filesystem_list):
5106         Don't leak memory on failure.
5107         Don't create a dummy struct mount_entry entry;
5108         use the address-of-the-tail-address method instead.
5109         Preserve errno if possible on failure, setting it to 0 if inapplicable.
5110         Close file descriptor leak if the F_SETLKW failed.
5111         Report an error if SVR4 lock file cannot be opened for some reason
5112         other than a nonexistent lock file.
5114 1998-07-03  Jim Meyering  <meyering@ascend.com>
5116         * configure.in (AM_WITH_REGEX): Remove.  Now the replacement
5117         macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
5118         * acconfig.h (WITH_REGEX): Remove undef.
5119         * lib/Makefile.am (noinst_HEADERS): Add regex.h.
5120         * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
5121         * lib/rx.c: Remove file.
5122         * lib/rx.h: Remove file.
5124         * src/df.c (df_readable): Rename local so as not to shadow global.
5126         * src/copy.c (SAME_INODE): New macro.
5127         Use it to replace open-coded equivalents.
5128         (copy_internal): Rename variable and reverse sense of tests
5129         to make the code a little clearer.
5131 1998-07-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5133         * src/copy.c (copy_internal): Try harder identifying a relative
5134         symbolic link in the current directory.
5136         * src/copy.c (copy_internal): Don't skip test for same file if
5137         creating a hardlink from symlink over a non-symlink while making
5138         backups.
5139         * tests/cp/same-file: Skip tests that depend on link(2) not
5140         following symlinks.
5142 1998-07-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5144         * src/copy.c (copy_internal): Don't call chown on a symlink.
5146 1998-07-01  Jim Meyering  <meyering@ascend.com>
5148         * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
5149         configure's --disable-assert option.
5151 1998-06-29  Paul Eggert  <eggert@twinsun.com>
5153         * lib/mountlist.c (read_filesystem_list):
5154         Plug file descriptor leak on failure.
5155         Report failure if lock file can't be opened for some reason
5156         other than nonexistence.
5158 1998-06-29  Jim Meyering  <meyering@ascend.com>
5160         * Version 3.16q.
5162         * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
5163         Always close stream and file descriptor before returning.
5165         * src/df.c (main): Move the test of the result of the
5166         read_filesystem_list call up out of if-block -- code in the
5167         else-block depends on it too.
5169 1998-06-29  Paul Eggert  <eggert@twinsun.com>
5171         * lib/mountlist.c: (read_filesystem_list): If SVR4, lock
5172         /etc/.mnttab.lock if available, to avoid race conditions
5173         (e.g. with the automounter on Solaris 2.6).
5175         Include <errno.h>, <fcntl.h>, <unistd.h>.
5177 1998-06-29  Jim Meyering  <meyering@ascend.com>
5179         * lib/mountlist.c (fstype_to_string): Guard with
5180         #if ! HAVE_F_FSTYPENAME_IN_STATFS.
5182 1998-06-28  Paul Eggert  <eggert@twinsun.com>
5184         Add support for new --block-size option and
5185         BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
5186         Adjust df output slightly to accommodate larger filesystems.
5188         * lib/human.c, lib/human.h (human_readable): Coalesce last two args
5189         into one, for convenience.  All callers changed.
5190         (human_block_size): New function.
5191         * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
5192         Include <stdlib.h> if HAVE_STDLIB_H;
5193         declare getenv unless HAVE_DECL_GETENV.
5194         (_): New macro.
5195         Include <argmatch.h>, <error.h>, <xstrtoul.h>.
5196         (DEFAULT_BLOCK_SIZE): New macro.
5197         (block_size_args, block_size_types): New constants.
5198         (humblock): New function.
5199         * lib/xstrtol.h (__ZLONG_MAX): Remove.
5200         * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
5201         unsigned long to double without losing information.
5202         (bkm_scale_by_power): New function.
5204         * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
5205         Add support for SI-like suffixes like "GB" and "TD".
5206         * src/dd.c (usage): Describe it.
5208         * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
5209         Remove; replace with new variable output_block_size.  All uses changed.
5210         (long_options, usage, main): Add --block-size.
5211         (main, decode_switches): Use new human_block_size function to
5212         initialize output block size consistently with other programs.
5214         * src/df.c (print_header, show_dev): Shrink some columns and expand
5215         others, to squeeze in support for today's larger filesystems.
5216         (print_header): Print output block size using power-of-1024 SI format.
5217         (df_readable): Coalesce last two args into one, for convenience.
5218         All callers changed.
5219         (main): Remove check for portable output format and larger
5220         or human-readable block sizes.
5222         * NEWS, doc/fileutils.texi: Describe above changes.
5224 1998-06-28  Jim Meyering  <meyering@ascend.com>
5226         * src/ls.c (usage): Make --kilobytes description consistent with
5227         that in du and df.  From Göran Uddeborg.
5229         * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
5230         now that we're using the jm_FSTYPENAME autoconf macro.
5231         James Tanis reported the old version didn't compile on BSDI3.
5233         * configure.in: Move big block of list_mounted_fs checks into
5234         new jm_LIST_MOUNTED_FILESYSTEMS macro.
5235         Use new jm_FSTYPENAME macro.
5237         * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
5238         * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
5239         FPUTS_LITERAL
5241 1998-06-27  Jim Meyering  <meyering@ascend.com>
5243         * src/copy.c (copy_reg): Detect identical source and dest here.
5244         (copy_internal): Make the test symmetric.
5246         * tests/cp/same-file: New file.
5247         * tests/cp/Makefile.am (TESTS): Add it.
5249 1998-06-26  Jim Meyering  <meyering@ascend.com>
5251         * src/remove.c (remove_file): Remove `non-directory' part of
5252         `removing non-directory FILE' verbose message.
5254 1998-06-23  Jim Meyering  <meyering@ascend.com>
5256         * src/df.c (show_dev): Increase field width for blocks, used,
5257         and available columns from 7 to 8.
5259 1998-06-21  Jim Meyering  <meyering@ascend.com>
5261         * aclocal.m4: Regenerate with fixed gettext.m4 installed.
5262         See README-alpha for details.
5264 1998-06-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5266         * src/automake-wrap: Quote `&' in sed replacement text.
5268 1998-05-31  Jim Meyering  <meyering@ascend.com>
5270         * Version 3.16p.
5272         * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
5273         Reported by Don Parsons.
5275 1998-05-30  Jim Meyering  <meyering@ascend.com>
5277         * tests/ls/time-1: Clean up ctime test.  Note that it fails also
5278         on Solaris5.5.1 tmpfs file systems.
5280         Solve the `rm -f rm' problem more cleanly.
5281         * src/.rm-warning: Remove file.
5282         * src/automake-wrap: New file.
5283         * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
5284         (Makefile.in): Depend on automake-wrap.
5285         (EXTRA_DIST): Add automake-wrap.
5286         (DISTCLEANFILES): Remove definition.
5287         (rm_DEPENDENCIES): Likewise.
5288         (.rm-warn-stamp): Remove rule.
5290 1998-05-27  Jim Meyering  <meyering@ascend.com>
5292         * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
5293         * tests/ls/rt-1: New file, renamed from cr-1.
5295 1998-05-26  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5297         * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
5299         * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
5300         to set it reliably.
5302 1998-05-25  Jim Meyering  <meyering@ascend.com>
5304         * configure.in (_GNU_SOURCE): AC_DEFINE it here.
5305         * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
5306         [!_GNU_SOURCE]: Add #undef instead.
5308 1998-05-24  Jim Meyering  <meyering@ascend.com>
5310         * Version 3.16o.
5312         * src/ansi2knr.c: Use new version from automake-1.3.
5314         * src/chown.c: Accept new option, --dereference.
5315         --no-dereference is now the default.
5316         (enum Change_status) [CH_NOT_APPLIED]: New member.
5317         (change_symlinks): Enable this by default, now.
5318         (describe_change): Handle new case.
5319         (change_file_owner): Add new parameter: cmdline_arg.  Update callers.
5320         Reorganize to reflect changed semantics.
5321         (LCHOWN): Remove definitions.
5323         * lib/lchown.c: New file.
5325 1998-05-21  Jim Meyering  <meyering@ascend.com>
5327         * configure.in (ALL_LINGUAS): Add russian (ru).
5329 1998-05-16  Jim Meyering  <meyering@ascend.com>
5331         * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
5332         (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
5334         * lib/hash.c (is_prime): Ansideclify.
5335         (next_prime): Ansideclify.  Add an assertion.
5337         * lib/Makefile.am (EXTRA_DIST): Remove.  Automake groks the `LIBOBJS='
5338         lines from the m4/*.m4 macros, so the hack of including some
5339         custom-replaced C source file names here is no longer needed.
5341         * configure.in (jm_MACROS): New wrapper macro.
5342         Remove uses of most jm_* macros.
5344         * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef.  Now it's handled
5345         as part of utimbuf.m4.
5346         (memcmp): Add #undef.
5348 1998-05-12  Jim Meyering  <meyering@ascend.com>
5350         * configure.in: Use my replacement AC_ISC_POSIX rather than
5351         open-coding it.
5353         * src/copy.c (copy_internal): Plug a small leak.
5355 1998-05-10  Jim Meyering  <meyering@ascend.com>
5357         * src/mv.c (do_move): Remove lots of code that was duplicated in
5358         copy.c (copy), now that copy() has better support for mv.  This fixes
5359         a bug with cross-filesystem `mv -i' whereby you could get two prompts
5360         for the same destination file and eventually remove the destination
5361         file even though one of the responses was negative.
5362         Reported by Dirk Lattermann.
5364         * src/copy.h: Better support for mv:
5365         [struct cp_options] (move_mode): New member.
5366         * src/copy.c (copy_internal): Use new move_mode member.
5367         Add parameter.
5368         (copy): Add parameter.
5370         * tests/cp/Makefile.am (TESTS): Add backup-is-src.
5371         * tests/mv/Makefile.am (TESTS): Likewise.
5373         * lib/userspec.c: Don't declare strdup if it's defined as a macro.
5374         Reported by Lorne Baker.
5376         * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
5378         * src/mv.c (cp_option_init): Initialize new members.
5379         * src/cp.c (cp_option_init): Likewise.
5380         (main): Set new preserve_* options.
5382 1998-05-09  Jim Meyering  <meyering@ascend.com>
5384         * src/copy.h: Support for install:
5385         [struct cp_options] (failed_unlink_is_fatal): New member.
5386         (preserve_owner_and_group): New member.
5387         (preserve_chmod_bits): New member.
5388         (preserve_timestamps): New member.
5389         (preserve): Remove member.
5390         (set_mode): New member.
5391         (mode): New member.
5392         * src/copy.c (new_nondir_mode): New function.  Use where appropriate.
5393         Use more-specific preserve_* members in place of removed `preserve'.
5394         (copy_internal): Honor failed_unlink_is_fatal.
5396         * src/install.c (main): Rewrite argv-handling to be clearer.
5397         (copy_file): Rewrite to use copy.c (copy).
5398         (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
5399         `no_need_to_chown' parameter.  Fix caller.
5400         (install_file_in_file): Remove now-unnecessary `to_created' parameter.
5401         (cp_option_init): New function.
5402         Update several functions to take new parameter specifying copy options.
5404         * tests/install: New subdir, with one basic test.
5405         * tests/Makefile.am (SUBDIRS): Add install.
5406         * configure.in (AC_OUTPUT): Add tests/install/Makefile.
5408         * src/dd.c: Include safe-read.h.
5409         Don't declare safe_read.
5410         * src/touch.c: Likewise.
5412         * configure.in (jm_TYPE_SSIZE_T): Use it.
5413         * acconfig.h (ssize_t): Add undef.
5415 1998-05-03  Jim Meyering  <meyering@ascend.com>
5417         * po/: Update from gettext-0.10.35.
5418         * intl/: Likewise.
5419         * configure.in: Remove use of AC_LINK_FILES.
5420         (AC_OUTPUT): Remove po/Makefile-generating sed command.
5422 1998-04-28  Jim Meyering  <meyering@ascend.com>
5424         * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
5425         Use unsigned char * pointers, not potentially signed ones, to avoid
5426         sign extension.
5428 1998-04-26  Jim Meyering  <meyering@ascend.com>
5430         * configure.in: Use jm_ASSERT.
5431         * acconfig.h: Add NDEBUG.
5433         * src/mv.c: Don't define NDEBUG.
5434         * src/cp.c: Likewise.
5436 1998-04-14  Jim Meyering  <meyering@ascend.com>
5438         * src/.rm-warning: New file.
5439         * src/Makefile.am (EXTRA_DIST): Add .rm-warning
5440         (DISTCLEANFILES): Add .rm-warn-stamp.
5441         (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
5442         (.rm-warn-stamp): New rule.
5443         (rm_prep): Comment out rule.
5445         * src/df.c (main): Use STREQ in string equality tests, not strcmp.
5446         * src/dircolors.c (dc_parse_stream): Likewise.
5447         (dc_parse_file): Likewise.
5448         * src/du.c (main): Likewise.
5449         * src/ls.c (decode_switches): Likewise.
5450         * src/remove.c (hash_compare_strings): Likewise.
5451         * src/touch.c (main): Likewise.
5453 1998-04-13  Jim Meyering  <meyering@ascend.com>
5455         * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
5457 1998-04-11  Jim Meyering  <meyering@ascend.com>
5459         * lib/hash.c: Add curly braces around statements in
5460         if/else/while/do/etc. that span more than a line -- even around
5461         multiline simple statements or single-line simple statements
5462         preceded by a comment line.
5464 1998-04-09  Jim Meyering  <meyering@ascend.com>
5466         * configure.in: Don't use AC_PATH_PROG to check for perl, now that
5467         we use jm_PERL.
5469 1998-04-06  Jim Meyering  <meyering@ascend.com>
5471         * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
5472         hash_insert.  Also declare to be static.
5473         * src/cp-hash.h (hash_insert): Remove declaration.
5475         * lib/hash.c: Lots of minor spec and name changes, and new comments.
5476         (hash_rehash): Rewrite to be easier on the allocator.
5477         From François Pinard.
5478         * lib/hash.h: More comments.
5479         * src/remove.c: Change names/usage of hash-related functions to work
5480         with the above.
5482 1998-04-05  Jim Meyering  <meyering@ascend.com>
5484         * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
5485         This now depends on HAVE_BTOWC so systems that lack btowc (like
5486         solaris-2.5.1) don't lose.
5488 1998-04-04  Jim Meyering  <meyering@eng.ascend.com>
5490         * GNUmakefile: Add conditionals so that running `make' in an
5491         unconfigured source directory will get a reasonable diagnostic.
5493         * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
5494         know about the m4/ subdirectory.
5495         * Makefile.maint (aclocal-files): Remove now-unnecessary (with
5496         automake-1.2h and the above change) aclocal-related rules and includes.
5498 1998-04-01  Jim Meyering  <meyering@eng.ascend.com>
5500         * tests/ls/cr-1: New file.
5501         * tests/ls/Makefile.am (TESTS): Add cr-1.
5503 1998-03-31  Jim Meyering  <meyering@eng.ascend.com>
5505         * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
5506         works with `unsigned char'.
5507         From Greg Wooledge.
5508         (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
5510         * lib/xstrtol.c: Merge with the version from textutils.
5512         * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
5514 1998-03-30  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5516         * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
5517         rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
5518         rev_cmp_size): Use file name as secondary sort key to get
5519         consistent sorting.
5521 1998-03-28  Jim Meyering  <meyering@eng.ascend.com>
5523         * src/copy.c: Add copyright.
5524         * src/remove.c: Add copyright.
5525         [_AIX]: Add #pragma alloca.
5527 1998-03-27  Jim Meyering  <meyering@eng.ascend.com>
5529         * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
5530         dependency and the := assignment of ACLOCAL to make the default
5531         rule use the `-I m4' option.
5533         * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
5535 1998-03-23  Jim Meyering  <meyering@eng.ascend.com>
5537         * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
5538         automatically handles it.
5540 1998-03-21  Jim Meyering  <meyering@eng.ascend.com>
5542         * lib/quotearg.h: Update from patch-2.5.3.
5543         * lib/quotearg.c: Likewise.
5544         * src/ls.c (decode_switches): Pass a null pointer instead of address
5545         of quotearg_quoting_options.
5547 1998-03-19  Paul Eggert  <eggert@twinsun.com>
5549         * lib/fsusage.h (struct fs_usage): New member
5550         fsu_bavail_top_bit_set.
5551         * lib/fsusage.c: Include <limits.h>.
5552         (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
5553         (get_fs_usage): If top bit of system variable corresponding to
5554         fsu_bavail is set, then set fsu_bavail_top_bit_set, and
5555         sign-extend the value when storing it into fsu_bavail.
5556         * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
5557         assume the original value corresponding to fsu_bavail was negative.
5558         Reported by Arne Juul.
5560 1998-03-18  Jim Meyering  <meyering@eng.ascend.com>
5562         * src/Makefile.am (rm-prep): Add dependency and rule to save users
5563         with `.' too early in their PATH from the `rm: cannot unlink `rm':
5564         Text file busy' error.  Suggestion from Philippe De Muyter.
5566 1998-03-15  Jim Meyering  <meyering@eng.ascend.com>
5568         * Version 3.16n.
5570         * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
5571         * lib/closeout.c: Likewise.
5572         * lib/dirname.c: Likewise.
5573         * lib/euidaccess.c: Likewise.
5574         * lib/fileblocks.c: Likewise.
5575         * lib/filemode.c: Likewise.
5576         * lib/ftruncate.c: Likewise.
5577         * lib/group-member.c: Likewise.
5578         * lib/isdir.c: Likewise.
5579         * lib/long-options.c: Likewise.
5580         * lib/mountlist.c: Likewise.
5581         * lib/path-concat.c: Likewise.
5582         * lib/save-cwd.c: Likewise.
5583         * lib/savedir.c: Likewise.
5584         * lib/strcasecmp.c: Likewise.
5585         * lib/strdup.c: Likewise.
5586         * lib/userspec.c: Likewise.
5587         * lib/yesno.c:: Likewise.
5589         * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
5590         Use #if !, not #ifndef with HAVE_ macros.
5591         * src/chown.c: Likewise.
5592         * src/copy.c: Likewise.
5593         * src/dd.c: Likewise.
5594         * src/dircolors.c: Likewise.
5595         * src/install.c: Likewise.
5596         * src/ls.c: Likewise.
5597         * src/mv.c: Likewise.
5598         * src/touch.c: Likewise.
5600         * configure.in: Use jm_PREREQ.
5602 1998-03-14  Jim Meyering  <meyering@eng.ascend.com>
5604         Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
5605         With automake-1.2f, that hack is no longer needed.
5607         * src/remove.c: Use `virtual memory exhausted' message, not
5608         `Memory exhausted' to be consistent with the majority of other
5609         such messages.
5610         Say `removing all...', not `removing any...'.
5611         * src/rmdir.c (remove_parents): Be consistent with documentation of
5612         --verbose option and with remove.c in saying `removing...' before
5613         the operation is attempted.
5614         (main): Likewise.
5615         Suggestions from Santiago Vila.
5617         * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
5618         (copy_internal): Likewise.
5619         (copy): Likewise.
5620         Update all callers.
5621         * src/copy.h (copy): Update prototype.
5622         * src/cp.c (do_copy): Add unused arg in calls to copy.
5623         * src/mv.c (do_move): Add &copy_into_self arg in call to copy.
5624         Don't remove source directory when copy_into_self is nonzero.
5625         Reported by Arne Henrik Juul.
5627         * tests/mv/into-self: Test for the above.
5628         * tests/mv/Makefile.am (TESTS): Add into-self.
5630 1998-02-28   Eli Zaretskii  <eliz@is.elta.co.il>
5632         * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
5633         about any arbitrary user and group by pretending to be the user
5634         and to belong to the group specified in `spec_arg' argument.
5636         * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
5637         any arbitrary user name.
5638         (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
5639         group name.
5641 1998-02-24  Jim Meyering  <meyering@eng.ascend.com>
5643         * lib/xstrtol.c (TYPE_SIGNED): Define.
5644         (TYPE_MAXIMUM): Define.
5645         (ULONG_MAX): Use TYPE_MAXIMUM.
5646         (LONG_MAX): Use TYPE_MAXIMUM.
5648         * lib/fnmatch.c: Update from libit.
5649         * lib/idcache.c: Update from libit.
5651 1998-02-23  Paul Eggert  <eggert@twinsun.com>
5653         * lib/quotearg.h, lib/quotearg.c: New files.
5654         * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
5655         (noinst_HEADERS): Add quotearg.h.
5657         * src/ls.c: Include new file quotearg.h.
5658         (enum indicator_style): Rename all to classify, and not_programs
5659         to file_type, to match option spellings.  All users changed.
5660         (indicator_style_args): New constant.
5661         (quote_funny_chars, quote_as_string, quote_shell): Remove;
5662         (filename_quoting_options, dirname_quoting_options): Use these
5663         variables instead.
5664         (long_options): Add --indicator-style, --quoting-style,
5665         --show-control-chars.  Remove --quote-shell.
5666         (dired_dump_obstack): Remove style parameter and don't output style.
5667         (main): Go back to previous method of outputting //DIRED//
5668         and //SUBDIRED// lines, without style.  But add a new
5669         //DIRED-OPTIONS// line that does output style.
5670         (decode_switches, usage): Add --indicator-style, --quoting-style,
5671         --show-control-chars.  Remove --quote-shell.
5672         (decode_switches): Default from QUOTING_STYLE environment variable.
5673         Set new quoting vars.
5674         (quote_name): Renamed from quote_filename.
5675         Take new arg specifying quoting options.
5676         Always print; do not have a special case for null FILE * argument.
5677         All callers changed.
5678         Move the guts of this function to new file quotearg.c.
5679         (length_of_file_name_and_frills): Use quotearg_buffer instead
5680         of (old) quote_filename to find length of file name.
5682         (decode_switches, parse_ls_color, print_dir, gobble_file,
5683         get_link_name): Quote output in diagnostics.
5685         * NEWS, doc/fileutils.texi: Describe above changes.
5686         * doc/fileutils.texi: Mention that control characters are output
5687         as question marks if output is a terminal.
5689 1998-02-22  Jim Meyering  <meyering@eng.ascend.com>
5691         * Version 3.16m.
5693         * ChangeLog-1997: New file.
5694         * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
5696 1998-02-21  Jim Meyering  <meyering@eng.ascend.com>
5698         * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
5699         * tests/Makefile.am (SUBDIRS): Add mv.
5700         * tests/mv: New directory
5701         * tests/mv/mv-special-1: New test.
5703 1998-02-20  Jim Meyering  <meyering@eng.ascend.com>
5705         * src/touch.c: Include get-date.h.
5706         Remove get_date decl.
5708         * lib/getdate.h: Removed.  Could cause confusion with an
5709         automake-generated `.y.h' rule.
5710         * lib/get-date.h: Renamed from getdate.h.
5711         * lib/getdate.y: s/getdate.h/get-date.h/
5712         * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
5714 1998-02-19  Jim Meyering  <meyering@eng.ascend.com>
5716         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
5717         * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
5719 1998-02-13  Jim Meyering  <meyering@eng.ascend.com>
5721         * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
5722         Otherwise, mv tries to open special files.
5723         Reported by Kjetil Torgrim Homme.
5725 1998-02-08  Jim Meyering  <meyering@eng.ascend.com>
5727         * Makefile.maint (cvs-dist): Update po/ to clear modified status
5728         of *.po files before running cvs tag -c.
5730         * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
5731         description.
5733 1998-02-07  Jim Meyering  <meyering@eng.ascend.com>
5735         * GNUmakefile: New file.
5736         * Makefile.am (EXTRA_DIST): Add GNUmakefile.
5737         Don't include Makefile.maint from here.  It's included from GNUmakefile.
5739         * configure.in: Don't use AM_MAINTAINER_MODE.
5740         (jm_PERL): Use this.
5742         * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl.  Add dcgen.
5743         (CLEANFILES): Remove dcgen.
5744         (dircolors.h): Use $(PERL).
5745         (.pl): Remove rule.
5747 1998-02-01  Jim Meyering  <meyering@na-net.ornl.gov>
5749         * POTFILES.in: Add remove.c.  Reported by Santiago Vila.
5751 1998-01-28  Jim Meyering  <meyering@na-net.ornl.gov>
5753         * src/df.c (print_header): Tweak format to align heading over
5754         last column of `df -i' output.  From Andreas Schwab.
5756 1998-01-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5758         * Makefile.am: Include Makefile.maint from $(srcdir).
5760 1998-01-25  Jim Meyering  <meyering@na-net.ornl.gov>
5762         * Version 3.16l.
5764         * Makefile.maint: New file.
5765         * Makefile.am: Move rules common to textutils, fileutils, sh-utils
5766         into Makefile.maint.
5767         Include Makefile.maint.
5768         (EXTRA_DIST): Add Makefile.maint.
5770         * src/cp.c (re_protect): Don't fail for non-root when chown fails
5771         due not only to lack of permission (EPERM), but also to lack of
5772         support (EINVAL).  Reported by Bengt Martensson.
5773         * src/copy.c (DO_CHOWN):  Likewise.
5775 1998-01-24  Jim Meyering  <meyering@na-net.ornl.gov>
5777         * tests/ls/time-1 (test_failure): Rename does not update ctime;
5778         link does -- so use ln, not mv.
5779         Note that the SunOS4.1.4 failure of the ctime test is expected.
5781         * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
5782         bug in Cray C 5.0.3.0 when T == time_t.
5784         * tests/rm/r-1: Adjust expected output for changed format of
5785         `rm --verbose'.
5786         * tests/rm/r-2: Likewise.
5788 1998-01-23  Jim Meyering  <meyering@na-net.ornl.gov>
5790         * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
5791         C compiler.  From Kaveh Ghazi.
5792         (TYPE_MINIMUM): Define.
5793         (TYPE_MAXIMUM): Define.
5794         (TIME_T_MIN): Use TYPE_MINIMUM.
5795         (TIME_T_MAX): Use TYPE_MAXIMUM.
5797 1998-01-22  Jim Meyering  <meyering@na-net.ornl.gov>
5799         * src/dd.c: Reorder functions to obviate forward dcls.
5800         (quit): Declare to be inline to stifle compile warning.
5802         * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
5804         * tests/rm/sunos-1: Don't use -f.  Do adjust $RM if it's a
5805         relative path.
5807         * tests/ls/time-1: Use GNU touch to work around problems with NFS
5808         caching and/or clock skew.  Reported by Kaveh Ghazi.
5810         * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
5812         * src/Makefile.am (noinst_HEADERS): Add remove.h.
5813         (mv_SOURCES): Define.
5814         (rm_SOURCES): Define.
5816 1998-01-21  Jim Meyering  <meyering@na-net.ornl.gov>
5818         * src/install.c: Declare new global, backup_type.
5819         (main): Initialize backup_type unconditionally.
5820         (copy_file): Call find_backup_file_name with new argument, backup_type.
5821         * src/ln.c: Declare new global, backup_type.
5822         (main): Initialize backup_type unconditionally.
5823         (do_link): Call find_backup_file_name with new argument, backup_type.
5825         * src/copy.c (copy_internal): Use x->backup_type, not the global.
5826         (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
5828         * src/copy.h: (VALID_SPARSE_MODE): Define.
5829         [struct cp_options] (backup_type): New member.
5831         * src/cp.c [NDEBUG]: Comment out definition.
5832         (do_copy): Use x->backup_type, not the global.
5834         * src/remove.c: New file.  Contains guts of old rm.c.
5835         (remove_init): New function.
5836         (remove_fini): New function.
5837         (rm): Take third argument, specifying options.
5838         * src/remove.h: New file.  Associated dcls.
5839         * src/rm.c: Remove and minimally librarify guts for use in mv.c.
5840         (main): Pass options (`&x') to rm.
5841         Call remove_init and remove_fini instead of open-coding them.
5843         * src/mv.c (rm_option_init): New function.
5844         (cp_option_init): New function.
5845         (copy_reg): Remove now-unused function.
5846         (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
5847         Set up for and use `remove.c (rm)' in place of unlink.
5849 1998-01-20  Jim Meyering  <meyering@na-net.ornl.gov>
5851         * lib/backupfile.c: Use ANSI function definitions.
5852         Remove global declaration of backup_type.
5853         (simple_backup_suffix): Default to `~', not `.orig'.
5854         Use PARAMS, not __BACKUPFILE_P.
5855         (find_backup_file_name): Add parameter, backup_type.
5856         * lib/backupfile.h: Remove extern declaration of backup_type.
5857         Use PARAMS, not __BACKUPFILE_P.
5858         (VALID_BACKUP_TYPE): Define.
5859         (find_backup_file_name): Adjust prototype.
5861 1998-01-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5863         * src/df.c (print_header): Fix inode format header to line it up
5864         with the rest of the output.
5866 1998-01-13  Jim Meyering  <meyering@na-net.ornl.gov>
5868         * lib/stat.c: Set errno to ENOENT, not EINVAL.  This is consistent
5869         with most other implementations.
5871 1998-01-12  Jim Meyering  <meyering@na-net.ornl.gov>
5873         * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
5874         Move function-spanning `#if ...BSIZE' directive to follow inclusion
5875         of sys/param.h since BSIZE is sometimes defined in sys/param.h.
5876         Reported by Philippe De Muyter.
5878 1998-01-10  Jim Meyering  <meyering@na-net.ornl.gov>
5880         * Version 3.16k.
5882         * src/install.c (install_file_to_path): New function.
5883         FIXME: update fileutils.texi.
5884         (main): Handle new option, -D.
5885         Based on a patch from Marty Leisner.
5886         (usage): Describe -D.
5888         * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
5889         with -l or -t.  Now, -u (like -c) implies --sort=time.
5890         (usage): Correct descriptions of --sort, --time, and -t.
5891         Suggestions from Andreas Schwab.
5893         Add test for the above fix.
5894         * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
5895         * tests/Makefile.am (SUBDIRS): Add ls.
5896         * tests/ls: New directory.
5897         * tests/ls/Makefile.am: New file.
5898         * tests/ls/time-1: New file.
5900         * lib/makepath.c (make_path): Reformat 3 if-stmts to test
5901         `if (newly_created_dir)' only once.  Suggestion from Andreas Schwab.
5903 1998-01-06  Jim Meyering  <meyering@na-net.ornl.gov>
5905         * lib/getdate.y: Move inclusion of getdate.h and dependent extern
5906         declarations down so getdate.h's prototype follows the sometimes-
5907         enabled definition of `const' to nothing.  Otherwise, the prototype
5908         wouldn't match the definition because of the defined-away `const'.
5909         From Kaveh Ghazi.
5910         (get_date): ANSI-fy definition.
5911         Add %expect directive.
5913 1998-01-05  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
5915         * lib/makepath.c (make_path): Put only newly created directories
5916         on the LEADING_DIRS list.
5918 1998-01-05  Paul Eggert  <eggert@twinsun.com>
5920         * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
5921         (get_fs_usage): If a value consists entirely of 1 bits,
5922         propagate this info to the output by setting it to (uintmax_t) -1.
5923         * src/df.c (df_readable): New function.
5924         (show_dev): If a value consists entirely of 1 bits, or is derived
5925         from some other value that consists entirely of 1 bits, report "-".
5926         Check inode and block counts more carefully for plausibility,
5927         to avoid arithmetic overflow when computing percentages.
5929 1998-01-04  Jim Meyering  <meyering@na-net.ornl.gov>
5931         * Version 3.16j.
5933         * lib/Makefile.in: Regenerated with patched automake-1.2d.
5934         See README-alpha.
5936         * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
5937         the two booleans, verbose and changes_only.  This fixes a bug whereby
5938         --change had the same effect as --verbose.
5939         * src/chmod.c: Likewise.
5940         * src/chown.c: Likewise.
5941         Reported by Paul Eggert.
5943 1998-01-04  Paul Eggert  <eggert@twinsun.com>
5945         Check for write errors more carefully.
5947         * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
5948         (noinst_HEADERS): Add closeout.h.
5949         * lib/closeout.c, lib/closeout.h: New files.
5950         * lib/long-options.c (parse_long_options),
5951         src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
5952         src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
5953         src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
5954         src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
5955         (main, usage): Check for write error to stdout before exiting.
5956         Include "closeout.h".
5958 1998-01-03  Jim Meyering  <meyering@na-net.ornl.gov>
5960         * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
5961         just like `fsu.fsu_blocks == 0' as an indicator that usage information
5962         is invalid.  This happens with Solaris-5.5.1 CD-ROM mount points.
5964         * lib/save-cwd.h: Guard PARAMS-enabling definition with
5965         `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
5966         problems with Irix4's cc.  From Kaveh Ghazi.
5967         * lib/getdate.h: Likewise, but just to be consistent.
5969         * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
5970         those files will be built via the ANSI2KNR-filtering rules if necessary.
5971         Reported by Kaveh Ghazi.
5973 1998-01-02  Jim Meyering  <meyering@na-net.ornl.gov>
5975         * Version 3.16i.
5977         Fix problem with `install -d'.  Reported by Marty Leisner.
5979         * src/install.c (get_ids): When otherwise unspecified,
5980         set uid and gid to -1.
5981         * lib/makepath.c (make_path): Try to change ownership only if we've
5982         just created the directory.  Fix latent bug (s/&&/||/ in two places --
5983         also, note that it could not be exercised via install or mkdir)
5984         whereby chown would not be invoked when only one of owner/group is
5985         not -1.
5987 1998-01-01  Jim Meyering  <meyering@na-net.ornl.gov>
5989         * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
5990         only once and never free it.
5992 Local Variables:
5993 version-control: never
5994 End: