1 2000-11-11 Jim Meyering <meyering@lucent.com>
5 * Makefile.maint (GZIP_ENV): Define to --no-name, so the timestamp
6 is not included in the .tar.gz file.
8 * tests/mkdir/perm (tests): Use `empty' (instead of just blanks) to
9 indicate no `-m' option. Using just blanks wasn't portable to
10 Solaris2.5.1's /bin/sh.
12 * tests/mkdir/perm: Don't put a newline in IFS; that's not portable to
13 NetBSD's /bin/sh. Instead, filter newlines and leading/trailing blanks
14 out of `tests' before the `set -'.
16 * Makefile.maint (announcement): Limit depth of ChangeLog `find' to 2.
18 * src/ls.c (print_long_format): Wrap the `--full-time' date format
19 string in _(...), so it too may be internationalized.
20 Suggestion from Jungshik Shin.
22 2000-11-10 Jim Meyering <meyering@lucent.com>
24 * src/touch.c (main): Interpret a lone numeric argument of 8 or 10
25 digits as a file name, rather than as a date/time in the obsolescent
26 `MMDDhhmm[YY]' format. Reported by Wenjun Zheng.
27 * tests/touch/obsolescent: New test for this.
28 * tests/touch/Makefile.am (TESTS): Add obsolescent.
30 2000-11-06 Jim Meyering <meyering@lucent.com>
32 * tests/cp/cp-parents: Move mkdir tests into ../mkdir.
34 * doc/fileutils.texi: Use Free Documentation Licence.
35 Change GNU to @sc{gnu} in many places.
37 * doc/texinfo.tex: Update from master repository.
38 * config.sub: Likewise.
39 * config.guess: Likewise.
40 * man/help2man: Update from latest version: 1.23.
42 * src/mkdir.c: Do not set the permissions of the final directory
43 component if it was not just created.
44 Based on a patch from Volker Borchert.
46 * tests/rwx-to-mode: New file.
47 * tests/Makefile.am (EXTRA_DIST): Add rwx-to-mode.
48 * tests/mkdir/parents: New test for the above mkdir.c fix.
49 * tests/mkdir/Makefile.am (TESTS): Add parents.
50 (TESTS_ENVIRONMENT): Define srcdir=$(srcdir).
52 2000-11-02 Won-kyu Park <wkpark@chem.skku.ac.kr>
54 * src/df.c (print_header): Mark strings for translation.
56 2000-11-05 Jim Meyering <meyering@lucent.com>
60 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
61 very latest version (in CVS) of autoconf.
63 * src/mkdir.c (main): Use make_dir instead of using mkdir directly.
64 Diagnose as failure when mkdir tries to create (without the
65 --parent (-p) option) a directory that already exists.
66 * tests/cp/cp-parents: Add a test for the above fix.
68 * tests/mv/mv-special-1: Clean up this test.
70 2000-11-01 Jim Meyering <meyering@lucent.com>
74 * src/chmod.c (main): Better diagnostics.
76 2000-10-31 Jim Meyering <meyering@lucent.com>
78 * tests/lang-default: Add all the internationalization-related
79 variable names autoconf uses. Set and export them in a loop.
81 `mkdir -p' would create parent directories with permissions
82 that did not account for the umask. [introduced with the
83 2000-09-30 change that became part of fileutils-4.0.28]
84 * src/mkdir.c: Include dirname.h.
85 Compute the parent directory `mode' unconditionally, effectively
86 as `$(umask -S),u+wx'.
87 Use make_path to create only the parent directories, thus using
88 the same code, both with and without -p, to create the final
89 component in each file name. Reported by Bob Proulx.
91 Add tests for the above fix.
92 * tests/cp/cp-parents: Add some permission tests.
93 * tests/mkdir/perm: Fix the test so it actually does something.
94 Run each test also with mkdir's `-p' option and check permissions
95 on the parent directories.
97 2000-10-23 Paul Eggert <eggert@twinsun.com>
99 * doc/getdate.texi: Use @sc where appropriate. Document the
100 ranges of supported times more precisely. Correct menu
101 spacing. Document old Latin 12m/12pm tradition. Remove list
102 of alphabetic time zone names, as it wasn't correct and people
103 shouldn't be relying on it anyway. Relative items also
104 account for non-DST adjustments. Fix some misspellings.
106 2000-10-30 Jim Meyering <meyering@lucent.com>
108 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
109 very latest version (in CVS) of autoconf.
111 2000-10-29 Jim Meyering <meyering@lucent.com>
115 * src/cp.c (do_copy): When constructing dst_path for use with the
116 --parents option, first remove any trailing slashes from the command
117 line argument. Otherwise, tests/cp/cp-parent would fail on NetBSD.
119 * tests/cp/cp-parents: Add a test.
121 * src/ls.c (DT_INIT): Define.
122 [enum filetype]: Remove the #ifdef, and use DT_INIT on the
123 initializers instead. `unknown' was undefined for some systems.
124 Reported by John David Anglin.
126 * tests/lang-default (LC_COLLATE): Set it to the empty string and
127 export it. Otherwise, tests/cp/cp-mv-backup would fail e.g., when
128 LC_COLLATE was set to en. Reported by Vin Shelton.
130 2000-10-28 Jim Meyering <meyering@lucent.com>
132 * src/ls.c (main): In call to gobble_file with `"."', use `directory'
133 as the type, not `unknown'.
134 [enum filetype] (arg_directory): Rather than `100', use
135 a number that should never conflict with another DT_* value.
140 Make `ls' a lot more efficient on systems (e.g., linux-2.4.*)
141 that store file type information in directory entries.
143 * src/ls.c [enum filetype] (unknown):
144 Add members (as yet unused):
145 (HAVE_STRUCT_DIRENT_D_TYPE): Define.
146 (format_needs_type): New global.
148 (print_dir): Set `type' from directory entry, if possible.
149 (gobble_file): Add a parameter, TYPE.
150 Stat the file only if its type is unknown and we need the type.
151 Patch from Ulrich Drepper.
153 Shred can now determine the size of a block devices (e.g. /dev/fd0)
154 by writing until a write operation fails.
156 * src/shred.c: Include assert.h.
157 (fillrand): Add a parameter, size_max.
160 (dopass): Break out of the `for (;;)' loop if size < offset.
161 That can happen now that dopass is called with SIZE == -1.
162 (do_wipefd): Accept a length of zero only for a regular file.
163 If lseek fails or returns 0 for a non-regular file, let dopass
164 determine the length.
165 Inspired by a patch from Alan Iwi.
167 * tests/Makefile.am (EXTRA_DIST): Add lang-default.
169 * tests/rm/hash: Factor out the expensive-test-checking code, ...
170 * tests/expensive: ... into this new file.
171 * tests/cp/perm: Disable this test by default; it's expensive.
172 Mark this as an expensive test.
173 * tests/Makefile.am (EXTRA_DIST): Add expensive.
175 * doc/fileutils.texi (shred invocation): Give two examples.
177 2000-10-26 Jim Meyering <meyering@lucent.com>
179 * doc/getdate.texi (Authors of getdate): Add Paul Eggert.
181 2000-10-23 Jim Meyering <meyering@lucent.com>
183 * Makefile.am (EXTRA_DIST): Add .prev-version.
185 2000-10-22 Jim Meyering <meyering@lucent.com>
187 * src/cp.c (make_path_private): Add a FIXME comment.
189 * tests/lang-default: New file. Set LANG, LC_ALL, and LANGUAGE to ''
190 (rather than to `C') and export them into the environment.
191 Suggestion from Bruno Haible.
193 * tests/cp/backup-is-src: Source lang-default rather than open-coding
194 the setting/exporting of LANG, LC_ALL, and LANGUAGE.
195 * tests/cp/cp-mv-backup: Likewise.
196 * tests/cp/same-file: Likewise.
197 * tests/cp/slink-2-slink: Likewise.
198 * tests/cp/symlink-slash: Likewise.
199 * tests/ln/sf-1: Likewise.
200 * tests/ls/symlink-slash: Likewise.
201 * tests/ls/time-1: Likewise.
202 * tests/mv/backup-is-src: Likewise.
203 * tests/mv/diag: Likewise.
204 * tests/mv/force: Likewise.
205 * tests/mv/hard-link-1: Likewise.
206 * tests/mv/i-2: Likewise.
207 * tests/mv/into-self: Likewise.
208 * tests/mv/into-self-2: Likewise.
209 * tests/mv/into-self-3: Likewise.
210 * tests/mv/mv-special-1: Likewise.
211 * tests/mv/part-symlink: Likewise.
212 * tests/mv/partition-perm: Likewise.
213 * tests/rm/r-1: Likewise.
214 * tests/rm/r-2: Likewise.
216 2000-10-21 Jim Meyering <meyering@lucent.com>
218 * tests/cp/cp-parents: New test.
219 * tests/cp/Makefile.am (TESTS): Add cp-parents;
221 2000-10-19 Jim Meyering <meyering@lucent.com>
223 * doc/texinfo.tex: Update from master repository.
224 * config.sub: Likewise.
225 * config.guess: Likewise.
228 2000-10-18 Jim Meyering <meyering@lucent.com>
230 * tests/mv/part-symlink: Make sure the programs use C-locale formats
231 and translations. Bruno Haible reported that this test would fail
232 when using other locales, because ls printed a translation of `total'.
234 2000-10-16 Jim Meyering <meyering@lucent.com>
236 * src/ls.c (print_long_format): Wrap date format strings in _(...)
237 so they may be internationalized. Suggestion from Christian Rose.
239 2000-10-13 Jim Meyering <meyering@lucent.com>
241 * src/mv.c (rm_option_init): Remove FIXME-maybe comment.
243 2000-09-30 Jim Meyering <meyering@lucent.com>
245 * tests/du/two-args: Update to use newer template.
247 * src/install.c: Remove big, option-describing comment block.
248 (main): Rename local `symbolic_mode' to `specified_mode'.
250 * src/mkdir.c (main): Don't set the umask to 0 and hand-apply
251 the previously-set umask unconditionally. Do that only when a
252 MODE has been specified. Otherwise, call mkdir with the full
253 creation mask (0777 or 0666) and let the kernel apply the umask.
254 The difference shows up only on file systems with ACL support
255 when the containing directory has a default ACL.
256 Patch by Andreas Gruenbacher.
257 (main): Rename local `symbolic_mode' to `specified_mode'.
258 * src/mknod.c (main): Likewise (but `call mknod', not mkdir).
259 Also, when MODE is specified, call chmod to ensure that the
260 permission bits are set as specified even when the containing
261 directory has a default ACL.
262 Patch by Andreas Gruenbacher.
263 * src/mkfifo.c (main): Likewise (but `call mkfifo', not mkdir).
264 Patch by Andreas Gruenbacher.
266 * tests/mkdir/perm: New test.
267 * tests/mkdir/Makefile.am (TESTS): Add perm.
269 2000-08-17 Andreas Gruenbacher <ag@bestbits.at>
271 * src/chmod.c (change_file_mode): Perform the chmod even if the
272 file mode permission bits are the same as those that should be set.
273 Omitting the chmod call would be alright with minimal 1003.1e DS17
274 ACLs, but eventually there may be other permissions in addition to
275 rwx. E.g., add and delete for directories, and something analogous
276 to NT's take ownership permission.
278 2000-09-25 Jim Meyering <meyering@lucent.com>
280 * tests/cp/same-file: Don't use `diff -u'. It's not portable.
281 Reported by Christian Krackowizer.
282 * tests/cp/same-file: Run `diff -c' only if cmp finds a difference.
283 * tests/mv/part-symlink: Likewise. And clean up.
285 `shred --exact file1 file2' wouldn't touch `file1'
286 * src/shred.c (long_opts): --exact doesn't take an argument.
287 Reported by Alan Iwi.
288 * tests/shred/exact: New test for this.
289 * tests/shred/Makefile.am (TESTS): Add exact.
291 * Makefile.maint (PREV_VERSION): Get the value from a file, rather
292 than trying to derive it from the current version number.
293 This is much more robust.
294 (alpha): Record just-released version number in `.prev-version',
295 and commit (post-tag).
299 2000-09-24 Paul Eggert <eggert@twinsun.com>
301 * doc/fileutils.texi: Update to more closely match changes in 4.0z.
302 * src/cp.c (usage): Match revised documentation better.
304 2000-09-24 Jim Meyering <meyering@lucent.com>
306 * src/cp.c (main): Tweak a relatively new diagnostic.
308 2000-09-23 Jim Meyering <meyering@lucent.com>
310 * tests/ls/time-1: Output more information when a test fails.
312 2000-09-22 Jim Meyering <meyering@lucent.com>
314 * src/install.c (cp_option_init): Once again make it so install always
315 unlinks an existing destination before trying to open it for writing.
316 Otherwise, installing onto a running shared library would make the
317 running program malfunction.
318 Reported by Dan Pascu via Michael Stone.
320 * src/mv.c (do_move): Moving a directory specified with a trailing
321 slash from one partition to another, and giving it a different
322 name at the destination would cause mv to get a failed assertion.
323 Reported by Michael Stone.
324 (strip_trailing_slashes_2): Move function definition to precede
326 * tests/mv/part-rename: New test for the above fix.
327 * tests/mv/Makefile.am (TESTS): Add part-rename.
329 * src/copy.c (copy_internal): Don't try to unlink directories when
330 using --remove-dest with -R.
331 * tests/cp/dir-rm-dest: New test for the above fix.
332 * tests/cp/Makefile.am (TESTS): Add dir-rm-dest.
334 2000-09-19 Jim Meyering <meyering@lucent.com>
336 * doc/fileutils.texi (cp invocation): Describe how --force works.
337 Update description of -P (soon to change meaning to conform w/POSIX).
338 Describe --remove-destination.
340 * src/cp.c (main): When used with --force, each of the --link and
341 --symbolic-link options now implies --remove-destination.
342 Reported by Miles Bader via Mike Stone.
343 * tests/cp/link: New file. Test for the above fix.
344 * tests/cp/same-file: Adjust for this change in behavior.
346 2000-09-15 Volker Borchert <bt@teknon.de>
348 * tests/Makefile.am (check-root, root-hint): New targets.
349 (check-recursive): Depend on root-hint.
350 * Makefile.am (check-root): New target.
352 2000-09-16 Jim Meyering <meyering@lucent.com>
354 * doc/perm.texi (Changing Special Permissions): Remove this statement:
355 ``a' in the USERS part of a symbolic mode does not cause the special
356 permissions to be affected'... It doesn't reflect what the code does
357 and isn't required by POSIX. Reported by aldomel@ix.netcom.com via
360 2000-09-15 Jim Meyering <meyering@lucent.com>
362 * config.sub: Update from master repository.
364 2000-09-10 Jim Meyering <meyering@lucent.com>
366 * tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure
367 that `ls' sorts the same way for everyone. Reported by Vin Shelton.
369 * Makefile.maint (b_host): Use freefriends.org, not tug.org.
371 2000-09-09 Jim Meyering <meyering@lucent.com>
373 * Makefile.maint (announcement): Use a stricter regexp for the
378 * tests/cp/special-bits: New file.
379 * tests/cp/Makefile.am (TESTS): Add special-bits.
380 (TESTS_ENVIRONMENT): Propagate $MAKE into environment, for special-bits.
382 * src/copy.c (SAME_OWNER, SAME_GROUP, SAME_OWNER_AND_GROUP): Define.
383 (copy_internal): Avoid calling chown if we know it's not necessary.
385 * src/copy.c (copy_internal): Call chmod also if we've made the
386 preceding chown call and we're supposed to preserve some special
387 permission bit(s) that would have been reset by chown.
388 Reported by Greg Louis.
390 2000-09-08 Jim Meyering <meyering@lucent.com>
392 * src/mkdir.c (S_IRWXUGO): Remove definition.
393 * src/sys2.h (S_IRWXUGO): Define here, instead.
395 2000-09-07 Jim Meyering <meyering@lucent.com>
397 * doc/texinfo.tex: Update from master repository.
398 * config.sub: Likewise.
399 * config.guess: Likewise.
401 2000-09-05 Jim Meyering <meyering@lucent.com>
403 * tests/mv/part-symlink: Redirect stdout to stderr before trying to
404 remove the temp directory. Otherwise, the `rm -rf' would get an
405 error because the output file wouldn't be closed and the directory
407 * tests/cp/same-file: Likewise.
409 * tests/cp/same-file: Remove the `cp -dl sl1 sl2' case,
410 since it's no longer portable (hard link to a symlink).
411 Likewise for the `cp -bdl symlink foo' case.
413 * config.guess: Update from master repository.
415 2000-09-04 Jim Meyering <meyering@lucent.com>
417 * src/cp.c: Move declaractions of lstat, stat, and rpl_lstat
418 as well as the definition of lstat from here...
419 * src/copy.h: ...to here.
420 * src/copy.c: Remove declaration of lstat, now that it's in copy.h.
422 * tests/mv/force: mv's --force (-f) option is no longer needed for
423 this test, now that all it does is cancel --interactive (-i).
425 * tests/cp/same-file: Add new tests using cp's --rem option.
426 Reflect the fact that cp's -f option no longer causes cp to remove the
427 destination file before trying to open it.
428 Reflect the fact that `cp -bdl' now makes a backup when copying a
429 symlink onto the file it points to (FIXME: look into this, and why
430 cp -bl does *not* do so).
432 * src/ln.c (do_link): Tweak diagnostics.
434 2000-09-03 Jim Meyering <meyering@lucent.com>
436 * src/install.c (cp_option_init): Initialize new members.
438 * src/cp.c (enum): Add UNLINK_DEST_BEFORE_OPENING.
439 [long_options]: Add an entry for --remove-destination.
440 (usage): Describe --remove-destination.
441 (do_copy): Use unlink_dest_after_failed_open member, not `force.'
442 (cp_option_init): Initialize new members.
443 (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
445 * src/mv.c: Remove obsolete comment block.
446 (cp_option_init): Initialize new members.
447 (usage): Reflect the fact that --force (-f) relates only to whether
449 (main): Remove uses of old `force' option member.
451 * src/install.c (cp_option_init): Reflect
453 `force' no longer means unlink-dest-before-opening
454 * src/copy.h (struct cp_options) [force]: Remove member.
455 [unlink_dest_before_opening]: Add member. `cp -f' and `mv -f' used to
456 do this. Now, you must use `cp --remove-destination' to get this
457 behavior. Now, `cp -f' and `mv -f' work as required by POSIX.
458 [unlink_dest_after_failed_open]: Add member.
459 Paul Eggert reported that `cp -f' removes an existing destination
460 file unconditionally, and that is contrary to POSIX.
462 * src/copy.c (same_file_ok): New function, extracted from copy_internal,
464 (copy_internal): Unlink destination file when unlink_dest_before_opening
465 option is set, and when the source is neither a regular file nor a
468 * tests/mv/Makefile.am (TESTS): Add part-symlink.
470 * src/ls.c: Use strcoll (not strcmp) when comparing file names.
471 Suggestion from Ulrich Drepper.
473 2000-08-27 Jim Meyering <meyering@lucent.com>
475 * src/copy.c (copy_reg): New parameters: X and NEW_DST.
476 Remove the SPARSE_MODE parameter. Update caller.
477 Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when copying
478 a regular source file and the destination file exists; upon failure,
479 unlink that existing file, then open again, but with O_WRONLY|O_CREAT.
480 (copy_internal): `force' in not related to interactive; remove
482 Remove the entire `else if (x->force)' block; justifying
483 removal of the non-directory part is easy: POSIX requires we try
484 to open an existing regular file, so we can't unlink it beforehand.
485 The part that changes the mode on a directory to allow overwriting
488 * src/copy.c (copy_reg): Rename two goto labels.
489 (copy_internal): Set `new_dst' when the move_mode rename fails,
490 since we then unlink the destination file.
492 * src/cp.c (usage): --force is independent of --interactive.
494 2000-08-24 Jim Meyering <meyering@lucent.com>
496 Put back the kluge. It's necessary after all.
497 * src/dd.c (buggy_lseek_support): New function.
499 Frank Adler reported that although _llseek returns 0, lseek
500 erroneously returns an offset suggesting the operation succeeded
501 even though it fails.
503 * install-sh: Double quote as needed, to protect against arguments
504 containing spaces or shell metacharacters. Reported by Bruno Haible.
506 2000-08-23 Jim Meyering <meyering@lucent.com>
508 * tests/dd/not-rewound: New test, for the SEEK_CUR vs. SEEK_SET part
509 of the last change. Based on Paul's example.
510 * tests/dd/Makefile.am (TESTS): Add not-rewound.
512 2000-08-22 Paul Eggert <eggert@twinsun.com>
515 Assume lseek failed if it returned zero, since a zero return is
516 impossible and some buggy drivers return zero.
518 Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the
519 file descriptor is not currently rewound.
521 2000-08-23 Jim Meyering <meyering@lucent.com>
523 * src/dd.c: Back out my last change. Paul's (above) is better.
525 2000-08-22 Jim Meyering <meyering@lucent.com>
527 Don't even try to use lseek on character devices.
528 * src/dd.c (buggy_lseek_support): New function.
530 Reported by Martin Gallant via Michael Stone.
532 2000-08-21 Jim Meyering <meyering@lucent.com>
534 * tests/cp/same-file: Clean up traps. Create files in a subdir.
536 * install-sh (oIFS): Remove unmatched double quote, left over from
537 my 2000-08-12 change. From J. David Anglin.
539 * Makefile.maint (wget-update): Get the latest version of depcomp.
541 * depcomp: Update from automake.
543 2000-08-20 Jim Meyering <meyering@lucent.com>
547 Add support for cp's new POSIX-mandated -H and -L options.
548 * src/copy.h (enum Dereference_symlink): Define.
549 (struct cp_options) [dereference]: Change type to Dereference_symlink.
550 * src/copy.c: Declare lstat.
551 (copy_dir): Set `xstat' member to lstat so that with `-H' we don't
552 follow symlinks found via recursive traversal.
553 Update uses of `dereference' to compare against new enum member names.
554 * src/cp.c (long_opts): Add --dereference, -L.
555 (usage): Describe -L and -H.
556 (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'.
557 (main): Add `H' and `-L' to getopt spec string.
558 [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0.
559 [case 'd']: Likewise.
560 [case 'H']: New case.
561 [case 'L']: New case.
562 [case 'R']: Don't set dereference to `0' here.
563 If it's not yet defined, set x.dereference to DEREF_NEVER
564 if -R was specified, else set it to DEREF_ALWAYS.
565 Set x.xstat accordingly for -H.
566 * doc/fileutils.texi (cp invocation): Describe -H and -L.
567 * src/mv.c (cp_option_init): Initialize to DEREF_NEVER, not `0'.
568 * src/install.c (cp_option_init): Initialize to DEREF_ALWAYS, not `1'.
570 * tests/cp/Makefile.am (TESTS): Add cp-HL.
571 * tests/cp/cp-HL: New test.
573 * src/du.c (print_totals): Rename global from opt_combined_arguments.
575 2000-08-17 Paul Eggert <eggert@twinsun.com>
577 * src/copy.c (DO_CHOWN): Do not make a special case for non-root.
578 POSIX.2 requires that cp -p and mv attempt to set the uid of the
579 destination file, even if you're not root. This affects behavior
580 only on hosts that let you give files away via chmod.
581 * NEWS: Describe the above change.
583 2000-08-15 Jim Meyering <meyering@lucent.com>
585 * src/du.c (count_entry): Remember the current directory also for `.'
586 and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu.
587 * tests/du/two-args: Add tests for this.
589 2000-08-14 Jim Meyering <meyering@lucent.com>
591 * src/copy.c (copy_reg): Move declaration of local, `n_read', into
592 the scope where it's used.
593 (copy_internal): In calling copy_reg, pass not the raw `src_mode',
594 but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
596 2000-08-13 Jim Meyering <meyering@lucent.com>
598 * src/copy.c (get_dest_mode): Rename from new_nondir_mode.
599 Honor the umask for `cp', but not for `mv' or `cp -p'.
600 (copy_reg): New 4th parameter, dst_mode. Pass it as 3rd arg. to open.
601 (copy_internal): Change type of locals `src_mode' and `src_type' from
603 Remove unnecessary local, `fix_mode'.
604 Combine two if-stmts into one.
605 Pass `src_mode' as 4th arg to copy_reg.
606 If we've just created a new regular file, return early, skipping the
607 chmod step. copy_reg now sets permissions of such files upon creation.
608 Use get_dest_mode, so there's just one chmod call here.
610 * tests/cp/Makefile.am (TESTS): Add perm.
611 * tests/cp/perm: New tests, to help ensure the above didn't
614 2000-08-12 Jim Meyering <meyering@lucent.com>
616 * tests/mv/into-self-2: Remove test for the VERSION_CONTROL and/or
617 SIMPLE_BACKUP_SUFFIX envvars. Source ../envvar-check instead.
618 * tests/mv/i-2: Likewise.
619 * tests/mv/to-symlink: Likewise.
620 * tests/cp/slink-2-slink: Likewise.
621 * tests/mv/partition-perm: Likewise.
622 * tests/cp/cp-mv-backup: Likewise.
624 * tests/Makefile.am (EXTRA_DIST): Add envvar-check.
625 * tests/envvar-check: New file.
627 * install-sh: Remove trailing blanks.
628 Output diagnostics to stderr, not stdout.
629 Remove many useless curly braces and double quotes.
631 2000-08-11 J. David Anglin <dave@hiauly1.hia.nrc.ca>
633 * install-sh: Improve error handling.
634 Do the job even when the target file is `busy' on systems
635 that don't allow such files to be unlinked.
637 2000-08-12 Jim Meyering <meyering@lucent.com>
639 * README: Remove note about how installation can fail and the
640 work-around, now that it's all automated.
642 2000-08-07 Paul Eggert <eggert@twinsun.com>
644 * src/cp.c (usage, main): For cp -P messages, mention the new
645 behavior as well as the old.
647 2000-08-07 Paul Eggert <eggert@twinsun.com>
649 Standardize on "memory exhausted" instead of "Memory exhausted"
650 or "virtual memory exhausted".
651 Invoke xalloc_die instead of printing our own message.
652 * src/chmod.c (main): Likewise.
653 * src/copy.c (copy_dir, copy_internal): Likewise.
654 * src/cp.c (do_copy): Likewise.
655 * src/dircolors.c (xstrndup): Likewise.
656 * src/install.c (main): Likewise.
657 * src/ln.c (do_link): Likewise.
658 * src/mkdir.c (main): Likewise.
659 * src/mkfifo.c (main): Likewise.
660 * src/mknod.c (main): Likewise.
661 * src/mv.c (movefile): Likewise.
662 * src/remove.c (remove_cwd_entries, rm): Likewise.
663 * src/shred.c (quotearg_colon, xmalloc):
664 "virtual memory exhausted" -> "memory exhausted"
666 2000-08-07 Jim Meyering <meyering@lucent.com>
668 * src/cp.c (enum) [PARENTS_OPTION]: New member.
669 (long_opts): Update "parents" and deprecated "path" entries to use
670 `PARENTS_OPTION', not `P'.
671 (usage): Update --help output.
672 (main): Warn that the meaning of `-P' will soon change.
674 2000-08-06 Jim Meyering <meyering@lucent.com>
676 * doc/fileutils.texi (cp invocation) [-r]: Remove inaccurate mention of
677 `non-symbolic links'.
679 2000-08-05 Jim Meyering <meyering@lucent.com>
681 * config.guess: Update from master repository.
682 * config.sub: Likewise.
684 * Regenerate build/config framework to use the latest CVS versions
685 of automake and autoconf.
687 2000-07-31 Jim Meyering <meyering@lucent.com>
689 * src/shred.c [!HAVE_CONFIG_H]: Use `virtual memory exhausted', not
692 2000-07-30 Jim Meyering <meyering@lucent.com>
694 * src/sys2.h (ISPRINT): Undef before defining to avoid warning.
696 * src/copy.c (copy_internal): Quote the file names that are displayed
697 with --verbose and --backup.
698 * src/remove.c (remove_file): Quote the file names that are displayed
700 (remove_dir): Likewise.
701 * tests/mv/mv-special-1: Add quote marks to match new behavior.
702 * tests/rm/r-1: Likewise.
703 * tests/rm/r-2: Likewise.
705 * src/df.c: Convert "`%s'" in format strings to "%s", and wrap each
706 corresponding argument in a `quote (...)' call.
707 * src/dircolors.c: Likewise.
708 * src/du.c: Likewise.
709 * src/mkdir.c: Likewise.
710 * src/mkfifo.c: Likewise.
711 * src/mknod.c: Likewise.
712 * src/shred.c: Likewise.
713 * src/rmdir.c: Likewise.
714 * src/cp-hash.c: Likewise.
716 * src/chgrp.c: Convert "`%s'" in format strings to "%s", and wrap each
717 corresponding argument in a `quote (...)' call.
718 Add more precise diagnostics.
719 * src/chmod.c: Likewise.
720 * src/chown.c: Likewise.
722 * src/remove.c (remove_cwd_entries): Quote one more file name.
724 * src/help-version: Remove file. Move it to ...
725 * tests/help-version: ...here
726 * tests/Makefile.am (TESTS): Set to help-version.
727 (TESTS_ENVIRONMENT): Define.
728 (EXTRA_DIST): Add $(TESTS).
729 * src/Makefile.am (EXTRA_DIST): Remove help-version.
730 (TESTS): Remove definition.
731 (TESTS_ENVIRONMENT): Remove definition.
733 2000-07-24 Bruno Haible <haible@clisp.cons.org>
735 * src/ls.c: Include <limits.h>, <stdlib.h>, <wchar.h>, <wctype.h>.
736 (quote_name): Use mbrtowc to step through the filename string while
737 replacing nonprintables with question marks. Return the screen width,
738 not the strlen length. Do no output if the out stream is NULL.
739 (length_of_file_name_and_frills): Use the quote_name return value.
741 2000-07-25 Jim Meyering <meyering@lucent.com>
743 * src/chgrp.c (change_file_group): Save errno from a possibly failed
744 chown, and use that later. Otherwise, errno itself could be clobbered
746 * src/chmod.c (change_file_mode): Likewise.
747 * src/chown.c (change_file_owner): Likewise.
749 * src/mv.c (main): Remove unnecessary "%s" argument.
751 * src/ln.c: Convert "`%s'" in format strings to "%s", and wrap each
752 corresponding argument in a `quote (...)' call.
753 Add more precise diagnostics.
754 * src/mv.c: Likewise.
755 * src/cp.c: Likewise.
756 * src/touch.c: Likewise.
758 2000-07-23 Jim Meyering <meyering@lucent.com>
762 * src/dd.c (main): Give a better diagnostic for e.g.,
763 `dd if=/dev/fd0 seek=100000000000'.
764 Convert "`%s'" in format strings to "%s", and wrap each
765 corresponding argument in a `quote (...)' call.
766 Add many, more precise diagnostics.
768 * src/remove.c (ASSIGN_STRDUPA): Remove macro definition.
769 * src/sys2.h (ASSIGN_STRDUPA): New macro (moved here from remove.c).
771 Fix cp so that `cp -r DIR1/ DIR2' works once again.
772 * src/cp.c (ASSIGN_BASENAME_STRDUPA): New macro.
773 (do_copy): Use it here (so we always strip trailing slashes before
774 calling base_name). Reported by Branden Robinson via Michael Stone.
776 Test for the above fix.
777 * tests/cp/Makefile.am (TESTS): Add dir-slash.
778 * tests/cp/dir-slash: New file.
780 2000-07-17 Jim Meyering <meyering@lucent.com>
782 * Makefile.maint (WGET): Define.
784 (wget-update): New rule, based on the one in autoconf.
786 * src/shred.c (usage): Give a little more info.
787 Remove a FIXME comment.
790 * src/ls.c (struct bin_str): Declare `string' member to be `const'.
791 (put_indicator): Declare local `p' to be `const'.
793 2000-07-15 Jim Meyering <meyering@lucent.com>
795 Begin converting "`%s'" in format strings to "%s", and wrap each
796 corresponding argument in a `quote (...)' call -- if there's only one.
797 If there are two or more, then use `quote_n (0, ...),
798 quote_n (1, ...), ...'.
800 Here's the justification, from Paul Eggert (thanks, Paul):
802 [Consider] the following, taken from fileutils/copy.c:
804 error (0, errno, _("cannot create directory `%s'"), dst_path);
806 Now, suppose dst_path is "/'\nrm: removing all files under `/"
807 (expressed in C string syntax). This will cause the user to see
808 the following delightfully ambiguous display:
810 cp: cannot create directory `/'
811 rm: removing all files under `/'
813 It would be better to rewrite the above line to be something
816 error (0, errno, _("cannot create directory %s"), quote (dst_path));
818 using the definition of "quote" [in lib/quote.c]. That way,
819 the user will see the following unambiguous display instead:
821 cp: cannot create directory `/\'\nrm: removing all files under `/'
823 One might object that any user who asks to copy a file with
824 a weird name like that deserves to get confused. But this
825 is not a good objection, as the source of the string may not
826 be under the user's control, or even visible to the user.
828 * src/copy.c: Adapt format strings and args as above. Include quote.h.
829 I have deliberately not changed the output of --verbose.
830 FIXME: maybe I should.
831 * src/cp.c: Likewise.
832 * src/remove.c: Likewise.
833 * src/install.c: Likewise. and improve a couple diagnostics.
835 2000-07-13 Paul Eggert <eggert@twinsun.com>
837 * NEWS: Describe --quoting-style=clocale.
839 * doc/fileutils.texi: New clocale quoting style.
840 Undo the previous change to the locale quoting style.
842 2000-07-09 Jim Meyering <meyering@lucent.com>
844 * config.guess: Update from FSF.
845 * config.sub: Likewise.
847 2000-07-05 Paul Eggert <eggert@twinsun.com>
849 * doc/fileutils.texi: Don't use ` and ' for quoting.
851 2000-07-01 Jim Meyering <meyering@lucent.com>
855 * tests/touch/dangling-symlink: Warn about the problem rather
856 than failing, on some very recent (at least 2.3.99) versions of
857 the Linux kernel. Suggestion from Ulrich Drepper.
858 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Define host_triplet
859 for use in the dangling-symlink test.
861 2000-06-28 Jim Meyering <meyering@lucent.com>
863 * tests/mv/i-2: Don't copy `out' into /tmp.
865 2000-06-26 Paul Eggert <eggert@twinsun.com>
867 Now that savedir.c has been cleaned up...
868 * src/chgrp.c (change_dir_group): Don't set errno before
869 invoking savedir, and assume that errno is nonzero if savedir fails.
870 * src/chmod.c (change_dir_mode): Likewise.
871 * src/chown.c (change_dir_owner): Likewise.
872 * src/copy.c (copy_dir): Likewise.
873 * src/du.c (count_entry): Likewise.
875 2000-06-26 Paul Eggert <eggert@twinsun.com>
877 * src/df.c (show_dev): Round disk usage percentage up, not to
878 nearest value. Use integer arithmetic if it's easy. Fix bug
879 when converting twos-complement negative values to floating point.
881 2000-06-25 Jim Meyering <meyering@lucent.com>
883 * src/copy.c (copy_internal): Don't return immediately after a failed
884 copy_dir call -- otherwise, the failure to read a single file in a
885 source directory would cause the containing destination directory
886 not to have the owner and/or permissions set properly.
887 Reported by Piotr and Maciej Kwapulinski.
888 * tests/cp/fail-perm: Test for it.
889 * tests/cp/Makefile.am (TESTS): Add fail-perm.
893 2000-06-18 Jim Meyering <meyering@lucent.com>
895 * README-alpha: Update.
897 2000-06-17 Jim Meyering <meyering@lucent.com>
899 * tests/install/basic-1: Don't fail (just exit 77) if strip doesn't
900 work. Suggestion from Ulrich Drepper.
901 Add canonical trap/mkdir/cd, plus exit portability cruft.
903 2000-06-16 Jim Meyering <meyering@lucent.com>
905 * src/copy.c (copy_reg): Give a slightly better diagnostic upon
908 2000-06-15 Paul Eggert <eggert@twinsun.com>
910 * NEWS, doc/fileutils.texi: df, du, and ls now round disk
911 usage up and disk free space down.
913 * src/df.c (df_readable): New arg for rounding style.
914 Round negative numbers correctly.
915 (show_dev): Round disk usage up and disk free space down.
917 * src/ls.c: (print_dir, gobble_file, print_long_format,
918 print_file_name_and_frills): Round disk usage up.
919 * src/du.c (print_size): Likewise.
921 2000-06-14 Andreas Schwab <schwab@suse.de>
923 * tests/rm/r-1 (framework_failure): Initialize this instead of
926 2000-06-12 Jim Meyering <meyering@lucent.com>
930 * tests/rm/r-1: Clean up.
931 Be careful to remove temp directory upon interrupt.
933 * src/mv.c (main): Give the correct diagnostic when using the
934 --target-dir=DIR option, but no arguments.
935 Patch from Michael Stone. Reported by Herbert Xu.
936 * tests/mv/diag: New test for this.
937 * tests/mv/Makefile.am (TESTS): Add diag.
939 2000-06-08 Brian Youmans <3diff@gnu.org>
941 * doc/perm.texi (Multiple Changes): Fix typo.
942 * doc/fileutils.texi: A few typos and minor formatting fixes.
943 * doc/getdate.texi: Likewise.
945 2000-06-06 Jim Meyering <meyering@lucent.com>
947 * Makefile.maint (alpha_subdir): Factor out `gnu/fetish'.
949 2000-06-04 Jim Meyering <meyering@lucent.com>
953 * src/df.c (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]:
954 Cast undeclared `realpath' to char* to avoid warning.
956 2000-06-03 Jim Meyering <meyering@lucent.com>
958 * src/install.c (usage): Document that -v is a synonym for --verbose.
959 * src/mkdir.c: Allow -v as synonym for --verbose, to be consistent
960 with other fileutils.
961 * src/rmdir.c: Likewise.
962 Suggestion from François Pinard.
964 2000-06-02 Jim Meyering <meyering@lucent.com>
966 * configure.in (ALL_LINGUAS): Add Danish (da).
968 2000-05-29 Jim Meyering <meyering@lucent.com>
970 Allow `cp -d -u' to copy one symlink onto another that's identical.
971 * src/copy.c (copy_internal): Change the || to ^ in the big sameness
972 test, so copying one symlink onto another, identical one doesn't fail
974 If the symlink call fails, don't report the failure if the destination
975 already exists and is a symlink pointing to the proper name.
976 Reported by Andrew Burgess.
977 * tests/cp/slink-2-slink: New test.
978 * tests/cp/Makefile.am (TESTS): Add slink-2-slink.
979 * tests/cp/same-file: Adapt to fit new semantics of `cp -d'.
981 2000-05-25 Jim Meyering <meyering@lucent.com>
983 * src/dd.c (close_stdout_wrapper): Don't dereference NULL pointer.
986 2000-05-23 Jim Meyering <meyering@lucent.com>
988 * tests/shred/remove: Add traps to clean up.
989 Correct broken running-as-root test.
991 * tests/mv/i-2: Exit 77 when run as root. Reported by Andreas Schwab.
993 2000-05-20 Jim Meyering <meyering@lucent.com>
997 * tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change.
999 * tests/rm/r-2: Clean up.
1000 * tests/ls/time-1 (LC_ALL): Set it unconditionally.
1002 2000-05-19 Jim Meyering <meyering@lucent.com>
1004 Save device number as well as inode number for each directory,
1005 and use both in comparisons. This makes the directory cycle
1006 test more robust, and closes the small remaining hole whereby
1007 an attacker could subvert a running `rm -r' command.
1009 * src/remove.c (struct active_dir_ent) [st_dev]: New member.
1010 [st_ino]: Rename from `inum'.
1011 (make_active_dir_ent) [device]: New parameter.
1012 (hash_compare_active_dir_ents): Compare using SAME_INODE macro.
1013 (fspec_init_common): New function, factored out.
1014 (fspec_init_file): Initialize have_device member.
1015 (fspec_get_full_mode): Remove parameter. Update caller.
1016 Set have_device and st_dev members.
1017 * src/remove.h (struct File_spec) [have_device, st_dev]: New members
1019 2000-05-18 Jim Meyering <meyering@lucent.com>
1021 * src/remove.c (rm): Combine adjacent fputc and fprintf.
1023 * tests/rm/Makefile.am (TESTS): Add hash.
1024 * tests/rm/hash: New test for the fix in lib/hash.c.
1026 2000-05-17 Jim Meyering <meyering@lucent.com>
1028 * src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert
1029 a running `rm -r'. Reported by Morten Welinder.
1031 2000-05-15 Jim Meyering <meyering@lucent.com>
1033 * src/ln.c (do_link): Use complete strings in diagnostics so they
1034 are easier to translate. Reported by Michel Robitaille.
1035 (main): Drop support for the case in which S_ISLNK wasn't defined.
1036 It was broken in any case.
1038 * tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the
1039 current locale is not C (POSIX). From Matthew Clarke.
1041 2000-05-13 Jim Meyering <meyering@lucent.com>
1043 * src/help-version: New test.
1044 * src/Makefile.am (TESTS): Define.
1045 (TESTS_ENVIRONMENT): Likewise.
1046 (EXTRA_DIST): Add help-version.
1048 * src/chgrp.c: Arrange to call close_stdout only upon exit.
1049 * src/chmod.c: Likewise.
1050 * src/chown.c: Likewise.
1051 * src/cp.c: Likewise.
1052 * src/df.c: Likewise.
1053 * src/dircolors.c: Likewise.
1054 * src/du.c: Likewise.
1055 * src/install.c: Likewise.
1056 * src/ln.c: Likewise.
1057 * src/ls.c: Likewise.
1058 * src/mkdir.c: Likewise.
1059 * src/mkfifo.c: Likewise.
1060 * src/mknod.c: Likewise.
1061 * src/mv.c: Likewise.
1062 * src/rm.c: Likewise.
1063 * src/rmdir.c: Likewise.
1064 * src/shred.c: Likewise.
1065 * src/sync.c: Likewise.
1066 * src/touch.c: Likewise.
1068 * src/dd.c: Include closeout.h.
1069 (usage): Don't call close_stdout here.
1070 (close_stdout_wrapper): New, kludgey, function and file-scoped global.
1071 (main): Register it with atexit.
1073 2000-05-12 Jim Meyering <meyering@lucent.com>
1075 Unlike for mv, -i doesn't cancel the effect of -f
1076 and -f doesn't cancel the effect of -i.
1077 * src/cp.c (main) ['f']: Don't reset `x.interactive'.
1078 ['i']: Don't reset `x.force'.
1079 * src/copy.c (copy_internal): Fix force and interactive tests.
1080 Patch from Michael Stone, reported by Jeff Sheinberg.
1082 2000-05-09 Jim Meyering <meyering@lucent.com>
1084 * src/shred.c: Include sys/types.h in shred.c before including
1085 sys/stat.h or system.h. From John David Anglin.
1087 2000-05-08 Jim Meyering <meyering@lucent.com>
1089 * tests/shred/remove: Don't use touch in root test. Instead, append to
1090 the test file, since now touch operates even on files which deny owner
1093 2000-05-06 Jim Meyering <meyering@lucent.com>
1095 * src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@.
1097 * src/rmdir.c (EEXIST): Remove now-unused definition.
1098 (ENOTEMPTY): Likewise.
1099 (errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
1100 which is determined by the autoconf test in m4/rmdir-errno.m4.
1102 2000-05-03 Bruno Haible <haible@clisp.cons.org>
1104 Don't fail when running `make check' with non-`C' locale.
1105 * tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext)
1106 and LC_ALL (for systems which look at LC_MESSAGES).
1107 * tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has
1108 LC_CTYPE or LC_ALL set. Define it and LANGUAGE before the first use
1111 2000-05-03 Jim Meyering <meyering@lucent.com>
1113 With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro.
1114 * src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup.
1115 * src/dircolors.c: Remove declaration of strndup.
1116 Reported by Bruno Haible.
1118 2000-05-02 Jim Meyering <meyering@lucent.com>
1120 * src/rm.c (usage): Add the answer to `How do I remove a file named -f?'
1122 2000-05-01 Jim Meyering <meyering@lucent.com>
1124 * src/install.c (change_attributes): Don't even attempt the chmod
1125 if the chown fails. Before, when a non-root user ran `install -m 4755
1126 -o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to
1127 the ID of the installing user. Reported by Marc Olzheim.
1129 2000-04-30 Jim Meyering <meyering@lucent.com>
1131 * src/touch.c (O_NOCTTY): Define if not defined already.
1132 (touch): Add O_NOCTTY to the flags passed to open.
1134 2000-04-29 Jim Meyering <meyering@lucent.com>
1138 * src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat.
1140 2000-04-27 Jim Meyering <meyering@lucent.com>
1143 * tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR.
1144 * tests/mkdir/p-1: Use mkdir, not $MKDIR.
1145 * tests/mkdir/p-2: Likewise.
1147 * configure.in (AC_OUTPUT): Add tests/du/Makefile.
1148 * tests/Makefile.am (SUBDIRS): Add du.
1149 * tests/du: New directory.
1150 * tests/du/two-args: New test.
1152 * tests/mkdir/special-1: New test.
1153 * tests/mkdir/Makefile.am (TESTS): Add special-1.
1155 2000-04-25 Paul Eggert <eggert@twinsun.com>
1157 * src/du.c (pop_dir): Remove through_symlink arg; use null cwd
1158 for that purpose instead.
1159 (count_entry): Also save the directory if we're saving more
1161 Fix file descriptor and memory leak when chdir fails.
1163 2000-04-26 Jim Meyering <meyering@lucent.com>
1165 * src/mkdir.c: Rename global: s/path_mode/create_parents/.
1166 (main): No longer perform explicit chmod when creating
1167 parent directories, since make_path now does the chmod.
1169 2000-04-17 Jim Meyering <meyering@lucent.com>
1171 * src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP.
1172 (enum) [FROM_OPTION]: New member.
1173 (long_options): New getopt spec.
1174 (change_file_owner): Add old_user, old_group parameters. Use them.
1175 (change_dir_owner): Likewise.
1178 From Andries Brouwer.
1179 * doc/fileutils.texi (invoking chown): Document it.
1181 2000-04-16 Jim Meyering <meyering@lucent.com>
1183 * src/cp.c: New option: --strip-trailing-slashes.
1184 (enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
1185 (remove_trailing_slashes): New global.
1186 (long_opts): New getopt spec.
1188 (do_copy): Strip trailing slashes on SOURCE names only if the new
1189 option has been specified.
1192 * tests/cp/symlink-slash: New test for the change in behavior.
1193 * tests/cp/Makefile.am (TESTS): Add symlink-slash.
1195 * doc/fileutils.texi (Trailing slashes): Factor out discussion on
1196 trailing slashes into its own node.
1197 Cross reference from cp and mv.
1199 2000-04-14 Jim Meyering <meyering@lucent.com>
1201 * src/touch.c (touch): Add O_NOCTTY to the list of open-time flags.
1203 2000-04-13 Jim Meyering <meyering@lucent.com>
1205 Move some code into m4/.
1206 * configure.in (_GNU_SOURCE): Don't define here.
1207 (AC_SYS_LARGEFILE): Don't use here.
1208 (AM_C_PROTOTYPES): Don't use here.
1209 * acconfig.h: Remove now-unused file.
1211 2000-04-08 Jim Meyering <meyering@lucent.com>
1213 * doc/fileutils.texi (cp invocation): Mention that there is an
1214 application for cp's --sparse=never option. From Martin Hippe.
1215 (cp invocation): Describe how --backup and --force
1216 can be useful together.
1218 2000-03-10 Alan Iwi <iwi@atm.ox.ac.uk>
1220 * src/ls.c: Add support for "ln=target" in the LS_COLORS variable,
1221 to colorize links as for the file/directory pointed to.
1222 * src/dircolors.hin: Add a few words of documentation of the above.
1224 2000-04-08 Jim Meyering <meyering@lucent.com>
1226 * src/cp.c (usage): Document that while the --backup option takes an
1227 optional argument, the -b option accepts none.
1228 (main): Use `backup type' in call to xget_version, not the
1229 now-deprecated `--version-control'.
1230 * src/install.c: Likewise.
1231 * src/ln.c: Likewise.
1232 * src/mv.c: Likewise.
1234 2000-03-12 Jim Meyering <meyering@lucent.com>
1236 Merge from textutils.
1237 * src/system.h: (O_BINARY, O_TEXT): Define if necessary.
1238 (SET_BINARY, SET_BINARY2): Define.
1239 (DEV_BSIZE): Define to BBSIZE if appropriate.
1241 2000-03-10 Jim Meyering <meyering@lucent.com>
1243 * tests/mv/mv-special-1: Make the message more like that in the
1244 similar touch and shred tests.
1245 * tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
1246 bug and `exit 77' if the fifo cannot be created.
1247 Report and suggestion from Volker Borchert.
1249 2000-03-03 Jim Meyering <meyering@lucent.com>
1251 * po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a
1252 space optimization anyway) to populate $(distdir). Otherwise, the dist
1253 rules that change permissions would end up affecting the master sources.
1255 2000-03-01 Paul Eggert <eggert@twinsun.com>
1257 * src/df.c (show_point): Ignore shortcuts based on path
1258 prefixes that are loop file system mount points, since they
1259 yield undesirable output.
1261 2000-02-29 Jim Meyering <meyering@lucent.com>
1263 * src/ls.c (decode_switches): Remove `e' from getopt_long's list of
1264 option characters. Reported by John Summerfield.
1266 2000-02-28 Jim Meyering <meyering@lucent.com>
1268 * tests/install/basic-1: Use ginstall, not install.
1270 2000-02-27 Jim Meyering <meyering@lucent.com>
1274 * src/sys2.h: Guard declaration of strtoull also with
1275 `&& HAVE_UNSIGNED_LONG_LONG'.
1277 * src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...'
1278 now that autoconf always defines the HAVE_DECL_ symbols.
1280 * src/install.c (install_file_to_path): Always use install_file_in_file.
1281 Based on a patch from Adam Klein via Michael Stone.
1283 * tests/install/Makefile.am (TESTS): Add create-leading.
1284 * tests/install/create-leading: New file.
1286 * tests/install/basic-1: Clean up.
1287 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft.
1289 2000-02-26 Jim Meyering <meyering@lucent.com>
1291 Tranform the generated src/Makefile.in file so it falls back on
1292 using /bin/rm when necessary. The old rule didn't always work.
1293 This is necessary only on certain losing systems, and because this
1294 package builds an `rm' executable and some people put `.' too
1295 early in their PATH.
1296 * Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment.
1297 (EXTRA_DIST): Add .kludge-stamp.
1298 (.kludge-stamp): New rule.
1299 * src/Makefile.am (AUTOMAKE): Remove definition.
1300 (Makefile.in): Remove dependency on automake-wrap script.
1301 (EXTRA_DIST): Remove automake-wrap.
1302 * src/automake-wrap: Remove file.
1304 * tests/rm/r-2: Don't make the success of the test depend on the
1305 order in which directory entries are processed.
1306 Reported by Andreas Schwab.
1308 2000-02-12 Jim Meyering <meyering@lucent.com>
1310 * po/POTFILES.in: Add lib/userspec.c.
1312 * doc/fileutils.texi (chown invocation): Deprecate use of `.'.
1314 * src/chown.c (usage): Mention only `:', and not `.' as the separator,
1315 since POSIX allows only the former.
1316 Prompted by a report from Manas Garg.
1318 2000-02-11 Jim Meyering <meyering@lucent.com>
1320 * src/df.c (main): Count the stat'able arguments.
1321 Print the header line only if there is at least one valid argument.
1322 Reported by Andy Longton <alongton@metamark.com>
1324 2000-02-10 Jim Meyering <meyering@lucent.com>
1326 Make du work when invoked from an unreadable directory.
1328 * src/du.c (pop_dir): New function.
1329 (count_entry): Factor out common code (pop_dir), and call the new
1331 Move declaration of global, `stat_buf' into this function.
1332 (du_files): Don't stat `.' or call save_cwd, since count_entry
1333 never returns with a changed working directory.
1335 2000-02-09 Jim Meyering <meyering@lucent.com>
1337 * tests/mv/mv-special-1: Use $null and $dir in place of literals
1339 Exit 77 if we can't set up the framework (Volker Borchert reported
1340 that this test would fail because mknod failed when run on SunOS4.1.4
1341 using NFS-mounted disk from an OpenBSD system).
1343 2000-02-05 Jim Meyering <meyering@lucent.com>
1345 * src/copy.c (copy_internal): Don't allow mv to move a directory onto
1346 a non-directory. Reported by Brian Kimball via Michael Stone.
1348 2000-02-03 Jim Meyering <meyering@lucent.com>
1350 * tests/mv/Makefile.am (TESTS): Add dir-file.
1351 (TESTS_ENVIRONMENT): Remove vestiges of old tests.
1352 * tests/mv/dir-file: New file.
1354 2000-02-02 Jim Meyering <meyering@lucent.com>
1356 * tests/touch/Makefile.am (TESTS): Add fifo.
1357 * tests/touch/fifo: New file.
1359 2000-02-01 Jim Meyering <meyering@lucent.com>
1361 * src/touch.c (O_NDELAY): Define to 0 if not defined.
1362 (O_NONBLOCK): Define to O_NDELAY if not defined.
1363 (touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
1364 Reported by Eric G. Miller via Michael Stone.
1366 * man/*.x: Change ." to .\".
1367 Reported by Andreas Schwab and Brendan O'Dea.
1369 2000-01-31 Jim Meyering <meyering@lucent.com>
1371 * man/Makefile.maint (ginstall_filter): Define.
1372 ($(man_MANS)): Use it here so that the install.1 man page refers
1373 to `install', not `ginstall'. Reported by Andreas Schwab.
1375 2000-01-30 Jim Meyering <meyering@lucent.com>
1379 * configure.in: Move library-related tests into m4/lib-check.m4.
1381 * src/system.h (ST_NBLOCKS): Use st_size only for regular files and
1382 for directories. From H. J. Lu.
1384 * src/dd.c (main): Exit with nonzero status if ftruncate fails.
1386 2000-01-24 Jim Meyering <meyering@lucent.com>
1388 * src/ln.c (usage): Describe behavior when LINK_NAME is omitted.
1391 * src/mv.c (main): Don't expect array index `n_files - 1' to evaluate
1392 to `-1' for unsigned int n_files == 0. Doing so lead to a segfault on
1393 alpha. From Michael Stone.
1395 2000-01-23 Jim Meyering <meyering@lucent.com>
1397 * configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.)
1398 Remove nearly all function checks (moved to m4/.)
1399 (AC_SUBST(DF_PROG)): Move this to m4/.
1400 (ftruncate test): Move into new file: m4/ftruncate.m4.
1401 (AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/.
1402 Remove df-related tests. i.e., move jm_LIST_MOUNTED_FILESYSTEMS,
1403 jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/.
1405 2000-01-22 Jim Meyering <meyering@lucent.com>
1407 * configure.in: Move addext.c prerequisites from this file into m4/.
1408 (AC_CHECK_HEADERS): Move these checks into m4/.
1410 2000-01-17 Paul Eggert <eggert@twinsun.com>
1412 * src/dd.c (interrupt_handler): Likewise.
1413 (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
1414 to decide whether to call sigaction; this fixes an old typo.
1416 2000-01-16 Jim Meyering <meyering@lucent.com>
1418 * lib/Makefile.am: Sync with sh-utils/lib/Makefile.am.
1420 * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME,
1421 jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and
1422 AC_FUNC_ALLOCA. They're now in m4/.
1424 Sync with the version from emacs-20.5.
1426 (<string.h>): Include if HAVE_STRING_H.
1427 (<stdlib.h>): Include if HAVE_STDLIB_H.
1428 (alloca): Abort if malloc fails.
1429 Reported by Paul Eggert.
1431 2000-01-15 Jim Meyering <meyering@lucent.com>
1433 * configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy
1434 memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol
1435 strtoul strverscmp. Now they're in m4/.
1437 2000-01-12 Jim Meyering <meyering@lucent.com>
1439 * tests/shred/remove: Make the warning that this shred test may not
1440 be run as root more prominent. Suggestion from Volker Borchert.
1442 2000-01-11 Paul Eggert <eggert@twinsun.com>
1444 Quote multibyte characters correctly.
1446 * lib/quotearg.c (ISGRAPH): Remove.
1447 (ISPRINT): New macro.
1448 (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
1449 (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
1450 defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1451 (quotearg_buffer_restyled): New function, with most of the old
1452 quotearg_buffer's contents.
1453 Major rewrite to support multibyte characters.
1454 (quotearg_buffer): Now just calls quotearg_buffer_restyled.
1456 * m4/c-bs-a.m4: New file.
1457 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
1458 (jm_PREREQ): Use it.
1460 2000-01-11 Paul Eggert <eggert@twinsun.com>
1462 * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned
1463 long, to parse numeric modes. Check for any unknown bits, not
1464 just unknown bits left of the leftmost known bit.
1466 2000-01-11 Paul Eggert <eggert@twinsun.com>
1468 * lib/getdate.y: Update copyright notice.
1470 2000-01-11 Paul Eggert <eggert@twinsun.com>
1472 * COPYING: Sync with latest FSF version (fixing a minor Y2k problem).
1474 2000-01-11 Paul Eggert <eggert@twinsun.com>
1476 * lib/exclude.c, lib/exclude.h: Sync to the slightly more
1477 general version of GNU tar.
1479 * src/du.c (count_entry):
1480 Adjust to new calling convention for excluded_filename.
1481 (main): Likewise, for add_exclude_file.
1483 2000-01-11 Jim Meyering <meyering@lucent.com>
1485 * lib/memcpy.c (memcpy): Protoize.
1487 Prepare to sync lib/ directories of fileutils, sh-utils, and textutils.
1488 * lib/Makefile.am: s/fu/fetish/
1489 * src/Makefile.am: s/libfu/libfetish/
1491 * lib/hash.c (hash_initialize): Fix typo in comment.
1492 From François Pinard.
1494 2000-01-10 Jim Meyering <meyering@lucent.com>
1498 * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
1500 2000-01-09 Jim Meyering <meyering@lucent.com>
1504 * src/ln.c (do_link): Produce the same sort of one-line output for
1505 `--backup --verbose' as cp, mv, install. Before this, the backup
1506 file name wasn't printed at all.
1508 This affects cp, install, and mv.
1509 * src/copy.c (copy_internal): When making backup files in verbose
1510 mode, print the backup file name on the same line as the rest of the
1511 information, e.g., `a -> b (backup: b.~13~)' rather than on a separate
1512 line by itself. Suggestion from Karl Berry.
1514 2000-01-08 Jim Meyering <meyering@ascend.com>
1516 * lib/error.c (error): Use __strerror_r's return value only if
1517 HAVE_WORKING_STRERROR_R.
1518 (error_at_line): Likewise.
1520 * Makefile.maint (null_AM_MAKEFLAGS): Define.
1521 (my-distcheck): Use it to avoid distributing out of date files
1522 whose derivation would require a maintainer tool.
1524 2000-01-07 Jim Meyering <meyering@ascend.com>
1526 * lib/euidaccess.c: Sync with the GNU C library.
1528 * tests/dir/Makefile.am: (TESTS_ENVIRONMENT): Add `pwd`/ prefix
1529 to exported PATH value (though not strictly necessary, here).
1530 * tests/dd/Makefile.am: Likewise.
1531 * tests/dircolors/Makefile.am: Likewise.
1532 * tests/rm/Makefile.am: Likewise.
1533 * tests/rmdir/Makefile.am: Likewise.
1534 * tests/shred/Makefile.am: Likewise.
1535 * tests/touch/Makefile.am: Likewise.
1536 * tests/shred/Makefile.am: Likewise.
1538 2000-01-06 Jim Meyering <meyering@ascend.com>
1540 * man/help2man: Import version 1.020.
1542 * lib/strftime.c: Sync with the GNU C Library.
1544 2000-01-06 Paul Eggert <eggert@set.twinsun.com>
1546 * tar/lib/getdate.y: Sync tm_diff with the GNU C Library.
1547 (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed.
1548 (tm_diff): Renamed from difftm. All uses changed.
1549 Replace body with that taken from GNU C Library 2.1.3pre1.
1550 (get_date): Prefer tm_gmtoff to tm_diff if available.
1552 2000-01-04 Paul Eggert <eggert@twinsun.com>
1554 * savedir.c (savedir): Don't store past the end of an array if
1555 name_size is zero and the directory is empty.
1557 * Makefile.maint (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0.
1558 (alpha): Create xdelta diffs.
1560 2000-01-02 Jim Meyering <meyering@ascend.com>
1564 * src/mv.c: New option: --strip-trailing-slashes.
1566 1999-11-18 Paul Eggert <eggert@twinsun.com>
1568 * lib/strftime.c (my_strftime): Some old compilers object to
1569 '\a', so don't bother optimizing for it.
1571 2000-01-01 Paul Eggert <eggert@twinsun.com>
1573 Fix bug: `df PATH' sometimes misbehaves when there is an
1574 inaccessible mount point unrelated to PATH.
1575 * configure.in (AC_CHECK_FUNCS): Add realpath, resolvepath.
1576 * src/df.c (#pragma alloca): Add if _AIX is defined.
1577 (path-concat.h): Include.
1578 (show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined,
1579 find the real absolute path for PATH, and use that to find the
1582 (show_point): Prefer non-dummy entries in shortcuts, too.
1583 Disable bogus mount dirs instead of restatting them each time.
1585 1999-12-30 Jim Meyering <meyering@ascend.com>
1586 1999-12-17 Kalle Olavi Niemitalo <tosi@stekt.oulu.fi>
1588 * src/rmdir.c (remove_parents, main): Don't pass errno to error
1589 when printing "removing directory" message. Failure of rmdir is
1592 1999-12-23 Jim Meyering <meyering@ascend.com>
1594 * configure.in: Remove clock_gettime tests.
1595 Now they're in m4/jm-macros.m4.
1597 * src/ln.c (usage): Correct typos.
1598 List new --target-directory=... usage.
1599 Reported by Göran Uddeborg
1601 * src/mv.c (usage): List new --target-directory=... usage.
1603 1999-12-22 Jim Meyering <meyering@ascend.com>
1605 * lib/getdate.y (get_date): Fix typo in time_t overflow test.
1608 1999-12-21 Andreas Schwab <schwab@suse.de>
1610 * tests/shred/remove: Use $file, not $tmp/file. Exit 77 if run as
1613 1999-12-20 Paul Eggert <eggert@twinsun.com>
1615 * src/df.c (ceil_percent): Remove.
1616 (show_dev): Avoid overflow problems when calculating percent.
1617 Do not display negative percents.
1619 1999-12-19 Jim Meyering <meyering@ascend.com>
1623 * doc/fileutils.texi: Clarify and combine descriptions of -c and of
1625 Likewise for -u/--time=atime.
1627 * src/ls.c [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper.
1628 [Notice the new configure-time test in m4/lstat-slash.m4. ]
1629 (main): Back out change from 1999-02-19 that made ls remove
1630 trailing slashes from command line arguments to accommodate early
1631 versions of Linux. Now, `ls symlink-to-dir/' acts like
1632 `ls symlink-to-dir/.' thus following the symbolic link, as POSIX says
1633 it should. Suggestion from Bruno Haible and Andreas Schwab.
1635 * lib/xstat.in (slash_aware_lstat): New function.
1636 (rpl_@xstat@): Use it.
1637 * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
1638 (lstat.c): Likewise.
1640 Make sure ls does the right thing with symlinks and trailing slashes.
1641 * tests/ls/Makefile.am (TESTS): Add symlink-slash.
1642 * tests/ls/symlink-slash: New test, for above-fixed bug.
1644 1999-12-18 Jim Meyering <meyering@ascend.com>
1646 * src/shred.c (wipename): When repeatedly renaming a file, making the
1647 name shorter and shorter, skip to the next shorter length length if a
1648 rename fails (e.g. due to permission denied). Otherwise, this loop
1649 would iterate for so long that shred would appear to be stuck in an
1650 infinite loop for any but the shortest file names.
1651 Reported by Joe Orton.
1653 * configure.in (AC_OUTPUT): Add tests/shred/Makefile.
1654 * tests/Makefile.am (SUBDIRS): Add shred.
1655 * tests/shred: New directory
1656 * tests/shred/remove: New file. Tests for the above-fixed bug.
1658 1999-12-13 Jim Meyering <meyering@ascend.com>
1660 * lib/makepath.c (make_path): Consistently use `error' to output
1661 the verbose, `created directory ...' messages.
1662 Reported by Bernhard Rosenkraenzer.
1664 1999-12-12 Jim Meyering <meyering@ascend.com>
1666 Move 120+ lines of stat.h-related macros from system.h (not shared)
1667 to sys2.h, which is shared between fileutils, sh-utils, textutils.
1668 * src/system.h: Move them from here...
1669 * src/sys2.h: ... to here.
1671 * src/system.h (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define
1672 if not defined. This was necessary on a NeXT Turbostation running
1673 Mach 3.3. Reported by Nelson H. F. Beebe.
1675 * src/ls.c (decode_switches): If -c or -u is specified and not -l
1676 (or any other option that implies -l), and no sort-type was specified,
1677 then sort by the ctime (-c) or atime (-u). Part of this change reverts
1678 the 1998-01-10 delta.
1679 (usage): Update to reflect this change.
1680 Reported by Paul Slootman via Michael Stone.
1682 1999-12-09 Jim Meyering <meyering@ascend.com>
1684 * src/df.c (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define
1685 these and use them instead of `CHAR_MAX + n'.
1686 * src/du.c (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION):
1688 * src/touch.c (TIME_OPTION): Likewise.
1689 * src/rmdir.c (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise.
1691 * tests/ls/time-1: Test more of the framework (touch's -a and -m
1692 options) before running the actual ls test.
1694 1999-12-07 Jim Meyering <meyering@ascend.com>
1696 * tests/cp/cp-mv-backup: Use 1>&2 rather than `1<&-'.
1697 Suggestion from Volker Borchert.
1699 1999-12-05 Jim Meyering <meyering@ascend.com>
1701 * Makefile.maint: Remove ftp.enst.fr.
1703 1999-12-04 Jim Meyering <meyering@ascend.com>
1707 * tests/mv/into-self-2: Adapt to reflect this change in behavior.
1708 Make sure the VERSION_CONTROL envvar is not set.
1709 Run diff if comparison fails.
1711 * src/copy.c (copy_internal): In move mode, if the rename attempt
1712 fails, then unlink any existing destination file. This makes a
1713 cross-device `mv' more consistent with the intra-device behavior.
1714 This change is required by POSIX to make a cross-device move act with
1715 semantics similar to those of the rename syscall. For example now
1716 `mv' can move a file onto a symlink to itself when that symlink
1717 is on a separate partition. With fileutils-4.0j, it would fail with
1718 a diagnostic saying they were the same file.
1719 Reported by Bruno Haible.
1721 * tests/mv/to-symlink: New file. Adds test for the above.
1722 * tests/mv/Makefile.am (TESTS): Add to-symlink.
1724 * tests/cp/cp-mv-backup (trap): Be careful to close $actual before
1725 removing the containing directory. Otherwise, on some systems rmdir
1726 fails to remove the containing directory.
1728 * tests/ls/time-1: List --full-time dates upon failure.
1730 1999-12-02 Andreas Schwab <schwab@suse.de>
1732 * src/ls.c (check_symlink_color): New variable.
1733 (main): Set it if we need to check for dangling symlinks when
1735 (gobble_file): Check check_symlink_color instead of print_with_color.
1737 1999-11-30 Paul Eggert <eggert@twinsun.com>
1739 * src/ls.c (usage): Shorten help for --show-control-chars.
1741 1999-11-30 Jim Meyering <meyering@ascend.com>
1743 Give the right diagnostic when failing to create a file in an
1744 unwritable directory.
1745 * src/touch.c (touch): Record errno upon failed errno and use that
1746 saved value if a subsequent fstat, stat or utime call fails.
1747 Reported by Wichert Akkerman via Michael Stone.
1749 1999-11-27 Jim Meyering <meyering@ascend.com>
1751 Clean up test scripts.
1752 * tests/mv/setup: Don't set/use DF or MKDIR. Use df and mkdir instead.
1753 * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH
1754 * tests/mv/backup-is-src: Likewise for RM and MV.
1755 * tests/mv/hard-link-1: Likewise.
1756 * tests/mv/into-self: Likewise.
1757 * tests/mv/into-self-3: Likewise.
1759 Add test for 1999-05-23 change to src/copy.c (copy_internal).
1760 * tests/mv/partition-perm: New file.
1761 * tests/mv/Makefile.am (TESTS): Add partition-perm.
1765 1999-11-22 Paul Eggert <eggert@twinsun.com>
1767 * src/df.c (df_readable): Now returns char const *, not char *.
1769 (ceil_percent): Now returns double, not int.
1770 Be more careful about adding 1 to a wild value.
1771 (show_dev): Don't filter out wild sizes from the underlying operating
1772 system; instead, show them to the user as faithfully as possible.
1774 1999-11-23 Jim Meyering <meyering@ascend.com>
1776 * doc/getdate.texi (Calendar date item): Correction regarding 0..68/
1777 69-99 split for 1900 vs 2000. From Peter Moulder.
1779 1999-11-22 Jim Meyering <meyering@ascend.com>
1781 * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c.
1783 1999-11-20 Jim Meyering <meyering@ascend.com>
1785 * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate
1787 (remove_parents): Use it.
1790 * tests/cp/cp-mv-backup: Run `diff -c' if the test fails.
1792 * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH.
1793 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc.
1795 * src/chgrp.c: Declare lstat; needed on e.g. SunOS4.
1796 Reported by Tom Tromey.
1798 1999-11-19 Jim Meyering <meyering@ascend.com>
1800 * lib/strstr.c (strstr): Include config.h.
1801 Add a `;' between shloop label and `}'.
1804 1999-11-17 Jim Meyering <meyering@ascend.com>
1806 * src/mkdir.c (S_IRWXUGO): Define if necessary.
1807 (main): Use chmod to set the permissions if bits other than those
1808 of S_IRWXUGO were requested. Reported by Sami Farin.
1810 1999-11-14 Paul Eggert <eggert@twinsun.com>
1812 * touch.c (touch): Simplify code a tad, using fd == -1 instead
1813 of separate valid_fd variable.
1815 1999-11-13 Jim Meyering <meyering@ascend.com>
1817 * src/touch.c (touch): Don't fail just because we couldn't open
1818 an existing file. This makes it so that touching a read-only
1819 file now works. Also clean up and simplify.
1820 Based on a patch from Chip Salzenberg.
1821 * tests/touch/no-rights: New test for this.
1822 * tests/touch/Makefile.am (TESTS): Add no-rights.
1824 1999-11-12 Jim Meyering <meyering@ascend.com>
1826 * src/remove.c (print_nth_dir): Write one fewer byte so we don't print
1828 (rm): Fix bugs in (and test, this time) the very rarely used code
1829 to warn about directory cycles.
1830 Reported by michael@roka.net.
1832 1999-11-11 Jim Meyering <meyering@ascend.com>
1834 * src/copy.c (copy_internal): Treat src and dest as the `same' in
1835 `mv src symlink-to-src' when src and dest are on different partitions.
1836 Otherwise, that `mv' command would silently remove `src'.
1837 Reported by Michael Stone.
1838 * tests/mv/into-self-2: Add a test for this fix.
1840 * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others
1841 just like that also dated back to 1992 were fixed in 1998-01-02).
1842 Richard Braakman reported that using `install -d -g foo 1/2`
1843 only sets the group on the intermediate directory, not the final
1844 component. From Michael Stone.
1846 1999-11-07 Paul Eggert <eggert@set.twinsun.com>
1848 * human.c (default_block_size): New function.
1849 (humblock): Use it if no block size is specified.
1850 (human_block_size): If the specified block size is zero, report an
1851 error if report_errors is nonzero; otherwise use the default.
1853 1999-11-07 Jim Meyering <meyering@ascend.com>
1855 * src/dircolors.hin: Add several more TERM types.
1857 Add .png for real this time.
1858 Change the image types colors to be visible in a black-on-white xterm.
1861 * src/chgrp.c (xstat): New global.
1863 (change_file_group): Use it. Before this change, when running chgrp
1864 on a symlink without --dereference (-h) and when the requested group
1865 is the same as the group for the *symlink*, chgrp would do nothing.
1866 Now it changes the group of the file referenced through the symlink.
1867 Reported by Martin Mitchell.
1869 * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
1870 * src/chown.c: Define and use REFERENCE_FILE_OPTION and
1871 DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
1872 * src/chgrp.c: Likewise.
1874 * tests/ln/misc: Add hard-link-to-symlink test.
1875 Move framework_failure test to the end.
1876 Fix a typo: s/||/&&/.
1878 * src/ln.c (do_link): Warn that making a hard link to a symbolic link
1881 * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'.
1882 * tests/ln/backup-1: Likewise.
1884 * configure.in (AC_OUTPUT): Add tests/rmdir/Makefile.
1885 * tests/Makefile.am (SUBDIRS): Add rmdir.
1886 * tests/rmdir: New directory
1887 * tests/rmdir/ignore: New file.
1889 * src/rmdir.c (remove_parents): Use the correct test (just as in
1890 main) in handling --ignore-fail-on-non-empty. From Michael Stone.
1891 (usage): Improve description of --parents. Based on suggestion from
1894 1999-11-06 Jim Meyering <meyering@ascend.com>
1896 Allow hard links to symlinks on systems that support it.
1897 * src/ln.c (STAT_LIKE_LINK): Define.
1898 (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
1899 the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
1901 * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is
1902 accepted as the short form of --file-type, per the documentation.
1903 From James Sneeringer.
1905 * src/ln.c (do_link): Fix typo (in which the function name `symlink'
1906 was tested instead of the variable `symbolic_link') that could make
1907 ln perform an unneeded `stat' call.
1909 1999-11-05 Jim Meyering <meyering@ascend.com>
1911 * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated
1913 * src/copy.c: Likewise.
1914 * lib/fileblocks.c: Likewise.
1916 * configure.in: Move some type/header/member tests into
1917 m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
1918 fileutils, textutils, and sh-utils.
1920 1999-11-02 Jim Meyering <meyering@ascend.com>
1922 * man/help2man: Import version 1.018.
1923 * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
1924 * man/*.x: Include one-line summary in [NAME] section.
1925 * man/Makefile.summ: Remove the one-line summaries.
1926 Suggestion for clean-up from Akim Demaille.
1928 * configure.in (ALL_LINGUAS): Add Galician (gl).
1930 1999-11-01 Jim Meyering <meyering@ascend.com>
1932 * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and
1933 other special files like /dev/zero.
1935 * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
1937 1999-10-31 Jim Meyering <meyering@ascend.com>
1939 * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around
1942 * doc/fileutils.texi: Document new --backup[=METHOD] option for
1943 cp, mv, ln, and install.
1945 * src/ln.c: Convert --backup to take an optional argument.
1946 Deprecate --version-control (-V) in comments.
1947 (usage): Remove mention of --version-control.
1948 (main): Make -V warn then fall through into --backup case.
1949 [--backup case]: Handle optional arg.
1950 * src/install.c: Likewise.
1952 1999-10-24 Jim Meyering <meyering@ascend.com>
1954 * src/cp.c (do_copy): Constify `dest', and cast-away the new
1955 const in assignment to new_dest.
1957 1999-10-23 Jim Meyering <meyering@ascend.com>
1959 * tests/touch/Makefile.am (TESTS): Add dangling-symlink.
1960 * tests/touch/dangling-symlink: New file.
1962 1999-10-23 Paul Eggert <eggert@twinsun.com>
1964 * src/touch.c (full_write): Remove unused decl.
1965 (open_maybe_create): Remove.
1966 (touch): Don't record whether the file was created; this isn't
1967 possible to do reliably and portably without race conditions.
1968 If the file was created and if amtime_now is nonzero, this
1969 change means we'll have to do another utime system call, but
1970 that's no more harmful than the previous version of this code.
1971 Reported by Gabor Z. Papp.
1973 1999-10-21 Jim Meyering <meyering@ascend.com>
1975 * configure.in (ALL_LINGUAS): Add Japanese (pa).
1977 1999-10-17 Jim Meyering <meyering@ascend.com>
1979 * tests/mv/backup-is-src: Remove use of mv's now-deprecated
1980 -V option. Use --b=simple instead of -b -V simple.
1982 * src/mv.c: Convert --backup to take an optional argument.
1983 Deprecate --version-control (-V) in comments.
1984 (usage): Remove mention of --version-control.
1985 (main): Make -V warn then fall through into --backup case.
1986 [--backup case]: Handle optional arg.
1988 Accept new option: --target-directory=DIR
1989 * src/cp.c (TARGET_DIRECTORY_OPTION): Define.
1990 (SPARSE_OPTION): Define.
1991 (usage): Describe it.
1992 (do_copy): Change meanings/names of first two parameters: use `n_files'
1993 in place of `argc - optind', and `file' instead of `argv + optind'.
1994 Add parameter, target_directory.
1995 (main): Pass new arg, target_directory.
1997 1999-10-16 Jim Meyering <meyering@ascend.com>
1999 * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option.
2000 Use --b=simple instead of -b -V simple.
2001 * tests/cp/backup-1: Replace use of cp's now-deprecated
2002 --version-control option with use of --backup=simple.
2004 * src/cp.c: Convert --backup to take an optional argument.
2005 Deprecate --version-control (-V) in comments.
2006 (usage): Remove mention of --version-control.
2007 (main): Make -V warn then fall through into --backup case.
2008 [--backup case]: Handle optional arg.
2010 * tests/cp/Makefile.am (TESTS): Add cp-mv-backup.
2011 * tests/cp/cp-mv-backup: New file.
2013 1999-10-11 Jim Meyering <meyering@ascend.com>
2015 * lib/getopt.c: Merge changes from latest glibc.
2016 * lib/getopt.h: Likewise.
2017 * lib/getopt1.c: Likewise.
2019 1999-10-09 Jim Meyering <meyering@ascend.com>
2021 Accept new option: --target-directory=DIR
2022 * src/ln.c (TARGET_DIRECTORY_OPTION): Define.
2023 (usage): Describe it.
2024 (main): Implement it.
2025 Make code clearer: use new variable `n_files' in place of
2026 `argc - optind'. Use `file' instead of `argv + optind'.
2028 1999-10-04 Jim Meyering <meyering@ascend.com>
2030 * depcomp: New file, for automake's new dependency support.
2031 * missing: New version, from automake's user-dep-gen-branch.
2033 * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too.
2034 * src/sys2.h (__attribute__): Likewise.
2035 Wrap with #ifndef __attribute__.
2037 1999-10-03 Paul Eggert <eggert@twinsun.com>
2039 * getdate.y (__attribute__): Define to empty if GCC claims to
2040 be before 2.8; this is needed for OPENStep 4.2 cc. Also,
2041 define to empty if strict ANSI.
2043 1999-10-03 Jim Meyering <meyering@ascend.com>
2045 Accept new option: --target-directory=DIR
2046 * src/mv.c (TARGET_DIRECTORY_OPTION): Define.
2047 (usage): Describe it.
2048 (main): Implement it.
2049 Remove unused variable, stdin_tty.
2050 Make code clearer: use new variable `n_files' in place of
2051 `argc - optind'. Use `file' instead of `argv + optind'.
2053 1999-09-28 Jim Meyering <meyering@ascend.com>
2055 * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
2056 Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
2057 * src/sys2.h: Likewise.
2059 * lib/xalloc.h (__attribute__): Protect against redefinition.
2062 1999-09-26 Jim Meyering <meyering@ascend.com>
2064 * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and
2066 Use explicit exit to help avoid warnings.
2069 * lib/path-concat.c (DIRECTORY_SEPARATOR): Define.
2071 (path_concat): Allow parameter DIR to be NULL.
2072 (xpath_concat): New function.
2075 * lib/xalloc.h (__attribute__): Define.
2076 (ATTRIBUTE_NORETURN): Define.
2077 (xalloc_die): Declare.
2078 (NEW): Define as yet unused macro.
2084 * lib/basename.c (base_name): Add prototype. From Akim Demaille.
2086 1999-09-19 Jim Meyering <meyering@ascend.com>
2088 * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
2089 (S_ISLNK): Define if necessary.
2090 This is necessary on a NEC SX-4 with SUPER-UX 9.1.
2091 Based on a patch from Holger Berger.
2093 * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
2094 Change many counter and index variables to be of unsigned type.
2095 (dd_copy): Add new unsigned variable, n_bytes_read, in place of
2096 many uses of `nread'.
2098 * src/sys2.h (__attribute__): Define.
2099 (ATTRIBUTE_NORETURN): Remove #else clause.
2100 (ATTRIBUTE_UNUSED): Define.
2102 1999-09-17 Jim Meyering <meyering@ascend.com>
2104 * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this
2105 is done in m4/jm-macros.m4.
2107 1999-09-09 Jim Meyering <meyering@ascend.com>
2109 * src/touch.c (usage): Remove misleading sentence in --help output.
2112 * src/Makefile.am (EXTRAdir): Remove unused variable.
2114 1999-09-03 Paul Eggert <eggert@twinsun.com>
2116 * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
2119 1999-09-01 Jim Meyering <meyering@ascend.com>
2121 * src/cp.c: Remove declaration of xstrdup.
2122 * src/df.c: Likewise.
2123 * src/ls.c: Likewise.
2125 1999-09-01 Akim Demaille <akim@epita.fr>
2127 * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'.
2128 * lib/xalloc.h (xalloc_fail_func): Likewise.
2129 (xstrdup): Add protoype.
2131 * lib/version-etc.c (version_etc_copyright): Default copyright string.
2132 (version_etc): Use it.
2133 * lib/version-etc.h: Declare it.
2135 1999-08-29 Jim Meyering <meyering@ascend.com>
2137 * configure.in (AC_YACC): Remove use, now that we require bison.
2139 * src/dircolors.hin: Add .rpm, .png, and .fli.
2142 1999-08-28 Paul Eggert <eggert@twinsun.com>
2144 * getdate.y: Add copyright notice.
2146 (number): Handle `Nov 11 1996' example; see Risks Digest 20.55
2147 http://catless.ncl.ac.uk/Risks/20.55.html#subj18
2150 (<stdio.h>): Include only if testing.
2152 (ISLOWER, PC): New macros.
2153 (<string.h>): Include if HAVE_STRING_H, not USG.
2155 (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
2157 (EPOCH_YEAR): Renamed from EPOCH.
2158 (table): Renamed from TABLE.
2159 (meridian): Now an anonymous enum.
2160 (struct parser_control): New type.
2161 (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
2162 (yyInput, ..., yyRelYear): Migrated into struct parser_control.
2163 (%pure_parser): Added, so that the parser is pure.
2164 (%union): Removed; the type is now just plain int.
2165 All %type directives removed.
2166 (tLOCAL_ZONE): New %token.
2167 (month_day_table): Renamed from MonthDayTable.
2168 (gmtime, localtime, mktime, time): Declare only if not defined.
2169 (meridian_table): New table.
2170 (dst_table): New table.
2171 (units_table): renamed from UnitsTable.
2172 (relative_time_table): Renamed from OtherTable.
2173 (time_zone_table): Renamed from TimezoneTable. Modernized data.
2174 (military_table): Renamed from MilitaryTable.
2175 (to_hour): Renamed from ToHour.
2176 (to_year): Renamed from ToYear.
2177 (lookup_zone): New function.
2178 (LookupWord): Renamed from lookup_word.
2179 Use lookup_zone for time zones.
2180 (yylex): Now reentrant. All callers changed.
2181 (get_date): Add support for local time zone abbreviations.
2184 1999-08-22 Jim Meyering <meyering@ascend.com>
2186 * src/sys2.h (IF_LINT): Define new macro.
2187 * src/df.c (main): Rename locals i and j.
2188 Use IF_LINT macro instead of #ifdef lint...
2190 * src/dd.c (parse_integer): Add `const' to char* parameter and
2191 add a separate `suffix' variable.
2193 1999-08-20 Jim Meyering <meyering@ascend.com>
2195 * src/chown.c (usage): Tweak --help output to make it more consistent
2197 * src/chgrp.c (usage): Tweak --help output to make it more consistent
2200 1999-08-17 Jim Meyering <meyering@ascend.com>
2202 * configure.in: Remove check for rename and the code that would
2203 enable building of the `mvdir' program.
2204 * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@.
2205 (EXTRA_PROGRAMS): Remove obsolete mvdir.
2206 * lib/rename.c: Remove obsolete file. (it had a bug, too)
2207 * src/mvdir.c: Remove obsolete file.
2208 * po/POTFILES.in: Remove mvdir.c
2210 * doc/fileutils.texi (chown, chgrp invocation): Make these sections
2211 consistent with each other.
2213 1999-08-16 Jim Meyering <meyering@ascend.com>
2215 * src/chown.c (groupname): Declare to be `const'.
2216 (change_dir_owner): Declare statp parameter to be `const'.
2217 (usage): Make the output be more consistent with that from chgrp.
2219 This change is nearly identical to the chown.c change of 1998-05-24
2220 * src/chgrp.c: Accept new option, --dereference.
2221 --no-dereference is now the default. Include lchown.h.
2222 (enum Change_status) [CH_NOT_APPLIED]: New member.
2223 (change_symlinks): Enable this by default, now.
2224 (describe_change): Handle new case.
2225 (change_file_group): Add new parameter: cmdline_arg. Update callers.
2226 Reorganize to reflect changed semantics.
2227 (LCHOWN): Remove definitions.
2230 1999-08-10 Jim Meyering <meyering@ascend.com>
2232 * po/POTFILES.in: Add lib/quotearg.c.
2234 1999-08-09 Paul Eggert <eggert@twinsun.com>
2236 * NEWS, doc/fileutils.texi, src/ls.c (usage):
2237 Add ls --quoting-style=locale.
2239 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE):
2240 Change from escape_quoting_style to locale_quoting_style.
2241 (argmatch_invalid): Use new quotearg_style primitive for simplicity.
2242 Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
2244 * lib/quotearg.h (locale_quoting_style): New enum value.
2245 (quotearg_n_style, quotearg_style): New decls.
2247 * lib/quotearg.c: Include <libintl.h> if ENABLE_NLS.
2249 (quoting_style_args, quoting_style_v, quotearg_buffer): Add support
2250 for locale_quoting_style, using _("`") and _("'") for open and close
2252 Do not quote spaces in escape_quoting_style.
2253 (quotearg_n_style, quotearg_style): New functions.
2255 1999-08-08 Jim Meyering <meyering@ascend.com>
2257 * src/touch.c (usage): Clarify description of --time=WORD.
2260 * lib/savedir.c (savedir): Change type of name_size parameter to off_t.
2261 * lib/savedir.h (savedir): Update prototype.
2262 * src/chmod.c (change_dir_mode): Remove cast of savedir arg.
2263 * src/chown.c (change_dir_owner): Likewise.
2264 * src/chgrp.c (change_dir_group): Likewise.
2265 * src/copy.c (copy_dir): Likewise.
2266 * src/du.c (count_entry): Likewise.
2267 Suggestion from Bob Proulx.
2269 1999-08-07 Jim Meyering <meyering@ascend.com>
2271 * po/POTFILES.in: Add lots of lib/*.c files.
2272 Remove src/cp-hash.c, since it doesn't use _().
2274 1999-08-04 Jim Meyering <meyering@ascend.com>
2276 * configure.in: Remove getline-testing code. Now it's in m4/.
2278 1999-08-01 Paul Eggert <eggert@twinsun.com>
2280 * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
2282 1999-07-30 Jim Meyering <meyering@ascend.com>
2284 * src/ls.c (usage): Explain about default wrt --hide-control-chars and
2285 --show-control-chars. Reported by Germano Leichsenring.
2287 1999-07-28 Jim Meyering <meyering@ascend.com>
2289 * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
2291 1999-07-24 Jim Meyering <meyering@ascend.com>
2293 * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
2294 (dd_copy): Use those to page-align both the input and output buffers.
2296 1999-06-01 Volker Borchert <bt@teknon.de>
2298 * tests/Makefile.am: Make envvar-check depend on check-recursive rather
2299 than on `check' so that its tests are performed before any real tests.
2301 1999-07-15 Jim Meyering <meyering@ascend.com>
2303 * src/dd.c: Include getpagesize.h.
2304 (dd_copy): Page-align the input buffer.
2305 Based on a patch from Scott Lurndal.
2307 * getpagesize.h: New file.
2308 * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h.
2310 * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
2311 Work around SunOS botch also when block size is different from 1k.
2314 1999-07-10 Jim Meyering <meyering@ascend.com>
2316 * man/help2man: Import version 1.012.
2318 1999-07-04 Jim Meyering <meyering@ascend.com>
2320 * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax.
2322 1999-07-04 Paul Eggert <eggert@twinsun.com>
2324 * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
2325 expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
2326 (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
2329 1999-06-27 Paul Eggert <eggert@twinsun.com>
2331 Fix some incompatibilities between `df -P' and POSIX.2.
2333 * lib/human.h (enum human_inexact_style): New enum.
2334 (human_readable_inexact): New decl.
2336 * lib/human.c (human_readable): New function.
2337 (human_readable_inexact): Renamed from human_readable, with new arg
2338 INEXACT_STYLE. Add support for ceiling and floor.
2340 * src/df.c (print_header): Conform to POSIX if posix_format).
2341 (df_readable): Take ceiling if posix_format.
2342 (ceil_percent): New function.
2343 (show_dev): Take ceiling of percent if posix_format.
2344 Align with POSIX-conforming header if posix_format.
2346 * doc/fileutils.texi: Document these changes.
2348 1999-05-27 Volker Borchert <bt@teknon.de>
2350 * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
2352 1999-05-23 Jim Meyering <meyering@ascend.com>
2354 * src/copy.c (copy_internal): Don't apply the umask in move_mode.
2355 Otherwise, `mv' would not preserve the permissions when copying
2356 between partitions. Reported by David Godfrey
2360 * tests/cp/same-file: Correct erroneous expected output from
2361 the `cp -f foo foo' tests.
2362 * po/POTFILES.in: Add same.c.
2363 * lib/same.h: New file.
2364 * lib/same.c: New file (function extracted from ln.c).
2365 * lib/Makefile.am (libfu_a_SOURCES): Add same.c.
2366 (noinst_HEADERS): Add same.h.
2367 * src/copy.c: Include same.h.
2368 * src/ln.c (same_name): Remove function.
2369 <same.h>: Include this instead.
2370 <dirname.h>: No longer include this.
2371 * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'.
2373 * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not
2374 remove FILE. Suggestion from Chris Yeo.
2375 * tests/mv/force: New test, for the above fix.
2376 * tests/mv/Makefile.am (TESTS): Add force.
2377 (TESTS_ENVIRONMENT): Change PATH to be absolute.
2379 * tests/mv/force (mv): New test.
2381 1999-05-17 Paul Eggert <eggert@twinsun.com>
2383 * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we
2384 have an absolute timestamp, or if the relative timestamp
2385 mentions days, months, or years. Reported by Volker Borchert.
2387 * lib/human.c (human_readable): Allow from_block_size to be zero.
2389 1999-05-14 Jim Meyering <meyering@ascend.com>
2391 * tests/Makefile.am (envvar-check): Renamed from check-local.
2392 (check): Depend on envvar-check so the envvar check is performed
2393 before all other tests. Reported by Volker Borchert.
2394 * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
2395 so CDPATH is mentioned in the message. Reported by Volker Borchert.
2397 * src/df.c (main): When asking for info on an explicit file name,
2398 just warn rather than failing if the table of mounted filesystems
2399 cannot be read. Based on a patch from Mark Kettenis.
2401 * lib/version-etc.c (version_etc): Put version info and author names
2402 on the first two lines respectively rather than putting the three
2403 lines of copyright info between them.
2405 * src/touch.c (open_maybe_create): Handle Solaris' failure mode when
2406 FILE is a directory. Reported by Vin Shelton.
2408 * lib/human.c: Include <string.h> or <strings.h> for strlen prototype.
2409 * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes.
2410 * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on
2411 64-bit systems. From Ulrich Drepper.
2413 1999-05-12 Jim Meyering <meyering@ascend.com>
2415 * src/shred.c (main): Put `u' for -u in getopt_long's string argument.
2418 1999-05-07 Jim Meyering <meyering@ascend.com>
2422 * tests/touch/dir-1: New test.
2423 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual
2424 upper-case program names. Add a definition of PATH.
2427 * src/mkdir.c (main): Use better wording in diagnostic: `cannot
2428 create directory' rather than `cannot make directory'. The former
2429 also matches the one in makepath.c.
2431 * src/dd.c: (apply_translations): Use TOUPPER and TOLOWER,
2432 not toupper and tolower.
2434 1999-05-05 Jim Meyering <meyering@ascend.com>
2436 * lib/makepath.c (make_dir): When reporting a mkdir failure and the
2437 target cannot be `stat'ed, use the errno from the failed mkdir call,
2438 not the one from the stat call. Before this change, running
2439 `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
2440 elicit `No such file or directory' instead of `Permission denied'.
2442 * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
2443 (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
2444 Based on a patch from Kaveh Ghazi.
2446 * src/ls.c (USE_ACL): Define this only #if
2447 (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
2448 Use `USE_ACL' in place of `HAVE_ACL' everywhere else. From Kaveh Ghazi.
2450 1999-05-04 Jim Meyering <meyering@ascend.com>
2452 * lib/makepath.c: Include makepath.h libintl.h, not after it.
2453 Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
2454 (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
2455 which is necessary on Irix4 since cc doesn't define __STDC__.)
2458 1999-04-30 Jim Meyering <meyering@ascend.com>
2460 * Makefile.maint: Define several tag-related make variables.
2461 (cvs-dist): Use the make variables instead of shell ones.
2462 (announcement): Automatically generate diffs for all ChangeLog files,
2463 not just the top level one.
2465 1999-04-30 Paul Eggert <eggert@twinsun.com>
2467 * lib/dup2.c: New file.
2469 1999-04-30 Jim Meyering <meyering@ascend.com>
2471 * src/touch.c (touch): Only do the fstat if we need to.
2472 Resort to calling stat for directories, but only when necessary.
2473 (usage): Mention --no-create.
2475 * src/copy.c (copy_internal): Move the one-file-system test so that
2476 it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
2477 Prior to this change, `cp --one-file-system' would traverse a file-
2478 system boundary if the destination directory existed. From Ton Hospel.
2480 1999-04-27 Paul Eggert <eggert@twinsun.com>
2482 * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO
2483 for output, to avoid confusion with closed input and output fds.
2484 (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
2486 (open_fd): New function.
2487 (main): Use it, instead of open, to ensure that file descriptors
2490 1999-04-26 Paul Eggert <eggert@twinsun.com>
2492 * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead
2495 * src/dd.c (skip): Don't fstat the input file; the result is
2498 1999-04-26 Jim Meyering <meyering@ascend.com>
2500 * tests/mv/into-self-2: Update to reflect this change by reversing
2501 the order of arguments so the symlink is the source, not the
2502 destination (otherwise, the mv command would now succeed).
2504 * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail.
2505 That is, even though source and destination are `the same,' don't fail
2506 if the destination is a symlink. From Peter Samuelson.
2508 1999-04-26 Paul Eggert <eggert@twinsun.com>
2510 * src/dd.c (main): If you can't open an output file (with
2511 seek=...) read-write, then open it for write and report an
2512 error if we can't seek.
2514 * lib/filemode.c (setst, ftypelet, mode_string):
2515 * lib/mkdir.c (mkdir):
2516 * lib/makepath.c (make_path):
2517 * lib/modechange.c (make_node_op_equals, mode_compile,
2518 mode_create_from_ref, mode_adjust):
2519 * lib/modechange.h (mode_adjust):
2520 * src/chmod.c (describe_change, change_file_mode):
2521 * src/copy.c (copy_reg, copy_internal):
2522 * src/copy.h (struct cp_options.umask_kill):
2523 * src/cp.c (do_copy, cp_option_init, main):
2525 * src/install.c (mode, cp_option_init, DIR_MODE):
2526 * src/mkdir.c (main):
2527 * src/mkfifo.c (main):
2528 * src/mknod.c (main):
2529 * src/mv.c (cp_option_init):
2530 * src/touch.c (open_maybe_create):
2531 Use proper mode_t types and macros.
2532 Don't assume the traditional Unix values for mode bits.
2534 * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH,
2535 S_IXOTH): Define if not defined.
2537 * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
2538 * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU):
2539 Define if not defined.
2540 * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
2541 Define if not defined.
2542 (CHMOD_MODE_BITS): New macro.
2543 * src/install.c (isodigit): Remove unused macro.
2545 * src/mkfifo.c, src/mknod.c (usage):
2546 Use symbolic mode as default, not octal.
2548 * lib/utime.c (utime_null):
2549 Don't pass 0666 to open; it's not needed and isn't
2550 guaranteed to be portable.
2552 * lib/filemode.h: <config.h>, <sys/types.h>: Include for mode_t.
2553 (mode_string): Now takes mode_t.
2555 * lib/modechange.h: Include <config.h>, <sys/types.h> for mode_t.
2556 (struct mode_change): Members affected and value are now mode_t instead
2559 * doc/fileutils.texi, doc/perm.texi:
2560 Don't assume traditional Unix mode numbering.
2562 * lib/modechange.c: modechange.h now includes sys/types.h.
2564 (isodigit, oatoi): Remove.
2565 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
2566 S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
2567 S_IRWXO): Define if not defined.
2568 (CHMOD_MODE_BITS): New macro.
2569 (mode_compile): Convert from octal with xstrtoul, not our own routine.
2571 1999-04-24 Jim Meyering <meyering@ascend.com>
2575 1999-04-22 Jim Meyering <meyering@ascend.com>
2577 * src/shred.c (word32): Don't use `#error'; it runs afoul of
2578 SunOS 4.1.4 cc. From Paul Eggert.
2580 * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
2582 1999-04-20 Paul Eggert <eggert@twinsun.com>
2584 Replace our temporary hack implementation of strtoumax with
2585 something very close to the real code in glibc.
2587 * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
2588 we now have a true replacement in strtoumax.c.
2589 (__strtol): Always define to strtoumax.
2590 (<stdlib.h>): No need to include.
2592 (my_strtoumax): Move this to strtoumax.c,
2593 rename it to strtoumax, and simplify.
2595 * lib/strtoull.c, lib/strtoumax.c: New files.
2597 * lib/strtol.c: Update to glibc 2.1.1 version.
2599 1999-04-20 Jim Meyering <meyering@ascend.com>
2601 * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
2602 (check-local): Also test and warn if CDPATH is set.
2604 1999-04-20 Paul Eggert <eggert@twinsun.com>
2606 * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
2608 * config.guess: New file (from autoconf).
2609 * config.sub: New file (from autoconf).
2611 * src/shred.c <config.h>: Include first, since it can do
2612 things like #define const, and this must be done before
2613 including any system headers.
2615 * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
2616 whether overflow occurred. Improve overflow-detection to use
2617 only one conditional branch total, rather than 2N+1
2618 conditional branches for an N-digit number.
2620 1999-04-18 Jim Meyering <meyering@ascend.com>
2622 * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
2623 strtouq, now that they're checked in m4/xstrtoumax.m4.
2625 1999-04-18 Paul Eggert <eggert@twinsun.com>
2627 * doc/fileutils.texi, src/shred.c (main, longopts):
2628 Use -u instead of -R for --remove, so that we can preserve
2629 future compatibility with rm.
2631 1999-04-18 Jim Meyering <meyering@ascend.com>
2633 * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
2634 (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
2637 1999-04-18 Paul Eggert <eggert@twinsun.com>
2639 Fix shred to do the right thing with off_t longer than long.
2640 Merge large-integer parsing code with similar code in dd.c,
2641 and put the resulting in lib/xstrtoumax.c so that other programs
2642 can use it. Instead of adding a new lib/xstrtoumax.h I thought
2643 it cleaner to put all the xstroto* declarations into a single
2644 header, which for now is lib/xstrtol.h for lack of a better place.
2645 (Mayby lib/xstdlib.h would be better? :-)
2647 I thought of several other problems with shredding regular files;
2648 shredding devices is much more reliable. So I changed the defaults
2649 to be more suitable for shredding devices; this should help encourage
2650 users to do the right thing.
2652 pfstatus isn't portable to environments with varying width
2653 fonts, or with internationalized environments where the byte
2654 count of the message is not the same as its print width.
2655 Rather than deal with this, I just simplified it to not do
2656 tricks with carriage-returns and spaces. (I'm also worried
2657 that vprintf may not return the right value on some hosts; I
2658 vaguelly recall this being a problem.) As a result, -v and -
2661 When removing a special file, try to truncate it first, but don't
2662 worry if this reports an error.
2664 Try to find the size of a non-regular file by seeking to its end.
2666 Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
2668 Some other minor bug fixes.
2670 * lib/xstrtoul.h: Remove this file.
2671 * lib/xstrtoumax.c: New file.
2673 * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
2675 * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
2676 (__strtol, __strtol_t, __xstrtol): New macros.
2678 * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
2679 New macros to specify the
2680 underlying function, its returned type, and our function. Default to
2681 values suitable for xstrtol.
2683 Include <ctype.h>, since we use its macros.
2685 (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
2686 (ISSPACE): New macro.
2688 (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
2691 (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
2692 whether STRING_TO_UNSIGNED is defined. Skip isspace chars, not
2693 isblank chars, to match strtol. When returning
2694 LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
2697 * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
2698 <inttypes.h>: Include if HAVE_INTTYPES_H.
2699 (_DECLARE_XSTRTOL): New macro.
2700 (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
2701 we need only one include file, not three.
2702 (_STRTOL_ERROR): Do not undef, as this is no longer needed.
2703 Reword overflow message so that it's independent of type.
2705 * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
2706 (noinst_HEADERS): Remove xstrtoul.h.
2708 * lib/xmalloc.c (xalloc_fail):
2709 Pass xalloc_msg_memory_exhausted through gettext.
2712 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
2713 (LookupWord, yylex): Don't pass negative char to ctype macros.
2715 * doc/fileutils.texi:
2716 Explain why shredding devices is more reliable, and why the
2717 default options are more suitable for devices.
2719 Remove withdrawn options -b or --no-contents, -c or --freed-contents,
2720 -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
2723 Add -R or --remove, -s or --size.
2725 -v can no longer be doubled.
2727 `file system' --> `filesystem' uniformly.
2729 * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
2731 * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
2732 "human.h", "xalloc.h": Include.
2733 (attribute): Remove; no longer needed.
2734 (xstrdup): New decl.
2735 (STDOUT_FILENO): New macro.
2736 (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
2738 The following changes have effect only if !HAVE_CONFIG_H.
2739 <ctype.h>: New include.
2740 (RETSIGTYPE): Remove bogus semicolon at end.
2741 (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
2743 (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
2744 Handle suffixes like the real routine does.
2745 (error): Remove bogus assignment of errno to errnum.
2746 (xmalloc, xstrdup): New functions.
2748 (O_NOCTTY): Define even if !HAVE_CONFIG_H.
2749 (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
2750 (OUTPUT_BLOCK_SIZE): New macro.
2751 (struct Options.verbose): Now a boolean, since we no longer have two
2752 levels of verbosity.
2753 (long_opts, usage, main): Remove -D or --device option. Invert -p or
2754 --preserve option, and rename it to -R or --remove.
2755 (usage): Describe G suffix.
2756 (usage): "-" no longer conflicts with -v.
2757 (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
2758 (ind): Portability fixes: return word32, not unsigned; multiply by
2759 sizeof (word32) instead of shifting left by 2.
2760 (isaac_refill, isaac_mix): Comment out size of array parameter, as
2761 ansi2knr mishandles this.
2762 (status_visible, status_pos, pfstatus, flushstatus): Remove, since
2763 pfstatus isn't portable to users with varying width fonts, or
2764 internationalized messages, and vfprintf is problematic. All callers
2765 of pfstatus changed to use error instead; this removes incompatibility
2766 of -v with -. All calls to flushstatus removed.
2767 (dopass, do_wipefd): Do not translate non-English msgs with gettext.
2769 (dopass): Cast lseek constant arguments to (off_t) for benefit
2770 of pre-ANSI compilers; fix one lseek call whose args were interchanged.
2771 Remove unnecessary casts to (off_t). Do not check for EIO
2772 when determining file size; this was just my earlier wild guess.
2773 Use human_readable to print off_t, instead of casting to unsigned long
2774 (which doesn't work in Solaris 2.6, where off_t is longer than long).
2775 Output human-readable sizes, instead of always using "K".
2776 Check for offset overflow (it happened to me in SunOS 4.1.4).
2777 (do_wipefd): Do not insist on regular files, but do check for special
2778 files that cannot possibly be shredded.
2779 Use xmalloc instead of malloc + check.
2780 Do not inspect st_size for non-regular files.
2781 Try to find the size of a non-regular file by seeking to its end.
2782 Do not assume that a regular file of size-0 has unknown size.
2783 Check for regular files with negative sizes,
2784 and for overflow after rounding to next block.
2785 Always try to truncate, even for special files, but do not report an
2786 error if truncation fails on a special file.
2788 (dopass, wipefile): Do not return 1 for special files; the caller
2789 doesn't care any more.
2791 (wipefd): Remove unnecessary (and nonportable) check for
2792 whether the file descriptor is read-only. Remove
2793 no-longer-needed check for `-v -'.
2795 (incname): Return 1 for carry bit, like the documentation says.
2797 (wipename, wipefile): Accept new argument, specifying the
2798 quoted file name. All callers changed.
2800 (wipename): Use xstrdup instead of strdup+error check.
2802 (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
2803 errors in NNN more carefully. Restore errno after the check.
2804 Check for errors when closing the file descriptor.
2805 Use more consistent wording when unable to remove a file.
2807 (main): Do not remove files by default.
2808 Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
2809 exist if !HAVE_CONFIG_H.
2810 In diagnostics, quote invalid operands to -n and -s options.
2811 Allow T, P, E, Z, and Y suffixes in -s operand.
2812 flags.verbose is now a boolean, not a counter.
2813 Use STDOUT_FILENO instead of 1, for clarity.
2816 Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
2817 xstrto... functions.
2819 * src/dd.c: Include xstrtol.h.
2820 (parse_integer): Migrate most of the work into the new xstrtoumax fn.
2822 * lib/xstrtoumax.c: New file.
2824 1999-04-18 Jim Meyering <meyering@ascend.com>
2826 * src/dd.c (main): Open the output file with *read* access
2827 only if we might need to read to satisfy a `seek=' request.
2828 From Matthias Urlichs.
2830 1999-04-10 Jim Meyering <meyering@ascend.com>
2832 * Makefile.maint (alpha): Add trailing slash for ncftp.
2836 * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
2837 * tests/Makefile.am (SUBDIRS): Add dd.
2838 * tests/dd: New directory
2839 * tests/dd/misc: New file.
2841 `ls --color' would segfault
2842 * src/ls.c: Include assert.h.
2843 (color_indicator[]): Add an entry for the type, `door.'
2844 (main): Assert that the lengths of the color_indicator and
2845 indicator_name arrays are appropriately related.
2846 Reported by John Gotts.
2848 * src/dd.c (scanargs): Fix bug introduced with last change: now that
2849 the loop is gone, manually decrement argc and increment argv.
2850 Reported by Andreas Jaeger and jvogel@linkny.com.
2852 1999-04-07 Jim Meyering <meyering@ascend.com>
2854 * lib/getdate.y (difftm): Protoize.
2856 1999-04-06 Jim Meyering <meyering@ascend.com>
2858 * lib/strftime.c: Update from master source in libc.
2860 1999-04-04 Jim Meyering <meyering@ascend.com>
2862 * tests/ln/misc: Comment out the test added on 1999-01-31.
2864 * Makefile.maint (url_dir_list): Define properly.
2865 (real_dir_list): Likewise.
2867 * src/shred.c: Don't include string.h.
2868 [!HAVE_CONFIG_H]: Include string.h here.
2869 [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
2870 (sigill_handler): Change return type and type of local `oldhandler' to
2872 (isaac_seed_machdep): Change and type of local `oldhandler' to
2878 * tests/cp/same-file: Change the sed command used to extract the
2879 filename from ls -l output, to accommodate the change in format.
2881 * src/ls.c (print_long_format): Add a space between %s and %3u. This
2882 assures that even when modebuf has the trailing `+' and there are more
2883 than 99 hard links to a file, the permissions string and the link count
2886 1999-04-03 Jim Meyering <meyering@ascend.com>
2888 * src/shred.c (dopass): add curly braces to avoid warning about
2890 (wipefd): Add parentheses suggested by gcc.
2891 (do_wipefd): Remove declaration of unused local.
2893 1999-04-02 Colin Plumb <colin@nyx.net>
2895 * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
2896 to allow standalone compilation.
2898 (wipefile): Added support for emulating /dev/fd/# files even if
2899 the OS doesn't support them. From Paul Eggert.
2901 (main, usage): Changed --device short option to -D.
2903 (wipefd, do_wipefd): Renamed function to do_wipefd and added
2904 separate wipefd that performs sanity checks on externally-opened file
2905 descriptors, such as not append-only. From Paul Eggert.
2907 (do_wipefd, isaac_seedfd): Do not read file for any reason.
2908 if the file is low-entropy, it's a security hole.
2909 (wipefile) Changed to open O_WRONLY and chmod to write-only when
2911 (isaac_seedfd) Function deleted as unnecessary.
2914 (dopass): Dynamically fall back to fsync() if fdatasync() fails,
2915 since POSIX, in their infinitesimal wisdom, encourage implementations
2916 that return constant -1, making compile-time testing useless.
2919 (dopass): Changed to support a size of -1 to mean "unknown".
2920 This entailed changing to a counting-up offset rather than couting-down
2921 cursize for the central state variable. Also changed size argument to
2922 be call-by-reference so that it can be passed back once known.
2923 (sizer) Function deleted as unnecessary.
2924 (wipefd): Changed to match. From Paul Eggert
2926 (dopass): Try to skip over bad blocks in destination files.
2927 Also added ftruncate() for more complete destruction of metadata.
2929 (main, usage): Changed "-" to stand for standard output.
2930 (wipefd): Added error message to detect conflict with -v.
2932 (dopass): Added periodic fsync() calls to keep the pass progress
2933 display in sync with reality. Hopefully they're sufficiently far spaced
2934 that throughput isn't affected. It might be a good thing to do even in
2935 non-verbose mode, to avoid filling up the kernel caches with dirty data.
2936 Also added ftruncate() for more complete destruction of metadata.
2938 (quotearg_colon): New function to print
2939 pathological filenames properly.
2940 [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
2941 that does most of the work.
2942 (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
2943 (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
2944 Error messages are also in a more uniform format.
2947 (struct Options, main, do_wipefd): Added -s/--size=N flag.
2948 (xstrtoul): Added support for valid_suffixes to help this.
2949 (usage) Documented it.
2951 (error): Changed some arguments from N_() to _(), since error()
2952 does not translate its argument. I think this is a bug.
2954 (struct Options do_wipefd, wipefd, wipefile, main): moved passes
2955 argument into the Options structure as n_iterations, which is now a
2956 size_t. From Paul Eggert.
2958 (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
2959 to manage seeding of RNG with arbitrary-sized data.
2960 (isaac_init): commented out as dead code.
2961 (isaac_seed): changed to use new functions to prevent any possibility of
2964 (isaac_seed): Added support for Solaris' gethrtime()
2965 configure.in: Corresponding feature test. From Paul Eggert.
2967 (wipename): Change remove() to unlink() for speed & portability.
2968 Use lstat() instead of access() to see if a filename is taken. This
2969 works even on dangling symlinks and avoids the suid problems of
2970 access(2). From Paul Eggert.
2972 (isaac_seed_machdep): New function for reading cycle counters
2974 1999-04-02 Paul Eggert <eggert@shade.twinsun.com>
2976 * configure.in (AC_CHECK_FUNCS): Add gethrtime.
2978 * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
2979 Use gethrtime if available. Don't assume that clock_gettime succeeds.
2980 Put most random sources first.
2982 1999-04-02 Paul Eggert <eggert@twinsun.com>
2984 shred: Add new options -bcCklL and fix some porting problems.
2985 Remove options -dp. Do not read output files.
2987 * src/shred.c (long_opts, usage, main, wipefile): Adjust to
2989 ("human.h", "quotearg.h"): New includes.
2990 (struct Options): New members contents, links, n_iterations.
2991 Remove allow_devices, remove_file. Change n_iterations to size_t.
2993 (output_block_size): New var.
2994 (usage): Declare __noreturn__ attribute.
2995 (fdatasync): Define to -1 if not present, since we need to invoke both
2996 fdatasync and fsync if both are present. All invokers of fdatasync
2997 now try fdatasync, then fsync.
2999 (isaac_seed): Use it to mix in values. Add uid, gid to mix.
3000 Don't use gettimeofday, as it has too many porting problems.
3001 (isaac_seedfd): Remove, since we no longer read the output files.
3002 (sizefd): Remove; we now determine size by writing sequentially.
3003 (dopass, wipename, wipefile, main): Clean up error messages.
3004 (dopass): Keep track of offset relative to start of file, not
3005 end, since we may not know how large the file is. If size is
3006 negative, write until we fall off the end of the file.
3007 (wipefd): Do not read output file.
3008 Return 0 if successful, -1 if not; do not make a special case for
3009 non-regular files, since our callers have that info now.
3010 (wipename): Now static. Return errno if error.
3011 (main): "-" now stands for standard output.
3012 Do not shred append-only standard output.
3013 (wipefile): Do not grant read permission to file when wiping it.
3014 Use symbolic permission (S_IWUSR), not octal.
3016 * src/system.h (S_IWUSR): Define if not already defined.
3018 * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
3019 (AC_CHECK_FUNCS): Remove gettimeofday.
3021 * doc/fileutils.texi: Document recent changes.
3023 1999-04-01 Jim Meyering <meyering@ascend.com>
3025 * configure.in (AC_CHECK_FUNCS): Add acl.
3026 (AC_CHECK_HEADERS): Add sys/acl.h.
3027 * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
3028 (struct fileinfo): New member `have_acl'.
3029 (gobble_file): Initialize it.
3030 (print_long_format): Use it.
3031 Mostly from Alen Muzinic.
3033 * src/touch.c (open_maybe_create): New function.
3034 (touch): Rewrite not to use `creat' and to eliminate a race
3035 condition that could make touch truncate a nonempty file.
3036 Report and suggestions from Andrew Tridgell.
3038 1999-03-31 Jim Meyering <meyering@ascend.com>
3040 * src/du.c: Remove prototypes and tsort function definitions.
3042 * src/chown.c (main): Move the declaration of `e' into the scope
3043 where it's used and make it `const'.
3045 * src/install.c (main): Qualify a char* with the `const' keyword.
3046 (install_file_in_dir): Likewise.
3047 * src/ln.c (main): Likewise.
3048 * src/mkdir.c (main): Likewise.
3049 * src/mkfifo.c (main): Likewise.
3050 * src/mknod.c (main): Likewise.
3051 * src/mv.c (main): Likewise.
3052 * src/touch.c (touch): Likewise.
3054 1999-03-30 Jim Meyering <meyering@ascend.com>
3056 * src/*.c: Don't include closeout.h or version-etc.h explicitly.
3057 Now, they're included via sys2.h.
3059 1999-03-29 Jim Meyering <meyering@ascend.com>
3061 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
3062 the catch-all for shared autoconf code, m4/jm-macros.m4.
3063 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
3066 1999-03-29 Paul Eggert <eggert@twinsun.com>
3068 Minor lint removal in code that forks and execs.
3070 * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
3071 against zero. This is to improve portability.
3072 * lib/rename.c (rename): Likewise.
3073 * lib/rmdir.c (rmdir): Likewise.
3075 * lib/rename.c (rename):
3076 (rename): Do not print any error messages, so that the messages
3077 are internationalized properly.
3079 * src/install.c (strip): Use standard "cannot fork" message.
3080 Check for strip nonzero exit status.
3082 1999-03-28 Jim Meyering <meyering@ascend.com>
3084 `chmod =OP' did not properly apply the umask
3085 * lib/modechange.c (make_node_op_equals): New function.
3086 (mode_append_entry): Likewise.
3087 (mode_compile): When none of [ugoa] is specified in an `=OP' change
3088 mode request, insert a `=0' entry into the linked list so that all
3089 bits are cleared first. Use the new functions.
3090 Reported by Andrew Dalke.
3092 New test for the above.
3093 * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
3094 * tests/Makefile.am (SUBDIRS): Add chmod.
3095 * tests/chmod: New directory
3096 * tests/chmod/equal-x: New file.
3098 1999-03-27 Jim Meyering <meyering@ascend.com>
3100 * lib/modechange.c (mode_compile): Upon allocation failure, free
3101 everything starting with the head, not the tail.
3103 * src/install.c (strip): Use pid_t, not int. From John Bley.
3105 1999-03-26 Jim Meyering <meyering@ascend.com>
3107 * src/dd.c (PROGRAM_NAME, AUTHORS): Define
3108 (long_options): Remove unused struct.
3109 (scanargs): Remove useless loop.
3110 (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
3111 * src/mvdir.c: Likewise.
3112 * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
3114 1999-03-25 Jim Meyering <meyering@ascend.com>
3116 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
3117 (noinst_HEADERS): Add version-etc.h.
3119 * lib/long-options.c (parse_long_options): Remove version-, copyright-,
3120 and author-printing code. Do it via version_etc.
3122 * lib/version-etc.c: New file.
3123 * lib/version-etc.h: Prototype for same.
3125 * src/sys2.h (GETOPT_HELP_CHAR): Define.
3126 (GETOPT_VERSION_CHAR): Define.
3127 (GETOPT_HELP_OPTION_DECL): Define.
3128 (GETOPT_VERSION_OPTION_DECL): Define.
3129 (case_GETOPT_HELP_CHAR): Define.
3130 (case_GETOPT_VERSION_CHAR): Define.
3132 * src/chgrp.c: No longer include long-options.h.
3133 Include version-etc.h instead.
3134 (PROGRAM_NAME, AUTHORS): Define.
3135 [long_options]: Add entries for --help and --version.
3136 Remove parse_long_options call.
3137 (main) [getopt switch]: Add a case for each of --help and --version.
3138 * src/chgrp.c: Likewise.
3139 * src/chmod.c: Likewise.
3140 * src/cp.c: Likewise.
3141 * src/df.c: Likewise.
3142 * src/dircolors.c: Likewise.
3143 * src/du.c: Likewise.
3144 * src/install.c: Likewise.
3145 * src/ln.c: Likewise.
3146 * src/ls.c: Likewise.
3147 * src/mkdir.c: Likewise.
3148 * src/mkfifo.c: Likewise.
3149 * src/mknod.c: Likewise.
3150 * src/mv.c: Likewise.
3151 * src/rm.c: Likewise.
3152 * src/rmdir.c: Likewise.
3153 * src/shred.c: Likewise.
3154 * src/touch.c: Likewise.
3156 1999-03-24 Jim Meyering <meyering@ascend.com>
3158 * man/help2man: Import version 1.010.
3160 1999-03-22 Jim Meyering <meyering@ascend.com>
3162 * src/chmod.c (usage): Add one-liner. Suggestion from Karl Berry.
3164 1999-03-19 Jim Meyering <meyering@ascend.com>
3166 * src/automake-wrap: Rewrite the automake-generated rule for
3167 clean-binPROGRAMS so that it removes rm even with a losing PATH on a
3168 losing system (PATH with `.' before /bin on a system where you can't
3169 unlink a running executable). Reported by William Bader.
3171 * configure.in: Use jm_WINSIZE_IN_PTEM.
3172 * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
3173 Required by SCO ODT 2.0 systems. Reported by William Bader.
3175 1999-03-18 Jim Meyering <meyering@ascend.com>
3177 * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
3178 (remove_init): Call hash_initialize with one more argument.
3180 1999-03-15 Jim Meyering <meyering@ascend.com>
3182 Revamp to allow fine-tuning to control when and by how
3183 much the table grows and shrinks.
3184 * lib/hash.c (next_prime): Don't assert.
3185 (hash_reset_tuning): New function.
3186 (check_tuning): New function.
3187 (hash_initialize): Accept and use new tuning parameter.
3188 (hash_rehash): Rewrite, updating for tuning.
3189 (hash_insert): Honor tuning semantics.
3190 (hash_delete): Likewise.
3191 From François Pinard.
3193 * lib/hash.h (struct hash_tuning): Define.
3194 (struct hash_table) [tuning]: Add member.
3195 (hash_initialize): Add `tuning' parameter.
3197 * lib/hash.c (hash_insert): Remove last parameter and change semantics.
3198 * lib/hash.h (hash_insert): Update prototype.
3200 * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
3201 otherwise, we'd do so even when the insertion failed.
3202 From François Pinard.
3204 1999-03-07 Jim Meyering <meyering@ascend.com>
3206 * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
3207 have to be scanned for % signs. Suggestion from François Pinard.
3209 * Makefile.maint: Add two more URLs and the loops to use them.
3211 * lib/long-options.c (parse_long_options): Include `Copyright...' line
3212 in --version output.
3213 Add the `...NO warranty...' message.
3215 1999-03-03 Jim Meyering <meyering@ascend.com>
3217 * lib/long-options.c (_): Define it.
3218 (parse_long_options): Accept new parameter, authors, and print it.
3220 * lib/long-options.h: Update prototype.
3222 * src/chgrp.c: Include long-options.h
3223 [long_options]: Remove the "help" and "version" entries.
3224 (main): Use parse_long_options, including author name(s).
3225 Remove the show_version and show_help blocks.
3226 * src/chmod.c: Likewise.
3227 * src/chown.c: Likewise.
3228 * src/cp.c: Likewise.
3229 * src/dd.c: Likewise.
3230 * src/df.c: Likewise.
3231 * src/dircolors.c: Likewise.
3232 * src/du.c: Likewise.
3233 * src/install.c: Likewise.
3234 * src/ln.c: Likewise.
3235 * src/ls.c: Likewise.
3236 * src/mkdir.c: Likewise.
3237 * src/mkfifo.c: Likewise.
3238 * src/mknod.c: Likewise.
3239 * src/mv.c: Likewise.
3240 * src/mvdir.c: Likewise.
3241 * src/rm.c: Likewise.
3242 * src/rmdir.c: Likewise.
3243 * src/shred.c: Likewise.
3244 * src/sync.c: Likewise.
3245 * src/touch.c: Likewise.
3247 1999-02-18 Paul Eggert <eggert@twinsun.com>
3249 * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
3250 The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
3252 1999-02-17 Jim Meyering <meyering@ascend.com>
3254 * src/shred.c (wipename): Fix string thinko. Now, shredding files
3255 in subdirectories works (dir/file). From Janos Farkas.
3257 1999-02-13 Jim Meyering <meyering@ascend.com>
3259 * src/dircolors.c (dc_parse_stream): Don't try to dereference
3260 NULL if there's an error in our built-in list.
3261 Suggestion from François Pinard.
3263 1999-02-13 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
3265 * src/install.c (main): Set x.backup_type only if backups are requested.
3266 (cp_option_init): Initialize backup_type.
3267 (backup_type): Remove unused variable.
3269 * doc/fileutils.texi: Fix use of @item vs @itemx.
3271 1999-02-08 Jim Meyering <meyering@ascend.com>
3273 * src/dircolors.c (slack_codes): Add "DOOR".
3274 (ls_codes): Add corresponding "do".
3275 Reported by John Gotts.
3277 * configure.in (ALL_LINGUAS): Add Italian (it).
3279 1999-02-07 Jim Meyering <meyering@ascend.com>
3281 * Version 4.0d (aka 4.1-b4).
3283 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
3284 is hooked up to the distcheck rule.
3285 * Makefile.am (distcheck-hook): New target and rule -- link to shared
3286 rule, my-distcheck, in Makefile.maint.
3288 * doc/fileutils.texi (shred invocation): New section. From Colin Plumb.
3290 * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
3291 group-member.m4, and just use this new macro.
3292 Use `.$ac_objext', not the literal `.o'.
3294 1999-02-02 Jim Meyering <meyering@ascend.com>
3296 * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
3297 Define to zero if not already defined.
3298 (HAVE_SYMLINKS): Define.
3299 (gobble_file): Remove #ifdef.
3300 (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
3301 rather than #ifdef S_ISLNK.
3302 (print_type_indicator): Remove #ifdefs and reorganize.
3303 (print_color_indicator): Remove #ifdefs.
3304 (length_of_file_name_and_frills): Likewise.
3306 1999-02-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3308 * src/dircolors.hin: Handle DOOR.
3310 * src/ls.c (print_type_indicator): Print doors as '>'.
3311 (length_of_file_name_and_frills): Account for this.
3312 (indicator_no): Define C_DOOR.
3313 (indicator_name): Add corresponding name.
3315 * lib/filemode.c (ftypelet): Handle doors.
3317 * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
3319 1999-02-01 Jim Meyering <meyering@ascend.com>
3321 * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
3322 argument list. From Akim Demaille.
3324 1999-01-31 Jim Meyering <meyering@ascend.com>
3326 * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
3327 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
3329 * tests/ln/misc: Add test for this.
3330 * src/ln.c (do_link): Allow creation of a hard link to a dangling
3331 symlink. Reported by Alexey Solovyov.
3333 * src/copy.c (copy_internal): Describe any backup-related renaming
3334 operations when in verbose mode.
3335 (copy_internal): Likewise.
3336 Based on changes from Marty Leisner.
3338 * lib/lchown.c: Declare chown.
3340 1999-01-30 Jim Meyering <meyering@ascend.com>
3342 * acconfig.h: Remove uintmax and STAT* #undefs.
3343 * configure.in: Require autoconf 2.13.
3344 Remove test for AFS.
3345 Use 3-argument form of AC_DEFINE*.
3347 1999-01-28 Jim Meyering <meyering@ascend.com>
3349 * po/POTFILES.in: Add src/shred.c.
3351 * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
3352 TM_IN_SYS_TIME based one (for shred).
3354 * acconfig.h: Remove lots of `#undef's, now that we use the
3355 3-argument forms of AC_DEFINE* macros.
3357 1999-01-25 Jim Meyering <meyering@ascend.com>
3359 * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
3361 (AC_CHECK_FUNCS): Add clock_gettime.
3363 * src/shred.c (isaac_seed): Guard clock_gettime with test of
3364 HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
3365 (wipename): Rename local dirfd to dir_fd to avoid shadowing the
3366 function declared in Linux's dirent.h.
3368 1999-01-25 Akim Demaille <demaille@inf.enst.fr>
3370 * lib/argmatch.h (ARRAY_CARDINALITY): Define.
3371 (ARGMATCH_ASSERT): New macro.
3373 * lib/argmatch.c (program_name): Remove dcl.
3375 (argmatch_invalid): Use error rather than fprintf.
3377 1999-01-24 Jim Meyering <meyering@ascend.com>
3379 * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
3380 New version from L. Peter Deutsch.
3382 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
3383 (and hence that of the local `n1', too) to `int' at Paul's request.
3385 * lib/closeout.c: Add comments.
3387 * src/shred.c (fdatasync): Remove function. instead, ...
3388 (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
3391 1999-01-23 Jim Meyering <meyering@ascend.com>
3393 * src/Makefile.am (bin_PROGRAMS): Add shred.
3394 * src/shred.c: New file.
3397 (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
3398 only when in verbose mode.
3399 (fdatasync) [! HAVE_FDATASYNC]: New function.
3401 * man/Makefile.am (man_MANS): Add shred.1.
3402 * man/Makefile.summ (shred-summary): Define.
3403 * man/shred.x: New file.
3405 * src/shred.c: New file. From Colin Plumb.
3406 Include config.h, getopt.h, system.h and error.h.
3407 Use #else/#if, not #elif.
3409 1998-11-05 Paul Eggert <eggert@twinsun.com>
3411 * lib/mktime.c (__mktime_internal): Adopt the traditional (and
3412 problematic) notion of what to do when tm_isdst doesn't match.
3414 1999-01-17 Jim Meyering <meyering@ascend.com>
3416 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
3417 than setting RM and CP.
3418 * tests/cp/*: Now that PATH is set properly, use rm and cp rather
3421 * tests/ln/Makefile.am (TESTS): Add backup-1.
3422 (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
3423 * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
3424 * tests/ln/backup-1: New test for this.
3425 * src/ln.c (do_link): Try to remove DEST even after renaming it.
3426 This fixes a bug reported by Jamie Lokier.
3428 * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
3430 1999-01-16 Jim Meyering <meyering@ascend.com>
3432 * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
3434 * acconfig.h: Remove @BOTTOM@ section.
3435 Instead, add the define and decl via m4/jm-macros.m4.
3437 * src/ls.c: Don't declare base_name.
3438 Use function-style XARGMATCH once again.
3439 * src/touch.c: Likewise.
3440 * acconfig.h: Add a @BOTTOM@ section.
3441 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
3445 * src/cp.c: Remove declarations of base_name and get_version.
3446 (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
3447 Use xget_version and function-style XARGMATCH.
3448 * src/mv.c (main): Likewise.
3449 * src/ln.c (main): Likewise.
3450 * src/install.c (main): Likewise.
3451 * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
3452 unsigned int, not just int.
3453 * lib/backupfile.h (get_version): Adjust prototype.
3454 (xget_version): Add prototype.
3455 (base_name): Remove prototype.
3456 * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
3457 (backup_args): Reorder enum members.
3458 (backup_types): Likewise.
3459 (get_version): Take an additional parameter, `context'.
3460 (xget_version): Like get_version, but if the `version' argument is NULL,
3461 use the value of the envvar VERSION_CONTROL.
3462 (base_name): Declare.
3463 Mostly from Akim Demaille.
3465 * lib/addext.c: (base_name): Declare.
3466 * src/sys2.h: Add prototype for base_name.
3468 * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
3469 * lib/argmatch.h: Likewise.
3471 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
3472 (XARGCASEMATCH): Likewise.
3474 * lib/argmatch.c (EXIT_FAILURE): Define.
3475 (ARGMATCH_DIE): Provide default.
3476 (__xargmatch_internal): New function.
3477 s/rogram_name/program_name.
3480 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
3482 * src/touch.c (usage): Don't make it static so that it can be
3483 called from libfu.a by xargmatch.
3484 * src/chgrp.c (usage): Likewise
3485 * src/chmod.c (usage): Likewise
3486 * src/chown.c (usage): Likewise
3487 * src/cp.c (usage): Likewise
3488 * src/dd.c (usage): Likewise
3489 * src/df.c (usage): Likewise
3490 * src/dircolors.c (usage): Likewise
3491 * src/du.c (usage): Likewise
3492 * src/install.c (usage): Likewise
3493 * src/ln.c (usage): Likewise
3494 * src/ls.c (usage): Likewise
3495 * src/mkdir.c (usage): Likewise
3496 * src/mkfifo.c (usage): Likewise
3497 * src/mknod.c (usage): Likewise
3498 * src/mv.c (usage): Likewise
3499 * src/mvdir.c (usage): Likewise
3500 * src/rm.c (usage): Likewise
3501 * src/rmdir.c (usage): Likewise
3502 * src/sync.c (usage): Likewise
3504 1999-01-12 Akim Demaille <demaille@inf.enst.fr>
3506 * lib/backupfile.c (get_version): added the parameters KIND.
3507 (xget_version): like get_version, but if argument is NULL, honor
3508 the envvar VERSION_CONTROL.
3509 * src/cp.c: Remove declarations of base_name and get_version.
3510 (main): Use xget_version.
3511 * src/mv.c (main): Likewise.
3512 * src/ln.c (main): Likewise.
3513 * src/install.c (main): Likewise.
3515 1999-01-12 Jim Meyering <meyering@ascend.com>
3517 * configure.in (ALL_LINGUAS): Add Greek (el).
3518 * po/el.po: New file.
3520 * install-sh: New version from autoconf.
3521 * missing: New version from automake.
3522 * src/ansi2knr.c: Likewise.
3523 * lib/getopt.c: New version from glibc.
3524 * lib/getopt.h: Likewise.
3525 * lib/getopt1.c: Likewise.
3526 * lib/regex.c: Likewise.
3527 * lib/regex.h: Likewise.
3528 * lib/ylwrap: Remove unused file.
3530 1999-01-10 Jim Meyering <meyering@ascend.com>
3532 * Version 4.0c (aka 4.1-b3).
3534 * Upgrade to autoconf-2.13 and automake-1.3b.
3536 * src/copy.c (copy_internal): Handle two more values of errno from
3537 failed rename of a directory into a subdirectory of itself.
3538 Thanks to Volker Borchert for testing many types and combinations
3541 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
3542 to escape_quoting_style.
3543 (argmatch_invalid): Now that the quoted quantity is no longer double
3544 quoted, remove the code that removed leading and trailing double quotes.
3546 * src/ls.c (decode_switches): Now that escape_quoting_style no longer
3547 escapes the SPACE character, arrange for SPACEs to be quoted here.
3548 * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
3549 it no longer escapes ` '.
3550 Suggestion from Paul Eggert.
3552 1999-01-05 Jim Meyering <meyering@ascend.com>
3554 * configure.in (space): Add `for' in message of statvfs check.
3555 From Ulrich Drepper.
3557 1999-01-04 Jim Meyering <meyering@ascend.com>
3561 1999-01-02 Jim Meyering <meyering@ascend.com>
3563 * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
3564 offending quoted argument before using it in explanatory diagnostic.
3565 Use a single fprintf stmt.
3567 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
3568 modify a parameter. Add a `Die_stmt' parameter.
3570 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
3571 (argmatch_to_argument): Add `const' attribute to first parameter.
3573 * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
3574 done in m4/jm-macros.m4).
3576 * lib/backupfile.c (get_version): Adapt to use new interface to
3578 * src/cp.c: Likewise.
3579 * src/ls.c: Likewise.
3580 * src/touch.c: Likewise.
3582 1999-01-01 Jim Meyering <meyering@ascend.com>
3584 * lib/makepath.c (make_dir): New function, factored out of make_path.
3585 (make_path): Use make_dir rather than open-coding it twice.
3586 This effectively reverses the order of the latter pair of stat/mkdir
3587 calls and fixes a race condition bug whereby one of two concurrent
3588 `mkdir -p' processes could fail with EEXIST.
3589 Include locale.h and libintl.h, and define `_()'.
3590 Mark translatable strings.
3592 * lib/xmalloc.c: Add comments.
3593 (xcalloc, xmalloc, xrealloc): Remove prototypes.
3594 (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
3595 * lib/xalloc.h: Add comments.
3596 (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
3597 (xcalloc, xmalloc, xrealloc): Add prototypes here.
3598 Based on changes from Akim Demaille.
3600 * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
3601 (quotearg_n): Change type of 1st parameter from int to unsigned int.
3602 (quotearg_n_options): Likewise.
3603 * lib/quotearg.h (quoting_style_vals): New public array.
3605 (quotearg_n_options): Declare `options' parameter to be `const'.
3607 * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
3609 * lib/backupfile.c (get_version): Use XARGMATCH in place of
3612 1998-12-31 Jim Meyering <meyering@ascend.com>
3614 * src/ls.c (indicator_style_types): New variable.
3615 (format_types): Rename from `formats'.
3616 (color_args): Remove unnecessary `no' string.
3617 (color_types): Remove corresponding `color_never' entry.
3618 (main): Use ARGMATCH_TO_ARGUMENT.
3619 (decode_switches): Use ARGMATCH instead of argmatch code
3620 in each of several cases.
3623 * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
3624 * src/touch.c (main): Likewise.
3625 * lib/backupfile.c (get_version): Likewise.
3628 * lib/strncasecmp.c: New file.
3629 * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
3630 * lib/argmatch.c (strncasecmp): Move to a separate file.
3631 Add curly braces around some one-stmt-but-multiline blocks.
3633 * lib/argmatch.c: Improvements from Akim Demaille.
3634 * lib/argmatch.h: Likewise.
3636 * lib/addext.c (addext): Protoize.
3637 Indent cpp directives to match nesting.
3639 Fix warnings from gcc -W -Wall
3640 * lib/posixtm.c (posix_time_parse): Change type of index `i' from
3641 int to unsigned int.
3642 * lib/getdate.y (__attribute__): Define.
3643 (ATTRIBUTE_UNUSED): Define.
3644 (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
3645 (MonthDayTable): Add initializers for last entry.
3646 (UnitsTable): Likewise.
3647 (OtherTable): Likewise.
3648 (MilitaryTable): Likewise.
3650 1998-12-22 Jim Meyering <meyering@ascend.com>
3654 * configure.in (ALL_LINGUAS): Add chinese (zh).
3656 1998-12-19 Jim Meyering <meyering@ascend.com>
3658 * tests/ln/misc: Use absolute path for final rm.
3660 * Makefile.maint (my-distcheck): Run make with
3661 CFLAGS='-Wformat -Werror'.
3663 1998-12-18 Jim Meyering <meyering@ascend.com>
3665 * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
3666 from format string. From Michiel Bacchiani.
3668 * src/chgrp.c (MAXGID): Define.
3669 Use gid_t (not int) as the type for `group' variables.
3670 (parse_group): Use MAXGID, not INT_MAX.
3672 * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
3673 * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
3675 1998-12-13 Jim Meyering <meyering@ascend.com>
3677 * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
3679 1998-12-12 Jim Meyering <meyering@ascend.com>
3681 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
3682 * src/ls.c: Group DIRED's code together.
3683 (full_time, inhibit_group, col_ext_type): Declare static.
3684 (dired_dump_obstack): Apply sizeof to variable, instead of its type.
3685 (parse_ls_color): Rename ext2 as e2. Move into the block where it
3688 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
3689 * src/ls.c: In order to distinguish col(umn|or):
3690 (init_column_info): Renamed from init_col_info.
3691 (struct column_info): Renamed from struct col_info.
3692 (struct color_ext_type): Renamed from struct col_ext_type.
3694 1998-12-11 Jim Meyering <meyering@ascend.com>
3696 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
3698 * lib/stat.c: Remove file.
3699 * lib/lstat.c: Remove file.
3700 * lib/xstat.in (xstat@): New file.
3702 * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
3704 * tests/ls-2/tests: Add a test for this.
3706 * man/help2man: import version 1.006.
3708 1998-12-07 Jim Meyering <meyering@ascend.com>
3710 * src/copy.c: Use dir_name, not dirname. Include dirname.h.
3711 * src/cp.c: Likewise.
3712 * src/df.c: Likewise.
3713 * src/install.c: Likewise.
3714 * src/ln.c: Likewise.
3715 * src/mvdir.c: Likewise.
3717 * lib/dirname.c (dir_name): Rename from dirname.
3718 Make argument `const'. Include "dirname.h"
3719 * lib/dirname.h: New file.
3720 * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
3722 1998-12-06 Jim Meyering <meyering@ascend.com>
3724 * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
3725 `^[yY]' and `^[nN]' (avoiding regex). From Karl Heuer.
3727 * lib/*.c: Ansideclify.
3729 Fix `ls -R .' formatting bug that broke mktexlsr.
3730 * src/ls.c: Include path-concat.h.
3731 (basename_is_dot_or_dotdot): New function, derived from
3732 is_not_dot_or_dotdot.
3733 (is_not_dot_or_dotdot): Remove function.
3734 (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
3735 instead of is_not_dot_or_dotdot and use path_concat instead of attach.
3737 * tests/ls-2/tests: New file (renamed from quoting),
3738 with new test for the `ls -R .' fix.
3739 * tests/ls-2/quoting: Remove file.
3740 * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
3742 1998-11-29 Jim Meyering <meyering@ascend.com>
3744 * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
3745 * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
3747 * src/dd.c (dd_copy): Rename function from `copy'.
3749 * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
3751 Per Kristian Hove reported that a certain move-directory-into-self
3752 wasn't properly diagnosed.
3754 * tests/mv/into-self-3: New file.
3755 * tests/mv/Makefile.am (TESTS): Add into-self-3.
3756 * src/copy.c (copy_internal): Remove earlier (but less effective)
3757 test for move/copy-into-self.
3758 Instead, deduce the move-into-self condition from errno==EINVAL
3759 after a failed rename.
3760 * src/mv.c (do_move): Don't arrange to remove DEST in the
3761 copied-into-self case.
3763 1998-11-15 Jim Meyering <meyering@ascend.com>
3765 Bob McCracken reported that mv couldn't handle certain combinations
3766 of hard linked source files.
3768 * tests/mv/hard-link-1: New file.
3769 * tests/mv/Makefile.am (TESTS): Add hard-link-1.
3770 * src/mv.c (movefile): Don't free new_dest.
3772 * lib/error.c (error): Don't use strerror_r's return value.
3773 From Johan Danielsson.
3775 1998-11-14 Jim Meyering <meyering@ascend.com>
3779 * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
3780 to avoid matching a prefix of another tag.
3782 1998-11-10 Jim Meyering <meyering@ascend.com>
3784 * configure.in (ALL_LINGUAS): Add Greek (el).
3785 * po/el.po: New file.
3787 1998-11-07 Jim Meyering <meyering@ascend.com>
3791 Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
3792 work on Hurd systems because of an inline definition of lstat in a
3793 system header file). This also makes it so that you may run `ls '' '
3794 on systems that let l?stat operate on the empty string.
3796 * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
3797 and declare the latter.
3798 * lib/stat.c [stat]: Remove #undef.
3799 (rpl_stat): Protoize.
3800 * lib/lstat.c [lstat]: Remove #undef.
3801 (rpl_lstat): Protoize. Use ENOENT, not EINVAL, to be consistent
3803 * acconfig.h: Remove #undef's for lstat and stat.
3805 1998-10-31 Jim Meyering <meyering@ascend.com>
3807 * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
3809 * tests/rm/empty-name: New file.
3811 * acconfig.h (stat): New #undef.
3812 This omission was uncovered when Mark Kettenis reported that
3813 `rm -r ''' got a failed assertion on the Hurd. This change
3814 doesn't fix *that* problem -- see above.
3816 1998-10-25 Jim Meyering <meyering@ascend.com>
3820 * README: Man pages will now be supported to the extent that
3821 people send patches.
3823 * tests/rm/unreadable: Two new tests.
3824 * tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
3825 it out since we're so close to release and since the test compares the
3826 text of diagnostics that are likely to vary between systems.
3827 (TEST_ENVIRONMENT): Add required framework.
3829 * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
3830 pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
3831 Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
3832 (remove_dir): Return `status', rather than always RM_OK.
3834 1998-10-18 Jim Meyering <meyering@ascend.com>
3838 * lib/mktime.c: Update from libc with this additional change from Paul.
3839 * lib/strftime.c: Likewise.
3841 1998-10-17 Paul Eggert <eggert@twinsun.com>
3843 Don't invoke localtime_r or gmtime_r unless it's the GNU C
3844 library's localtime_r and gmtime_r; there are too many buggy
3845 implementations of localtime_r and gmtime_r out there, and
3846 it's not worth keeping track of all the different bugs.
3848 * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
3849 (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
3850 Base it on localtime unless _LIBC.
3852 * strftime.c (__EXTENSIONS__): Remove.
3853 (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
3854 (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
3855 Base them on localtime/gmtime if not _LIBC.
3857 1998-10-17 Jim Meyering <meyering@ascend.com>
3861 * lib/mktime.c: Declare localtime_r if necessary.
3862 * lib/strftime.c: Likewise.
3864 * tests/Fetish.pm (run_tests): Run $prog with --version only
3867 1998-10-11 Jim Meyering <meyering@ascend.com>
3871 1998-10-08 Paul Eggert <eggert@twinsun.com>
3873 * mktime.c (__mktime_internal): When the requested time falls
3874 in a spring-forward gap of size DT, return a time that is DT
3875 away from the requested time, preferring a time whose tm_isdst
3876 differs from the requested value. Bump the max number of
3877 probes from 4 to 6 to account for the extra probes needed to
3878 discover a spring-forward gap in the worst case.
3880 1998-10-08 Paul Eggert <eggert@twinsun.com>
3882 * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
3883 Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
3884 a body that merely expands localtime_r; this works around a
3885 bug in Digital Unix 4.0A and 4.0D.
3887 1998-10-05 Jim Meyering <meyering@ascend.com>
3889 * po/Makefile.in.in (uninstall): Remove (historical?) command that
3890 removed po-Makefile.in.in. From Akim Demaille.
3892 * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
3895 1998-10-04 Jim Meyering <meyering@ascend.com>
3897 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
3900 1998-10-03 Jim Meyering <meyering@ascend.com>
3904 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
3906 * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
3907 Instead, depend on corresponding source file and on configure.in.
3908 Based on suggestion and code from Akim Demaille.
3909 Factor out irregular men into Makefile.summ.
3911 * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
3913 * man/Makefile.summ: New file.
3914 * man/Makefile.maint: Include it.
3916 * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
3918 * tests/mv/Makefile.am (TESTS): Add i-1.
3919 * tests/mv/i-1: New test.
3921 1998-10-02 Jim Meyering <meyering@ascend.com>
3923 * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
3924 * tests/ls-2/run-test: Remove file.
3925 * tests/ls-2/quoting: Include /bin/sh driver framework.
3927 * tests/dircolors/simple: Remove file.
3928 * tests/dircolors/run-test: Embed it here instead.
3929 * tests/dircolors/simple: Rename from run-test.
3931 1998-10-01 Jim Meyering <meyering@ascend.com>
3933 * tests/Makefile.am (EXTRA_DIST): Remove README.
3936 1998-09-28 Jim Meyering <meyering@ascend.com>
3940 * Use automake-1.3b. See notes in README.
3942 * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
3943 Otherwise, `touch a b; echo n|mv -i a b' would remove b.
3946 1998-09-27 Jim Meyering <meyering@ascend.com>
3950 * Makefile.maint (alpha): New target.
3951 (my-distcheck): Tweak.
3953 * lib/backupfile.h: Protect against multiple inclusion.
3956 * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
3957 Now, it is invoked through jm_MACROS.
3959 * lib/strftime.c (my_strftime): Update from FSF.
3961 1998-09-26 Jim Meyering <meyering@ascend.com>
3963 * src/copy.c (copy_internal): Don't preserve hard-linked directories
3964 to avoid damaging the destination filesystem when copying from a
3965 Netapp snapshot directory. With code from Kjetil Torgrim Hollstein
3968 1998-09-24 Jim Meyering <meyering@ascend.com>
3970 * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
3973 1998-09-21 Jim Meyering <meyering@ascend.com>
3975 * man/Makefile.maint ($(man_MANS)): Remove `echo'.
3977 1998-09-20 Jim Meyering <meyering@ascend.com>
3981 * src/install.c (install_file_to_path) [-D]: Create any leading
3982 directories with permissions of 0755.
3984 1998-09-19 Jim Meyering <meyering@ascend.com>
3986 * src/install.c (install_file_to_path): Copy the file after creating
3987 any leading directories.
3988 (main) [case 'v']: Set `x.verbose' to 1, not 0.
3989 Reported by Marty Leisner.
3991 * man/Makefile.am (transform): Define.
3992 (man_MANS): Include ginstall.1, not install.1, to match the name
3993 of the executable in ../src.
3994 * man/ginstall.x: New file.
3995 * man/install.x: Remove file.
3996 * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
3998 * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
3999 Reported by Akim Demaille.
4001 * lib/modechange.c: Fix post-protoization typo.
4003 * lib/posixtm.h (PARAMS): Define and use.
4006 1998-09-12 Jim Meyering <meyering@ascend.com>
4010 * src/remove.c (remove_cwd_entries): Declare to be static.
4012 Automatically generate man pages from combination of --help
4013 output and the contents of new, man/*.x files.
4014 * man/Makefile.am (HELP2MAN): Define.
4016 (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
4017 (MAINTAINERCLEANFILES): Add $(man_MANS).
4018 * man/*.x: New files.
4019 * man/GNUmakefile: New file.
4020 * man/Makefile.maint: New file.
4021 * man/help2man: New file.
4023 1998-09-09 Jim Meyering <meyering@ascend.com>
4025 * lib/modechange.c: Protoize.
4027 1998-09-07 Jim Meyering <meyering@ascend.com>
4031 * src/df.c (show_dev) [!posix_format]: When using --print-type,
4032 let the device path and the file system type share a single (wider)
4033 field if their combined lengths allow it. From Andries Brouwer.
4035 * tests/touch/empty-file: Upon failure, suggest how to rerun the test
4036 with longer delay, in case NFS clock skew was the cause of the failure.
4037 Reported by Kaveh Ghazi.
4039 * tests/ls-2/quoting: Add tests.
4040 * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
4041 (_create_file): Don't include $$ in temp file name.
4042 (run_tests): Use shorter suffixes for temp file names.
4044 1998-09-06 Jim Meyering <meyering@ascend.com>
4046 * src/touch.c: Include posixtm.h.
4047 (usage): Correct the description of the format of the
4048 date string argument to -t option.
4049 (main): Update to use rewritten posixtime function.
4050 Reported by Andries Brouwer.
4052 * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
4053 (noinst_HEADERS): Add posixtm.h.
4055 * lib/posixtm.h: New file.
4056 * lib/posixtm.c: New file. Rewritten based on posixtm.y.
4057 * lib/posixtm.y: Remove file.
4059 1998-09-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4061 * src/ls.c (print_dir_name): Put back.
4062 (print_dir): Also print directory name header if print_dir_name is
4065 1998-08-29 Jim Meyering <meyering@ascend.com>
4069 * src/du.c (long_options): Use corresponding short-option character
4070 in place of `1', and `NULL' in place of pointer in initialization.
4071 * src/cp.c (long_opts): Likewise.
4072 * src/ln.c (long_options): Likewise.
4073 * src/mkdir.c (longopts): Likewise.
4074 * src/rmdir.c (longopts): Likewise.
4075 * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
4077 * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
4078 * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
4080 * tests/Fetish.pm: New file -- moved from ls-2/.
4081 * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
4082 * tests/Makefile.am (SUBDIRS): Add dircolors.
4083 (EXTRA_DIST): Add Fetish.pm.
4084 * tests/dircolors: New directory
4086 * src/ls.c (print_dir_name): Remove global variable.
4087 (print_dir): When trace_dirs is set, always print the directory
4090 1998-08-26 Jim Meyering <meyering@ascend.com>
4092 * src/dircolors.c (dc_parse_stream): Don't segfault when a line
4093 contains only one token. Reported by Olav Morkrid.
4095 1998-08-24 Paul Eggert <eggert@twinsun.com>
4097 * src/system.h (CHAR_MIN, CHAR_MAX):
4098 Renamed from SCHAR_MIN, SCHAR_MAX, since these
4099 macros apply to char, not signed char.
4101 * src/df.c, src/du.c, src/touch.c (long_options, main):
4104 1998-08-18 Paul Eggert <eggert@twinsun.com>
4106 Port nanosecond-resolution times to UnixWare 2.1.2 and
4107 pedantic Solaris 2.6.
4109 * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
4110 * acconfig.h (ST_MTIM_NSEC): New #undef.
4111 * src/system.h: (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
4112 Use new ST_MTIM_NSEC macro.
4114 1998-08-16 Jim Meyering <meyering@ascend.com>
4116 * lib/filemode.h (PARAMS): Define and use.
4119 1998-08-15 Jim Meyering <meyering@ascend.com>
4123 * Makefile.maint (announcement): New target.
4125 * tests/mv/into-self: Update to reflect changed behavior of mv.
4126 * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
4127 With prodding from François Pinard :-)
4129 * tests/ls-2/Fetish.pm: New file
4130 * tests/ls-2/run-test: New file
4132 * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
4133 directories (but none of their entries). This makes `cp --archive
4134 --one-file-system' use the same policy `tar --one-file-system' does.
4137 * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
4139 1998-08-14 Jim Meyering <meyering@ascend.com>
4141 * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
4142 Reported by Christian von Roques.
4144 * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
4145 * tests/Makefile.am (SUBDIRS): Add ls-2.
4146 * tests/ls-2: New directory
4148 1998-08-14 Christian von Roques <roques@pond.sub.org>
4150 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
4151 infloop on getmnt(2) returning 0.
4153 * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
4154 not initializing output redirection of : command.
4155 * tests/mv/backup-is-src: Likewise.
4156 * tests/rm/i-1: Likewise.
4158 1998-08-12 Jim Meyering <meyering@ascend.com>
4160 * po/Makefile.in.in: Provide automake-style DESTDIR support.
4161 From Johan Danielsson.
4162 (DISTFILES): Remove ChangeLog.
4163 po/ChangeLog: Remove empty file.
4165 * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
4167 * src/ls.c: Include filemode.h.
4168 * src/chmod.c: Likewise.
4170 * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
4171 From Johan Danielsson.
4172 Protoize. Tsort function definitions and remove prototypes of
4174 (mode_string): Remove prototype.
4175 * lib/filemode.h (mode_string): New file.
4176 * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
4178 1998-08-09 Jim Meyering <meyering@ascend.com>
4182 1998-07-31 Paul Eggert <eggert@twinsun.com>
4184 Add support for filesystems whose timestamps have better resolution
4185 than 1 second (e.g. Solaris 2.6, recent Linux kernels).
4187 * configure.in (AC_STRUCT_ST_MTIM): Add.
4189 * src/copy.c (copy_internal): Compare time stamps with
4190 subsecond resolution if available.
4192 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
4193 rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
4194 stamps with subsecond resolution if available.
4196 * src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
4197 CTIME_CMP, MTIME_CMP): New macros.
4199 1998-08-01 Jim Meyering <meyering@ascend.com>
4201 * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
4203 1998-07-28 Paul Eggert <eggert@twinsun.com>
4205 * lib/mountlist.c (read_filesystem_list): Remove all_fs
4206 argument, but put the necessary information into the result so
4207 that the caller can ignore filesystems that he's not
4210 * lib/mountlist.h (struct mount_entry):
4211 New members me_dummy, me_remote.
4212 (read_filesystem_list): Remove all_fs argument.
4213 (REMOTE_FS_TYPE): Remove.
4214 (ME_DUMMY, ME_REMOTE): New macros.
4216 * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
4218 * src/df.c (show_all_fs):
4219 Revert to boolean value; the old negative value is
4220 now in show_local_fs.
4221 (show_local_fs): New variable.
4222 (show_dev): New args me_dummy and me_class. Use show_local_fs
4223 and boolean show_all_fs in combination with these new args
4224 to decide whether to show a device.
4225 (show_disk): Pass flags to show_dev.
4226 (show_point): Use a non-dummy mount entry if possible.
4227 (show_all_entries): Pass flags to show_dev.
4228 (main): --local sets show_local_fs now. Ask for file system types if
4229 show_local_fs is nonzero, since ME_REMOTE might need them.
4231 1998-07-27 Jim Meyering <meyering@ascend.com>
4233 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
4235 * tests/install/basic-1: Add a test for this.
4236 * src/install.c: Make copy create each destination file initially
4237 with mode 0600 so strip will work, then apply specified mode.
4238 Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
4240 1998-07-25 Jim Meyering <meyering@ascend.com>
4242 * src/mv.c (chown): Remove unused definition.
4243 Reported by Kaveh Ghazi.
4245 * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
4246 Handle that, so --ignore-fail-on-non-empty works.
4247 (EEXIST): Define to zero if not defined.
4248 (ENOTEMPTY): Likewise.
4250 * tests/cp/same-file: Remove `diff' I'd put in for debugging.
4251 Exit with the status from cmp.
4255 * tests/cp/same-file: Skip three more unportable tests.
4256 These failed on SunOS4.1.4.
4258 * src/copy.c (SAME_INODE): Remove definition.
4259 * src/sys2.h (SAME_INODE): Define it here instead.
4261 * src/remove.c (same_file): New function.
4262 (remove_dir): Use it to give a better diagnostic when rmdir fails
4263 because it can't remove the current directory.
4265 * src/df.c (long_options): Changes table entries not to use this form:
4266 {"all", no_argument, &show_all_fs, 1},
4267 but rather this form:
4268 {"all", no_argument, NULL, 'a'},
4269 Using the latter, all the option handling in one place: the getopt loop.
4271 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
4273 (fsp_to_string): Don't xmalloc return value (yet).
4274 (xatoi): Ansideclify.
4275 (fstype_to_string): Ansideclify.
4276 * lib/mountlist.h: Define and use PARAMS macro.
4278 * lib/utime.c: New file.
4279 * src/touch.c (utime_now): Moved into m4/utimes.m4.
4280 (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
4283 * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
4285 1998-07-22 Paul Eggert <eggert@twinsun.com>
4287 * lib/human.c (human_readable): amt -> damt, to fix typo when
4288 computing which power to use after overflow occurs during
4291 * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
4294 1998-07-21 Paul Eggert <eggert@twinsun.com>
4296 Add df -l or --local option.
4297 * doc/fileutils.texi: Document it.
4298 * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
4299 * lib/mountlist.c (read_filesystem_list):
4300 If all_fs is negative, omit non-local filesytems.
4302 * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
4303 (show_all_fs): If negative, omit non-local filesystems.
4304 All uses of (all_fs != 0) changed to (all_fs > 0).
4305 (long_options, usage, main): Add -l or --local option.
4306 (main): When asking for df of an explicit file name, get all
4307 the mount points, so that we're more likely to find it when
4310 1998-07-18 Jim Meyering <meyering@ascend.com>
4312 * src/copy.c (copy_internal): Add another exclusion from the
4313 sameness test: when --force has been specified, the destination
4314 is unlinked before any copy.
4315 (copy_internal): Add yet another: when both src and dest are symlinks.
4317 * tests/touch: New subdir.
4318 * tests/Makefile.am (SUBDIRS): Add touch.
4319 * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
4321 * tests/mv/into-self-2: New test.
4322 * tests/mv/Makefile.am (TESTS): Add into-self-2.
4324 1998-07-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4326 * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
4329 1998-07-16 Jim Meyering <meyering@ascend.com>
4331 Work around failure of chown calls on m68k-motorola-sysv systems.
4332 * src/chown.c: Include lchown.h.
4333 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
4334 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
4335 * lib/lchown.c: Include lchown.h.
4336 Reported by and with suggestions from Manfred Hollstein.
4338 1998-07-12 Paul Eggert <eggert@twinsun.com>
4340 * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
4342 1998-07-07 Jim Meyering <meyering@ascend.com>
4344 * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
4345 Suggestion from Ulrich Drepper.
4347 1998-07-04 Jim Meyering <meyering@ascend.com>
4349 * lib/safe-read.c (safe_read): Change type of pointer parameter to
4350 `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi.
4351 * lib/safe-read.h: Update prototype.
4353 * src/dircolors.c (parse_line): Add casts to avoid errors from
4354 Irix4's `cc' C compiler. From Kaveh Ghazi.
4356 * lib/xstrtol.c: Include stdio.h. Required on some systems when
4357 using assert. From Kaveh Ghazi.
4359 * tests/mv/backup-is-src: Use cmp, not diff.
4360 Reported by Kaveh Ghazi.
4362 1998-07-03 Jim Meyering <meyering@ascend.com>
4366 * src/remove.c (remove_dir): Use fprintf (not error) to avoid
4369 1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
4371 * lib/mountlist.c: (read_filesystem_list):
4372 Don't leak memory on failure.
4373 Don't create a dummy struct mount_entry entry;
4374 use the address-of-the-tail-address method instead.
4375 Preserve errno if possible on failure, setting it to 0 if inapplicable.
4376 Close file descriptor leak if the F_SETLKW failed.
4377 Report an error if SVR4 lock file cannot be opened for some reason
4378 other than a nonexistent lock file.
4380 1998-07-03 Jim Meyering <meyering@ascend.com>
4382 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
4383 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
4384 * acconfig.h (WITH_REGEX): Remove undef.
4385 * lib/Makefile.am (noinst_HEADERS): Add regex.h.
4386 * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
4387 * lib/rx.c: Remove file.
4388 * lib/rx.h: Remove file.
4390 * src/df.c (df_readable): Rename local so as not to shadow global.
4392 * src/copy.c (SAME_INODE): New macro.
4393 Use it to replace open-coded equivalents.
4394 (copy_internal): Rename variable and reverse sense of tests
4395 to make the code a little clearer.
4397 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4399 * src/copy.c (copy_internal): Try harder identifying a relative
4400 symbolic link in the current directory.
4402 * src/copy.c (copy_internal): Don't skip test for same file if
4403 creating a hardlink from symlink over a non-symlink while making
4405 * tests/cp/same-file: Skip tests that depend on link(2) not
4408 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4410 * src/copy.c (copy_internal): Don't call chown on a symlink.
4412 1998-07-01 Jim Meyering <meyering@ascend.com>
4414 * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
4415 configure's --disable-assert option.
4417 1998-06-29 Paul Eggert <eggert@twinsun.com>
4419 * lib/mountlist.c (read_filesystem_list):
4420 Plug file descriptor leak on failure.
4421 Report failure if lock file can't be opened for some reason
4422 other than nonexistence.
4424 1998-06-29 Jim Meyering <meyering@ascend.com>
4428 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
4429 Always close stream and file descriptor before returning.
4431 * src/df.c (main): Move the test of the result of the
4432 read_filesystem_list call up out of if-block -- code in the
4433 else-block depends on it too.
4435 1998-06-29 Paul Eggert <eggert@twinsun.com>
4437 * lib/mountlist.c: (read_filesystem_list): If SVR4, lock
4438 /etc/.mnttab.lock if available, to avoid race conditions
4439 (e.g. with the automounter on Solaris 2.6).
4441 Include <errno.h>, <fcntl.h>, <unistd.h>.
4443 1998-06-29 Jim Meyering <meyering@ascend.com>
4445 * lib/mountlist.c (fstype_to_string): Guard with
4446 #if ! HAVE_F_FSTYPENAME_IN_STATFS.
4448 1998-06-28 Paul Eggert <eggert@twinsun.com>
4450 Add support for new --block-size option and
4451 BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
4452 Adjust df output slightly to accommodate larger filesystems.
4454 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
4455 into one, for convenience. All callers changed.
4456 (human_block_size): New function.
4457 * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
4458 Include <stdlib.h> if HAVE_STDLIB_H;
4459 declare getenv unless HAVE_DECL_GETENV.
4461 Include <argmatch.h>, <error.h>, <xstrtoul.h>.
4462 (DEFAULT_BLOCK_SIZE): New macro.
4463 (block_size_args, block_size_types): New constants.
4464 (humblock): New function.
4465 * lib/xstrtol.h (__ZLONG_MAX): Remove.
4466 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
4467 unsigned long to double without losing information.
4468 (bkm_scale_by_power): New function.
4470 * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
4471 Add support for SI-like suffixes like "GB" and "TD".
4472 * src/dd.c (usage): Describe it.
4474 * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
4475 Remove; replace with new variable output_block_size. All uses changed.
4476 (long_options, usage, main): Add --block-size.
4477 (main, decode_switches): Use new human_block_size function to
4478 initialize output block size consistently with other programs.
4480 * src/df.c (print_header, show_dev): Shrink some columns and expand
4481 others, to squeeze in support for today's larger filesystems.
4482 (print_header): Print output block size using power-of-1024 SI format.
4483 (df_readable): Coalesce last two args into one, for convenience.
4484 All callers changed.
4485 (main): Remove check for portable output format and larger
4486 or human-readable block sizes.
4488 * NEWS, doc/fileutils.texi: Describe above changes.
4490 1998-06-28 Jim Meyering <meyering@ascend.com>
4492 * src/ls.c (usage): Make --kilobytes description consistent with
4493 that in du and df. From Göran Uddeborg.
4495 * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
4496 now that we're using the jm_FSTYPENAME autoconf macro.
4497 James Tanis reported the old version didn't compile on BSDI3.
4499 * configure.in: Move big block of list_mounted_fs checks into
4500 new jm_LIST_MOUNTED_FILESYSTEMS macro.
4501 Use new jm_FSTYPENAME macro.
4503 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
4504 * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
4507 1998-06-27 Jim Meyering <meyering@ascend.com>
4509 * src/copy.c (copy_reg): Detect identical source and dest here.
4510 (copy_internal): Make the test symmetric.
4512 * tests/cp/same-file: New file.
4513 * tests/cp/Makefile.am (TESTS): Add it.
4515 1998-06-26 Jim Meyering <meyering@ascend.com>
4517 * src/remove.c (remove_file): Remove `non-directory' part of
4518 `removing non-directory FILE' verbose message.
4520 1998-06-23 Jim Meyering <meyering@ascend.com>
4522 * src/df.c (show_dev): Increase field width for blocks, used,
4523 and available columns from 7 to 8.
4525 1998-06-21 Jim Meyering <meyering@ascend.com>
4527 * aclocal.m4: Regenerate with fixed gettext.m4 installed.
4528 See README-alpha for details.
4530 1998-06-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4532 * src/automake-wrap: Quote `&' in sed replacement text.
4534 1998-05-31 Jim Meyering <meyering@ascend.com>
4538 * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
4539 Reported by Don Parsons.
4541 1998-05-30 Jim Meyering <meyering@ascend.com>
4543 * tests/ls/time-1: Clean up ctime test. Note that it fails also
4544 on Solaris5.5.1 tmpfs file systems.
4546 Solve the `rm -f rm' problem more cleanly.
4547 * src/.rm-warning: Remove file.
4548 * src/automake-wrap: New file.
4549 * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
4550 (Makefile.in): Depend on automake-wrap.
4551 (EXTRA_DIST): Add automake-wrap.
4552 (DISTCLEANFILES): Remove definition.
4553 (rm_DEPENDENCIES): Likewise.
4554 (.rm-warn-stamp): Remove rule.
4556 1998-05-27 Jim Meyering <meyering@ascend.com>
4558 * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
4559 * tests/ls/rt-1: New file, renamed from cr-1.
4561 1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4563 * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
4565 * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
4568 1998-05-25 Jim Meyering <meyering@ascend.com>
4570 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
4571 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
4572 [!_GNU_SOURCE]: Add #undef instead.
4574 1998-05-24 Jim Meyering <meyering@ascend.com>
4578 * src/ansi2knr.c: Use new version from automake-1.3.
4580 * src/chown.c: Accept new option, --dereference.
4581 --no-dereference is now the default.
4582 (enum Change_status) [CH_NOT_APPLIED]: New member.
4583 (change_symlinks): Enable this by default, now.
4584 (describe_change): Handle new case.
4585 (change_file_owner): Add new parameter: cmdline_arg. Update callers.
4586 Reorganize to reflect changed semantics.
4587 (LCHOWN): Remove definitions.
4589 * lib/lchown.c: New file.
4591 1998-05-21 Jim Meyering <meyering@ascend.com>
4593 * configure.in (ALL_LINGUAS): Add russian (ru).
4595 1998-05-16 Jim Meyering <meyering@ascend.com>
4597 * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
4598 (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
4600 * lib/hash.c (is_prime): Ansideclify.
4601 (next_prime): Ansideclify. Add an assertion.
4603 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
4604 lines from the m4/*.m4 macros, so the hack of including some
4605 custom-replaced C source file names here is no longer needed.
4607 * configure.in (jm_MACROS): New wrapper macro.
4608 Remove uses of most jm_* macros.
4610 * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
4611 as part of utimbuf.m4.
4612 (memcmp): Add #undef.
4614 1998-05-12 Jim Meyering <meyering@ascend.com>
4616 * configure.in: Use my replacement AC_ISC_POSIX rather than
4619 * src/copy.c (copy_internal): Plug a small leak.
4621 1998-05-10 Jim Meyering <meyering@ascend.com>
4623 * src/mv.c (do_move): Remove lots of code that was duplicated in
4624 copy.c (copy), now that copy() has better support for mv. This fixes
4625 a bug with cross-filesystem `mv -i' whereby you could get two prompts
4626 for the same destination file and eventually remove the destination
4627 file even though one of the responses was negative.
4628 Reported by Dirk Lattermann.
4630 * src/copy.h: Better support for mv:
4631 [struct cp_options] (move_mode): New member.
4632 * src/copy.c (copy_internal): Use new move_mode member.
4634 (copy): Add parameter.
4636 * tests/cp/Makefile.am (TESTS): Add backup-is-src.
4637 * tests/mv/Makefile.am (TESTS): Likewise.
4639 * lib/userspec.c: Don't declare strdup if it's defined as a macro.
4640 Reported by Lorne Baker.
4642 * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
4644 * src/mv.c (cp_option_init): Initialize new members.
4645 * src/cp.c (cp_option_init): Likewise.
4646 (main): Set new preserve_* options.
4648 1998-05-09 Jim Meyering <meyering@ascend.com>
4650 * src/copy.h: Support for install:
4651 [struct cp_options] (failed_unlink_is_fatal): New member.
4652 (preserve_owner_and_group): New member.
4653 (preserve_chmod_bits): New member.
4654 (preserve_timestamps): New member.
4655 (preserve): Remove member.
4656 (set_mode): New member.
4658 * src/copy.c (new_nondir_mode): New function. Use where appropriate.
4659 Use more-specific preserve_* members in place of removed `preserve'.
4660 (copy_internal): Honor failed_unlink_is_fatal.
4662 * src/install.c (main): Rewrite argv-handling to be clearer.
4663 (copy_file): Rewrite to use copy.c (copy).
4664 (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
4665 `no_need_to_chown' parameter. Fix caller.
4666 (install_file_in_file): Remove now-unnecessary `to_created' parameter.
4667 (cp_option_init): New function.
4668 Update several functions to take new parameter specifying copy options.
4670 * tests/install: New subdir, with one basic test.
4671 * tests/Makefile.am (SUBDIRS): Add install.
4672 * configure.in (AC_OUTPUT): Add tests/install/Makefile.
4674 * src/dd.c: Include safe-read.h.
4675 Don't declare safe_read.
4676 * src/touch.c: Likewise.
4678 * configure.in (jm_TYPE_SSIZE_T): Use it.
4679 * acconfig.h (ssize_t): Add undef.
4681 1998-05-03 Jim Meyering <meyering@ascend.com>
4683 * po/: Update from gettext-0.10.35.
4685 * configure.in: Remove use of AC_LINK_FILES.
4686 (AC_OUTPUT): Remove po/Makefile-generating sed command.
4688 1998-04-28 Jim Meyering <meyering@ascend.com>
4690 * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
4691 Use unsigned char * pointers, not potentially signed ones, to avoid
4694 1998-04-26 Jim Meyering <meyering@ascend.com>
4696 * configure.in: Use jm_ASSERT.
4697 * acconfig.h: Add NDEBUG.
4699 * src/mv.c: Don't define NDEBUG.
4700 * src/cp.c: Likewise.
4702 1998-04-14 Jim Meyering <meyering@ascend.com>
4704 * src/.rm-warning: New file.
4705 * src/Makefile.am (EXTRA_DIST): Add .rm-warning
4706 (DISTCLEANFILES): Add .rm-warn-stamp.
4707 (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
4708 (.rm-warn-stamp): New rule.
4709 (rm_prep): Comment out rule.
4711 * src/df.c (main): Use STREQ in string equality tests, not strcmp.
4712 * src/dircolors.c (dc_parse_stream): Likewise.
4713 (dc_parse_file): Likewise.
4714 * src/du.c (main): Likewise.
4715 * src/ls.c (decode_switches): Likewise.
4716 * src/remove.c (hash_compare_strings): Likewise.
4717 * src/touch.c (main): Likewise.
4719 1998-04-13 Jim Meyering <meyering@ascend.com>
4721 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
4723 1998-04-11 Jim Meyering <meyering@ascend.com>
4725 * lib/hash.c: Add curly braces around statements in
4726 if/else/while/do/etc. that span more than a line -- even around
4727 multiline simple statements or single-line simple statements
4728 preceded by a comment line.
4730 1998-04-09 Jim Meyering <meyering@ascend.com>
4732 * configure.in: Don't use AC_PATH_PROG to check for perl, now that
4735 1998-04-06 Jim Meyering <meyering@ascend.com>
4737 * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
4738 hash_insert. Also declare to be static.
4739 * src/cp-hash.h (hash_insert): Remove declaration.
4741 * lib/hash.c: Lots of minor spec and name changes, and new comments.
4742 (hash_rehash): Rewrite to be easier on the allocator.
4743 From François Pinard.
4744 * lib/hash.h: More comments.
4745 * src/remove.c: Change names/usage of hash-related functions to work
4748 1998-04-05 Jim Meyering <meyering@ascend.com>
4750 * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
4751 This now depends on HAVE_BTOWC so systems that lack btowc (like
4752 solaris-2.5.1) don't lose.
4754 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
4756 * GNUmakefile: Add conditionals so that running `make' in an
4757 unconfigured source directory will get a reasonable diagnostic.
4759 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
4760 know about the m4/ subdirectory.
4761 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
4762 automake-1.2h and the above change) aclocal-related rules and includes.
4764 1998-04-01 Jim Meyering <meyering@eng.ascend.com>
4766 * tests/ls/cr-1: New file.
4767 * tests/ls/Makefile.am (TESTS): Add cr-1.
4769 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
4771 * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
4772 works with `unsigned char'.
4774 (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
4776 * lib/xstrtol.c: Merge with the version from textutils.
4778 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
4780 1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4782 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
4783 rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
4784 rev_cmp_size): Use file name as secondary sort key to get
4787 1998-03-28 Jim Meyering <meyering@eng.ascend.com>
4789 * src/copy.c: Add copyright.
4790 * src/remove.c: Add copyright.
4791 [_AIX]: Add #pragma alloca.
4793 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
4795 * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
4796 dependency and the := assignment of ACLOCAL to make the default
4797 rule use the `-I m4' option.
4799 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
4801 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
4803 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
4804 automatically handles it.
4806 1998-03-21 Jim Meyering <meyering@eng.ascend.com>
4808 * lib/quotearg.h: Update from patch-2.5.3.
4809 * lib/quotearg.c: Likewise.
4810 * src/ls.c (decode_switches): Pass a null pointer instead of address
4811 of quotearg_quoting_options.
4813 1998-03-19 Paul Eggert <eggert@twinsun.com>
4815 * lib/fsusage.h (struct fs_usage): New member
4816 fsu_bavail_top_bit_set.
4817 * lib/fsusage.c: Include <limits.h>.
4818 (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
4819 (get_fs_usage): If top bit of system variable corresponding to
4820 fsu_bavail is set, then set fsu_bavail_top_bit_set, and
4821 sign-extend the value when storing it into fsu_bavail.
4822 * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
4823 assume the original value corresponding to fsu_bavail was negative.
4824 Reported by Arne Juul.
4826 1998-03-18 Jim Meyering <meyering@eng.ascend.com>
4828 * src/Makefile.am (rm-prep): Add dependency and rule to save users
4829 with `.' too early in their PATH from the `rm: cannot unlink `rm':
4830 Text file busy' error. Suggestion from Philippe De Muyter.
4832 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
4836 * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
4837 * lib/closeout.c: Likewise.
4838 * lib/dirname.c: Likewise.
4839 * lib/euidaccess.c: Likewise.
4840 * lib/fileblocks.c: Likewise.
4841 * lib/filemode.c: Likewise.
4842 * lib/ftruncate.c: Likewise.
4843 * lib/group-member.c: Likewise.
4844 * lib/isdir.c: Likewise.
4845 * lib/long-options.c: Likewise.
4846 * lib/mountlist.c: Likewise.
4847 * lib/path-concat.c: Likewise.
4848 * lib/save-cwd.c: Likewise.
4849 * lib/savedir.c: Likewise.
4850 * lib/strcasecmp.c: Likewise.
4851 * lib/strdup.c: Likewise.
4852 * lib/userspec.c: Likewise.
4853 * lib/yesno.c:: Likewise.
4855 * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
4856 Use #if !, not #ifndef with HAVE_ macros.
4857 * src/chown.c: Likewise.
4858 * src/copy.c: Likewise.
4859 * src/dd.c: Likewise.
4860 * src/dircolors.c: Likewise.
4861 * src/install.c: Likewise.
4862 * src/ls.c: Likewise.
4863 * src/mv.c: Likewise.
4864 * src/touch.c: Likewise.
4866 * configure.in: Use jm_PREREQ.
4868 1998-03-14 Jim Meyering <meyering@eng.ascend.com>
4870 Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
4871 With automake-1.2f, that hack is no longer needed.
4873 * src/remove.c: Use `virtual memory exhausted' message, not
4874 `Memory exhausted' to be consistent with the majority of other
4876 Say `removing all...', not `removing any...'.
4877 * src/rmdir.c (remove_parents): Be consistent with documentation of
4878 --verbose option and with remove.c in saying `removing...' before
4879 the operation is attempted.
4881 Suggestions from Santiago Vila.
4883 * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
4884 (copy_internal): Likewise.
4887 * src/copy.h (copy): Update prototype.
4888 * src/cp.c (do_copy): Add unused arg in calls to copy.
4889 * src/mv.c (do_move): Add ©_into_self arg in call to copy.
4890 Don't remove source directory when copy_into_self is nonzero.
4891 Reported by Arne Henrik Juul.
4893 * tests/mv/into-self: Test for the above.
4894 * tests/mv/Makefile.am (TESTS): Add into-self.
4896 1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
4898 * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
4899 about any arbitrary user and group by pretending to be the user
4900 and to belong to the group specified in `spec_arg' argument.
4902 * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
4903 any arbitrary user name.
4904 (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
4907 1998-02-24 Jim Meyering <meyering@eng.ascend.com>
4909 * lib/xstrtol.c (TYPE_SIGNED): Define.
4910 (TYPE_MAXIMUM): Define.
4911 (ULONG_MAX): Use TYPE_MAXIMUM.
4912 (LONG_MAX): Use TYPE_MAXIMUM.
4914 * lib/fnmatch.c: Update from libit.
4915 * lib/idcache.c: Update from libit.
4917 1998-02-23 Paul Eggert <eggert@twinsun.com>
4919 * lib/quotearg.h, lib/quotearg.c: New files.
4920 * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
4921 (noinst_HEADERS): Add quotearg.h.
4923 * src/ls.c: Include new file quotearg.h.
4924 (enum indicator_style): Rename all to classify, and not_programs
4925 to file_type, to match option spellings. All users changed.
4926 (indicator_style_args): New constant.
4927 (quote_funny_chars, quote_as_string, quote_shell): Remove;
4928 (filename_quoting_options, dirname_quoting_options): Use these
4930 (long_options): Add --indicator-style, --quoting-style,
4931 --show-control-chars. Remove --quote-shell.
4932 (dired_dump_obstack): Remove style parameter and don't output style.
4933 (main): Go back to previous method of outputting //DIRED//
4934 and //SUBDIRED// lines, without style. But add a new
4935 //DIRED-OPTIONS// line that does output style.
4936 (decode_switches, usage): Add --indicator-style, --quoting-style,
4937 --show-control-chars. Remove --quote-shell.
4938 (decode_switches): Default from QUOTING_STYLE environment variable.
4939 Set new quoting vars.
4940 (quote_name): Renamed from quote_filename.
4941 Take new arg specifying quoting options.
4942 Always print; do not have a special case for null FILE * argument.
4943 All callers changed.
4944 Move the guts of this function to new file quotearg.c.
4945 (length_of_file_name_and_frills): Use quotearg_buffer instead
4946 of (old) quote_filename to find length of file name.
4948 (decode_switches, parse_ls_color, print_dir, gobble_file,
4949 get_link_name): Quote output in diagnostics.
4951 * NEWS, doc/fileutils.texi: Describe above changes.
4952 * doc/fileutils.texi: Mention that control characters are output
4953 as question marks if output is a terminal.
4955 1998-02-22 Jim Meyering <meyering@eng.ascend.com>
4959 * ChangeLog-1997: New file.
4960 * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
4962 1998-02-21 Jim Meyering <meyering@eng.ascend.com>
4964 * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
4965 * tests/Makefile.am (SUBDIRS): Add mv.
4966 * tests/mv: New directory
4967 * tests/mv/mv-special-1: New test.
4969 1998-02-20 Jim Meyering <meyering@eng.ascend.com>
4971 * src/touch.c: Include get-date.h.
4972 Remove get_date decl.
4974 * lib/getdate.h: Removed. Could cause confusion with an
4975 automake-generated `.y.h' rule.
4976 * lib/get-date.h: Renamed from getdate.h.
4977 * lib/getdate.y: s/getdate.h/get-date.h/
4978 * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
4980 1998-02-19 Jim Meyering <meyering@eng.ascend.com>
4982 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
4983 * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
4985 1998-02-13 Jim Meyering <meyering@eng.ascend.com>
4987 * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
4988 Otherwise, mv tries to open special files.
4989 Reported by Kjetil Torgrim Homme.
4991 1998-02-08 Jim Meyering <meyering@eng.ascend.com>
4993 * Makefile.maint (cvs-dist): Update po/ to clear modified status
4994 of *.po files before running cvs tag -c.
4996 * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
4999 1998-02-07 Jim Meyering <meyering@eng.ascend.com>
5001 * GNUmakefile: New file.
5002 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
5003 Don't include Makefile.maint from here. It's included from GNUmakefile.
5005 * configure.in: Don't use AM_MAINTAINER_MODE.
5006 (jm_PERL): Use this.
5008 * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen.
5009 (CLEANFILES): Remove dcgen.
5010 (dircolors.h): Use $(PERL).
5013 1998-02-01 Jim Meyering <meyering@na-net.ornl.gov>
5015 * POTFILES.in: Add remove.c. Reported by Santiago Vila.
5017 1998-01-28 Jim Meyering <meyering@na-net.ornl.gov>
5019 * src/df.c (print_header): Tweak format to align heading over
5020 last column of `df -i' output. From Andreas Schwab.
5022 1998-01-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5024 * Makefile.am: Include Makefile.maint from $(srcdir).
5026 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
5030 * Makefile.maint: New file.
5031 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
5032 into Makefile.maint.
5033 Include Makefile.maint.
5034 (EXTRA_DIST): Add Makefile.maint.
5036 * src/cp.c (re_protect): Don't fail for non-root when chown fails
5037 due not only to lack of permission (EPERM), but also to lack of
5038 support (EINVAL). Reported by Bengt Martensson.
5039 * src/copy.c (DO_CHOWN): Likewise.
5041 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
5043 * tests/ls/time-1 (test_failure): Rename does not update ctime;
5044 link does -- so use ln, not mv.
5045 Note that the SunOS4.1.4 failure of the ctime test is expected.
5047 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
5048 bug in Cray C 5.0.3.0 when T == time_t.
5050 * tests/rm/r-1: Adjust expected output for changed format of
5052 * tests/rm/r-2: Likewise.
5054 1998-01-23 Jim Meyering <meyering@na-net.ornl.gov>
5056 * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
5057 C compiler. From Kaveh Ghazi.
5058 (TYPE_MINIMUM): Define.
5059 (TYPE_MAXIMUM): Define.
5060 (TIME_T_MIN): Use TYPE_MINIMUM.
5061 (TIME_T_MAX): Use TYPE_MAXIMUM.
5063 1998-01-22 Jim Meyering <meyering@na-net.ornl.gov>
5065 * src/dd.c: Reorder functions to obviate forward dcls.
5066 (quit): Declare to be inline to stifle compile warning.
5068 * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
5070 * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a
5073 * tests/ls/time-1: Use GNU touch to work around problems with NFS
5074 caching and/or clock skew. Reported by Kaveh Ghazi.
5076 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
5078 * src/Makefile.am (noinst_HEADERS): Add remove.h.
5079 (mv_SOURCES): Define.
5080 (rm_SOURCES): Define.
5082 1998-01-21 Jim Meyering <meyering@na-net.ornl.gov>
5084 * src/install.c: Declare new global, backup_type.
5085 (main): Initialize backup_type unconditionally.
5086 (copy_file): Call find_backup_file_name with new argument, backup_type.
5087 * src/ln.c: Declare new global, backup_type.
5088 (main): Initialize backup_type unconditionally.
5089 (do_link): Call find_backup_file_name with new argument, backup_type.
5091 * src/copy.c (copy_internal): Use x->backup_type, not the global.
5092 (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
5094 * src/copy.h: (VALID_SPARSE_MODE): Define.
5095 [struct cp_options] (backup_type): New member.
5097 * src/cp.c [NDEBUG]: Comment out definition.
5098 (do_copy): Use x->backup_type, not the global.
5100 * src/remove.c: New file. Contains guts of old rm.c.
5101 (remove_init): New function.
5102 (remove_fini): New function.
5103 (rm): Take third argument, specifying options.
5104 * src/remove.h: New file. Associated dcls.
5105 * src/rm.c: Remove and minimally librarify guts for use in mv.c.
5106 (main): Pass options (`&x') to rm.
5107 Call remove_init and remove_fini instead of open-coding them.
5109 * src/mv.c (rm_option_init): New function.
5110 (cp_option_init): New function.
5111 (copy_reg): Remove now-unused function.
5112 (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
5113 Set up for and use `remove.c (rm)' in place of unlink.
5115 1998-01-20 Jim Meyering <meyering@na-net.ornl.gov>
5117 * lib/backupfile.c: Use ANSI function definitions.
5118 Remove global declaration of backup_type.
5119 (simple_backup_suffix): Default to `~', not `.orig'.
5120 Use PARAMS, not __BACKUPFILE_P.
5121 (find_backup_file_name): Add parameter, backup_type.
5122 * lib/backupfile.h: Remove extern declaration of backup_type.
5123 Use PARAMS, not __BACKUPFILE_P.
5124 (VALID_BACKUP_TYPE): Define.
5125 (find_backup_file_name): Adjust prototype.
5127 1998-01-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5129 * src/df.c (print_header): Fix inode format header to line it up
5130 with the rest of the output.
5132 1998-01-13 Jim Meyering <meyering@na-net.ornl.gov>
5134 * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent
5135 with most other implementations.
5137 1998-01-12 Jim Meyering <meyering@na-net.ornl.gov>
5139 * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
5140 Move function-spanning `#if ...BSIZE' directive to follow inclusion
5141 of sys/param.h since BSIZE is sometimes defined in sys/param.h.
5142 Reported by Philippe De Muyter.
5144 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
5148 * src/install.c (install_file_to_path): New function.
5149 FIXME: update fileutils.texi.
5150 (main): Handle new option, -D.
5151 Based on a patch from Marty Leisner.
5152 (usage): Describe -D.
5154 * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
5155 with -l or -t. Now, -u (like -c) implies --sort=time.
5156 (usage): Correct descriptions of --sort, --time, and -t.
5157 Suggestions from Andreas Schwab.
5159 Add test for the above fix.
5160 * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
5161 * tests/Makefile.am (SUBDIRS): Add ls.
5162 * tests/ls: New directory.
5163 * tests/ls/Makefile.am: New file.
5164 * tests/ls/time-1: New file.
5166 * lib/makepath.c (make_path): Reformat 3 if-stmts to test
5167 `if (newly_created_dir)' only once. Suggestion from Andreas Schwab.
5169 1998-01-06 Jim Meyering <meyering@na-net.ornl.gov>
5171 * lib/getdate.y: Move inclusion of getdate.h and dependent extern
5172 declarations down so getdate.h's prototype follows the sometimes-
5173 enabled definition of `const' to nothing. Otherwise, the prototype
5174 wouldn't match the definition because of the defined-away `const'.
5176 (get_date): ANSI-fy definition.
5177 Add %expect directive.
5179 1998-01-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5181 * lib/makepath.c (make_path): Put only newly created directories
5182 on the LEADING_DIRS list.
5184 1998-01-05 Paul Eggert <eggert@twinsun.com>
5186 * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
5187 (get_fs_usage): If a value consists entirely of 1 bits,
5188 propagate this info to the output by setting it to (uintmax_t) -1.
5189 * src/df.c (df_readable): New function.
5190 (show_dev): If a value consists entirely of 1 bits, or is derived
5191 from some other value that consists entirely of 1 bits, report "-".
5192 Check inode and block counts more carefully for plausibility,
5193 to avoid arithmetic overflow when computing percentages.
5195 1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
5199 * lib/Makefile.in: Regenerated with patched automake-1.2d.
5202 * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
5203 the two booleans, verbose and changes_only. This fixes a bug whereby
5204 --change had the same effect as --verbose.
5205 * src/chmod.c: Likewise.
5206 * src/chown.c: Likewise.
5207 Reported by Paul Eggert.
5209 1998-01-04 Paul Eggert <eggert@twinsun.com>
5211 Check for write errors more carefully.
5213 * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
5214 (noinst_HEADERS): Add closeout.h.
5215 * lib/closeout.c, lib/closeout.h: New files.
5216 * lib/long-options.c (parse_long_options),
5217 src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
5218 src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
5219 src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
5220 src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
5221 (main, usage): Check for write error to stdout before exiting.
5222 Include "closeout.h".
5224 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
5226 * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
5227 just like `fsu.fsu_blocks == 0' as an indicator that usage information
5228 is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
5230 * lib/save-cwd.h: Guard PARAMS-enabling definition with
5231 `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
5232 problems with Irix4's cc. From Kaveh Ghazi.
5233 * lib/getdate.h: Likewise, but just to be consistent.
5235 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
5236 those files will be built via the ANSI2KNR-filtering rules if necessary.
5237 Reported by Kaveh Ghazi.
5239 1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
5243 Fix problem with `install -d'. Reported by Marty Leisner.
5245 * src/install.c (get_ids): When otherwise unspecified,
5246 set uid and gid to -1.
5247 * lib/makepath.c (make_path): Try to change ownership only if we've
5248 just created the directory. Fix latent bug (s/&&/||/ in two places --
5249 also, note that it could not be exercised via install or mkdir)
5250 whereby chown would not be invoked when only one of owner/group is
5253 1998-01-01 Jim Meyering <meyering@na-net.ornl.gov>
5255 * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
5256 only once and never free it.
5259 version-control: never