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