5f12d1ca3ef9d8a18f98ef482650bdb23c1ba764
[platform/upstream/coreutils.git] / old / fileutils / ChangeLog
1 2002-07-28  Jim Meyering  <meyering@lucent.com>
2
3         * Version 4.1.12.
4
5         * configure.ac: Require automake-1.6b.
6
7         * TODO: Remove entry that mentions rm's HAVE_WORKING_READDIR.
8         Since remove.c was rewritten, rm is no longer susceptible to that.
9
10 2002-07-26  Jim Meyering  <meyering@lucent.com>
11
12         * src/stat.c: Don't include malloc.h -- it was unnecessary.
13
14 2002-07-22  Jim Meyering  <meyering@lucent.com>
15
16         * Version 4.1.11.
17
18         * src/stat.c (usage): The short form of --dereference is now -L, not -l.
19         Reported by Kalle Olavi Niemitalo.
20
21         * src/rm.c: Add new option, --presume-input-tty, for testing only.
22         Not documented.
23
24         This test might remove a file owned by the person running `make check'.
25         * tests/rm/fail-eperm: Hoist definition of $target_file, and use
26         that (not $f) in test for owner/dir/symlink.  Patch by Michael Stone.
27
28         * tests/rm/fail-eperm: Handle the case in which rm produces no output.
29
30         rm would prompt for a symlink to an unwritable file
31         * src/remove.c (prompt): When not interactive, don't prompt
32         for a symlink.  Reported by Dave Beckett.  Patch by Michael Stone.
33         * tests/rm/dangling-symlink: Add a test for the above-fixed bug.
34
35 2002-07-20  Jim Meyering  <meyering@lucent.com>
36
37         * src/copy.c (copy_internal): Use file_name_lookup, not getdport.
38         Patch by Alfred M. Szmidt.
39
40         * Makefile.maint (news-r1, news-r2): Define.  Better regexp.
41         (announcement): Use them here.  Also makes the line length < 80.
42
43         * Upgrade to cvs automake -- required to work with 2.53b.
44         * configure.ac: Require automake-1.6a.
45
46         * Version 4.1.10.
47
48         * Upgrade to gettext-0.11.3.
49         * Upgrade to autoconf-2.53b.
50
51 2002-07-19  Jim Meyering  <meyering@lucent.com>
52
53         * src/dircolors.hin: Add .wav.
54
55         * tests/rm/fail-eperm: Don't expect `ARGV_0=$0 exec ...' to work.
56         It doesn't work with /bin/sh of Solaris5.6.
57         Use an explicit `export ARGV_0' instead.
58         [comparing actual and expected output]: Don't match the entire line,
59         but rather just the `rm: cannot remove `$dir/$f':' part.
60
61         * tests/rm/dangling-symlink: Use input-tty rather than
62         testing for /dev/stdin.
63
64         * tests/Makefile.am (EXTRA_DIST): Add input-tty.
65         * tests/input-tty: New file.
66
67 2002-07-18  Jim Meyering  <meyering@lucent.com>
68
69         * src/dircolors.hin: Add the following to the list of colorizable
70         TERM names: dtterm xterm-color Eterm.
71         New archive suffix: .jar
72         New image suffixes: .jpeg .pbm .pgm .tiff .mpeg .xcf .xwd
73         Audio suffixes: .ogg .mp3
74         From Michael Stone.
75
76 2002-07-16  Jim Meyering  <meyering@lucent.com>
77
78         * src/stat.c (print_it): Use memcpy and a little pointer arithmetic,
79         rather than stpncpy.
80
81 2002-07-14  Jim Meyering  <meyering@lucent.com>
82
83         Under some circumstances, rm would fail due to a lack of
84         permissions, but give a misleading diagnostic like this:
85         rm: cannot chdir from `.' to `foo': Not a directory
86         * src/remove.c (remove_dir): Detect the case in which unlinking a
87         non-directory fails with EPERM, and give an appropriate diagnostic.
88         Reported by Michael Stone.
89
90 2002-07-13  Jim Meyering  <meyering@lucent.com>
91
92         * tests/rm/fail-eperm: New file/test, for the above.
93         * tests/rm/Makefile.am (TESTS): Add fail-eperm.
94
95         * src/stat.c (print_it): Use xstrdup, not strdup.
96         Use strspn to avoid an explicit loop.
97         Use fputc rather than printf "\n".
98
99         * src/stat.c: Include quote.h.
100         (print_stat): Use xreadlink, rather than using readlink directly.
101         Use the quote function rather than hard-coded double quotes.
102         Use error, not perror.
103
104 2002-07-09  Martin Michlmayr  <tbm@cyrius.com>
105
106         * src/df.c (show_dev): Make the `Use%' column align with
107         its heading, even when -P is used with -h or -H.
108
109 2002-07-10  Jim Meyering  <meyering@lucent.com>
110
111         * man/du.x: Add a description of --exclude=PATTERN.
112         * src/du.c (usage) [--exclude]: Use PATTERN rather than PAT.
113         From Martin Michlmayr.
114
115 2002-07-09  Jim Meyering  <meyering@lucent.com>
116
117         I added stat.x, but didn't update the definition of dist_man_MANS.
118         * man/Makefile.am (dist_man_MANS): Add stat.1.
119         (stat.1): Add dependency.
120         Reported by Michael Stone.
121
122         Ensure that the above never happens again.
123         * man/Makefile.am (check-x-vs-1): New target.
124         (check-local): Depend on check-x-vs-1.
125
126         * src/mv.c (euidaccess): Remove declaration.  It was unused.
127         From Michael Stone.
128         (yesno): Remove declaration.  It too was unused.
129
130 2002-07-08  Paul Eggert  <eggert@twinsun.com:
131
132         * NEWS: df now rounds all quantities up, as per POSIX.
133         This fixes a bug where df would report Size < Used.
134         * doc/coreutils.texi: Likewise.
135         * src/df.c (df_readable): Omit last arg; we always round up now.
136         All callers changed.
137
138 2002-07-07  Paul Eggert  <eggert@twinsun.com>
139
140         NEWS, doc/coreutils.texi:
141         New ls time style: long-iso, which generates YYYY-MM-DD HH:MM.
142         Any time style can be preceded by "posix-".
143         The default time style is now posix-long-iso instead of posix-iso.
144
145         * src/ls.c (enum time_style): Remove posix_iso_time_style.
146         Add long_iso_time_style.
147         (time_style_args, time_style_types, decode_switches): Likewise.
148         (decode_switches): If a time style is prefixed by "posix-", ignore
149         it if in the POSIX locale.  Default style is now posix-long-iso.
150         (usage): Explain the above.
151
152 2002-07-06  Jim Meyering  <meyering@lucent.com>
153
154         * tests/Makefile.am (envvar-check): Mark as `.PHONY'.
155
156         * src/stat.c: Remove everything associated with --secure option.
157
158 2002-07-04  Jim Meyering  <meyering@lucent.com>
159
160         * src/remove.c (prompt): Fix test for write-protectedness to also
161         check errno == EACCES.  Otherwise, `rm dangling-symlink' would
162         mistakenly prompt.  Reported by Mike Castle.
163
164         * tests/rm/Makefile.am (TESTS): Add dangling-symlink.
165         * tests/rm/dangling-symlink: New file/test, for the above fix.
166
167 2002-07-03  Jim Meyering  <meyering@lucent.com>
168
169         * src/stat.c (usage): Rename --link/-l to --dereference/-L.
170         Describe --secure.
171         Describe --format.
172         (main): Support -L.  Deprecate -l.
173
174 2002-07-02  Jim Meyering  <meyering@lucent.com>
175
176         * src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c (usage):
177         Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.
178         * src/df.c, src/dircolors.c, src/du.c, src/install.c: Likewise.
179         * src/link.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c: Likewise.
180         * src/mknod.c, src/mv.c, src/rm.c, src/rmdir.c, src/shred.c: Likewise.
181         * src/stat.c, src/sync.c, src/touch.c, src/unlink.c: Likewise.
182
183 2002-07-01  Jim Meyering  <meyering@lucent.com>
184
185         * tests/touch/fail-diag: Handle yet another different diagnostic.
186         Report from Volker Borchert.
187
188 2002-06-29  Jim Meyering  <meyering@lucent.com>
189
190         * src/stat.c (print_statfs): Use `fputc ('*', stdout)'
191         instead of the combination of strcat and printf.
192         (print_statfs) [!FLASK_LINUX]: Print `*' for %S and %C,
193         rather than `S' and `C'.
194         (print_stat) [!FLASK_LINUX]: Likewise.
195
196         * src/remove.c (AD_mark_current_as_unremovable): Replace dead
197         code with an assertion.
198
199 2002-06-26  Paul Eggert  <eggert@twinsun.com>
200
201         * src/ls-test: Use grep, not egrep.
202
203 2002-06-25  Jim Meyering  <meyering@lucent.com>
204
205         * src/remove.c (prompt): Add a comment to help translators work
206         around the problem of making the translations of the adjective
207         `write-protected' and the corresponding run-time-variable noun
208         (e.g., file, directory, symlink, etc.) consistent.  From Paul Eggert.
209
210 2002-06-24  Jim Meyering  <meyering@lucent.com>
211
212         * src/stat.c (usage): Add missing open-quote.
213         Reported by Michael Piefel.
214
215 2002-06-22  Jim Meyering  <meyering@lucent.com>
216
217         * Version 4.1.9.
218
219         * configure.ac: Invoke AC_GNU_SOURCE very early.
220
221         * tests/rm/rm1: Accommodate the  slightly different diagnostic we
222         get on some systems, due to `unlink (dir)' failing with EACCES
223         rather than EPERM.  E.g. for ReiserFS on Linux-2.4.18.
224
225 2002-06-21  Jim Meyering  <meyering@lucent.com>
226
227         * Makefile.maint (wget-update): Checkout into config/.
228         Warn when skipping a file.
229
230         * src/stat.c: Include sys/statvfs.h.
231         [!HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H]: Include sys/param.h
232         and sys/mount.h, to get decl of struct statfs on NetBSD 1.5.2.
233         (NAMEMAX_FORMAT, STRUCT_STATVFS): Define.
234         (HAVE_STRUCT_STATXFS_F_TYPE, SB_F_NAMEMAX): Define.
235         Remove `static' attribute from decl of program_name.
236         (human_fstype): Use f_basetype or f_fstypename if available.
237         (print_human_time): Use nstrftime and an ISO format string, in
238         place of strftime with `%c'.  The latter is too locale-dependent.
239         (print_statfs): Deal with lots of portability issues: some fields
240         are available only with statfs, others only with statvfs, and
241         some are available in both, but with different types.
242         (do_statfs) [DEFAULT_FORMAT_TERSE]: Factor out.
243         [DEFAULT_FORMAT_VERBOSE]: Likewise.
244
245         * src/copy.c: Change all `preserving ...' diagnostics to
246         `failed to preserve ...' to make the failure clearer.
247         * src/cp.c: Likewise.
248
249 2002-04-03  Alfred M. Szmidt  <ams@kemisten.nu>
250
251         * src/copy.c Include hurd.h.
252         (copy_internal): Preserve the stat.st_author field.
253
254 2002-06-21  Jim Meyering  <meyering@lucent.com>
255
256         * src/ls.c (LOGIN_NAME_MAX): Define if not already defined.
257         (ID_LENGTH_MAX): Define.
258         (ST_DM_MODE): New macro.  Code moved from...
259         (print_long_format): ...here.
260         (print_long_format): Itemize and comment the individual parts
261         of init_bigbuf.  Use the above *_MAX macros.
262
263 2002-06-20  Jim Meyering  <meyering@lucent.com>
264
265         * src/system.h: Change `defined(X)' syntax to `defined X'
266         in cpp directives.
267
268 2002-06-17  Jim Meyering  <meyering@lucent.com>
269
270         * tests/setgid-check: Interpret a permissions string of
271         drwxr-xr-x (DOS/Windows) as meaning the cwd is not setgid.
272         Reported by Rich Dawe.
273
274 2002-05-19  Paul Eggert  <eggert@twinsun.com>
275
276         Add support for new ls option --author, for GNU/Hurd.
277         Derived from a suggestion by Alfred M. Szmidt.
278
279         * doc/coreutils.texi (ls invocation), NEWS: Document this.
280         * m4/jm-macros.m4 (jm_CHECK_ALL_TYPES): Check for st_author.
281         * src/ls.c (st_author) [! HAVE_STRUCT_STAT_ST_AUTHOR]: New macro.
282         (print_author): New var.
283         (AUTHOR_OPTION): New enum val.
284         (long_options, decode_switches, print_long_format, usage):
285         Support --author.
286         (format_user): New function.
287         (print_long_format): Use it.  Make print buffer a bit bigger.
288
289 2002-06-15  Jim Meyering  <meyering@lucent.com>
290
291         * tests/sample-test (trap): Make sure the temporary hierarchy is
292         writable before removing it.
293
294         * tests/mv/perm-1: New file, to demonstrate fix of 2002-06-12.
295         * tests/mv/Makefile.am (TESTS): Add perm-1.
296
297         * src/system.h: For GNU libc 2.2 and newer, ensure that <sys/types.h>
298         has been included before this file.
299
300 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
301
302         Accommodate DOS file name limitations.
303         * tests/cp/same-file: Change temp. file name: s/\.err/_err/, for DOS.
304         * tests/mv/force: Similar.
305         * tests/mv/into-self: Similar.
306         * tests/touch/no-rights: Similar.
307         * tests/mv/mv-special-1: Remove leading `.' from temp. names.
308
309 2002-06-15  Jim Meyering  <meyering@lucent.com>
310
311         * src/sys2.h (S_ISNAM): Add to list of S_IS* macros.
312         Rearrange #if directives for each S_IS macro.
313         From diffutils-2.8.2.
314
315 2002-06-12  Jim Meyering  <meyering@lucent.com>
316
317         * src/mv.c (do_move): Give one diagnostic, not two, when unable to
318         unlink a destination file.  This bug was introduced in fileutils-3.16l.
319
320 2002-06-07  Jim Meyering  <meyering@lucent.com>
321
322         * tests/mv/part-fail: Also accept the permission-denied diagnostic
323         issued by some losing systems.  Reported by Volker Borchert.
324
325         * src/remove.c (remove_entry): Use DT_IS_DIR only if
326         HAVE_STRUCT_DIRENT_D_TYPE is defined.
327
328 2002-06-02  Jim Meyering  <meyering@lucent.com>
329
330         `rm' no longer uses explicit recursion, and as such is now able
331         to remove hierarchies of effectively unlimited depth.  Prior to
332         this change, on typical systems, rm would fail (segfault) to remove
333         hierarchies of depth greater than about 25,000.
334
335         * src/remove.c: Merge in all changes from no-recursion branch.
336         See below for details.
337         * src/remove.h: Likewise.
338         * src/mv.c (do_move): Adapt to new calling sequence for rm.
339         * src/rm.c (main): Likewise.
340
341 2002-06-02  Jim Meyering  <meyering@lucent.com>
342
343         * tests/rm/r-2: Adjust, now that we no longer report
344         `removing all entries of directory ...'.
345         * tests/rm/r-1: Likewise.
346
347         * src/remove.c (enum Ternary): Define type.
348         (prompt): Add a parameter.  Adjust callers.
349         (remove_entry): Attempt rmdir here, only if a directory is
350         `known' to be empty.  Significant rework.
351         (remove_dir): Propagate failure `up' also when rmdir fails.
352
353 2002-06-01  Jim Meyering  <meyering@lucent.com>
354
355         * tests/rm/Makefile.am (TESTS): Add rm5.
356         * tests/rm/rm5: New test.
357
358 2002-05-30  Jim Meyering  <meyering@lucent.com>
359
360         In interactive mode, prompt only once about an empty directory.
361         * src/remove.c (enum Prompt_action): Define.
362         (prompt): Two new parameters.  Adjust all callers.
363
364         Performance.
365         * src/remove.c (remove_entry) [!ROOT_CAN_UNLINK_DIRS]:
366         Don't call rmdir here.
367
368 2002-05-29  Jim Meyering  <meyering@lucent.com>
369
370         * src/remove.c (AD_pop_and_chdir): Don't use errno (it's not valid)
371         in diagnostic for changed dev/ino.
372         (remove_entry): Tweak diagnostic.
373
374 2002-05-27  Jim Meyering  <meyering@lucent.com>
375
376         * src/remove.c (ROOT_CAN_UNLINK_DIRS): Define.
377         (AD_pop_and_chdir): Propagate status as we traverse back `up' the tree.
378         (DO_UNLINK, DO_RMDIR): Define.
379         (remove_entry) [ROOT_CAN_UNLINK_DIRS]: Add code so this works also on
380         systems where root can use `unlink' to remove directories.
381
382 2002-05-24  Jim Meyering  <meyering@lucent.com>
383
384         * tests/mv/mv-special-1: Adapt for changed format of --verbose output.
385
386 2002-05-22  Jim Meyering  <meyering@lucent.com>
387
388         * src/remove.c: Include file-type.h.
389         Include file type in prompt when asking whether to remove file.
390         Based on a patch from Paul Eggert.
391
392         * src/remove.c (prompt): Add comment.
393
394         * src/remove.c (remove_dir): Fix another (known) leak.
395
396         * tests/rm/rm3: Don't depend on order of traversal of dir entries.
397         It is nondeterministic on some types of filesystems.
398
399         * src/remove.c (hash_freer): New function.
400         (AD_mark_helper): Use it.
401         (AD_mark_as_unremovable): xstrdup the filename argument.
402         (remove_dir): Free directory name.
403
404         * src/remove.c (remove_entry): Fail also when trying to remove a
405         directory without the --recursive option.
406         Change a diagnostic, s/unlink/remove/, now that it can apply also
407         to a directory.
408
409         * src/remove.c (is_empty_dir): New function.
410         (prompt): New function, factored out of...
411         (remove_entry): ...here.  Call it.
412         (remove_dir): Call prompt before rmdir.
413
414         * src/remove.c (remove_entry): Add support for prompting (e.g., -i).
415
416         * src/remove.h (UPDATE_STATUS): New macro.
417         Include save-cwd.h.
418         (struct File_spec): Remove declaration.
419         Update prototypes.
420
421         * src/remove.c [AD_ent] (status): New member.  This lets us propagate
422         the status from a subdirectory to its parent via AD_pop_and_chdir.
423         (AD_push_initial): Set it.
424         (AD_push): Likewise.
425         (remove_cwd_entries): Change return type to enum RM_status, and
426         adjust all callers.
427         (rm): Use UPDATE_STATUS rather than open-coding it.
428
429         * src/remove.c (remove_entry): New function, factored out of...
430         (remove_cwd_entries): ...here, and...
431         (rm_1): ...here.
432
433         * src/remove.c (remove_cwd_entries): Add support for --verbose.
434         (remove_dir): Likewise.
435         (rm_1): Likewise.
436
437 2002-05-18  Jim Meyering  <meyering@lucent.com>
438
439         * tests/rm/rm3: New file.
440         * tests/rm/rm4: New file.
441         * tests/rm/Makefile.am (TESTS): Add rm3 and rm4.
442
443 2002-05-17  Jim Meyering  <meyering@lucent.com>
444
445         * tests/rm/rm1: New file.
446         * tests/rm/rm2: New file.
447         * tests/rm/unread2: New file.
448         * tests/rm/Makefile.am (TESTS): Add rm1, rm2, and unread2.
449
450         * src/remove.h (enum RM_status) [RM_NONEMPTY_DIR]: New member.
451
452 2002-05-13  Jim Meyering  <meyering@lucent.com>
453
454         * src/remove.c (rm): Free cwd_state, if necessary.
455
456 2002-05-01  Jim Meyering  <meyering@lucent.com>
457
458         * src/remove.c (rm_1): Remove now useless (always true)
459         user_specified_name parameter.  Adjust sole caller.
460
461         * src/remove.c (rm): New function.  This interface allows
462         one to remove multiple arguments at a time.  This is important in
463         that it allows us to hide the remove_init/remove_fini functions and
464         the cwd_state parameter.
465         (rm_1): Renamed from rm.
466         (remove_init, remove_fini): Remove functions.  Each body is now
467         part of `rm'.
468         * src/remove.h (rm): Update prototype.
469
470 2002-06-01  Jim Meyering  <meyering@lucent.com>
471
472         * src/ls.c: Remove use of D_TYPE_IN_DIRENT, now that that symbol
473         has been renamed.
474
475 2002-05-30  Jim Meyering  <meyering@lucent.com>
476
477         * src/copy.c (copy_reg): Use a temporary to avoid a warning
478         from gcc -W about comparison between signed and unsigned.
479         (copy_internal): Likewise, but use a cast.
480
481 2002-05-22  Jim Meyering  <meyering@lucent.com>
482
483         * src/sys2.h (S_ISREG, S_ISDIR): Define if not already defined.
484         (S_TYPEISSEM, S_TYPEISSHM, S_TYPEISTMO): Likewise.
485
486         * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
487         Remove definitions.
488         * src/sys2.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
489         Define here instead.
490
491 2002-04-27  Jim Meyering  <meyering@lucent.com>
492
493         * src/remove.c (cycle_check): New function containing code factored
494         out of remove_dir.  The sole difference is that upon detecting a
495         cycle, rm now dies unconditionally.  Before, in interactive mode,
496         it would ask the user whether to continue.
497         (remove_dir): Call cycle_check.
498
499 2002-04-25  Jim Meyering  <meyering@lucent.com>
500
501         Avoid new warnings from gcc.
502         * src/dd.c: Declare input_file and output_file to be `const'.
503         (skip): Declare `file' parameter to be `const', too.
504
505         Remove hash table, active_dir_map, used to detect directory cycles.
506         Instead, detect them lazily with just O(1) memory.
507         Suggestion from Andi Kleen.
508         * src/remove.c (is_power_of_two): New function.
509         (print_nth_dir, make_active_dir_ent): Remove functions.
510         (hash_active_dir_ent, hash_compare_active_dir_ents): Likewise.
511         (remove_dir): Check for cycles here, ...
512         (rm): ... and don't check for cycles here.
513
514         * src/remove.c (rm): Call fspec_get_full_mode here, rather than
515         fspec_get_filetype_mode.  We want to get the dev/ino earlier, and
516         at the same time as when we get the file type, to avoid the risk
517         that an attacker would change e.g. a directory to a symlink before
518         we record its dev/ino.
519
520         * configure.ac (AC_CONFIG_FILES): Remove intl/Makefile.
521         (AM_GNU_GETTEXT): Add external arg.
522
523         * intl/: Remove directory.
524         * Makefile.am (SUBDIRS): Remove intl.
525         (DISTCLEANFILES): Remove definition.
526
527         * src/sys2.h: Remove ENABLE_NLS-related code.
528         (_, N_) Remove definitions.
529         Include "gettext.h" instead.
530
531         * src/Makefile.am (INCLUDES): Remove -I../intl.
532
533 2002-04-22  Jim Meyering  <meyering@lucent.com>
534
535         * src/remove.c (rm): Call exit with EXIT_FAILURE, not `1'.
536
537 2002-04-19  Jim Meyering  <meyering@lucent.com>
538
539         * tests/cp/*: Clean up.
540
541         * tests/sample-test: Use a temporary directory named
542         `basename $0`.tmp/$$.  Create with mkdir -p.
543
544         * tests/cp/backup-1: Use better trap, etc.
545         * tests/mkdir/p-2: Use better trap.
546         * tests/mkdir/p-1: Likewise.
547         * tests/mkdir/concurrent-1: Likewise.
548
549         * tests/rm/deep-1: Set $tmp the new way.
550
551         * tests/rm/ir-1: Use `rm', not $RM.  Use better trap.
552         * tests/rm/i-1: Likewise.
553         * tests/rm/f-1: Likewise.
554
555         * tests/sample-test: Use automatically-derived name for temporary
556         directory.  This is more 8.3-friendly.  Based on a suggestion from
557         Richard Dawe.
558
559         * tests/sample-test: New file.
560         * tests/Makefile.am (EXTRA_DIST): Add sample-test.
561
562 2002-04-17  Jim Meyering  <meyering@lucent.com>
563
564         * src/touch.c (touch): Don't report errors for nonexistent files
565         when --no-create is in effect.  Based on a patch from TAKAI Kousuke.
566         * tests/touch/no-create-missing: New file/test for above.
567         * tests/touch/Makefile.am (TESTS): Add no-create-missing.
568
569 2002-04-16  Jim Meyering  <meyering@lucent.com>
570
571         * src/stat.c: Add copyright comment.
572         (human_fstype): Rename from print_human_fstype, and rework accordingly.
573         (print_statfs): Use human_fstype to honor format width on %T.
574
575 2002-04-15  Jim Meyering  <meyering@lucent.com>
576
577         Handle "lld" vs "ld" printf formats the same way Bash does.
578         * src/stat.c: Include inttypes.h.
579         (PRIdMAX, PRIuMAX): Define, if not already defined.
580         (print_statfs): Use those macros, not the literal strings.
581         (print_stat): Likewise.
582         Suggestion from Paul Eggert.
583
584         * src/stat.c (print_human_fstype): Add missing `break;'
585         for `case S_MAGIC_MINIX:'.
586
587 2002-04-14  Jim Meyering  <meyering@lucent.com>
588
589         * src/stat.c (statfs_secure): Define.
590         (print_stat): Remove another #ifdef.
591         (do_statfs): Likewise.
592         (print_statfs): Prefer/use fputs over printf.
593         (print_stat): Likewise.
594
595         * src/Makefile.am (bin_PROGRAMS): Add stat.
596         (noinst_HEADERS): Add fs.h.
597
598         * src/stat.c [HAVE_SYS_VFS_H]: Guard incluion of sys/vfs.h.
599         Constify many parameters.
600         (print_statfs): Fix typo: Use %u (to match %lu) for namelen, not %d.
601         (verbose_usage): Remove function.  Move contents into usage.
602         Remove lots of #if directives involving FLASK_LINUX
603         [!FLASK_LINUX] (is_flask_enabled): Define.
604         (stat_secure, lstat_secure): Define.
605         (print_statfs): Remove lots of nested #if directives.
606         Instead, rely on support fo %llu and %lld printf formats --
607         but that is only temporary, since it's not porable enough.
608         (main): Hoist is_flask_enabled test to be done here, rather
609         than in each of do_stat and do_statfs for every argument.
610
611 2002-04-13  Jim Meyering  <meyering@lucent.com>
612
613         * src/stat.c: Include system.h, error.h, and many other headers.
614         [HAVE_SYS_SYSMACROS_H]: Guard inclusion of sys/sysmacros.h.
615         (PROGRAM_NAME, AUTHORS): Define.
616         (long_options): Declare/define.
617         (print_human_access): Rewrite to use mode_string.
618         (usage): Rewrite.
619         (main): Use getopt_long.
620         (print_human_type): Call fputs once rather than calling
621         printf many times.
622         (print_human_fstype): Revamp in a similar fashion.  Don't use strdup.
623         Declare most functions to be `static'.
624
625 2002-04-12  Jim Meyering  <meyering@lucent.com>
626
627         * src/Makefile.am (LDADD): List ../lib/libfetish.a both before
628         and after @LIBINTL@.  Thanks to Paul Eggert for the fix and to
629         Bruno Haible for diagnosing the problem.
630
631         * src/link.c: Include long-options.h.
632         [long_opts]: Remove.
633         (usage): Tweak --help output; use *_OPTION_DESCRIPTION macros.
634         (main): Don't use getopt directly.  Use parse_long_options instead.
635         Tweak a diagnostic.
636         Use EXIT_FAILURE rather than a literal `1'.
637         * src/unlink.c: Likewise.
638         (main): If POSIXLY_CORRECT is set, don't recognize --help or --version,
639         so the program can operate on a file with one of those names.
640
641 2002-04-11  Jim Meyering  <meyering@lucent.com>
642
643         New programs link and unlink.
644
645         * src/Makefile.am (bin_PROGRAMS): Add link and unlink.
646         * src/link.c, src/unlink.c: New files, from Debian's fileutils_4.1-10.
647         Written by Michael Stone.
648
649         * man/link.x: New file.
650         * man/unlink.x: New file.
651         * man/Makefile.am: Add link and unlink.
652
653 2002-04-07  Jim Meyering  <meyering@lucent.com>
654
655         * tests/install/basic-1: Tweak comments to reflect reality.
656         * tests/cp/fail-perm: Add VERBOSE=yes support.
657         * tests/mv/mv-special-1: Fix typo in VERBOSE=yes handling.
658         Reported by Richard Dawe.
659
660 2002-03-30  Jim Meyering  <meyering@lucent.com>
661
662         * Version 4.1.8.
663
664         * tests/mv/i-link-no: Use --reply=no rather than -i.
665         The latter depends on whether stdin is a tty and hence would
666         fail in some situations where --reply=no doesn't.
667
668         * src/mv.c (do_move): Correct a comment.
669
670         * src/copy.c (copy_internal): Move the block that sets `earlier_file'
671         down to just before the first use of that variable.  Otherwise, it was
672         possible to make mv (and probably cp, too) malfunction when copying
673         hard-linked files into a directory containing at least one of the
674         source file names.  Call forget_created everywhere thereafter where
675         this function returns without creating a destination file that might
676         subsequently be linked.  Reported by Iida Yosiaki.
677         * src/cp-hash.c (forget_created): New function.
678         * src/cp-hash.h (forget_created): Prototype.
679
680         * tests/mv/i-link-no: New test for the above.
681         Based on an example from Iida Yosiaki.
682         * tests/mv/Makefile.am (TESTS): Add i-link-no.
683
684 2002-03-17  Jim Meyering  <meyering@lucent.com>
685
686         * src/copy.c (copy_internal) [move_mode]: Give a better diagnostic,
687         by using errno from the failed unlink, when a cross-device `mv'
688         fails, e.g., because the destination cannot be unlinked.
689         Prompted by a report from Karl Berry.
690         * tests/mv/part-fail: New test for the above.
691         * tests/mv/Makefile.am (TESTS): Add part-fail.
692
693 2002-03-16  Jim Meyering  <meyering@lucent.com>
694
695         * src/Makefile.am (datadir): Don't override $(datadir)
696         which might be set by --datadir and different from $(prefix)/share.
697         Patch from Albert Chin-A-Young.
698
699 2002-03-10  Jim Meyering  <meyering@lucent.com>
700
701         * Version 4.1.7.
702
703         * src/ln.c (main): Change wording in diagnostic.
704         * src/cp.c (do_copy): Likewise.
705         * src/install.c (strip): Likewise.
706         Suggestions from Santiago Vila.
707
708         * Use autoconf-2.53.  Regenerate dependent files.
709
710         * Makefile.maint (GZIP, BZIP2): Remove definitions.
711         ($(my_distdir).tar.bz2): Remove rule.  Now, it's built by `make dist'.
712
713         * configure.ac (AM_INIT_AUTOMAKE): Specify the required version
714         of automake (1.6), and options (gnits dist-bzip2), rather than...
715         * Makefile.am (AUTOMAKE_OPTIONS): ...here.  Remove definition.
716
717         * src/copy.c (copy_reg): Don't exit upon finding a replaced file.
718         Instead, just skip it like the diagnostic says.
719         Reported by Paul Eggert.
720
721 2002-03-09  Paul Eggert  <eggert@twinsun.com>
722
723         * src/copy.c (copy_reg): Use a more concise diagnostic for
724         reporting replaced files.  This avoids a bug in the code,
725         which mishandled ino_t wider than long.
726         * src/remove.c (remove_dir): Likewise, twice.
727
728 2002-03-09  Jim Meyering  <meyering@lucent.com>
729
730         * Makefile.am (EXTRA_DIST): Remove config/config.rpath,
731         now that automake knows about it.
732
733 2002-03-08  Jim Meyering  <meyering@lucent.com>
734
735         Don't allow a malicious user to trick another user's rm process into
736         removing unintended files.  In one scenario, if root is removing a
737         hierarchy that is writable by the malicious user, that user may trick
738         root into removing all of `/'.  Reported by Wojciech Purczynski.
739
740         * src/remove.c (remove_dir): After chdir `..', call lstat to get the
741         dev/inode of "." and fail if they aren't the same as the old numbers.
742         (remove_cwd_entries): New parameter, `cwd_dev_ino'.
743         (remove_dir): Likewise.
744         (rm): Likewise.
745         Adjust all callers.
746         * src/mv.c (do_move): The first time we resort to copy/remove,
747         call lstat `.' to get the device/inode numbers now required for rm.
748         * src/rm.c (main): Call lstat `.' to get the device/inode numbers
749         now required for rm.
750         * src/remove.h (struct dev_ino): Declare new type.
751         (rm): Add a parameter to the prototype.
752
753 2002-03-06  Jim Meyering  <meyering@lucent.com>
754
755         * Use automake-1.6.  Regenerate dependent files.
756
757 2002-03-05  Jim Meyering  <meyering@lucent.com>
758
759         * Makefile.am (EXTRA_DIST): Add config/config.rpath.
760
761 2002-03-04  Jim Meyering  <meyering@lucent.com>
762
763         * Makefile.maint (tgz-size): Also handle a suffix of `K', since
764         the sizes in the output of `du -h' now look like `29K'
765
766 2002-03-03  Jim Meyering  <meyering@lucent.com>
767
768         * Version 4.1.6.
769
770 2002-03-03  Paul Eggert  <eggert@twinsun.com>
771
772         Make cp -r equivalent to cp -R.  Add a new cp option --copy-contents
773         for people who want to emulate the traditional (and rarely desirable)
774         cp -r behavior.
775
776         * src/cp.c (COPY_CONTENTS_OPTION): New enum value.
777         (long_opts): Add --copy-contents.
778         (usage): Describe new behavior.  Sort options.
779         (main): Implement new behavior.  Remove diagnostics for -a and -r;
780         no longer needed.
781         * src/copy.c (copy_internal): Remove -r warning; no longer needed.
782
783         * NEWS: Document this.
784
785 2002-03-02  Jim Meyering  <meyering@lucent.com>
786
787         * src/copy.c (copy_internal): For each symlink copied by cp -r,
788         issue a warning that `cp -r' is not portable.
789
790         * src/cp.c (main): Revert change of 2001-12-29.  With this change,
791         cp -r once again preserves symlinks.
792         (usage): Document the original (now-restored) behavior.
793         * tests/cp/r-vs-symlink: Reflect changed semantics of cp's -r option.
794
795         * src/cp.c (main): Warn when -r is specified before --archive (-a).
796         * src/cp.c (main): Fail when -r is specified after --archive (-a)
797         on the command line.
798
799         * src/copy.c (copy_reg): Detect abuse of a race condition
800         whereby an unprivileged user could gain read access to otherwise-
801         inaccessible files when root uses cp or mv to copy a hierarchy
802         belonging to that user.
803
804 2002-02-27  Paul Eggert  <eggert@twinsun.com>
805
806         * src/ls.c (decode_switches, usage): Add --time-style=+FORMAT.
807         * doc/coreutils.texi (Formatting file timestamps): Document it.
808
809 2002-02-25  Paul Eggert  <eggert@twinsun.com>
810
811         Add ACL support to 'ls' for HP-UX and Unixware, and try to
812         establish a framework for adding it for other hosts.
813         This builds on a suggestion of Andreas Gruenbacher.
814
815         * lib/Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
816         * lib/acl.h, lib/acl.c, m4/acl.m4: New files.
817         * m4/jm-macros.m4 (jm_MACROS): Require AC_FUNC_ACL.
818         Do not check for acl or sys/acl.h, as AC_FUNC_ACL does that now.
819         * src/ls.c: Include "acl.h" rather than <sys/acl.h>.
820         (USE_ACL): Remove; replaced by HAVE_ACL everywhere.
821         (gobble_file): Use file_has_acl rather than doing it ourselves.
822
823 2002-02-20  Jim Meyering  <meyering@lucent.com>
824
825         * src/touch.c: Include posixver.h.
826         (usage): Document only the intersection of the old and new behaviors,
827         to encourage portability.
828         (main): Use `posix2_version ()' in place of POSIX2_VERSION.
829
830 2002-02-17  Jim Meyering  <meyering@lucent.com>
831
832         * ABOUT-NLS, intl/*: Update to Gettext 0.11.
833         * INSTALL: Update to Autoconf 2.52h.
834
835         * src/Makefile.am (datadir): Use `share' in place of @DATADIRNAME@,
836         per Gettext-0.11.
837         (LDADD): Use @LIBINTL@ instead of @INTLLIBS@, per Gettext-0.11.
838
839         * configure.ac (AC_CONFIG_AUX_DIR): New macro invocation.
840         (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11.
841
842         * config: New subdirectory, containing the following files from .:
843         config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs.
844         Move the following files here from doc: texinfo.tex, mdate-sh.
845
846 2002-02-16  Jim Meyering  <meyering@lucent.com>
847
848         * tests/ls/infloop: Use `head -n 7', not `head -7'.
849         * tests/rm/hash: Likewise.
850
851 2002-02-10  Jim Meyering  <meyering@lucent.com>
852
853         * configure.in (ALL_LINGUAS): Add Hungarian (hu).
854
855 2002-02-02  Jim Meyering  <meyering@lucent.com>
856
857         * src/shred.c: (VERBOSE_UPDATE): Update every 5 seconds, not every 10.
858         (wipename): Quote file names only when necessary.
859         (main): Copy quoted string into malloc'd storage so it doesn't
860         get clobbered when using -u and --verbose.
861
862         Minor clean-up.
863         * src/shred.c:
864         Use `NULL' rather than `(time_t *) 0'.
865         (dopass): Use STREQ in place of strcmp.
866         Add parentheses around use of nested ternary operator.
867
868 2002-01-15  Paul Eggert  <eggert@twinsun.com>
869
870         * src/shred.c (VERBOSE_UPDATE): Now counts seconds, not bytes.
871
872         (dopass): If verbose, output a line every VERBOSE_UPDATE seconds,
873         and suppress duplicate output lines.  Output a percentage as well
874         as a count of bytes.
875
876         Also, fix comment/code typo regarding how many bytes have been
877         written; this typo was harmless before, but is no longer harmless with
878         the above change in effect.
879
880 2002-02-02  Jim Meyering  <meyering@lucent.com>
881
882         * src/remove.c (rm): Add a comment.
883
884 2002-01-28  Jim Meyering  <meyering@lucent.com>
885
886         * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5d.
887         * configure.ac (AM_INIT_AUTOMAKE): Use zero-arg form of this macro.
888
889 2002-01-21  Jim Meyering  <meyering@lucent.com>
890
891         * po/POTFILES.in: Add lib/xmemcoll.c
892
893         * src/chown-core.c: Don't include "xalloc.h", as system.h already
894         does that via sys2.h.
895         * src/ls.c: Likewise.
896         * src/shred.c: Likewise.
897
898 2002-01-20  Paul Eggert  <eggert@twinsun.com>
899
900         * src/ls.c: Avoid undefined behavior when strcoll fails,
901         by resorting the directory with strcmp instead.
902
903         Include <setjmp.h>.
904         Include "quote.h".
905         (compare_atime, rev_cmp_atime, compare_ctime, rev_cmp_ctime,
906         compare_mtime, rev_cmp_mtime, compare_size, rev_comp_size,
907         compare_name, rev_cmp_name, compare_extension, rev_cmp_extension,
908         compare_version, rev_compare_version): Move before use, so that
909         we can remove the forward declaration.  Reimplement in terms of
910         the new functions described below, using xstrcoll instead of strcoll.
911         (failed_strcoll): New var.
912         (xstrcoll): New function.
913         (V): New type.
914         (cmp_ctime, compstr_ctime, rev_str_ctime): New functions.
915         (cmp_mtime, compstr_mtime, rev_str_mtime): Likewise.
916         (cmp_atime, compstr_atime, rev_str_atime): Likewise.
917         (cmp_size, compstr_size, rev_str_size): Likewise.
918         (cmp_version): Likewise.
919         (cmp_name, compstr_name, rev_str_name): Likewise.
920         (cmp_extension, compstr_extension, rev_str_extension): Likewise.
921         (sort_files): Use prototype for internal function var.
922         If the strcoll-based comparison fails, fall back on a strcmp-based one.
923
924 2002-01-19  Jim Meyering  <meyering@lucent.com>
925
926         Ensure that the two version numbers in configure.ac remain in sync.
927         * Makefile.maint (local-check): Depend on ac-check.
928         (ac_p_pkg, AC_INIT_PKG): Define.
929         (ac_p_ver, AC_INIT_VER): Define.
930         (ac-check): New rule.
931
932 2002-01-19  Jim Meyering  <meyering@lucent.com>
933
934         * configure.ac: Remove code that set LIBOBJS in support of ansi2knr.
935         The latest version of autoconf objected to it, and besides, I don't
936         care too much about K&R support these days.
937
938 2002-01-14  Paul Eggert  <eggert@twinsun.com>
939
940         * src/touch.c (main): Issue a warning for obsolete usage, unless
941         POSIXLY_CORRECT.
942
943 2002-01-14  Paul Eggert  <eggert@twinsun.com>
944
945         Add support for POSIX 1003.1-2001, which requires removal for
946         support of the obsolete `touch [-acm] MMDDhhmm[YY] FILE...' syntax.
947
948         * NEWS: Document this.
949         * src/touch.c (usage, main): Implement this.
950
951 2002-01-12  Jim Meyering  <meyering@lucent.com>
952
953         Avoid giving a misleading diagnostic in some unusual cases.
954         Instead, give one that makes sense.
955
956         * src/copy.c (copy_reg): Don't treat errno==ENOENT as a special case.
957         (same_file_ok): Detect a case that would have lead to the errno==ENOENT
958         condition above (and a misleading diagnostic), and return 0 so we give
959         a diagnostic about the source and destination being the same file.
960         (copy_internal): Use an explicit test for errno==EXDEV to detect
961         that rename has failed because source and destination are on
962         different devices.  This reverts part of a change from 1997-12-13,
963         and is to avoid letting a race condition evoke a bogus diagnostic.
964         Note that while POSIX has encouraged the errno==EXDEV test for
965         years, it was inadequate back in 1997.  I'm hoping that many
966         more systems have conforming support these days.
967         Reported by Michael Gaughen <mgaughen@polyserve.com>
968
969         * src/shred.c (usage): Also mention Ext3.
970         Suggestion from Göran Uddeborg.
971
972 2002-01-06  Bruno Haible  <bruno@clisp.org>
973
974         * src/ls.c (long_time_format): Extend translator comments.
975
976 2002-01-05  Jim Meyering  <meyering@lucent.com>
977
978         * Version 4.1.5.
979
980 2001-12-29  Jim Meyering  <meyering@lucent.com>
981
982         * src/cp.c (main): With -r, always dereference symlinks.
983         Reported by Christian Harkort.  Patch by Chris J. Bednar.
984
985         * tests/cp/r-vs-symlink: New file to test for the above fix.
986         * tests/cp/Makefile.am (TESTS): Add r-vs-symlink.
987
988 2001-12-21  Jim Meyering  <meyering@lucent.com>
989
990         * src/shred.c [!HAVE_CONFIG_H]: Remove cpp block that duplicated
991         code in lib/ in order to facilitate compiling this program without
992         config.h.
993
994 2001-12-19  Paul Eggert  <eggert@twinsun.com>
995
996         * src/shred.c: Add FSF copyright notice.
997
998 2001-12-18  Paul Eggert  <eggert@twinsun.com>
999
1000         Use notation compatible with SI and with IEC 60027-2.
1001         For example, --block-size=1MB now means --block-size=1000000,
1002         whereas --block-size=1MiB now means --block-size=1048576.
1003         A trailing `B' now means decimal, not binary; this is a silent change.
1004         -H or --si now outputs the trailing 'B', for consistency with this.
1005         Programs now output trailing 'K' (not 'k') to mean 1024.
1006         New df, du short option -B is short for --block-size.
1007         You can omit an integer `1' before a block size suffix,
1008         e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'.
1009
1010         * NEWS, doc/coreutils.texi: Document this.  Remove documentation
1011         for obsolescent constructs MD, --kilobytes, -m or --megabytes.
1012
1013         * src/dd.c (usage, parse_integer): Prefer K to k for 1024.
1014         * src/shred.c (usage, main): Likewise.
1015
1016         * src/shred.c (xstrtoumax): If there is no number but there
1017         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
1018         Accept 'K' as well as 'k'.
1019
1020         * src/dd.c (usage): MD -> MB for decimal.
1021
1022         * src/df.c (BLOCK_SIZE_OPTION): Remove; no longer needed now that
1023         we have 'B'.
1024         (long_options, usage, main): Add -B.
1025         (usage): Deprecate --kilobytes, -m, --megabytes.
1026         Document size suffixes.
1027         * src/du.c: Likewise.
1028         * src/ls.c (usage): Deprecate --kilobytes.  Document size suffixes.
1029
1030         * src/df.c (print_header, show_dev): Enlarge column widths for
1031         trailing "B".
1032
1033 2001-12-17  Jim Meyering  <meyering@lucent.com>
1034
1035         * Makefile.maint (real_dir): Remove unused variable.
1036         (url_dir_list): Don't set define it here, but...
1037         * Makefile.cfg (url_dir_list): ...define it here instead.
1038         (hosts, a_host, b_host): Remove now-unused variables.
1039         (alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables.
1040
1041 2001-12-15  Jim Meyering  <meyering@lucent.com>
1042
1043         * Version 4.1.4.
1044
1045         * tests/touch/fail-diag: Also accept SunOS4's `Not owner' diagnostic.
1046         Reported by Volker Borchert.
1047
1048         * tests/help-version: Fail also if ./$i --version fails.
1049         Run each --help and --version test with a few different settings
1050         of LC_MESSAGES.  Prompted by a report from Nelson Beebe.
1051
1052 2001-12-11  Jim Meyering  <meyering@lucent.com>
1053
1054         Include the word `fail' in some diagnostics to make it clearer
1055         that they indicate a failure.
1056         * src/chgrp.c (main): s/getting attributes/failed to get attributes/.
1057         * src/chmod.c (change_file_mode, main): Likewise.
1058         * src/chown-core.c (change_file_owner): Likewise.
1059         * src/chown.c (main): Likewise.
1060         * src/cp.c (re_protect): Likewise.
1061         * src/touch.c (touch, main):Likewise.
1062         Suggestion from Karl Berry.
1063
1064 2001-12-10  Jim Meyering  <meyering@lucent.com>
1065
1066         * src/dd.c (buggy_lseek_support): Remove function.
1067         (skip_via_lseek) [__linux__]: New function.
1068         (skip): Use skip_via_lseek, not buggy_lseek_support.
1069         Based on an outline from Paul Eggert.
1070
1071 2001-12-09  Jim Meyering  <meyering@lucent.com>
1072
1073         * configure.in (ALL_LINGUAS): Add Estonian (et).
1074
1075 2001-12-08  Jim Meyering  <meyering@lucent.com>
1076
1077         * Makefile.cfg (wget_files): Remove ansi2knr.c, since it's
1078         no longer available at that location.
1079
1080 2001-12-04  Jim Meyering  <meyering@lucent.com>
1081
1082         * tests/chgrp/basic: Don't use diff's -u option.  It's not portable.
1083         Besides, with GNU diff one can use the DIFF_OPTIONS envvar.
1084         * tests/ls/no-arg: Likewise.
1085         * tests/ls/recursive: Likewise.
1086         * tests/ls/rt-1: Likewise.
1087
1088 2001-12-02  Jim Meyering  <meyering@lucent.com>
1089
1090         * Version 4.1.3.
1091
1092         * src/sys2.h (HELP_OPTION_DESCRIPTION): New macro.
1093         (VERSION_OPTION_DESCRIPTION): New macro.
1094         * src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
1095         * src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
1096         * src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/rm.c,
1097         * src/rmdir.c, src/shred.c, src/stat.c, src/sync.c, src/touch.c (usage):
1098         Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION
1099         instead of hard-coding --help and --version descriptions.
1100
1101         * POTFILES.in: Add src/sys2.h.
1102
1103         * src/touch.c (touch): Extend the change of 2001-09-15 to work on
1104         systems for which errno is set to EPERM in that case.  Thus, e.g.,
1105         `touch /' by non-root gives a better diagnostic on systems like SunOS4.
1106         Reported by Volker Borchert.
1107
1108         Don't emulate dd's skip=N for *all* character devices;  lseek works
1109         just fine on non-tape character devices like /dev/mem and /dev/kmem.
1110         * src/dd.c (buggy_lseek_support) [__linux__]: Emulate `skip=N'
1111         behavior using reads, not lseek for Linux tape devices (major == 9).
1112         Kernel lseek support for tapes is broken, up to and including
1113         linux-2.4.16.  Reported by Herbert Xu.
1114
1115 2001-11-27  Jim Meyering  <meyering@lucent.com>
1116
1117         * tests/ls/rt-1: Compare all lines of output.
1118         Update code to use `trap' and more up to date infrastructure.
1119
1120         The change of 2001-11-01 introduced a bug whereby some recursive
1121         listings didn't have a blank line between per-directory groups of files.
1122         * src/ls.c (print_dir): Print a newline before each directory name
1123         except the first one, rather than after each except the last, since
1124         now (after the changes of 2001-11-01) detecting whether a `pending*'
1125         is the last would involve more work.  Reported by Andreas Schwab.
1126         * tests/ls/recursive: New file.  Test for the above.
1127         * tests/ls/Makefile.am (TESTS): Add recursive.
1128
1129         This change has no net effect.
1130         * src/ls.c (main): Remove always-true conjunct and add a comment.
1131
1132 2001-11-26  Jim Meyering  <meyering@lucent.com>
1133
1134         * src/shred.c: Don't include "gtod.h"
1135         (main): Don't `call' GETTIMEOFDAY_INIT.
1136         * src/ls.c: Likewise.
1137
1138 2001-11-24  Jim Meyering  <meyering@lucent.com>
1139
1140         * Makefile.maint: Include signatures for the xdelta file, too.
1141
1142         * Makefile.maint (emit-upload-commands): Rename from
1143         emit-rsync-commands.
1144         Output only the package name and the prev and current version numbers.
1145
1146         * Version 4.1.2.
1147
1148         * src/sync.c (usage): Make --help and --version strings
1149         start in column 7.
1150
1151         * Makefile.cfg (move_if_change): Remove definition.
1152         ($(srcdir)/m4/jm-glibc-io.m4): Use mv, not move-if-change.
1153
1154 2001-11-23  Jim Meyering  <meyering@lucent.com>
1155
1156         * cp.c, df.c, du.c, install.c, ln.c, ls.c, mkdir.c (usage):
1157         * mkfifo.c, mknod.c, mv.c, shred.c, touch.c (usage):
1158         Note that ``Mandatory arguments to long options are mandatory
1159         for short options too.''
1160
1161         * src/shred.c (usage): Use `output', not `print' in description of
1162         the --version option, so this message is consistent with all the rest.
1163
1164         * chgrp.c, chmod.c, chown.c, cp.c, dd.c, df.c, dircolors.c (usage):
1165         * du.c, install.c, ln.c, ls.c, rm.c, rmdir.c, shred.c, touch.c (usage):
1166         Split --help output into smaller pieces.
1167         Use fputs, not printf.
1168
1169         * src/cp-hash.c: Use opaque type, Hash_table, not `struct hash_table'.
1170         * src/du.c: Likewise.
1171         * src/remove.c: Likewise.
1172
1173 2001-11-22  Jim Meyering  <meyering@lucent.com>
1174
1175         Don't fail for commands like this: cp a a d/
1176         This change in behavior was introduced in 4.1.1, as part of the
1177         2001-09-28 change.  cp and mv still fail for commands like this:
1178         rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
1179
1180         * src/copy.c (triple_hash_no_name): New function.
1181         (src_info_init): New function.
1182         (copy_internal): Warn and return early for the second and subsequent
1183         occurrences of the same source file named on the command line.
1184         * src/copy.h (struct cp_options) [src_info]: New member.
1185         * src/install.c (cp_option_init): Initialize new member.
1186         * src/mv.c (cp_option_init): Likewise.
1187         * src/cp.c (cp_option_init): Likewise.
1188         (do_copy): Call src_info_init.
1189
1190         * tests/mv/dup-source: New test for the above.
1191         * tests/mv/Makefile.am (TESTS): Add dup-source.
1192
1193         * src/copy.c (seen_file): Change type of `stats' parameter to pointer.
1194         (copy_internal): Update caller.
1195
1196         * src/copy.c (struct F_triple): Rename from dest_info.
1197         (seen_file): Rename from seen_dest.  Rename parameters accordingly.
1198         (record_file): Rename from record_dest.  Rename parameters accordingly.
1199         (triple_hash): Rename from dest_info_hash.
1200         (triple_compare): Rename from dest_info_compare.
1201         (triple_free): Rename from dest_info_free.
1202
1203         * src/mknod.c (main): Add a literal format string to suppress
1204         a warning from gcc's -Wformat-security.
1205
1206         copy.c shouldn't maintain static state.
1207
1208         * src/copy.c (dest_info): Remove declaration of file-scoped global.
1209         (dest_info_init): Require a parameter.
1210         Update all callers.
1211         (seen_dest): Require a hash table parameter.  Update callers.
1212         (record_dest): Likewise.
1213         * src/copy.h: Include hash.h.
1214         (struct cp_options) [dest_info]: New member.
1215         * src/install.c (cp_option_init): Initialize new member.
1216         * src/mv.c (cp_option_init): Likewise.
1217         * src/cp.c (cp_option_init): Likewise.
1218         (do_copy): Remove const attribute from declaration of parameter, x.
1219
1220 2001-11-17  Jim Meyering  <meyering@lucent.com>
1221
1222         * tests/chmod/equals: New test for the just-fixed bug in
1223         lib/modechange.c.
1224         * tests/chmod/Makefile.am (TESTS): Add equals.
1225
1226         * configure.ac: Replace use of the one-arg form of AC_INIT
1227         with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR.
1228
1229 2001-11-12  Jim Meyering  <meyering@lucent.com>
1230
1231         * tests/rm/r-3: Clean up.
1232
1233 2001-11-09  Jim Meyering  <meyering@lucent.com>
1234
1235         * configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no
1236         arguments.
1237
1238 2001-11-06  Jim Meyering  <meyering@lucent.com>
1239
1240         * src/dircolors.hin: Remove duplicate entry for .png.
1241         Reported by Frédéric L. W. Meunier.
1242
1243 2001-11-03  Jim Meyering  <meyering@lucent.com>
1244
1245         * Version 4.1.1.
1246
1247         * src/ls.c (DEV_INO_PUSH): Avoid unnecessary copies.
1248         (dev_ino_pop): Likewise.
1249
1250 2001-11-02  Jim Meyering  <meyering@lucent.com>
1251
1252         * src/ls.c: Rename global: s/trace_dirs/recursive/.
1253         (extract_dirs_from_files): Rename parameter:
1254         s/recursive/ignore_dot_and_dot_dot/.
1255
1256         * src/ls.c: (dev_ino_pop): Cast 2nd arg of obstack_blank to `int'
1257         before negating to avoid warning from gcc on systems with 64-bit size_t.
1258
1259         * src/ls.c: Use XMALLOC and XREALLOC in a several places.  It's cleaner.
1260
1261 2001-11-01  Jim Meyering  <meyering@lucent.com>
1262
1263         * src/ls.c: Include dirfd.h.
1264         (print_dir): If dirfd fails, resort to using stat.
1265
1266         * tests/ls/infloop: Redirect cmp's stderr to /dev/null.
1267
1268         * src/ls.c (struct pending) [st_ino, st_dev]: Remove members.
1269         (queue_directory): Remove just-added 3rd parameter
1270         and associated code, and update callers.
1271         (print_dir): Get dev/inode pair via `fstat (dirfd (reading), ...',
1272         and call visit_dir to detect cycles here.
1273         Push the dev/inode pair onto the new stack.
1274         (dev_ino_obstack): New global.
1275         (DEV_INO_PUSH): New macro.
1276         (dev_ino_pop): New function.
1277         (ASSERT_MATCHING_DEV_INO): New macro.
1278         (visit_dir): Take two parameters (dev,ino), not one `pending'.
1279         (main): Initialized the dev_ino_obstack.
1280         Don't call visit_dir here.
1281         Get the dev/ino pair from the new stack, not from the pending entry.
1282
1283         Make ls -R detect directory cycles.
1284         Add loop detection without incurring an additional stat call per
1285         directory processed.  To detect loops efficiently (i.e., time: +O(1)
1286         per directory processed by ls -R, total additional space:
1287         O(max-tree-depth)), record the dev/ino of each `active' directory
1288         in a hash table.  To know when a directory is no longer active,
1289         insert a marker (name == NULL) entry for it in the pending queue.
1290         When a marker comes to the front of the queue, that directory is no
1291         longer active, and must be removed from the hash table.  To remove it,
1292         we need to know its dev/ino again.  Since by the time a directory
1293         has become inactive its files[] info is long gone and it's DIR*
1294         is closed, I must either save the dev/ino someplace (pending seemed
1295         logical) or recompute them via stat.
1296
1297         The following change will convert to using a stack of dev/ino pairs
1298         instead, pushing an entry when doing the opendir (use fstat on
1299         dirfd (reading)), and popping (when encountering a marker) to get
1300         the dev/ino pair to be removed from the hash table.
1301
1302         * src/ls.c: Include hash.h, same.h, and xalloc.h.
1303         (INITIAL_TABLE_SIZE, LOOP_DETECT): Define.
1304         (active_dir_set): New global.
1305         (struct dev_ino): Declare.
1306         (dev_ino_hash, dev_ino_compare, dev_ino_free): New functions.
1307         (visit_dir, free_pending_ent): New functions.
1308         (main): Initialize the active_dir_set hash table, if necessary.
1309         Don't confuse a marker entry with a real one.
1310         Detect loops.
1311         Manage the set of active directories.
1312         Free the hash table.
1313         (queue_directory): Add a new parameter.
1314         Ensure that we set the new dev/ino members for each enqueued directory.
1315         Update all callers.
1316         (print_dir): Don't confuse a marker entry with a real one.
1317         (extract_dirs_from_files): Insert a marker entry before inserting
1318         the entries for subdirectories.
1319
1320         Don't try to print a NULL pointer.
1321         * src/ls.c (main): Don't use ARGMATCH_TO_ARGUMENT.
1322         This reverts part of the 1998-12-31 change.
1323         * tests/ls/dired: New test, for the above.
1324         * tests/ls/Makefile.am (TESTS): Add dired.
1325
1326 2001-10-24  Jim Meyering  <meyering@lucent.com>
1327
1328         * src/cp.c (main): Free hash table storage.
1329         * src/cp-hash.c (forget_all): Use hash_free, not hash_clear.
1330
1331 2001-10-22  Paul Eggert  <eggert@twinsun.com>
1332
1333         * src/sys2.h (alloca): Define to __builtin_alloca if __GNUC__,
1334         to avoid a warning if -Wall.
1335
1336 2001-10-21  Paul Eggert  <eggert@twinsun.com>
1337
1338         * src/dd.c: Remove as many instances of 'unsigned' as
1339         possible, as some of them were not conforming to ANSI C, and
1340         they made the code hard to read.  Avoiding 'unsigned' cuts
1341         down on the number of casts.
1342
1343         (newline_character, space_character, save_char):
1344         Now char, not unsigned char.
1345         (obuf): Now char *, not unsigned char *.
1346         (ascii_to_ebcdic, ascii_to_ibm, ebcdic_to_ascii):
1347         Now char[], not unsigned char[].
1348         (translate_charset, translate_buffer, swab_buffer, skip, copy_simple,
1349         copy_with_block, copy_with_unblock):
1350         Arg now points to char, not unsigned char.
1351         All callers changed.
1352         (translate_charset, parse_conversion, apply_translations):
1353         Use int index, not unsigned int.
1354         (bit_count): Arg is now int, not unsigned int.
1355         Callers not changed, as they already assumed this.
1356         (translate_buffer): Cast char to unsigned char before using
1357         it as a subscript.
1358         (swab_buffer): Returns char *, not unsigned char *.
1359         (dd_copy): Use char, not unsigned char, for buffers.
1360         Use size_t for possibly-large index, not unsigned int.
1361
1362 2001-10-21  Jim Meyering  <meyering@lucent.com>
1363
1364         * src/shred.c (isaac_seed_machdep): Handle SIGSEGV, too.  Ick.
1365
1366         * tests/mv/Makefile.am (TESTS): Remove i-3.  It's not portable.
1367
1368         * src/copy.c: Include xreadlink.h.
1369         (copy_internal): Don't use PATH_MAX.
1370         Rewrite the symlink-copying code to use xreadlink.
1371
1372 2001-10-20  Jim Meyering  <meyering@lucent.com>
1373
1374         * src/touch.c (touch): Extend last change to work on systems
1375         for which errno is set to EINVAL.
1376
1377         * src/ls.c: Declare some local variables to be `const', where
1378         appropriate.
1379         (usage): Improve the description of --dereference (-L).
1380
1381         * src/rm.c (usage): Clarify description of --directory (-d).
1382         Based on a patch from Michael Stone.
1383
1384         * man/chmod.x: Describe sticky files and directories.
1385         From Michael Stone.
1386
1387         * tests/mv/partition-perm: Don't use a umask that removes owner
1388         read/write.  Use a stricter test for permissions.
1389
1390         * tests/cp/link-preserve: Don't use a umask that removes owner
1391         read/write.  That would induce spurious failures in a probably-
1392         outdated version of purify.
1393
1394 2001-10-18  Jim Meyering  <meyering@lucent.com>
1395
1396         * src/mv.c (movefile): Now that remember_copied xstrdup's the file
1397         name, free `new_dest'.
1398
1399         Plug a leak.
1400         * src/cp-hash.c (remember_copied): Use src_to_dest_free to free
1401         the entry we couldn't insert.
1402
1403         Don't use free'd memory.
1404         * src/copy.c (dest_info_free): New function.
1405         (dest_info_init): Make the hash table code use it.
1406         (record_dest): Store each DEST in malloc'd  memory.  Hence the above.
1407         Use dest_info_free to free the `ent' we couldn't insert.
1408
1409 2001-10-14  Jim Meyering  <meyering@lucent.com>
1410
1411         Now, -P is the same as --no-dereference, per POSIX.
1412         Use --parents to get the old meaning.
1413
1414         * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: Remove member.
1415         (long_opts): Associate --no-dereference with `-P'.
1416         (usage): Update description of -P.
1417         (main): Remove local, used_P_option, and code to warn
1418         that the meaning of -P would be changing.
1419
1420 2001-10-13  Jim Meyering  <meyering@lucent.com>
1421
1422         * src/copy.c (copy_internal): Tighten up and add comments
1423         describing the test for when to record (via remember_copied)
1424         a <dst_path, source_dev, source_ino> triple.
1425         Relax the test that guards the hard-linked-dir check and
1426         the hard-link-preserving code.
1427
1428         Remove the link-preserving semantics from cp_options.dereference.
1429         Clean up the code that preserves links for `cp -d' and `mv'.
1430         Introduce new options:
1431           --preserve[={mode,ownership,timestamps,links,all}]
1432           --no-preserve={mode,ownership,timestamps,links,all}
1433         -p and --preserve remain unchanged and are equivalent to
1434           `--preserve=mode,ownership,timestamps'
1435
1436         * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: New member.
1437         (enum) [NO_PRESERVE_ATTRIBUTES_OPTION]: New member.
1438         (enum) [PRESERVE_ATTRIBUTES_OPTION]: New member.
1439         (long_opts): Separate -d and --no-dereference options.
1440         Add `no-preserve'.
1441         Separate -p and --preserve options.
1442         The long-named --preserve now accepts optional arguments; -p doesn't.
1443         (usage): Describe additions and changes.
1444         (cp_option_init): Initialize new member, preserve_links, to 0.
1445         (decode_preserve_arg): New function.
1446         (main) [case 'a']: Set preserve_links to 1.
1447         [case 'd']: Set preserve_links to 1.
1448         Add `case' for long-named --no-dereference.
1449         Handle long-named --no-preserve and --preserve.
1450
1451         * src/copy.h (enum Dereference_symlink): Add comments.
1452         (struct cp_options) [preserve_links]: New member.
1453         * src/install.c (cp_option_init): Initialize new member to 0.
1454         * src/mv.c (cp_option_init): Initialize new member to 1.
1455
1456         * tests/cp/link-preserve: Add tests for some of the above.
1457
1458 2001-10-13  Jim Meyering  <meyering@lucent.com>
1459
1460         * src/copy.h (struct cp_options) [failed_unlink_is_fatal]: Remove
1461         unused member.
1462         * src/mv.c (cp_option_init): Don't set it.
1463         * src/cp.c (cp_option_init): Likewise.
1464         * src/install.c (cp_option_init): Likewise.
1465
1466         * src/copy.h (struct cp_options): Rename members:
1467         s/preserve_owner_and_group/preserve_ownership/, and
1468         s/preserve_chmod_bits/preserve_mode/.
1469         * src/copy.c, src/cp.c, src/install.c, src/mv.c: Update all uses.
1470
1471         * man/chown.x: Fix typo: s/Sh/SH/ before OPTIONS.
1472         Reported by Eric S. Raymond.
1473
1474 2001-10-12  Jim Meyering  <meyering@lucent.com>
1475
1476         * tests/ls/Makefile.am (TESTS): Add infloop.
1477         (XFAIL_TESTS): Mark it as a test that we expect to fail (temporarily).
1478         * tests/ls/infloop: New file.
1479
1480 2001-10-11  Jim Meyering  <meyering@lucent.com>
1481
1482         * src/mknod.c (main): Tell what's wrong with `mknod c zero 1 5' rather
1483         than saying just `Try `./mknod --help' for more information.'.
1484         Suggestion from Karl Berry.
1485
1486 2001-10-07  Jim Meyering  <meyering@lucent.com>
1487
1488         * TODO: Remove items relating to cp-hash.c, now that they're done.
1489
1490         Allow cp -d (and mv when it resorts to copying) to preserve
1491         hard links that span command line arguments.
1492
1493         * src/cp.c (do_copy): Don't clear the hash table after processing
1494         each command line argument.
1495         * tests/cp/link-preserve: New test for the above.
1496         * tests/cp/Makefile.am (TESTS): Add link-preserve.
1497
1498         * src/cp-hash.c (remember_copied): Make a local copy of the file name.
1499         (src_to_dest_free): New function (to free the above).
1500         (hash_init): Register src_to_dest_free.
1501         * src/copy.c (copy_dir): Now that remember_copied copies the
1502         file name, free the temporary `dst_path' allocated here.
1503
1504 2001-10-06  Jim Meyering  <meyering@lucent.com>
1505
1506         Convert du.c to use the functions in lib/hash.c, not private,
1507         slightly-modified copies of those that used to be in cp-hash.c.
1508
1509         * src/du.c (struct entry) [coll_link]: Remove member.
1510         (struct htab): Remove.
1511         (hash_reset, hash_init, hash_insert2, hash_insert): Remove functions.
1512
1513         * src/du.c: Include hash.h and same.h.
1514         (htab): Change type of global to `struct hash';
1515         (entry_hash, entry_compare, hash_ins): New functions.
1516         (count_entry): Use hash_ins instead of hash_insert.
1517
1518 2001-10-06  Jim Meyering  <meyering@lucent.com>
1519
1520         Rewrite cp-hash.c to use the functions in lib/hash.c.
1521
1522         * src/cp-hash.c (hash_init): Die if hash_initialize fails.
1523
1524         * src/cp-hash.c: Rewrite to use the functions in lib/hash.c.
1525         * src/cp-hash.h: Update prototype for hash_init.
1526         * src/mv.c (do_move): Reflect that hash_init now takes no arguments.
1527         * src/install.c (main): Likewise.
1528         * src/cp.c (main): Likewise.
1529
1530 2001-10-06  Jim Meyering  <meyering@lucent.com>
1531
1532         * src/copy.c (record_dest): Avoid a small leak.
1533
1534 2001-10-06  Jim Meyering  <meyering@lucent.com>
1535
1536         This decreases the memory footprint a little, when copying
1537         hierarchies containing many files.
1538
1539         * src/copy.c (copy_internal): Call remember_copied only if
1540         the source file has 1 < st_nlink, or if it's a directory.
1541         Now that EARLIER_FILE is set conditionally, initialize it to NULL.
1542
1543         * tests/mv/childproof: Redirect stderr on one test.
1544
1545 2001-10-05  Jim Meyering  <meyering@lucent.com>
1546
1547         * src/copy.c: Include hash-pjw.h and remove definition of hash_pjw.
1548         * src/remove.c: Likewise.
1549
1550 2001-10-01  Jim Meyering  <meyering@lucent.com>
1551
1552         * src/remove.c (hash_pjw): Remove function.
1553         * src/copy.c: Likewise.
1554
1555 2001-09-29  Jim Meyering  <meyering@lucent.com>
1556
1557         * src/copy.c (copy_internal): Call record_dest for all types of
1558         files (for which this makes sense), not just regular ones.
1559
1560         * mkinstalldirs: Update from master.
1561
1562         * Makefile.maint (wget-update): Add mkinstalldirs.
1563
1564 2001-09-28  Jim Meyering  <meyering@lucent.com>
1565
1566         This mv command should fail (likewise for cp), rather than
1567         silently clobbering one of the source files.
1568           rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
1569         Reported by Dan Jacobson.
1570
1571         * src/cp.c (do_copy): Call dest_info_init if necessary.
1572         * src/install.c (main): Likewise.
1573         * src/mv.c (main): Likewise.
1574         * src/copy.h (dest_info_init): Declare.
1575         * src/copy.c: Include "hash.h" and "same.h".
1576         (struct Dest_info): Define.
1577         (dest_info): Declare global.
1578         (DEST_INFO_INITIAL_CAPACITY): Define.
1579         (hash_pjw): New function.
1580         (dest_info_hash): Likewise.
1581         (dest_info_compare): Likewise.
1582         (dest_info_init): Likewise.
1583         (seen_dest): Likewise.
1584         (record_dest): Likewise.
1585         (copy_internal): If the destination exists, fail if it's in the set
1586         of files that have already been created as part of this mv or cp.
1587         (copy_internal) [move_mode]: Record the destination dev/ino/filename.
1588         (copy_internal) [!move_mode, regular file]: Likewise.
1589
1590         Accept new option: --reply={yes,no,query}
1591         * src/cp.c: (enum) [REPLY_OPTION]: Define.
1592         (usage): Describe new option.
1593         Split long usage string into smaller pieces.
1594         (main): Handle new option.
1595
1596         * missing: Update from master.
1597         * config.guess: Likewise.
1598         * config.sub: Likewise.
1599
1600         * configure.ac: Tell automake to use the file name `config.hin'
1601         rather than the two-`.' config.h.in.
1602
1603 2001-09-26  Jim Meyering  <meyering@lucent.com>
1604
1605         * man/Makefile.am (common_dep): s/configure.in/configure.ac/.
1606
1607         * configure.ac: Renamed from configure.in.
1608
1609         * INSTALL, mkinstalldirs: Update to autoconf 2.50 version.
1610
1611 2001-09-23  Jim Meyering  <meyering@lucent.com>
1612
1613         * tests/mv/childproof: New test, for the above fix.
1614         Based on a report from Dan Jacobson.
1615         * tests/mv/Makefile.am (TESTS): Add childproof.
1616
1617         * Makefile.am (SUBDIRS): When using newer gettext (in which
1618         intl/libintl.h is created by rules intl/Makefile)
1619         `intl' must precede `lib'.
1620
1621 2001-09-22  Jim Meyering  <meyering@lucent.com>
1622
1623         Mostly clean-up (modulo the better diagnostic).
1624         * src/copy.c (copy_internal): Rename parameter, move_mode, to
1625         command_line_arg, and adjust caller.  Now, move_mode is a local
1626         that is derived from command_line_arg.
1627         Factor some involved code to produce something slightly more readable.
1628         Use x->move_mode, not move_mode in determining which diagnostic
1629         to give (`backing up %s would destroy source;  %s not moved').
1630
1631 2001-09-16  Paul Eggert  <eggert@twinsun.com>
1632
1633         * src/ls.c (usage): Fix typo in -g usage.
1634         -H now means --dereference-command-line.
1635
1636 2001-09-16  Jim Meyering  <meyering@lucent.com>
1637
1638         * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5.
1639
1640         * man/Makefile.am (*.1): Depend on *source* files, not binaries.
1641         (.x.1): Add code to work around ginstall vs. install exception.
1642
1643         * man/Makefile.am (dist_man_MANS): Use dist_man_MANS, not man_MANS.
1644
1645 2001-09-15  Jim Meyering  <meyering@lucent.com>
1646
1647         Convert to a more conventional (e.g., like autoconf) Makefile.am.
1648         * man/Makefile.am: Remove hacks.
1649         * man/GNUmakefile: Remove file.
1650         * man/Makefile.summ: Remove file.
1651         * man/Makefile.maint: Remove file.
1652         * man/ginstall.x: Remove.  Renamed to ...
1653         * man/install.x: ... this.  New file.
1654         Michael Stone reported that man pages weren't built in non-srcdir build.
1655
1656         * src/touch.c (EISDIR): Define to 0, if not already defined.
1657         (touch): Give a better diagnostic for e.g., `touch /' by non-root.
1658         Based on a patch from Michael Stone.
1659         Reported by Jeff Sheinberg as Debian bug #101677.
1660         * tests/touch/fail-diag: New test, for the above fix.
1661         * tests/touch/Makefile.am (TESTS): Add fail-diag.
1662
1663         * src/copy.c (copy_internal) [move_mode]: Support the new
1664         --reply=... option.
1665         (UNWRITABLE): Define (factored out of copy_internal).
1666         (copy_internal): Use UNWRITABLE.
1667
1668         Accept new option: --reply={yes,no,query}
1669         * src/mv.c: Include argmatch.h.
1670         (enum) [REPLY_OPTION]: Define.
1671         (usage): Describe new option.
1672         Split long usage string into smaller pieces.
1673         (main): Handle new option.
1674
1675         * src/cp.c (main): Reflect renaming: s/I_ON/I_ASK_USER/.
1676
1677         * src/copy.h (enum Interactive): Remove members, I_OFF and I_ON.
1678         Instead, add I_ALWAYS_YES, I_ALWAYS_NO, and I_ASK_USER.
1679
1680         * tests/mv/i-2: Clean up: use priv-check rather than open-coding it.
1681
1682 2001-05-11  Paul Eggert  <eggert@twinsun.com>
1683
1684         * src/chmod.c, src/chown.c, src/mkdir.c, src/rm.c, src/rmdir.c (main):
1685         Don't strip trailing slashes; POSIX doesn't allow it here.
1686         Don't include "dirname.h" when no longer needed.
1687
1688 2001-09-08  Jim Meyering  <meyering@lucent.com>
1689
1690         * src/copy.c (copy_internal): Add braces around now-multi-stmt
1691         if-block.  This fixes a bug introduced by my 2001-08-06 change.
1692         * tests/mv/i-4: New test, for the above.
1693         * tests/mv/Makefile.am (TESTS): Add i-4.
1694
1695 2001-09-04  Paul Eggert  <eggert@twinsun.com>
1696
1697         * src/ls.c (get_link_name): Update use of xreadlink.
1698
1699 2001-09-02  Jim Meyering  <meyering@lucent.com>
1700
1701         * tests/priv-check: Change usage not to use $1.
1702         That's not portable to e.g., Solaris2.6's /bin/sh.
1703         Communicate via an envvar instead.
1704         * tests/mv/i-3: Don't pass an argument to a sourced script.
1705         * tests/cp/special-bits: Likewise.
1706         * tests/chown/basic: Likewise.
1707
1708         * Makefile.maint (alpha): Depend on local-check so that they run
1709         a little earlier.
1710
1711 2001-09-01  Jim Meyering  <meyering@lucent.com>
1712
1713         * src/df.c (show_point): Use canonicalize_file_name, if possible.
1714         [HAVE_RESOLVEPATH], [!HAVE_RESOLVEPATH]: Use malloc, not alloca,
1715         so that these two paths also produce `resolved' in malloc'd storage.
1716         Free that memory when done with it.
1717
1718         * src/ls.c: Include "xreadlink.h".
1719         (get_link_name): Don't use PATH_MAX.
1720         Rewrite to use xreadlink.
1721
1722 2001-08-30  Paul Eggert  <eggert@twinsun.com>
1723
1724         * src/chgrp.c: Do not include savedir.h; not used.
1725         * src/chown.c: Likewise.
1726
1727         * src/chmod.c (change_dir_mode): Remove statp arg; no longer needed.
1728         * src/chown-core.c (change_dir_owner): Likewise.
1729         * src/du.c (count_entry): Remove st_size argument.
1730         * src/copy.c (copy_dir): Likewise.
1731
1732 2001-08-30  Paul Eggert  <eggert@twinsun.com>
1733
1734         * src/copy.c: Include full-write.h.
1735         * src/dd.c: Likewise.
1736
1737         * src/copy.c (full_write): Remove decl; not needed.
1738         * src/dd.c: Likewise.
1739         * src/install.c: Likewise.
1740         * src/mv.c: Likewise.
1741
1742         * src/copy.c (copy_reg):
1743         Don't assume read and write size fits in int.
1744         * src/dd.c (open_fd): Likewise.
1745
1746 2001-08-30  Paul Eggert  <eggert@twinsun.com>
1747
1748         * src/remove.c (bool): Remove; moved to...
1749         * src/system.h: ...here.
1750
1751         * src/du.c (count_entry, main): Reflect changes to the
1752         exclude functions.
1753
1754 2001-08-13  Jim Meyering  <meyering@lucent.com>
1755
1756         * src/cp.c, src/dd.c, src/ln.c, src/ls.c, src/mv.c (AUTHORS): Mark
1757         string for translation, since it contains the English word `and'.
1758
1759         * Makefile.maint (author_mark_check): New rule.
1760         (local-check): Depend on it.
1761
1762         Change the rules governing when mv prompts before removing an
1763         existing destination file so it is consistent with POSIX:
1764         Now, in the absence of --force (-f), if stdin is a tty and an
1765         existing destination is not writable mv will prompt before
1766         overwriting the destination file.
1767         Reported by Vin Shelton.
1768
1769         * src/copy.c (overwrite_prompt): New function.
1770         (copy_internal): Separate the mv-specific and non-move_mode code
1771         that determines whether to prompt the user.
1772         [move_mode]: Don't make mv fail (i.e. don't return 1) just because
1773         the user declined to remove one or more of the files.
1774         * src/copy.h (enum Interactive): New type.
1775         (struct cp_options) [interactive]: Change type to Interactive.
1776         (struct cp_options) [stdin_tty]: New member.
1777         * src/cp.c (cp_option_init): Adjust initialization of `interactive',
1778         and initialize new member, stdin_tty.
1779         * src/mv.c (cp_option_init): Likewise.
1780         * src/install.c (cp_option_init): Likewise.
1781         * src/cp.c (main): Adjust initialization(s) of `interactive',
1782         * src/mv.c (main): Likewise.
1783         * tests/mv/i-1: Change expected exit status to reflect the above.
1784
1785 2001-08-12  Jim Meyering  <meyering@lucent.com>
1786
1787         * tests/mk-script ($program_name): Define.
1788         (main): Use $program_name, rather than long-inaccurate `build-script'.
1789         (main): Iterate over the sorted keys (rather than `while...each...'),
1790         so this script produces the same output regardless of which version
1791         of perl (e.g., perl5.6) is used.
1792
1793         Work around non-compliant gettimeofday on Mac OS X 10.0.4,
1794         (aka Darwin 1.3.7) that caused the date of the first file listed
1795         in long output to be the current time rather than the file's mtime.
1796         The real work is in m4/gettimeofday.m4 and the wrapper function,
1797         lib/gettimeofday.c.
1798         * src/ls.c: Include gtod.h.
1799         (main): `Call' GETTIMEOFDAY_INIT.
1800         (print_long_format): Add a comment about gettimeofday.
1801         Report and diagnosis from Bernhard Baehr.
1802
1803         * src/shred.c: Include gtod.h.
1804         (main): `Call' GETTIMEOFDAY_INIT, just in case the code ever changes
1805         to make it necessary.
1806
1807 2001-08-10  Paul Eggert  <eggert@twinsun.com>
1808
1809         * src/ls.c (print_long_format): Simplify previous patch for
1810         listing negative sizes, by adding OFF_T_MAX - OFF_T_MIN + 1
1811         instead of doing a fancy conditional shift.  This is simpler
1812         and it avoids GCC's bogus compile-time warning about shift
1813         counts.  (As a bonus, it is portable to hosts that do not use
1814         twos-complement arithmetic.  :-)
1815
1816 2001-08-10  Jim Meyering  <meyering@lucent.com>
1817
1818         * ls.c (print_long_format): Multiply the shift width by zero
1819         to avoid a warning from gcc on hosts with an unsigned type for the
1820         st_size member.
1821
1822 2001-08-06  Paul Eggert  <eggert@twinsun.com>
1823
1824         * src/ls.c (print_long_format): If a file size is negative, assume
1825         the typical case where it has wrapped around from a positive value.
1826
1827 2001-08-07  Jim Meyering  <meyering@lucent.com>
1828
1829         * Makefile.maint (m4-check): New rule.
1830         (local-check): Depend on it.
1831
1832 2001-08-06  Jim Meyering  <meyering@lucent.com>
1833
1834         Fix the bug whereby `mv -uf source dest' would delete source,
1835         even though it's older than dest.
1836
1837         * src/mv.c (usage): Correct the description of --update.
1838         * src/copy.c (copy_internal): Set *rename_succeeded, so that
1839         the caller (mv) doesn't remove the source file.
1840         Reported by Phelippe Neveu.
1841
1842         * tests/mv/update: New test for the above.
1843         * tests/mv/Makefile.am (TESTS): Add update.
1844
1845 2001-08-05  Jim Meyering  <meyering@lucent.com>
1846
1847         * tests/root-only: Generalize.  Rename to ...
1848         * tests/priv-check: ...this.  New file.  Renamed from the above.
1849         * tests/Makefile.am (EXTRA_DIST): Reflect renaming.
1850         * tests/mv/i-3: Reflect name and usage changes.
1851         * tests/chown/basic: Likewise.
1852         * tests/cp/special-bits: Likewise.
1853         * tests/sample-test: Likewise.
1854
1855 2001-08-04  Jim Meyering  <meyering@lucent.com>
1856
1857         * tests/root-only: Remove *all* write access, not just that
1858         of the owner.
1859
1860         * tests/mv/i-3: New test for the above fix.
1861         * tests/mv/Makefile.am (TESTS): Add i-3.
1862
1863 2001-08-03  Paul Eggert  <eggert@twinsun.com>
1864
1865         * ls.c (quote_name): Pass 0 to mbsnwidth, since the default
1866         got changed and we want the default now.
1867
1868 2001-08-03  Paul Eggert  <eggert@twinsun.com>
1869
1870         * ls.c (quote_name): Pass 0 to mbsnwidth, since the default
1871         got changed and we want the default now.
1872
1873 2001-07-15  Jim Meyering  <meyering@lucent.com>
1874
1875         * src/Makefile.am (INCLUDES): Add -I../lib so sys2.h can include
1876         the new, generated file, unlocked-io.h.
1877
1878         * src/sys2.h: Include "unlocked-io.h", rather than hard-coding the
1879         HAVE_*_UNLOCKED macros.
1880
1881         * Makefile.cfg ($(srcdir)/m4/jm-glibc-io.m4): New rule.
1882
1883 2001-07-14  Jim Meyering  <meyering@lucent.com>
1884
1885         * Makefile.maint (tgz-size): Also work for sizes in the kilobyte range.
1886
1887         * Makefile.maint: More changes from autoconf.
1888
1889         Changes from autoconf.
1890         * Makefile.maint (GZIP_ENV): Add --best.
1891         (AMTAR): Define.
1892         (writable-files): Factor out ../release/ constant, and work (by
1893         creating it) even if such a directory doesn't exist.
1894
1895 2001-07-08  Jim Meyering  <meyering@lucent.com>
1896
1897         * src/copy.c (get_dest_mode): Clear set-user-ID and set-group-ID bits
1898         when copying (i.e., not in move mode) and not preserving permissions.
1899         Reported by kytek@cybercomm.net.
1900         FIXME: add a test for this!!!
1901
1902 2001-07-02  Jim Meyering  <meyering@lucent.com>
1903
1904         * src/ln.c (do_link): Test the boolean symbolic_link, not the function,
1905         symlink.  Patch by Frederik Eaton.
1906
1907 2001-06-17  Jim Meyering  <meyering@lucent.com>
1908
1909         * Makefile.maint: Factor out definitions specific to fileutils,
1910         sh-utils, and textutils, so that other packages can use the framework.
1911         Patch by Akim Demaille.
1912         * Makefile.cfg: New file with package-specific definitions.
1913         * GNUmakefile: Include Makefile.cfg.
1914         * Makefile.am (EXTRA_DIST): Add Makefile.cfg.
1915
1916 2001-06-16  Jim Meyering  <meyering@lucent.com>
1917
1918         * src/ls.c (main): Recheck global print_with_color after calling
1919         parse_ls_color, since that function may have reset it.
1920         Based on a patch from Richard Dawe.
1921
1922 2001-06-16  Jim Meyering  <meyering@lucent.com>
1923
1924         * config.sub: Update from master repository.
1925         * config.guess: Likewise.
1926
1927 2001-06-09  Jim Meyering  <meyering@lucent.com>
1928
1929         * configure.in (ALL_LINGUAS): Add Turkish (tr).
1930
1931 2001-05-25  Jim Meyering  <meyering@lucent.com>
1932
1933         * src/ls.c (print_long_format): Don't truncate user names
1934         or group names that are longer than 8 characters.
1935
1936         Add definitions that let me factor the wget rule while still letting
1937         me accommodate the fact that these files reside in several different
1938         directories and come from different places.
1939         * Makefile.maint (wget-files): Define.
1940         (get-targets, *-local_dir, *-url_prefix): Likewise.
1941         (target, url, local_file): Convenience variables.
1942         ($(get-targets)): The factored rule.
1943
1944 2001-05-24  Jim Meyering  <meyering@lucent.com>
1945
1946         * src/ansi2knr.c: Update from master source.
1947
1948         * Makefile.maint (wget-update): Have wget write to a temporary file,
1949         and replace the original only if wget succeeds.
1950         Also get ansi2nkr.c.
1951         (move-if-change): Define.
1952         (wget-update): Use it in place of mv.
1953
1954         * src/ls.c: Use `#if D_TYPE_IN_DIRENT && defined DTTOIF' to
1955         determine whether to enable the DT_INIT definition, not the less
1956         portable `#if defined _DIRENT_HAVE_D_TYPE || defined DTTOIF'.
1957         Reported by Eli Zaretskii.
1958
1959         * src/mkfifo.c (main): Remove quotes around %s.
1960         The argument is already quoted via the quote function.
1961         * src/mknod.c (main): Likewise.
1962         Reported by Göran Uddeborg.
1963
1964 2001-05-21  Jim Meyering  <meyering@lucent.com>
1965
1966         * Makefile.maint (wget-update): depcomp and missing are now in
1967         automake's lib/ subdirectory.
1968
1969 2001-05-11  Paul Eggert  <eggert@twinsun.com>
1970
1971         Add new --time-style option.
1972         Change --full-time to be equivalent to --time-style=full-iso.
1973
1974         * NEWS, doc/omni-utils.texi: Describe this change.
1975
1976         * src/ls.c: Include "hard-locale.h".
1977         (nstrftime): New decl.
1978         (enum time_style): New enum.
1979         (time_style_args, time_style_types): New constants.
1980         (full_time): Remove.
1981         (long_time_format): Initialize to POSIX defaults.
1982         (TIME_STYLE_OPTION): New constant.
1983         (long_options, decode_switches, usage): Add --time-style support.
1984         (long_time_expected_width): Use nstrftime, not strftime.
1985         (print_long_format): Likewise.
1986         Increase initial size to match new full-iso time style.
1987
1988         * tests/ls/time-1: Unset QUOTING_STYLE and TIME_STYLE.  Set TZ.
1989         Adjust to change in full-time format.
1990         Fix typo in failure messages (-a and -m were interchanged).
1991
1992 2001-05-20  Jim Meyering  <meyering@lucent.com>
1993
1994         * doc/Makefile.am (EXTRA_DIST): Add constants.texi and doclicense.texi.
1995         (info_TEXINFOS): s/fileutils/omni-utils/.
1996         (check-texinfo): New rule.
1997         (check): Depend on check-texinfo.
1998
1999         * doc/omni-utils.texi (uniq invocation): Document the new optional
2000         arguments to the --all-repeated option.
2001         Make all references to POSIX use @sc{posix}.
2002
2003 2001-05-19  Jim Meyering  <meyering@lucent.com>
2004
2005         * doc/fileutils.texi: Remove.
2006
2007         * doc/omni-utils.texi: Change a few uses of `timezone' to `time zone'.
2008         Reported by Stephen Eglen.
2009
2010 2001-05-16  Jim Meyering  <meyering@lucent.com>
2011
2012         * Makefile.maint (my-distcheck): Remove work-around kludge and
2013         associated comment, now that automake has ben fixed.
2014
2015 2001-05-12  Paul Eggert  <eggert@twinsun.com>
2016
2017         Clean up some of the places where the code assumed that random
2018         types like 'mode_t' fit into 'int', which POSIX doesn't guarantee.
2019
2020         * src/ls.c (struct fileinfo.linkmode): Now st_mode.
2021         (print_color_indicator, print_name_with_quoting, print_type_indicator,
2022         length_of_file_name_and_frills):
2023         Use mode_t, not unsigned int, to store modes.
2024         (dired_dump_obstack): Do not assume size fits in 'int'.
2025         (get_link_name): readlink returns ssize_t, not int.
2026         (make_link_path): Store buffer size as size_t, not int.
2027         (print_long_format): Use unsigned long, not unsigned, to print
2028         nlink_t, uid_t, gid_t, major_t, minor_t.
2029
2030 2001-05-13  Paul Eggert  <eggert@sic.twinsun.com>
2031
2032         * src/mknod.c (main): Check for NODEV device only if NODEV is defined.
2033         * src/system.h (NODEV): Remove, undoing previous change.
2034
2035 2001-05-13  Jim Meyering  <meyering@lucent.com>
2036
2037         * src/remove.c (dir_name, dir_len): Define to different names
2038         to avoid shadowing warnings due to new declarations from dirname.h.
2039
2040         * tests/Fetish.pm (run_tests): Fail if any test name is longer
2041         than 12 bytes.
2042         * tests/ls-2/tests: Shorten test names so the length of a
2043         resulting file name doesn't exceed 14.
2044
2045 2001-05-12  Paul Eggert  <eggert@twinsun.com>
2046
2047         * src/system.h (NODEV): New macro, if not already defined.
2048
2049         * src/mknod.c (main): Check for overflow when converting out
2050         of uintmax_t.  Do not assume that major_t and minor_t are no
2051         wider than int.  Check for makedev failures.  Convert device
2052         numbers via uintmax_t, not unsigned long, just in case.
2053         Coalesce duplicate code in the block and character device
2054         cases.
2055
2056 2001-05-11  Paul Eggert  <eggert@twinsun.com>
2057
2058         Add new --dereference-command-line option.
2059         -H now means this instead of meaning --si, as POSIX requires.
2060
2061         * NEWS, doc/omni-utils.texi: Document this.
2062
2063         * src/ls.c (enum Dereference_symlink): New type.
2064         (dereference): New var, replacing trace_links, which was removed.
2065         (long_options, main, decode_switches, gobble_file, usage):
2066         Implement the changes.
2067
2068         * tests/ls-2/tests:
2069         Rename slink-dir test to slink-dir-dF.  Add new tests
2070         slink-dir-F, slink-dir-dFH, slink-dir-dFL.
2071
2072 2001-05-11  Paul Eggert  <eggert@twinsun.com>
2073
2074         dirname code cleanup.  base_name now behaves more compatibly
2075         with POSIX basename when given file names that have trailing
2076         slashes, and similarly for dir_name.  Add new primitives
2077         base_len and dir_len.  Put the directory-name-related decls
2078         into dirname.h.
2079
2080         * src/chmod.c (strip_trailing_slashes): Remove; now in dirname.h.
2081         * src/chown.c (strip_trailing_slashes): Likewise.
2082         * src/cp.c (strip_trailing_slashes): Likewise.
2083         * src/df.c (strip_trailing_slashes): Likewise.
2084         * src/ln.c (strip_trailing_slashes): Likewise.
2085         * src/mkdir.c (strip_trailing_slashes): Likewise.
2086         * src/rm.c (strip_trailing_slashes): Likewise.
2087         * src/rmdir.c (strip_trailing_slashes): Likewise.
2088
2089         * src/dircolors.c, src/ls.c, src/remove.c:
2090         Include "dirname.h", to get base_name.
2091
2092         * src/cp.c (make_path_private): Use dir_len instead of
2093         dir_name, and avoid an extra mealloc call.
2094
2095         * src/df.c (find_mount_point): No need to strip trailing
2096         slashes before invoking new dir_name.
2097
2098         * src/mv.c: Include "dirname.h".
2099         (strip_trailing_slashes_2): Remove; now done by
2100         strip_trailing_slashes.  All callers changed.
2101
2102         * src/sys2.h (base_name): Remove decl; now in dirname.h.
2103
2104         * src/copy.c (copy_internal): Remove the code that tested for NULL
2105         dir_name return value.  That can't happen.
2106
2107 2001-05-12  Jim Meyering  <meyering@lucent.com>
2108
2109         * src/ls.c (usage): Wording changes related to -o, -n, and -g.
2110         * doc/omni-utils.texi: Likewise.
2111         From Paul Eggert.
2112
2113 2001-05-11  Paul Eggert  <eggert@twinsun.com>
2114
2115         * src/chmod.c (mode_changed, change_file_mode):
2116         There's no need to invoke both lstat and stat here, so call just
2117         one of the two functions.
2118
2119 2001-05-11  Jim Meyering  <meyering@lucent.com>
2120
2121         * doc/omni-utils.texi: New file.  The union of fileutils.texi,
2122         sh-utils.texi, and textutils.texi.  Merged by Brian Youmans.
2123
2124         * src/shred.c (usage): Warn about backups and mirrors.
2125         * doc/omni-utils.texi (shred invocation): Likewise.
2126         From Nelson Beebe.
2127
2128 2001-05-09  Jim Meyering  <meyering@lucent.com>
2129
2130         * src/ls.c (main): Don't set `format_needs_stat' for --recursive (-R),
2131         because that would make `ls -RF dir' stat unnecessarily all of the
2132         files in dir/ on some systems.
2133         Similarly, don't set `format_needs_stat' for --dereference (-L),
2134         because that would make `ls -RLF dir' stat unnecessarily all non-symlink
2135         files in dir/ on some systems.
2136         Instead, ...
2137         (gobble_file): ... also stat a file if `trace_dirs' (-R) is set and its
2138         type is unknown.
2139         ... also stat a file if `trace_links' (-L) is set and the file is a
2140         symlink or its type is unknown.
2141         (print_dir): Also recognize DT_REG and DT_LNK.
2142
2143 2001-05-07  Jim Meyering  <meyering@lucent.com>
2144
2145         * src/chown.c (main): Fix thinko that made --from=... fail:
2146         s/argv[optind]/optarg/.  Reported by Andrew Pham.
2147
2148         * tests/chown: New directory.
2149         * tests/chown/basic: New (root-only) test for the above.
2150         * tests/cp/special-bits: Factor out the root-only test into this ...
2151         * tests/root-only: ... new file.
2152         * tests/Makefile.am (EXTRA_DIST): Add root-only.
2153         (SUBDIRS): Add chown.
2154         * tests/chown/Makefile.am: New file.
2155         * configure.in (AC_OUTPUT): Add tests/chown/Makefile.
2156
2157 2001-05-05  Jim Meyering  <meyering@lucent.com>
2158
2159         * src/ls.c (decode_switches): Complain if the envvar, QUOTING_STYLE,
2160         is set to an invalid value.
2161         Move some declarations of locals into scopes where they're used.
2162
2163 2001-05-02  Jim Meyering  <meyering@lucent.com>
2164
2165         * doc/texinfo.tex: Update from master repository.
2166         * config.sub: Likewise.
2167         * config.guess: Likewise.
2168
2169 2001-05-01  Jim Meyering  <meyering@lucent.com>
2170
2171         * Makefile.maint (tgz-size, xd-size): Compute sizes.
2172         (announcement): Include sizes of .tar.gz and .xdelta files
2173         in the announcement.
2174
2175         * src/ls.c (print_owner): New global variable.
2176         (usage): Update the descriptions of -g.
2177         (decode_switches): Honor the -g option (omit owner information),
2178         now that POSIX specifies it.
2179         (print_long_format): Don't print owner name if -g was specified.
2180         Move declaration of `user_name' into the scope where it's used.
2181         (print_group): Rename global from `inhibit_group'.  Update all
2182         uses accordingly.
2183         * doc/fileutils.texi (What information is listed): Describe -g.
2184         * TODO: Remove item for ls -g.
2185
2186         * src/ls.c (decode_switches): Make -n work just like -l, except
2187         with numeric IDs, per POSIX.  Before, to have any effect, -n had
2188         to be used with -l.  Reported by Dale Scheetz.
2189         (usage): Update the description of -n.
2190         Separate the descriptions of -n and --numeric-uid-gid.
2191         Split string in --help output that had exceeded my limit of
2192         2048 bytes.
2193
2194 2001-04-29  Jim Meyering  <meyering@lucent.com>
2195
2196         * Version 4.1.
2197
2198         * configure: Regenerate using a further-patched copy of autoconf-2.49e
2199         to work around a bug in its test for ranlib.  This is the change to
2200         autoconf's acgeneral.m4 that was made on 2001-04-24.
2201
2202         * README: Don't mention mvdir.  It is no longer provided.
2203         Don't mention HP/UX vs. du blocksize problem.  It's long gone.
2204         Remove note about how cp, mv, and ln couldn't make backups
2205         of files with names of maximum length.  Now they can do that.
2206         Thank the people who have provided access to their systems
2207         for portability testing.
2208         Warn about and describe autoconf/automake version requirements.
2209         Use a better URL for the GNU Coding Standards.
2210
2211         * man/rm.x: Refer to shred.
2212         Remove the example showing how to remove `-foo', since that is now
2213         in the --help output (and hence automatically included).
2214         * src/rm.c (usage): Mention shred.
2215
2216         * src/shred.c (usage): Include in --help output the warning about
2217         some of the filesystem types on which shred is not effective.
2218
2219 2001-04-25  Jim Meyering  <meyering@lucent.com>
2220
2221         * Makefile.maint (my-distcheck): Add a comment.
2222
2223 2001-04-23  Jim Meyering  <meyering@lucent.com>
2224
2225         * Version 4.0.45.
2226
2227 2001-04-22  Jim Meyering  <meyering@lucent.com>
2228
2229         * src/ls.c (decode_switches): Ensure that -1 has no effect when it
2230         follows -l, per POSIX.  Reported by Ulrich Drepper.
2231
2232         * src/dd.c (usage): Mention that sync makes dd pad with spaces (rather
2233         than NULs) when used with block or unblock.
2234         (dd_copy): When using sync with either block or unblock,
2235         pad with spaces.  Reported by Dale Scheetz.
2236         * tests/dd/skip-seek (block-sync-1): New test, for this.  Based on
2237         a report from Dale Scheetz.
2238         * doc/fileutils.texi (dd invocation): Document it here, too.
2239
2240         * configure: Regenerate using a patched copy of autoconf-2.49e to
2241         work around a bug in its test for a working memcmp function.
2242         This is the change to autoconf's acfunctions.m4 that was made
2243         on 2001-04-22.
2244
2245         * tests/ls/no-arg: New file.
2246         * tests/ls/Makefile.am (TESTS): Add no-arg.
2247         * src/ls.c (main): Fix off-by-one error introduced with last change.
2248
2249 2001-04-21  Jim Meyering  <meyering@lucent.com>
2250
2251         * Version 4.0.44.
2252
2253         * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49e.
2254
2255         * doc/fileutils.texi (touch invocation): Discuss ctime.
2256         Based on suggestions and contributions from Aharon Robbins
2257         and Dan Jacobson.
2258
2259         * src/ls.c (main): When given two or more arguments but the only one
2260         that exists is a directory, don't treat it as if it were the only
2261         argument.  Before, `mkdir d; ls no-dir d 2>/dev/null' would act like
2262         `ls d' and produce no output.  Now, it prints `d:'.
2263         Report and patch from Stéphane Chazelas.
2264         * tests/ls-2/tests: New tests, for the above fix.
2265
2266 2001-04-08  Jim Meyering  <meyering@lucent.com>
2267
2268         * depcomp: New version, from automake.
2269
2270 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
2271
2272         * ls.c: Don't inspect MB_LEN_MAX. Paul Eggert says it's
2273         not always defined correctly.
2274
2275 2001-04-03  John David Anglin  <dave@hiauly1.hia.nrc.ca>
2276
2277         * tests/chgrp/basic: Ensure that initial group id's are properly set
2278         for `d' and `d/f3'.
2279
2280 2001-04-02  Jim Meyering  <meyering@lucent.com>
2281
2282         * tests/mv/setup: Skip nonexistent directories so we don't get
2283         diagnostics from df about e.g., `/usr/tmp not found'.
2284
2285 2001-03-24  Jim Meyering  <meyering@lucent.com>
2286
2287         * configure.in: Don't require autoconf version here -- it's done in m4/.
2288
2289 2001-03-23  Jim Meyering  <meyering@lucent.com>
2290
2291         * Version 4.0.43.
2292
2293         * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49d.
2294
2295         * Makefile.maint (check-copyright): New target and rule.
2296         (alpha): Depend on it.
2297
2298         * missing: Handle shell built-ins (only `:' and `cd' for now) to work
2299         around brain damage in Ultrix's /bin/sh.
2300
2301 2001-03-18  Jim Meyering  <meyering@lucent.com>
2302
2303         * Version 4.0.42.
2304
2305         * tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL
2306         to $DJDIR/bin/bash.exe.  Patch from Richard Dawe, based on a
2307         suggestion from Eli Zaretskii.
2308
2309 2001-03-17  Paul Eggert  <eggert@twinsun.com>
2310
2311         * doc/fileutils.texi: Warn that touch DATE FILE will be withdrawn.
2312
2313 2001-03-17  Jim Meyering  <meyering@lucent.com>
2314
2315         * tests/install/basic-1: Add the standard $VERBOSE-handling hook.
2316         This test currently fails for mips-dec-ultrix4.4.
2317
2318         * tests/install/create-leading: Use ../envvar-check rather than
2319         open-coding the same tests.
2320
2321         * tests/envvar-check: Set/use $as_unset, for those shells
2322         (like Ultrix4's /bin/sh) that don't accept `unset'.
2323
2324         * missing (--run): Use `eval' to run `"$@"'.  Otherwise, Ultrix4.4's
2325         /bin/sh fails and outputs garbage.
2326
2327         * src/touch.c (usage): Tweak the obsolescent usage line so that
2328         help2man recognizes it as such.  Reported by Dan Jacobson.
2329
2330 2001-03-16  Jim Meyering  <meyering@lucent.com>
2331
2332         * Makefile.maint (wget-update): Also get `missing'.
2333         Use for-loops.
2334
2335         * missing: Update from automake.
2336
2337 2001-03-11  Jim Meyering  <meyering@lucent.com>
2338
2339         * tests/rm/isatty: Disable this test, for now.
2340         It would block when run in the background.
2341
2342 2001-03-09  Jim Meyering  <meyering@lucent.com>
2343
2344         * config.guess: Update from master repository.
2345
2346         * Makefile.maint (my_distdir): Define new variable, and use this
2347         in place of most old uses of $(distdir).
2348
2349         * src/Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
2350         Reported by Akim Demaille.
2351
2352         * tests/help-version: Ensure that /dev/full is a character device
2353         (using test -c) as well as being writable, before trying to write to it.
2354         Otherwise, the test could mistakenly append a newline to an existing,
2355         regular, writable, /dev/full file.
2356         Suggested by Ulrich Drepper.
2357
2358 2001-03-06  Jim Meyering  <meyering@lucent.com>
2359
2360         * src/dd.c (S_TYPEISSHM): Rename parameter to reflect its type.
2361         (main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM.
2362         Patch by Alain Magloire.
2363
2364 2001-03-04  Jim Meyering  <meyering@lucent.com>
2365
2366         * src/dd.c (output_char): Reformat so each statement is on a
2367         separate line.
2368
2369 2001-02-21  Jim Meyering  <meyering@lucent.com>
2370
2371         * src/mkdir.c (main): Remove assignment-in-if-expression.
2372         In fact, remove t_errno altogether.  Reported by Nelson Beebe.
2373
2374         * tests/ls-2/tests: Add two tests of existing behavior -- both will
2375         have to be changed (soon after release), once ls is fixed.
2376
2377 2001-02-20  Paul Eggert  <eggert@twinsun.com>
2378
2379         * src/ls.c (FULL_TIME_OPTION): Renamed from FULL_TIME, for
2380         consistency with the other enum values.
2381
2382 2001-02-20  Paul Eggert  <eggert@twinsun.com>
2383
2384         * NEWS, doc/fileutils.texi: ls -H is now obsolescent.
2385         * src/ls.c (SI_OPTION): New enum value.
2386         (long_options): Use it instead of 'H' for --si.
2387         (decode_switches): Warn that -H will change soon.
2388         (usage): Likewise.
2389
2390 2001-02-18  Jim Meyering  <meyering@lucent.com>
2391
2392         * tests/rm/Makefile.am (TESTS): Add isatty.
2393         * tests/rm/isatty: New test, for the bug fixed below.
2394
2395         * Version 4.0.41.
2396
2397         * depcomp: New version, from automake.
2398
2399         `chmod 0 file; rm file' would no longer prompt before removal.
2400         * src/remove.c (remove_file): Revert last change.
2401         Reported by Vin Shelton.
2402
2403 2001-02-17  Jim Meyering  <meyering@lucent.com>
2404
2405         * Version 4.0.40.
2406
2407         * src/chown.c (main): `quote' the offending argument.
2408
2409 2001-02-17  Paul Eggert  <eggert@twinsun.com>
2410
2411         Stop trying to support hosts that have nonstandard declarations for
2412         mbrtowc and/or mbstate_t.  It's not worth the portability hassle.
2413
2414         * m4/mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC.
2415         * m4/mbswidth.m4 (jm_PREREQ_MBSWIDTH):
2416         Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc).
2417         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Likewise.
2418         * lib/mbswidth.c, lib/quotearg.c, src/ls.c (mbrtowc, mbsinit):
2419         Remove workaround macros for hosts that have mbrtowc but not
2420         mbstate_t, as we now insist on proper declarations for both
2421         before using mbrtowc.
2422         Reported by Matt Schalit.
2423
2424 2001-02-17  Jim Meyering  <meyering@lucent.com>
2425
2426         * config.sub: Update from master repository.
2427         * config.guess: Likewise.
2428
2429 2001-02-16  Paul Eggert  <eggert@twinsun.com>
2430
2431         * doc/getdate.texi: Mention that only English is supported.
2432         Show how to use "date" so that the output is acceptable to getdate.
2433         Mention Z as an abbreviation for UTC.
2434
2435 2001-02-11  Jim Meyering  <meyering@lucent.com>
2436
2437         * Makefile.maint (emit-rsync-commands): Define.
2438         (alpha): Use it here.
2439
2440 2001-02-10  Jim Meyering  <meyering@lucent.com>
2441
2442         * Makefile.maint (alpha): Fix previous, incomplete change.
2443
2444         * Version 4.0.39.
2445
2446         * depcomp: New version, from automake.
2447
2448 2001-02-04  Jim Meyering  <meyering@lucent.com>
2449
2450         * README: Remove note about now-ancient Sequents.
2451
2452 2001-02-03  Jim Meyering  <meyering@lucent.com>
2453
2454         * src/ln.c (main): Change type of index variable to `unsigned int'
2455         to avoid a warning.
2456
2457         * config.guess: Update from master repository.
2458
2459         * Makefile.maint (a_host): Use fencepost.
2460         (real_dir): Use the same name for both.
2461         (alpha): Print commands for both hosts.
2462
2463         * src/mv.c (long_options): Use `strip-trailing-slashes',
2464         per the documetation, not `strip-trailing-slash'.
2465         * src/cp.c (long_opts): Likewise.
2466         Reported by Oskar Liljeblad.
2467
2468         * doc/fileutils.texi (mv invocation): Add a warning about how a trailing
2469         slash makes a difference.  Prompted by a report from Oskar Liljeblad
2470         via Michael Stone (Debian bug#83991).
2471
2472 2001-01-31  Jim Meyering  <meyering@lucent.com>
2473
2474         * config.sub: Update from master repository.
2475         * config.guess: Likewise.
2476
2477 2001-01-28  Jim Meyering  <meyering@lucent.com>
2478
2479         * Version 4.0.38.
2480
2481         * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49c.
2482
2483         * src/ls.c (gobble_file): Add a FIXME comment.
2484
2485         * TODO: Add a few items.
2486
2487         * src/ls.c (enum) [FULL_TIME]: Define.
2488         (long_options): Use it.
2489         (decode_switches): Make --full-time imply -l.
2490         Prompted by a report from Karl Eichwalder.
2491
2492 2001-01-22  Jim Meyering  <meyering@lucent.com>
2493
2494         * src/remove.c (remove_file): Correct an expression to avoid making
2495         an unnecessary call to euidaccess for each file.
2496
2497 2001-01-21  Jim Meyering  <meyering@lucent.com>
2498
2499         * Version 4.0.37.
2500
2501 2001-01-20  Jim Meyering  <meyering@lucent.com>
2502
2503         * configure.in: Remove jm_CHECK_ALL_TYPES.
2504         Now it's invoked by jm_MACROS.
2505
2506 2001-01-17  Jim Meyering  <meyering@lucent.com>
2507
2508         * src/sys2.h (case_GETOPT_VERSION_CHAR): Use PACKAGE, not GNU_PACKAGE.
2509         * src/sync.c (main): Likewise.
2510         * src/shred.c (PACKAGE): Likewise.
2511         * src/dd.c (main): Likewise.
2512
2513 2001-01-14  Jim Meyering  <meyering@lucent.com>
2514
2515         * Version 4.0.36.
2516
2517         * src/shred.c (UINT_MAX_32_BITS): Define.
2518         Use UINT_MAX_32_BITS in the cpp conditions that determine
2519         the `word32' typedef.  Using a literal `0xffffffff' failed with
2520         HPUX10.20's /bin/cc.
2521
2522         * config.sub: Update from master repository.
2523         * config.guess: Likewise.
2524
2525 2001-01-02  Volker Borchert  <bt@teknon.de>
2526
2527         Work around a broken rename system call, e.g. on SunOS 4.1.1_U1,
2528         that fails when the source path has a trailing slash.
2529         * src/copy.h [RENAME_TRAILING_SLASH_BUG]: Use the rename wrapper.
2530         * tests/mv/trailing-slash: Test whether the workaround works.
2531         * tests/m4/Makefile.am (TESTS): Add trailing-slash.
2532
2533 2001-01-03  Alexandre Duret-Lutz  <duret_g@epita.fr>
2534
2535         * po/Makefile.in.in (update-po): Merge po-files in temporary files
2536         in the build directory, and update the source directory only when
2537         the merged catalog differs from the original.  This fixes the known
2538         `make distcheck' failure due to `make update-po' being called
2539         on up-to-date but read-only files.
2540
2541 2001-01-13  Jim Meyering  <meyering@lucent.com>
2542
2543         * src/copy.c (same_file_ok): When moving a symlink onto itself,
2544         don't remove the symlink.  Reported by David Luyer as Debian bug#82089,
2545         via Michael Stone.
2546         * tests/mv/into-self-4: New test for the above.
2547         * tests/mv/Makefile.am (TESTS): Add into-self-4.
2548
2549         * tests/chmod/setgid: If `chmod g+s d' fails, then try to chgrp
2550         to a group of which we're a member, then try the chmod again.
2551
2552 2001-01-11  Jim Meyering  <meyering@lucent.com>
2553
2554         * depcomp: New version, from automake.
2555
2556 2001-01-10  Jim Meyering  <meyering@lucent.com>
2557
2558         * src/copy.c (copy_internal): Add a comment.
2559         Set *copy_into_self in the new code that detects that.
2560         Make diagnostic more consistent: s/won't/will not/.
2561         [move_mode, copy_into_self]: Give a diagnstic here, now that
2562         we have the top_level_* globals.  Remove the corresponding diagnostic
2563         from mv.c.
2564         Add a FIXME comment.
2565         * src/mv.c (do_move): Remove diagnostic, now that copy.c issues it.
2566         Set `fail' to nonzero in the primary `if (copy_into_self)' block
2567         rather than in its own tiny one below.
2568
2569         * src/copy.c (copy_internal): Don't allow cp (or mv, when working
2570         across a partition boundary) to overwrite a non-directory with a
2571         directory.  Reported by Michael J. Croghan.
2572         * tests/cp/dir-vs-file: New test for the above.
2573         * tests/cp/Makefile.am (TESTS): Add dir-vs-file.
2574
2575 2001-01-09  Jim Meyering  <meyering@lucent.com>
2576
2577         Give a better diagnostic for `cp -R a a'.
2578         * src/copy.c (top_level_src_path, top_level_dst_path): New globals.
2579         (copy_internal): Use them.
2580         (copy): Set them.
2581         * src/cp-hash.c [struct entry] (node): Describe how it's used,
2582         now that we've overloaded it, in order to detect and diagnose
2583         the copying-directory-into-self problem.
2584         (new_file): Remove global.
2585         (htab): Declare global to be static.
2586         (remember_created): Insert file name instead of dummy pointer, so
2587         that copy.c can use the just-created directory name to detect
2588         the copying-directory-into-self problem.
2589         * tests/cp/into-self: New test for the above.
2590         * tests/cp/Makefile.am (TESTS): Add into-self.
2591
2592 2001-01-07  Jim Meyering  <meyering@lucent.com>
2593
2594         * src/cp.c (usage): Split a string that was longer than 2048 bytes.
2595
2596         * doc/perm.texi: s/can not/cannot/
2597
2598 2001-01-07  Karl Eichwalder  <ke@suse.de>
2599
2600         * src/chown.c (usage): Split long message string.
2601
2602 2001-01-07  Karl Eichwalder  <ke@suse.de>
2603
2604         * src/ls.c (usage): Untabify.
2605
2606         * src/chgrp.c (parse_group): Normalize spelling.
2607
2608 2001-01-03  Paul Eggert  <eggert@twinsun.com>
2609
2610         * NEWS: Document the planned --full-time change.
2611         * doc/fileutils.texi: Likewise.
2612         * NEWS: Document that time stamps depend on LC_TIME, not LC_MESSAGES.
2613
2614 2001-01-03  Paul Eggert  <eggert@twinsun.com>
2615
2616         Use the more precise algorithm of GNU "make" to decide whether
2617         a file is in the future, by looking at high-resolution time
2618         stamps if available.
2619
2620         * src/ls.c:
2621         (TIMESPEC_NS): New macro.
2622         (current_time): Initialize to the minimum value.
2623         (current_time_ns): New var.
2624         (main): Do not bother to initialize current_time;
2625         it's no longer needed.
2626         (get_current_time): New function.
2627         (print_long_format): Use it when a file appears to be in the future.
2628         Get the nanoseconds of the file's time stamp, if available,
2629         and use that to decide whether the file appears to be in the future.
2630
2631         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): New macros.
2632
2633 2001-01-02  Paul Eggert  <eggert@twinsun.com>
2634
2635         * src/ls.c (long_time_expected_width, print_long_format): Fix
2636         bug: the initial byte passed to strftime wasn't initialized to
2637         a nonzero value after the buffer was reallocated.
2638
2639 2001-01-02  Paul Eggert  <eggert@twinsun.com>
2640
2641         Make ls -l compatible with POSIX, which requires that the
2642         behavior of time formats must depend only on LC_TIME, not on
2643         LC_MESSAGES.
2644
2645         * po/Makefile.in.in (install-data-yes): If the package is
2646         fileutils, install LC_TIME as an alias for LC_MESSAGES.
2647         * src/sys2.h (dcgettext): New macro.
2648         * src/ls.c (decode_switches): Use dcgettext with LC_TIME,
2649         not plain gettext, to get the translations of time formats.
2650
2651 2001-01-02  Paul Eggert  <eggert@twinsun.com>
2652
2653         * src/ls.c (long_time_expected_width): New function.
2654         (print_long_format): Use it, so that we don't assume a
2655         particular width for time stamps in an internationalized
2656         environment.
2657
2658 2001-01-01  Paul Eggert  <eggert@twinsun.com>
2659
2660         * doc/fileutils.texi, NEWS:
2661         ls -l now reports the year for files even slightly in the future, as
2662         POSIX requires.  This helps warn users about clock skew problems.
2663
2664         * src/ls.c (print_long_format):
2665         Report the year for files even slightly in the future.
2666         Avoid overflow problems near Y2038 on 32-bit hosts.
2667         To calculate "six months", take half the average Gregorian
2668         year, not 180 days.
2669
2670 2001-01-01  Jim Meyering  <meyering@lucent.com>
2671
2672         * tests/chmod/Makefile.am (TESTS): Add setgid.
2673         * tests/chmod/setgid: Test for chmod's existing behavior.
2674         Based on a report from Paul Eggert.
2675
2676 2000-12-29  Paul Eggert  <eggert@twinsun.com>
2677
2678         Clean up the terminology a tad: some directories were called "sticky"
2679         when they were really setgid.
2680         * tests/Makefile.am (EXTRA_DIST): sticky-check -> setgid-check
2681         * tests/chmod/c-option, tests/cp/cp-parents, tests/mkdir/parents,
2682         tests/mkdir/perm: Likewise.
2683         * tests/setgid-check: File renamed from tests/sticky-check.
2684         All uses of "sticky" changed to "setgid".
2685
2686 2000-12-31  Jim Meyering  <meyering@lucent.com>
2687
2688         * tests/cp/Makefile.am (TESTS): Add deref-slink.
2689         * tests/cp/deref-slink: New file.  Test for the bug fixed by my
2690         2000-12-28 change to copy.c.
2691
2692 2000-12-30  Paul Eggert  <eggert@twinsun.com>
2693
2694         * src/ls.c: Improve performance by invoking gettext twice at the start,
2695         instead of once for each file.
2696         (long_time_format): New var.
2697         (decode_switches): Initialize it, if format == long_format.
2698         (print_long_format): Use it.
2699
2700 2000-12-30  Paul Eggert  <eggert@twinsun.com>
2701
2702         * src/ls.c (print_long_format): Don't dump core if strftime
2703         returns the empty string.
2704
2705 2000-12-30  Paul Eggert  <eggert@twinsun.com>
2706
2707         * src/ls.c (gobble_file): If not using long format, don't
2708         invoke acl; it's not needed.
2709
2710 2000-12-30  Jim Meyering  <meyering@lucent.com>
2711
2712         Avoid an unnecessary `stat' when using --dereference.
2713         * src/copy.c (same_file_ok): Use stat only if lstat reported that
2714         the file was a symbolic link.
2715
2716 2000-12-29  Paul Eggert  <eggert@twinsun.com>
2717
2718         * doc/perm.texi: append-only directories -> restricted deletion flag,
2719         which is the term that POSIX d5 uses for this notion.
2720
2721 2000-12-28  Paul Eggert  <eggert@twinsun.com>
2722
2723         * tests/group-names: Try /usr/xpg4/bin/id (Solaris 7) if plain
2724         'id' doesn't work.
2725
2726 2000-12-28  Jim Meyering  <meyering@lucent.com>
2727
2728         * tests/cp/cp-parents: Run sticky-check from just-created directory.
2729
2730 2000-12-28  Jim Meyering  <meyering@lucent.com>
2731
2732         * src/copy.c (same_file_ok): Fix two typos from my 2000-09-03 change:
2733         s/tmp_dst_sb/tmp_src_sb/.
2734
2735 2000-12-27  Paul Eggert  <eggert@twinsun.com>
2736
2737         * tests/sticky-check: Turn off the working directory's sticky
2738         bit, so that we don't have to worry about it later.
2739
2740         * src/copy.c (same_file_ok): Use a single auto var for
2741         tmp_dst_sb, instead of two static vars.  Likewise for
2742         tmp_src_sb.
2743
2744 2000-12-26  Jim Meyering  <meyering@lucent.com>
2745
2746         * Version 4.0.35.
2747
2748         * Regenerate build/config framework to use automake-1.4b and
2749         the latest CVS version autoconf.
2750
2751         * tests/mkdir/perm: Disable the test if the working directory has
2752         the sticky bit set.
2753         * tests/cp/cp-parents: Likewise.
2754         Reported by Nelson Beebe.
2755
2756 2000-12-25  Jim Meyering  <meyering@lucent.com>
2757
2758         Clean-up to avoid warnings from Irix's c89.
2759
2760         * src/remove.c (hash_compare_active_dir_ents): Return explicit `true'
2761         or `false', rather than relying on implicit int-to-enum cast.
2762         * src/copy.c (same_file_ok): Remove declaration and set of unused
2763         variables: src_sb_no_link, dst_sb_no_link.
2764         * src/ls.c (extract_dirs_from_files): Remove unused variable.
2765         Reported by Nelson Beebe.
2766
2767         * src/ls.c (gobble_file): Move decl of local, val, into the scope
2768         where it's used.
2769
2770 2000-12-24  Jim Meyering  <meyering@lucent.com>
2771
2772         For both ln and install, when using `--backup=simple --suffix=S',
2773         the suffix `S' wasn't used.
2774
2775         * src/ln.c (main): Actually use the local variable,
2776         `backup_suffix_string'.
2777         * src/install.c (main): Likewise.
2778         Nelson Beebe reported the unused variables.
2779         * tests/ln/misc: Add a test for this (for all of cp, mv, ln, install).
2780
2781         * man/help2man: Update to version 1.24.
2782
2783 2000-12-22  Jim Meyering  <meyering@lucent.com>
2784
2785         * Version 4.0.34.
2786
2787         * src/shred.c (isaac_seed_machdep) [_ARCH_PPC]: Disable the code
2788         that would use the PPC mfspr `asm' code.  Suggestion from Michael Stone.
2789
2790 2000-12-19  Jim Meyering  <meyering@lucent.com>
2791
2792         * doc/fileutils.texi: Use `ref_file' in place of `file' to make
2793         descriptions of the various --reference=... options clearer.
2794
2795 2000-12-17  Jim Meyering  <meyering@lucent.com>
2796
2797         * doc/texinfo.tex: Update from master repository.
2798         * config.sub: Likewise.
2799         * config.guess: Likewise.
2800
2801 2000-12-16  Jim Meyering  <meyering@lucent.com>
2802
2803         * src/chown-core.c (uint_to_string): New function.
2804         (uid_to_name): Use it.
2805         (gid_to_name): Use it.
2806         Rename locals, user/group, to uid/gid.
2807
2808         * src/chown-core.h (enum Change_status): Start with 1.
2809
2810         * src/chown.c (main): Rename locals, user/group, to uid/gid.
2811         * src/chgrp.c (main): Rename local, group, to gid.
2812
2813         * tests/group-names: New file.
2814         * tests/Makefile.am (EXTRA_DIST): Add group-names.
2815         * tests/chgrp/basic: Use group-names.
2816         * tests/chgrp/deref: Likewise.
2817         * tests/chgrp/recurse: Likewise.
2818
2819         * tests/chgrp/basic: Don't assume that creating a file gives it
2820         group $g1.
2821
2822         * tests/chgrp/Makefile.am (TESTS): Add recurse.
2823
2824 2000-12-15  Jim Meyering  <meyering@lucent.com>
2825
2826         * src/chown-core.h [enum Dereference_symlink] (dereference): Rename
2827         from change_symlinks.
2828         * src/chown-core.c: Declare lstat.
2829         Rename change_symlinks member to `dereference' and use the DEREF_*
2830         enum values.
2831         (describe_change): Merge the chgrp and chown switch statements.
2832         Use xmalloc to form the `user:group' string.
2833         (change_file_owner): Record (and later, use) is_symlink and is_directory
2834         from the lstat stats, in order to control whether we operate on symlinks
2835         and whether (with -R) we traverse symlinks to directories.
2836         When dereferencing, use open/fchown (rather than chown) on symlinks.
2837         * src/chown.c (main): Reflect renaming: s/dereference/change_symlinks/.
2838         * src/chgrp.c (main): Likewise.
2839
2840         * src/chown-core.c (describe_change): Use `:' (not `.') to separate the
2841         username and group in messages evoked by the --verbose and --changes
2842         options.
2843
2844 2000-12-09  Jim Meyering  <meyering@lucent.com>
2845
2846         * src/Makefile.am (noinst_HEADERS): Add chown-core.h.
2847         (chown_SOURCES): Define.
2848         (chgrp_SOURCES): Define.
2849
2850         * src/chgrp.c: Include "chown-core.h".
2851         [enum Change_status, enum Verbosity]: Remove declarations.
2852         Remove decls of globals that are now part of struct Chown_option.
2853         Remove decl of xstat.
2854         (describe_change): Remove function.
2855         (change_file_group): Likewise.
2856         (change_dir_group): Likewise.
2857         (parse_group): Don't set global, groupname, here...
2858         (main): ... instead, initialize `chopt.group_name' here.
2859         Initialize chopt and update uses of the now-members.
2860         Set group_name also when it's obtained via a --reference=FILE option.
2861         Call change_file_owner (with -1 for uids), not change_file_group.
2862
2863         * src/chown.c: Don't include pwd.h or grp.h -- no longer needed.
2864         Include "chown-core.h".
2865         [enum Change_status, enum Verbosity]: Remove declarations.
2866         Remove decls of globals that are now part of struct Chown_option.
2867         (describe_change): Remove function.
2868         (change_file_owner): Likewise.
2869         (change_dir_owner): Likewise.
2870         (main): Initialize chopt and update uses of the now-members.
2871         Set user_name and group_name also when they're obtained via a
2872         --reference=FILE option.
2873         Pass `chopt' to change_file_owner.
2874
2875         * src/chown-core.c: Include <pwd.h>, <grp.h>, and "xalloc.h".
2876         [!_POSIX_VERSION]: Declare getgrnam and getgrgid.
2877         (gid_to_name): New function.
2878         (uid_to_name): Likewise.
2879         (chopt_free): Likewise.
2880
2881         Factor out code that's common to chgrp.c and chown.c.
2882         * src/chown-core.h: New file.
2883         * src/chown-core.c (chopt_init): New function.
2884         (describe_change): Extracted/combined from chgrp.c and chown.c.
2885         (change_dir_owner): Likewise.
2886         (change_file_owner): Likewise.
2887         * po/POTFILES.in: Add src/chown-core.c.
2888
2889         * configure.in (AC_OUTPUT): Add tests/chgrp/Makefile.
2890         * tests/Makefile.am (SUBDIRS): Add chgrp.
2891         * tests/chgrp: New directory.
2892         * tests/chgrp/basic: New test.
2893         * tests/chgrp/deref: Likewise.
2894         * tests/chgrp/Makefile.am: New file.
2895
2896         * src/chown.c (change_file_owner): Restore special file permission
2897         bits, since calling chown resets them on some systems.
2898         Reported by Matt Perry.
2899
2900 2000-12-08  Andreas Schwab  <schwab@suse.de>
2901
2902         * tests/mv/mv-special-1: Don't make the success of the test depend
2903         on the order in which directory entries are processed.
2904
2905 2000-12-03  Jim Meyering  <meyering@lucent.com>
2906
2907         * src/ls.c (gobble_file) [USE_ACL]: Set have_acl member unconditionally
2908         to avoid uninitialized memory reference via FILE_HAS_ACL.
2909
2910         * Makefile.maint (alpha): Use rsync rather than scp, so the destination
2911         file is created only after the successful completion of the copy.
2912
2913 2000-12-02  Jim Meyering  <meyering@lucent.com>
2914
2915         * tests/ls/Makefile.am (TESTS): Add follow-slink.
2916         * tests/ls/follow-slink: New file.
2917
2918 2000-12-01  Paul Eggert  <eggert@twinsun.com>
2919
2920         * src/ls.c (gobble_file): Do not fall back on lstat if stat
2921         fails; POSIX.2 does not allow this.  Invoke acl only on
2922         non-symlinks, and only if lstat or stat succeeds.
2923
2924 2000-12-02  Jim Meyering  <meyering@lucent.com>
2925
2926         * configure: Regenerate using the very latest version (in CVS) of
2927         autoconf.
2928
2929         * tests/dd/skip-seek: Remove test #2, now that support for the
2930         `B' suffix is gone.
2931         * tests/dd/Makefile.am (TESTS): Add skip-seek2
2932         * tests/dd/skip-seek2: New file.
2933
2934 2000-12-01  Paul Eggert  <eggert@twinsun.com>
2935
2936         * src/dd.c (skip, dd_copy): Use ssize_t to store result of
2937         safe_read, to avoid overflow e.g. on 64-bit Solaris sparc.
2938         (dd_copy): Remove unnecessary cast.
2939
2940 2000-12-01  Paul Eggert  <eggert@twinsun.com>
2941
2942         * doc/fileutils.texi: Remove B suffix.  Document how to have
2943         the desired effect without it.
2944
2945         * src/dd.c: Undo most of the changes since 2000-11-24, since we've
2946         documented a standard way to do it.
2947         (skip_bytes, seek_bytes): Remove.
2948         (usage): Remove B suffix.
2949         (scanargs, skip, dd_copy, main): Remove support for B suffix.
2950
2951 2000-11-28  Jim Meyering  <meyering@lucent.com>
2952
2953         * src/mkdir.c (main): Remove any trailing slash unconditionally.
2954         Reported by Volker Borchert.
2955         * tests/mkdir/t-slash: Add a test for this.
2956
2957 2000-11-27  Jim Meyering  <meyering@lucent.com>
2958
2959         * Version 4.0.33.
2960
2961         * tests/touch/no-rights: Use touch with `-d tomorrow' to avoid a
2962         race condition.
2963
2964         * tests/Fetish.pm (_compare_files): New function.
2965         (_process_file_spec): Likewise.
2966         (_at_replace): Likewise.
2967         (run_tests): Support new keywords, AUX and CMP and associated
2968         syntax and semantics.
2969
2970         * config.sub: Likewise.
2971         * config.guess: Likewise.
2972
2973 2000-11-26  Jim Meyering  <meyering@lucent.com>
2974
2975         * src/dd.c (skip): Perform the `records < blocksize' test
2976         at the top of the loop, not at the bottom.
2977
2978 2000-11-26  Paul Eggert  <eggert@twinsun.com>
2979
2980         * src/dd.c (skip): New arg COUNT_BYTES.  Read with BLOCKSIZE
2981         bytes, but consider RECORDS to be a byte count if COUNT_BYTES
2982         is nonzero.
2983
2984 2000-11-25  Paul Eggert  <eggert@twinsun.com>
2985
2986         * doc/fileutils.texi: Document seek=nB and skip=nB.
2987
2988         * src/dd.c (skip_bytes, seek_bytes): Now booleans, not counts.
2989         (seek_records): Renamed from seek_record, for consistency with
2990         skip_records and max_records.  All uses changed.
2991
2992         (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB
2993         and skip=nB.
2994         (enum Unit, Unit): Remove.
2995         (skip, dd_copy, main): Undo most recent change.
2996         (dd_copy, main): Pass blocksize of 1 as appropriate when
2997         skip_bytes or seek_bytes is nonzero.
2998         (main): Rework ftruncate failure diagnostic to always use byte count.
2999
3000 2000-11-25  Jim Meyering  <meyering@lucent.com>
3001
3002         * src/dd.c: Add new options, bskip and bseek.
3003         Based on a patch from Chris Sylvain.
3004         * tests/dd/skip-seek: New tests.
3005         * tests/dd/Makefile.am (TESTS): Add skip-seek.
3006
3007 2000-11-24  Paul Eggert  <eggert@green.twinsun.com>
3008
3009         * src/dd.c (S_TYPEISSHM): New macro.
3010         (main): Report failed fstat.
3011         Complain only when ftruncate fails on a regular file,
3012         a directory, or a shared memory object.
3013
3014 2000-11-24  Jim Meyering  <meyering@lucent.com>
3015
3016         * src/dd.c: Declare a pointer parameters to be `const' as appropriate.
3017
3018         * src/dd.c (main): Use ftruncate only on regular files.
3019         Based on a patch from Michael Stone.
3020         Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
3021
3022 2000-11-23  Jim Meyering  <meyering@lucent.com>
3023
3024         * src/df.c (show_point): Before accepting an entry as a match, make
3025         sure that the mount directory exists and has the required device number.
3026         Before, e.g., `df /floppy' would mistakenly report on the root
3027         partition if /floppy were not listed in /etc/mtab but / was.
3028         Patch from Eirik Fuller (http://bugs.debian.org/76923).
3029
3030         * src/chmod.c (mode_changed): New function.
3031         (change_file_mode): Use it to determine accurately when -c should
3032         make chmod announce there's been a change.
3033         Based on a patch from Michael Stone.
3034         Reported by Kai Henningsen as Debian bug #77349.
3035
3036         * tests/chmod/c-option: New test for the above fix.
3037         * tests/chmod/Makefile.am (TESTS): Add c-option
3038
3039         * tests/sticky-check: New file.  Factored out of tests/mkdir/parents.
3040         * tests/Makefile.am (EXTRA_DIST): Add sticky-check.
3041         * tests/mkdir/parents: Source sticky-check instead of open-coding it.
3042
3043 2000-11-19  Jim Meyering  <meyering@lucent.com>
3044
3045         * tests/chmod/equal-x: Update to use its own directory, and better trap.
3046
3047 2000-11-18  Paul Eggert  <eggert@twinsun.com>
3048
3049         * src/ls.c (BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION,
3050         INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION,
3051         SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum
3052         values, to ensure that option values can't collide with chars.
3053         (long_options, decode_switches): Use them.
3054
3055 2000-11-18  Paul Eggert  <eggert@twinsun.com>
3056
3057         * src/sys2.h (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum
3058         constants rather than macros.  Use values that cannot conflict
3059         with C characters or with -1, CHAR_MAX + 1, etc.
3060
3061 2000-11-18  Jim Meyering  <meyering@lucent.com>
3062
3063         * src/du.c (count_entry): Don't omit the size of a directory entry
3064         merely because we couldn't `chdir' into it.  That would give subtly
3065         different results in some cases.  Reported by Mattias Wadenstein
3066         via Michael Stone.
3067
3068         * src/ls.c: Revert change of 2000-11-11.  It inadvertently change
3069         the output format of `ls -l --full-time'.
3070
3071         * src/mkdir.c (main): When failing to create a directory, give only
3072         one diagnostic, not two.  Reported by Volker Borchert.
3073
3074         * src/mkdir.c (main): With --parents, remove any trailing slashes
3075         from the argument to the final mkdir call.  Required for NetBSD.
3076         Reported by Volker Borchert.
3077         * tests/mkdir/t-slash: New test for this.
3078         * tests/mkdir/Makefile.am (TESTS): Add t-slash.
3079
3080         * tests/mv/mv-special-1: Create and `cd' into temporary directory
3081         before anything else.  Reported by Volker Borchert.
3082
3083         * configure, config.h.in, Makefile.in, etc.: Regenerate using the
3084         very latest version (in CVS) of autoconf.
3085
3086 2000-11-17  Jim Meyering  <meyering@lucent.com>
3087
3088         * Makefile.am (.NOTPARALLEL): Remove target.
3089         * GNUmakefile (.NOTPARALLEL): ... put it here instead, since this
3090         file is common to these packages: fileutils, sh-utils, textutils.
3091
3092         * Makefile.am (.NOTPARALLEL): New target.  Prevent unwanted parallelism.
3093         Suggestion from Ulrich Drepper.
3094         * po/Makefile.in.in (Makefile): Likewise.
3095
3096         * Makefile.maint (sha1): Define.
3097         (announcement): Include SHA1 digest of .tar.gz file.
3098
3099 2000-11-14  Jim Meyering  <meyering@lucent.com>
3100
3101         * tests/mkdir/perm: Add an `echo' so that the input to the sed command
3102         is NL-terminated.  Otherwise, Solaris' /bin/sed generates no output.
3103         Reported by Vin Shelton.
3104
3105 2000-11-13  Paul Eggert  <eggert@twinsun.com>
3106
3107         * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
3108         be tested with #ifdef, not with #if.
3109
3110 2000-11-12  Jim Meyering  <meyering@lucent.com>
3111
3112         * src/ls.c (print_long_format): Remove obsolete comment.
3113         From Paul Eggert.
3114
3115         * doc/texinfo.tex: Update from master repository.
3116
3117 2000-11-11  Paul Eggert  <eggert@sic.twinsun.com>
3118
3119         * src/ls.c (<langinfo.h>): Include if HAVE_LANGINFO_H.
3120         (DATE_FMT_LANGINFO): New macro, taken from sh-utils/src/date.c.
3121         (print_long_format): Use it to determine "date" format.
3122         Do not wrap "%b %e %Y" and "%b %e %H:%M" in _(), as it results in
3123         incorrect behavior when LC_ALL is unset, LC_TIME is "C", and
3124         LC_MESSAGES or LANG is set to something disagreeing with the POSIX
3125         locale.
3126
3127 2000-11-11  Jim Meyering  <meyering@lucent.com>
3128
3129         * Version 4.0.32.
3130
3131         * Makefile.maint (GZIP_ENV): Define to --no-name, so the timestamp
3132         is not included in the .tar.gz file.
3133
3134         * tests/mkdir/perm (tests): Use `empty' (instead of just blanks) to
3135         indicate no `-m' option.  Using just blanks wasn't portable to
3136         Solaris2.5.1's /bin/sh.
3137
3138         * tests/mkdir/perm: Don't put a newline in IFS;  that's not portable to
3139         NetBSD's /bin/sh.  Instead, filter newlines and leading/trailing blanks
3140         out of `tests' before the `set -'.
3141
3142         * Makefile.maint (announcement): Limit depth of ChangeLog `find' to 2.
3143
3144         * src/ls.c (print_long_format): Wrap the `--full-time' date format
3145         string in _(...), so it too may be internationalized.
3146         Suggestion from Jungshik Shin.
3147
3148 2000-11-10  Jim Meyering  <meyering@lucent.com>
3149
3150         * src/touch.c (main): Interpret a lone numeric argument of 8 or 10
3151         digits as a file name, rather than as a date/time in the obsolescent
3152         `MMDDhhmm[YY]' format.  Reported by Wenjun Zheng.
3153         * tests/touch/obsolescent: New test for this.
3154         * tests/touch/Makefile.am (TESTS): Add obsolescent.
3155
3156 2000-11-06  Jim Meyering  <meyering@lucent.com>
3157
3158         * tests/cp/cp-parents: Move mkdir tests into ../mkdir.
3159
3160         * doc/fileutils.texi: Use Free Documentation Licence.
3161         Change GNU to @sc{gnu} in many places.
3162
3163         * doc/texinfo.tex: Update from master repository.
3164         * config.sub: Likewise.
3165         * config.guess: Likewise.
3166         * man/help2man: Update from latest version: 1.23.
3167
3168         * src/mkdir.c: Do not set the permissions of the final directory
3169         component if it was not just created.
3170         Based on a patch from Volker Borchert.
3171
3172         * tests/rwx-to-mode: New file.
3173         * tests/Makefile.am (EXTRA_DIST): Add rwx-to-mode.
3174         * tests/mkdir/parents: New test for the above mkdir.c fix.
3175         * tests/mkdir/Makefile.am (TESTS): Add parents.
3176         (TESTS_ENVIRONMENT): Define srcdir=$(srcdir).
3177
3178 2000-11-02  Won-kyu Park  <wkpark@chem.skku.ac.kr>
3179
3180         * src/df.c (print_header): Mark strings for translation.
3181
3182 2000-11-05  Jim Meyering  <meyering@lucent.com>
3183
3184         * Version 4.0.31.
3185
3186         * configure, config.h.in, Makefile.in, etc.: Regenerate using the
3187         very latest version (in CVS) of autoconf.
3188
3189         * src/mkdir.c (main): Use make_dir instead of using mkdir directly.
3190         Diagnose as failure when mkdir tries to create (without the
3191         --parent (-p) option) a directory that already exists.
3192         * tests/cp/cp-parents: Add a test for the above fix.
3193
3194         * tests/mv/mv-special-1: Clean up this test.
3195
3196 2000-11-01  Jim Meyering  <meyering@lucent.com>
3197
3198         * Version 4.0.30.
3199
3200         * src/chmod.c (main): Better diagnostics.
3201
3202 2000-10-31  Jim Meyering  <meyering@lucent.com>
3203
3204         * tests/lang-default: Add all the internationalization-related
3205         variable names autoconf uses.  Set and export them in a loop.
3206
3207         `mkdir -p' would create parent directories with permissions
3208         that did not account for the umask. [introduced with the
3209         2000-09-30 change that became part of fileutils-4.0.28]
3210         * src/mkdir.c: Include dirname.h.
3211         Compute the parent directory `mode' unconditionally, effectively
3212         as `$(umask -S),u+wx'.
3213         Use make_path to create only the parent directories, thus using
3214         the same code, both with and without -p, to create the final
3215         component in each file name.  Reported by Bob Proulx.
3216
3217         Add tests for the above fix.
3218         * tests/cp/cp-parents: Add some permission tests.
3219         * tests/mkdir/perm: Fix the test so it actually does something.
3220         Run each test also with mkdir's `-p' option and check permissions
3221         on the parent directories.
3222
3223 2000-10-23  Paul Eggert  <eggert@twinsun.com>
3224
3225         * doc/getdate.texi: Use @sc where appropriate.  Document the
3226         ranges of supported times more precisely.  Correct menu
3227         spacing.  Document old Latin 12m/12pm tradition.  Remove list
3228         of alphabetic time zone names, as it wasn't correct and people
3229         shouldn't be relying on it anyway.  Relative items also
3230         account for non-DST adjustments.  Fix some misspellings.
3231
3232 2000-10-30  Jim Meyering  <meyering@lucent.com>
3233
3234         * configure, config.h.in, Makefile.in, etc.: Regenerate using the
3235         very latest version (in CVS) of autoconf.
3236
3237 2000-10-29  Jim Meyering  <meyering@lucent.com>
3238
3239         * Version 4.0.29.
3240
3241         * src/cp.c (do_copy): When constructing dst_path for use with the
3242         --parents option, first remove any trailing slashes from the command
3243         line argument.  Otherwise, tests/cp/cp-parent would fail on NetBSD.
3244
3245         * tests/cp/cp-parents: Add a test.
3246
3247         * src/ls.c (DT_INIT): Define.
3248         [enum filetype]: Remove the #ifdef, and use DT_INIT on the
3249         initializers instead.  `unknown' was undefined for some systems.
3250         Reported by John David Anglin.
3251
3252         * tests/lang-default (LC_COLLATE): Set it to the empty string and
3253         export it.  Otherwise, tests/cp/cp-mv-backup would fail e.g., when
3254         LC_COLLATE was set to en.  Reported by Vin Shelton.
3255
3256 2000-10-28  Jim Meyering  <meyering@lucent.com>
3257
3258         * src/ls.c (main): In call to gobble_file with `"."', use `directory'
3259         as the type, not `unknown'.
3260         [enum filetype] (arg_directory): Rather than `100', use
3261         a number that should never conflict with another DT_* value.
3262         From Ulrich Drepper.
3263
3264         * Version 4.0.28.
3265
3266         Make `ls' a lot more efficient on systems (e.g., linux-2.4.*)
3267         that store file type information in directory entries.
3268
3269         * src/ls.c [enum filetype] (unknown):
3270         Add members (as yet unused):
3271         (HAVE_STRUCT_DIRENT_D_TYPE): Define.
3272         (format_needs_type): New global.
3273         (main): Set it.
3274         (print_dir): Set `type' from directory entry, if possible.
3275         (gobble_file): Add a parameter, TYPE.
3276         Stat the file only if its type is unknown and we need the type.
3277         Patch from Ulrich Drepper.
3278
3279         Shred can now determine the size of a block devices (e.g. /dev/fd0)
3280         by writing until a write operation fails.
3281
3282         * src/shred.c: Include assert.h.
3283         (fillrand): Add a parameter, size_max.
3284         Adjust caller.
3285         Add an assertion.
3286         (dopass): Break out of the `for (;;)' loop if size < offset.
3287         That can happen now that dopass is called with SIZE == -1.
3288         (do_wipefd): Accept a length of zero only for a regular file.
3289         If lseek fails or returns 0 for a non-regular file, let dopass
3290         determine the length.
3291         Inspired by a patch from Alan Iwi.
3292
3293         * tests/Makefile.am (EXTRA_DIST): Add lang-default.
3294
3295         * tests/rm/hash: Factor out the expensive-test-checking code, ...
3296         * tests/expensive: ... into this new file.
3297         * tests/cp/perm: Disable this test by default; it's expensive.
3298         Mark this as an expensive test.
3299         * tests/Makefile.am (EXTRA_DIST): Add expensive.
3300
3301         * doc/fileutils.texi (shred invocation): Give two examples.
3302
3303 2000-10-26  Jim Meyering  <meyering@lucent.com>
3304
3305         * doc/getdate.texi (Authors of getdate): Add Paul Eggert.
3306
3307 2000-10-23  Jim Meyering  <meyering@lucent.com>
3308
3309         * Makefile.am (EXTRA_DIST): Add .prev-version.
3310
3311 2000-10-22  Jim Meyering  <meyering@lucent.com>
3312
3313         * src/cp.c (make_path_private): Add a FIXME comment.
3314
3315         * tests/lang-default: New file.  Set LANG, LC_ALL, and LANGUAGE to ''
3316         (rather than to `C') and export them into the environment.
3317         Suggestion from Bruno Haible.
3318
3319         * tests/cp/backup-is-src: Source lang-default rather than open-coding
3320         the setting/exporting of LANG, LC_ALL, and LANGUAGE.
3321         * tests/cp/cp-mv-backup: Likewise.
3322         * tests/cp/same-file: Likewise.
3323         * tests/cp/slink-2-slink: Likewise.
3324         * tests/cp/symlink-slash: Likewise.
3325         * tests/ln/sf-1: Likewise.
3326         * tests/ls/symlink-slash: Likewise.
3327         * tests/ls/time-1: Likewise.
3328         * tests/mv/backup-is-src: Likewise.
3329         * tests/mv/diag: Likewise.
3330         * tests/mv/force: Likewise.
3331         * tests/mv/hard-link-1: Likewise.
3332         * tests/mv/i-2: Likewise.
3333         * tests/mv/into-self: Likewise.
3334         * tests/mv/into-self-2: Likewise.
3335         * tests/mv/into-self-3: Likewise.
3336         * tests/mv/mv-special-1: Likewise.
3337         * tests/mv/part-symlink: Likewise.
3338         * tests/mv/partition-perm: Likewise.
3339         * tests/rm/r-1: Likewise.
3340         * tests/rm/r-2: Likewise.
3341
3342 2000-10-21  Jim Meyering  <meyering@lucent.com>
3343
3344         * tests/cp/cp-parents: New test.
3345         * tests/cp/Makefile.am (TESTS): Add cp-parents;
3346
3347 2000-10-19  Jim Meyering  <meyering@lucent.com>
3348
3349         * doc/texinfo.tex: Update from master repository.
3350         * config.sub: Likewise.
3351         * config.guess: Likewise.
3352         * depcomp: Likewise.
3353
3354 2000-10-18  Jim Meyering  <meyering@lucent.com>
3355
3356         * tests/mv/part-symlink: Make sure the programs use C-locale formats
3357         and translations.  Bruno Haible reported that this test would fail
3358         when using other locales, because ls printed a translation of `total'.
3359
3360 2000-10-16  Jim Meyering  <meyering@lucent.com>
3361
3362         * src/ls.c (print_long_format): Wrap date format strings in _(...)
3363         so they may be internationalized.  Suggestion from Christian Rose.
3364
3365 2000-10-13  Jim Meyering  <meyering@lucent.com>
3366
3367         * src/mv.c (rm_option_init): Remove FIXME-maybe comment.
3368
3369 2000-09-30  Jim Meyering  <meyering@lucent.com>
3370
3371         * tests/du/two-args: Update to use newer template.
3372
3373         * src/install.c: Remove big, option-describing comment block.
3374         (main): Rename local `symbolic_mode' to `specified_mode'.
3375
3376         * src/mkdir.c (main): Don't set the umask to 0 and hand-apply
3377         the previously-set umask unconditionally.  Do that only when a
3378         MODE has been specified.  Otherwise, call mkdir with the full
3379         creation mask (0777 or 0666) and let the kernel apply the umask.
3380         The difference shows up only on file systems with ACL support
3381         when the containing directory has a default ACL.
3382         Patch by Andreas Gruenbacher.
3383         (main): Rename local `symbolic_mode' to `specified_mode'.
3384         * src/mknod.c (main): Likewise (but `call mknod', not mkdir).
3385         Also, when MODE is specified, call chmod to ensure that the
3386         permission bits are set as specified even when the containing
3387         directory has a default ACL.
3388         Patch by Andreas Gruenbacher.
3389         * src/mkfifo.c (main): Likewise (but `call mkfifo', not mkdir).
3390         Patch by Andreas Gruenbacher.
3391
3392         * tests/mkdir/perm: New test.
3393         * tests/mkdir/Makefile.am (TESTS): Add perm.
3394
3395 2000-08-17  Andreas Gruenbacher  <ag@bestbits.at>
3396
3397         * src/chmod.c (change_file_mode): Perform the chmod even if the
3398         file mode permission bits are the same as those that should be set.
3399         Omitting the chmod call would be alright with minimal 1003.1e DS17
3400         ACLs, but eventually there may be other permissions in addition to
3401         rwx.  E.g., add and delete for directories, and something analogous
3402         to NT's take ownership permission.
3403
3404 2000-09-25  Jim Meyering  <meyering@lucent.com>
3405
3406         * tests/cp/same-file: Don't use `diff -u'.  It's not portable.
3407         Reported by Christian Krackowizer.
3408         * tests/cp/same-file: Run `diff -c' only if cmp finds a difference.
3409         * tests/mv/part-symlink: Likewise.  And clean up.
3410
3411         `shred --exact file1 file2' wouldn't touch `file1'
3412         * src/shred.c (long_opts): --exact doesn't take an argument.
3413         Reported by Alan Iwi.
3414         * tests/shred/exact: New test for this.
3415         * tests/shred/Makefile.am (TESTS): Add exact.
3416
3417         * Makefile.maint (PREV_VERSION): Get the value from a file, rather
3418         than trying to derive it from the current version number.
3419         This is much more robust.
3420         (alpha): Record just-released version number in `.prev-version',
3421         and commit (post-tag).
3422
3423         * Version 4.0.27.
3424
3425 2000-09-24  Paul Eggert  <eggert@twinsun.com>
3426
3427         * doc/fileutils.texi: Update to more closely match changes in 4.0z.
3428         * src/cp.c (usage): Match revised documentation better.
3429
3430 2000-09-24  Jim Meyering  <meyering@lucent.com>
3431
3432         * src/cp.c (main): Tweak a relatively new diagnostic.
3433
3434 2000-09-23  Jim Meyering  <meyering@lucent.com>
3435
3436         * tests/ls/time-1: Output more information when a test fails.
3437
3438 2000-09-22  Jim Meyering  <meyering@lucent.com>
3439
3440         * src/install.c (cp_option_init): Once again make it so install always
3441         unlinks an existing destination before trying to open it for writing.
3442         Otherwise, installing onto a running shared library would make the
3443         running program malfunction.
3444         Reported by Dan Pascu via Michael Stone.
3445
3446         * src/mv.c (do_move): Moving a directory specified with a trailing
3447         slash from one partition to another, and giving it a different
3448         name at the destination would cause mv to get a failed assertion.
3449         Reported by Michael Stone.
3450         (strip_trailing_slashes_2): Move function definition to precede
3451         new first use.
3452         * tests/mv/part-rename: New test for the above fix.
3453         * tests/mv/Makefile.am (TESTS): Add part-rename.
3454
3455         * src/copy.c (copy_internal): Don't try to unlink directories when
3456         using --remove-dest with -R.
3457         * tests/cp/dir-rm-dest: New test for the above fix.
3458         * tests/cp/Makefile.am (TESTS): Add dir-rm-dest.
3459
3460 2000-09-19  Jim Meyering  <meyering@lucent.com>
3461
3462         * doc/fileutils.texi (cp invocation): Describe how --force works.
3463         Update description of -P (soon to change meaning to conform w/POSIX).
3464         Describe --remove-destination.
3465
3466         * src/cp.c (main): When used with --force, each of the --link and
3467         --symbolic-link options now implies --remove-destination.
3468         Reported by Miles Bader via Mike Stone.
3469         * tests/cp/link: New file.  Test for the above fix.
3470         * tests/cp/same-file: Adjust for this change in behavior.
3471
3472 2000-09-15  Volker Borchert  <bt@teknon.de>
3473
3474         * tests/Makefile.am (check-root, root-hint): New targets.
3475         (check-recursive): Depend on root-hint.
3476         * Makefile.am (check-root): New target.
3477
3478 2000-09-16  Jim Meyering  <meyering@lucent.com>
3479
3480         * doc/perm.texi (Changing Special Permissions): Remove this statement:
3481         ``a' in the USERS part of a symbolic mode does not cause the special
3482         permissions to be affected'...  It doesn't reflect what the code does
3483         and isn't required by POSIX.  Reported by aldomel@ix.netcom.com via
3484         Mike Stone.
3485
3486 2000-09-15  Jim Meyering  <meyering@lucent.com>
3487
3488         * config.sub: Update from master repository.
3489
3490 2000-09-10  Jim Meyering  <meyering@lucent.com>
3491
3492         * tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure
3493         that `ls' sorts the same way for everyone.  Reported by Vin Shelton.
3494
3495         * Makefile.maint (b_host): Use freefriends.org, not tug.org.
3496
3497 2000-09-09  Jim Meyering  <meyering@lucent.com>
3498
3499         * Makefile.maint (announcement): Use a stricter regexp for the
3500         previous version.
3501
3502         * Version 4.0z.
3503
3504         * tests/cp/special-bits: New file.
3505         * tests/cp/Makefile.am (TESTS): Add special-bits.
3506         (TESTS_ENVIRONMENT): Propagate $MAKE into environment, for special-bits.
3507
3508         * src/copy.c (SAME_OWNER, SAME_GROUP, SAME_OWNER_AND_GROUP): Define.
3509         (copy_internal): Avoid calling chown if we know it's not necessary.
3510
3511         * src/copy.c (copy_internal): Call chmod also if we've made the
3512         preceding chown call and we're supposed to preserve some special
3513         permission bit(s) that would have been reset by chown.
3514         Reported by Greg Louis.
3515
3516 2000-09-08  Jim Meyering  <meyering@lucent.com>
3517
3518         * src/mkdir.c (S_IRWXUGO): Remove definition.
3519         * src/sys2.h (S_IRWXUGO): Define here, instead.
3520
3521 2000-09-07  Jim Meyering  <meyering@lucent.com>
3522
3523         * doc/texinfo.tex: Update from master repository.
3524         * config.sub: Likewise.
3525         * config.guess: Likewise.
3526
3527 2000-09-05  Jim Meyering  <meyering@lucent.com>
3528
3529         * tests/mv/part-symlink: Redirect stdout to stderr before trying to
3530         remove the temp directory.  Otherwise, the `rm -rf' would get an
3531         error because the output file wouldn't be closed and the directory
3532         wouldn't be `empty'.
3533         * tests/cp/same-file: Likewise.
3534
3535         * tests/cp/same-file: Remove the `cp -dl sl1 sl2' case,
3536         since it's no longer portable (hard link to a symlink).
3537         Likewise for the `cp -bdl symlink foo' case.
3538
3539         * config.guess: Update from master repository.
3540
3541 2000-09-04  Jim Meyering  <meyering@lucent.com>
3542
3543         * src/cp.c: Move declaractions of lstat, stat, and rpl_lstat
3544         as well as the definition of lstat from here...
3545         * src/copy.h: ...to here.
3546         * src/copy.c: Remove declaration of lstat, now that it's in copy.h.
3547
3548         * tests/mv/force: mv's --force (-f) option is no longer needed for
3549         this test, now that all it does is cancel --interactive (-i).
3550
3551         * tests/cp/same-file: Add new tests using cp's --rem option.
3552         Reflect the fact that cp's -f option no longer causes cp to remove the
3553         destination file before trying to open it.
3554         Reflect the fact that `cp -bdl' now makes a backup when copying a
3555         symlink onto the file it points to (FIXME: look into this, and why
3556         cp -bl does *not* do so).
3557
3558         * src/ln.c (do_link): Tweak diagnostics.
3559
3560 2000-09-03  Jim Meyering  <meyering@lucent.com>
3561
3562         * src/install.c (cp_option_init): Initialize new members.
3563
3564         * src/cp.c (enum): Add UNLINK_DEST_BEFORE_OPENING.
3565         [long_options]: Add an entry for --remove-destination.
3566         (usage): Describe --remove-destination.
3567         (do_copy): Use unlink_dest_after_failed_open member, not `force.'
3568         (cp_option_init): Initialize new members.
3569         (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
3570
3571         * src/mv.c: Remove obsolete comment block.
3572         (cp_option_init): Initialize new members.
3573         (usage): Reflect the fact that --force (-f) relates only to whether
3574         mv prompts.
3575         (main): Remove uses of old `force' option member.
3576
3577         * src/install.c (cp_option_init): Reflect
3578
3579         `force' no longer means unlink-dest-before-opening
3580         * src/copy.h (struct cp_options) [force]: Remove member.
3581         [unlink_dest_before_opening]: Add member.  `cp -f' and `mv -f' used to
3582         do this.  Now, you must use `cp --remove-destination' to get this
3583         behavior.  Now, `cp -f' and `mv -f' work as required by POSIX.
3584         [unlink_dest_after_failed_open]: Add member.
3585         Paul Eggert reported that `cp -f' removes an existing destination
3586         file unconditionally, and that is contrary to POSIX.
3587
3588         * src/copy.c (same_file_ok): New function, extracted from copy_internal,
3589         and rewritten.
3590         (copy_internal): Unlink destination file when unlink_dest_before_opening
3591         option is set, and when the source is neither a regular file nor a
3592         directory.
3593
3594         * tests/mv/Makefile.am (TESTS): Add part-symlink.
3595
3596         * src/ls.c: Use strcoll (not strcmp) when comparing file names.
3597         Suggestion from Ulrich Drepper.
3598
3599 2000-08-27  Jim Meyering  <meyering@lucent.com>
3600
3601         * src/copy.c (copy_reg): New parameters: X and NEW_DST.
3602         Remove the SPARSE_MODE parameter.  Update caller.
3603         Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when copying
3604         a regular source file and the destination file exists;  upon failure,
3605         unlink that existing file, then open again, but with O_WRONLY|O_CREAT.
3606         (copy_internal): `force' is not related to interactive; remove
3607         the conjunct.
3608         Remove the entire `else if (x->force)' block;  justifying
3609         removal of the non-directory part is easy:  POSIX requires we try
3610         to open an existing regular file, so we can't unlink it beforehand.
3611         The part that changes the mode on a directory to allow overwriting
3612         isn't necessary.
3613
3614         * src/copy.c (copy_reg): Rename two goto labels.
3615         (copy_internal): Set `new_dst' when the move_mode rename fails,
3616         since we then unlink the destination file.
3617
3618         * src/cp.c (usage): --force is independent of --interactive.
3619
3620 2000-08-24  Jim Meyering  <meyering@lucent.com>
3621
3622         Put back the kludge.  It's necessary after all.
3623         * src/dd.c (buggy_lseek_support): New function.
3624         (skip): Use it.
3625         Frank Adler reported that although _llseek returns 0, lseek
3626         erroneously returns an offset suggesting the operation succeeded
3627         even though it fails.
3628
3629         * install-sh: Double quote as needed, to protect against arguments
3630         containing spaces or shell metacharacters.  Reported by Bruno Haible.
3631
3632 2000-08-23  Jim Meyering  <meyering@lucent.com>
3633
3634         * tests/dd/not-rewound: New test, for the SEEK_CUR vs. SEEK_SET part
3635         of the last change.  Based on Paul's example.
3636         * tests/dd/Makefile.am (TESTS): Add not-rewound.
3637
3638 2000-08-22  Paul Eggert  <eggert@twinsun.com>
3639
3640         * src/dd.c (skip):
3641         Assume lseek failed if it returned zero, since a zero return is
3642         impossible and some buggy drivers return zero.
3643
3644         Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the
3645         file descriptor is not currently rewound.
3646
3647 2000-08-23  Jim Meyering  <meyering@lucent.com>
3648
3649         * src/dd.c: Back out my last change.  Paul's (above) is better.
3650
3651 2000-08-22  Jim Meyering  <meyering@lucent.com>
3652
3653         Don't even try to use lseek on character devices.
3654         * src/dd.c (buggy_lseek_support): New function.
3655         (skip): Use it.
3656         Reported by Martin Gallant via Michael Stone.
3657
3658 2000-08-21  Jim Meyering  <meyering@lucent.com>
3659
3660         * tests/cp/same-file: Clean up traps.  Create files in a subdir.
3661
3662         * install-sh (oIFS): Remove unmatched double quote, left over from
3663         my 2000-08-12 change.  From J. David Anglin.
3664
3665         * Makefile.maint (wget-update): Get the latest version of depcomp.
3666
3667         * depcomp: Update from automake.
3668
3669 2000-08-20  Jim Meyering  <meyering@lucent.com>
3670
3671         * Version 4.0y.
3672
3673         Add support for cp's new POSIX-mandated -H and -L options.
3674         * src/copy.h (enum Dereference_symlink): Define.
3675         (struct cp_options) [dereference]: Change type to Dereference_symlink.
3676         * src/copy.c: Declare lstat.
3677         (copy_dir): Set `xstat' member to lstat so that with `-H' we don't
3678         follow symlinks found via recursive traversal.
3679         Update uses of `dereference' to compare against new enum member names.
3680         * src/cp.c (long_opts): Add --dereference, -L.
3681         (usage): Describe -L and -H.
3682         (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'.
3683         (main): Add `H' and `-L' to getopt spec string.
3684         [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0.
3685         [case 'd']: Likewise.
3686         [case 'H']: New case.
3687         [case 'L']: New case.
3688         [case 'R']: Don't set dereference to `0' here.
3689         If it's not yet defined, set x.dereference to DEREF_NEVER
3690         if -R was specified, else set it to DEREF_ALWAYS.
3691         Set x.xstat accordingly for -H.
3692         * doc/fileutils.texi (cp invocation): Describe -H and -L.
3693         * src/mv.c (cp_option_init): Initialize to DEREF_NEVER, not `0'.
3694         * src/install.c (cp_option_init): Initialize to DEREF_ALWAYS, not `1'.
3695
3696         * tests/cp/Makefile.am (TESTS): Add cp-HL.
3697         * tests/cp/cp-HL: New test.
3698
3699         * src/du.c (print_totals): Rename global from opt_combined_arguments.
3700
3701 2000-08-17  Paul Eggert  <eggert@twinsun.com>
3702
3703         * src/copy.c (DO_CHOWN): Do not make a special case for non-root.
3704         POSIX.2 requires that cp -p and mv attempt to set the uid of the
3705         destination file, even if you're not root.  This affects behavior
3706         only on hosts that let you give files away via chmod.
3707         * NEWS: Describe the above change.
3708
3709 2000-08-15  Jim Meyering  <meyering@lucent.com>
3710
3711         * src/du.c (count_entry): Remember the current directory also for `.'
3712         and `..'.  Reported by Stephen Smoogen, based on a patch from H.J. Lu.
3713         * tests/du/two-args: Add tests for this.
3714
3715 2000-08-14  Jim Meyering  <meyering@lucent.com>
3716
3717         * src/copy.c (copy_reg): Move declaration of local, `n_read', into
3718         the scope where it's used.
3719         (copy_internal): In calling copy_reg, pass not the raw `src_mode',
3720         but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
3721
3722 2000-08-13  Jim Meyering  <meyering@lucent.com>
3723
3724         * src/copy.c (get_dest_mode): Rename from new_nondir_mode.
3725         Honor the umask for `cp', but not for `mv' or `cp -p'.
3726         (copy_reg): New 4th parameter, dst_mode.  Pass it as 3rd arg. to open.
3727         (copy_internal): Change type of locals `src_mode' and `src_type' from
3728         int to mode_t.
3729         Remove unnecessary local, `fix_mode'.
3730         Combine two if-stmts into one.
3731         Pass `src_mode' as 4th arg to copy_reg.
3732         If we've just created a new regular file, return early, skipping the
3733         chmod step.  copy_reg now sets permissions of such files upon creation.
3734         Use get_dest_mode, so there's just one chmod call here.
3735
3736         * tests/cp/Makefile.am (TESTS): Add perm.
3737         * tests/cp/perm: New tests, to help ensure the above didn't
3738         change anything.
3739
3740 2000-08-12  Jim Meyering  <meyering@lucent.com>
3741
3742         * tests/mv/into-self-2: Remove test for the VERSION_CONTROL and/or
3743         SIMPLE_BACKUP_SUFFIX envvars.  Source ../envvar-check instead.
3744         * tests/mv/i-2: Likewise.
3745         * tests/mv/to-symlink: Likewise.
3746         * tests/cp/slink-2-slink: Likewise.
3747         * tests/mv/partition-perm: Likewise.
3748         * tests/cp/cp-mv-backup: Likewise.
3749
3750         * tests/Makefile.am (EXTRA_DIST): Add envvar-check.
3751         * tests/envvar-check: New file.
3752
3753         * install-sh: Remove trailing blanks.
3754         Output diagnostics to stderr, not stdout.
3755         Remove many useless curly braces and double quotes.
3756
3757 2000-08-11  J. David Anglin  <dave@hiauly1.hia.nrc.ca>
3758
3759         * install-sh: Improve error handling.
3760         Do the job even when the target file is `busy' on systems
3761         that don't allow such files to be unlinked.
3762
3763 2000-08-12  Jim Meyering  <meyering@lucent.com>
3764
3765         * README: Remove note about how installation can fail and the
3766         work-around, now that it's all automated.
3767
3768 2000-08-07  Paul Eggert  <eggert@twinsun.com>
3769
3770         * src/cp.c (usage, main): For cp -P messages, mention the new
3771         behavior as well as the old.
3772
3773 2000-08-07  Paul Eggert  <eggert@twinsun.com>
3774
3775         Standardize on "memory exhausted" instead of "Memory exhausted"
3776         or "virtual memory exhausted".
3777         Invoke xalloc_die instead of printing our own message.
3778         * src/chmod.c (main): Likewise.
3779         * src/copy.c (copy_dir, copy_internal): Likewise.
3780         * src/cp.c (do_copy): Likewise.
3781         * src/dircolors.c (xstrndup): Likewise.
3782         * src/install.c (main): Likewise.
3783         * src/ln.c (do_link): Likewise.
3784         * src/mkdir.c (main): Likewise.
3785         * src/mkfifo.c (main): Likewise.
3786         * src/mknod.c (main): Likewise.
3787         * src/mv.c (movefile): Likewise.
3788         * src/remove.c (remove_cwd_entries, rm): Likewise.
3789         * src/shred.c (quotearg_colon, xmalloc):
3790         "virtual memory exhausted" -> "memory exhausted"
3791
3792 2000-08-07  Jim Meyering  <meyering@lucent.com>
3793
3794         * src/cp.c (enum) [PARENTS_OPTION]: New member.
3795         (long_opts): Update "parents" and deprecated "path" entries to use
3796         `PARENTS_OPTION', not `P'.
3797         (usage): Update --help output.
3798         (main): Warn that the meaning of `-P' will soon change.
3799
3800 2000-08-06  Jim Meyering  <meyering@lucent.com>
3801
3802         * doc/fileutils.texi (cp invocation) [-r]: Remove inaccurate mention of
3803         `non-symbolic links'.
3804
3805 2000-08-05  Jim Meyering  <meyering@lucent.com>
3806
3807         * config.guess: Update from master repository.
3808         * config.sub: Likewise.
3809
3810         * Regenerate build/config framework to use the latest CVS versions
3811         of automake and autoconf.
3812
3813 2000-07-31  Jim Meyering  <meyering@lucent.com>
3814
3815         * src/shred.c [!HAVE_CONFIG_H]: Use `virtual memory exhausted', not
3816         `Memory exhausted'.
3817
3818 2000-07-30  Jim Meyering  <meyering@lucent.com>
3819
3820         * src/sys2.h (ISPRINT): Undef before defining to avoid warning.
3821
3822         * src/copy.c (copy_internal): Quote the file names that are displayed
3823         with --verbose and --backup.
3824         * src/remove.c (remove_file): Quote the file names that are displayed
3825         with --verbose.
3826         (remove_dir): Likewise.
3827         * tests/mv/mv-special-1: Add quote marks to match new behavior.
3828         * tests/rm/r-1: Likewise.
3829         * tests/rm/r-2: Likewise.
3830
3831         * src/df.c: Convert "`%s'" in format strings to "%s", and wrap each
3832         corresponding argument in a `quote (...)' call.
3833         * src/dircolors.c: Likewise.
3834         * src/du.c: Likewise.
3835         * src/mkdir.c: Likewise.
3836         * src/mkfifo.c: Likewise.
3837         * src/mknod.c: Likewise.
3838         * src/shred.c: Likewise.
3839         * src/rmdir.c: Likewise.
3840         * src/cp-hash.c: Likewise.
3841
3842         * src/chgrp.c: Convert "`%s'" in format strings to "%s", and wrap each
3843         corresponding argument in a `quote (...)' call.
3844         Add more precise diagnostics.
3845         * src/chmod.c: Likewise.
3846         * src/chown.c: Likewise.
3847
3848         * src/remove.c (remove_cwd_entries): Quote one more file name.
3849
3850         * src/help-version: Remove file.  Move it to ...
3851         * tests/help-version: ...here
3852         * tests/Makefile.am (TESTS): Set to help-version.
3853         (TESTS_ENVIRONMENT): Define.
3854         (EXTRA_DIST): Add $(TESTS).
3855         * src/Makefile.am (EXTRA_DIST): Remove help-version.
3856         (TESTS): Remove definition.
3857         (TESTS_ENVIRONMENT): Remove definition.
3858
3859 2000-07-24  Bruno Haible  <haible@clisp.cons.org>
3860
3861         * src/ls.c: Include <limits.h>, <stdlib.h>, <wchar.h>, <wctype.h>.
3862         (quote_name): Use mbrtowc to step through the filename string while
3863         replacing nonprintables with question marks. Return the screen width,
3864         not the strlen length. Do no output if the out stream is NULL.
3865         (length_of_file_name_and_frills): Use the quote_name return value.
3866
3867 2000-07-25  Jim Meyering  <meyering@lucent.com>
3868
3869         * src/chgrp.c (change_file_group): Save errno from a possibly failed
3870         chown, and use that later.  Otherwise, errno itself could be clobbered
3871         before used.
3872         * src/chmod.c (change_file_mode): Likewise.
3873         * src/chown.c (change_file_owner): Likewise.
3874
3875         * src/mv.c (main): Remove unnecessary "%s" argument.
3876
3877         * src/ln.c: Convert "`%s'" in format strings to "%s", and wrap each
3878         corresponding argument in a `quote (...)' call.
3879         Add more precise diagnostics.
3880         * src/mv.c: Likewise.
3881         * src/cp.c: Likewise.
3882         * src/touch.c: Likewise.
3883
3884 2000-07-23  Jim Meyering  <meyering@lucent.com>
3885
3886         * Version 4.0x.
3887
3888         * src/dd.c (main): Give a better diagnostic for e.g.,
3889         `dd if=/dev/fd0 seek=100000000000'.
3890         Convert "`%s'" in format strings to "%s", and wrap each
3891         corresponding argument in a `quote (...)' call.
3892         Add many, more precise diagnostics.
3893
3894         * src/remove.c (ASSIGN_STRDUPA): Remove macro definition.
3895         * src/sys2.h (ASSIGN_STRDUPA): New macro (moved here from remove.c).
3896
3897         Fix cp so that `cp -r DIR1/ DIR2' works once again.
3898         * src/cp.c (ASSIGN_BASENAME_STRDUPA): New macro.
3899         (do_copy): Use it here (so we always strip trailing slashes before
3900         calling base_name).  Reported by Branden Robinson via Michael Stone.
3901
3902         Test for the above fix.
3903         * tests/cp/Makefile.am (TESTS): Add dir-slash.
3904         * tests/cp/dir-slash: New file.
3905
3906 2000-07-17  Jim Meyering  <meyering@lucent.com>
3907
3908         * Makefile.maint (WGET): Define.
3909         (ftp-gnu): Define.
3910         (wget-update): New rule, based on the one in autoconf.
3911
3912         * src/shred.c (usage): Give a little more info.
3913         Remove a FIXME comment.
3914
3915         Avoid warnings.
3916         * src/ls.c (struct bin_str): Declare `string' member to be `const'.
3917         (put_indicator): Declare local `p' to be `const'.
3918
3919 2000-07-15  Jim Meyering  <meyering@lucent.com>
3920
3921         Begin converting "`%s'" in format strings to "%s", and wrap each
3922         corresponding argument in a `quote (...)' call -- if there's only one.
3923         If there are two or more, then use `quote_n (0, ...),
3924         quote_n (1, ...), ...'.
3925
3926         Here's the justification, from Paul Eggert (thanks, Paul):
3927
3928           [Consider] the following, taken from fileutils/copy.c:
3929
3930              error (0, errno, _("cannot create directory `%s'"), dst_path);
3931
3932           Now, suppose dst_path is "/'\nrm: removing all files under `/"
3933           (expressed in C string syntax).  This will cause the user to see
3934           the following delightfully ambiguous display:
3935
3936             cp: cannot create directory `/'
3937             rm: removing all files under `/'
3938
3939           It would be better to rewrite the above line to be something
3940           like this:
3941
3942             error (0, errno, _("cannot create directory %s"), quote (dst_path));
3943
3944           using the definition of "quote" [in lib/quote.c].  That way,
3945           the user will see the following unambiguous display instead:
3946
3947             cp: cannot create directory `/\'\nrm: removing all files under `/'
3948
3949           One might object that any user who asks to copy a file with
3950           a weird name like that deserves to get confused.  But this
3951           is not a good objection, as the source of the string may not
3952           be under the user's control, or even visible to the user.
3953
3954         * src/copy.c: Adapt format strings and args as above.  Include quote.h.
3955         I have deliberately not changed the output of --verbose.
3956         FIXME: maybe I should.
3957         * src/cp.c: Likewise.
3958         * src/remove.c: Likewise.
3959         * src/install.c: Likewise.  and improve a couple diagnostics.
3960
3961 2000-07-13  Paul Eggert  <eggert@twinsun.com>
3962
3963         * NEWS: Describe --quoting-style=clocale.
3964
3965         * doc/fileutils.texi: New clocale quoting style.
3966         Undo the previous change to the locale quoting style.
3967
3968 2000-07-09  Jim Meyering  <meyering@lucent.com>
3969
3970         * config.guess: Update from FSF.
3971         * config.sub: Likewise.
3972
3973 2000-07-05  Paul Eggert  <eggert@twinsun.com>
3974
3975         * doc/fileutils.texi: Don't use ` and ' for quoting.
3976
3977 2000-07-01  Jim Meyering  <meyering@lucent.com>
3978
3979         * Version 4.0w.
3980
3981         * tests/touch/dangling-symlink: Warn about the problem rather
3982         than failing, on some very recent (at least 2.3.99) versions of
3983         the Linux kernel.  Suggestion from Ulrich Drepper.
3984         * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Define host_triplet
3985         for use in the dangling-symlink test.
3986
3987 2000-06-28  Jim Meyering  <meyering@lucent.com>
3988
3989         * tests/mv/i-2: Don't copy `out' into /tmp.
3990
3991 2000-06-26  Paul Eggert  <eggert@twinsun.com>
3992
3993         Now that savedir.c has been cleaned up...
3994         * src/chgrp.c (change_dir_group): Don't set errno before
3995         invoking savedir, and assume that errno is nonzero if savedir fails.
3996         * src/chmod.c (change_dir_mode): Likewise.
3997         * src/chown.c (change_dir_owner): Likewise.
3998         * src/copy.c (copy_dir): Likewise.
3999         * src/du.c (count_entry): Likewise.
4000
4001 2000-06-26  Paul Eggert  <eggert@twinsun.com>
4002
4003         * src/df.c (show_dev): Round disk usage percentage up, not to
4004         nearest value.  Use integer arithmetic if it's easy.  Fix bug
4005         when converting twos-complement negative values to floating point.
4006
4007 2000-06-25  Jim Meyering  <meyering@lucent.com>
4008
4009         * src/copy.c (copy_internal): Don't return immediately after a failed
4010         copy_dir call -- otherwise, the failure to read a single file in a
4011         source directory would cause the containing destination directory
4012         not to have the owner and/or permissions set properly.
4013         Reported by Piotr and Maciej Kwapulinski.
4014         * tests/cp/fail-perm: Test for it.
4015         * tests/cp/Makefile.am (TESTS): Add fail-perm.
4016
4017         * Version 4.0v.
4018
4019 2000-06-18  Jim Meyering  <meyering@lucent.com>
4020
4021         * README-alpha: Update.
4022
4023 2000-06-17  Jim Meyering  <meyering@lucent.com>
4024
4025         * tests/install/basic-1: Don't fail (just exit 77) if strip doesn't
4026         work.  Suggestion from Ulrich Drepper.
4027         Add canonical trap/mkdir/cd, plus exit portability cruft.
4028
4029 2000-06-16  Jim Meyering  <meyering@lucent.com>
4030
4031         * src/copy.c (copy_reg): Give a slightly better diagnostic upon
4032         open failure.
4033
4034 2000-06-15  Paul Eggert  <eggert@twinsun.com>
4035
4036         * NEWS, doc/fileutils.texi: df, du, and ls now round disk
4037         usage up and disk free space down.
4038
4039         * src/df.c (df_readable): New arg for rounding style.
4040         Round negative numbers correctly.
4041         (show_dev): Round disk usage up and disk free space down.
4042
4043         * src/ls.c (print_dir, gobble_file, print_long_format,
4044         print_file_name_and_frills): Round disk usage up.
4045         * src/du.c (print_size): Likewise.
4046
4047 2000-06-14  Andreas Schwab  <schwab@suse.de>
4048
4049         * tests/rm/r-1 (framework_failure): Initialize this instead of
4050         test_failure.
4051
4052 2000-06-12  Jim Meyering  <meyering@lucent.com>
4053
4054         * Version 4.0u.
4055
4056         * tests/rm/r-1: Clean up.
4057         Be careful to remove temp directory upon interrupt.
4058
4059         * src/mv.c (main): Give the correct diagnostic when using the
4060         --target-dir=DIR option, but no arguments.
4061         Patch from Michael Stone.  Reported by Herbert Xu.
4062         * tests/mv/diag: New test for this.
4063         * tests/mv/Makefile.am (TESTS): Add diag.
4064
4065 2000-06-08  Brian Youmans  <3diff@gnu.org>
4066
4067         * doc/perm.texi (Multiple Changes): Fix typo.
4068         * doc/fileutils.texi: A few typos and minor formatting fixes.
4069         * doc/getdate.texi: Likewise.
4070
4071 2000-06-06  Jim Meyering  <meyering@lucent.com>
4072
4073         * Makefile.maint (alpha_subdir): Factor out `gnu/fetish'.
4074
4075 2000-06-04  Jim Meyering  <meyering@lucent.com>
4076
4077         * Version 4.0t.
4078
4079         * src/df.c (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]:
4080         Cast undeclared `realpath' to char* to avoid warning.
4081
4082 2000-06-03  Jim Meyering  <meyering@lucent.com>
4083
4084         * src/install.c (usage): Document that -v is a synonym for --verbose.
4085         * src/mkdir.c: Allow -v as synonym for --verbose, to be consistent
4086         with other fileutils.
4087         * src/rmdir.c: Likewise.
4088         Suggestion from François Pinard.
4089
4090 2000-06-02  Jim Meyering  <meyering@lucent.com>
4091
4092         * configure.in (ALL_LINGUAS): Add Danish (da).
4093
4094 2000-05-29  Jim Meyering  <meyering@lucent.com>
4095
4096         Allow `cp -d -u' to copy one symlink onto another that's identical.
4097         * src/copy.c (copy_internal): Change the || to ^ in the big sameness
4098         test, so copying one symlink onto another, identical one doesn't fail
4099         here.
4100         If the symlink call fails, don't report the failure if the destination
4101         already exists and is a symlink pointing to the proper name.
4102         Reported by Andrew Burgess.
4103         * tests/cp/slink-2-slink: New test.
4104         * tests/cp/Makefile.am (TESTS): Add slink-2-slink.
4105         * tests/cp/same-file: Adapt to fit new semantics of `cp -d'.
4106
4107 2000-05-25  Jim Meyering  <meyering@lucent.com>
4108
4109         * src/dd.c (close_stdout_wrapper): Don't dereference NULL pointer.
4110         From Bob Proulx.
4111
4112 2000-05-23  Jim Meyering  <meyering@lucent.com>
4113
4114         * tests/shred/remove: Add traps to clean up.
4115         Correct broken running-as-root test.
4116
4117         * tests/mv/i-2: Exit 77 when run as root.  Reported by Andreas Schwab.
4118
4119 2000-05-20  Jim Meyering  <meyering@lucent.com>
4120
4121         * Version 4.0s.
4122
4123         * tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change.
4124
4125         * tests/rm/r-2: Clean up.
4126         * tests/ls/time-1 (LC_ALL): Set it unconditionally.
4127
4128 2000-05-19  Jim Meyering  <meyering@lucent.com>
4129
4130         Save device number as well as inode number for each directory,
4131         and use both in comparisons.  This makes the directory cycle
4132         test more robust, and closes the small remaining hole whereby
4133         an attacker could subvert a running `rm -r' command.
4134
4135         * src/remove.c (struct active_dir_ent) [st_dev]: New member.
4136         [st_ino]: Rename from `inum'.
4137         (make_active_dir_ent) [device]: New parameter.
4138         (hash_compare_active_dir_ents): Compare using SAME_INODE macro.
4139         (fspec_init_common): New function, factored out.
4140         (fspec_init_file): Initialize have_device member.
4141         (fspec_get_full_mode): Remove parameter.  Update caller.
4142         Set have_device and st_dev members.
4143         * src/remove.h (struct File_spec) [have_device, st_dev]:  New members
4144
4145 2000-05-18  Jim Meyering  <meyering@lucent.com>
4146
4147         * src/remove.c (rm): Combine adjacent fputc and fprintf.
4148
4149         * tests/rm/Makefile.am (TESTS): Add hash.
4150         * tests/rm/hash: New test for the fix in lib/hash.c.
4151
4152 2000-05-17  Jim Meyering  <meyering@lucent.com>
4153
4154         * src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert
4155         a running `rm -r'.  Reported by Morten Welinder.
4156
4157 2000-05-15  Jim Meyering  <meyering@lucent.com>
4158
4159         * src/ln.c (do_link): Use complete strings in diagnostics so they
4160         are easier to translate.  Reported by Michel Robitaille.
4161         (main): Drop support for the case in which S_ISLNK wasn't defined.
4162         It was broken in any case.
4163
4164         * tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the
4165         current locale is not C (POSIX).  From Matthew Clarke.
4166
4167 2000-05-13  Jim Meyering  <meyering@lucent.com>
4168
4169         * src/help-version: New test.
4170         * src/Makefile.am (TESTS): Define.
4171         (TESTS_ENVIRONMENT): Likewise.
4172         (EXTRA_DIST): Add help-version.
4173
4174         * src/chgrp.c: Arrange to call close_stdout only upon exit.
4175         * src/chmod.c: Likewise.
4176         * src/chown.c: Likewise.
4177         * src/cp.c: Likewise.
4178         * src/df.c: Likewise.
4179         * src/dircolors.c: Likewise.
4180         * src/du.c: Likewise.
4181         * src/install.c: Likewise.
4182         * src/ln.c: Likewise.
4183         * src/ls.c: Likewise.
4184         * src/mkdir.c: Likewise.
4185         * src/mkfifo.c: Likewise.
4186         * src/mknod.c: Likewise.
4187         * src/mv.c: Likewise.
4188         * src/rm.c: Likewise.
4189         * src/rmdir.c: Likewise.
4190         * src/shred.c: Likewise.
4191         * src/sync.c: Likewise.
4192         * src/touch.c: Likewise.
4193
4194         * src/dd.c: Include closeout.h.
4195         (usage): Don't call close_stdout here.
4196         (close_stdout_wrapper): New, kludgey, function and file-scoped global.
4197         (main): Register it with atexit.
4198
4199 2000-05-12  Jim Meyering  <meyering@lucent.com>
4200
4201         Unlike for mv, -i doesn't cancel the effect of -f
4202         and -f doesn't cancel the effect of -i.
4203         * src/cp.c (main) ['f']: Don't reset `x.interactive'.
4204         ['i']: Don't reset `x.force'.
4205         * src/copy.c (copy_internal): Fix force and interactive tests.
4206         Patch from Michael Stone, reported by Jeff Sheinberg.
4207
4208 2000-05-09  Jim Meyering  <meyering@lucent.com>
4209
4210         * src/shred.c: Include sys/types.h in shred.c before including
4211         sys/stat.h or system.h.  From John David Anglin.
4212
4213 2000-05-08  Jim Meyering  <meyering@lucent.com>
4214
4215         * tests/shred/remove: Don't use touch in root test.  Instead, append to
4216         the test file, since now touch operates even on files which deny owner
4217         write access.
4218
4219 2000-05-06  Jim Meyering  <meyering@lucent.com>
4220
4221         * src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@.
4222
4223         * src/rmdir.c (EEXIST): Remove now-unused definition.
4224         (ENOTEMPTY): Likewise.
4225         (errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
4226         which is determined by the autoconf test in m4/rmdir-errno.m4.
4227
4228 2000-05-03  Bruno Haible  <haible@clisp.cons.org>
4229
4230         Don't fail when running `make check' with non-`C' locale.
4231         * tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext)
4232         and LC_ALL (for systems which look at LC_MESSAGES).
4233         * tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has
4234         LC_CTYPE or LC_ALL set.  Define it and LANGUAGE before the first use
4235         of sort.
4236
4237 2000-05-03  Jim Meyering  <meyering@lucent.com>
4238
4239         With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro.
4240         * src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup.
4241         * src/dircolors.c: Remove declaration of strndup.
4242         Reported by Bruno Haible.
4243
4244 2000-05-02  Jim Meyering  <meyering@lucent.com>
4245
4246         * src/rm.c (usage): Add the answer to `How do I remove a file named -f?'
4247
4248 2000-05-01  Jim Meyering  <meyering@lucent.com>
4249
4250         * src/install.c (change_attributes): Don't even attempt the chmod
4251         if the chown fails.  Before, when a non-root user ran `install -m 4755
4252         -o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to
4253         the ID of the installing user.  Reported by Marc Olzheim.
4254
4255 2000-04-30  Jim Meyering  <meyering@lucent.com>
4256
4257         * src/touch.c (O_NOCTTY): Define if not defined already.
4258         (touch): Add O_NOCTTY to the flags passed to open.
4259
4260 2000-04-29  Jim Meyering  <meyering@lucent.com>
4261
4262         * Version 4.0r.
4263
4264         * src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat.
4265
4266 2000-04-27  Jim Meyering  <meyering@lucent.com>
4267
4268         Clean up.
4269         * tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR.
4270         * tests/mkdir/p-1: Use mkdir, not $MKDIR.
4271         * tests/mkdir/p-2: Likewise.
4272
4273         * configure.in (AC_OUTPUT): Add tests/du/Makefile.
4274         * tests/Makefile.am (SUBDIRS): Add du.
4275         * tests/du: New directory.
4276         * tests/du/two-args: New test.
4277
4278         * tests/mkdir/special-1: New test.
4279         * tests/mkdir/Makefile.am (TESTS): Add special-1.
4280
4281 2000-04-25  Paul Eggert  <eggert@twinsun.com>
4282
4283         * src/du.c (pop_dir): Remove through_symlink arg; use null cwd
4284         for that purpose instead.
4285         (count_entry): Also save the directory if we're saving more
4286         than one level.
4287         Fix file descriptor and memory leak when chdir fails.
4288
4289 2000-04-26  Jim Meyering  <meyering@lucent.com>
4290
4291         * src/mkdir.c: Rename global: s/path_mode/create_parents/.
4292         (main): No longer perform explicit chmod when creating
4293         parent directories, since make_path now does the chmod.
4294
4295 2000-04-17  Jim Meyering  <meyering@lucent.com>
4296
4297         * src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP.
4298         (enum) [FROM_OPTION]: New member.
4299         (long_options): New getopt spec.
4300         (change_file_owner): Add old_user, old_group parameters.  Use them.
4301         (change_dir_owner): Likewise.
4302         (usage): Describe.
4303         (main): New case.
4304         From Andries Brouwer.
4305         * doc/fileutils.texi (invoking chown): Document it.
4306
4307 2000-04-16  Jim Meyering  <meyering@lucent.com>
4308
4309         * src/cp.c: New option: --strip-trailing-slashes.
4310         (enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
4311         (remove_trailing_slashes): New global.
4312         (long_opts): New getopt spec.
4313         (usage): Describe.
4314         (do_copy): Strip trailing slashes on SOURCE names only if the new
4315         option has been specified.
4316         (main): New case.
4317
4318         * tests/cp/symlink-slash: New test for the change in behavior.
4319         * tests/cp/Makefile.am (TESTS): Add symlink-slash.
4320
4321         * doc/fileutils.texi (Trailing slashes): Factor out discussion on
4322         trailing slashes into its own node.
4323         Cross reference from cp and mv.
4324
4325 2000-04-14  Jim Meyering  <meyering@lucent.com>
4326
4327         * src/touch.c (touch): Add O_NOCTTY to the list of open-time flags.
4328
4329 2000-04-13  Jim Meyering  <meyering@lucent.com>
4330
4331         Move some code into m4/.
4332         * configure.in (_GNU_SOURCE): Don't define here.
4333         (AC_SYS_LARGEFILE): Don't use here.
4334         (AM_C_PROTOTYPES): Don't use here.
4335         * acconfig.h: Remove now-unused file.
4336
4337 2000-04-08  Jim Meyering  <meyering@lucent.com>
4338
4339         * doc/fileutils.texi (cp invocation): Mention that there is an
4340         application for cp's --sparse=never option.  From Martin Hippe.
4341         (cp invocation): Describe how --backup and --force
4342         can be useful together.
4343
4344 2000-03-10  Alan Iwi <iwi@atm.ox.ac.uk>
4345
4346         * src/ls.c: Add support for "ln=target" in the LS_COLORS variable,
4347         to colorize links as for the file/directory pointed to.
4348         * src/dircolors.hin: Add a few words of documentation of the above.
4349
4350 2000-04-08  Jim Meyering  <meyering@lucent.com>
4351
4352         * src/cp.c (usage): Document that while the --backup option takes an
4353         optional argument, the -b option accepts none.
4354         (main): Use `backup type' in call to xget_version, not the
4355         now-deprecated `--version-control'.
4356         * src/install.c: Likewise.
4357         * src/ln.c: Likewise.
4358         * src/mv.c: Likewise.
4359
4360 2000-03-12  Jim Meyering  <meyering@lucent.com>
4361
4362         Merge from textutils.
4363         * src/system.h (O_BINARY, O_TEXT): Define if necessary.
4364         (SET_BINARY, SET_BINARY2): Define.
4365         (DEV_BSIZE): Define to BBSIZE if appropriate.
4366
4367 2000-03-10  Jim Meyering  <meyering@lucent.com>
4368
4369         * tests/mv/mv-special-1: Make the message more like that in the
4370         similar touch and shred tests.
4371         * tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
4372         bug and `exit 77' if the fifo cannot be created.
4373         Report and suggestion from Volker Borchert.
4374
4375 2000-03-03  Jim Meyering  <meyering@lucent.com>
4376
4377         * po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a
4378         space optimization anyway) to populate $(distdir).  Otherwise, the dist
4379         rules that change permissions would end up affecting the master sources.
4380
4381 2000-03-01  Paul Eggert  <eggert@twinsun.com>
4382
4383         * src/df.c (show_point): Ignore shortcuts based on path
4384         prefixes that are loop file system mount points, since they
4385         yield undesirable output.
4386
4387 2000-02-29  Jim Meyering  <meyering@lucent.com>
4388
4389         * src/ls.c (decode_switches): Remove `e' from getopt_long's list of
4390         option characters.  Reported by John Summerfield.
4391
4392 2000-02-28  Jim Meyering  <meyering@lucent.com>
4393
4394         * tests/install/basic-1: Use ginstall, not install.
4395
4396 2000-02-27  Jim Meyering  <meyering@lucent.com>
4397
4398         * Version 4.0q.
4399
4400         * src/sys2.h: Guard declaration of strtoull also with
4401         `&& HAVE_UNSIGNED_LONG_LONG'.
4402
4403         * src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...'
4404         now that autoconf always defines the HAVE_DECL_ symbols.
4405
4406         * src/install.c (install_file_to_path): Always use install_file_in_file.
4407         Based on a patch from Adam Klein via Michael Stone.
4408
4409         * tests/install/Makefile.am (TESTS): Add create-leading.
4410         * tests/install/create-leading: New file.
4411
4412         * tests/install/basic-1: Clean up.
4413         * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft.
4414
4415 2000-02-26  Jim Meyering  <meyering@lucent.com>
4416
4417         Tranform the generated src/Makefile.in file so it falls back on
4418         using /bin/rm when necessary.  The old rule didn't always work.
4419         This is necessary only on certain losing systems, and because this
4420         package builds an `rm' executable and some people put `.' too
4421         early in their PATH.
4422         * Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment.
4423         (EXTRA_DIST): Add .kludge-stamp.
4424         (.kludge-stamp): New rule.
4425         * src/Makefile.am (AUTOMAKE): Remove definition.
4426         (Makefile.in): Remove dependency on automake-wrap script.
4427         (EXTRA_DIST): Remove automake-wrap.
4428         * src/automake-wrap: Remove file.
4429
4430         * tests/rm/r-2: Don't make the success of the test depend on the
4431         order in which directory entries are processed.
4432         Reported by Andreas Schwab.
4433
4434 2000-02-12  Jim Meyering  <meyering@lucent.com>
4435
4436         * po/POTFILES.in: Add lib/userspec.c.
4437
4438         * doc/fileutils.texi (chown invocation): Deprecate use of `.'.
4439
4440         * src/chown.c (usage): Mention only `:', and not `.' as the separator,
4441         since POSIX allows only the former.
4442         Prompted by a report from Manas Garg.
4443
4444 2000-02-11  Jim Meyering  <meyering@lucent.com>
4445
4446         * src/df.c (main): Count the stat'able arguments.
4447         Print the header line only if there is at least one valid argument.
4448         Reported by Andy Longton <alongton@metamark.com>
4449
4450 2000-02-10  Jim Meyering  <meyering@lucent.com>
4451
4452         Make du work when invoked from an unreadable directory.
4453
4454         * src/du.c (pop_dir): New function.
4455         (count_entry): Factor out common code (pop_dir), and call the new
4456         function instead.
4457         Move declaration of global, `stat_buf' into this function.
4458         (du_files): Don't stat `.' or call save_cwd, since count_entry
4459         never returns with a changed working directory.
4460
4461 2000-02-09  Jim Meyering  <meyering@lucent.com>
4462
4463         * tests/mv/mv-special-1: Use $null and $dir in place of literals
4464         in `here' script.
4465         Exit 77 if we can't set up the framework (Volker Borchert reported
4466         that this test would fail because mknod failed when run on SunOS4.1.4
4467         using NFS-mounted disk from an OpenBSD system).
4468
4469 2000-02-05  Jim Meyering  <meyering@lucent.com>
4470
4471         * src/copy.c (copy_internal): Don't allow mv to move a directory onto
4472         a non-directory.  Reported by Brian Kimball via Michael Stone.
4473
4474 2000-02-03  Jim Meyering  <meyering@lucent.com>
4475
4476         * tests/mv/Makefile.am (TESTS): Add dir-file.
4477         (TESTS_ENVIRONMENT): Remove vestiges of old tests.
4478         * tests/mv/dir-file: New file.
4479
4480 2000-02-02  Jim Meyering  <meyering@lucent.com>
4481
4482         * tests/touch/Makefile.am (TESTS): Add fifo.
4483         * tests/touch/fifo: New file.
4484
4485 2000-02-01  Jim Meyering  <meyering@lucent.com>
4486
4487         * src/touch.c (O_NDELAY): Define to 0 if not defined.
4488         (O_NONBLOCK): Define to O_NDELAY if not defined.
4489         (touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
4490         Reported by Eric G. Miller via Michael Stone.
4491
4492         * man/*.x: Change ." to .\".
4493         Reported by Andreas Schwab and Brendan O'Dea.
4494
4495 2000-01-31  Jim Meyering  <meyering@lucent.com>
4496
4497         * man/Makefile.maint (ginstall_filter): Define.
4498         ($(man_MANS)): Use it here so that the install.1 man page refers
4499         to `install', not `ginstall'.  Reported by Andreas Schwab.
4500
4501 2000-01-30  Jim Meyering  <meyering@lucent.com>
4502
4503         * Version 4.0p.
4504
4505         * configure.in: Move library-related tests into m4/lib-check.m4.
4506
4507         * src/system.h (ST_NBLOCKS): Use st_size only for regular files and
4508         for directories.  From H. J. Lu.
4509
4510         * src/dd.c (main): Exit with nonzero status if ftruncate fails.
4511
4512 2000-01-24  Jim Meyering  <meyering@lucent.com>
4513
4514         * src/ln.c (usage): Describe behavior when LINK_NAME is omitted.
4515         From Michael Stone.
4516
4517         * src/mv.c (main): Don't expect array index `n_files - 1' to evaluate
4518         to `-1' for unsigned int n_files == 0.  Doing so lead to a segfault on
4519         alpha.  From Michael Stone.
4520
4521 2000-01-23  Jim Meyering  <meyering@lucent.com>
4522
4523         * configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.)
4524         Remove nearly all function checks (moved to m4/.)
4525         (AC_SUBST(DF_PROG)): Move this to m4/.
4526         (ftruncate test): Move into new file: m4/ftruncate.m4.
4527         (AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/.
4528         Remove df-related tests.  i.e., move jm_LIST_MOUNTED_FILESYSTEMS,
4529         jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/.
4530
4531 2000-01-22  Jim Meyering  <meyering@lucent.com>
4532
4533         * configure.in: Move addext.c prerequisites from this file into m4/.
4534         (AC_CHECK_HEADERS): Move these checks into m4/.
4535
4536 2000-01-17  Paul Eggert  <eggert@twinsun.com>
4537
4538         * src/dd.c (interrupt_handler): Likewise.
4539         (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
4540         to decide whether to call sigaction; this fixes an old typo.
4541
4542 2000-01-16  Jim Meyering  <meyering@lucent.com>
4543
4544         * lib/Makefile.am: Sync with sh-utils/lib/Makefile.am.
4545
4546         * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME,
4547         jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and
4548         AC_FUNC_ALLOCA.  They're now in m4/.
4549
4550         Sync with the version from emacs-20.5.
4551         * lib/alloca.c
4552         (<string.h>): Include if HAVE_STRING_H.
4553         (<stdlib.h>): Include if HAVE_STDLIB_H.
4554         (alloca): Abort if malloc fails.
4555         Reported by Paul Eggert.
4556
4557 2000-01-15  Jim Meyering  <meyering@lucent.com>
4558
4559         * configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy
4560         memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol
4561         strtoul strverscmp.  Now they're in m4/.
4562
4563 2000-01-12  Jim Meyering  <meyering@lucent.com>
4564
4565         * tests/shred/remove: Make the warning that this shred test may not
4566         be run as root more prominent.  Suggestion from Volker Borchert.
4567
4568 2000-01-11  Paul Eggert  <eggert@twinsun.com>
4569
4570         Quote multibyte characters correctly.
4571
4572         * lib/quotearg.c (ISGRAPH): Remove.
4573         (ISPRINT): New macro.
4574         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
4575         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
4576         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4577         (quotearg_buffer_restyled): New function, with most of the old
4578         quotearg_buffer's contents.
4579         Major rewrite to support multibyte characters.
4580         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
4581
4582         * m4/c-bs-a.m4: New file.
4583         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
4584         (jm_PREREQ): Use it.
4585
4586 2000-01-11  Paul Eggert  <eggert@twinsun.com>
4587
4588         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned
4589         long, to parse numeric modes.  Check for any unknown bits, not
4590         just unknown bits left of the leftmost known bit.
4591
4592 2000-01-11  Paul Eggert  <eggert@twinsun.com>
4593
4594         * lib/getdate.y: Update copyright notice.
4595
4596 2000-01-11  Paul Eggert  <eggert@twinsun.com>
4597
4598         * COPYING: Sync with latest FSF version (fixing a minor Y2k problem).
4599
4600 2000-01-11  Paul Eggert  <eggert@twinsun.com>
4601
4602         * lib/exclude.c, lib/exclude.h: Sync to the slightly more
4603         general version of GNU tar.
4604
4605         * src/du.c (count_entry):
4606         Adjust to new calling convention for excluded_filename.
4607         (main): Likewise, for add_exclude_file.
4608
4609 2000-01-11  Jim Meyering  <meyering@lucent.com>
4610
4611         * lib/memcpy.c (memcpy): Protoize.
4612
4613         Prepare to sync lib/ directories of fileutils, sh-utils, and textutils.
4614         * lib/Makefile.am: s/fu/fetish/
4615         * src/Makefile.am: s/libfu/libfetish/
4616
4617         * lib/hash.c (hash_initialize): Fix typo in comment.
4618         From François Pinard.
4619
4620 2000-01-10  Jim Meyering  <meyering@lucent.com>
4621
4622         * Version 4.0o.
4623
4624         * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
4625
4626 2000-01-09  Jim Meyering  <meyering@lucent.com>
4627
4628         * Version 4.0n.
4629
4630         * src/ln.c (do_link): Produce the same sort of one-line output for
4631         `--backup --verbose' as cp, mv, install.  Before this, the backup
4632         file name wasn't printed at all.
4633
4634         This affects cp, install, and mv.
4635         * src/copy.c (copy_internal): When making backup files in verbose
4636         mode, print the backup file name on the same line as the rest of the
4637         information, e.g., `a -> b (backup: b.~13~)' rather than on a separate
4638         line by itself.  Suggestion from Karl Berry.
4639
4640 2000-01-08  Jim Meyering  <meyering@ascend.com>
4641
4642         * lib/error.c (error): Use __strerror_r's return value only if
4643         HAVE_WORKING_STRERROR_R.
4644         (error_at_line): Likewise.
4645
4646         * Makefile.maint (null_AM_MAKEFLAGS): Define.
4647         (my-distcheck): Use it to avoid distributing out of date files
4648         whose derivation would require a maintainer tool.
4649
4650 2000-01-07  Jim Meyering  <meyering@ascend.com>
4651
4652         * lib/euidaccess.c: Sync with the GNU C library.
4653
4654         * tests/dir/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix
4655         to exported PATH value (though not strictly necessary, here).
4656         * tests/dd/Makefile.am: Likewise.
4657         * tests/dircolors/Makefile.am: Likewise.
4658         * tests/rm/Makefile.am: Likewise.
4659         * tests/rmdir/Makefile.am: Likewise.
4660         * tests/shred/Makefile.am: Likewise.
4661         * tests/touch/Makefile.am: Likewise.
4662         * tests/shred/Makefile.am: Likewise.
4663
4664 2000-01-06  Jim Meyering  <meyering@ascend.com>
4665
4666         * man/help2man: Import version 1.020.
4667
4668         * lib/strftime.c: Sync with the GNU C Library.
4669
4670 2000-01-06  Paul Eggert  <eggert@set.twinsun.com>
4671
4672         * tar/lib/getdate.y: Sync tm_diff with the GNU C Library.
4673         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
4674         (tm_diff): Renamed from difftm.  All uses changed.
4675         Replace body with that taken from GNU C Library 2.1.3pre1.
4676         (get_date): Prefer tm_gmtoff to tm_diff if available.
4677
4678 2000-01-04  Paul Eggert  <eggert@twinsun.com>
4679
4680         * savedir.c (savedir): Don't store past the end of an array if
4681         name_size is zero and the directory is empty.
4682
4683         * Makefile.maint (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0.
4684         (alpha): Create xdelta diffs.
4685
4686 2000-01-02  Jim Meyering  <meyering@ascend.com>
4687
4688         * Version 4.0m.
4689
4690         * src/mv.c: New option: --strip-trailing-slashes.
4691
4692         1999-11-18  Paul Eggert  <eggert@twinsun.com>
4693
4694         * lib/strftime.c (my_strftime): Some old compilers object to
4695         '\a', so don't bother optimizing for it.
4696
4697 2000-01-01  Paul Eggert  <eggert@twinsun.com>
4698
4699         Fix bug: `df PATH' sometimes misbehaves when there is an
4700         inaccessible mount point unrelated to PATH.
4701         * configure.in (AC_CHECK_FUNCS): Add realpath, resolvepath.
4702         * src/df.c (#pragma alloca): Add if _AIX is defined.
4703         (path-concat.h): Include.
4704         (show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined,
4705         find the real absolute path for PATH, and use that to find the
4706         mount point.
4707
4708         (show_point): Prefer non-dummy entries in shortcuts, too.
4709         Disable bogus mount dirs instead of restatting them each time.
4710
4711 1999-12-30  Jim Meyering  <meyering@ascend.com>
4712         1999-12-17  Kalle Olavi Niemitalo  <tosi@stekt.oulu.fi>
4713
4714         * src/rmdir.c (remove_parents, main): Don't pass errno to error
4715         when printing "removing directory" message.  Failure of rmdir is
4716         handled elsewhere.
4717
4718 1999-12-23  Jim Meyering  <meyering@ascend.com>
4719
4720         * configure.in: Remove clock_gettime tests.
4721         Now they're in m4/jm-macros.m4.
4722
4723         * src/ln.c (usage): Correct typos.
4724         List new --target-directory=... usage.
4725         Reported by Göran Uddeborg
4726
4727         * src/mv.c (usage): List new --target-directory=... usage.
4728
4729 1999-12-22  Jim Meyering  <meyering@ascend.com>
4730
4731         * lib/getdate.y (get_date): Fix typo in time_t overflow test.
4732         From Michael Stone.
4733
4734 1999-12-21  Andreas Schwab  <schwab@suse.de>
4735
4736         * tests/shred/remove: Use $file, not $tmp/file.  Exit 77 if run as
4737         root.
4738
4739 1999-12-20  Paul Eggert  <eggert@twinsun.com>
4740
4741         * src/df.c (ceil_percent): Remove.
4742         (show_dev): Avoid overflow problems when calculating percent.
4743         Do not display negative percents.
4744
4745 1999-12-19  Jim Meyering  <meyering@ascend.com>
4746
4747         * Version 4.0l.
4748
4749         * doc/fileutils.texi: Clarify and combine descriptions of -c and of
4750         --time=ctime.
4751         Likewise for -u/--time=atime.
4752
4753         * src/ls.c [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper.
4754         [Notice the new configure-time test in m4/lstat-slash.m4. ]
4755         (main): Back out change from 1999-02-19 that made ls remove
4756         trailing slashes from command line arguments to accommodate early
4757         versions of Linux.  Now, `ls symlink-to-dir/' acts like
4758         `ls symlink-to-dir/.' thus following the symbolic link, as POSIX says
4759         it should.  Suggestion from Bruno Haible and Andreas Schwab.
4760
4761         * lib/xstat.in (slash_aware_lstat): New function.
4762         (rpl_@xstat@): Use it.
4763         * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
4764         (lstat.c): Likewise.
4765
4766         Make sure ls does the right thing with symlinks and trailing slashes.
4767         * tests/ls/Makefile.am (TESTS): Add symlink-slash.
4768         * tests/ls/symlink-slash: New test, for above-fixed bug.
4769
4770 1999-12-18  Jim Meyering  <meyering@ascend.com>
4771
4772         * src/shred.c (wipename): When repeatedly renaming a file, making the
4773         name shorter and shorter, skip to the next shorter length length if a
4774         rename fails (e.g. due to permission denied).  Otherwise, this loop
4775         would iterate for so long that shred would appear to be stuck in an
4776         infinite loop for any but the shortest file names.
4777         Reported by Joe Orton.
4778
4779         * configure.in (AC_OUTPUT): Add tests/shred/Makefile.
4780         * tests/Makefile.am (SUBDIRS): Add shred.
4781         * tests/shred: New directory
4782         * tests/shred/remove: New file.  Tests for the above-fixed bug.
4783
4784 1999-12-13  Jim Meyering  <meyering@ascend.com>
4785
4786         * lib/makepath.c (make_path): Consistently use `error' to output
4787         the verbose, `created directory ...' messages.
4788         Reported by Bernhard Rosenkraenzer.
4789
4790 1999-12-12  Jim Meyering  <meyering@ascend.com>
4791
4792         Move 120+ lines of stat.h-related macros from system.h (not shared)
4793         to sys2.h, which is shared between fileutils, sh-utils, textutils.
4794         * src/system.h: Move them from here...
4795         * src/sys2.h: ... to here.
4796
4797         * src/system.h (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define
4798         if not defined.  This was necessary on a NeXT Turbostation running
4799         Mach 3.3.  Reported by Nelson H. F. Beebe.
4800
4801         * src/ls.c (decode_switches): If -c or -u is specified and not -l
4802         (or any other option that implies -l), and no sort-type was specified,
4803         then sort by the ctime (-c) or atime (-u).  Part of this change reverts
4804         the 1998-01-10 delta.
4805         (usage): Update to reflect this change.
4806         Reported by Paul Slootman via Michael Stone.
4807
4808 1999-12-09  Jim Meyering  <meyering@ascend.com>
4809
4810         * src/df.c (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define
4811         these and use them instead of `CHAR_MAX + n'.
4812         * src/du.c (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION):
4813         Likewise.
4814         * src/touch.c (TIME_OPTION): Likewise.
4815         * src/rmdir.c (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise.
4816
4817         * tests/ls/time-1: Test more of the framework (touch's -a and -m
4818         options) before running the actual ls test.
4819
4820 1999-12-07  Jim Meyering  <meyering@ascend.com>
4821
4822         * tests/cp/cp-mv-backup: Use 1>&2 rather than `1<&-'.
4823         Suggestion from Volker Borchert.
4824
4825 1999-12-05  Jim Meyering  <meyering@ascend.com>
4826
4827         * Makefile.maint: Remove ftp.enst.fr.
4828
4829 1999-12-04  Jim Meyering  <meyering@ascend.com>
4830
4831         * Version 4.0k.
4832
4833         * tests/mv/into-self-2: Adapt to reflect this change in behavior.
4834         Make sure the VERSION_CONTROL envvar is not set.
4835         Run diff if comparison fails.
4836
4837         * src/copy.c (copy_internal): In move mode, if the rename attempt
4838         fails, then unlink any existing destination file.  This makes a
4839         cross-device `mv' more consistent with the intra-device behavior.
4840         This change is required by POSIX to make a cross-device move act with
4841         semantics similar to those of the rename syscall.  For example now
4842         `mv' can move a file onto a symlink to itself when that symlink
4843         is on a separate partition.  With fileutils-4.0j, it would fail with
4844         a diagnostic saying they were the same file.
4845         Reported by Bruno Haible.
4846
4847         * tests/mv/to-symlink: New file.  Adds test for the above.
4848         * tests/mv/Makefile.am (TESTS): Add to-symlink.
4849
4850         * tests/cp/cp-mv-backup (trap): Be careful to close $actual before
4851         removing the containing directory.  Otherwise, on some systems rmdir
4852         fails to remove the containing directory.
4853
4854         * tests/ls/time-1: List --full-time dates upon failure.
4855
4856 1999-12-02  Andreas Schwab  <schwab@suse.de>
4857
4858         * src/ls.c (check_symlink_color): New variable.
4859         (main): Set it if we need to check for dangling symlinks when
4860         displaying colors.
4861         (gobble_file): Check check_symlink_color instead of print_with_color.
4862
4863 1999-11-30  Paul Eggert  <eggert@twinsun.com>
4864
4865         * src/ls.c (usage): Shorten help for --show-control-chars.
4866
4867 1999-11-30  Jim Meyering  <meyering@ascend.com>
4868
4869         Give the right diagnostic when failing to create a file in an
4870         unwritable directory.
4871         * src/touch.c (touch): Record errno upon failed errno and use that
4872         saved value if a subsequent fstat, stat or utime call fails.
4873         Reported by Wichert Akkerman via Michael Stone.
4874
4875 1999-11-27  Jim Meyering  <meyering@ascend.com>
4876
4877         Clean up test scripts.
4878         * tests/mv/setup: Don't set/use DF or MKDIR.  Use df and mkdir instead.
4879         * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH
4880         * tests/mv/backup-is-src: Likewise for RM and MV.
4881         * tests/mv/hard-link-1: Likewise.
4882         * tests/mv/into-self: Likewise.
4883         * tests/mv/into-self-3: Likewise.
4884
4885         Add test for 1999-05-23 change to src/copy.c (copy_internal).
4886         * tests/mv/partition-perm: New file.
4887         * tests/mv/Makefile.am (TESTS): Add partition-perm.
4888
4889         * Version 4.0j.
4890
4891 1999-11-22  Paul Eggert  <eggert@twinsun.com>
4892
4893         * src/df.c (df_readable): Now returns char const *, not char *.
4894         New arg NEGATIVE.
4895         (ceil_percent): Now returns double, not int.
4896         Be more careful about adding 1 to a wild value.
4897         (show_dev): Don't filter out wild sizes from the underlying operating
4898         system; instead, show them to the user as faithfully as possible.
4899
4900 1999-11-23  Jim Meyering  <meyering@ascend.com>
4901
4902         * doc/getdate.texi (Calendar date item): Correction regarding 0..68/
4903         69-99 split for 1900 vs 2000.  From Peter Moulder.
4904
4905 1999-11-22  Jim Meyering  <meyering@ascend.com>
4906
4907         * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c.
4908
4909 1999-11-20  Jim Meyering  <meyering@ascend.com>
4910
4911         * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate
4912         errno comparison.
4913         (remove_parents): Use it.
4914         (main): Use it.
4915
4916         * tests/cp/cp-mv-backup: Run `diff -c' if the test fails.
4917
4918         * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH.
4919         * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc.
4920
4921         * src/chgrp.c: Declare lstat;  needed on e.g. SunOS4.
4922         Reported by Tom Tromey.
4923
4924 1999-11-19  Jim Meyering  <meyering@ascend.com>
4925
4926         * lib/strstr.c (strstr): Include config.h.
4927         Add a `;' between shloop label and `}'.
4928         From Akim Demaille.
4929
4930 1999-11-17  Jim Meyering  <meyering@ascend.com>
4931
4932         * src/mkdir.c (S_IRWXUGO): Define if necessary.
4933         (main): Use chmod to set the permissions if bits other than those
4934         of S_IRWXUGO were requested.  Reported by Sami Farin.
4935
4936 1999-11-14  Paul Eggert  <eggert@twinsun.com>
4937
4938         * touch.c (touch): Simplify code a tad, using fd == -1 instead
4939         of separate valid_fd variable.
4940
4941 1999-11-13  Jim Meyering  <meyering@ascend.com>
4942
4943         * src/touch.c (touch): Don't fail just because we couldn't open
4944         an existing file.  This makes it so that touching a read-only
4945         file now works.  Also clean up and simplify.
4946         Based on a patch from Chip Salzenberg.
4947         * tests/touch/no-rights: New test for this.
4948         * tests/touch/Makefile.am (TESTS): Add no-rights.
4949
4950 1999-11-12  Jim Meyering  <meyering@ascend.com>
4951
4952         * src/remove.c (print_nth_dir): Write one fewer byte so we don't print
4953         a trailing slash.
4954         (rm): Fix bugs in (and test, this time) the very rarely used code
4955         to warn about directory cycles.
4956         Reported by michael@roka.net.
4957
4958 1999-11-11  Jim Meyering  <meyering@ascend.com>
4959
4960         * src/copy.c (copy_internal): Treat src and dest as the `same' in
4961         `mv src symlink-to-src' when src and dest are on different partitions.
4962         Otherwise, that `mv' command would silently remove `src'.
4963         Reported by Michael Stone.
4964         * tests/mv/into-self-2: Add a test for this fix.
4965
4966         * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others
4967         just like that also dated back to 1992 were fixed in 1998-01-02).
4968         Richard Braakman reported that using `install -d -g foo 1/2`
4969         only sets the group on the intermediate directory, not the final
4970         component.  From Michael Stone.
4971
4972 1999-11-07  Paul Eggert  <eggert@set.twinsun.com>
4973
4974         * human.c (default_block_size): New function.
4975         (humblock): Use it if no block size is specified.
4976         (human_block_size): If the specified block size is zero, report an
4977         error if report_errors is nonzero; otherwise use the default.
4978
4979 1999-11-07  Jim Meyering  <meyering@ascend.com>
4980
4981         * src/dircolors.hin: Add several more TERM types.
4982         Add .bz2 suffix.
4983         Add .png for real this time.
4984         Change the image types colors to be visible in a black-on-white xterm.
4985         From Michael Stone.
4986
4987         * src/chgrp.c (xstat): New global.
4988         (main): Define it.
4989         (change_file_group): Use it.  Before this change, when running chgrp
4990         on a symlink without --dereference (-h) and when the requested group
4991         is the same as the group for the *symlink*, chgrp would do nothing.
4992         Now it changes the group of the file referenced through the symlink.
4993         Reported by Martin Mitchell.
4994
4995         * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
4996         * src/chown.c: Define and use REFERENCE_FILE_OPTION and
4997         DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
4998         * src/chgrp.c: Likewise.
4999
5000         * tests/ln/misc: Add hard-link-to-symlink test.
5001         Move framework_failure test to the end.
5002         Fix a typo: s/||/&&/.
5003
5004         * src/ln.c (do_link): Warn that making a hard link to a symbolic link
5005         is not portable.
5006
5007         * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'.
5008         * tests/ln/backup-1: Likewise.
5009
5010         * configure.in (AC_OUTPUT): Add tests/rmdir/Makefile.
5011         * tests/Makefile.am (SUBDIRS): Add rmdir.
5012         * tests/rmdir: New directory
5013         * tests/rmdir/ignore: New file.
5014
5015         * src/rmdir.c (remove_parents): Use the correct test (just as in
5016         main) in handling --ignore-fail-on-non-empty.  From Michael Stone.
5017         (usage): Improve description of --parents.  Based on suggestion from
5018         Torsten Landschoff.
5019
5020 1999-11-06  Jim Meyering  <meyering@ascend.com>
5021
5022         Allow hard links to symlinks on systems that support it.
5023         * src/ln.c (STAT_LIKE_LINK): Define.
5024         (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
5025         the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
5026
5027         * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is
5028         accepted as the short form of --file-type, per the documentation.
5029         From James Sneeringer.
5030
5031         * src/ln.c (do_link): Fix typo (in which the function name `symlink'
5032         was tested instead of the variable `symbolic_link') that could make
5033         ln perform an unneeded `stat' call.
5034
5035 1999-11-05  Jim Meyering  <meyering@ascend.com>
5036
5037         * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated
5038         HAVE_ST_BLOCKS.
5039         * src/copy.c: Likewise.
5040         * lib/fileblocks.c: Likewise.
5041
5042         * configure.in: Move some type/header/member tests into
5043         m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
5044         fileutils, textutils, and sh-utils.
5045
5046 1999-11-02  Jim Meyering  <meyering@ascend.com>
5047
5048         * man/help2man: Import version 1.018.
5049         * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
5050         * man/*.x: Include one-line summary in [NAME] section.
5051         * man/Makefile.summ: Remove the one-line summaries.
5052         Suggestion for clean-up from Akim Demaille.
5053
5054         * configure.in (ALL_LINGUAS): Add Galician (gl).
5055
5056 1999-11-01  Jim Meyering  <meyering@ascend.com>
5057
5058         * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and
5059         other special files like /dev/zero.
5060
5061         * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
5062
5063 1999-10-31  Jim Meyering  <meyering@ascend.com>
5064
5065         * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around
5066         automake bug.
5067
5068         * doc/fileutils.texi: Document new --backup[=METHOD] option for
5069         cp, mv, ln, and install.
5070
5071         * src/ln.c: Convert --backup to take an optional argument.
5072         Deprecate --version-control (-V) in comments.
5073         (usage): Remove mention of --version-control.
5074         (main): Make -V warn then fall through into --backup case.
5075         [--backup case]: Handle optional arg.
5076         * src/install.c: Likewise.
5077
5078 1999-10-24  Jim Meyering  <meyering@ascend.com>
5079
5080         * src/cp.c (do_copy): Constify `dest', and cast-away the new
5081         const in assignment to new_dest.
5082
5083 1999-10-23  Jim Meyering  <meyering@ascend.com>
5084
5085         * tests/touch/Makefile.am (TESTS): Add dangling-symlink.
5086         * tests/touch/dangling-symlink: New file.
5087
5088 1999-10-23  Paul Eggert  <eggert@twinsun.com>
5089
5090         * src/touch.c (full_write): Remove unused decl.
5091         (open_maybe_create): Remove.
5092         (touch): Don't record whether the file was created; this isn't
5093         possible to do reliably and portably without race conditions.
5094         If the file was created and if amtime_now is nonzero, this
5095         change means we'll have to do another utime system call, but
5096         that's no more harmful than the previous version of this code.
5097         Reported by Gabor Z. Papp.
5098
5099 1999-10-21  Jim Meyering  <meyering@ascend.com>
5100
5101         * configure.in (ALL_LINGUAS): Add Japanese (pa).
5102
5103 1999-10-17  Jim Meyering  <meyering@ascend.com>
5104
5105         * tests/mv/backup-is-src: Remove use of mv's now-deprecated
5106         -V option.  Use --b=simple instead of -b -V simple.
5107
5108         * src/mv.c: Convert --backup to take an optional argument.
5109         Deprecate --version-control (-V) in comments.
5110         (usage): Remove mention of --version-control.
5111         (main): Make -V warn then fall through into --backup case.
5112         [--backup case]: Handle optional arg.
5113
5114         Accept new option: --target-directory=DIR
5115         * src/cp.c (TARGET_DIRECTORY_OPTION): Define.
5116         (SPARSE_OPTION): Define.
5117         (usage): Describe it.
5118         (do_copy): Change meanings/names of first two parameters: use `n_files'
5119         in place of `argc - optind', and `file' instead of `argv + optind'.
5120         Add parameter, target_directory.
5121         (main): Pass new arg, target_directory.
5122
5123 1999-10-16  Jim Meyering  <meyering@ascend.com>
5124
5125         * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option.
5126         Use --b=simple instead of -b -V simple.
5127         * tests/cp/backup-1: Replace use of cp's now-deprecated
5128         --version-control option with use of --backup=simple.
5129
5130         * src/cp.c: Convert --backup to take an optional argument.
5131         Deprecate --version-control (-V) in comments.
5132         (usage): Remove mention of --version-control.
5133         (main): Make -V warn then fall through into --backup case.
5134         [--backup case]: Handle optional arg.
5135
5136         * tests/cp/Makefile.am (TESTS): Add cp-mv-backup.
5137         * tests/cp/cp-mv-backup: New file.
5138
5139 1999-10-11  Jim Meyering  <meyering@ascend.com>
5140
5141         * lib/getopt.c: Merge changes from latest glibc.
5142         * lib/getopt.h: Likewise.
5143         * lib/getopt1.c: Likewise.
5144
5145 1999-10-09  Jim Meyering  <meyering@ascend.com>
5146
5147         Accept new option: --target-directory=DIR
5148         * src/ln.c (TARGET_DIRECTORY_OPTION): Define.
5149         (usage): Describe it.
5150         (main): Implement it.
5151         Make code clearer:  use new variable `n_files' in place of
5152         `argc - optind'.  Use `file' instead of `argv + optind'.
5153
5154 1999-10-04  Jim Meyering  <meyering@ascend.com>
5155
5156         * depcomp: New file, for automake's new dependency support.
5157         * missing: New version, from automake's user-dep-gen-branch.
5158
5159         * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too.
5160         * src/sys2.h (__attribute__): Likewise.
5161         Wrap with #ifndef __attribute__.
5162
5163 1999-10-03  Paul Eggert  <eggert@twinsun.com>
5164
5165         * getdate.y (__attribute__): Define to empty if GCC claims to
5166         be before 2.8; this is needed for OPENStep 4.2 cc.  Also,
5167         define to empty if strict ANSI.
5168
5169 1999-10-03  Jim Meyering  <meyering@ascend.com>
5170
5171         Accept new option: --target-directory=DIR
5172         * src/mv.c (TARGET_DIRECTORY_OPTION): Define.
5173         (usage): Describe it.
5174         (main): Implement it.
5175         Remove unused variable, stdin_tty.
5176         Make code clearer:  use new variable `n_files' in place of
5177         `argc - optind'.  Use `file' instead of `argv + optind'.
5178
5179 1999-09-28  Jim Meyering  <meyering@ascend.com>
5180
5181         * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
5182         Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
5183         * src/sys2.h: Likewise.
5184
5185         * lib/xalloc.h (__attribute__): Protect against redefinition.
5186         From Akim Demaille.
5187
5188 1999-09-26  Jim Meyering  <meyering@ascend.com>
5189
5190         * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and
5191         update callers.
5192         Use explicit exit to help avoid warnings.
5193         From Akim Demaille.
5194
5195         * lib/path-concat.c (DIRECTORY_SEPARATOR): Define.
5196         (ISSLASH): Define.
5197         (path_concat): Allow parameter DIR to be NULL.
5198         (xpath_concat): New function.
5199         From Akim Demaille.
5200
5201         * lib/xalloc.h (__attribute__): Define.
5202         (ATTRIBUTE_NORETURN): Define.
5203         (xalloc_die): Declare.
5204         (NEW): Define as yet unused macro.
5205         (XFREE): Likewise
5206         (CCLONE): Likewise.
5207         (CLONE): Likewise.
5208         From Akim Demaille.
5209
5210         * lib/basename.c (base_name): Add prototype.  From Akim Demaille.
5211
5212 1999-09-19  Jim Meyering  <meyering@ascend.com>
5213
5214         * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
5215         (S_ISLNK): Define if necessary.
5216         This is necessary on a NEC SX-4 with SUPER-UX 9.1.
5217         Based on a patch from Holger Berger.
5218
5219         * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
5220         Change many counter and index variables to be of unsigned type.
5221         (dd_copy): Add new unsigned variable, n_bytes_read, in place of
5222         many uses of `nread'.
5223
5224         * src/sys2.h (__attribute__): Define.
5225         (ATTRIBUTE_NORETURN): Remove #else clause.
5226         (ATTRIBUTE_UNUSED): Define.
5227
5228 1999-09-17  Jim Meyering  <meyering@ascend.com>
5229
5230         * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this
5231         is done in m4/jm-macros.m4.
5232
5233 1999-09-09  Jim Meyering  <meyering@ascend.com>
5234
5235         * src/touch.c (usage): Remove misleading sentence in --help output.
5236         From Karl Heuer.
5237
5238         * src/Makefile.am (EXTRAdir): Remove unused variable.
5239
5240 1999-09-03  Paul Eggert  <eggert@twinsun.com>
5241
5242         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
5243         Use EINVAL instead.
5244
5245 1999-09-01  Jim Meyering  <meyering@ascend.com>
5246
5247         * src/cp.c: Remove declaration of xstrdup.
5248         * src/df.c: Likewise.
5249         * src/ls.c: Likewise.
5250
5251 1999-09-01  Akim Demaille  <akim@epita.fr>
5252
5253         * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'.
5254         * lib/xalloc.h (xalloc_fail_func): Likewise.
5255         (xstrdup): Add protoype.
5256
5257         * lib/version-etc.c (version_etc_copyright): Default copyright string.
5258         (version_etc): Use it.
5259         * lib/version-etc.h: Declare it.
5260
5261 1999-08-29  Jim Meyering  <meyering@ascend.com>
5262
5263         * configure.in (AC_YACC): Remove use, now that we require bison.
5264
5265         * src/dircolors.hin: Add .rpm, .png, and .fli.
5266         From Andres Soolo.
5267
5268 1999-08-28  Paul Eggert  <eggert@twinsun.com>
5269
5270         * getdate.y: Add copyright notice.
5271
5272         (number): Handle `Nov 11 1996' example; see Risks Digest 20.55
5273         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
5274         (1999-08-27)
5275
5276         (<stdio.h>): Include only if testing.
5277         (ISUPPER): Remove.
5278         (ISLOWER, PC): New macros.
5279         (<string.h>): Include if HAVE_STRING_H, not USG.
5280         (bcopy): Remove.
5281         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
5282         bison.
5283         (EPOCH_YEAR): Renamed from EPOCH.
5284         (table): Renamed from TABLE.
5285         (meridian): Now an anonymous enum.
5286         (struct parser_control): New type.
5287         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
5288         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
5289         (%pure_parser): Added, so that the parser is pure.
5290         (%union): Removed; the type is now just plain int.
5291         All %type directives removed.
5292         (tLOCAL_ZONE): New %token.
5293         (month_day_table): Renamed from MonthDayTable.
5294         (gmtime, localtime, mktime, time): Declare only if not defined.
5295         (meridian_table): New table.
5296         (dst_table): New table.
5297         (units_table): renamed from UnitsTable.
5298         (relative_time_table): Renamed from OtherTable.
5299         (time_zone_table): Renamed from TimezoneTable.  Modernized data.
5300         (military_table): Renamed from MilitaryTable.
5301         (to_hour): Renamed from ToHour.
5302         (to_year): Renamed from ToYear.
5303         (lookup_zone): New function.
5304         (LookupWord): Renamed from lookup_word.
5305         Use lookup_zone for time zones.
5306         (yylex): Now reentrant.  All callers changed.
5307         (get_date): Add support for local time zone abbreviations.
5308         Make it reentrant.
5309
5310 1999-08-22  Jim Meyering  <meyering@ascend.com>
5311
5312         * src/sys2.h (IF_LINT): Define new macro.
5313         * src/df.c (main): Rename locals i and j.
5314         Use IF_LINT macro instead of #ifdef lint...
5315
5316         * src/dd.c (parse_integer): Add `const' to char* parameter and
5317         add a separate `suffix' variable.
5318
5319 1999-08-20  Jim Meyering  <meyering@ascend.com>
5320
5321         * src/chown.c (usage): Tweak --help output to make it more consistent
5322         with that of chgrp.
5323         * src/chgrp.c (usage): Tweak --help output to make it more consistent
5324         with that of chown.
5325
5326 1999-08-17  Jim Meyering  <meyering@ascend.com>
5327
5328         * configure.in: Remove check for rename and the code that would
5329         enable building of the `mvdir' program.
5330         * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@.
5331         (EXTRA_PROGRAMS): Remove obsolete mvdir.
5332         * lib/rename.c: Remove obsolete file. (it had a bug, too)
5333         * src/mvdir.c: Remove obsolete file.
5334         * po/POTFILES.in: Remove mvdir.c
5335
5336         * doc/fileutils.texi (chown, chgrp invocation): Make these sections
5337         consistent with each other.
5338
5339 1999-08-16  Jim Meyering  <meyering@ascend.com>
5340
5341         * src/chown.c (groupname): Declare to be `const'.
5342         (change_dir_owner): Declare statp parameter to be `const'.
5343         (usage): Make the output be more consistent with that from chgrp.
5344
5345         This change is nearly identical to the chown.c change of 1998-05-24
5346         * src/chgrp.c: Accept new option, --dereference.
5347         --no-dereference is now the default. Include lchown.h.
5348         (enum Change_status) [CH_NOT_APPLIED]: New member.
5349         (change_symlinks): Enable this by default, now.
5350         (describe_change): Handle new case.
5351         (change_file_group): Add new parameter: cmdline_arg.  Update callers.
5352         Reorganize to reflect changed semantics.
5353         (LCHOWN): Remove definitions.
5354         From Bruno Haible.
5355
5356 1999-08-10  Jim Meyering  <meyering@ascend.com>
5357
5358         * po/POTFILES.in: Add lib/quotearg.c.
5359
5360 1999-08-09  Paul Eggert  <eggert@twinsun.com>
5361
5362         * NEWS, doc/fileutils.texi, src/ls.c (usage):
5363         Add ls --quoting-style=locale.
5364
5365         * lib/argmatch.c (ARGMATCH_QUOTING_STYLE):
5366         Change from escape_quoting_style to locale_quoting_style.
5367         (argmatch_invalid): Use new quotearg_style primitive for simplicity.
5368         Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
5369
5370         * lib/quotearg.h (locale_quoting_style): New enum value.
5371         (quotearg_n_style, quotearg_style): New decls.
5372
5373         * lib/quotearg.c: Include <libintl.h> if ENABLE_NLS.
5374         (_): New macro.
5375         (quoting_style_args, quoting_style_v, quotearg_buffer): Add support
5376         for locale_quoting_style, using _("`") and _("'") for open and close
5377         quote symbols.
5378         Do not quote spaces in escape_quoting_style.
5379         (quotearg_n_style, quotearg_style): New functions.
5380
5381 1999-08-08  Jim Meyering  <meyering@ascend.com>
5382
5383         * src/touch.c (usage): Clarify description of --time=WORD.
5384         From Karl Berry.
5385
5386         * lib/savedir.c (savedir): Change type of name_size parameter to off_t.
5387         * lib/savedir.h (savedir): Update prototype.
5388         * src/chmod.c (change_dir_mode): Remove cast of savedir arg.
5389         * src/chown.c (change_dir_owner): Likewise.
5390         * src/chgrp.c (change_dir_group): Likewise.
5391         * src/copy.c (copy_dir): Likewise.
5392         * src/du.c (count_entry): Likewise.
5393         Suggestion from Bob Proulx.
5394
5395 1999-08-07  Jim Meyering  <meyering@ascend.com>
5396
5397         * po/POTFILES.in: Add lots of lib/*.c files.
5398         Remove src/cp-hash.c, since it doesn't use _().
5399
5400 1999-08-04  Jim Meyering  <meyering@ascend.com>
5401
5402         * configure.in: Remove getline-testing code.  Now it's in m4/.
5403
5404 1999-08-01  Paul Eggert  <eggert@twinsun.com>
5405
5406         * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
5407
5408 1999-07-30  Jim Meyering  <meyering@ascend.com>
5409
5410         * src/ls.c (usage): Explain about default wrt --hide-control-chars and
5411         --show-control-chars.  Reported by Germano Leichsenring.
5412
5413 1999-07-28  Jim Meyering  <meyering@ascend.com>
5414
5415         * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
5416
5417 1999-07-24  Jim Meyering  <meyering@ascend.com>
5418
5419         * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
5420         (dd_copy): Use those to page-align both the input and output buffers.
5421
5422 1999-06-01  Volker Borchert  <bt@teknon.de>
5423
5424         * tests/Makefile.am: Make envvar-check depend on check-recursive rather
5425         than on `check' so that its tests are performed before any real tests.
5426
5427 1999-07-15  Jim Meyering  <meyering@ascend.com>
5428
5429         * src/dd.c: Include getpagesize.h.
5430         (dd_copy): Page-align the input buffer.
5431         Based on a patch from Scott Lurndal.
5432
5433         * getpagesize.h: New file.
5434         * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h.
5435
5436         * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
5437         Work around SunOS botch also when block size is different from 1k.
5438         From Jürgen Fluk.
5439
5440 1999-07-10  Jim Meyering  <meyering@ascend.com>
5441
5442         * man/help2man: Import version 1.012.
5443
5444 1999-07-04  Jim Meyering  <meyering@ascend.com>
5445
5446         * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax.
5447
5448 1999-07-04  Paul Eggert  <eggert@twinsun.com>
5449
5450         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
5451         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
5452         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
5453         the above decl.
5454
5455 1999-06-27  Paul Eggert  <eggert@twinsun.com>
5456
5457         Fix some incompatibilities between `df -P' and POSIX.2.
5458
5459         * lib/human.h (enum human_inexact_style): New enum.
5460         (human_readable_inexact): New decl.
5461
5462         * lib/human.c (human_readable): New function.
5463         (human_readable_inexact): Renamed from human_readable, with new arg
5464         INEXACT_STYLE.  Add support for ceiling and floor.
5465
5466         * src/df.c (print_header): Conform to POSIX if posix_format).
5467         (df_readable): Take ceiling if posix_format.
5468         (ceil_percent): New function.
5469         (show_dev): Take ceiling of percent if posix_format.
5470         Align with POSIX-conforming header if posix_format.
5471
5472         * doc/fileutils.texi: Document these changes.
5473
5474 1999-05-27  Volker Borchert  <bt@teknon.de>
5475
5476         * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
5477
5478 1999-05-23  Jim Meyering  <meyering@ascend.com>
5479
5480         * src/copy.c (copy_internal): Don't apply the umask in move_mode.
5481         Otherwise, `mv' would not preserve the permissions when copying
5482         between partitions.  Reported by David Godfrey
5483
5484         * Version 4.0i.
5485
5486         * tests/cp/same-file: Correct erroneous expected output from
5487         the `cp -f foo foo' tests.
5488         * po/POTFILES.in: Add same.c.
5489         * lib/same.h: New file.
5490         * lib/same.c: New file (function extracted from ln.c).
5491         * lib/Makefile.am (libfu_a_SOURCES): Add same.c.
5492         (noinst_HEADERS): Add same.h.
5493         * src/copy.c: Include same.h.
5494         * src/ln.c (same_name): Remove function.
5495         <same.h>: Include this instead.
5496         <dirname.h>: No longer include this.
5497         * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'.
5498
5499         * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not
5500         remove FILE.  Suggestion from Chris Yeo.
5501         * tests/mv/force: New test, for the above fix.
5502         * tests/mv/Makefile.am (TESTS): Add force.
5503         (TESTS_ENVIRONMENT): Change PATH to be absolute.
5504
5505         * tests/mv/force (mv): New test.
5506
5507 1999-05-17  Paul Eggert  <eggert@twinsun.com>
5508
5509         * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we
5510         have an absolute timestamp, or if the relative timestamp
5511         mentions days, months, or years.  Reported by Volker Borchert.
5512
5513         * lib/human.c (human_readable): Allow from_block_size to be zero.
5514
5515 1999-05-14  Jim Meyering  <meyering@ascend.com>
5516
5517         * tests/Makefile.am (envvar-check): Renamed from check-local.
5518         (check): Depend on envvar-check so the envvar check is performed
5519         before all other tests.  Reported by Volker Borchert.
5520         * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
5521         so CDPATH is mentioned in the message.  Reported by Volker Borchert.
5522
5523         * src/df.c (main): When asking for info on an explicit file name,
5524         just warn rather than failing if the table of mounted filesystems
5525         cannot be read.  Based on a patch from Mark Kettenis.
5526
5527         * lib/version-etc.c (version_etc): Put version info and author names
5528         on the first two lines respectively rather than putting the three
5529         lines of copyright info between them.
5530
5531         * src/touch.c (open_maybe_create): Handle Solaris' failure mode when
5532         FILE is a directory.  Reported by Vin Shelton.
5533
5534         * lib/human.c: Include <string.h> or <strings.h> for strlen prototype.
5535         * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes.
5536         * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on
5537         64-bit systems.  From Ulrich Drepper.
5538
5539 1999-05-12  Jim Meyering  <meyering@ascend.com>
5540
5541         * src/shred.c (main): Put `u' for -u in getopt_long's string argument.
5542         Remove the `R'.
5543
5544 1999-05-07  Jim Meyering  <meyering@ascend.com>
5545
5546         * Version 4.0h.
5547
5548         * tests/touch/dir-1: New test.
5549         * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual
5550         upper-case program names.  Add a definition of PATH.
5551         (TESTS): Add dir-1.
5552
5553         * src/mkdir.c (main): Use better wording in diagnostic: `cannot
5554         create directory' rather than `cannot make directory'.  The former
5555         also matches the one in makepath.c.
5556
5557         * src/dd.c (apply_translations): Use TOUPPER and TOLOWER,
5558         not toupper and tolower.
5559
5560 1999-05-05  Jim Meyering  <meyering@ascend.com>
5561
5562         * lib/makepath.c (make_dir): When reporting a mkdir failure and the
5563         target cannot be `stat'ed, use the errno from the failed mkdir call,
5564         not the one from the stat call.  Before this change, running
5565         `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
5566         elicit `No such file or directory' instead of `Permission denied'.
5567
5568         * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
5569         (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
5570         Based on a patch from Kaveh Ghazi.
5571
5572         * src/ls.c (USE_ACL): Define this only #if
5573         (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
5574         Use `USE_ACL' in place of `HAVE_ACL' everywhere else.  From Kaveh Ghazi.
5575
5576 1999-05-04  Jim Meyering  <meyering@ascend.com>
5577
5578         * lib/makepath.c: Include makepath.h libintl.h, not after it.
5579         Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
5580         (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
5581         which is necessary on Irix4 since cc doesn't define __STDC__.)
5582         From Kaveh Ghazi.
5583
5584 1999-04-30  Jim Meyering  <meyering@ascend.com>
5585
5586         * Makefile.maint: Define several tag-related make variables.
5587         (cvs-dist): Use the make variables instead of shell ones.
5588         (announcement): Automatically generate diffs for all ChangeLog files,
5589         not just the top level one.
5590
5591 1999-04-30  Paul Eggert  <eggert@twinsun.com>
5592
5593         * lib/dup2.c: New file.
5594
5595 1999-04-30  Jim Meyering  <meyering@ascend.com>
5596
5597         * src/touch.c (touch): Only do the fstat if we need to.
5598         Resort to calling stat for directories, but only when necessary.
5599         (usage): Mention --no-create.
5600
5601         * src/copy.c (copy_internal): Move the one-file-system test so that
5602         it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
5603         Prior to this change, `cp --one-file-system' would traverse a file-
5604         system boundary if the destination directory existed.  From Ton Hospel.
5605
5606 1999-04-27  Paul Eggert  <eggert@twinsun.com>
5607
5608         * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO
5609         for output, to avoid confusion with closed input and output fds.
5610         (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
5611         and STDOUT_FILENO.
5612         (open_fd): New function.
5613         (main): Use it, instead of open, to ensure that file descriptors
5614         don't get confused.
5615
5616 1999-04-26  Paul Eggert  <eggert@twinsun.com>
5617
5618         * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead
5619         of 0, 1.
5620
5621         * src/dd.c (skip): Don't fstat the input file; the result is
5622         no longer used.
5623
5624 1999-04-26  Jim Meyering  <meyering@ascend.com>
5625
5626         * tests/mv/into-self-2: Update to reflect this change by reversing
5627         the order of arguments so the symlink is the source, not the
5628         destination (otherwise, the mv command would now succeed).
5629
5630         * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail.
5631         That is, even though source and destination are `the same,' don't fail
5632         if the destination is a symlink.  From Peter Samuelson.
5633
5634 1999-04-26  Paul Eggert  <eggert@twinsun.com>
5635
5636         * src/dd.c (main): If you can't open an output file (with
5637         seek=...) read-write, then open it for write and report an
5638         error if we can't seek.
5639
5640         * lib/filemode.c (setst, ftypelet, mode_string):
5641         * lib/mkdir.c (mkdir):
5642         * lib/makepath.c (make_path):
5643         * lib/modechange.c (make_node_op_equals, mode_compile,
5644           mode_create_from_ref, mode_adjust):
5645         * lib/modechange.h (mode_adjust):
5646         * src/chmod.c (describe_change, change_file_mode):
5647         * src/copy.c (copy_reg, copy_internal):
5648         * src/copy.h (struct cp_options.umask_kill):
5649         * src/cp.c (do_copy, cp_option_init, main):
5650         * src/dd.c (main):
5651         * src/install.c (mode, cp_option_init, DIR_MODE):
5652         * src/mkdir.c (main):
5653         * src/mkfifo.c (main):
5654         * src/mknod.c (main):
5655         * src/mv.c (cp_option_init):
5656         * src/touch.c (open_maybe_create):
5657         Use proper mode_t types and macros.
5658         Don't assume the traditional Unix values for mode bits.
5659
5660         * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH,
5661         S_IXOTH): Define if not defined.
5662         (rwx): Remove.
5663         * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
5664         * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU):
5665         Define if not defined.
5666         * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
5667         Define if not defined.
5668         (CHMOD_MODE_BITS): New macro.
5669         * src/install.c (isodigit): Remove unused macro.
5670
5671         * src/mkfifo.c, src/mknod.c (usage):
5672         Use symbolic mode as default, not octal.
5673
5674         * lib/utime.c (utime_null):
5675         Don't pass 0666 to open; it's not needed and isn't
5676         guaranteed to be portable.
5677
5678         * lib/filemode.h: <config.h>, <sys/types.h>: Include for mode_t.
5679         (mode_string): Now takes mode_t.
5680
5681         * lib/modechange.h: Include <config.h>, <sys/types.h> for mode_t.
5682         (struct mode_change): Members affected and value are now mode_t instead
5683         of unsigned short.
5684
5685         * doc/fileutils.texi, doc/perm.texi:
5686         Don't assume traditional Unix mode numbering.
5687
5688         * lib/modechange.c: modechange.h now includes sys/types.h.
5689         Include xstrtol.h.
5690         (isodigit, oatoi): Remove.
5691         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
5692         S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
5693         S_IRWXO): Define if not defined.
5694         (CHMOD_MODE_BITS): New macro.
5695         (mode_compile): Convert from octal with xstrtoul, not our own routine.
5696
5697 1999-04-24  Jim Meyering  <meyering@ascend.com>
5698
5699         * Version 4.0g.
5700
5701 1999-04-22  Jim Meyering  <meyering@ascend.com>
5702
5703         * src/shred.c (word32): Don't use `#error'; it runs afoul of
5704         SunOS 4.1.4 cc.  From Paul Eggert.
5705
5706         * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
5707
5708 1999-04-20  Paul Eggert  <eggert@twinsun.com>
5709
5710         Replace our temporary hack implementation of strtoumax with
5711         something very close to the real code in glibc.
5712
5713         * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
5714         we now have a true replacement in strtoumax.c.
5715         (__strtol): Always define to strtoumax.
5716         (<stdlib.h>): No need to include.
5717         (PARAMS): Remove.
5718         (my_strtoumax): Move this to strtoumax.c,
5719         rename it to strtoumax, and simplify.
5720
5721         * lib/strtoull.c, lib/strtoumax.c: New files.
5722
5723         * lib/strtol.c: Update to glibc 2.1.1 version.
5724
5725 1999-04-20  Jim Meyering  <meyering@ascend.com>
5726
5727         * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
5728         (check-local): Also test and warn if CDPATH is set.
5729
5730 1999-04-20  Paul Eggert  <eggert@twinsun.com>
5731
5732         * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
5733         cross-compilation.
5734         * config.guess: New file (from autoconf).
5735         * config.sub: New file (from autoconf).
5736
5737         * src/shred.c <config.h>: Include first, since it can do
5738         things like #define const, and this must be done before
5739         including any system headers.
5740
5741         * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
5742         whether overflow occurred.  Improve overflow-detection to use
5743         only one conditional branch total, rather than 2N+1
5744         conditional branches for an N-digit number.
5745
5746 1999-04-18  Jim Meyering  <meyering@ascend.com>
5747
5748         * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
5749         strtouq, now that they're checked in m4/xstrtoumax.m4.
5750
5751 1999-04-18  Paul Eggert  <eggert@twinsun.com>
5752
5753         * doc/fileutils.texi, src/shred.c (main, longopts):
5754         Use -u instead of -R for --remove, so that we can preserve
5755         future compatibility with rm.
5756
5757 1999-04-18  Jim Meyering  <meyering@ascend.com>
5758
5759         * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
5760         (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
5761         member directly.
5762
5763 1999-04-18  Paul Eggert  <eggert@twinsun.com>
5764
5765         Fix shred to do the right thing with off_t longer than long.
5766         Merge large-integer parsing code with similar code in dd.c,
5767         and put the resulting in lib/xstrtoumax.c so that other programs
5768         can use it.  Instead of adding a new lib/xstrtoumax.h I thought
5769         it cleaner to put all the xstroto* declarations into a single
5770         header, which for now is lib/xstrtol.h for lack of a better place.
5771         (Mayby lib/xstdlib.h would be better?  :-)
5772
5773         I thought of several other problems with shredding regular files;
5774         shredding devices is much more reliable.  So I changed the defaults
5775         to be more suitable for shredding devices; this should help encourage
5776         users to do the right thing.
5777
5778         pfstatus isn't portable to environments with varying width
5779         fonts, or with internationalized environments where the byte
5780         count of the message is not the same as its print width.
5781         Rather than deal with this, I just simplified it to not do
5782         tricks with carriage-returns and spaces.  (I'm also worried
5783         that vprintf may not return the right value on some hosts; I
5784         vaguelly recall this being a problem.)  As a result, -v and -
5785         no longer conflict.
5786
5787         When removing a special file, try to truncate it first, but don't
5788         worry if this reports an error.
5789
5790         Try to find the size of a non-regular file by seeking to its end.
5791
5792         Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
5793
5794         Some other minor bug fixes.
5795
5796         * lib/xstrtoul.h: Remove this file.
5797         * lib/xstrtoumax.c: New file.
5798
5799         * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
5800
5801         * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
5802         (__strtol, __strtol_t, __xstrtol): New macros.
5803
5804         * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
5805         New macros to specify the
5806         underlying function, its returned type, and our function.  Default to
5807         values suitable for xstrtol.
5808
5809         Include <ctype.h>, since we use its macros.
5810
5811         (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
5812         (ISSPACE): New macro.
5813
5814         (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
5815         -> __strtol_t.
5816
5817         (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
5818         whether STRING_TO_UNSIGNED is defined.  Skip isspace chars, not
5819         isblank chars, to match strtol.  When returning
5820         LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
5821         *val.
5822
5823         * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
5824         <inttypes.h>: Include if HAVE_INTTYPES_H.
5825         (_DECLARE_XSTRTOL): New macro.
5826         (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
5827         we need only one include file, not three.
5828         (_STRTOL_ERROR): Do not undef, as this is no longer needed.
5829         Reword overflow message so that it's independent of type.
5830
5831         * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
5832         (noinst_HEADERS): Remove xstrtoul.h.
5833
5834         * lib/xmalloc.c (xalloc_fail):
5835         Pass xalloc_msg_memory_exhausted through gettext.
5836
5837         * lib/getdate.y:
5838         <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
5839         (LookupWord, yylex): Don't pass negative char to ctype macros.
5840
5841         * doc/fileutils.texi:
5842         Explain why shredding devices is more reliable, and why the
5843         default options are more suitable for devices.
5844
5845         Remove withdrawn options -b or --no-contents, -c or --freed-contents,
5846         -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
5847         --all-links.
5848
5849         Add -R or --remove, -s or --size.
5850
5851         -v can no longer be doubled.
5852
5853         `file system' --> `filesystem' uniformly.
5854
5855         * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
5856
5857         * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
5858         "human.h", "xalloc.h": Include.
5859         (attribute): Remove; no longer needed.
5860         (xstrdup): New decl.
5861         (STDOUT_FILENO): New macro.
5862         (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
5863
5864         The following changes have effect only if !HAVE_CONFIG_H.
5865         <ctype.h>: New include.
5866         (RETSIGTYPE): Remove bogus semicolon at end.
5867         (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
5868         New macros.
5869         (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
5870         Handle suffixes like the real routine does.
5871         (error): Remove bogus assignment of errno to errnum.
5872         (xmalloc, xstrdup): New functions.
5873
5874         (O_NOCTTY): Define even if !HAVE_CONFIG_H.
5875         (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
5876         (OUTPUT_BLOCK_SIZE): New macro.
5877         (struct Options.verbose): Now a boolean, since we no longer have two
5878         levels of verbosity.
5879         (long_opts, usage, main): Remove -D or --device option.  Invert -p or
5880         --preserve option, and rename it to -R or --remove.
5881         (usage): Describe G suffix.
5882         (usage): "-" no longer conflicts with -v.
5883         (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
5884         (ind): Portability fixes: return word32, not unsigned; multiply by
5885         sizeof (word32) instead of shifting left by 2.
5886         (isaac_refill, isaac_mix): Comment out size of array parameter, as
5887         ansi2knr mishandles this.
5888         (status_visible, status_pos, pfstatus, flushstatus): Remove, since
5889         pfstatus isn't portable to users with varying width fonts, or
5890         internationalized messages, and vfprintf is problematic.  All callers
5891         of pfstatus changed to use error instead; this removes incompatibility
5892         of -v with -.  All calls to flushstatus removed.
5893         (dopass, do_wipefd): Do not translate non-English msgs with gettext.
5894
5895         (dopass): Cast lseek constant arguments to (off_t) for benefit
5896         of pre-ANSI compilers; fix one lseek call whose args were interchanged.
5897         Remove unnecessary casts to (off_t).  Do not check for EIO
5898         when determining file size; this was just my earlier wild guess.
5899         Use human_readable to print off_t, instead of casting to unsigned long
5900         (which doesn't work in Solaris 2.6, where off_t is longer than long).
5901         Output human-readable sizes, instead of always using "K".
5902         Check for offset overflow (it happened to me in SunOS 4.1.4).
5903         (do_wipefd): Do not insist on regular files, but do check for special
5904         files that cannot possibly be shredded.
5905         Use xmalloc instead of malloc + check.
5906         Do not inspect st_size for non-regular files.
5907         Try to find the size of a non-regular file by seeking to its end.
5908         Do not assume that a regular file of size-0 has unknown size.
5909         Check for regular files with negative sizes,
5910         and for overflow after rounding to next block.
5911         Always try to truncate, even for special files, but do not report an
5912         error if truncation fails on a special file.
5913
5914         (dopass, wipefile): Do not return 1 for special files; the caller
5915         doesn't care any more.
5916
5917         (wipefd): Remove unnecessary (and nonportable) check for
5918         whether the file descriptor is read-only.  Remove
5919         no-longer-needed check for `-v -'.
5920
5921         (incname): Return 1 for carry bit, like the documentation says.
5922
5923         (wipename, wipefile): Accept new argument, specifying the
5924         quoted file name.  All callers changed.
5925
5926         (wipename): Use xstrdup instead of strdup+error check.
5927
5928         (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
5929         errors in NNN more carefully. Restore errno after the check.
5930         Check for errors when closing the file descriptor.
5931         Use more consistent wording when unable to remove a file.
5932
5933         (main): Do not remove files by default.
5934         Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
5935         exist if !HAVE_CONFIG_H.
5936         In diagnostics, quote invalid operands to -n and -s options.
5937         Allow T, P, E, Z, and Y suffixes in -s operand.
5938         flags.verbose is now a boolean, not a counter.
5939         Use STDOUT_FILENO instead of 1, for clarity.
5940
5941         * lib/human.c:
5942         Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
5943         xstrto... functions.
5944
5945         * src/dd.c: Include xstrtol.h.
5946         (parse_integer): Migrate most of the work into the new xstrtoumax fn.
5947
5948         * lib/xstrtoumax.c: New file.
5949
5950 1999-04-18  Jim Meyering  <meyering@ascend.com>
5951
5952         * src/dd.c (main): Open the output file with *read* access
5953         only if we might need to read to satisfy a `seek=' request.
5954         From Matthias Urlichs.
5955
5956 1999-04-10  Jim Meyering  <meyering@ascend.com>
5957
5958         * Makefile.maint (alpha): Add trailing slash for ncftp.
5959
5960         * Version 4.0f.
5961
5962         * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
5963         * tests/Makefile.am (SUBDIRS): Add dd.
5964         * tests/dd: New directory
5965         * tests/dd/misc: New file.
5966
5967         `ls --color' would segfault
5968         * src/ls.c: Include assert.h.
5969         (color_indicator[]): Add an entry for the type, `door.'
5970         (main): Assert that the lengths of the color_indicator and
5971         indicator_name arrays are appropriately related.
5972         Reported by John Gotts.
5973
5974         * src/dd.c (scanargs): Fix bug introduced with last change: now that
5975         the loop is gone, manually decrement argc and increment argv.
5976         Reported by Andreas Jaeger and jvogel@linkny.com.
5977
5978 1999-04-07  Jim Meyering  <meyering@ascend.com>
5979
5980         * lib/getdate.y (difftm): Protoize.
5981
5982 1999-04-06  Jim Meyering  <meyering@ascend.com>
5983
5984         * lib/strftime.c: Update from master source in libc.
5985
5986 1999-04-04  Jim Meyering  <meyering@ascend.com>
5987
5988         * tests/ln/misc: Comment out the test added on 1999-01-31.
5989
5990         * Makefile.maint (url_dir_list): Define properly.
5991         (real_dir_list): Likewise.
5992
5993         * src/shred.c: Don't include string.h.
5994         [!HAVE_CONFIG_H]: Include string.h here.
5995         [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
5996         (sigill_handler): Change return type and type of local `oldhandler' to
5997         RETSIGTYPE.
5998         (isaac_seed_machdep): Change and type of local `oldhandler' to
5999         RETSIGTYPE.
6000         From Colin Plumb.
6001
6002         * Version 4.0e
6003
6004         * tests/cp/same-file: Change the sed command used to extract the
6005         filename from ls -l output, to accommodate the change in format.
6006
6007         * src/ls.c (print_long_format): Add a space between %s and %3u.  This
6008         assures that even when modebuf has the trailing `+' and there are more
6009         than 99 hard links to a file, the permissions string and the link count
6010         will be separated.
6011
6012 1999-04-03  Jim Meyering  <meyering@ascend.com>
6013
6014         * src/shred.c (dopass): add curly braces to avoid warning about
6015         ambiguous `else'.
6016         (wipefd): Add parentheses suggested by gcc.
6017         (do_wipefd): Remove declaration of unused local.
6018
6019 1999-04-02  Colin Plumb  <colin@nyx.net>
6020
6021         * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
6022         to allow standalone compilation.
6023
6024         (wipefile): Added support for emulating /dev/fd/# files even if
6025         the OS doesn't support them.  From Paul Eggert.
6026
6027         (main, usage): Changed --device short option to -D.
6028
6029         (wipefd, do_wipefd): Renamed function to do_wipefd and added
6030         separate wipefd that performs sanity checks on externally-opened file
6031         descriptors, such as not append-only.  From Paul Eggert.
6032
6033         (do_wipefd, isaac_seedfd): Do not read file for any reason.
6034         if the file is low-entropy, it's a security hole.
6035         (wipefile) Changed to open O_WRONLY and chmod to write-only when
6036         forcing.
6037         (isaac_seedfd) Function deleted as unnecessary.
6038         From Paul Eggert.
6039
6040         (dopass): Dynamically fall back to fsync() if fdatasync() fails,
6041         since POSIX, in their infinitesimal wisdom, encourage implementations
6042         that return constant -1, making compile-time testing useless.
6043         From Paul Eggert.
6044
6045         (dopass): Changed to support a size of -1 to mean "unknown".
6046         This entailed changing to a counting-up offset rather than couting-down
6047         cursize for the central state variable.  Also changed size argument to
6048         be call-by-reference so that it can be passed back once known.
6049         (sizer) Function deleted as unnecessary.
6050         (wipefd): Changed to match.  From Paul Eggert
6051
6052         (dopass): Try to skip over bad blocks in destination files.
6053         Also added ftruncate() for more complete destruction of metadata.
6054
6055         (main, usage): Changed "-" to stand for standard output.
6056         (wipefd): Added error message to detect conflict with -v.
6057
6058         (dopass): Added periodic fsync() calls to keep the pass progress
6059         display in sync with reality.  Hopefully they're sufficiently far spaced
6060         that throughput isn't affected.  It might be a good thing to do even in
6061         non-verbose mode, to avoid filling up the kernel caches with dirty data.
6062         Also added ftruncate() for more complete destruction of metadata.
6063
6064         (quotearg_colon): New function to print
6065         pathological filenames properly.
6066         [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
6067         that does most of the work.
6068         (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
6069         (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
6070         Error messages are also in a more uniform format.
6071         From Paul Eggert.
6072
6073         (struct Options, main, do_wipefd): Added -s/--size=N flag.
6074         (xstrtoul): Added support for valid_suffixes to help this.
6075         (usage) Documented it.
6076
6077         (error): Changed some arguments from N_() to _(), since error()
6078         does not translate its argument.  I think this is a bug.
6079
6080         (struct Options do_wipefd, wipefd, wipefile, main): moved passes
6081         argument into the Options structure as n_iterations, which is now a
6082         size_t.  From Paul Eggert.
6083
6084         (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
6085         to manage seeding of RNG with arbitrary-sized data.
6086         (isaac_init): commented out as dead code.
6087         (isaac_seed): changed to use new functions to prevent any possibility of
6088         a buffer overflow.
6089
6090         (isaac_seed): Added support for Solaris' gethrtime()
6091         configure.in: Corresponding feature test.  From Paul Eggert.
6092
6093         (wipename): Change remove() to unlink() for speed & portability.
6094         Use lstat() instead of access() to see if a filename is taken.  This
6095         works even on dangling symlinks and avoids the suid problems of
6096         access(2).  From Paul Eggert.
6097
6098         (isaac_seed_machdep): New function for reading cycle counters
6099
6100 1999-04-02  Paul Eggert  <eggert@shade.twinsun.com>
6101
6102         * configure.in (AC_CHECK_FUNCS): Add gethrtime.
6103
6104         * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
6105         Use gethrtime if available.  Don't assume that clock_gettime succeeds.
6106         Put most random sources first.
6107
6108 1999-04-02  Paul Eggert  <eggert@twinsun.com>
6109
6110         shred: Add new options -bcCklL and fix some porting problems.
6111         Remove options -dp.  Do not read output files.
6112
6113         * src/shred.c (long_opts, usage, main, wipefile): Adjust to
6114         new options.
6115         ("human.h", "quotearg.h"): New includes.
6116         (struct Options): New members contents, links, n_iterations.
6117         Remove allow_devices, remove_file.  Change n_iterations to size_t.
6118         All uses changed.
6119         (output_block_size): New var.
6120         (usage): Declare __noreturn__ attribute.
6121         (fdatasync): Define to -1 if not present, since we need to invoke both
6122         fdatasync and fsync if both are present.  All invokers of fdatasync
6123         now try fdatasync, then fsync.
6124         (MIXIN): New macro.
6125         (isaac_seed): Use it to mix in values.  Add uid, gid to mix.
6126         Don't use gettimeofday, as it has too many porting problems.
6127         (isaac_seedfd): Remove, since we no longer read the output files.
6128         (sizefd): Remove; we now determine size by writing sequentially.
6129         (dopass, wipename, wipefile, main): Clean up error messages.
6130         (dopass): Keep track of offset relative to start of file, not
6131         end, since we may not know how large the file is.  If size is
6132         negative, write until we fall off the end of the file.
6133         (wipefd): Do not read output file.
6134         Return 0 if successful, -1 if not; do not make a special case for
6135         non-regular files, since our callers have that info now.
6136         (wipename): Now static.  Return errno if error.
6137         (main): "-" now stands for standard output.
6138         Do not shred append-only standard output.
6139         (wipefile): Do not grant read permission to file when wiping it.
6140         Use symbolic permission (S_IWUSR), not octal.
6141
6142         * src/system.h (S_IWUSR): Define if not already defined.
6143
6144         * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
6145         (AC_CHECK_FUNCS): Remove gettimeofday.
6146
6147         * doc/fileutils.texi: Document recent changes.
6148
6149 1999-04-01  Jim Meyering  <meyering@ascend.com>
6150
6151         * configure.in (AC_CHECK_FUNCS): Add acl.
6152         (AC_CHECK_HEADERS): Add sys/acl.h.
6153         * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
6154         (struct fileinfo): New member `have_acl'.
6155         (gobble_file): Initialize it.
6156         (print_long_format): Use it.
6157         Mostly from Alen Muzinic.
6158
6159         * src/touch.c (open_maybe_create): New function.
6160         (touch): Rewrite not to use `creat' and to eliminate a race
6161         condition that could make touch truncate a nonempty file.
6162         Report and suggestions from Andrew Tridgell.
6163
6164 1999-03-31  Jim Meyering  <meyering@ascend.com>
6165
6166         * src/du.c: Remove prototypes and tsort function definitions.
6167
6168         * src/chown.c (main): Move the declaration of `e' into the scope
6169         where it's used and make it `const'.
6170
6171         * src/install.c (main): Qualify a char* with the `const' keyword.
6172         (install_file_in_dir): Likewise.
6173         * src/ln.c (main): Likewise.
6174         * src/mkdir.c (main): Likewise.
6175         * src/mkfifo.c (main): Likewise.
6176         * src/mknod.c (main): Likewise.
6177         * src/mv.c (main): Likewise.
6178         * src/touch.c (touch): Likewise.
6179
6180 1999-03-30  Jim Meyering  <meyering@ascend.com>
6181
6182         * src/*.c: Don't include closeout.h or version-etc.h explicitly.
6183         Now, they're included via sys2.h.
6184
6185 1999-03-29  Jim Meyering  <meyering@ascend.com>
6186
6187         * configure.in (GNU_PACKAGE): Remove related code -- now it's in
6188         the catch-all for shared autoconf code, m4/jm-macros.m4.
6189         (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
6190         this instead.
6191
6192 1999-03-29  Paul Eggert  <eggert@twinsun.com>
6193
6194         Minor lint removal in code that forks and execs.
6195
6196         * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
6197         against zero.  This is to improve portability.
6198         * lib/rename.c (rename): Likewise.
6199         * lib/rmdir.c (rmdir): Likewise.
6200
6201         * lib/rename.c (rename):
6202         (rename): Do not print any error messages, so that the messages
6203         are internationalized properly.
6204
6205         * src/install.c (strip): Use standard "cannot fork" message.
6206         Check for strip nonzero exit status.
6207
6208 1999-03-28  Jim Meyering  <meyering@ascend.com>
6209
6210         `chmod =OP' did not properly apply the umask
6211         * lib/modechange.c (make_node_op_equals): New function.
6212         (mode_append_entry): Likewise.
6213         (mode_compile): When none of [ugoa] is specified in an `=OP' change
6214         mode request, insert a `=0' entry into the linked list so that all
6215         bits are cleared first.  Use the new functions.
6216         Reported by Andrew Dalke.
6217
6218         New test for the above.
6219         * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
6220         * tests/Makefile.am (SUBDIRS): Add chmod.
6221         * tests/chmod: New directory
6222         * tests/chmod/equal-x: New file.
6223
6224 1999-03-27  Jim Meyering  <meyering@ascend.com>
6225
6226         * lib/modechange.c (mode_compile): Upon allocation failure, free
6227         everything starting with the head, not the tail.
6228
6229         * src/install.c (strip): Use pid_t, not int.  From John Bley.
6230
6231 1999-03-26  Jim Meyering  <meyering@ascend.com>
6232
6233         * src/dd.c (PROGRAM_NAME, AUTHORS): Define
6234         (long_options): Remove unused struct.
6235         (scanargs): Remove useless loop.
6236         (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
6237         * src/mvdir.c: Likewise.
6238         * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
6239
6240 1999-03-25  Jim Meyering  <meyering@ascend.com>
6241
6242         * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
6243         (noinst_HEADERS): Add version-etc.h.
6244
6245         * lib/long-options.c (parse_long_options): Remove version-, copyright-,
6246         and author-printing code.  Do it via version_etc.
6247
6248         * lib/version-etc.c: New file.
6249         * lib/version-etc.h: Prototype for same.
6250
6251         * src/sys2.h (GETOPT_HELP_CHAR): Define.
6252         (GETOPT_VERSION_CHAR): Define.
6253         (GETOPT_HELP_OPTION_DECL): Define.
6254         (GETOPT_VERSION_OPTION_DECL): Define.
6255         (case_GETOPT_HELP_CHAR): Define.
6256         (case_GETOPT_VERSION_CHAR): Define.
6257
6258         * src/chgrp.c: No longer include long-options.h.
6259         Include version-etc.h instead.
6260         (PROGRAM_NAME, AUTHORS): Define.
6261         [long_options]: Add entries for --help and --version.
6262         Remove parse_long_options call.
6263         (main) [getopt switch]: Add a case for each of --help and --version.
6264         * src/chgrp.c: Likewise.
6265         * src/chmod.c: Likewise.
6266         * src/cp.c: Likewise.
6267         * src/df.c: Likewise.
6268         * src/dircolors.c: Likewise.
6269         * src/du.c: Likewise.
6270         * src/install.c: Likewise.
6271         * src/ln.c: Likewise.
6272         * src/ls.c: Likewise.
6273         * src/mkdir.c: Likewise.
6274         * src/mkfifo.c: Likewise.
6275         * src/mknod.c: Likewise.
6276         * src/mv.c: Likewise.
6277         * src/rm.c: Likewise.
6278         * src/rmdir.c: Likewise.
6279         * src/shred.c: Likewise.
6280         * src/touch.c: Likewise.
6281
6282 1999-03-24  Jim Meyering  <meyering@ascend.com>
6283
6284         * man/help2man: Import version 1.010.
6285
6286 1999-03-22  Jim Meyering  <meyering@ascend.com>
6287
6288         * src/chmod.c (usage): Add one-liner.  Suggestion from Karl Berry.
6289
6290 1999-03-19  Jim Meyering  <meyering@ascend.com>
6291
6292         * src/automake-wrap: Rewrite the automake-generated rule for
6293         clean-binPROGRAMS so that it removes rm even with a losing PATH on a
6294         losing system (PATH with `.' before /bin on a system where you can't
6295         unlink a running executable).  Reported by William Bader.
6296
6297         * configure.in: Use jm_WINSIZE_IN_PTEM.
6298         * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
6299         Required by SCO ODT 2.0 systems.  Reported by William Bader.
6300
6301 1999-03-18  Jim Meyering  <meyering@ascend.com>
6302
6303         * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
6304         (remove_init): Call hash_initialize with one more argument.
6305
6306 1999-03-15  Jim Meyering  <meyering@ascend.com>
6307
6308         Revamp to allow fine-tuning to control when and by how
6309         much the table grows and shrinks.
6310         * lib/hash.c (next_prime): Don't assert.
6311         (hash_reset_tuning): New function.
6312         (check_tuning): New function.
6313         (hash_initialize): Accept and use new tuning parameter.
6314         (hash_rehash): Rewrite, updating for tuning.
6315         (hash_insert): Honor tuning semantics.
6316         (hash_delete): Likewise.
6317         From François Pinard.
6318
6319         * lib/hash.h (struct hash_tuning): Define.
6320         (struct hash_table) [tuning]: Add member.
6321         (hash_initialize): Add `tuning' parameter.
6322
6323         * lib/hash.c (hash_insert): Remove last parameter and change semantics.
6324         * lib/hash.h (hash_insert): Update prototype.
6325
6326         * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
6327         otherwise, we'd do so even when the insertion failed.
6328         From François Pinard.
6329
6330 1999-03-07  Jim Meyering  <meyering@ascend.com>
6331
6332         * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
6333         have to be scanned for % signs.  Suggestion from François Pinard.
6334
6335         * Makefile.maint: Add two more URLs and the loops to use them.
6336
6337         * lib/long-options.c (parse_long_options): Include `Copyright...' line
6338         in --version output.
6339         Add the `...NO warranty...' message.
6340
6341 1999-03-03  Jim Meyering  <meyering@ascend.com>
6342
6343         * lib/long-options.c (_): Define it.
6344         (parse_long_options): Accept new parameter, authors, and print it.
6345
6346         * lib/long-options.h: Update prototype.
6347
6348         * src/chgrp.c: Include long-options.h
6349         [long_options]: Remove the "help" and "version" entries.
6350         (main): Use parse_long_options, including author name(s).
6351         Remove the show_version and show_help blocks.
6352         * src/chmod.c: Likewise.
6353         * src/chown.c: Likewise.
6354         * src/cp.c: Likewise.
6355         * src/dd.c: Likewise.
6356         * src/df.c: Likewise.
6357         * src/dircolors.c: Likewise.
6358         * src/du.c: Likewise.
6359         * src/install.c: Likewise.
6360         * src/ln.c: Likewise.
6361         * src/ls.c: Likewise.
6362         * src/mkdir.c: Likewise.
6363         * src/mkfifo.c: Likewise.
6364         * src/mknod.c: Likewise.
6365         * src/mv.c: Likewise.
6366         * src/mvdir.c: Likewise.
6367         * src/rm.c: Likewise.
6368         * src/rmdir.c: Likewise.
6369         * src/shred.c: Likewise.
6370         * src/sync.c: Likewise.
6371         * src/touch.c: Likewise.
6372
6373 1999-02-18  Paul Eggert  <eggert@twinsun.com>
6374
6375         * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
6376         The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
6377
6378 1999-02-17  Jim Meyering  <meyering@ascend.com>
6379
6380         * src/shred.c (wipename): Fix string thinko.  Now, shredding files
6381         in subdirectories works (dir/file).  From Janos Farkas.
6382
6383 1999-02-13  Jim Meyering  <meyering@ascend.com>
6384
6385         * src/dircolors.c (dc_parse_stream): Don't try to dereference
6386         NULL if there's an error in our built-in list.
6387         Suggestion from François Pinard.
6388
6389 1999-02-13  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
6390
6391         * src/install.c (main): Set x.backup_type only if backups are requested.
6392         (cp_option_init): Initialize backup_type.
6393         (backup_type): Remove unused variable.
6394
6395         * doc/fileutils.texi: Fix use of @item vs @itemx.
6396
6397 1999-02-08  Jim Meyering  <meyering@ascend.com>
6398
6399         * src/dircolors.c (slack_codes): Add "DOOR".
6400         (ls_codes): Add corresponding "do".
6401         Reported by John Gotts.
6402
6403         * configure.in (ALL_LINGUAS): Add Italian (it).
6404
6405 1999-02-07  Jim Meyering  <meyering@ascend.com>
6406
6407         * Version 4.0d (aka 4.1-b4).
6408
6409         * Makefile.maint (my-distcheck): Don't depend on dist, now that this
6410         is hooked up to the distcheck rule.
6411         * Makefile.am (distcheck-hook): New target and rule -- link to shared
6412         rule, my-distcheck, in Makefile.maint.
6413
6414         * doc/fileutils.texi (shred invocation): New section.  From Colin Plumb.
6415
6416         * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
6417         group-member.m4, and just use this new macro.
6418         Use `.$ac_objext', not the literal `.o'.
6419
6420 1999-02-02  Jim Meyering  <meyering@ascend.com>
6421
6422         * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
6423         Define to zero if not already defined.
6424         (HAVE_SYMLINKS): Define.
6425         (gobble_file): Remove #ifdef.
6426         (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
6427         rather than #ifdef S_ISLNK.
6428         (print_type_indicator): Remove #ifdefs and reorganize.
6429         (print_color_indicator): Remove #ifdefs.
6430         (length_of_file_name_and_frills): Likewise.
6431
6432 1999-02-01  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
6433
6434         * src/dircolors.hin: Handle DOOR.
6435
6436         * src/ls.c (print_type_indicator): Print doors as '>'.
6437         (length_of_file_name_and_frills): Account for this.
6438         (indicator_no): Define C_DOOR.
6439         (indicator_name): Add corresponding name.
6440
6441         * lib/filemode.c (ftypelet): Handle doors.
6442
6443         * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
6444
6445 1999-02-01  Jim Meyering  <meyering@ascend.com>
6446
6447         * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
6448         argument list.  From Akim Demaille.
6449
6450 1999-01-31  Jim Meyering  <meyering@ascend.com>
6451
6452         * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
6453         @ifinfo so `makeinfo --html ...' works.  From Karl Berry.
6454
6455         * tests/ln/misc: Add test for this.
6456         * src/ln.c (do_link): Allow creation of a hard link to a dangling
6457         symlink.  Reported by Alexey Solovyov.
6458
6459         * src/copy.c (copy_internal): Describe any backup-related renaming
6460         operations when in verbose mode.
6461         (copy_internal): Likewise.
6462         Based on changes from Marty Leisner.
6463
6464         * lib/lchown.c: Declare chown.
6465
6466 1999-01-30  Jim Meyering  <meyering@ascend.com>
6467
6468         * acconfig.h: Remove uintmax and STAT* #undefs.
6469         * configure.in: Require autoconf 2.13.
6470         Remove test for AFS.
6471         Use 3-argument form of AC_DEFINE*.
6472
6473 1999-01-28  Jim Meyering  <meyering@ascend.com>
6474
6475         * po/POTFILES.in: Add src/shred.c.
6476
6477         * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
6478         TM_IN_SYS_TIME based one (for shred).
6479
6480         * acconfig.h: Remove lots of `#undef's, now that we use the
6481         3-argument forms of AC_DEFINE* macros.
6482
6483 1999-01-25  Jim Meyering  <meyering@ascend.com>
6484
6485         * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
6486         AC_REPLACE_FUNCS.
6487         (AC_CHECK_FUNCS): Add clock_gettime.
6488
6489         * src/shred.c (isaac_seed): Guard clock_gettime with test of
6490         HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
6491         (wipename): Rename local dirfd to dir_fd to avoid shadowing the
6492         function declared in Linux's dirent.h.
6493
6494 1999-01-25  Akim Demaille  <demaille@inf.enst.fr>
6495
6496         * lib/argmatch.h (ARRAY_CARDINALITY): Define.
6497         (ARGMATCH_ASSERT): New macro.
6498
6499         * lib/argmatch.c (program_name): Remove dcl.
6500         Include error.h.
6501         (argmatch_invalid): Use error rather than fprintf.
6502
6503 1999-01-24  Jim Meyering  <meyering@ascend.com>
6504
6505         * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
6506         New version from L. Peter Deutsch.
6507
6508         * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
6509         (and hence that of the local `n1', too) to `int' at Paul's request.
6510
6511         * lib/closeout.c: Add comments.
6512
6513         * src/shred.c (fdatasync): Remove function.  instead, ...
6514         (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
6515         From Colin Plumb.
6516
6517 1999-01-23  Jim Meyering  <meyering@ascend.com>
6518
6519         * src/Makefile.am (bin_PROGRAMS): Add shred.
6520         * src/shred.c: New file.
6521         Portability tweaks.
6522         Internationalize.
6523         (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
6524         only when in verbose mode.
6525         (fdatasync) [! HAVE_FDATASYNC]: New function.
6526
6527         * man/Makefile.am (man_MANS): Add shred.1.
6528         * man/Makefile.summ (shred-summary): Define.
6529         * man/shred.x: New file.
6530
6531         * src/shred.c: New file.  From Colin Plumb.
6532         Include config.h, getopt.h, system.h and error.h.
6533         Use #else/#if, not #elif.
6534
6535 1998-11-05  Paul Eggert  <eggert@twinsun.com>
6536
6537         * lib/mktime.c (__mktime_internal): Adopt the traditional (and
6538         problematic) notion of what to do when tm_isdst doesn't match.
6539
6540 1999-01-17  Jim Meyering  <meyering@ascend.com>
6541
6542         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
6543         than setting RM and CP.
6544         * tests/cp/*: Now that PATH is set properly, use rm and cp rather
6545         than $RM and $CP.
6546
6547         * tests/ln/Makefile.am (TESTS): Add backup-1.
6548         (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
6549         * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
6550         * tests/ln/backup-1: New test for this.
6551         * src/ln.c (do_link): Try to remove DEST even after renaming it.
6552         This fixes a bug reported by Jamie Lokier.
6553
6554         * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
6555
6556 1999-01-16  Jim Meyering  <meyering@ascend.com>
6557
6558         * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
6559
6560         * acconfig.h: Remove @BOTTOM@ section.
6561         Instead, add the define and decl via m4/jm-macros.m4.
6562
6563         * src/ls.c: Don't declare base_name.
6564         Use function-style XARGMATCH once again.
6565         * src/touch.c: Likewise.
6566         * acconfig.h: Add a @BOTTOM@ section.
6567         (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
6568         Declare usage.
6569         From Akim Demaille.
6570
6571         * src/cp.c: Remove declarations of base_name and get_version.
6572         (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
6573         Use xget_version and function-style XARGMATCH.
6574         * src/mv.c (main): Likewise.
6575         * src/ln.c (main): Likewise.
6576         * src/install.c (main): Likewise.
6577         * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
6578         unsigned int, not just int.
6579         * lib/backupfile.h (get_version): Adjust prototype.
6580         (xget_version): Add prototype.
6581         (base_name): Remove prototype.
6582         * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
6583         (backup_args): Reorder enum members.
6584         (backup_types): Likewise.
6585         (get_version): Take an additional parameter, `context'.
6586         (xget_version): Like get_version, but if the `version' argument is NULL,
6587         use the value of the envvar VERSION_CONTROL.
6588         (base_name): Declare.
6589         Mostly from Akim Demaille.
6590
6591         * lib/addext.c (base_name): Declare.
6592         * src/sys2.h: Add prototype for base_name.
6593
6594         * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
6595         * lib/argmatch.h: Likewise.
6596
6597         * lib/argmatch.h (XARGMATCH): Define to return a value once again.
6598         (XARGCASEMATCH): Likewise.
6599
6600         * lib/argmatch.c (EXIT_FAILURE): Define.
6601         (ARGMATCH_DIE): Provide default.
6602         (__xargmatch_internal): New function.
6603         s/rogram_name/program_name.
6604         From Akim Demaille.
6605
6606 1999-01-14  Akim Demaille  <demaille@inf.enst.fr>
6607
6608         * src/touch.c (usage): Don't make it static so that it can be
6609         called from libfu.a by xargmatch.
6610         * src/chgrp.c (usage): Likewise
6611         * src/chmod.c (usage): Likewise
6612         * src/chown.c (usage): Likewise
6613         * src/cp.c (usage): Likewise
6614         * src/dd.c (usage): Likewise
6615         * src/df.c (usage): Likewise
6616         * src/dircolors.c (usage): Likewise
6617         * src/du.c (usage): Likewise
6618         * src/install.c (usage): Likewise
6619         * src/ln.c (usage): Likewise
6620         * src/ls.c (usage): Likewise
6621         * src/mkdir.c (usage): Likewise
6622         * src/mkfifo.c (usage): Likewise
6623         * src/mknod.c (usage): Likewise
6624         * src/mv.c (usage): Likewise
6625         * src/mvdir.c (usage): Likewise
6626         * src/rm.c (usage): Likewise
6627         * src/rmdir.c (usage): Likewise
6628         * src/sync.c (usage): Likewise
6629
6630 1999-01-12  Akim Demaille  <demaille@inf.enst.fr>
6631
6632         * lib/backupfile.c (get_version): added the parameters KIND.
6633         (xget_version): like get_version, but if argument is NULL, honor
6634         the envvar VERSION_CONTROL.
6635         * src/cp.c: Remove declarations of base_name and get_version.
6636         (main): Use xget_version.
6637         * src/mv.c (main): Likewise.
6638         * src/ln.c (main): Likewise.
6639         * src/install.c (main): Likewise.
6640
6641 1999-01-12  Jim Meyering  <meyering@ascend.com>
6642
6643         * configure.in (ALL_LINGUAS): Add Greek (el).
6644         * po/el.po: New file.
6645
6646         * install-sh: New version from autoconf.
6647         * missing: New version from automake.
6648         * src/ansi2knr.c: Likewise.
6649         * lib/getopt.c: New version from glibc.
6650         * lib/getopt.h: Likewise.
6651         * lib/getopt1.c: Likewise.
6652         * lib/regex.c: Likewise.
6653         * lib/regex.h: Likewise.
6654         * lib/ylwrap: Remove unused file.
6655
6656 1999-01-10  Jim Meyering  <meyering@ascend.com>
6657
6658         * Version 4.0c (aka 4.1-b3).
6659
6660         * Upgrade to autoconf-2.13 and automake-1.3b.
6661
6662         * src/copy.c (copy_internal): Handle two more values of errno from
6663         failed rename of a directory into a subdirectory of itself.
6664         Thanks to Volker Borchert for testing many types and combinations
6665         of systems.
6666
6667         * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
6668         to escape_quoting_style.
6669         (argmatch_invalid): Now that the quoted quantity is no longer double
6670         quoted, remove the code that removed leading and trailing double quotes.
6671
6672         * src/ls.c (decode_switches): Now that escape_quoting_style no longer
6673         escapes the SPACE character, arrange for SPACEs to be quoted here.
6674         * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
6675         it no longer escapes ` '.
6676         Suggestion from Paul Eggert.
6677
6678 1999-01-05  Jim Meyering  <meyering@ascend.com>
6679
6680         * configure.in (space): Add `for' in message of statvfs check.
6681         From Ulrich Drepper.
6682
6683 1999-01-04  Jim Meyering  <meyering@ascend.com>
6684
6685         * Version 4.1-b2.
6686
6687 1999-01-02  Jim Meyering  <meyering@ascend.com>
6688
6689         * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
6690         offending quoted argument before using it in explanatory diagnostic.
6691         Use a single fprintf stmt.
6692
6693         * lib/argmatch.h (XARGMATCH): Don't return a value;  instead,
6694         modify a parameter.  Add a `Die_stmt' parameter.
6695         Add parentheses.
6696         * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
6697         (argmatch_to_argument): Add `const' attribute to first parameter.
6698
6699         * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
6700         done in m4/jm-macros.m4).
6701
6702         * lib/backupfile.c (get_version): Adapt to use new interface to
6703         XARGMATCH.
6704         * src/cp.c: Likewise.
6705         * src/ls.c: Likewise.
6706         * src/touch.c: Likewise.
6707
6708 1999-01-01  Jim Meyering  <meyering@ascend.com>
6709
6710         * lib/makepath.c (make_dir): New function, factored out of make_path.
6711         (make_path): Use make_dir rather than open-coding it twice.
6712         This effectively reverses the order of the latter pair of stat/mkdir
6713         calls and fixes a race condition bug whereby one of two concurrent
6714         `mkdir -p' processes could fail with EEXIST.
6715         Include locale.h and libintl.h, and define `_()'.
6716         Mark translatable strings.
6717
6718         * lib/xmalloc.c: Add comments.
6719         (xcalloc, xmalloc, xrealloc): Remove prototypes.
6720         (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
6721         * lib/xalloc.h: Add comments.
6722         (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
6723         (xcalloc, xmalloc, xrealloc): Add prototypes here.
6724         Based on changes from Akim Demaille.
6725
6726         * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
6727         (quotearg_n): Change type of 1st parameter from int to unsigned int.
6728         (quotearg_n_options): Likewise.
6729         * lib/quotearg.h (quoting_style_vals): New public array.
6730         From Akim Demaille.
6731         (quotearg_n_options): Declare `options' parameter to be `const'.
6732
6733         * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
6734
6735         * lib/backupfile.c (get_version): Use XARGMATCH in place of
6736         argmatch & co.
6737
6738 1998-12-31  Jim Meyering  <meyering@ascend.com>
6739
6740         * src/ls.c (indicator_style_types): New variable.
6741         (format_types): Rename from `formats'.
6742         (color_args): Remove unnecessary `no' string.
6743         (color_types): Remove corresponding `color_never' entry.
6744         (main): Use ARGMATCH_TO_ARGUMENT.
6745         (decode_switches): Use ARGMATCH instead of argmatch code
6746         in each of several cases.
6747         From Akim Demaille.
6748
6749         * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
6750         * src/touch.c (main): Likewise.
6751         * lib/backupfile.c (get_version): Likewise.
6752         From Akim Demaille.
6753
6754         * lib/strncasecmp.c: New file.
6755         * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
6756         * lib/argmatch.c (strncasecmp): Move to a separate file.
6757         Add curly braces around some one-stmt-but-multiline blocks.
6758
6759         * lib/argmatch.c: Improvements from Akim Demaille.
6760         * lib/argmatch.h: Likewise.
6761
6762         * lib/addext.c (addext): Protoize.
6763         Indent cpp directives to match nesting.
6764
6765         Fix warnings from gcc -W -Wall
6766         * lib/posixtm.c (posix_time_parse): Change type of index `i' from
6767         int to unsigned int.
6768         * lib/getdate.y (__attribute__): Define.
6769         (ATTRIBUTE_UNUSED): Define.
6770         (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
6771         (MonthDayTable): Add initializers for last entry.
6772         (UnitsTable): Likewise.
6773         (OtherTable): Likewise.
6774         (MilitaryTable): Likewise.
6775
6776 1998-12-22  Jim Meyering  <meyering@ascend.com>
6777
6778         * Version 4.1-b1.
6779
6780         * configure.in (ALL_LINGUAS): Add chinese (zh).
6781
6782 1998-12-19  Jim Meyering  <meyering@ascend.com>
6783
6784         * tests/ln/misc: Use absolute path for final rm.
6785
6786         * Makefile.maint (my-distcheck): Run make with
6787         CFLAGS='-Wformat -Werror'.
6788
6789 1998-12-18  Jim Meyering  <meyering@ascend.com>
6790
6791         * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
6792         from format string.  From Michiel Bacchiani.
6793
6794         * src/chgrp.c (MAXGID): Define.
6795         Use gid_t (not int) as the type for `group' variables.
6796         (parse_group): Use MAXGID, not INT_MAX.
6797
6798         * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
6799         * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
6800
6801 1998-12-13  Jim Meyering  <meyering@ascend.com>
6802
6803         * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
6804
6805 1998-12-12  Jim Meyering  <meyering@ascend.com>
6806
6807         1998-10-15  Akim Demaille  <demaille@inf.enst.fr>
6808         * src/ls.c: Group DIRED's code together.
6809         (full_time, inhibit_group, col_ext_type): Declare static.
6810         (dired_dump_obstack): Apply sizeof to variable, instead of its type.
6811         (parse_ls_color): Rename ext2 as e2.  Move into the block where it
6812         is used.
6813
6814         1998-10-15  Akim Demaille  <demaille@inf.enst.fr>
6815         * src/ls.c: In order to distinguish col(umn|or):
6816         (init_column_info): Renamed from init_col_info.
6817         (struct column_info): Renamed from struct col_info.
6818         (struct color_ext_type): Renamed from struct col_ext_type.
6819
6820 1998-12-11  Jim Meyering  <meyering@ascend.com>
6821
6822         * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
6823         (stat.c): Likewise.
6824         * lib/stat.c: Remove file.
6825         * lib/lstat.c: Remove file.
6826         * lib/xstat.in (xstat@): New file.
6827
6828         * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
6829         From Bruno Haible.
6830         * tests/ls-2/tests: Add a test for this.
6831
6832         * man/help2man: import version 1.006.
6833
6834 1998-12-07  Jim Meyering  <meyering@ascend.com>
6835
6836         * src/copy.c: Use dir_name, not dirname.  Include dirname.h.
6837         * src/cp.c: Likewise.
6838         * src/df.c: Likewise.
6839         * src/install.c: Likewise.
6840         * src/ln.c: Likewise.
6841         * src/mvdir.c: Likewise.
6842
6843         * lib/dirname.c (dir_name): Rename from dirname.
6844         Make argument `const'.  Include "dirname.h"
6845         * lib/dirname.h: New file.
6846         * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
6847
6848 1998-12-06  Jim Meyering  <meyering@ascend.com>
6849
6850         * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
6851         `^[yY]' and `^[nN]' (avoiding regex).  From Karl Heuer.
6852
6853         * lib/*.c: Ansideclify.
6854
6855         Fix `ls -R .' formatting bug that broke mktexlsr.
6856         * src/ls.c: Include path-concat.h.
6857         (basename_is_dot_or_dotdot): New function, derived from
6858         is_not_dot_or_dotdot.
6859         (is_not_dot_or_dotdot): Remove function.
6860         (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
6861         instead of is_not_dot_or_dotdot and use path_concat instead of attach.
6862
6863         * tests/ls-2/tests: New file (renamed from quoting),
6864         with new test for the `ls -R .' fix.
6865         * tests/ls-2/quoting: Remove file.
6866         * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
6867
6868 1998-11-29  Jim Meyering  <meyering@ascend.com>
6869
6870         * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
6871         * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
6872
6873         * src/dd.c (dd_copy): Rename function from `copy'.
6874
6875         * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
6876
6877         Per Kristian Hove reported that a certain move-directory-into-self
6878         wasn't properly diagnosed.
6879
6880         * tests/mv/into-self-3: New file.
6881         * tests/mv/Makefile.am (TESTS): Add into-self-3.
6882         * src/copy.c (copy_internal): Remove earlier (but less effective)
6883         test for move/copy-into-self.
6884         Instead, deduce the move-into-self condition from errno==EINVAL
6885         after a failed rename.
6886         * src/mv.c (do_move): Don't arrange to remove DEST in the
6887         copied-into-self case.
6888
6889 1998-11-15  Jim Meyering  <meyering@ascend.com>
6890
6891         Bob McCracken reported that mv couldn't handle certain combinations
6892         of hard linked source files.
6893
6894         * tests/mv/hard-link-1: New file.
6895         * tests/mv/Makefile.am (TESTS): Add hard-link-1.
6896         * src/mv.c (movefile): Don't free new_dest.
6897
6898         * lib/error.c (error): Don't use strerror_r's return value.
6899         From Johan Danielsson.
6900
6901 1998-11-14  Jim Meyering  <meyering@ascend.com>
6902
6903         * Version 4.0.
6904
6905         * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
6906         to avoid matching a prefix of another tag.
6907
6908 1998-11-10  Jim Meyering  <meyering@ascend.com>
6909
6910         * configure.in (ALL_LINGUAS): Add Greek (el).
6911         * po/el.po: New file.
6912
6913 1998-11-07  Jim Meyering  <meyering@ascend.com>
6914
6915         * Version 4.0-b7.
6916
6917         Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
6918         work on Hurd systems because of an inline definition of lstat in a
6919         system header file).  This also makes it so that you may run `ls '' '
6920         on systems that let l?stat operate on the empty string.
6921
6922         * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
6923         and declare the latter.
6924         * lib/stat.c [stat]: Remove #undef.
6925         (rpl_stat): Protoize.
6926         * lib/lstat.c [lstat]: Remove #undef.
6927         (rpl_lstat): Protoize.  Use ENOENT, not EINVAL, to be consistent
6928         with lib/stat.c.
6929         * acconfig.h: Remove #undef's for lstat and stat.
6930
6931 1998-10-31  Jim Meyering  <meyering@ascend.com>
6932
6933         * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
6934         but comment it out.
6935         * tests/rm/empty-name: New file.
6936
6937         * acconfig.h (stat): New #undef.
6938         This omission was uncovered when Mark Kettenis reported that
6939         `rm -r ''' got a failed assertion on the Hurd.  This change
6940         doesn't fix *that* problem -- see above.
6941
6942 1998-10-25  Jim Meyering  <meyering@ascend.com>
6943
6944         * Version 4.0-b6.
6945
6946         * README: Man pages will now be supported to the extent that
6947         people send patches.
6948
6949         * tests/rm/unreadable: Two new tests.
6950         * tests/rm/Makefile.am (TESTS): Add new test `unreadable'.  But comment
6951         it out since we're so close to release and since the test compares the
6952         text of diagnostics that are likely to vary between systems.
6953         (TEST_ENVIRONMENT): Add required framework.
6954
6955         * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
6956         pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
6957         Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
6958         (remove_dir): Return `status', rather than always RM_OK.
6959
6960 1998-10-18  Jim Meyering  <meyering@ascend.com>
6961
6962         * Version 4.0-b5.
6963
6964         * lib/mktime.c: Update from libc with this additional change from Paul.
6965         * lib/strftime.c: Likewise.
6966
6967         1998-10-17  Paul Eggert  <eggert@twinsun.com>
6968
6969         Don't invoke localtime_r or gmtime_r unless it's the GNU C
6970         library's localtime_r and gmtime_r; there are too many buggy
6971         implementations of localtime_r and gmtime_r out there, and
6972         it's not worth keeping track of all the different bugs.
6973
6974         * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
6975         (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
6976         Base it on localtime unless _LIBC.
6977
6978         * strftime.c (__EXTENSIONS__): Remove.
6979         (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
6980         (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
6981         Base them on localtime/gmtime if not _LIBC.
6982
6983 1998-10-17  Jim Meyering  <meyering@ascend.com>
6984
6985         * Version 4.0-b4.
6986
6987         * lib/mktime.c: Declare localtime_r if necessary.
6988         * lib/strftime.c: Likewise.
6989
6990         * tests/Fetish.pm (run_tests): Run $prog with --version only
6991         if $verbose.
6992
6993 1998-10-11  Jim Meyering  <meyering@ascend.com>
6994
6995         * Version 4.0-b3.
6996
6997 1998-10-08  Paul Eggert  <eggert@twinsun.com>
6998
6999         * mktime.c (__mktime_internal): When the requested time falls
7000         in a spring-forward gap of size DT, return a time that is DT
7001         away from the requested time, preferring a time whose tm_isdst
7002         differs from the requested value.  Bump the max number of
7003         probes from 4 to 6 to account for the extra probes needed to
7004         discover a spring-forward gap in the worst case.
7005
7006 1998-10-08  Paul Eggert  <eggert@twinsun.com>
7007
7008         * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
7009         Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
7010         a body that merely expands localtime_r; this works around a
7011         bug in Digital Unix 4.0A and 4.0D.
7012
7013 1998-10-05  Jim Meyering  <meyering@ascend.com>
7014
7015         * po/Makefile.in.in (uninstall): Remove (historical?) command that
7016         removed po-Makefile.in.in.  From Akim Demaille.
7017
7018         * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
7019         From aldomel.
7020
7021 1998-10-04  Jim Meyering  <meyering@ascend.com>
7022
7023         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
7024         From Kaveh Ghazi.
7025
7026 1998-10-03  Jim Meyering  <meyering@ascend.com>
7027
7028         * Version 4.0-b2.
7029
7030         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
7031
7032         * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
7033         Instead, depend on corresponding source file and on configure.in.
7034         Based on suggestion and code from Akim Demaille.
7035         Factor out irregular men into Makefile.summ.
7036
7037         * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
7038
7039         * man/Makefile.summ: New file.
7040         * man/Makefile.maint: Include it.
7041
7042         * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
7043
7044         * tests/mv/Makefile.am (TESTS): Add i-1.
7045         * tests/mv/i-1: New test.
7046
7047 1998-10-02  Jim Meyering  <meyering@ascend.com>
7048
7049         * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
7050         * tests/ls-2/run-test: Remove file.
7051         * tests/ls-2/quoting: Include /bin/sh driver framework.
7052
7053         * tests/dircolors/simple: Remove file.
7054         * tests/dircolors/run-test: Embed it here instead.
7055         * tests/dircolors/simple: Rename from run-test.
7056
7057 1998-10-01  Jim Meyering  <meyering@ascend.com>
7058
7059         * tests/Makefile.am (EXTRA_DIST): Remove README.
7060         From Akim Demaille.
7061
7062 1998-09-28  Jim Meyering  <meyering@ascend.com>
7063
7064         * Version 4.0-pre1.
7065
7066         * Use automake-1.3b.  See notes in README.
7067
7068         * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
7069         Otherwise, `touch a b; echo n|mv -i a b' would remove b.
7070         From Bernd Leibing.
7071
7072 1998-09-27  Jim Meyering  <meyering@ascend.com>
7073
7074         * Version 3.16z.
7075
7076         * Makefile.maint (alpha): New target.
7077         (my-distcheck): Tweak.
7078
7079         * lib/backupfile.h: Protect against multiple inclusion.
7080         From Akim Demaille.
7081
7082         * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
7083         Now, it is invoked through jm_MACROS.
7084
7085         * lib/strftime.c (my_strftime): Update from FSF.
7086
7087 1998-09-26  Jim Meyering  <meyering@ascend.com>
7088
7089         * src/copy.c (copy_internal): Don't preserve hard-linked directories
7090         to avoid damaging the destination filesystem when copying from a
7091         Netapp snapshot directory.  With code from Kjetil Torgrim Hollstein
7092         and Paul Eggert.
7093
7094 1998-09-24  Jim Meyering  <meyering@ascend.com>
7095
7096         * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
7097         From Akim Demaille.
7098
7099 1998-09-21  Jim Meyering  <meyering@ascend.com>
7100
7101         * man/Makefile.maint ($(man_MANS)): Remove `echo'.
7102
7103 1998-09-20  Jim Meyering  <meyering@ascend.com>
7104
7105         * Version 3.16y.
7106
7107         * src/install.c (install_file_to_path) [-D]: Create any leading
7108         directories with permissions of 0755.
7109
7110 1998-09-19  Jim Meyering  <meyering@ascend.com>
7111
7112         * src/install.c (install_file_to_path): Copy the file after creating
7113         any leading directories.
7114         (main) [case 'v']: Set `x.verbose' to 1, not 0.
7115         Reported by Marty Leisner.
7116
7117         * man/Makefile.am (transform): Define.
7118         (man_MANS): Include ginstall.1, not install.1, to match the name
7119         of the executable in ../src.
7120         * man/ginstall.x: New file.
7121         * man/install.x: Remove file.
7122         * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
7123
7124         * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
7125         Reported by Akim Demaille.
7126
7127         * lib/modechange.c: Fix post-protoization typo.
7128
7129         * lib/posixtm.h (PARAMS): Define and use.
7130         From Kaveh Ghazi.
7131
7132 1998-09-12  Jim Meyering  <meyering@ascend.com>
7133
7134         * Version 3.16x.
7135
7136         * src/remove.c (remove_cwd_entries): Declare to be static.
7137
7138         Automatically generate man pages from combination of --help
7139         output and the contents of new, man/*.x files.
7140         * man/Makefile.am (HELP2MAN): Define.
7141         (man_aux): Define.
7142         (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
7143         (MAINTAINERCLEANFILES): Add $(man_MANS).
7144         * man/*.x: New files.
7145         * man/GNUmakefile: New file.
7146         * man/Makefile.maint: New file.
7147         * man/help2man: New file.
7148
7149 1998-09-09  Jim Meyering  <meyering@ascend.com>
7150
7151         * lib/modechange.c: Protoize.
7152
7153 1998-09-07  Jim Meyering  <meyering@ascend.com>
7154
7155         * Version 3.16w.
7156
7157         * src/df.c (show_dev) [!posix_format]: When using --print-type,
7158         let the device path and the file system type share a single (wider)
7159         field if their combined lengths allow it.  From Andries Brouwer.
7160
7161         * tests/touch/empty-file: Upon failure, suggest how to rerun the test
7162         with longer delay, in case NFS clock skew was the cause of the failure.
7163         Reported by Kaveh Ghazi.
7164
7165         * tests/ls-2/quoting: Add tests.
7166         * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
7167         (_create_file): Don't include $$ in temp file name.
7168         (run_tests): Use shorter suffixes for temp file names.
7169
7170 1998-09-06  Jim Meyering  <meyering@ascend.com>
7171
7172         * src/touch.c: Include posixtm.h.
7173         (usage): Correct the description of the format of the
7174         date string argument to -t option.
7175         (main): Update to use rewritten posixtime function.
7176         Reported by Andries Brouwer.
7177
7178         * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
7179         (noinst_HEADERS): Add posixtm.h.
7180
7181         * lib/posixtm.h: New file.
7182         * lib/posixtm.c: New file.  Rewritten based on posixtm.y.
7183         * lib/posixtm.y: Remove file.
7184
7185 1998-09-05  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7186
7187         * src/ls.c (print_dir_name): Put back.
7188         (print_dir): Also print directory name header if print_dir_name is
7189         true.
7190
7191 1998-08-29  Jim Meyering  <meyering@ascend.com>
7192
7193         * Version 3.16v.
7194
7195         * src/du.c (long_options): Use corresponding short-option character
7196         in place of `1', and `NULL' in place of pointer in initialization.
7197         * src/cp.c (long_opts): Likewise.
7198         * src/ln.c (long_options): Likewise.
7199         * src/mkdir.c (longopts): Likewise.
7200         * src/rmdir.c (longopts): Likewise.
7201         * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
7202         respectively.
7203         * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
7204         * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
7205
7206         * tests/Fetish.pm: New file -- moved from ls-2/.
7207         * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
7208         * tests/Makefile.am (SUBDIRS): Add dircolors.
7209         (EXTRA_DIST): Add Fetish.pm.
7210         * tests/dircolors: New directory
7211
7212         * src/ls.c (print_dir_name): Remove global variable.
7213         (print_dir): When trace_dirs is set, always print the directory
7214         name header.
7215
7216 1998-08-26  Jim Meyering  <meyering@ascend.com>
7217
7218         * src/dircolors.c (dc_parse_stream): Don't segfault when a line
7219         contains only one token.  Reported by Olav Morkrid.
7220
7221 1998-08-24  Paul Eggert  <eggert@twinsun.com>
7222
7223         * src/system.h (CHAR_MIN, CHAR_MAX):
7224         Renamed from SCHAR_MIN, SCHAR_MAX, since these
7225         macros apply to char, not signed char.
7226
7227         * src/df.c, src/du.c, src/touch.c (long_options, main):
7228         Don't assume ASCII.
7229
7230 1998-08-18  Paul Eggert  <eggert@twinsun.com>
7231
7232         Port nanosecond-resolution times to UnixWare 2.1.2 and
7233         pedantic Solaris 2.6.
7234
7235         * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
7236         * acconfig.h (ST_MTIM_NSEC): New #undef.
7237         * src/system.h (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
7238         Use new ST_MTIM_NSEC macro.
7239
7240 1998-08-16  Jim Meyering  <meyering@ascend.com>
7241
7242         * lib/filemode.h (PARAMS): Define and use.
7243         From Kaveh Ghazi.
7244
7245 1998-08-15  Jim Meyering  <meyering@ascend.com>
7246
7247         * Version 3.16u.
7248
7249         * Makefile.maint (announcement): New target.
7250
7251         * tests/mv/into-self: Update to reflect changed behavior of mv.
7252         * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
7253         With prodding from François Pinard :-)
7254
7255         * tests/ls-2/Fetish.pm: New file
7256         * tests/ls-2/run-test: New file
7257
7258         * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
7259         directories (but none of their entries).  This makes `cp --archive
7260          --one-file-system' use the same policy `tar --one-file-system' does.
7261         From Marty Leisner.
7262
7263         * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
7264
7265 1998-08-14  Jim Meyering  <meyering@ascend.com>
7266
7267         * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
7268         Reported by Christian von Roques.
7269
7270         * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
7271         * tests/Makefile.am (SUBDIRS): Add ls-2.
7272         * tests/ls-2: New directory
7273
7274 1998-08-14  Christian von Roques  <roques@pond.sub.org>
7275
7276         * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
7277         infloop on getmnt(2) returning 0.
7278
7279         * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
7280         not initializing output redirection of : command.
7281         * tests/mv/backup-is-src: Likewise.
7282         * tests/rm/i-1: Likewise.
7283
7284 1998-08-12  Jim Meyering  <meyering@ascend.com>
7285
7286         * po/Makefile.in.in: Provide automake-style DESTDIR support.
7287         From Johan Danielsson.
7288         (DISTFILES): Remove ChangeLog.
7289         po/ChangeLog: Remove empty file.
7290
7291         * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
7292
7293         * src/ls.c: Include filemode.h.
7294         * src/chmod.c: Likewise.
7295
7296         * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
7297         From Johan Danielsson.
7298         Protoize.  Tsort function definitions and remove prototypes of
7299         static functions.
7300         (mode_string): Remove prototype.
7301         * lib/filemode.h (mode_string): New file.
7302         * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
7303
7304 1998-08-09  Jim Meyering  <meyering@ascend.com>
7305
7306         * Version 3.16t.
7307
7308 1998-07-31  Paul Eggert  <eggert@twinsun.com>
7309
7310         Add support for filesystems whose timestamps have better resolution
7311         than 1 second (e.g. Solaris 2.6, recent Linux kernels).
7312
7313         * configure.in (AC_STRUCT_ST_MTIM): Add.
7314
7315         * src/copy.c (copy_internal): Compare time stamps with
7316         subsecond resolution if available.
7317
7318         * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
7319         rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
7320         stamps with subsecond resolution if available.
7321
7322         * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
7323         CTIME_CMP, MTIME_CMP): New macros.
7324
7325 1998-08-01  Jim Meyering  <meyering@ascend.com>
7326
7327         * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
7328
7329 1998-07-28  Paul Eggert  <eggert@twinsun.com>
7330
7331         * lib/mountlist.c (read_filesystem_list): Remove all_fs
7332         argument, but put the necessary information into the result so
7333         that the caller can ignore filesystems that he's not
7334         interested in.
7335
7336         * lib/mountlist.h (struct mount_entry):
7337         New members me_dummy, me_remote.
7338         (read_filesystem_list): Remove all_fs argument.
7339         (REMOTE_FS_TYPE): Remove.
7340         (ME_DUMMY, ME_REMOTE): New macros.
7341
7342         * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
7343
7344         * src/df.c (show_all_fs):
7345         Revert to boolean value; the old negative value is
7346         now in show_local_fs.
7347         (show_local_fs): New variable.
7348         (show_dev): New args me_dummy and me_class.  Use show_local_fs
7349         and boolean show_all_fs in combination with these new args
7350         to decide whether to show a device.
7351         (show_disk): Pass flags to show_dev.
7352         (show_point): Use a non-dummy mount entry if possible.
7353         (show_all_entries): Pass flags to show_dev.
7354         (main): --local sets show_local_fs now.  Ask for file system types if
7355         show_local_fs is nonzero, since ME_REMOTE might need them.
7356
7357 1998-07-27  Jim Meyering  <meyering@ascend.com>
7358
7359         * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
7360
7361         * tests/install/basic-1: Add a test for this.
7362         * src/install.c: Make copy create each destination file initially
7363         with mode 0600 so strip will work, then apply specified mode.
7364         Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
7365
7366 1998-07-25  Jim Meyering  <meyering@ascend.com>
7367
7368         * src/mv.c (chown): Remove unused definition.
7369         Reported by Kaveh Ghazi.
7370
7371         * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
7372         Handle that, so --ignore-fail-on-non-empty works.
7373         (EEXIST): Define to zero if not defined.
7374         (ENOTEMPTY): Likewise.
7375
7376         * tests/cp/same-file: Remove `diff' I'd put in for debugging.
7377         Exit with the status from cmp.
7378
7379         * Version 3.16s.
7380
7381         * tests/cp/same-file: Skip three more unportable tests.
7382         These failed on SunOS4.1.4.
7383
7384         * src/copy.c (SAME_INODE): Remove definition.
7385         * src/sys2.h (SAME_INODE): Define it here instead.
7386
7387         * src/remove.c (same_file): New function.
7388         (remove_dir): Use it to give a better diagnostic when rmdir fails
7389         because it can't remove the current directory.
7390
7391         * src/df.c (long_options): Changes table entries not to use this form:
7392         {"all", no_argument, &show_all_fs, 1},
7393         but rather this form:
7394         {"all", no_argument, NULL, 'a'},
7395         Using the latter, all the option handling in one place: the getopt loop.
7396
7397         * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
7398         Use fsp_to_string.
7399         (fsp_to_string): Don't xmalloc return value (yet).
7400         (xatoi): Ansideclify.
7401         (fstype_to_string): Ansideclify.
7402         * lib/mountlist.h: Define and use PARAMS macro.
7403
7404         * lib/utime.c: New file.
7405         * src/touch.c (utime_now): Moved into m4/utimes.m4.
7406         (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
7407         in the if-block.
7408
7409         * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
7410
7411 1998-07-22  Paul Eggert  <eggert@twinsun.com>
7412
7413         * lib/human.c (human_readable): amt -> damt, to fix typo when
7414         computing which power to use after overflow occurs during
7415         multiplication.
7416
7417         * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
7418         needed on SunOS 4.
7419
7420 1998-07-21  Paul Eggert  <eggert@twinsun.com>
7421
7422         Add df -l or --local option.
7423         * doc/fileutils.texi: Document it.
7424         * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
7425         * lib/mountlist.c (read_filesystem_list):
7426         If all_fs is negative, omit non-local filesytems.
7427
7428         * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
7429         (show_all_fs): If negative, omit non-local filesystems.
7430         All uses of (all_fs != 0) changed to (all_fs > 0).
7431         (long_options, usage, main): Add -l or --local option.
7432         (main): When asking for df of an explicit file name, get all
7433         the mount points, so that we're more likely to find it when
7434         we look it up.
7435
7436 1998-07-18  Jim Meyering  <meyering@ascend.com>
7437
7438         * src/copy.c (copy_internal): Add another exclusion from the
7439         sameness test: when --force has been specified, the destination
7440         is unlinked before any copy.
7441         (copy_internal): Add yet another: when both src and dest are symlinks.
7442
7443         * tests/touch: New subdir.
7444         * tests/Makefile.am (SUBDIRS): Add touch.
7445         * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
7446
7447         * tests/mv/into-self-2: New test.
7448         * tests/mv/Makefile.am (TESTS): Add into-self-2.
7449
7450 1998-07-06  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7451
7452         * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
7453         failure.
7454
7455 1998-07-16  Jim Meyering  <meyering@ascend.com>
7456
7457         Work around failure of chown calls on m68k-motorola-sysv systems.
7458         * src/chown.c: Include lchown.h.
7459         * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
7460         * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
7461         * lib/lchown.c: Include lchown.h.
7462         Reported by and with suggestions from Manfred Hollstein.
7463
7464 1998-07-12  Paul Eggert  <eggert@twinsun.com>
7465
7466         * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
7467
7468 1998-07-07  Jim Meyering  <meyering@ascend.com>
7469
7470         * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
7471         Suggestion from Ulrich Drepper.
7472
7473 1998-07-04  Jim Meyering  <meyering@ascend.com>
7474
7475         * lib/safe-read.c (safe_read): Change type of pointer parameter to
7476         `void' to avoid Irix4 cc errors.  Reported by Kaveh Ghazi.
7477         * lib/safe-read.h: Update prototype.
7478
7479         * src/dircolors.c (parse_line): Add casts to avoid errors from
7480         Irix4's `cc' C compiler.  From Kaveh Ghazi.
7481
7482         * lib/xstrtol.c: Include stdio.h.  Required on some systems when
7483         using assert.  From Kaveh Ghazi.
7484
7485         * tests/mv/backup-is-src: Use cmp, not diff.
7486         Reported by Kaveh Ghazi.
7487
7488 1998-07-03  Jim Meyering  <meyering@ascend.com>
7489
7490         * Version 3.16r.
7491
7492         * src/remove.c (remove_dir): Use fprintf (not error) to avoid
7493         newline in prompt.
7494
7495 1998-06-30  Paul Eggert  <eggert@shade.twinsun.com>
7496
7497         * lib/mountlist.c (read_filesystem_list):
7498         Don't leak memory on failure.
7499         Don't create a dummy struct mount_entry entry;
7500         use the address-of-the-tail-address method instead.
7501         Preserve errno if possible on failure, setting it to 0 if inapplicable.
7502         Close file descriptor leak if the F_SETLKW failed.
7503         Report an error if SVR4 lock file cannot be opened for some reason
7504         other than a nonexistent lock file.
7505
7506 1998-07-03  Jim Meyering  <meyering@ascend.com>
7507
7508         * configure.in (AM_WITH_REGEX): Remove.  Now the replacement
7509         macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
7510         * acconfig.h (WITH_REGEX): Remove undef.
7511         * lib/Makefile.am (noinst_HEADERS): Add regex.h.
7512         * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
7513         * lib/rx.c: Remove file.
7514         * lib/rx.h: Remove file.
7515
7516         * src/df.c (df_readable): Rename local so as not to shadow global.
7517
7518         * src/copy.c (SAME_INODE): New macro.
7519         Use it to replace open-coded equivalents.
7520         (copy_internal): Rename variable and reverse sense of tests
7521         to make the code a little clearer.
7522
7523 1998-07-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7524
7525         * src/copy.c (copy_internal): Try harder identifying a relative
7526         symbolic link in the current directory.
7527
7528         * src/copy.c (copy_internal): Don't skip test for same file if
7529         creating a hardlink from symlink over a non-symlink while making
7530         backups.
7531         * tests/cp/same-file: Skip tests that depend on link(2) not
7532         following symlinks.
7533
7534 1998-07-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7535
7536         * src/copy.c (copy_internal): Don't call chown on a symlink.
7537
7538 1998-07-01  Jim Meyering  <meyering@ascend.com>
7539
7540         * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
7541         configure's --disable-assert option.
7542
7543 1998-06-29  Paul Eggert  <eggert@twinsun.com>
7544
7545         * lib/mountlist.c (read_filesystem_list):
7546         Plug file descriptor leak on failure.
7547         Report failure if lock file can't be opened for some reason
7548         other than nonexistence.
7549
7550 1998-06-29  Jim Meyering  <meyering@ascend.com>
7551
7552         * Version 3.16q.
7553
7554         * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
7555         Always close stream and file descriptor before returning.
7556
7557         * src/df.c (main): Move the test of the result of the
7558         read_filesystem_list call up out of if-block -- code in the
7559         else-block depends on it too.
7560
7561 1998-06-29  Paul Eggert  <eggert@twinsun.com>
7562
7563         * lib/mountlist.c (read_filesystem_list): If SVR4, lock
7564         /etc/.mnttab.lock if available, to avoid race conditions
7565         (e.g. with the automounter on Solaris 2.6).
7566
7567         Include <errno.h>, <fcntl.h>, <unistd.h>.
7568
7569 1998-06-29  Jim Meyering  <meyering@ascend.com>
7570
7571         * lib/mountlist.c (fstype_to_string): Guard with
7572         #if ! HAVE_F_FSTYPENAME_IN_STATFS.
7573
7574 1998-06-28  Paul Eggert  <eggert@twinsun.com>
7575
7576         Add support for new --block-size option and
7577         BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
7578         Adjust df output slightly to accommodate larger filesystems.
7579
7580         * lib/human.c, lib/human.h (human_readable): Coalesce last two args
7581         into one, for convenience.  All callers changed.
7582         (human_block_size): New function.
7583         * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
7584         Include <stdlib.h> if HAVE_STDLIB_H;
7585         declare getenv unless HAVE_DECL_GETENV.
7586         (_): New macro.
7587         Include <argmatch.h>, <error.h>, <xstrtoul.h>.
7588         (DEFAULT_BLOCK_SIZE): New macro.
7589         (block_size_args, block_size_types): New constants.
7590         (humblock): New function.
7591         * lib/xstrtol.h (__ZLONG_MAX): Remove.
7592         * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
7593         unsigned long to double without losing information.
7594         (bkm_scale_by_power): New function.
7595
7596         * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
7597         Add support for SI-like suffixes like "GB" and "TD".
7598         * src/dd.c (usage): Describe it.
7599
7600         * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
7601         Remove; replace with new variable output_block_size.  All uses changed.
7602         (long_options, usage, main): Add --block-size.
7603         (main, decode_switches): Use new human_block_size function to
7604         initialize output block size consistently with other programs.
7605
7606         * src/df.c (print_header, show_dev): Shrink some columns and expand
7607         others, to squeeze in support for today's larger filesystems.
7608         (print_header): Print output block size using power-of-1024 SI format.
7609         (df_readable): Coalesce last two args into one, for convenience.
7610         All callers changed.
7611         (main): Remove check for portable output format and larger
7612         or human-readable block sizes.
7613
7614         * NEWS, doc/fileutils.texi: Describe above changes.
7615
7616 1998-06-28  Jim Meyering  <meyering@ascend.com>
7617
7618         * src/ls.c (usage): Make --kilobytes description consistent with
7619         that in du and df.  From Göran Uddeborg.
7620
7621         * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
7622         now that we're using the jm_FSTYPENAME autoconf macro.
7623         James Tanis reported the old version didn't compile on BSDI3.
7624
7625         * configure.in: Move big block of list_mounted_fs checks into
7626         new jm_LIST_MOUNTED_FILESYSTEMS macro.
7627         Use new jm_FSTYPENAME macro.
7628
7629         * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
7630         * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
7631         FPUTS_LITERAL
7632
7633 1998-06-27  Jim Meyering  <meyering@ascend.com>
7634
7635         * src/copy.c (copy_reg): Detect identical source and dest here.
7636         (copy_internal): Make the test symmetric.
7637
7638         * tests/cp/same-file: New file.
7639         * tests/cp/Makefile.am (TESTS): Add it.
7640
7641 1998-06-26  Jim Meyering  <meyering@ascend.com>
7642
7643         * src/remove.c (remove_file): Remove `non-directory' part of
7644         `removing non-directory FILE' verbose message.
7645
7646 1998-06-23  Jim Meyering  <meyering@ascend.com>
7647
7648         * src/df.c (show_dev): Increase field width for blocks, used,
7649         and available columns from 7 to 8.
7650
7651 1998-06-21  Jim Meyering  <meyering@ascend.com>
7652
7653         * aclocal.m4: Regenerate with fixed gettext.m4 installed.
7654         See README-alpha for details.
7655
7656 1998-06-02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7657
7658         * src/automake-wrap: Quote `&' in sed replacement text.
7659
7660 1998-05-31  Jim Meyering  <meyering@ascend.com>
7661
7662         * Version 3.16p.
7663
7664         * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
7665         Reported by Don Parsons.
7666
7667 1998-05-30  Jim Meyering  <meyering@ascend.com>
7668
7669         * tests/ls/time-1: Clean up ctime test.  Note that it fails also
7670         on Solaris5.5.1 tmpfs file systems.
7671
7672         Solve the `rm -f rm' problem more cleanly.
7673         * src/.rm-warning: Remove file.
7674         * src/automake-wrap: New file.
7675         * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
7676         (Makefile.in): Depend on automake-wrap.
7677         (EXTRA_DIST): Add automake-wrap.
7678         (DISTCLEANFILES): Remove definition.
7679         (rm_DEPENDENCIES): Likewise.
7680         (.rm-warn-stamp): Remove rule.
7681
7682 1998-05-27  Jim Meyering  <meyering@ascend.com>
7683
7684         * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
7685         * tests/ls/rt-1: New file, renamed from cr-1.
7686
7687 1998-05-26  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7688
7689         * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
7690
7691         * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
7692         to set it reliably.
7693
7694 1998-05-25  Jim Meyering  <meyering@ascend.com>
7695
7696         * configure.in (_GNU_SOURCE): AC_DEFINE it here.
7697         * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
7698         [!_GNU_SOURCE]: Add #undef instead.
7699
7700 1998-05-24  Jim Meyering  <meyering@ascend.com>
7701
7702         * Version 3.16o.
7703
7704         * src/ansi2knr.c: Use new version from automake-1.3.
7705
7706         * src/chown.c: Accept new option, --dereference.
7707         --no-dereference is now the default.
7708         (enum Change_status) [CH_NOT_APPLIED]: New member.
7709         (change_symlinks): Enable this by default, now.
7710         (describe_change): Handle new case.
7711         (change_file_owner): Add new parameter: cmdline_arg.  Update callers.
7712         Reorganize to reflect changed semantics.
7713         (LCHOWN): Remove definitions.
7714
7715         * lib/lchown.c: New file.
7716
7717 1998-05-21  Jim Meyering  <meyering@ascend.com>
7718
7719         * configure.in (ALL_LINGUAS): Add russian (ru).
7720
7721 1998-05-16  Jim Meyering  <meyering@ascend.com>
7722
7723         * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
7724         (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
7725
7726         * lib/hash.c (is_prime): Ansideclify.
7727         (next_prime): Ansideclify.  Add an assertion.
7728
7729         * lib/Makefile.am (EXTRA_DIST): Remove.  Automake groks the `LIBOBJS='
7730         lines from the m4/*.m4 macros, so the hack of including some
7731         custom-replaced C source file names here is no longer needed.
7732
7733         * configure.in (jm_MACROS): New wrapper macro.
7734         Remove uses of most jm_* macros.
7735
7736         * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef.  Now it's handled
7737         as part of utimbuf.m4.
7738         (memcmp): Add #undef.
7739
7740 1998-05-12  Jim Meyering  <meyering@ascend.com>
7741
7742         * configure.in: Use my replacement AC_ISC_POSIX rather than
7743         open-coding it.
7744
7745         * src/copy.c (copy_internal): Plug a small leak.
7746
7747 1998-05-10  Jim Meyering  <meyering@ascend.com>
7748
7749         * src/mv.c (do_move): Remove lots of code that was duplicated in
7750         copy.c (copy), now that copy() has better support for mv.  This fixes
7751         a bug with cross-filesystem `mv -i' whereby you could get two prompts
7752         for the same destination file and eventually remove the destination
7753         file even though one of the responses was negative.
7754         Reported by Dirk Lattermann.
7755
7756         * src/copy.h: Better support for mv:
7757         [struct cp_options] (move_mode): New member.
7758         * src/copy.c (copy_internal): Use new move_mode member.
7759         Add parameter.
7760         (copy): Add parameter.
7761
7762         * tests/cp/Makefile.am (TESTS): Add backup-is-src.
7763         * tests/mv/Makefile.am (TESTS): Likewise.
7764
7765         * lib/userspec.c: Don't declare strdup if it's defined as a macro.
7766         Reported by Lorne Baker.
7767
7768         * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
7769
7770         * src/mv.c (cp_option_init): Initialize new members.
7771         * src/cp.c (cp_option_init): Likewise.
7772         (main): Set new preserve_* options.
7773
7774 1998-05-09  Jim Meyering  <meyering@ascend.com>
7775
7776         * src/copy.h: Support for install:
7777         [struct cp_options] (failed_unlink_is_fatal): New member.
7778         (preserve_owner_and_group): New member.
7779         (preserve_chmod_bits): New member.
7780         (preserve_timestamps): New member.
7781         (preserve): Remove member.
7782         (set_mode): New member.
7783         (mode): New member.
7784         * src/copy.c (new_nondir_mode): New function.  Use where appropriate.
7785         Use more-specific preserve_* members in place of removed `preserve'.
7786         (copy_internal): Honor failed_unlink_is_fatal.
7787
7788         * src/install.c (main): Rewrite argv-handling to be clearer.
7789         (copy_file): Rewrite to use copy.c (copy).
7790         (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
7791         `no_need_to_chown' parameter.  Fix caller.
7792         (install_file_in_file): Remove now-unnecessary `to_created' parameter.
7793         (cp_option_init): New function.
7794         Update several functions to take new parameter specifying copy options.
7795
7796         * tests/install: New subdir, with one basic test.
7797         * tests/Makefile.am (SUBDIRS): Add install.
7798         * configure.in (AC_OUTPUT): Add tests/install/Makefile.
7799
7800         * src/dd.c: Include safe-read.h.
7801         Don't declare safe_read.
7802         * src/touch.c: Likewise.
7803
7804         * configure.in (jm_TYPE_SSIZE_T): Use it.
7805         * acconfig.h (ssize_t): Add undef.
7806
7807 1998-05-03  Jim Meyering  <meyering@ascend.com>
7808
7809         * po/: Update from gettext-0.10.35.
7810         * intl/: Likewise.
7811         * configure.in: Remove use of AC_LINK_FILES.
7812         (AC_OUTPUT): Remove po/Makefile-generating sed command.
7813
7814 1998-04-28  Jim Meyering  <meyering@ascend.com>
7815
7816         * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
7817         Use unsigned char * pointers, not potentially signed ones, to avoid
7818         sign extension.
7819
7820 1998-04-26  Jim Meyering  <meyering@ascend.com>
7821
7822         * configure.in: Use jm_ASSERT.
7823         * acconfig.h: Add NDEBUG.
7824
7825         * src/mv.c: Don't define NDEBUG.
7826         * src/cp.c: Likewise.
7827
7828 1998-04-14  Jim Meyering  <meyering@ascend.com>
7829
7830         * src/.rm-warning: New file.
7831         * src/Makefile.am (EXTRA_DIST): Add .rm-warning
7832         (DISTCLEANFILES): Add .rm-warn-stamp.
7833         (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
7834         (.rm-warn-stamp): New rule.
7835         (rm_prep): Comment out rule.
7836
7837         * src/df.c (main): Use STREQ in string equality tests, not strcmp.
7838         * src/dircolors.c (dc_parse_stream): Likewise.
7839         (dc_parse_file): Likewise.
7840         * src/du.c (main): Likewise.
7841         * src/ls.c (decode_switches): Likewise.
7842         * src/remove.c (hash_compare_strings): Likewise.
7843         * src/touch.c (main): Likewise.
7844
7845 1998-04-13  Jim Meyering  <meyering@ascend.com>
7846
7847         * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
7848
7849 1998-04-11  Jim Meyering  <meyering@ascend.com>
7850
7851         * lib/hash.c: Add curly braces around statements in
7852         if/else/while/do/etc. that span more than a line -- even around
7853         multiline simple statements or single-line simple statements
7854         preceded by a comment line.
7855
7856 1998-04-09  Jim Meyering  <meyering@ascend.com>
7857
7858         * configure.in: Don't use AC_PATH_PROG to check for perl, now that
7859         we use jm_PERL.
7860
7861 1998-04-06  Jim Meyering  <meyering@ascend.com>
7862
7863         * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
7864         hash_insert.  Also declare to be static.
7865         * src/cp-hash.h (hash_insert): Remove declaration.
7866
7867         * lib/hash.c: Lots of minor spec and name changes, and new comments.
7868         (hash_rehash): Rewrite to be easier on the allocator.
7869         From François Pinard.
7870         * lib/hash.h: More comments.
7871         * src/remove.c: Change names/usage of hash-related functions to work
7872         with the above.
7873
7874 1998-04-05  Jim Meyering  <meyering@ascend.com>
7875
7876         * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
7877         This now depends on HAVE_BTOWC so systems that lack btowc (like
7878         solaris-2.5.1) don't lose.
7879
7880 1998-04-04  Jim Meyering  <meyering@eng.ascend.com>
7881
7882         * GNUmakefile: Add conditionals so that running `make' in an
7883         unconfigured source directory will get a reasonable diagnostic.
7884
7885         * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
7886         know about the m4/ subdirectory.
7887         * Makefile.maint (aclocal-files): Remove now-unnecessary (with
7888         automake-1.2h and the above change) aclocal-related rules and includes.
7889
7890 1998-04-01  Jim Meyering  <meyering@eng.ascend.com>
7891
7892         * tests/ls/cr-1: New file.
7893         * tests/ls/Makefile.am (TESTS): Add cr-1.
7894
7895 1998-03-31  Jim Meyering  <meyering@eng.ascend.com>
7896
7897         * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
7898         works with `unsigned char'.
7899         From Greg Wooledge.
7900         (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
7901
7902         * lib/xstrtol.c: Merge with the version from textutils.
7903
7904         * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
7905
7906 1998-03-30  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
7907
7908         * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
7909         rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
7910         rev_cmp_size): Use file name as secondary sort key to get
7911         consistent sorting.
7912
7913 1998-03-28  Jim Meyering  <meyering@eng.ascend.com>
7914
7915         * src/copy.c: Add copyright.
7916         * src/remove.c: Add copyright.
7917         [_AIX]: Add #pragma alloca.
7918
7919 1998-03-27  Jim Meyering  <meyering@eng.ascend.com>
7920
7921         * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
7922         dependency and the := assignment of ACLOCAL to make the default
7923         rule use the `-I m4' option.
7924
7925         * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
7926
7927 1998-03-23  Jim Meyering  <meyering@eng.ascend.com>
7928
7929         * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
7930         automatically handles it.
7931
7932 1998-03-21  Jim Meyering  <meyering@eng.ascend.com>
7933
7934         * lib/quotearg.h: Update from patch-2.5.3.
7935         * lib/quotearg.c: Likewise.
7936         * src/ls.c (decode_switches): Pass a null pointer instead of address
7937         of quotearg_quoting_options.
7938
7939 1998-03-19  Paul Eggert  <eggert@twinsun.com>
7940
7941         * lib/fsusage.h (struct fs_usage): New member
7942         fsu_bavail_top_bit_set.
7943         * lib/fsusage.c: Include <limits.h>.
7944         (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
7945         (get_fs_usage): If top bit of system variable corresponding to
7946         fsu_bavail is set, then set fsu_bavail_top_bit_set, and
7947         sign-extend the value when storing it into fsu_bavail.
7948         * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
7949         assume the original value corresponding to fsu_bavail was negative.
7950         Reported by Arne Juul.
7951
7952 1998-03-18  Jim Meyering  <meyering@eng.ascend.com>
7953
7954         * src/Makefile.am (rm-prep): Add dependency and rule to save users
7955         with `.' too early in their PATH from the `rm: cannot unlink `rm':
7956         Text file busy' error.  Suggestion from Philippe De Muyter.
7957
7958 1998-03-15  Jim Meyering  <meyering@eng.ascend.com>
7959
7960         * Version 3.16n.
7961
7962         * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
7963         * lib/closeout.c: Likewise.
7964         * lib/dirname.c: Likewise.
7965         * lib/euidaccess.c: Likewise.
7966         * lib/fileblocks.c: Likewise.
7967         * lib/filemode.c: Likewise.
7968         * lib/ftruncate.c: Likewise.
7969         * lib/group-member.c: Likewise.
7970         * lib/isdir.c: Likewise.
7971         * lib/long-options.c: Likewise.
7972         * lib/mountlist.c: Likewise.
7973         * lib/path-concat.c: Likewise.
7974         * lib/save-cwd.c: Likewise.
7975         * lib/savedir.c: Likewise.
7976         * lib/strcasecmp.c: Likewise.
7977         * lib/strdup.c: Likewise.
7978         * lib/userspec.c: Likewise.
7979         * lib/yesno.c:: Likewise.
7980
7981         * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
7982         Use #if !, not #ifndef with HAVE_ macros.
7983         * src/chown.c: Likewise.
7984         * src/copy.c: Likewise.
7985         * src/dd.c: Likewise.
7986         * src/dircolors.c: Likewise.
7987         * src/install.c: Likewise.
7988         * src/ls.c: Likewise.
7989         * src/mv.c: Likewise.
7990         * src/touch.c: Likewise.
7991
7992         * configure.in: Use jm_PREREQ.
7993
7994 1998-03-14  Jim Meyering  <meyering@eng.ascend.com>
7995
7996         Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
7997         With automake-1.2f, that hack is no longer needed.
7998
7999         * src/remove.c: Use `virtual memory exhausted' message, not
8000         `Memory exhausted' to be consistent with the majority of other
8001         such messages.
8002         Say `removing all...', not `removing any...'.
8003         * src/rmdir.c (remove_parents): Be consistent with documentation of
8004         --verbose option and with remove.c in saying `removing...' before
8005         the operation is attempted.
8006         (main): Likewise.
8007         Suggestions from Santiago Vila.
8008
8009         * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
8010         (copy_internal): Likewise.
8011         (copy): Likewise.
8012         Update all callers.
8013         * src/copy.h (copy): Update prototype.
8014         * src/cp.c (do_copy): Add unused arg in calls to copy.
8015         * src/mv.c (do_move): Add &copy_into_self arg in call to copy.
8016         Don't remove source directory when copy_into_self is nonzero.
8017         Reported by Arne Henrik Juul.
8018
8019         * tests/mv/into-self: Test for the above.
8020         * tests/mv/Makefile.am (TESTS): Add into-self.
8021
8022 1998-02-28   Eli Zaretskii  <eliz@is.elta.co.il>
8023
8024         * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
8025         about any arbitrary user and group by pretending to be the user
8026         and to belong to the group specified in `spec_arg' argument.
8027
8028         * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
8029         any arbitrary user name.
8030         (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
8031         group name.
8032
8033 1998-02-24  Jim Meyering  <meyering@eng.ascend.com>
8034
8035         * lib/xstrtol.c (TYPE_SIGNED): Define.
8036         (TYPE_MAXIMUM): Define.
8037         (ULONG_MAX): Use TYPE_MAXIMUM.
8038         (LONG_MAX): Use TYPE_MAXIMUM.
8039
8040         * lib/fnmatch.c: Update from libit.
8041         * lib/idcache.c: Update from libit.
8042
8043 1998-02-23  Paul Eggert  <eggert@twinsun.com>
8044
8045         * lib/quotearg.h, lib/quotearg.c: New files.
8046         * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
8047         (noinst_HEADERS): Add quotearg.h.
8048
8049         * src/ls.c: Include new file quotearg.h.
8050         (enum indicator_style): Rename all to classify, and not_programs
8051         to file_type, to match option spellings.  All users changed.
8052         (indicator_style_args): New constant.
8053         (quote_funny_chars, quote_as_string, quote_shell): Remove;
8054         (filename_quoting_options, dirname_quoting_options): Use these
8055         variables instead.
8056         (long_options): Add --indicator-style, --quoting-style,
8057         --show-control-chars.  Remove --quote-shell.
8058         (dired_dump_obstack): Remove style parameter and don't output style.
8059         (main): Go back to previous method of outputting //DIRED//
8060         and //SUBDIRED// lines, without style.  But add a new
8061         //DIRED-OPTIONS// line that does output style.
8062         (decode_switches, usage): Add --indicator-style, --quoting-style,
8063         --show-control-chars.  Remove --quote-shell.
8064         (decode_switches): Default from QUOTING_STYLE environment variable.
8065         Set new quoting vars.
8066         (quote_name): Renamed from quote_filename.
8067         Take new arg specifying quoting options.
8068         Always print; do not have a special case for null FILE * argument.
8069         All callers changed.
8070         Move the guts of this function to new file quotearg.c.
8071         (length_of_file_name_and_frills): Use quotearg_buffer instead
8072         of (old) quote_filename to find length of file name.
8073
8074         (decode_switches, parse_ls_color, print_dir, gobble_file,
8075         get_link_name): Quote output in diagnostics.
8076
8077         * NEWS, doc/fileutils.texi: Describe above changes.
8078         * doc/fileutils.texi: Mention that control characters are output
8079         as question marks if output is a terminal.
8080
8081 1998-02-22  Jim Meyering  <meyering@eng.ascend.com>
8082
8083         * Version 3.16m.
8084
8085         * ChangeLog-1997: New file.
8086         * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
8087
8088 1998-02-21  Jim Meyering  <meyering@eng.ascend.com>
8089
8090         * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
8091         * tests/Makefile.am (SUBDIRS): Add mv.
8092         * tests/mv: New directory
8093         * tests/mv/mv-special-1: New test.
8094
8095 1998-02-20  Jim Meyering  <meyering@eng.ascend.com>
8096
8097         * src/touch.c: Include get-date.h.
8098         Remove get_date decl.
8099
8100         * lib/getdate.h: Removed.  Could cause confusion with an
8101         automake-generated `.y.h' rule.
8102         * lib/get-date.h: Renamed from getdate.h.
8103         * lib/getdate.y: s/getdate.h/get-date.h/
8104         * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
8105
8106 1998-02-19  Jim Meyering  <meyering@eng.ascend.com>
8107
8108         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
8109         * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
8110
8111 1998-02-13  Jim Meyering  <meyering@eng.ascend.com>
8112
8113         * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
8114         Otherwise, mv tries to open special files.
8115         Reported by Kjetil Torgrim Homme.
8116
8117 1998-02-08  Jim Meyering  <meyering@eng.ascend.com>
8118
8119         * Makefile.maint (cvs-dist): Update po/ to clear modified status
8120         of *.po files before running cvs tag -c.
8121
8122         * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
8123         description.
8124
8125 1998-02-07  Jim Meyering  <meyering@eng.ascend.com>
8126
8127         * GNUmakefile: New file.
8128         * Makefile.am (EXTRA_DIST): Add GNUmakefile.
8129         Don't include Makefile.maint from here.  It's included from GNUmakefile.
8130
8131         * configure.in: Don't use AM_MAINTAINER_MODE.
8132         (jm_PERL): Use this.
8133
8134         * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl.  Add dcgen.
8135         (CLEANFILES): Remove dcgen.
8136         (dircolors.h): Use $(PERL).
8137         (.pl): Remove rule.
8138
8139 1998-02-01  Jim Meyering  <meyering@na-net.ornl.gov>
8140
8141         * POTFILES.in: Add remove.c.  Reported by Santiago Vila.
8142
8143 1998-01-28  Jim Meyering  <meyering@na-net.ornl.gov>
8144
8145         * src/df.c (print_header): Tweak format to align heading over
8146         last column of `df -i' output.  From Andreas Schwab.
8147
8148 1998-01-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
8149
8150         * Makefile.am: Include Makefile.maint from $(srcdir).
8151
8152 1998-01-25  Jim Meyering  <meyering@na-net.ornl.gov>
8153
8154         * Version 3.16l.
8155
8156         * Makefile.maint: New file.
8157         * Makefile.am: Move rules common to textutils, fileutils, sh-utils
8158         into Makefile.maint.
8159         Include Makefile.maint.
8160         (EXTRA_DIST): Add Makefile.maint.
8161
8162         * src/cp.c (re_protect): Don't fail for non-root when chown fails
8163         due not only to lack of permission (EPERM), but also to lack of
8164         support (EINVAL).  Reported by Bengt Martensson.
8165         * src/copy.c (DO_CHOWN):  Likewise.
8166
8167 1998-01-24  Jim Meyering  <meyering@na-net.ornl.gov>
8168
8169         * tests/ls/time-1 (test_failure): Rename does not update ctime;
8170         link does -- so use ln, not mv.
8171         Note that the SunOS4.1.4 failure of the ctime test is expected.
8172
8173         * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
8174         bug in Cray C 5.0.3.0 when T == time_t.
8175
8176         * tests/rm/r-1: Adjust expected output for changed format of
8177         `rm --verbose'.
8178         * tests/rm/r-2: Likewise.
8179
8180 1998-01-23  Jim Meyering  <meyering@na-net.ornl.gov>
8181
8182         * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
8183         C compiler.  From Kaveh Ghazi.
8184         (TYPE_MINIMUM): Define.
8185         (TYPE_MAXIMUM): Define.
8186         (TIME_T_MIN): Use TYPE_MINIMUM.
8187         (TIME_T_MAX): Use TYPE_MAXIMUM.
8188
8189 1998-01-22  Jim Meyering  <meyering@na-net.ornl.gov>
8190
8191         * src/dd.c: Reorder functions to obviate forward dcls.
8192         (quit): Declare to be inline to stifle compile warning.
8193
8194         * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
8195
8196         * tests/rm/sunos-1: Don't use -f.  Do adjust $RM if it's a
8197         relative path.
8198
8199         * tests/ls/time-1: Use GNU touch to work around problems with NFS
8200         caching and/or clock skew.  Reported by Kaveh Ghazi.
8201
8202         * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
8203
8204         * src/Makefile.am (noinst_HEADERS): Add remove.h.
8205         (mv_SOURCES): Define.
8206         (rm_SOURCES): Define.
8207
8208 1998-01-21  Jim Meyering  <meyering@na-net.ornl.gov>
8209
8210         * src/install.c: Declare new global, backup_type.
8211         (main): Initialize backup_type unconditionally.
8212         (copy_file): Call find_backup_file_name with new argument, backup_type.
8213         * src/ln.c: Declare new global, backup_type.
8214         (main): Initialize backup_type unconditionally.
8215         (do_link): Call find_backup_file_name with new argument, backup_type.
8216
8217         * src/copy.c (copy_internal): Use x->backup_type, not the global.
8218         (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
8219
8220         * src/copy.h (VALID_SPARSE_MODE): Define.
8221         [struct cp_options] (backup_type): New member.
8222
8223         * src/cp.c [NDEBUG]: Comment out definition.
8224         (do_copy): Use x->backup_type, not the global.
8225
8226         * src/remove.c: New file.  Contains guts of old rm.c.
8227         (remove_init): New function.
8228         (remove_fini): New function.
8229         (rm): Take third argument, specifying options.
8230         * src/remove.h: New file.  Associated dcls.
8231         * src/rm.c: Remove and minimally librarify guts for use in mv.c.
8232         (main): Pass options (`&x') to rm.
8233         Call remove_init and remove_fini instead of open-coding them.
8234
8235         * src/mv.c (rm_option_init): New function.
8236         (cp_option_init): New function.
8237         (copy_reg): Remove now-unused function.
8238         (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
8239         Set up for and use `remove.c (rm)' in place of unlink.
8240
8241 1998-01-20  Jim Meyering  <meyering@na-net.ornl.gov>
8242
8243         * lib/backupfile.c: Use ANSI function definitions.
8244         Remove global declaration of backup_type.
8245         (simple_backup_suffix): Default to `~', not `.orig'.
8246         Use PARAMS, not __BACKUPFILE_P.
8247         (find_backup_file_name): Add parameter, backup_type.
8248         * lib/backupfile.h: Remove extern declaration of backup_type.
8249         Use PARAMS, not __BACKUPFILE_P.
8250         (VALID_BACKUP_TYPE): Define.
8251         (find_backup_file_name): Adjust prototype.
8252
8253 1998-01-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
8254
8255         * src/df.c (print_header): Fix inode format header to line it up
8256         with the rest of the output.
8257
8258 1998-01-13  Jim Meyering  <meyering@na-net.ornl.gov>
8259
8260         * lib/stat.c: Set errno to ENOENT, not EINVAL.  This is consistent
8261         with most other implementations.
8262
8263 1998-01-12  Jim Meyering  <meyering@na-net.ornl.gov>
8264
8265         * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
8266         Move function-spanning `#if ...BSIZE' directive to follow inclusion
8267         of sys/param.h since BSIZE is sometimes defined in sys/param.h.
8268         Reported by Philippe De Muyter.
8269
8270 1998-01-10  Jim Meyering  <meyering@na-net.ornl.gov>
8271
8272         * Version 3.16k.
8273
8274         * src/install.c (install_file_to_path): New function.
8275         FIXME: update fileutils.texi.
8276         (main): Handle new option, -D.
8277         Based on a patch from Marty Leisner.
8278         (usage): Describe -D.
8279
8280         * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
8281         with -l or -t.  Now, -u (like -c) implies --sort=time.
8282         (usage): Correct descriptions of --sort, --time, and -t.
8283         Suggestions from Andreas Schwab.
8284
8285         Add test for the above fix.
8286         * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
8287         * tests/Makefile.am (SUBDIRS): Add ls.
8288         * tests/ls: New directory.
8289         * tests/ls/Makefile.am: New file.
8290         * tests/ls/time-1: New file.
8291
8292         * lib/makepath.c (make_path): Reformat 3 if-stmts to test
8293         `if (newly_created_dir)' only once.  Suggestion from Andreas Schwab.
8294
8295 1998-01-06  Jim Meyering  <meyering@na-net.ornl.gov>
8296
8297         * lib/getdate.y: Move inclusion of getdate.h and dependent extern
8298         declarations down so getdate.h's prototype follows the sometimes-
8299         enabled definition of `const' to nothing.  Otherwise, the prototype
8300         wouldn't match the definition because of the defined-away `const'.
8301         From Kaveh Ghazi.
8302         (get_date): ANSI-fy definition.
8303         Add %expect directive.
8304
8305 1998-01-05  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
8306
8307         * lib/makepath.c (make_path): Put only newly created directories
8308         on the LEADING_DIRS list.
8309
8310 1998-01-05  Paul Eggert  <eggert@twinsun.com>
8311
8312         * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
8313         (get_fs_usage): If a value consists entirely of 1 bits,
8314         propagate this info to the output by setting it to (uintmax_t) -1.
8315         * src/df.c (df_readable): New function.
8316         (show_dev): If a value consists entirely of 1 bits, or is derived
8317         from some other value that consists entirely of 1 bits, report "-".
8318         Check inode and block counts more carefully for plausibility,
8319         to avoid arithmetic overflow when computing percentages.
8320
8321 1998-01-04  Jim Meyering  <meyering@na-net.ornl.gov>
8322
8323         * Version 3.16j.
8324
8325         * lib/Makefile.in: Regenerated with patched automake-1.2d.
8326         See README-alpha.
8327
8328         * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
8329         the two booleans, verbose and changes_only.  This fixes a bug whereby
8330         --change had the same effect as --verbose.
8331         * src/chmod.c: Likewise.
8332         * src/chown.c: Likewise.
8333         Reported by Paul Eggert.
8334
8335 1998-01-04  Paul Eggert  <eggert@twinsun.com>
8336
8337         Check for write errors more carefully.
8338
8339         * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
8340         (noinst_HEADERS): Add closeout.h.
8341         * lib/closeout.c, lib/closeout.h: New files.
8342         * lib/long-options.c (parse_long_options),
8343         src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
8344         src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
8345         src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
8346         src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
8347         (main, usage): Check for write error to stdout before exiting.
8348         Include "closeout.h".
8349
8350 1998-01-03  Jim Meyering  <meyering@na-net.ornl.gov>
8351
8352         * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
8353         just like `fsu.fsu_blocks == 0' as an indicator that usage information
8354         is invalid.  This happens with Solaris-5.5.1 CD-ROM mount points.
8355
8356         * lib/save-cwd.h: Guard PARAMS-enabling definition with
8357         `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
8358         problems with Irix4's cc.  From Kaveh Ghazi.
8359         * lib/getdate.h: Likewise, but just to be consistent.
8360
8361         * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
8362         those files will be built via the ANSI2KNR-filtering rules if necessary.
8363         Reported by Kaveh Ghazi.
8364
8365 1998-01-02  Jim Meyering  <meyering@na-net.ornl.gov>
8366
8367         * Version 3.16i.
8368
8369         Fix problem with `install -d'.  Reported by Marty Leisner.
8370
8371         * src/install.c (get_ids): When otherwise unspecified,
8372         set uid and gid to -1.
8373         * lib/makepath.c (make_path): Try to change ownership only if we've
8374         just created the directory.  Fix latent bug (s/&&/||/ in two places --
8375         also, note that it could not be exercised via install or mkdir)
8376         whereby chown would not be invoked when only one of owner/group is
8377         not -1.
8378
8379 1998-01-01  Jim Meyering  <meyering@na-net.ornl.gov>
8380
8381         * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
8382         only once and never free it.