1 2001-04-21 Jim Meyering <meyering@lucent.com>
5 * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49e.
7 * doc/fileutils.texi (touch invocation): Discuss ctime.
8 Based on suggestions and contributions from Aharon Robbins
11 * src/ls.c (main): When given two or more arguments but the only one
12 that exists is a directory, don't treat it as if it were the only
13 argument. Before, `mkdir d; ls no-dir d 2>/dev/null' would act like
14 `ls d' and produce no output. Now, it prints `d:'.
15 Report and patch from Stéphane Chazelas.
16 * tests/ls-2/tests: New tests, for the above fix.
18 2001-04-08 Jim Meyering <meyering@lucent.com>
20 * depcomp: New version, from automake.
22 2000-10-31 Bruno Haible <haible@clisp.cons.org>
24 * ls.c: Don't inspect MB_LEN_MAX. Paul Eggert says it's
25 not always defined correctly.
27 2001-04-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
29 * tests/chgrp/basic: Ensure that initial group id's are properly set
32 2001-04-02 Jim Meyering <meyering@lucent.com>
34 * tests/mv/setup: Skip nonexistent directories so we don't get
35 diagnostics from df about e.g., `/usr/tmp not found'.
37 2001-03-24 Jim Meyering <meyering@lucent.com>
39 * configure.in: Don't require autoconf version here -- it's done in m4/.
41 2001-03-23 Jim Meyering <meyering@lucent.com>
45 * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49d.
47 * Makefile.maint (check-copyright): New target and rule.
48 (alpha): Depend on it.
50 * missing: Handle shell built-ins (only `:' and `cd' for now) to work
51 around brain damage in Ultrix's /bin/sh.
53 2001-03-18 Jim Meyering <meyering@lucent.com>
57 * tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL
58 to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a
59 suggestion from Eli Zaretskii.
61 2001-03-17 Paul Eggert <eggert@twinsun.com>
63 * doc/fileutils.texi: Warn that touch DATE FILE will be withdrawn.
65 2001-03-17 Jim Meyering <meyering@lucent.com>
67 * tests/install/basic-1: Add the standard $VERBOSE-handling hook.
68 This test currently fails for mips-dec-ultrix4.4.
70 * tests/install/create-leading: Use ../envvar-check rather than
71 open-coding the same tests.
73 * tests/envvar-check: Set/use $as_unset, for those shells
74 (like Ultrix4's /bin/sh) that don't accept `unset'.
76 * missing (--run): Use `eval' to run `"$@"'. Otherwise, Ultrix4.4's
77 /bin/sh fails and outputs garbage.
79 * src/touch.c (usage): Tweak the obsolescent usage line so that
80 help2man recognizes it as such. Reported by Dan Jacobson.
82 2001-03-16 Jim Meyering <meyering@lucent.com>
84 * Makefile.maint (wget-update): Also get `missing'.
87 * missing: Update from automake.
89 2001-03-11 Jim Meyering <meyering@lucent.com>
91 * tests/rm/isatty: Disable this test, for now.
92 It would block when run in the background.
94 2001-03-09 Jim Meyering <meyering@lucent.com>
96 * config.guess: Update from master repository.
98 * Makefile.maint (my_distdir): Define new variable, and use this
99 in place of most old uses of $(distdir).
101 * src/Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
102 Reported by Akim Demaille.
104 * tests/help-version: Ensure that /dev/full is a character device
105 (using test -c) as well as being writable, before trying to write to it.
106 Otherwise, the test could mistakenly append a newline to an existing,
107 regular, writable, /dev/full file.
108 Suggested by Ulrich Drepper.
110 2001-03-06 Jim Meyering <meyering@lucent.com>
112 * src/dd.c (S_TYPEISSHM): Rename parameter to reflect its type.
113 (main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM.
114 Patch by Alain Magloire.
116 2001-03-04 Jim Meyering <meyering@lucent.com>
118 * src/dd.c (output_char): Reformat so each statement is on a
121 2001-02-21 Jim Meyering <meyering@lucent.com>
123 * src/mkdir.c (main): Remove assignment-in-if-expression.
124 In fact, remove t_errno altogether. Reported by Nelson Beebe.
126 * tests/ls-2/tests: Add two tests of existing behavior -- both will
127 have to be changed (soon after release), once ls is fixed.
129 2001-02-20 Paul Eggert <eggert@twinsun.com>
131 * src/ls.c (FULL_TIME_OPTION): Renamed from FULL_TIME, for
132 consistency with the other enum values.
134 2001-02-20 Paul Eggert <eggert@twinsun.com>
136 * NEWS, doc/fileutils.texi: ls -H is now obsolescent.
137 * src/ls.c (SI_OPTION): New enum value.
138 (long_options): Use it instead of 'H' for --si.
139 (decode_switches): Warn that -H will change soon.
142 2001-02-18 Jim Meyering <meyering@lucent.com>
144 * tests/rm/Makefile.am (TESTS): Add isatty.
145 * tests/rm/isatty: New test, for the bug fixed below.
149 * depcomp: New version, from automake.
151 `chmod 0 file; rm file' would no longer prompt before removal.
152 * src/remove.c (remove_file): Revert last change.
153 Reported by Vin Shelton.
155 2001-02-17 Jim Meyering <meyering@lucent.com>
159 * src/chown.c (main): `quote' the offending argument.
161 2001-02-17 Paul Eggert <eggert@twinsun.com>
163 Stop trying to support hosts that have nonstandard declarations for
164 mbrtowc and/or mbstate_t. It's not worth the portability hassle.
166 * m4/mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC.
167 * m4/mbswidth.m4 (jm_PREREQ_MBSWIDTH):
168 Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc).
169 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Likewise.
170 * lib/mbswidth.c, lib/quotearg.c, src/ls.c (mbrtowc, mbsinit):
171 Remove workaround macros for hosts that have mbrtowc but not
172 mbstate_t, as we now insist on proper declarations for both
173 before using mbrtowc.
174 Reported by Matt Schalit.
176 2001-02-17 Jim Meyering <meyering@lucent.com>
178 * config.sub: Update from master repository.
179 * config.guess: Likewise.
181 2001-02-16 Paul Eggert <eggert@twinsun.com>
183 * doc/getdate.texi: Mention that only English is supported.
184 Show how to use "date" so that the output is acceptable to getdate.
185 Mention Z as an abbreviation for UTC.
187 2001-02-11 Jim Meyering <meyering@lucent.com>
189 * Makefile.maint (emit-rsync-commands): Define.
190 (alpha): Use it here.
192 2001-02-10 Jim Meyering <meyering@lucent.com>
194 * Makefile.maint (alpha): Fix previous, incomplete change.
198 * depcomp: New version, from automake.
200 2001-02-04 Jim Meyering <meyering@lucent.com>
202 * README: Remove note about now-ancient Sequents.
204 2001-02-03 Jim Meyering <meyering@lucent.com>
206 * src/ln.c (main): Change type of index variable to `unsigned int'
209 * config.guess: Update from master repository.
211 * Makefile.maint (a_host): Use fencepost.
212 (real_dir): Use the same name for both.
213 (alpha): Print commands for both hosts.
215 * src/mv.c (long_options): Use `strip-trailing-slashes',
216 per the documetation, not `strip-trailing-slash'.
217 * src/cp.c (long_opts): Likewise.
218 Reported by Oskar Liljeblad.
220 * doc/fileutils.texi (mv invocation): Add a warning about how a trailing
221 slash makes a difference. Prompted by a report from Oskar Liljeblad
222 via Michael Stone (Debian bug#83991).
224 2001-01-31 Jim Meyering <meyering@lucent.com>
226 * config.sub: Update from master repository.
227 * config.guess: Likewise.
229 2001-01-28 Jim Meyering <meyering@lucent.com>
233 * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49c.
235 * src/ls.c (gobble_file): Add a FIXME comment.
237 * TODO: Add a few items.
239 * src/ls.c (enum) [FULL_TIME]: Define.
240 (long_options): Use it.
241 (decode_switches): Make --full-time imply -l.
242 Prompted by a report from Karl Eichwalder.
244 2001-01-22 Jim Meyering <meyering@lucent.com>
246 * src/remove.c (remove_file): Correct an expression to avoid making
247 an unnecessary call to euidaccess for each file.
249 2001-01-21 Jim Meyering <meyering@lucent.com>
253 2001-01-20 Jim Meyering <meyering@lucent.com>
255 * configure.in: Remove jm_CHECK_ALL_TYPES.
256 Now it's invoked by jm_MACROS.
258 2001-01-17 Jim Meyering <meyering@lucent.com>
260 * src/sys2.h (case_GETOPT_VERSION_CHAR): Use PACKAGE, not GNU_PACKAGE.
261 * src/sync.c (main): Likewise.
262 * src/shred.c (PACKAGE): Likewise.
263 * src/dd.c (main): Likewise.
265 2001-01-14 Jim Meyering <meyering@lucent.com>
269 * src/shred.c (UINT_MAX_32_BITS): Define.
270 Use UINT_MAX_32_BITS in the cpp conditions that determine
271 the `word32' typedef. Using a literal `0xffffffff' failed with
274 * config.sub: Update from master repository.
275 * config.guess: Likewise.
277 2001-01-02 Volker Borchert <bt@teknon.de>
279 Work around a broken rename system call, e.g. on SunOS 4.1.1_U1,
280 that fails when the source path has a trailing slash.
281 * src/copy.h [RENAME_TRAILING_SLASH_BUG]: Use the rename wrapper.
282 * tests/mv/trailing-slash: Test whether the workaround works.
283 * tests/m4/Makefile.am (TESTS): Add trailing-slash.
285 2001-01-03 Alexandre Duret-Lutz <duret_g@epita.fr>
287 * po/Makefile.in.in (update-po): Merge po-files in temporary files
288 in the build directory, and update the source directory only when
289 the merged catalog differs from the original. This fixes the known
290 `make distcheck' failure due to `make update-po' being called
291 on up-to-date but read-only files.
293 2001-01-13 Jim Meyering <meyering@lucent.com>
295 * src/copy.c (same_file_ok): When moving a symlink onto itself,
296 don't remove the symlink. Reported by David Luyer as Debian bug#82089,
298 * tests/mv/into-self-4: New test for the above.
299 * tests/mv/Makefile.am (TESTS): Add into-self-4.
301 * tests/chmod/setgid: If `chmod g+s d' fails, then try to chgrp
302 to a group of which we're a member, then try the chmod again.
304 2001-01-11 Jim Meyering <meyering@lucent.com>
306 * depcomp: New version, from automake.
308 2001-01-10 Jim Meyering <meyering@lucent.com>
310 * src/copy.c (copy_internal): Add a comment.
311 Set *copy_into_self in the new code that detects that.
312 Make diagnostic more consistent: s/won't/will not/.
313 [move_mode, copy_into_self]: Give a diagnstic here, now that
314 we have the top_level_* globals. Remove the corresponding diagnostic
317 * src/mv.c (do_move): Remove diagnostic, now that copy.c issues it.
318 Set `fail' to nonzero in the primary `if (copy_into_self)' block
319 rather than in its own tiny one below.
321 * src/copy.c (copy_internal): Don't allow cp (or mv, when working
322 across a partition boundary) to overwrite a non-directory with a
323 directory. Reported by Michael J. Croghan.
324 * tests/cp/dir-vs-file: New test for the above.
325 * tests/cp/Makefile.am (TESTS): Add dir-vs-file.
327 2001-01-09 Jim Meyering <meyering@lucent.com>
329 Give a better diagnostic for `cp -R a a'.
330 * src/copy.c (top_level_src_path, top_level_dst_path): New globals.
331 (copy_internal): Use them.
333 * src/cp-hash.c [struct entry] (node): Describe how it's used,
334 now that we've overloaded it, in order to detect and diagnose
335 the copying-directory-into-self problem.
336 (new_file): Remove global.
337 (htab): Declare global to be static.
338 (remember_created): Insert file name instead of dummy pointer, so
339 that copy.c can use the just-created directory name to detect
340 the copying-directory-into-self problem.
341 * tests/cp/into-self: New test for the above.
342 * tests/cp/Makefile.am (TESTS): Add into-self.
344 2001-01-07 Jim Meyering <meyering@lucent.com>
346 * src/cp.c (usage): Split a string that was longer than 2048 bytes.
348 * doc/perm.texi: s/can not/cannot/
350 2001-01-07 Karl Eichwalder <ke@suse.de>
352 * src/chown.c (usage): Split long message string.
354 2001-01-07 Karl Eichwalder <ke@suse.de>
356 * src/ls.c (usage): Untabify.
358 * src/chgrp.c (parse_group): Normalize spelling.
360 2001-01-03 Paul Eggert <eggert@twinsun.com>
362 * NEWS: Document the planned --full-time change.
363 * doc/fileutils.texi: Likewise.
364 * NEWS: Document that time stamps depend on LC_TIME, not LC_MESSAGES.
366 2001-01-03 Paul Eggert <eggert@twinsun.com>
368 Use the more precise algorithm of GNU "make" to decide whether
369 a file is in the future, by looking at high-resolution time
373 (TIMESPEC_NS): New macro.
374 (current_time): Initialize to the minimum value.
375 (current_time_ns): New var.
376 (main): Do not bother to initialize current_time;
377 it's no longer needed.
378 (get_current_time): New function.
379 (print_long_format): Use it when a file appears to be in the future.
380 Get the nanoseconds of the file's time stamp, if available,
381 and use that to decide whether the file appears to be in the future.
383 * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): New macros.
385 2001-01-02 Paul Eggert <eggert@twinsun.com>
387 * src/ls.c (long_time_expected_width, print_long_format): Fix
388 bug: the initial byte passed to strftime wasn't initialized to
389 a nonzero value after the buffer was reallocated.
391 2001-01-02 Paul Eggert <eggert@twinsun.com>
393 Make ls -l compatible with POSIX, which requires that the
394 behavior of time formats must depend only on LC_TIME, not on
397 * po/Makefile.in.in (install-data-yes): If the package is
398 fileutils, install LC_TIME as an alias for LC_MESSAGES.
399 * src/sys2.h (dcgettext): New macro.
400 * src/ls.c (decode_switches): Use dcgettext with LC_TIME,
401 not plain gettext, to get the translations of time formats.
403 2001-01-02 Paul Eggert <eggert@twinsun.com>
405 * src/ls.c (long_time_expected_width): New function.
406 (print_long_format): Use it, so that we don't assume a
407 particular width for time stamps in an internationalized
410 2001-01-01 Paul Eggert <eggert@twinsun.com>
412 * doc/fileutils.texi, NEWS:
413 ls -l now reports the year for files even slightly in the future, as
414 POSIX requires. This helps warn users about clock skew problems.
416 * src/ls.c (print_long_format):
417 Report the year for files even slightly in the future.
418 Avoid overflow problems near Y2038 on 32-bit hosts.
419 To calculate "six months", take half the average Gregorian
422 2001-01-01 Jim Meyering <meyering@lucent.com>
424 * tests/chmod/Makefile.am (TESTS): Add setgid.
425 * tests/chmod/setgid: Test for chmod's existing behavior.
426 Based on a report from Paul Eggert.
428 2000-12-29 Paul Eggert <eggert@twinsun.com>
430 Clean up the terminology a tad: some directories were called "sticky"
431 when they were really setgid.
432 * tests/Makefile.am (EXTRA_DIST): sticky-check -> setgid-check
433 * tests/chmod/c-option, tests/cp/cp-parents, tests/mkdir/parents,
434 tests/mkdir/perm: Likewise.
435 * tests/setgid-check: File renamed from tests/sticky-check.
436 All uses of "sticky" changed to "setgid".
438 2000-12-31 Jim Meyering <meyering@lucent.com>
440 * tests/cp/Makefile.am (TESTS): Add deref-slink.
441 * tests/cp/deref-slink: New file. Test for the bug fixed by my
442 2000-12-28 change to copy.c.
444 2000-12-30 Paul Eggert <eggert@twinsun.com>
446 * src/ls.c: Improve performance by invoking gettext twice at the start,
447 instead of once for each file.
448 (long_time_format): New var.
449 (decode_switches): Initialize it, if format == long_format.
450 (print_long_format): Use it.
452 2000-12-30 Paul Eggert <eggert@twinsun.com>
454 * src/ls.c (print_long_format): Don't dump core if strftime
455 returns the empty string.
457 2000-12-30 Paul Eggert <eggert@twinsun.com>
459 * src/ls.c (gobble_file): If not using long format, don't
460 invoke acl; it's not needed.
462 2000-12-30 Jim Meyering <meyering@lucent.com>
464 Avoid an unnecessary `stat' when using --dereference.
465 * src/copy.c (same_file_ok): Use stat only if lstat reported that
466 the file was a symbolic link.
468 2000-12-29 Paul Eggert <eggert@twinsun.com>
470 * doc/perm.texi: append-only directories -> restricted deletion flag,
471 which is the term that POSIX d5 uses for this notion.
473 2000-12-28 Paul Eggert <eggert@twinsun.com>
475 * tests/group-names: Try /usr/xpg4/bin/id (Solaris 7) if plain
478 2000-12-28 Jim Meyering <meyering@lucent.com>
480 * tests/cp/cp-parents: Run sticky-check from just-created directory.
482 2000-12-28 Jim Meyering <meyering@lucent.com>
484 * src/copy.c (same_file_ok): Fix two typos from my 2000-09-03 change:
485 s/tmp_dst_sb/tmp_src_sb/.
487 2000-12-27 Paul Eggert <eggert@twinsun.com>
489 * tests/sticky-check: Turn off the working directory's sticky
490 bit, so that we don't have to worry about it later.
492 * src/copy.c (same_file_ok): Use a single auto var for
493 tmp_dst_sb, instead of two static vars. Likewise for
496 2000-12-26 Jim Meyering <meyering@lucent.com>
500 * Regenerate build/config framework to use automake-1.4b and
501 the latest CVS version autoconf.
503 * tests/mkdir/perm: Disable the test if the working directory has
505 * tests/cp/cp-parents: Likewise.
506 Reported by Nelson Beebe.
508 2000-12-25 Jim Meyering <meyering@lucent.com>
510 Clean-up to avoid warnings from Irix's c89.
512 * src/remove.c (hash_compare_active_dir_ents): Return explicit `true'
513 or `false', rather than relying on implicit int-to-enum cast.
514 * src/copy.c (same_file_ok): Remove declaration and set of unused
515 variables: src_sb_no_link, dst_sb_no_link.
516 * src/ls.c (extract_dirs_from_files): Remove unused variable.
517 Reported by Nelson Beebe.
519 * src/ls.c (gobble_file): Move decl of local, val, into the scope
522 2000-12-24 Jim Meyering <meyering@lucent.com>
524 For both ln and install, when using `--backup=simple --suffix=S',
525 the suffix `S' wasn't used.
527 * src/ln.c (main): Actually use the local variable,
528 `backup_suffix_string'.
529 * src/install.c (main): Likewise.
530 Nelson Beebe reported the unused variables.
531 * tests/ln/misc: Add a test for this (for all of cp, mv, ln, install).
533 * man/help2man: Update to version 1.24.
535 2000-12-22 Jim Meyering <meyering@lucent.com>
539 * src/shred.c (isaac_seed_machdep) [_ARCH_PPC]: Disable the code
540 that would use the PPC mfspr `asm' code. Suggestion from Michael Stone.
542 2000-12-19 Jim Meyering <meyering@lucent.com>
544 * doc/fileutils.texi: Use `ref_file' in place of `file' to make
545 descriptions of the various --reference=... options clearer.
547 2000-12-17 Jim Meyering <meyering@lucent.com>
549 * doc/texinfo.tex: Update from master repository.
550 * config.sub: Likewise.
551 * config.guess: Likewise.
553 2000-12-16 Jim Meyering <meyering@lucent.com>
555 * src/chown-core.c (uint_to_string): New function.
556 (uid_to_name): Use it.
557 (gid_to_name): Use it.
558 Rename locals, user/group, to uid/gid.
560 * src/chown-core.h (enum Change_status): Start with 1.
562 * src/chown.c (main): Rename locals, user/group, to uid/gid.
563 * src/chgrp.c (main): Rename local, group, to gid.
565 * tests/group-names: New file.
566 * tests/Makefile.am (EXTRA_DIST): Add group-names.
567 * tests/chgrp/basic: Use group-names.
568 * tests/chgrp/deref: Likewise.
569 * tests/chgrp/recurse: Likewise.
571 * tests/chgrp/basic: Don't assume that creating a file gives it
574 * tests/chgrp/Makefile.am (TESTS): Add recurse.
576 2000-12-15 Jim Meyering <meyering@lucent.com>
578 * src/chown-core.h [enum Dereference_symlink] (dereference): Rename
579 from change_symlinks.
580 * src/chown-core.c: Declare lstat.
581 Rename change_symlinks member to `dereference' and use the DEREF_*
583 (describe_change): Merge the chgrp and chown switch statements.
584 Use xmalloc to form the `user:group' string.
585 (change_file_owner): Record (and later, use) is_symlink and is_directory
586 from the lstat stats, in order to control whether we operate on symlinks
587 and whether (with -R) we traverse symlinks to directories.
588 When dereferencing, use open/fchown (rather than chown) on symlinks.
589 * src/chown.c (main): Reflect renaming: s/dereference/change_symlinks/.
590 * src/chgrp.c (main): Likewise.
592 * src/chown-core.c (describe_change): Use `:' (not `.') to separate the
593 username and group in messages evoked by the --verbose and --changes
596 2000-12-09 Jim Meyering <meyering@lucent.com>
598 * src/Makefile.am (noinst_HEADERS): Add chown-core.h.
599 (chown_SOURCES): Define.
600 (chgrp_SOURCES): Define.
602 * src/chgrp.c: Include "chown-core.h".
603 [enum Change_status, enum Verbosity]: Remove declarations.
604 Remove decls of globals that are now part of struct Chown_option.
605 Remove decl of xstat.
606 (describe_change): Remove function.
607 (change_file_group): Likewise.
608 (change_dir_group): Likewise.
609 (parse_group): Don't set global, groupname, here...
610 (main): ... instead, initialize `chopt.group_name' here.
611 Initialize chopt and update uses of the now-members.
612 Set group_name also when it's obtained via a --reference=FILE option.
613 Call change_file_owner (with -1 for uids), not change_file_group.
615 * src/chown.c: Don't include pwd.h or grp.h -- no longer needed.
616 Include "chown-core.h".
617 [enum Change_status, enum Verbosity]: Remove declarations.
618 Remove decls of globals that are now part of struct Chown_option.
619 (describe_change): Remove function.
620 (change_file_owner): Likewise.
621 (change_dir_owner): Likewise.
622 (main): Initialize chopt and update uses of the now-members.
623 Set user_name and group_name also when they're obtained via a
624 --reference=FILE option.
625 Pass `chopt' to change_file_owner.
627 * src/chown-core.c: Include <pwd.h>, <grp.h>, and "xalloc.h".
628 [!_POSIX_VERSION]: Declare getgrnam and getgrgid.
629 (gid_to_name): New function.
630 (uid_to_name): Likewise.
631 (chopt_free): Likewise.
633 Factor out code that's common to chgrp.c and chown.c.
634 * src/chown-core.h: New file.
635 * src/chown-core.c (chopt_init): New function.
636 (describe_change): Extracted/combined from chgrp.c and chown.c.
637 (change_dir_owner): Likewise.
638 (change_file_owner): Likewise.
639 * po/POTFILES.in: Add src/chown-core.c.
641 * configure.in (AC_OUTPUT): Add tests/chgrp/Makefile.
642 * tests/Makefile.am (SUBDIRS): Add chgrp.
643 * tests/chgrp: New directory.
644 * tests/chgrp/basic: New test.
645 * tests/chgrp/deref: Likewise.
646 * tests/chgrp/Makefile.am: New file.
648 * src/chown.c (change_file_owner): Restore special file permission
649 bits, since calling chown resets them on some systems.
650 Reported by Matt Perry.
652 2000-12-08 Andreas Schwab <schwab@suse.de>
654 * tests/mv/mv-special-1: Don't make the success of the test depend
655 on the order in which directory entries are processed.
657 2000-12-03 Jim Meyering <meyering@lucent.com>
659 * src/ls.c (gobble_file) [USE_ACL]: Set have_acl member unconditionally
660 to avoid uninitialized memory reference via FILE_HAS_ACL.
662 * Makefile.maint (alpha): Use rsync rather than scp, so the destination
663 file is created only after the successful completion of the copy.
665 2000-12-02 Jim Meyering <meyering@lucent.com>
667 * tests/ls/Makefile.am (TESTS): Add follow-slink.
668 * tests/ls/follow-slink: New file.
670 2000-12-01 Paul Eggert <eggert@twinsun.com>
672 * src/ls.c (gobble_file): Do not fall back on lstat if stat
673 fails; POSIX.2 does not allow this. Invoke acl only on
674 non-symlinks, and only if lstat or stat succeeds.
676 2000-12-02 Jim Meyering <meyering@lucent.com>
678 * configure: Regenerate using the very latest version (in CVS) of
681 * tests/dd/skip-seek: Remove test #2, now that support for the
683 * tests/dd/Makefile.am (TESTS): Add skip-seek2
684 * tests/dd/skip-seek2: New file.
686 2000-12-01 Paul Eggert <eggert@twinsun.com>
688 * src/dd.c (skip, dd_copy): Use ssize_t to store result of
689 safe_read, to avoid overflow e.g. on 64-bit Solaris sparc.
690 (dd_copy): Remove unnecessary cast.
692 2000-12-01 Paul Eggert <eggert@twinsun.com>
694 * doc/fileutils.texi: Remove B suffix. Document how to have
695 the desired effect without it.
697 * src/dd.c: Undo most of the changes since 2000-11-24, since we've
698 documented a standard way to do it.
699 (skip_bytes, seek_bytes): Remove.
700 (usage): Remove B suffix.
701 (scanargs, skip, dd_copy, main): Remove support for B suffix.
703 2000-11-28 Jim Meyering <meyering@lucent.com>
705 * src/mkdir.c (main): Remove any trailing slash unconditionally.
706 Reported by Volker Borchert.
707 * tests/mkdir/t-slash: Add a test for this.
709 2000-11-27 Jim Meyering <meyering@lucent.com>
713 * tests/touch/no-rights: Use touch with `-d tomorrow' to avoid a
716 * tests/Fetish.pm (_compare_files): New function.
717 (_process_file_spec): Likewise.
718 (_at_replace): Likewise.
719 (run_tests): Support new keywords, AUX and CMP and associated
720 syntax and semantics.
722 * config.sub: Likewise.
723 * config.guess: Likewise.
725 2000-11-26 Jim Meyering <meyering@lucent.com>
727 * src/dd.c (skip): Perform the `records < blocksize' test
728 at the top of the loop, not at the bottom.
730 2000-11-26 Paul Eggert <eggert@twinsun.com>
732 * src/dd.c (skip): New arg COUNT_BYTES. Read with BLOCKSIZE
733 bytes, but consider RECORDS to be a byte count if COUNT_BYTES
736 2000-11-25 Paul Eggert <eggert@twinsun.com>
738 * doc/fileutils.texi: Document seek=nB and skip=nB.
740 * src/dd.c (skip_bytes, seek_bytes): Now booleans, not counts.
741 (seek_records): Renamed from seek_record, for consistency with
742 skip_records and max_records. All uses changed.
744 (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB
746 (enum Unit, Unit): Remove.
747 (skip, dd_copy, main): Undo most recent change.
748 (dd_copy, main): Pass blocksize of 1 as appropriate when
749 skip_bytes or seek_bytes is nonzero.
750 (main): Rework ftruncate failure diagnostic to always use byte count.
752 2000-11-25 Jim Meyering <meyering@lucent.com>
754 * src/dd.c: Add new options, bskip and bseek.
755 Based on a patch from Chris Sylvain.
756 * tests/dd/skip-seek: New tests.
757 * tests/dd/Makefile.am (TESTS): Add skip-seek.
759 2000-11-24 Paul Eggert <eggert@green.twinsun.com>
761 * src/dd.c (S_TYPEISSHM): New macro.
762 (main): Report failed fstat.
763 Complain only when ftruncate fails on a regular file,
764 a directory, or a shared memory object.
766 2000-11-24 Jim Meyering <meyering@lucent.com>
768 * src/dd.c: Declare a pointer parameters to be `const' as appropriate.
770 * src/dd.c (main): Use ftruncate only on regular files.
771 Based on a patch from Michael Stone.
772 Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
774 2000-11-23 Jim Meyering <meyering@lucent.com>
776 * src/df.c (show_point): Before accepting an entry as a match, make
777 sure that the mount directory exists and has the required device number.
778 Before, e.g., `df /floppy' would mistakenly report on the root
779 partition if /floppy were not listed in /etc/mtab but / was.
780 Patch from Eirik Fuller (http://bugs.debian.org/76923).
782 * src/chmod.c (mode_changed): New function.
783 (change_file_mode): Use it to determine accurately when -c should
784 make chmod announce there's been a change.
785 Based on a patch from Michael Stone.
786 Reported by Kai Henningsen as Debian bug #77349.
788 * tests/chmod/c-option: New test for the above fix.
789 * tests/chmod/Makefile.am (TESTS): Add c-option
791 * tests/sticky-check: New file. Factored out of tests/mkdir/parents.
792 * tests/Makefile.am (EXTRA_DIST): Add sticky-check.
793 * tests/mkdir/parents: Source sticky-check instead of open-coding it.
795 2000-11-19 Jim Meyering <meyering@lucent.com>
797 * tests/chmod/equal-x: Update to use its own directory, and better trap.
799 2000-11-18 Paul Eggert <eggert@twinsun.com>
801 * src/ls.c (BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION,
802 INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION,
803 SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum
804 values, to ensure that option values can't collide with chars.
805 (long_options, decode_switches): Use them.
807 2000-11-18 Paul Eggert <eggert@twinsun.com>
809 * src/sys2.h (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum
810 constants rather than macros. Use values that cannot conflict
811 with C characters or with -1, CHAR_MAX + 1, etc.
813 2000-11-18 Jim Meyering <meyering@lucent.com>
815 * src/du.c (count_entry): Don't omit the size of a directory entry
816 merely because we couldn't `chdir' into it. That would give subtly
817 different results in some cases. Reported by Mattias Wadenstein
820 * src/ls.c: Revert change of 2000-11-11. It inadvertently change
821 the output format of `ls -l --full-time'.
823 * src/mkdir.c (main): When failing to create a directory, give only
824 one diagnostic, not two. Reported by Volker Borchert.
826 * src/mkdir.c (main): With --parents, remove any trailing slashes
827 from the argument to the final mkdir call. Required for NetBSD.
828 Reported by Volker Borchert.
829 * tests/mkdir/t-slash: New test for this.
830 * tests/mkdir/Makefile.am (TESTS): Add t-slash.
832 * tests/mv/mv-special-1: Create and `cd' into temporary directory
833 before anything else. Reported by Volker Borchert.
835 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
836 very latest version (in CVS) of autoconf.
838 2000-11-17 Jim Meyering <meyering@lucent.com>
840 * Makefile.am (.NOTPARALLEL): Remove target.
841 * GNUmakefile (.NOTPARALLEL): ... put it here instead, since this
842 file is common to these packages: fileutils, sh-utils, textutils.
844 * Makefile.am (.NOTPARALLEL): New target. Prevent unwanted parallelism.
845 Suggestion from Ulrich Drepper.
846 * po/Makefile.in.in (Makefile): Likewise.
848 * Makefile.maint (sha1): Define.
849 (announcement): Include SHA1 digest of .tar.gz file.
851 2000-11-14 Jim Meyering <meyering@lucent.com>
853 * tests/mkdir/perm: Add an `echo' so that the input to the sed command
854 is NL-terminated. Otherwise, Solaris' /bin/sed generates no output.
855 Reported by Vin Shelton.
857 2000-11-13 Paul Eggert <eggert@twinsun.com>
859 * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
860 be tested with #ifdef, not with #if.
862 2000-11-12 Jim Meyering <meyering@lucent.com>
864 * src/ls.c (print_long_format): Remove obsolete comment.
867 * doc/texinfo.tex: Update from master repository.
869 2000-11-11 Paul Eggert <eggert@sic.twinsun.com>
871 * src/ls.c (<langinfo.h>): Include if HAVE_LANGINFO_H.
872 (DATE_FMT_LANGINFO): New macro, taken from sh-utils/src/date.c.
873 (print_long_format): Use it to determine "date" format.
874 Do not wrap "%b %e %Y" and "%b %e %H:%M" in _(), as it results in
875 incorrect behavior when LC_ALL is unset, LC_TIME is "C", and
876 LC_MESSAGES or LANG is set to something disagreeing with the POSIX
879 2000-11-11 Jim Meyering <meyering@lucent.com>
883 * Makefile.maint (GZIP_ENV): Define to --no-name, so the timestamp
884 is not included in the .tar.gz file.
886 * tests/mkdir/perm (tests): Use `empty' (instead of just blanks) to
887 indicate no `-m' option. Using just blanks wasn't portable to
888 Solaris2.5.1's /bin/sh.
890 * tests/mkdir/perm: Don't put a newline in IFS; that's not portable to
891 NetBSD's /bin/sh. Instead, filter newlines and leading/trailing blanks
892 out of `tests' before the `set -'.
894 * Makefile.maint (announcement): Limit depth of ChangeLog `find' to 2.
896 * src/ls.c (print_long_format): Wrap the `--full-time' date format
897 string in _(...), so it too may be internationalized.
898 Suggestion from Jungshik Shin.
900 2000-11-10 Jim Meyering <meyering@lucent.com>
902 * src/touch.c (main): Interpret a lone numeric argument of 8 or 10
903 digits as a file name, rather than as a date/time in the obsolescent
904 `MMDDhhmm[YY]' format. Reported by Wenjun Zheng.
905 * tests/touch/obsolescent: New test for this.
906 * tests/touch/Makefile.am (TESTS): Add obsolescent.
908 2000-11-06 Jim Meyering <meyering@lucent.com>
910 * tests/cp/cp-parents: Move mkdir tests into ../mkdir.
912 * doc/fileutils.texi: Use Free Documentation Licence.
913 Change GNU to @sc{gnu} in many places.
915 * doc/texinfo.tex: Update from master repository.
916 * config.sub: Likewise.
917 * config.guess: Likewise.
918 * man/help2man: Update from latest version: 1.23.
920 * src/mkdir.c: Do not set the permissions of the final directory
921 component if it was not just created.
922 Based on a patch from Volker Borchert.
924 * tests/rwx-to-mode: New file.
925 * tests/Makefile.am (EXTRA_DIST): Add rwx-to-mode.
926 * tests/mkdir/parents: New test for the above mkdir.c fix.
927 * tests/mkdir/Makefile.am (TESTS): Add parents.
928 (TESTS_ENVIRONMENT): Define srcdir=$(srcdir).
930 2000-11-02 Won-kyu Park <wkpark@chem.skku.ac.kr>
932 * src/df.c (print_header): Mark strings for translation.
934 2000-11-05 Jim Meyering <meyering@lucent.com>
938 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
939 very latest version (in CVS) of autoconf.
941 * src/mkdir.c (main): Use make_dir instead of using mkdir directly.
942 Diagnose as failure when mkdir tries to create (without the
943 --parent (-p) option) a directory that already exists.
944 * tests/cp/cp-parents: Add a test for the above fix.
946 * tests/mv/mv-special-1: Clean up this test.
948 2000-11-01 Jim Meyering <meyering@lucent.com>
952 * src/chmod.c (main): Better diagnostics.
954 2000-10-31 Jim Meyering <meyering@lucent.com>
956 * tests/lang-default: Add all the internationalization-related
957 variable names autoconf uses. Set and export them in a loop.
959 `mkdir -p' would create parent directories with permissions
960 that did not account for the umask. [introduced with the
961 2000-09-30 change that became part of fileutils-4.0.28]
962 * src/mkdir.c: Include dirname.h.
963 Compute the parent directory `mode' unconditionally, effectively
964 as `$(umask -S),u+wx'.
965 Use make_path to create only the parent directories, thus using
966 the same code, both with and without -p, to create the final
967 component in each file name. Reported by Bob Proulx.
969 Add tests for the above fix.
970 * tests/cp/cp-parents: Add some permission tests.
971 * tests/mkdir/perm: Fix the test so it actually does something.
972 Run each test also with mkdir's `-p' option and check permissions
973 on the parent directories.
975 2000-10-23 Paul Eggert <eggert@twinsun.com>
977 * doc/getdate.texi: Use @sc where appropriate. Document the
978 ranges of supported times more precisely. Correct menu
979 spacing. Document old Latin 12m/12pm tradition. Remove list
980 of alphabetic time zone names, as it wasn't correct and people
981 shouldn't be relying on it anyway. Relative items also
982 account for non-DST adjustments. Fix some misspellings.
984 2000-10-30 Jim Meyering <meyering@lucent.com>
986 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
987 very latest version (in CVS) of autoconf.
989 2000-10-29 Jim Meyering <meyering@lucent.com>
993 * src/cp.c (do_copy): When constructing dst_path for use with the
994 --parents option, first remove any trailing slashes from the command
995 line argument. Otherwise, tests/cp/cp-parent would fail on NetBSD.
997 * tests/cp/cp-parents: Add a test.
999 * src/ls.c (DT_INIT): Define.
1000 [enum filetype]: Remove the #ifdef, and use DT_INIT on the
1001 initializers instead. `unknown' was undefined for some systems.
1002 Reported by John David Anglin.
1004 * tests/lang-default (LC_COLLATE): Set it to the empty string and
1005 export it. Otherwise, tests/cp/cp-mv-backup would fail e.g., when
1006 LC_COLLATE was set to en. Reported by Vin Shelton.
1008 2000-10-28 Jim Meyering <meyering@lucent.com>
1010 * src/ls.c (main): In call to gobble_file with `"."', use `directory'
1011 as the type, not `unknown'.
1012 [enum filetype] (arg_directory): Rather than `100', use
1013 a number that should never conflict with another DT_* value.
1014 From Ulrich Drepper.
1018 Make `ls' a lot more efficient on systems (e.g., linux-2.4.*)
1019 that store file type information in directory entries.
1021 * src/ls.c [enum filetype] (unknown):
1022 Add members (as yet unused):
1023 (HAVE_STRUCT_DIRENT_D_TYPE): Define.
1024 (format_needs_type): New global.
1026 (print_dir): Set `type' from directory entry, if possible.
1027 (gobble_file): Add a parameter, TYPE.
1028 Stat the file only if its type is unknown and we need the type.
1029 Patch from Ulrich Drepper.
1031 Shred can now determine the size of a block devices (e.g. /dev/fd0)
1032 by writing until a write operation fails.
1034 * src/shred.c: Include assert.h.
1035 (fillrand): Add a parameter, size_max.
1038 (dopass): Break out of the `for (;;)' loop if size < offset.
1039 That can happen now that dopass is called with SIZE == -1.
1040 (do_wipefd): Accept a length of zero only for a regular file.
1041 If lseek fails or returns 0 for a non-regular file, let dopass
1042 determine the length.
1043 Inspired by a patch from Alan Iwi.
1045 * tests/Makefile.am (EXTRA_DIST): Add lang-default.
1047 * tests/rm/hash: Factor out the expensive-test-checking code, ...
1048 * tests/expensive: ... into this new file.
1049 * tests/cp/perm: Disable this test by default; it's expensive.
1050 Mark this as an expensive test.
1051 * tests/Makefile.am (EXTRA_DIST): Add expensive.
1053 * doc/fileutils.texi (shred invocation): Give two examples.
1055 2000-10-26 Jim Meyering <meyering@lucent.com>
1057 * doc/getdate.texi (Authors of getdate): Add Paul Eggert.
1059 2000-10-23 Jim Meyering <meyering@lucent.com>
1061 * Makefile.am (EXTRA_DIST): Add .prev-version.
1063 2000-10-22 Jim Meyering <meyering@lucent.com>
1065 * src/cp.c (make_path_private): Add a FIXME comment.
1067 * tests/lang-default: New file. Set LANG, LC_ALL, and LANGUAGE to ''
1068 (rather than to `C') and export them into the environment.
1069 Suggestion from Bruno Haible.
1071 * tests/cp/backup-is-src: Source lang-default rather than open-coding
1072 the setting/exporting of LANG, LC_ALL, and LANGUAGE.
1073 * tests/cp/cp-mv-backup: Likewise.
1074 * tests/cp/same-file: Likewise.
1075 * tests/cp/slink-2-slink: Likewise.
1076 * tests/cp/symlink-slash: Likewise.
1077 * tests/ln/sf-1: Likewise.
1078 * tests/ls/symlink-slash: Likewise.
1079 * tests/ls/time-1: Likewise.
1080 * tests/mv/backup-is-src: Likewise.
1081 * tests/mv/diag: Likewise.
1082 * tests/mv/force: Likewise.
1083 * tests/mv/hard-link-1: Likewise.
1084 * tests/mv/i-2: Likewise.
1085 * tests/mv/into-self: Likewise.
1086 * tests/mv/into-self-2: Likewise.
1087 * tests/mv/into-self-3: Likewise.
1088 * tests/mv/mv-special-1: Likewise.
1089 * tests/mv/part-symlink: Likewise.
1090 * tests/mv/partition-perm: Likewise.
1091 * tests/rm/r-1: Likewise.
1092 * tests/rm/r-2: Likewise.
1094 2000-10-21 Jim Meyering <meyering@lucent.com>
1096 * tests/cp/cp-parents: New test.
1097 * tests/cp/Makefile.am (TESTS): Add cp-parents;
1099 2000-10-19 Jim Meyering <meyering@lucent.com>
1101 * doc/texinfo.tex: Update from master repository.
1102 * config.sub: Likewise.
1103 * config.guess: Likewise.
1104 * depcomp: Likewise.
1106 2000-10-18 Jim Meyering <meyering@lucent.com>
1108 * tests/mv/part-symlink: Make sure the programs use C-locale formats
1109 and translations. Bruno Haible reported that this test would fail
1110 when using other locales, because ls printed a translation of `total'.
1112 2000-10-16 Jim Meyering <meyering@lucent.com>
1114 * src/ls.c (print_long_format): Wrap date format strings in _(...)
1115 so they may be internationalized. Suggestion from Christian Rose.
1117 2000-10-13 Jim Meyering <meyering@lucent.com>
1119 * src/mv.c (rm_option_init): Remove FIXME-maybe comment.
1121 2000-09-30 Jim Meyering <meyering@lucent.com>
1123 * tests/du/two-args: Update to use newer template.
1125 * src/install.c: Remove big, option-describing comment block.
1126 (main): Rename local `symbolic_mode' to `specified_mode'.
1128 * src/mkdir.c (main): Don't set the umask to 0 and hand-apply
1129 the previously-set umask unconditionally. Do that only when a
1130 MODE has been specified. Otherwise, call mkdir with the full
1131 creation mask (0777 or 0666) and let the kernel apply the umask.
1132 The difference shows up only on file systems with ACL support
1133 when the containing directory has a default ACL.
1134 Patch by Andreas Gruenbacher.
1135 (main): Rename local `symbolic_mode' to `specified_mode'.
1136 * src/mknod.c (main): Likewise (but `call mknod', not mkdir).
1137 Also, when MODE is specified, call chmod to ensure that the
1138 permission bits are set as specified even when the containing
1139 directory has a default ACL.
1140 Patch by Andreas Gruenbacher.
1141 * src/mkfifo.c (main): Likewise (but `call mkfifo', not mkdir).
1142 Patch by Andreas Gruenbacher.
1144 * tests/mkdir/perm: New test.
1145 * tests/mkdir/Makefile.am (TESTS): Add perm.
1147 2000-08-17 Andreas Gruenbacher <ag@bestbits.at>
1149 * src/chmod.c (change_file_mode): Perform the chmod even if the
1150 file mode permission bits are the same as those that should be set.
1151 Omitting the chmod call would be alright with minimal 1003.1e DS17
1152 ACLs, but eventually there may be other permissions in addition to
1153 rwx. E.g., add and delete for directories, and something analogous
1154 to NT's take ownership permission.
1156 2000-09-25 Jim Meyering <meyering@lucent.com>
1158 * tests/cp/same-file: Don't use `diff -u'. It's not portable.
1159 Reported by Christian Krackowizer.
1160 * tests/cp/same-file: Run `diff -c' only if cmp finds a difference.
1161 * tests/mv/part-symlink: Likewise. And clean up.
1163 `shred --exact file1 file2' wouldn't touch `file1'
1164 * src/shred.c (long_opts): --exact doesn't take an argument.
1165 Reported by Alan Iwi.
1166 * tests/shred/exact: New test for this.
1167 * tests/shred/Makefile.am (TESTS): Add exact.
1169 * Makefile.maint (PREV_VERSION): Get the value from a file, rather
1170 than trying to derive it from the current version number.
1171 This is much more robust.
1172 (alpha): Record just-released version number in `.prev-version',
1173 and commit (post-tag).
1177 2000-09-24 Paul Eggert <eggert@twinsun.com>
1179 * doc/fileutils.texi: Update to more closely match changes in 4.0z.
1180 * src/cp.c (usage): Match revised documentation better.
1182 2000-09-24 Jim Meyering <meyering@lucent.com>
1184 * src/cp.c (main): Tweak a relatively new diagnostic.
1186 2000-09-23 Jim Meyering <meyering@lucent.com>
1188 * tests/ls/time-1: Output more information when a test fails.
1190 2000-09-22 Jim Meyering <meyering@lucent.com>
1192 * src/install.c (cp_option_init): Once again make it so install always
1193 unlinks an existing destination before trying to open it for writing.
1194 Otherwise, installing onto a running shared library would make the
1195 running program malfunction.
1196 Reported by Dan Pascu via Michael Stone.
1198 * src/mv.c (do_move): Moving a directory specified with a trailing
1199 slash from one partition to another, and giving it a different
1200 name at the destination would cause mv to get a failed assertion.
1201 Reported by Michael Stone.
1202 (strip_trailing_slashes_2): Move function definition to precede
1204 * tests/mv/part-rename: New test for the above fix.
1205 * tests/mv/Makefile.am (TESTS): Add part-rename.
1207 * src/copy.c (copy_internal): Don't try to unlink directories when
1208 using --remove-dest with -R.
1209 * tests/cp/dir-rm-dest: New test for the above fix.
1210 * tests/cp/Makefile.am (TESTS): Add dir-rm-dest.
1212 2000-09-19 Jim Meyering <meyering@lucent.com>
1214 * doc/fileutils.texi (cp invocation): Describe how --force works.
1215 Update description of -P (soon to change meaning to conform w/POSIX).
1216 Describe --remove-destination.
1218 * src/cp.c (main): When used with --force, each of the --link and
1219 --symbolic-link options now implies --remove-destination.
1220 Reported by Miles Bader via Mike Stone.
1221 * tests/cp/link: New file. Test for the above fix.
1222 * tests/cp/same-file: Adjust for this change in behavior.
1224 2000-09-15 Volker Borchert <bt@teknon.de>
1226 * tests/Makefile.am (check-root, root-hint): New targets.
1227 (check-recursive): Depend on root-hint.
1228 * Makefile.am (check-root): New target.
1230 2000-09-16 Jim Meyering <meyering@lucent.com>
1232 * doc/perm.texi (Changing Special Permissions): Remove this statement:
1233 ``a' in the USERS part of a symbolic mode does not cause the special
1234 permissions to be affected'... It doesn't reflect what the code does
1235 and isn't required by POSIX. Reported by aldomel@ix.netcom.com via
1238 2000-09-15 Jim Meyering <meyering@lucent.com>
1240 * config.sub: Update from master repository.
1242 2000-09-10 Jim Meyering <meyering@lucent.com>
1244 * tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure
1245 that `ls' sorts the same way for everyone. Reported by Vin Shelton.
1247 * Makefile.maint (b_host): Use freefriends.org, not tug.org.
1249 2000-09-09 Jim Meyering <meyering@lucent.com>
1251 * Makefile.maint (announcement): Use a stricter regexp for the
1256 * tests/cp/special-bits: New file.
1257 * tests/cp/Makefile.am (TESTS): Add special-bits.
1258 (TESTS_ENVIRONMENT): Propagate $MAKE into environment, for special-bits.
1260 * src/copy.c (SAME_OWNER, SAME_GROUP, SAME_OWNER_AND_GROUP): Define.
1261 (copy_internal): Avoid calling chown if we know it's not necessary.
1263 * src/copy.c (copy_internal): Call chmod also if we've made the
1264 preceding chown call and we're supposed to preserve some special
1265 permission bit(s) that would have been reset by chown.
1266 Reported by Greg Louis.
1268 2000-09-08 Jim Meyering <meyering@lucent.com>
1270 * src/mkdir.c (S_IRWXUGO): Remove definition.
1271 * src/sys2.h (S_IRWXUGO): Define here, instead.
1273 2000-09-07 Jim Meyering <meyering@lucent.com>
1275 * doc/texinfo.tex: Update from master repository.
1276 * config.sub: Likewise.
1277 * config.guess: Likewise.
1279 2000-09-05 Jim Meyering <meyering@lucent.com>
1281 * tests/mv/part-symlink: Redirect stdout to stderr before trying to
1282 remove the temp directory. Otherwise, the `rm -rf' would get an
1283 error because the output file wouldn't be closed and the directory
1284 wouldn't be `empty'.
1285 * tests/cp/same-file: Likewise.
1287 * tests/cp/same-file: Remove the `cp -dl sl1 sl2' case,
1288 since it's no longer portable (hard link to a symlink).
1289 Likewise for the `cp -bdl symlink foo' case.
1291 * config.guess: Update from master repository.
1293 2000-09-04 Jim Meyering <meyering@lucent.com>
1295 * src/cp.c: Move declaractions of lstat, stat, and rpl_lstat
1296 as well as the definition of lstat from here...
1297 * src/copy.h: ...to here.
1298 * src/copy.c: Remove declaration of lstat, now that it's in copy.h.
1300 * tests/mv/force: mv's --force (-f) option is no longer needed for
1301 this test, now that all it does is cancel --interactive (-i).
1303 * tests/cp/same-file: Add new tests using cp's --rem option.
1304 Reflect the fact that cp's -f option no longer causes cp to remove the
1305 destination file before trying to open it.
1306 Reflect the fact that `cp -bdl' now makes a backup when copying a
1307 symlink onto the file it points to (FIXME: look into this, and why
1308 cp -bl does *not* do so).
1310 * src/ln.c (do_link): Tweak diagnostics.
1312 2000-09-03 Jim Meyering <meyering@lucent.com>
1314 * src/install.c (cp_option_init): Initialize new members.
1316 * src/cp.c (enum): Add UNLINK_DEST_BEFORE_OPENING.
1317 [long_options]: Add an entry for --remove-destination.
1318 (usage): Describe --remove-destination.
1319 (do_copy): Use unlink_dest_after_failed_open member, not `force.'
1320 (cp_option_init): Initialize new members.
1321 (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
1323 * src/mv.c: Remove obsolete comment block.
1324 (cp_option_init): Initialize new members.
1325 (usage): Reflect the fact that --force (-f) relates only to whether
1327 (main): Remove uses of old `force' option member.
1329 * src/install.c (cp_option_init): Reflect
1331 `force' no longer means unlink-dest-before-opening
1332 * src/copy.h (struct cp_options) [force]: Remove member.
1333 [unlink_dest_before_opening]: Add member. `cp -f' and `mv -f' used to
1334 do this. Now, you must use `cp --remove-destination' to get this
1335 behavior. Now, `cp -f' and `mv -f' work as required by POSIX.
1336 [unlink_dest_after_failed_open]: Add member.
1337 Paul Eggert reported that `cp -f' removes an existing destination
1338 file unconditionally, and that is contrary to POSIX.
1340 * src/copy.c (same_file_ok): New function, extracted from copy_internal,
1342 (copy_internal): Unlink destination file when unlink_dest_before_opening
1343 option is set, and when the source is neither a regular file nor a
1346 * tests/mv/Makefile.am (TESTS): Add part-symlink.
1348 * src/ls.c: Use strcoll (not strcmp) when comparing file names.
1349 Suggestion from Ulrich Drepper.
1351 2000-08-27 Jim Meyering <meyering@lucent.com>
1353 * src/copy.c (copy_reg): New parameters: X and NEW_DST.
1354 Remove the SPARSE_MODE parameter. Update caller.
1355 Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when copying
1356 a regular source file and the destination file exists; upon failure,
1357 unlink that existing file, then open again, but with O_WRONLY|O_CREAT.
1358 (copy_internal): `force' in not related to interactive; remove
1360 Remove the entire `else if (x->force)' block; justifying
1361 removal of the non-directory part is easy: POSIX requires we try
1362 to open an existing regular file, so we can't unlink it beforehand.
1363 The part that changes the mode on a directory to allow overwriting
1366 * src/copy.c (copy_reg): Rename two goto labels.
1367 (copy_internal): Set `new_dst' when the move_mode rename fails,
1368 since we then unlink the destination file.
1370 * src/cp.c (usage): --force is independent of --interactive.
1372 2000-08-24 Jim Meyering <meyering@lucent.com>
1374 Put back the kluge. It's necessary after all.
1375 * src/dd.c (buggy_lseek_support): New function.
1377 Frank Adler reported that although _llseek returns 0, lseek
1378 erroneously returns an offset suggesting the operation succeeded
1379 even though it fails.
1381 * install-sh: Double quote as needed, to protect against arguments
1382 containing spaces or shell metacharacters. Reported by Bruno Haible.
1384 2000-08-23 Jim Meyering <meyering@lucent.com>
1386 * tests/dd/not-rewound: New test, for the SEEK_CUR vs. SEEK_SET part
1387 of the last change. Based on Paul's example.
1388 * tests/dd/Makefile.am (TESTS): Add not-rewound.
1390 2000-08-22 Paul Eggert <eggert@twinsun.com>
1393 Assume lseek failed if it returned zero, since a zero return is
1394 impossible and some buggy drivers return zero.
1396 Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the
1397 file descriptor is not currently rewound.
1399 2000-08-23 Jim Meyering <meyering@lucent.com>
1401 * src/dd.c: Back out my last change. Paul's (above) is better.
1403 2000-08-22 Jim Meyering <meyering@lucent.com>
1405 Don't even try to use lseek on character devices.
1406 * src/dd.c (buggy_lseek_support): New function.
1408 Reported by Martin Gallant via Michael Stone.
1410 2000-08-21 Jim Meyering <meyering@lucent.com>
1412 * tests/cp/same-file: Clean up traps. Create files in a subdir.
1414 * install-sh (oIFS): Remove unmatched double quote, left over from
1415 my 2000-08-12 change. From J. David Anglin.
1417 * Makefile.maint (wget-update): Get the latest version of depcomp.
1419 * depcomp: Update from automake.
1421 2000-08-20 Jim Meyering <meyering@lucent.com>
1425 Add support for cp's new POSIX-mandated -H and -L options.
1426 * src/copy.h (enum Dereference_symlink): Define.
1427 (struct cp_options) [dereference]: Change type to Dereference_symlink.
1428 * src/copy.c: Declare lstat.
1429 (copy_dir): Set `xstat' member to lstat so that with `-H' we don't
1430 follow symlinks found via recursive traversal.
1431 Update uses of `dereference' to compare against new enum member names.
1432 * src/cp.c (long_opts): Add --dereference, -L.
1433 (usage): Describe -L and -H.
1434 (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'.
1435 (main): Add `H' and `-L' to getopt spec string.
1436 [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0.
1437 [case 'd']: Likewise.
1438 [case 'H']: New case.
1439 [case 'L']: New case.
1440 [case 'R']: Don't set dereference to `0' here.
1441 If it's not yet defined, set x.dereference to DEREF_NEVER
1442 if -R was specified, else set it to DEREF_ALWAYS.
1443 Set x.xstat accordingly for -H.
1444 * doc/fileutils.texi (cp invocation): Describe -H and -L.
1445 * src/mv.c (cp_option_init): Initialize to DEREF_NEVER, not `0'.
1446 * src/install.c (cp_option_init): Initialize to DEREF_ALWAYS, not `1'.
1448 * tests/cp/Makefile.am (TESTS): Add cp-HL.
1449 * tests/cp/cp-HL: New test.
1451 * src/du.c (print_totals): Rename global from opt_combined_arguments.
1453 2000-08-17 Paul Eggert <eggert@twinsun.com>
1455 * src/copy.c (DO_CHOWN): Do not make a special case for non-root.
1456 POSIX.2 requires that cp -p and mv attempt to set the uid of the
1457 destination file, even if you're not root. This affects behavior
1458 only on hosts that let you give files away via chmod.
1459 * NEWS: Describe the above change.
1461 2000-08-15 Jim Meyering <meyering@lucent.com>
1463 * src/du.c (count_entry): Remember the current directory also for `.'
1464 and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu.
1465 * tests/du/two-args: Add tests for this.
1467 2000-08-14 Jim Meyering <meyering@lucent.com>
1469 * src/copy.c (copy_reg): Move declaration of local, `n_read', into
1470 the scope where it's used.
1471 (copy_internal): In calling copy_reg, pass not the raw `src_mode',
1472 but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
1474 2000-08-13 Jim Meyering <meyering@lucent.com>
1476 * src/copy.c (get_dest_mode): Rename from new_nondir_mode.
1477 Honor the umask for `cp', but not for `mv' or `cp -p'.
1478 (copy_reg): New 4th parameter, dst_mode. Pass it as 3rd arg. to open.
1479 (copy_internal): Change type of locals `src_mode' and `src_type' from
1481 Remove unnecessary local, `fix_mode'.
1482 Combine two if-stmts into one.
1483 Pass `src_mode' as 4th arg to copy_reg.
1484 If we've just created a new regular file, return early, skipping the
1485 chmod step. copy_reg now sets permissions of such files upon creation.
1486 Use get_dest_mode, so there's just one chmod call here.
1488 * tests/cp/Makefile.am (TESTS): Add perm.
1489 * tests/cp/perm: New tests, to help ensure the above didn't
1492 2000-08-12 Jim Meyering <meyering@lucent.com>
1494 * tests/mv/into-self-2: Remove test for the VERSION_CONTROL and/or
1495 SIMPLE_BACKUP_SUFFIX envvars. Source ../envvar-check instead.
1496 * tests/mv/i-2: Likewise.
1497 * tests/mv/to-symlink: Likewise.
1498 * tests/cp/slink-2-slink: Likewise.
1499 * tests/mv/partition-perm: Likewise.
1500 * tests/cp/cp-mv-backup: Likewise.
1502 * tests/Makefile.am (EXTRA_DIST): Add envvar-check.
1503 * tests/envvar-check: New file.
1505 * install-sh: Remove trailing blanks.
1506 Output diagnostics to stderr, not stdout.
1507 Remove many useless curly braces and double quotes.
1509 2000-08-11 J. David Anglin <dave@hiauly1.hia.nrc.ca>
1511 * install-sh: Improve error handling.
1512 Do the job even when the target file is `busy' on systems
1513 that don't allow such files to be unlinked.
1515 2000-08-12 Jim Meyering <meyering@lucent.com>
1517 * README: Remove note about how installation can fail and the
1518 work-around, now that it's all automated.
1520 2000-08-07 Paul Eggert <eggert@twinsun.com>
1522 * src/cp.c (usage, main): For cp -P messages, mention the new
1523 behavior as well as the old.
1525 2000-08-07 Paul Eggert <eggert@twinsun.com>
1527 Standardize on "memory exhausted" instead of "Memory exhausted"
1528 or "virtual memory exhausted".
1529 Invoke xalloc_die instead of printing our own message.
1530 * src/chmod.c (main): Likewise.
1531 * src/copy.c (copy_dir, copy_internal): Likewise.
1532 * src/cp.c (do_copy): Likewise.
1533 * src/dircolors.c (xstrndup): Likewise.
1534 * src/install.c (main): Likewise.
1535 * src/ln.c (do_link): Likewise.
1536 * src/mkdir.c (main): Likewise.
1537 * src/mkfifo.c (main): Likewise.
1538 * src/mknod.c (main): Likewise.
1539 * src/mv.c (movefile): Likewise.
1540 * src/remove.c (remove_cwd_entries, rm): Likewise.
1541 * src/shred.c (quotearg_colon, xmalloc):
1542 "virtual memory exhausted" -> "memory exhausted"
1544 2000-08-07 Jim Meyering <meyering@lucent.com>
1546 * src/cp.c (enum) [PARENTS_OPTION]: New member.
1547 (long_opts): Update "parents" and deprecated "path" entries to use
1548 `PARENTS_OPTION', not `P'.
1549 (usage): Update --help output.
1550 (main): Warn that the meaning of `-P' will soon change.
1552 2000-08-06 Jim Meyering <meyering@lucent.com>
1554 * doc/fileutils.texi (cp invocation) [-r]: Remove inaccurate mention of
1555 `non-symbolic links'.
1557 2000-08-05 Jim Meyering <meyering@lucent.com>
1559 * config.guess: Update from master repository.
1560 * config.sub: Likewise.
1562 * Regenerate build/config framework to use the latest CVS versions
1563 of automake and autoconf.
1565 2000-07-31 Jim Meyering <meyering@lucent.com>
1567 * src/shred.c [!HAVE_CONFIG_H]: Use `virtual memory exhausted', not
1570 2000-07-30 Jim Meyering <meyering@lucent.com>
1572 * src/sys2.h (ISPRINT): Undef before defining to avoid warning.
1574 * src/copy.c (copy_internal): Quote the file names that are displayed
1575 with --verbose and --backup.
1576 * src/remove.c (remove_file): Quote the file names that are displayed
1578 (remove_dir): Likewise.
1579 * tests/mv/mv-special-1: Add quote marks to match new behavior.
1580 * tests/rm/r-1: Likewise.
1581 * tests/rm/r-2: Likewise.
1583 * src/df.c: Convert "`%s'" in format strings to "%s", and wrap each
1584 corresponding argument in a `quote (...)' call.
1585 * src/dircolors.c: Likewise.
1586 * src/du.c: Likewise.
1587 * src/mkdir.c: Likewise.
1588 * src/mkfifo.c: Likewise.
1589 * src/mknod.c: Likewise.
1590 * src/shred.c: Likewise.
1591 * src/rmdir.c: Likewise.
1592 * src/cp-hash.c: Likewise.
1594 * src/chgrp.c: Convert "`%s'" in format strings to "%s", and wrap each
1595 corresponding argument in a `quote (...)' call.
1596 Add more precise diagnostics.
1597 * src/chmod.c: Likewise.
1598 * src/chown.c: Likewise.
1600 * src/remove.c (remove_cwd_entries): Quote one more file name.
1602 * src/help-version: Remove file. Move it to ...
1603 * tests/help-version: ...here
1604 * tests/Makefile.am (TESTS): Set to help-version.
1605 (TESTS_ENVIRONMENT): Define.
1606 (EXTRA_DIST): Add $(TESTS).
1607 * src/Makefile.am (EXTRA_DIST): Remove help-version.
1608 (TESTS): Remove definition.
1609 (TESTS_ENVIRONMENT): Remove definition.
1611 2000-07-24 Bruno Haible <haible@clisp.cons.org>
1613 * src/ls.c: Include <limits.h>, <stdlib.h>, <wchar.h>, <wctype.h>.
1614 (quote_name): Use mbrtowc to step through the filename string while
1615 replacing nonprintables with question marks. Return the screen width,
1616 not the strlen length. Do no output if the out stream is NULL.
1617 (length_of_file_name_and_frills): Use the quote_name return value.
1619 2000-07-25 Jim Meyering <meyering@lucent.com>
1621 * src/chgrp.c (change_file_group): Save errno from a possibly failed
1622 chown, and use that later. Otherwise, errno itself could be clobbered
1624 * src/chmod.c (change_file_mode): Likewise.
1625 * src/chown.c (change_file_owner): Likewise.
1627 * src/mv.c (main): Remove unnecessary "%s" argument.
1629 * src/ln.c: Convert "`%s'" in format strings to "%s", and wrap each
1630 corresponding argument in a `quote (...)' call.
1631 Add more precise diagnostics.
1632 * src/mv.c: Likewise.
1633 * src/cp.c: Likewise.
1634 * src/touch.c: Likewise.
1636 2000-07-23 Jim Meyering <meyering@lucent.com>
1640 * src/dd.c (main): Give a better diagnostic for e.g.,
1641 `dd if=/dev/fd0 seek=100000000000'.
1642 Convert "`%s'" in format strings to "%s", and wrap each
1643 corresponding argument in a `quote (...)' call.
1644 Add many, more precise diagnostics.
1646 * src/remove.c (ASSIGN_STRDUPA): Remove macro definition.
1647 * src/sys2.h (ASSIGN_STRDUPA): New macro (moved here from remove.c).
1649 Fix cp so that `cp -r DIR1/ DIR2' works once again.
1650 * src/cp.c (ASSIGN_BASENAME_STRDUPA): New macro.
1651 (do_copy): Use it here (so we always strip trailing slashes before
1652 calling base_name). Reported by Branden Robinson via Michael Stone.
1654 Test for the above fix.
1655 * tests/cp/Makefile.am (TESTS): Add dir-slash.
1656 * tests/cp/dir-slash: New file.
1658 2000-07-17 Jim Meyering <meyering@lucent.com>
1660 * Makefile.maint (WGET): Define.
1662 (wget-update): New rule, based on the one in autoconf.
1664 * src/shred.c (usage): Give a little more info.
1665 Remove a FIXME comment.
1668 * src/ls.c (struct bin_str): Declare `string' member to be `const'.
1669 (put_indicator): Declare local `p' to be `const'.
1671 2000-07-15 Jim Meyering <meyering@lucent.com>
1673 Begin converting "`%s'" in format strings to "%s", and wrap each
1674 corresponding argument in a `quote (...)' call -- if there's only one.
1675 If there are two or more, then use `quote_n (0, ...),
1676 quote_n (1, ...), ...'.
1678 Here's the justification, from Paul Eggert (thanks, Paul):
1680 [Consider] the following, taken from fileutils/copy.c:
1682 error (0, errno, _("cannot create directory `%s'"), dst_path);
1684 Now, suppose dst_path is "/'\nrm: removing all files under `/"
1685 (expressed in C string syntax). This will cause the user to see
1686 the following delightfully ambiguous display:
1688 cp: cannot create directory `/'
1689 rm: removing all files under `/'
1691 It would be better to rewrite the above line to be something
1694 error (0, errno, _("cannot create directory %s"), quote (dst_path));
1696 using the definition of "quote" [in lib/quote.c]. That way,
1697 the user will see the following unambiguous display instead:
1699 cp: cannot create directory `/\'\nrm: removing all files under `/'
1701 One might object that any user who asks to copy a file with
1702 a weird name like that deserves to get confused. But this
1703 is not a good objection, as the source of the string may not
1704 be under the user's control, or even visible to the user.
1706 * src/copy.c: Adapt format strings and args as above. Include quote.h.
1707 I have deliberately not changed the output of --verbose.
1708 FIXME: maybe I should.
1709 * src/cp.c: Likewise.
1710 * src/remove.c: Likewise.
1711 * src/install.c: Likewise. and improve a couple diagnostics.
1713 2000-07-13 Paul Eggert <eggert@twinsun.com>
1715 * NEWS: Describe --quoting-style=clocale.
1717 * doc/fileutils.texi: New clocale quoting style.
1718 Undo the previous change to the locale quoting style.
1720 2000-07-09 Jim Meyering <meyering@lucent.com>
1722 * config.guess: Update from FSF.
1723 * config.sub: Likewise.
1725 2000-07-05 Paul Eggert <eggert@twinsun.com>
1727 * doc/fileutils.texi: Don't use ` and ' for quoting.
1729 2000-07-01 Jim Meyering <meyering@lucent.com>
1733 * tests/touch/dangling-symlink: Warn about the problem rather
1734 than failing, on some very recent (at least 2.3.99) versions of
1735 the Linux kernel. Suggestion from Ulrich Drepper.
1736 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Define host_triplet
1737 for use in the dangling-symlink test.
1739 2000-06-28 Jim Meyering <meyering@lucent.com>
1741 * tests/mv/i-2: Don't copy `out' into /tmp.
1743 2000-06-26 Paul Eggert <eggert@twinsun.com>
1745 Now that savedir.c has been cleaned up...
1746 * src/chgrp.c (change_dir_group): Don't set errno before
1747 invoking savedir, and assume that errno is nonzero if savedir fails.
1748 * src/chmod.c (change_dir_mode): Likewise.
1749 * src/chown.c (change_dir_owner): Likewise.
1750 * src/copy.c (copy_dir): Likewise.
1751 * src/du.c (count_entry): Likewise.
1753 2000-06-26 Paul Eggert <eggert@twinsun.com>
1755 * src/df.c (show_dev): Round disk usage percentage up, not to
1756 nearest value. Use integer arithmetic if it's easy. Fix bug
1757 when converting twos-complement negative values to floating point.
1759 2000-06-25 Jim Meyering <meyering@lucent.com>
1761 * src/copy.c (copy_internal): Don't return immediately after a failed
1762 copy_dir call -- otherwise, the failure to read a single file in a
1763 source directory would cause the containing destination directory
1764 not to have the owner and/or permissions set properly.
1765 Reported by Piotr and Maciej Kwapulinski.
1766 * tests/cp/fail-perm: Test for it.
1767 * tests/cp/Makefile.am (TESTS): Add fail-perm.
1771 2000-06-18 Jim Meyering <meyering@lucent.com>
1773 * README-alpha: Update.
1775 2000-06-17 Jim Meyering <meyering@lucent.com>
1777 * tests/install/basic-1: Don't fail (just exit 77) if strip doesn't
1778 work. Suggestion from Ulrich Drepper.
1779 Add canonical trap/mkdir/cd, plus exit portability cruft.
1781 2000-06-16 Jim Meyering <meyering@lucent.com>
1783 * src/copy.c (copy_reg): Give a slightly better diagnostic upon
1786 2000-06-15 Paul Eggert <eggert@twinsun.com>
1788 * NEWS, doc/fileutils.texi: df, du, and ls now round disk
1789 usage up and disk free space down.
1791 * src/df.c (df_readable): New arg for rounding style.
1792 Round negative numbers correctly.
1793 (show_dev): Round disk usage up and disk free space down.
1795 * src/ls.c (print_dir, gobble_file, print_long_format,
1796 print_file_name_and_frills): Round disk usage up.
1797 * src/du.c (print_size): Likewise.
1799 2000-06-14 Andreas Schwab <schwab@suse.de>
1801 * tests/rm/r-1 (framework_failure): Initialize this instead of
1804 2000-06-12 Jim Meyering <meyering@lucent.com>
1808 * tests/rm/r-1: Clean up.
1809 Be careful to remove temp directory upon interrupt.
1811 * src/mv.c (main): Give the correct diagnostic when using the
1812 --target-dir=DIR option, but no arguments.
1813 Patch from Michael Stone. Reported by Herbert Xu.
1814 * tests/mv/diag: New test for this.
1815 * tests/mv/Makefile.am (TESTS): Add diag.
1817 2000-06-08 Brian Youmans <3diff@gnu.org>
1819 * doc/perm.texi (Multiple Changes): Fix typo.
1820 * doc/fileutils.texi: A few typos and minor formatting fixes.
1821 * doc/getdate.texi: Likewise.
1823 2000-06-06 Jim Meyering <meyering@lucent.com>
1825 * Makefile.maint (alpha_subdir): Factor out `gnu/fetish'.
1827 2000-06-04 Jim Meyering <meyering@lucent.com>
1831 * src/df.c (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]:
1832 Cast undeclared `realpath' to char* to avoid warning.
1834 2000-06-03 Jim Meyering <meyering@lucent.com>
1836 * src/install.c (usage): Document that -v is a synonym for --verbose.
1837 * src/mkdir.c: Allow -v as synonym for --verbose, to be consistent
1838 with other fileutils.
1839 * src/rmdir.c: Likewise.
1840 Suggestion from François Pinard.
1842 2000-06-02 Jim Meyering <meyering@lucent.com>
1844 * configure.in (ALL_LINGUAS): Add Danish (da).
1846 2000-05-29 Jim Meyering <meyering@lucent.com>
1848 Allow `cp -d -u' to copy one symlink onto another that's identical.
1849 * src/copy.c (copy_internal): Change the || to ^ in the big sameness
1850 test, so copying one symlink onto another, identical one doesn't fail
1852 If the symlink call fails, don't report the failure if the destination
1853 already exists and is a symlink pointing to the proper name.
1854 Reported by Andrew Burgess.
1855 * tests/cp/slink-2-slink: New test.
1856 * tests/cp/Makefile.am (TESTS): Add slink-2-slink.
1857 * tests/cp/same-file: Adapt to fit new semantics of `cp -d'.
1859 2000-05-25 Jim Meyering <meyering@lucent.com>
1861 * src/dd.c (close_stdout_wrapper): Don't dereference NULL pointer.
1864 2000-05-23 Jim Meyering <meyering@lucent.com>
1866 * tests/shred/remove: Add traps to clean up.
1867 Correct broken running-as-root test.
1869 * tests/mv/i-2: Exit 77 when run as root. Reported by Andreas Schwab.
1871 2000-05-20 Jim Meyering <meyering@lucent.com>
1875 * tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change.
1877 * tests/rm/r-2: Clean up.
1878 * tests/ls/time-1 (LC_ALL): Set it unconditionally.
1880 2000-05-19 Jim Meyering <meyering@lucent.com>
1882 Save device number as well as inode number for each directory,
1883 and use both in comparisons. This makes the directory cycle
1884 test more robust, and closes the small remaining hole whereby
1885 an attacker could subvert a running `rm -r' command.
1887 * src/remove.c (struct active_dir_ent) [st_dev]: New member.
1888 [st_ino]: Rename from `inum'.
1889 (make_active_dir_ent) [device]: New parameter.
1890 (hash_compare_active_dir_ents): Compare using SAME_INODE macro.
1891 (fspec_init_common): New function, factored out.
1892 (fspec_init_file): Initialize have_device member.
1893 (fspec_get_full_mode): Remove parameter. Update caller.
1894 Set have_device and st_dev members.
1895 * src/remove.h (struct File_spec) [have_device, st_dev]: New members
1897 2000-05-18 Jim Meyering <meyering@lucent.com>
1899 * src/remove.c (rm): Combine adjacent fputc and fprintf.
1901 * tests/rm/Makefile.am (TESTS): Add hash.
1902 * tests/rm/hash: New test for the fix in lib/hash.c.
1904 2000-05-17 Jim Meyering <meyering@lucent.com>
1906 * src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert
1907 a running `rm -r'. Reported by Morten Welinder.
1909 2000-05-15 Jim Meyering <meyering@lucent.com>
1911 * src/ln.c (do_link): Use complete strings in diagnostics so they
1912 are easier to translate. Reported by Michel Robitaille.
1913 (main): Drop support for the case in which S_ISLNK wasn't defined.
1914 It was broken in any case.
1916 * tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the
1917 current locale is not C (POSIX). From Matthew Clarke.
1919 2000-05-13 Jim Meyering <meyering@lucent.com>
1921 * src/help-version: New test.
1922 * src/Makefile.am (TESTS): Define.
1923 (TESTS_ENVIRONMENT): Likewise.
1924 (EXTRA_DIST): Add help-version.
1926 * src/chgrp.c: Arrange to call close_stdout only upon exit.
1927 * src/chmod.c: Likewise.
1928 * src/chown.c: Likewise.
1929 * src/cp.c: Likewise.
1930 * src/df.c: Likewise.
1931 * src/dircolors.c: Likewise.
1932 * src/du.c: Likewise.
1933 * src/install.c: Likewise.
1934 * src/ln.c: Likewise.
1935 * src/ls.c: Likewise.
1936 * src/mkdir.c: Likewise.
1937 * src/mkfifo.c: Likewise.
1938 * src/mknod.c: Likewise.
1939 * src/mv.c: Likewise.
1940 * src/rm.c: Likewise.
1941 * src/rmdir.c: Likewise.
1942 * src/shred.c: Likewise.
1943 * src/sync.c: Likewise.
1944 * src/touch.c: Likewise.
1946 * src/dd.c: Include closeout.h.
1947 (usage): Don't call close_stdout here.
1948 (close_stdout_wrapper): New, kludgey, function and file-scoped global.
1949 (main): Register it with atexit.
1951 2000-05-12 Jim Meyering <meyering@lucent.com>
1953 Unlike for mv, -i doesn't cancel the effect of -f
1954 and -f doesn't cancel the effect of -i.
1955 * src/cp.c (main) ['f']: Don't reset `x.interactive'.
1956 ['i']: Don't reset `x.force'.
1957 * src/copy.c (copy_internal): Fix force and interactive tests.
1958 Patch from Michael Stone, reported by Jeff Sheinberg.
1960 2000-05-09 Jim Meyering <meyering@lucent.com>
1962 * src/shred.c: Include sys/types.h in shred.c before including
1963 sys/stat.h or system.h. From John David Anglin.
1965 2000-05-08 Jim Meyering <meyering@lucent.com>
1967 * tests/shred/remove: Don't use touch in root test. Instead, append to
1968 the test file, since now touch operates even on files which deny owner
1971 2000-05-06 Jim Meyering <meyering@lucent.com>
1973 * src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@.
1975 * src/rmdir.c (EEXIST): Remove now-unused definition.
1976 (ENOTEMPTY): Likewise.
1977 (errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
1978 which is determined by the autoconf test in m4/rmdir-errno.m4.
1980 2000-05-03 Bruno Haible <haible@clisp.cons.org>
1982 Don't fail when running `make check' with non-`C' locale.
1983 * tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext)
1984 and LC_ALL (for systems which look at LC_MESSAGES).
1985 * tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has
1986 LC_CTYPE or LC_ALL set. Define it and LANGUAGE before the first use
1989 2000-05-03 Jim Meyering <meyering@lucent.com>
1991 With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro.
1992 * src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup.
1993 * src/dircolors.c: Remove declaration of strndup.
1994 Reported by Bruno Haible.
1996 2000-05-02 Jim Meyering <meyering@lucent.com>
1998 * src/rm.c (usage): Add the answer to `How do I remove a file named -f?'
2000 2000-05-01 Jim Meyering <meyering@lucent.com>
2002 * src/install.c (change_attributes): Don't even attempt the chmod
2003 if the chown fails. Before, when a non-root user ran `install -m 4755
2004 -o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to
2005 the ID of the installing user. Reported by Marc Olzheim.
2007 2000-04-30 Jim Meyering <meyering@lucent.com>
2009 * src/touch.c (O_NOCTTY): Define if not defined already.
2010 (touch): Add O_NOCTTY to the flags passed to open.
2012 2000-04-29 Jim Meyering <meyering@lucent.com>
2016 * src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat.
2018 2000-04-27 Jim Meyering <meyering@lucent.com>
2021 * tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR.
2022 * tests/mkdir/p-1: Use mkdir, not $MKDIR.
2023 * tests/mkdir/p-2: Likewise.
2025 * configure.in (AC_OUTPUT): Add tests/du/Makefile.
2026 * tests/Makefile.am (SUBDIRS): Add du.
2027 * tests/du: New directory.
2028 * tests/du/two-args: New test.
2030 * tests/mkdir/special-1: New test.
2031 * tests/mkdir/Makefile.am (TESTS): Add special-1.
2033 2000-04-25 Paul Eggert <eggert@twinsun.com>
2035 * src/du.c (pop_dir): Remove through_symlink arg; use null cwd
2036 for that purpose instead.
2037 (count_entry): Also save the directory if we're saving more
2039 Fix file descriptor and memory leak when chdir fails.
2041 2000-04-26 Jim Meyering <meyering@lucent.com>
2043 * src/mkdir.c: Rename global: s/path_mode/create_parents/.
2044 (main): No longer perform explicit chmod when creating
2045 parent directories, since make_path now does the chmod.
2047 2000-04-17 Jim Meyering <meyering@lucent.com>
2049 * src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP.
2050 (enum) [FROM_OPTION]: New member.
2051 (long_options): New getopt spec.
2052 (change_file_owner): Add old_user, old_group parameters. Use them.
2053 (change_dir_owner): Likewise.
2056 From Andries Brouwer.
2057 * doc/fileutils.texi (invoking chown): Document it.
2059 2000-04-16 Jim Meyering <meyering@lucent.com>
2061 * src/cp.c: New option: --strip-trailing-slashes.
2062 (enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
2063 (remove_trailing_slashes): New global.
2064 (long_opts): New getopt spec.
2066 (do_copy): Strip trailing slashes on SOURCE names only if the new
2067 option has been specified.
2070 * tests/cp/symlink-slash: New test for the change in behavior.
2071 * tests/cp/Makefile.am (TESTS): Add symlink-slash.
2073 * doc/fileutils.texi (Trailing slashes): Factor out discussion on
2074 trailing slashes into its own node.
2075 Cross reference from cp and mv.
2077 2000-04-14 Jim Meyering <meyering@lucent.com>
2079 * src/touch.c (touch): Add O_NOCTTY to the list of open-time flags.
2081 2000-04-13 Jim Meyering <meyering@lucent.com>
2083 Move some code into m4/.
2084 * configure.in (_GNU_SOURCE): Don't define here.
2085 (AC_SYS_LARGEFILE): Don't use here.
2086 (AM_C_PROTOTYPES): Don't use here.
2087 * acconfig.h: Remove now-unused file.
2089 2000-04-08 Jim Meyering <meyering@lucent.com>
2091 * doc/fileutils.texi (cp invocation): Mention that there is an
2092 application for cp's --sparse=never option. From Martin Hippe.
2093 (cp invocation): Describe how --backup and --force
2094 can be useful together.
2096 2000-03-10 Alan Iwi <iwi@atm.ox.ac.uk>
2098 * src/ls.c: Add support for "ln=target" in the LS_COLORS variable,
2099 to colorize links as for the file/directory pointed to.
2100 * src/dircolors.hin: Add a few words of documentation of the above.
2102 2000-04-08 Jim Meyering <meyering@lucent.com>
2104 * src/cp.c (usage): Document that while the --backup option takes an
2105 optional argument, the -b option accepts none.
2106 (main): Use `backup type' in call to xget_version, not the
2107 now-deprecated `--version-control'.
2108 * src/install.c: Likewise.
2109 * src/ln.c: Likewise.
2110 * src/mv.c: Likewise.
2112 2000-03-12 Jim Meyering <meyering@lucent.com>
2114 Merge from textutils.
2115 * src/system.h (O_BINARY, O_TEXT): Define if necessary.
2116 (SET_BINARY, SET_BINARY2): Define.
2117 (DEV_BSIZE): Define to BBSIZE if appropriate.
2119 2000-03-10 Jim Meyering <meyering@lucent.com>
2121 * tests/mv/mv-special-1: Make the message more like that in the
2122 similar touch and shred tests.
2123 * tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
2124 bug and `exit 77' if the fifo cannot be created.
2125 Report and suggestion from Volker Borchert.
2127 2000-03-03 Jim Meyering <meyering@lucent.com>
2129 * po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a
2130 space optimization anyway) to populate $(distdir). Otherwise, the dist
2131 rules that change permissions would end up affecting the master sources.
2133 2000-03-01 Paul Eggert <eggert@twinsun.com>
2135 * src/df.c (show_point): Ignore shortcuts based on path
2136 prefixes that are loop file system mount points, since they
2137 yield undesirable output.
2139 2000-02-29 Jim Meyering <meyering@lucent.com>
2141 * src/ls.c (decode_switches): Remove `e' from getopt_long's list of
2142 option characters. Reported by John Summerfield.
2144 2000-02-28 Jim Meyering <meyering@lucent.com>
2146 * tests/install/basic-1: Use ginstall, not install.
2148 2000-02-27 Jim Meyering <meyering@lucent.com>
2152 * src/sys2.h: Guard declaration of strtoull also with
2153 `&& HAVE_UNSIGNED_LONG_LONG'.
2155 * src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...'
2156 now that autoconf always defines the HAVE_DECL_ symbols.
2158 * src/install.c (install_file_to_path): Always use install_file_in_file.
2159 Based on a patch from Adam Klein via Michael Stone.
2161 * tests/install/Makefile.am (TESTS): Add create-leading.
2162 * tests/install/create-leading: New file.
2164 * tests/install/basic-1: Clean up.
2165 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft.
2167 2000-02-26 Jim Meyering <meyering@lucent.com>
2169 Tranform the generated src/Makefile.in file so it falls back on
2170 using /bin/rm when necessary. The old rule didn't always work.
2171 This is necessary only on certain losing systems, and because this
2172 package builds an `rm' executable and some people put `.' too
2173 early in their PATH.
2174 * Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment.
2175 (EXTRA_DIST): Add .kludge-stamp.
2176 (.kludge-stamp): New rule.
2177 * src/Makefile.am (AUTOMAKE): Remove definition.
2178 (Makefile.in): Remove dependency on automake-wrap script.
2179 (EXTRA_DIST): Remove automake-wrap.
2180 * src/automake-wrap: Remove file.
2182 * tests/rm/r-2: Don't make the success of the test depend on the
2183 order in which directory entries are processed.
2184 Reported by Andreas Schwab.
2186 2000-02-12 Jim Meyering <meyering@lucent.com>
2188 * po/POTFILES.in: Add lib/userspec.c.
2190 * doc/fileutils.texi (chown invocation): Deprecate use of `.'.
2192 * src/chown.c (usage): Mention only `:', and not `.' as the separator,
2193 since POSIX allows only the former.
2194 Prompted by a report from Manas Garg.
2196 2000-02-11 Jim Meyering <meyering@lucent.com>
2198 * src/df.c (main): Count the stat'able arguments.
2199 Print the header line only if there is at least one valid argument.
2200 Reported by Andy Longton <alongton@metamark.com>
2202 2000-02-10 Jim Meyering <meyering@lucent.com>
2204 Make du work when invoked from an unreadable directory.
2206 * src/du.c (pop_dir): New function.
2207 (count_entry): Factor out common code (pop_dir), and call the new
2209 Move declaration of global, `stat_buf' into this function.
2210 (du_files): Don't stat `.' or call save_cwd, since count_entry
2211 never returns with a changed working directory.
2213 2000-02-09 Jim Meyering <meyering@lucent.com>
2215 * tests/mv/mv-special-1: Use $null and $dir in place of literals
2217 Exit 77 if we can't set up the framework (Volker Borchert reported
2218 that this test would fail because mknod failed when run on SunOS4.1.4
2219 using NFS-mounted disk from an OpenBSD system).
2221 2000-02-05 Jim Meyering <meyering@lucent.com>
2223 * src/copy.c (copy_internal): Don't allow mv to move a directory onto
2224 a non-directory. Reported by Brian Kimball via Michael Stone.
2226 2000-02-03 Jim Meyering <meyering@lucent.com>
2228 * tests/mv/Makefile.am (TESTS): Add dir-file.
2229 (TESTS_ENVIRONMENT): Remove vestiges of old tests.
2230 * tests/mv/dir-file: New file.
2232 2000-02-02 Jim Meyering <meyering@lucent.com>
2234 * tests/touch/Makefile.am (TESTS): Add fifo.
2235 * tests/touch/fifo: New file.
2237 2000-02-01 Jim Meyering <meyering@lucent.com>
2239 * src/touch.c (O_NDELAY): Define to 0 if not defined.
2240 (O_NONBLOCK): Define to O_NDELAY if not defined.
2241 (touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
2242 Reported by Eric G. Miller via Michael Stone.
2244 * man/*.x: Change ." to .\".
2245 Reported by Andreas Schwab and Brendan O'Dea.
2247 2000-01-31 Jim Meyering <meyering@lucent.com>
2249 * man/Makefile.maint (ginstall_filter): Define.
2250 ($(man_MANS)): Use it here so that the install.1 man page refers
2251 to `install', not `ginstall'. Reported by Andreas Schwab.
2253 2000-01-30 Jim Meyering <meyering@lucent.com>
2257 * configure.in: Move library-related tests into m4/lib-check.m4.
2259 * src/system.h (ST_NBLOCKS): Use st_size only for regular files and
2260 for directories. From H. J. Lu.
2262 * src/dd.c (main): Exit with nonzero status if ftruncate fails.
2264 2000-01-24 Jim Meyering <meyering@lucent.com>
2266 * src/ln.c (usage): Describe behavior when LINK_NAME is omitted.
2269 * src/mv.c (main): Don't expect array index `n_files - 1' to evaluate
2270 to `-1' for unsigned int n_files == 0. Doing so lead to a segfault on
2271 alpha. From Michael Stone.
2273 2000-01-23 Jim Meyering <meyering@lucent.com>
2275 * configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.)
2276 Remove nearly all function checks (moved to m4/.)
2277 (AC_SUBST(DF_PROG)): Move this to m4/.
2278 (ftruncate test): Move into new file: m4/ftruncate.m4.
2279 (AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/.
2280 Remove df-related tests. i.e., move jm_LIST_MOUNTED_FILESYSTEMS,
2281 jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/.
2283 2000-01-22 Jim Meyering <meyering@lucent.com>
2285 * configure.in: Move addext.c prerequisites from this file into m4/.
2286 (AC_CHECK_HEADERS): Move these checks into m4/.
2288 2000-01-17 Paul Eggert <eggert@twinsun.com>
2290 * src/dd.c (interrupt_handler): Likewise.
2291 (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
2292 to decide whether to call sigaction; this fixes an old typo.
2294 2000-01-16 Jim Meyering <meyering@lucent.com>
2296 * lib/Makefile.am: Sync with sh-utils/lib/Makefile.am.
2298 * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME,
2299 jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and
2300 AC_FUNC_ALLOCA. They're now in m4/.
2302 Sync with the version from emacs-20.5.
2304 (<string.h>): Include if HAVE_STRING_H.
2305 (<stdlib.h>): Include if HAVE_STDLIB_H.
2306 (alloca): Abort if malloc fails.
2307 Reported by Paul Eggert.
2309 2000-01-15 Jim Meyering <meyering@lucent.com>
2311 * configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy
2312 memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol
2313 strtoul strverscmp. Now they're in m4/.
2315 2000-01-12 Jim Meyering <meyering@lucent.com>
2317 * tests/shred/remove: Make the warning that this shred test may not
2318 be run as root more prominent. Suggestion from Volker Borchert.
2320 2000-01-11 Paul Eggert <eggert@twinsun.com>
2322 Quote multibyte characters correctly.
2324 * lib/quotearg.c (ISGRAPH): Remove.
2325 (ISPRINT): New macro.
2326 (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
2327 (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
2328 defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
2329 (quotearg_buffer_restyled): New function, with most of the old
2330 quotearg_buffer's contents.
2331 Major rewrite to support multibyte characters.
2332 (quotearg_buffer): Now just calls quotearg_buffer_restyled.
2334 * m4/c-bs-a.m4: New file.
2335 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
2336 (jm_PREREQ): Use it.
2338 2000-01-11 Paul Eggert <eggert@twinsun.com>
2340 * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned
2341 long, to parse numeric modes. Check for any unknown bits, not
2342 just unknown bits left of the leftmost known bit.
2344 2000-01-11 Paul Eggert <eggert@twinsun.com>
2346 * lib/getdate.y: Update copyright notice.
2348 2000-01-11 Paul Eggert <eggert@twinsun.com>
2350 * COPYING: Sync with latest FSF version (fixing a minor Y2k problem).
2352 2000-01-11 Paul Eggert <eggert@twinsun.com>
2354 * lib/exclude.c, lib/exclude.h: Sync to the slightly more
2355 general version of GNU tar.
2357 * src/du.c (count_entry):
2358 Adjust to new calling convention for excluded_filename.
2359 (main): Likewise, for add_exclude_file.
2361 2000-01-11 Jim Meyering <meyering@lucent.com>
2363 * lib/memcpy.c (memcpy): Protoize.
2365 Prepare to sync lib/ directories of fileutils, sh-utils, and textutils.
2366 * lib/Makefile.am: s/fu/fetish/
2367 * src/Makefile.am: s/libfu/libfetish/
2369 * lib/hash.c (hash_initialize): Fix typo in comment.
2370 From François Pinard.
2372 2000-01-10 Jim Meyering <meyering@lucent.com>
2376 * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
2378 2000-01-09 Jim Meyering <meyering@lucent.com>
2382 * src/ln.c (do_link): Produce the same sort of one-line output for
2383 `--backup --verbose' as cp, mv, install. Before this, the backup
2384 file name wasn't printed at all.
2386 This affects cp, install, and mv.
2387 * src/copy.c (copy_internal): When making backup files in verbose
2388 mode, print the backup file name on the same line as the rest of the
2389 information, e.g., `a -> b (backup: b.~13~)' rather than on a separate
2390 line by itself. Suggestion from Karl Berry.
2392 2000-01-08 Jim Meyering <meyering@ascend.com>
2394 * lib/error.c (error): Use __strerror_r's return value only if
2395 HAVE_WORKING_STRERROR_R.
2396 (error_at_line): Likewise.
2398 * Makefile.maint (null_AM_MAKEFLAGS): Define.
2399 (my-distcheck): Use it to avoid distributing out of date files
2400 whose derivation would require a maintainer tool.
2402 2000-01-07 Jim Meyering <meyering@ascend.com>
2404 * lib/euidaccess.c: Sync with the GNU C library.
2406 * tests/dir/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix
2407 to exported PATH value (though not strictly necessary, here).
2408 * tests/dd/Makefile.am: Likewise.
2409 * tests/dircolors/Makefile.am: Likewise.
2410 * tests/rm/Makefile.am: Likewise.
2411 * tests/rmdir/Makefile.am: Likewise.
2412 * tests/shred/Makefile.am: Likewise.
2413 * tests/touch/Makefile.am: Likewise.
2414 * tests/shred/Makefile.am: Likewise.
2416 2000-01-06 Jim Meyering <meyering@ascend.com>
2418 * man/help2man: Import version 1.020.
2420 * lib/strftime.c: Sync with the GNU C Library.
2422 2000-01-06 Paul Eggert <eggert@set.twinsun.com>
2424 * tar/lib/getdate.y: Sync tm_diff with the GNU C Library.
2425 (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed.
2426 (tm_diff): Renamed from difftm. All uses changed.
2427 Replace body with that taken from GNU C Library 2.1.3pre1.
2428 (get_date): Prefer tm_gmtoff to tm_diff if available.
2430 2000-01-04 Paul Eggert <eggert@twinsun.com>
2432 * savedir.c (savedir): Don't store past the end of an array if
2433 name_size is zero and the directory is empty.
2435 * Makefile.maint (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0.
2436 (alpha): Create xdelta diffs.
2438 2000-01-02 Jim Meyering <meyering@ascend.com>
2442 * src/mv.c: New option: --strip-trailing-slashes.
2444 1999-11-18 Paul Eggert <eggert@twinsun.com>
2446 * lib/strftime.c (my_strftime): Some old compilers object to
2447 '\a', so don't bother optimizing for it.
2449 2000-01-01 Paul Eggert <eggert@twinsun.com>
2451 Fix bug: `df PATH' sometimes misbehaves when there is an
2452 inaccessible mount point unrelated to PATH.
2453 * configure.in (AC_CHECK_FUNCS): Add realpath, resolvepath.
2454 * src/df.c (#pragma alloca): Add if _AIX is defined.
2455 (path-concat.h): Include.
2456 (show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined,
2457 find the real absolute path for PATH, and use that to find the
2460 (show_point): Prefer non-dummy entries in shortcuts, too.
2461 Disable bogus mount dirs instead of restatting them each time.
2463 1999-12-30 Jim Meyering <meyering@ascend.com>
2464 1999-12-17 Kalle Olavi Niemitalo <tosi@stekt.oulu.fi>
2466 * src/rmdir.c (remove_parents, main): Don't pass errno to error
2467 when printing "removing directory" message. Failure of rmdir is
2470 1999-12-23 Jim Meyering <meyering@ascend.com>
2472 * configure.in: Remove clock_gettime tests.
2473 Now they're in m4/jm-macros.m4.
2475 * src/ln.c (usage): Correct typos.
2476 List new --target-directory=... usage.
2477 Reported by Göran Uddeborg
2479 * src/mv.c (usage): List new --target-directory=... usage.
2481 1999-12-22 Jim Meyering <meyering@ascend.com>
2483 * lib/getdate.y (get_date): Fix typo in time_t overflow test.
2486 1999-12-21 Andreas Schwab <schwab@suse.de>
2488 * tests/shred/remove: Use $file, not $tmp/file. Exit 77 if run as
2491 1999-12-20 Paul Eggert <eggert@twinsun.com>
2493 * src/df.c (ceil_percent): Remove.
2494 (show_dev): Avoid overflow problems when calculating percent.
2495 Do not display negative percents.
2497 1999-12-19 Jim Meyering <meyering@ascend.com>
2501 * doc/fileutils.texi: Clarify and combine descriptions of -c and of
2503 Likewise for -u/--time=atime.
2505 * src/ls.c [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper.
2506 [Notice the new configure-time test in m4/lstat-slash.m4. ]
2507 (main): Back out change from 1999-02-19 that made ls remove
2508 trailing slashes from command line arguments to accommodate early
2509 versions of Linux. Now, `ls symlink-to-dir/' acts like
2510 `ls symlink-to-dir/.' thus following the symbolic link, as POSIX says
2511 it should. Suggestion from Bruno Haible and Andreas Schwab.
2513 * lib/xstat.in (slash_aware_lstat): New function.
2514 (rpl_@xstat@): Use it.
2515 * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
2516 (lstat.c): Likewise.
2518 Make sure ls does the right thing with symlinks and trailing slashes.
2519 * tests/ls/Makefile.am (TESTS): Add symlink-slash.
2520 * tests/ls/symlink-slash: New test, for above-fixed bug.
2522 1999-12-18 Jim Meyering <meyering@ascend.com>
2524 * src/shred.c (wipename): When repeatedly renaming a file, making the
2525 name shorter and shorter, skip to the next shorter length length if a
2526 rename fails (e.g. due to permission denied). Otherwise, this loop
2527 would iterate for so long that shred would appear to be stuck in an
2528 infinite loop for any but the shortest file names.
2529 Reported by Joe Orton.
2531 * configure.in (AC_OUTPUT): Add tests/shred/Makefile.
2532 * tests/Makefile.am (SUBDIRS): Add shred.
2533 * tests/shred: New directory
2534 * tests/shred/remove: New file. Tests for the above-fixed bug.
2536 1999-12-13 Jim Meyering <meyering@ascend.com>
2538 * lib/makepath.c (make_path): Consistently use `error' to output
2539 the verbose, `created directory ...' messages.
2540 Reported by Bernhard Rosenkraenzer.
2542 1999-12-12 Jim Meyering <meyering@ascend.com>
2544 Move 120+ lines of stat.h-related macros from system.h (not shared)
2545 to sys2.h, which is shared between fileutils, sh-utils, textutils.
2546 * src/system.h: Move them from here...
2547 * src/sys2.h: ... to here.
2549 * src/system.h (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define
2550 if not defined. This was necessary on a NeXT Turbostation running
2551 Mach 3.3. Reported by Nelson H. F. Beebe.
2553 * src/ls.c (decode_switches): If -c or -u is specified and not -l
2554 (or any other option that implies -l), and no sort-type was specified,
2555 then sort by the ctime (-c) or atime (-u). Part of this change reverts
2556 the 1998-01-10 delta.
2557 (usage): Update to reflect this change.
2558 Reported by Paul Slootman via Michael Stone.
2560 1999-12-09 Jim Meyering <meyering@ascend.com>
2562 * src/df.c (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define
2563 these and use them instead of `CHAR_MAX + n'.
2564 * src/du.c (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION):
2566 * src/touch.c (TIME_OPTION): Likewise.
2567 * src/rmdir.c (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise.
2569 * tests/ls/time-1: Test more of the framework (touch's -a and -m
2570 options) before running the actual ls test.
2572 1999-12-07 Jim Meyering <meyering@ascend.com>
2574 * tests/cp/cp-mv-backup: Use 1>&2 rather than `1<&-'.
2575 Suggestion from Volker Borchert.
2577 1999-12-05 Jim Meyering <meyering@ascend.com>
2579 * Makefile.maint: Remove ftp.enst.fr.
2581 1999-12-04 Jim Meyering <meyering@ascend.com>
2585 * tests/mv/into-self-2: Adapt to reflect this change in behavior.
2586 Make sure the VERSION_CONTROL envvar is not set.
2587 Run diff if comparison fails.
2589 * src/copy.c (copy_internal): In move mode, if the rename attempt
2590 fails, then unlink any existing destination file. This makes a
2591 cross-device `mv' more consistent with the intra-device behavior.
2592 This change is required by POSIX to make a cross-device move act with
2593 semantics similar to those of the rename syscall. For example now
2594 `mv' can move a file onto a symlink to itself when that symlink
2595 is on a separate partition. With fileutils-4.0j, it would fail with
2596 a diagnostic saying they were the same file.
2597 Reported by Bruno Haible.
2599 * tests/mv/to-symlink: New file. Adds test for the above.
2600 * tests/mv/Makefile.am (TESTS): Add to-symlink.
2602 * tests/cp/cp-mv-backup (trap): Be careful to close $actual before
2603 removing the containing directory. Otherwise, on some systems rmdir
2604 fails to remove the containing directory.
2606 * tests/ls/time-1: List --full-time dates upon failure.
2608 1999-12-02 Andreas Schwab <schwab@suse.de>
2610 * src/ls.c (check_symlink_color): New variable.
2611 (main): Set it if we need to check for dangling symlinks when
2613 (gobble_file): Check check_symlink_color instead of print_with_color.
2615 1999-11-30 Paul Eggert <eggert@twinsun.com>
2617 * src/ls.c (usage): Shorten help for --show-control-chars.
2619 1999-11-30 Jim Meyering <meyering@ascend.com>
2621 Give the right diagnostic when failing to create a file in an
2622 unwritable directory.
2623 * src/touch.c (touch): Record errno upon failed errno and use that
2624 saved value if a subsequent fstat, stat or utime call fails.
2625 Reported by Wichert Akkerman via Michael Stone.
2627 1999-11-27 Jim Meyering <meyering@ascend.com>
2629 Clean up test scripts.
2630 * tests/mv/setup: Don't set/use DF or MKDIR. Use df and mkdir instead.
2631 * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH
2632 * tests/mv/backup-is-src: Likewise for RM and MV.
2633 * tests/mv/hard-link-1: Likewise.
2634 * tests/mv/into-self: Likewise.
2635 * tests/mv/into-self-3: Likewise.
2637 Add test for 1999-05-23 change to src/copy.c (copy_internal).
2638 * tests/mv/partition-perm: New file.
2639 * tests/mv/Makefile.am (TESTS): Add partition-perm.
2643 1999-11-22 Paul Eggert <eggert@twinsun.com>
2645 * src/df.c (df_readable): Now returns char const *, not char *.
2647 (ceil_percent): Now returns double, not int.
2648 Be more careful about adding 1 to a wild value.
2649 (show_dev): Don't filter out wild sizes from the underlying operating
2650 system; instead, show them to the user as faithfully as possible.
2652 1999-11-23 Jim Meyering <meyering@ascend.com>
2654 * doc/getdate.texi (Calendar date item): Correction regarding 0..68/
2655 69-99 split for 1900 vs 2000. From Peter Moulder.
2657 1999-11-22 Jim Meyering <meyering@ascend.com>
2659 * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c.
2661 1999-11-20 Jim Meyering <meyering@ascend.com>
2663 * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate
2665 (remove_parents): Use it.
2668 * tests/cp/cp-mv-backup: Run `diff -c' if the test fails.
2670 * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH.
2671 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc.
2673 * src/chgrp.c: Declare lstat; needed on e.g. SunOS4.
2674 Reported by Tom Tromey.
2676 1999-11-19 Jim Meyering <meyering@ascend.com>
2678 * lib/strstr.c (strstr): Include config.h.
2679 Add a `;' between shloop label and `}'.
2682 1999-11-17 Jim Meyering <meyering@ascend.com>
2684 * src/mkdir.c (S_IRWXUGO): Define if necessary.
2685 (main): Use chmod to set the permissions if bits other than those
2686 of S_IRWXUGO were requested. Reported by Sami Farin.
2688 1999-11-14 Paul Eggert <eggert@twinsun.com>
2690 * touch.c (touch): Simplify code a tad, using fd == -1 instead
2691 of separate valid_fd variable.
2693 1999-11-13 Jim Meyering <meyering@ascend.com>
2695 * src/touch.c (touch): Don't fail just because we couldn't open
2696 an existing file. This makes it so that touching a read-only
2697 file now works. Also clean up and simplify.
2698 Based on a patch from Chip Salzenberg.
2699 * tests/touch/no-rights: New test for this.
2700 * tests/touch/Makefile.am (TESTS): Add no-rights.
2702 1999-11-12 Jim Meyering <meyering@ascend.com>
2704 * src/remove.c (print_nth_dir): Write one fewer byte so we don't print
2706 (rm): Fix bugs in (and test, this time) the very rarely used code
2707 to warn about directory cycles.
2708 Reported by michael@roka.net.
2710 1999-11-11 Jim Meyering <meyering@ascend.com>
2712 * src/copy.c (copy_internal): Treat src and dest as the `same' in
2713 `mv src symlink-to-src' when src and dest are on different partitions.
2714 Otherwise, that `mv' command would silently remove `src'.
2715 Reported by Michael Stone.
2716 * tests/mv/into-self-2: Add a test for this fix.
2718 * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others
2719 just like that also dated back to 1992 were fixed in 1998-01-02).
2720 Richard Braakman reported that using `install -d -g foo 1/2`
2721 only sets the group on the intermediate directory, not the final
2722 component. From Michael Stone.
2724 1999-11-07 Paul Eggert <eggert@set.twinsun.com>
2726 * human.c (default_block_size): New function.
2727 (humblock): Use it if no block size is specified.
2728 (human_block_size): If the specified block size is zero, report an
2729 error if report_errors is nonzero; otherwise use the default.
2731 1999-11-07 Jim Meyering <meyering@ascend.com>
2733 * src/dircolors.hin: Add several more TERM types.
2735 Add .png for real this time.
2736 Change the image types colors to be visible in a black-on-white xterm.
2739 * src/chgrp.c (xstat): New global.
2741 (change_file_group): Use it. Before this change, when running chgrp
2742 on a symlink without --dereference (-h) and when the requested group
2743 is the same as the group for the *symlink*, chgrp would do nothing.
2744 Now it changes the group of the file referenced through the symlink.
2745 Reported by Martin Mitchell.
2747 * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
2748 * src/chown.c: Define and use REFERENCE_FILE_OPTION and
2749 DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
2750 * src/chgrp.c: Likewise.
2752 * tests/ln/misc: Add hard-link-to-symlink test.
2753 Move framework_failure test to the end.
2754 Fix a typo: s/||/&&/.
2756 * src/ln.c (do_link): Warn that making a hard link to a symbolic link
2759 * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'.
2760 * tests/ln/backup-1: Likewise.
2762 * configure.in (AC_OUTPUT): Add tests/rmdir/Makefile.
2763 * tests/Makefile.am (SUBDIRS): Add rmdir.
2764 * tests/rmdir: New directory
2765 * tests/rmdir/ignore: New file.
2767 * src/rmdir.c (remove_parents): Use the correct test (just as in
2768 main) in handling --ignore-fail-on-non-empty. From Michael Stone.
2769 (usage): Improve description of --parents. Based on suggestion from
2772 1999-11-06 Jim Meyering <meyering@ascend.com>
2774 Allow hard links to symlinks on systems that support it.
2775 * src/ln.c (STAT_LIKE_LINK): Define.
2776 (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
2777 the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
2779 * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is
2780 accepted as the short form of --file-type, per the documentation.
2781 From James Sneeringer.
2783 * src/ln.c (do_link): Fix typo (in which the function name `symlink'
2784 was tested instead of the variable `symbolic_link') that could make
2785 ln perform an unneeded `stat' call.
2787 1999-11-05 Jim Meyering <meyering@ascend.com>
2789 * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated
2791 * src/copy.c: Likewise.
2792 * lib/fileblocks.c: Likewise.
2794 * configure.in: Move some type/header/member tests into
2795 m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
2796 fileutils, textutils, and sh-utils.
2798 1999-11-02 Jim Meyering <meyering@ascend.com>
2800 * man/help2man: Import version 1.018.
2801 * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
2802 * man/*.x: Include one-line summary in [NAME] section.
2803 * man/Makefile.summ: Remove the one-line summaries.
2804 Suggestion for clean-up from Akim Demaille.
2806 * configure.in (ALL_LINGUAS): Add Galician (gl).
2808 1999-11-01 Jim Meyering <meyering@ascend.com>
2810 * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and
2811 other special files like /dev/zero.
2813 * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2815 1999-10-31 Jim Meyering <meyering@ascend.com>
2817 * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around
2820 * doc/fileutils.texi: Document new --backup[=METHOD] option for
2821 cp, mv, ln, and install.
2823 * src/ln.c: Convert --backup to take an optional argument.
2824 Deprecate --version-control (-V) in comments.
2825 (usage): Remove mention of --version-control.
2826 (main): Make -V warn then fall through into --backup case.
2827 [--backup case]: Handle optional arg.
2828 * src/install.c: Likewise.
2830 1999-10-24 Jim Meyering <meyering@ascend.com>
2832 * src/cp.c (do_copy): Constify `dest', and cast-away the new
2833 const in assignment to new_dest.
2835 1999-10-23 Jim Meyering <meyering@ascend.com>
2837 * tests/touch/Makefile.am (TESTS): Add dangling-symlink.
2838 * tests/touch/dangling-symlink: New file.
2840 1999-10-23 Paul Eggert <eggert@twinsun.com>
2842 * src/touch.c (full_write): Remove unused decl.
2843 (open_maybe_create): Remove.
2844 (touch): Don't record whether the file was created; this isn't
2845 possible to do reliably and portably without race conditions.
2846 If the file was created and if amtime_now is nonzero, this
2847 change means we'll have to do another utime system call, but
2848 that's no more harmful than the previous version of this code.
2849 Reported by Gabor Z. Papp.
2851 1999-10-21 Jim Meyering <meyering@ascend.com>
2853 * configure.in (ALL_LINGUAS): Add Japanese (pa).
2855 1999-10-17 Jim Meyering <meyering@ascend.com>
2857 * tests/mv/backup-is-src: Remove use of mv's now-deprecated
2858 -V option. Use --b=simple instead of -b -V simple.
2860 * src/mv.c: Convert --backup to take an optional argument.
2861 Deprecate --version-control (-V) in comments.
2862 (usage): Remove mention of --version-control.
2863 (main): Make -V warn then fall through into --backup case.
2864 [--backup case]: Handle optional arg.
2866 Accept new option: --target-directory=DIR
2867 * src/cp.c (TARGET_DIRECTORY_OPTION): Define.
2868 (SPARSE_OPTION): Define.
2869 (usage): Describe it.
2870 (do_copy): Change meanings/names of first two parameters: use `n_files'
2871 in place of `argc - optind', and `file' instead of `argv + optind'.
2872 Add parameter, target_directory.
2873 (main): Pass new arg, target_directory.
2875 1999-10-16 Jim Meyering <meyering@ascend.com>
2877 * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option.
2878 Use --b=simple instead of -b -V simple.
2879 * tests/cp/backup-1: Replace use of cp's now-deprecated
2880 --version-control option with use of --backup=simple.
2882 * src/cp.c: Convert --backup to take an optional argument.
2883 Deprecate --version-control (-V) in comments.
2884 (usage): Remove mention of --version-control.
2885 (main): Make -V warn then fall through into --backup case.
2886 [--backup case]: Handle optional arg.
2888 * tests/cp/Makefile.am (TESTS): Add cp-mv-backup.
2889 * tests/cp/cp-mv-backup: New file.
2891 1999-10-11 Jim Meyering <meyering@ascend.com>
2893 * lib/getopt.c: Merge changes from latest glibc.
2894 * lib/getopt.h: Likewise.
2895 * lib/getopt1.c: Likewise.
2897 1999-10-09 Jim Meyering <meyering@ascend.com>
2899 Accept new option: --target-directory=DIR
2900 * src/ln.c (TARGET_DIRECTORY_OPTION): Define.
2901 (usage): Describe it.
2902 (main): Implement it.
2903 Make code clearer: use new variable `n_files' in place of
2904 `argc - optind'. Use `file' instead of `argv + optind'.
2906 1999-10-04 Jim Meyering <meyering@ascend.com>
2908 * depcomp: New file, for automake's new dependency support.
2909 * missing: New version, from automake's user-dep-gen-branch.
2911 * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too.
2912 * src/sys2.h (__attribute__): Likewise.
2913 Wrap with #ifndef __attribute__.
2915 1999-10-03 Paul Eggert <eggert@twinsun.com>
2917 * getdate.y (__attribute__): Define to empty if GCC claims to
2918 be before 2.8; this is needed for OPENStep 4.2 cc. Also,
2919 define to empty if strict ANSI.
2921 1999-10-03 Jim Meyering <meyering@ascend.com>
2923 Accept new option: --target-directory=DIR
2924 * src/mv.c (TARGET_DIRECTORY_OPTION): Define.
2925 (usage): Describe it.
2926 (main): Implement it.
2927 Remove unused variable, stdin_tty.
2928 Make code clearer: use new variable `n_files' in place of
2929 `argc - optind'. Use `file' instead of `argv + optind'.
2931 1999-09-28 Jim Meyering <meyering@ascend.com>
2933 * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
2934 Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
2935 * src/sys2.h: Likewise.
2937 * lib/xalloc.h (__attribute__): Protect against redefinition.
2940 1999-09-26 Jim Meyering <meyering@ascend.com>
2942 * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and
2944 Use explicit exit to help avoid warnings.
2947 * lib/path-concat.c (DIRECTORY_SEPARATOR): Define.
2949 (path_concat): Allow parameter DIR to be NULL.
2950 (xpath_concat): New function.
2953 * lib/xalloc.h (__attribute__): Define.
2954 (ATTRIBUTE_NORETURN): Define.
2955 (xalloc_die): Declare.
2956 (NEW): Define as yet unused macro.
2962 * lib/basename.c (base_name): Add prototype. From Akim Demaille.
2964 1999-09-19 Jim Meyering <meyering@ascend.com>
2966 * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
2967 (S_ISLNK): Define if necessary.
2968 This is necessary on a NEC SX-4 with SUPER-UX 9.1.
2969 Based on a patch from Holger Berger.
2971 * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
2972 Change many counter and index variables to be of unsigned type.
2973 (dd_copy): Add new unsigned variable, n_bytes_read, in place of
2974 many uses of `nread'.
2976 * src/sys2.h (__attribute__): Define.
2977 (ATTRIBUTE_NORETURN): Remove #else clause.
2978 (ATTRIBUTE_UNUSED): Define.
2980 1999-09-17 Jim Meyering <meyering@ascend.com>
2982 * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this
2983 is done in m4/jm-macros.m4.
2985 1999-09-09 Jim Meyering <meyering@ascend.com>
2987 * src/touch.c (usage): Remove misleading sentence in --help output.
2990 * src/Makefile.am (EXTRAdir): Remove unused variable.
2992 1999-09-03 Paul Eggert <eggert@twinsun.com>
2994 * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
2997 1999-09-01 Jim Meyering <meyering@ascend.com>
2999 * src/cp.c: Remove declaration of xstrdup.
3000 * src/df.c: Likewise.
3001 * src/ls.c: Likewise.
3003 1999-09-01 Akim Demaille <akim@epita.fr>
3005 * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'.
3006 * lib/xalloc.h (xalloc_fail_func): Likewise.
3007 (xstrdup): Add protoype.
3009 * lib/version-etc.c (version_etc_copyright): Default copyright string.
3010 (version_etc): Use it.
3011 * lib/version-etc.h: Declare it.
3013 1999-08-29 Jim Meyering <meyering@ascend.com>
3015 * configure.in (AC_YACC): Remove use, now that we require bison.
3017 * src/dircolors.hin: Add .rpm, .png, and .fli.
3020 1999-08-28 Paul Eggert <eggert@twinsun.com>
3022 * getdate.y: Add copyright notice.
3024 (number): Handle `Nov 11 1996' example; see Risks Digest 20.55
3025 http://catless.ncl.ac.uk/Risks/20.55.html#subj18
3028 (<stdio.h>): Include only if testing.
3030 (ISLOWER, PC): New macros.
3031 (<string.h>): Include if HAVE_STRING_H, not USG.
3033 (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
3035 (EPOCH_YEAR): Renamed from EPOCH.
3036 (table): Renamed from TABLE.
3037 (meridian): Now an anonymous enum.
3038 (struct parser_control): New type.
3039 (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
3040 (yyInput, ..., yyRelYear): Migrated into struct parser_control.
3041 (%pure_parser): Added, so that the parser is pure.
3042 (%union): Removed; the type is now just plain int.
3043 All %type directives removed.
3044 (tLOCAL_ZONE): New %token.
3045 (month_day_table): Renamed from MonthDayTable.
3046 (gmtime, localtime, mktime, time): Declare only if not defined.
3047 (meridian_table): New table.
3048 (dst_table): New table.
3049 (units_table): renamed from UnitsTable.
3050 (relative_time_table): Renamed from OtherTable.
3051 (time_zone_table): Renamed from TimezoneTable. Modernized data.
3052 (military_table): Renamed from MilitaryTable.
3053 (to_hour): Renamed from ToHour.
3054 (to_year): Renamed from ToYear.
3055 (lookup_zone): New function.
3056 (LookupWord): Renamed from lookup_word.
3057 Use lookup_zone for time zones.
3058 (yylex): Now reentrant. All callers changed.
3059 (get_date): Add support for local time zone abbreviations.
3062 1999-08-22 Jim Meyering <meyering@ascend.com>
3064 * src/sys2.h (IF_LINT): Define new macro.
3065 * src/df.c (main): Rename locals i and j.
3066 Use IF_LINT macro instead of #ifdef lint...
3068 * src/dd.c (parse_integer): Add `const' to char* parameter and
3069 add a separate `suffix' variable.
3071 1999-08-20 Jim Meyering <meyering@ascend.com>
3073 * src/chown.c (usage): Tweak --help output to make it more consistent
3075 * src/chgrp.c (usage): Tweak --help output to make it more consistent
3078 1999-08-17 Jim Meyering <meyering@ascend.com>
3080 * configure.in: Remove check for rename and the code that would
3081 enable building of the `mvdir' program.
3082 * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@.
3083 (EXTRA_PROGRAMS): Remove obsolete mvdir.
3084 * lib/rename.c: Remove obsolete file. (it had a bug, too)
3085 * src/mvdir.c: Remove obsolete file.
3086 * po/POTFILES.in: Remove mvdir.c
3088 * doc/fileutils.texi (chown, chgrp invocation): Make these sections
3089 consistent with each other.
3091 1999-08-16 Jim Meyering <meyering@ascend.com>
3093 * src/chown.c (groupname): Declare to be `const'.
3094 (change_dir_owner): Declare statp parameter to be `const'.
3095 (usage): Make the output be more consistent with that from chgrp.
3097 This change is nearly identical to the chown.c change of 1998-05-24
3098 * src/chgrp.c: Accept new option, --dereference.
3099 --no-dereference is now the default. Include lchown.h.
3100 (enum Change_status) [CH_NOT_APPLIED]: New member.
3101 (change_symlinks): Enable this by default, now.
3102 (describe_change): Handle new case.
3103 (change_file_group): Add new parameter: cmdline_arg. Update callers.
3104 Reorganize to reflect changed semantics.
3105 (LCHOWN): Remove definitions.
3108 1999-08-10 Jim Meyering <meyering@ascend.com>
3110 * po/POTFILES.in: Add lib/quotearg.c.
3112 1999-08-09 Paul Eggert <eggert@twinsun.com>
3114 * NEWS, doc/fileutils.texi, src/ls.c (usage):
3115 Add ls --quoting-style=locale.
3117 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE):
3118 Change from escape_quoting_style to locale_quoting_style.
3119 (argmatch_invalid): Use new quotearg_style primitive for simplicity.
3120 Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
3122 * lib/quotearg.h (locale_quoting_style): New enum value.
3123 (quotearg_n_style, quotearg_style): New decls.
3125 * lib/quotearg.c: Include <libintl.h> if ENABLE_NLS.
3127 (quoting_style_args, quoting_style_v, quotearg_buffer): Add support
3128 for locale_quoting_style, using _("`") and _("'") for open and close
3130 Do not quote spaces in escape_quoting_style.
3131 (quotearg_n_style, quotearg_style): New functions.
3133 1999-08-08 Jim Meyering <meyering@ascend.com>
3135 * src/touch.c (usage): Clarify description of --time=WORD.
3138 * lib/savedir.c (savedir): Change type of name_size parameter to off_t.
3139 * lib/savedir.h (savedir): Update prototype.
3140 * src/chmod.c (change_dir_mode): Remove cast of savedir arg.
3141 * src/chown.c (change_dir_owner): Likewise.
3142 * src/chgrp.c (change_dir_group): Likewise.
3143 * src/copy.c (copy_dir): Likewise.
3144 * src/du.c (count_entry): Likewise.
3145 Suggestion from Bob Proulx.
3147 1999-08-07 Jim Meyering <meyering@ascend.com>
3149 * po/POTFILES.in: Add lots of lib/*.c files.
3150 Remove src/cp-hash.c, since it doesn't use _().
3152 1999-08-04 Jim Meyering <meyering@ascend.com>
3154 * configure.in: Remove getline-testing code. Now it's in m4/.
3156 1999-08-01 Paul Eggert <eggert@twinsun.com>
3158 * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
3160 1999-07-30 Jim Meyering <meyering@ascend.com>
3162 * src/ls.c (usage): Explain about default wrt --hide-control-chars and
3163 --show-control-chars. Reported by Germano Leichsenring.
3165 1999-07-28 Jim Meyering <meyering@ascend.com>
3167 * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
3169 1999-07-24 Jim Meyering <meyering@ascend.com>
3171 * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
3172 (dd_copy): Use those to page-align both the input and output buffers.
3174 1999-06-01 Volker Borchert <bt@teknon.de>
3176 * tests/Makefile.am: Make envvar-check depend on check-recursive rather
3177 than on `check' so that its tests are performed before any real tests.
3179 1999-07-15 Jim Meyering <meyering@ascend.com>
3181 * src/dd.c: Include getpagesize.h.
3182 (dd_copy): Page-align the input buffer.
3183 Based on a patch from Scott Lurndal.
3185 * getpagesize.h: New file.
3186 * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h.
3188 * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
3189 Work around SunOS botch also when block size is different from 1k.
3192 1999-07-10 Jim Meyering <meyering@ascend.com>
3194 * man/help2man: Import version 1.012.
3196 1999-07-04 Jim Meyering <meyering@ascend.com>
3198 * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax.
3200 1999-07-04 Paul Eggert <eggert@twinsun.com>
3202 * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
3203 expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
3204 (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
3207 1999-06-27 Paul Eggert <eggert@twinsun.com>
3209 Fix some incompatibilities between `df -P' and POSIX.2.
3211 * lib/human.h (enum human_inexact_style): New enum.
3212 (human_readable_inexact): New decl.
3214 * lib/human.c (human_readable): New function.
3215 (human_readable_inexact): Renamed from human_readable, with new arg
3216 INEXACT_STYLE. Add support for ceiling and floor.
3218 * src/df.c (print_header): Conform to POSIX if posix_format).
3219 (df_readable): Take ceiling if posix_format.
3220 (ceil_percent): New function.
3221 (show_dev): Take ceiling of percent if posix_format.
3222 Align with POSIX-conforming header if posix_format.
3224 * doc/fileutils.texi: Document these changes.
3226 1999-05-27 Volker Borchert <bt@teknon.de>
3228 * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
3230 1999-05-23 Jim Meyering <meyering@ascend.com>
3232 * src/copy.c (copy_internal): Don't apply the umask in move_mode.
3233 Otherwise, `mv' would not preserve the permissions when copying
3234 between partitions. Reported by David Godfrey
3238 * tests/cp/same-file: Correct erroneous expected output from
3239 the `cp -f foo foo' tests.
3240 * po/POTFILES.in: Add same.c.
3241 * lib/same.h: New file.
3242 * lib/same.c: New file (function extracted from ln.c).
3243 * lib/Makefile.am (libfu_a_SOURCES): Add same.c.
3244 (noinst_HEADERS): Add same.h.
3245 * src/copy.c: Include same.h.
3246 * src/ln.c (same_name): Remove function.
3247 <same.h>: Include this instead.
3248 <dirname.h>: No longer include this.
3249 * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'.
3251 * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not
3252 remove FILE. Suggestion from Chris Yeo.
3253 * tests/mv/force: New test, for the above fix.
3254 * tests/mv/Makefile.am (TESTS): Add force.
3255 (TESTS_ENVIRONMENT): Change PATH to be absolute.
3257 * tests/mv/force (mv): New test.
3259 1999-05-17 Paul Eggert <eggert@twinsun.com>
3261 * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we
3262 have an absolute timestamp, or if the relative timestamp
3263 mentions days, months, or years. Reported by Volker Borchert.
3265 * lib/human.c (human_readable): Allow from_block_size to be zero.
3267 1999-05-14 Jim Meyering <meyering@ascend.com>
3269 * tests/Makefile.am (envvar-check): Renamed from check-local.
3270 (check): Depend on envvar-check so the envvar check is performed
3271 before all other tests. Reported by Volker Borchert.
3272 * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
3273 so CDPATH is mentioned in the message. Reported by Volker Borchert.
3275 * src/df.c (main): When asking for info on an explicit file name,
3276 just warn rather than failing if the table of mounted filesystems
3277 cannot be read. Based on a patch from Mark Kettenis.
3279 * lib/version-etc.c (version_etc): Put version info and author names
3280 on the first two lines respectively rather than putting the three
3281 lines of copyright info between them.
3283 * src/touch.c (open_maybe_create): Handle Solaris' failure mode when
3284 FILE is a directory. Reported by Vin Shelton.
3286 * lib/human.c: Include <string.h> or <strings.h> for strlen prototype.
3287 * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes.
3288 * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on
3289 64-bit systems. From Ulrich Drepper.
3291 1999-05-12 Jim Meyering <meyering@ascend.com>
3293 * src/shred.c (main): Put `u' for -u in getopt_long's string argument.
3296 1999-05-07 Jim Meyering <meyering@ascend.com>
3300 * tests/touch/dir-1: New test.
3301 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual
3302 upper-case program names. Add a definition of PATH.
3305 * src/mkdir.c (main): Use better wording in diagnostic: `cannot
3306 create directory' rather than `cannot make directory'. The former
3307 also matches the one in makepath.c.
3309 * src/dd.c (apply_translations): Use TOUPPER and TOLOWER,
3310 not toupper and tolower.
3312 1999-05-05 Jim Meyering <meyering@ascend.com>
3314 * lib/makepath.c (make_dir): When reporting a mkdir failure and the
3315 target cannot be `stat'ed, use the errno from the failed mkdir call,
3316 not the one from the stat call. Before this change, running
3317 `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
3318 elicit `No such file or directory' instead of `Permission denied'.
3320 * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
3321 (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
3322 Based on a patch from Kaveh Ghazi.
3324 * src/ls.c (USE_ACL): Define this only #if
3325 (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
3326 Use `USE_ACL' in place of `HAVE_ACL' everywhere else. From Kaveh Ghazi.
3328 1999-05-04 Jim Meyering <meyering@ascend.com>
3330 * lib/makepath.c: Include makepath.h libintl.h, not after it.
3331 Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
3332 (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
3333 which is necessary on Irix4 since cc doesn't define __STDC__.)
3336 1999-04-30 Jim Meyering <meyering@ascend.com>
3338 * Makefile.maint: Define several tag-related make variables.
3339 (cvs-dist): Use the make variables instead of shell ones.
3340 (announcement): Automatically generate diffs for all ChangeLog files,
3341 not just the top level one.
3343 1999-04-30 Paul Eggert <eggert@twinsun.com>
3345 * lib/dup2.c: New file.
3347 1999-04-30 Jim Meyering <meyering@ascend.com>
3349 * src/touch.c (touch): Only do the fstat if we need to.
3350 Resort to calling stat for directories, but only when necessary.
3351 (usage): Mention --no-create.
3353 * src/copy.c (copy_internal): Move the one-file-system test so that
3354 it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
3355 Prior to this change, `cp --one-file-system' would traverse a file-
3356 system boundary if the destination directory existed. From Ton Hospel.
3358 1999-04-27 Paul Eggert <eggert@twinsun.com>
3360 * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO
3361 for output, to avoid confusion with closed input and output fds.
3362 (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
3364 (open_fd): New function.
3365 (main): Use it, instead of open, to ensure that file descriptors
3368 1999-04-26 Paul Eggert <eggert@twinsun.com>
3370 * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead
3373 * src/dd.c (skip): Don't fstat the input file; the result is
3376 1999-04-26 Jim Meyering <meyering@ascend.com>
3378 * tests/mv/into-self-2: Update to reflect this change by reversing
3379 the order of arguments so the symlink is the source, not the
3380 destination (otherwise, the mv command would now succeed).
3382 * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail.
3383 That is, even though source and destination are `the same,' don't fail
3384 if the destination is a symlink. From Peter Samuelson.
3386 1999-04-26 Paul Eggert <eggert@twinsun.com>
3388 * src/dd.c (main): If you can't open an output file (with
3389 seek=...) read-write, then open it for write and report an
3390 error if we can't seek.
3392 * lib/filemode.c (setst, ftypelet, mode_string):
3393 * lib/mkdir.c (mkdir):
3394 * lib/makepath.c (make_path):
3395 * lib/modechange.c (make_node_op_equals, mode_compile,
3396 mode_create_from_ref, mode_adjust):
3397 * lib/modechange.h (mode_adjust):
3398 * src/chmod.c (describe_change, change_file_mode):
3399 * src/copy.c (copy_reg, copy_internal):
3400 * src/copy.h (struct cp_options.umask_kill):
3401 * src/cp.c (do_copy, cp_option_init, main):
3403 * src/install.c (mode, cp_option_init, DIR_MODE):
3404 * src/mkdir.c (main):
3405 * src/mkfifo.c (main):
3406 * src/mknod.c (main):
3407 * src/mv.c (cp_option_init):
3408 * src/touch.c (open_maybe_create):
3409 Use proper mode_t types and macros.
3410 Don't assume the traditional Unix values for mode bits.
3412 * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH,
3413 S_IXOTH): Define if not defined.
3415 * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
3416 * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU):
3417 Define if not defined.
3418 * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
3419 Define if not defined.
3420 (CHMOD_MODE_BITS): New macro.
3421 * src/install.c (isodigit): Remove unused macro.
3423 * src/mkfifo.c, src/mknod.c (usage):
3424 Use symbolic mode as default, not octal.
3426 * lib/utime.c (utime_null):
3427 Don't pass 0666 to open; it's not needed and isn't
3428 guaranteed to be portable.
3430 * lib/filemode.h: <config.h>, <sys/types.h>: Include for mode_t.
3431 (mode_string): Now takes mode_t.
3433 * lib/modechange.h: Include <config.h>, <sys/types.h> for mode_t.
3434 (struct mode_change): Members affected and value are now mode_t instead
3437 * doc/fileutils.texi, doc/perm.texi:
3438 Don't assume traditional Unix mode numbering.
3440 * lib/modechange.c: modechange.h now includes sys/types.h.
3442 (isodigit, oatoi): Remove.
3443 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
3444 S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
3445 S_IRWXO): Define if not defined.
3446 (CHMOD_MODE_BITS): New macro.
3447 (mode_compile): Convert from octal with xstrtoul, not our own routine.
3449 1999-04-24 Jim Meyering <meyering@ascend.com>
3453 1999-04-22 Jim Meyering <meyering@ascend.com>
3455 * src/shred.c (word32): Don't use `#error'; it runs afoul of
3456 SunOS 4.1.4 cc. From Paul Eggert.
3458 * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
3460 1999-04-20 Paul Eggert <eggert@twinsun.com>
3462 Replace our temporary hack implementation of strtoumax with
3463 something very close to the real code in glibc.
3465 * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
3466 we now have a true replacement in strtoumax.c.
3467 (__strtol): Always define to strtoumax.
3468 (<stdlib.h>): No need to include.
3470 (my_strtoumax): Move this to strtoumax.c,
3471 rename it to strtoumax, and simplify.
3473 * lib/strtoull.c, lib/strtoumax.c: New files.
3475 * lib/strtol.c: Update to glibc 2.1.1 version.
3477 1999-04-20 Jim Meyering <meyering@ascend.com>
3479 * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
3480 (check-local): Also test and warn if CDPATH is set.
3482 1999-04-20 Paul Eggert <eggert@twinsun.com>
3484 * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
3486 * config.guess: New file (from autoconf).
3487 * config.sub: New file (from autoconf).
3489 * src/shred.c <config.h>: Include first, since it can do
3490 things like #define const, and this must be done before
3491 including any system headers.
3493 * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
3494 whether overflow occurred. Improve overflow-detection to use
3495 only one conditional branch total, rather than 2N+1
3496 conditional branches for an N-digit number.
3498 1999-04-18 Jim Meyering <meyering@ascend.com>
3500 * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
3501 strtouq, now that they're checked in m4/xstrtoumax.m4.
3503 1999-04-18 Paul Eggert <eggert@twinsun.com>
3505 * doc/fileutils.texi, src/shred.c (main, longopts):
3506 Use -u instead of -R for --remove, so that we can preserve
3507 future compatibility with rm.
3509 1999-04-18 Jim Meyering <meyering@ascend.com>
3511 * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
3512 (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
3515 1999-04-18 Paul Eggert <eggert@twinsun.com>
3517 Fix shred to do the right thing with off_t longer than long.
3518 Merge large-integer parsing code with similar code in dd.c,
3519 and put the resulting in lib/xstrtoumax.c so that other programs
3520 can use it. Instead of adding a new lib/xstrtoumax.h I thought
3521 it cleaner to put all the xstroto* declarations into a single
3522 header, which for now is lib/xstrtol.h for lack of a better place.
3523 (Mayby lib/xstdlib.h would be better? :-)
3525 I thought of several other problems with shredding regular files;
3526 shredding devices is much more reliable. So I changed the defaults
3527 to be more suitable for shredding devices; this should help encourage
3528 users to do the right thing.
3530 pfstatus isn't portable to environments with varying width
3531 fonts, or with internationalized environments where the byte
3532 count of the message is not the same as its print width.
3533 Rather than deal with this, I just simplified it to not do
3534 tricks with carriage-returns and spaces. (I'm also worried
3535 that vprintf may not return the right value on some hosts; I
3536 vaguelly recall this being a problem.) As a result, -v and -
3539 When removing a special file, try to truncate it first, but don't
3540 worry if this reports an error.
3542 Try to find the size of a non-regular file by seeking to its end.
3544 Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
3546 Some other minor bug fixes.
3548 * lib/xstrtoul.h: Remove this file.
3549 * lib/xstrtoumax.c: New file.
3551 * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
3553 * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
3554 (__strtol, __strtol_t, __xstrtol): New macros.
3556 * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
3557 New macros to specify the
3558 underlying function, its returned type, and our function. Default to
3559 values suitable for xstrtol.
3561 Include <ctype.h>, since we use its macros.
3563 (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
3564 (ISSPACE): New macro.
3566 (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
3569 (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
3570 whether STRING_TO_UNSIGNED is defined. Skip isspace chars, not
3571 isblank chars, to match strtol. When returning
3572 LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
3575 * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
3576 <inttypes.h>: Include if HAVE_INTTYPES_H.
3577 (_DECLARE_XSTRTOL): New macro.
3578 (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
3579 we need only one include file, not three.
3580 (_STRTOL_ERROR): Do not undef, as this is no longer needed.
3581 Reword overflow message so that it's independent of type.
3583 * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
3584 (noinst_HEADERS): Remove xstrtoul.h.
3586 * lib/xmalloc.c (xalloc_fail):
3587 Pass xalloc_msg_memory_exhausted through gettext.
3590 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
3591 (LookupWord, yylex): Don't pass negative char to ctype macros.
3593 * doc/fileutils.texi:
3594 Explain why shredding devices is more reliable, and why the
3595 default options are more suitable for devices.
3597 Remove withdrawn options -b or --no-contents, -c or --freed-contents,
3598 -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
3601 Add -R or --remove, -s or --size.
3603 -v can no longer be doubled.
3605 `file system' --> `filesystem' uniformly.
3607 * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
3609 * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
3610 "human.h", "xalloc.h": Include.
3611 (attribute): Remove; no longer needed.
3612 (xstrdup): New decl.
3613 (STDOUT_FILENO): New macro.
3614 (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
3616 The following changes have effect only if !HAVE_CONFIG_H.
3617 <ctype.h>: New include.
3618 (RETSIGTYPE): Remove bogus semicolon at end.
3619 (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
3621 (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
3622 Handle suffixes like the real routine does.
3623 (error): Remove bogus assignment of errno to errnum.
3624 (xmalloc, xstrdup): New functions.
3626 (O_NOCTTY): Define even if !HAVE_CONFIG_H.
3627 (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
3628 (OUTPUT_BLOCK_SIZE): New macro.
3629 (struct Options.verbose): Now a boolean, since we no longer have two
3630 levels of verbosity.
3631 (long_opts, usage, main): Remove -D or --device option. Invert -p or
3632 --preserve option, and rename it to -R or --remove.
3633 (usage): Describe G suffix.
3634 (usage): "-" no longer conflicts with -v.
3635 (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
3636 (ind): Portability fixes: return word32, not unsigned; multiply by
3637 sizeof (word32) instead of shifting left by 2.
3638 (isaac_refill, isaac_mix): Comment out size of array parameter, as
3639 ansi2knr mishandles this.
3640 (status_visible, status_pos, pfstatus, flushstatus): Remove, since
3641 pfstatus isn't portable to users with varying width fonts, or
3642 internationalized messages, and vfprintf is problematic. All callers
3643 of pfstatus changed to use error instead; this removes incompatibility
3644 of -v with -. All calls to flushstatus removed.
3645 (dopass, do_wipefd): Do not translate non-English msgs with gettext.
3647 (dopass): Cast lseek constant arguments to (off_t) for benefit
3648 of pre-ANSI compilers; fix one lseek call whose args were interchanged.
3649 Remove unnecessary casts to (off_t). Do not check for EIO
3650 when determining file size; this was just my earlier wild guess.
3651 Use human_readable to print off_t, instead of casting to unsigned long
3652 (which doesn't work in Solaris 2.6, where off_t is longer than long).
3653 Output human-readable sizes, instead of always using "K".
3654 Check for offset overflow (it happened to me in SunOS 4.1.4).
3655 (do_wipefd): Do not insist on regular files, but do check for special
3656 files that cannot possibly be shredded.
3657 Use xmalloc instead of malloc + check.
3658 Do not inspect st_size for non-regular files.
3659 Try to find the size of a non-regular file by seeking to its end.
3660 Do not assume that a regular file of size-0 has unknown size.
3661 Check for regular files with negative sizes,
3662 and for overflow after rounding to next block.
3663 Always try to truncate, even for special files, but do not report an
3664 error if truncation fails on a special file.
3666 (dopass, wipefile): Do not return 1 for special files; the caller
3667 doesn't care any more.
3669 (wipefd): Remove unnecessary (and nonportable) check for
3670 whether the file descriptor is read-only. Remove
3671 no-longer-needed check for `-v -'.
3673 (incname): Return 1 for carry bit, like the documentation says.
3675 (wipename, wipefile): Accept new argument, specifying the
3676 quoted file name. All callers changed.
3678 (wipename): Use xstrdup instead of strdup+error check.
3680 (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
3681 errors in NNN more carefully. Restore errno after the check.
3682 Check for errors when closing the file descriptor.
3683 Use more consistent wording when unable to remove a file.
3685 (main): Do not remove files by default.
3686 Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
3687 exist if !HAVE_CONFIG_H.
3688 In diagnostics, quote invalid operands to -n and -s options.
3689 Allow T, P, E, Z, and Y suffixes in -s operand.
3690 flags.verbose is now a boolean, not a counter.
3691 Use STDOUT_FILENO instead of 1, for clarity.
3694 Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
3695 xstrto... functions.
3697 * src/dd.c: Include xstrtol.h.
3698 (parse_integer): Migrate most of the work into the new xstrtoumax fn.
3700 * lib/xstrtoumax.c: New file.
3702 1999-04-18 Jim Meyering <meyering@ascend.com>
3704 * src/dd.c (main): Open the output file with *read* access
3705 only if we might need to read to satisfy a `seek=' request.
3706 From Matthias Urlichs.
3708 1999-04-10 Jim Meyering <meyering@ascend.com>
3710 * Makefile.maint (alpha): Add trailing slash for ncftp.
3714 * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
3715 * tests/Makefile.am (SUBDIRS): Add dd.
3716 * tests/dd: New directory
3717 * tests/dd/misc: New file.
3719 `ls --color' would segfault
3720 * src/ls.c: Include assert.h.
3721 (color_indicator[]): Add an entry for the type, `door.'
3722 (main): Assert that the lengths of the color_indicator and
3723 indicator_name arrays are appropriately related.
3724 Reported by John Gotts.
3726 * src/dd.c (scanargs): Fix bug introduced with last change: now that
3727 the loop is gone, manually decrement argc and increment argv.
3728 Reported by Andreas Jaeger and jvogel@linkny.com.
3730 1999-04-07 Jim Meyering <meyering@ascend.com>
3732 * lib/getdate.y (difftm): Protoize.
3734 1999-04-06 Jim Meyering <meyering@ascend.com>
3736 * lib/strftime.c: Update from master source in libc.
3738 1999-04-04 Jim Meyering <meyering@ascend.com>
3740 * tests/ln/misc: Comment out the test added on 1999-01-31.
3742 * Makefile.maint (url_dir_list): Define properly.
3743 (real_dir_list): Likewise.
3745 * src/shred.c: Don't include string.h.
3746 [!HAVE_CONFIG_H]: Include string.h here.
3747 [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
3748 (sigill_handler): Change return type and type of local `oldhandler' to
3750 (isaac_seed_machdep): Change and type of local `oldhandler' to
3756 * tests/cp/same-file: Change the sed command used to extract the
3757 filename from ls -l output, to accommodate the change in format.
3759 * src/ls.c (print_long_format): Add a space between %s and %3u. This
3760 assures that even when modebuf has the trailing `+' and there are more
3761 than 99 hard links to a file, the permissions string and the link count
3764 1999-04-03 Jim Meyering <meyering@ascend.com>
3766 * src/shred.c (dopass): add curly braces to avoid warning about
3768 (wipefd): Add parentheses suggested by gcc.
3769 (do_wipefd): Remove declaration of unused local.
3771 1999-04-02 Colin Plumb <colin@nyx.net>
3773 * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
3774 to allow standalone compilation.
3776 (wipefile): Added support for emulating /dev/fd/# files even if
3777 the OS doesn't support them. From Paul Eggert.
3779 (main, usage): Changed --device short option to -D.
3781 (wipefd, do_wipefd): Renamed function to do_wipefd and added
3782 separate wipefd that performs sanity checks on externally-opened file
3783 descriptors, such as not append-only. From Paul Eggert.
3785 (do_wipefd, isaac_seedfd): Do not read file for any reason.
3786 if the file is low-entropy, it's a security hole.
3787 (wipefile) Changed to open O_WRONLY and chmod to write-only when
3789 (isaac_seedfd) Function deleted as unnecessary.
3792 (dopass): Dynamically fall back to fsync() if fdatasync() fails,
3793 since POSIX, in their infinitesimal wisdom, encourage implementations
3794 that return constant -1, making compile-time testing useless.
3797 (dopass): Changed to support a size of -1 to mean "unknown".
3798 This entailed changing to a counting-up offset rather than couting-down
3799 cursize for the central state variable. Also changed size argument to
3800 be call-by-reference so that it can be passed back once known.
3801 (sizer) Function deleted as unnecessary.
3802 (wipefd): Changed to match. From Paul Eggert
3804 (dopass): Try to skip over bad blocks in destination files.
3805 Also added ftruncate() for more complete destruction of metadata.
3807 (main, usage): Changed "-" to stand for standard output.
3808 (wipefd): Added error message to detect conflict with -v.
3810 (dopass): Added periodic fsync() calls to keep the pass progress
3811 display in sync with reality. Hopefully they're sufficiently far spaced
3812 that throughput isn't affected. It might be a good thing to do even in
3813 non-verbose mode, to avoid filling up the kernel caches with dirty data.
3814 Also added ftruncate() for more complete destruction of metadata.
3816 (quotearg_colon): New function to print
3817 pathological filenames properly.
3818 [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
3819 that does most of the work.
3820 (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
3821 (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
3822 Error messages are also in a more uniform format.
3825 (struct Options, main, do_wipefd): Added -s/--size=N flag.
3826 (xstrtoul): Added support for valid_suffixes to help this.
3827 (usage) Documented it.
3829 (error): Changed some arguments from N_() to _(), since error()
3830 does not translate its argument. I think this is a bug.
3832 (struct Options do_wipefd, wipefd, wipefile, main): moved passes
3833 argument into the Options structure as n_iterations, which is now a
3834 size_t. From Paul Eggert.
3836 (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
3837 to manage seeding of RNG with arbitrary-sized data.
3838 (isaac_init): commented out as dead code.
3839 (isaac_seed): changed to use new functions to prevent any possibility of
3842 (isaac_seed): Added support for Solaris' gethrtime()
3843 configure.in: Corresponding feature test. From Paul Eggert.
3845 (wipename): Change remove() to unlink() for speed & portability.
3846 Use lstat() instead of access() to see if a filename is taken. This
3847 works even on dangling symlinks and avoids the suid problems of
3848 access(2). From Paul Eggert.
3850 (isaac_seed_machdep): New function for reading cycle counters
3852 1999-04-02 Paul Eggert <eggert@shade.twinsun.com>
3854 * configure.in (AC_CHECK_FUNCS): Add gethrtime.
3856 * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
3857 Use gethrtime if available. Don't assume that clock_gettime succeeds.
3858 Put most random sources first.
3860 1999-04-02 Paul Eggert <eggert@twinsun.com>
3862 shred: Add new options -bcCklL and fix some porting problems.
3863 Remove options -dp. Do not read output files.
3865 * src/shred.c (long_opts, usage, main, wipefile): Adjust to
3867 ("human.h", "quotearg.h"): New includes.
3868 (struct Options): New members contents, links, n_iterations.
3869 Remove allow_devices, remove_file. Change n_iterations to size_t.
3871 (output_block_size): New var.
3872 (usage): Declare __noreturn__ attribute.
3873 (fdatasync): Define to -1 if not present, since we need to invoke both
3874 fdatasync and fsync if both are present. All invokers of fdatasync
3875 now try fdatasync, then fsync.
3877 (isaac_seed): Use it to mix in values. Add uid, gid to mix.
3878 Don't use gettimeofday, as it has too many porting problems.
3879 (isaac_seedfd): Remove, since we no longer read the output files.
3880 (sizefd): Remove; we now determine size by writing sequentially.
3881 (dopass, wipename, wipefile, main): Clean up error messages.
3882 (dopass): Keep track of offset relative to start of file, not
3883 end, since we may not know how large the file is. If size is
3884 negative, write until we fall off the end of the file.
3885 (wipefd): Do not read output file.
3886 Return 0 if successful, -1 if not; do not make a special case for
3887 non-regular files, since our callers have that info now.
3888 (wipename): Now static. Return errno if error.
3889 (main): "-" now stands for standard output.
3890 Do not shred append-only standard output.
3891 (wipefile): Do not grant read permission to file when wiping it.
3892 Use symbolic permission (S_IWUSR), not octal.
3894 * src/system.h (S_IWUSR): Define if not already defined.
3896 * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
3897 (AC_CHECK_FUNCS): Remove gettimeofday.
3899 * doc/fileutils.texi: Document recent changes.
3901 1999-04-01 Jim Meyering <meyering@ascend.com>
3903 * configure.in (AC_CHECK_FUNCS): Add acl.
3904 (AC_CHECK_HEADERS): Add sys/acl.h.
3905 * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
3906 (struct fileinfo): New member `have_acl'.
3907 (gobble_file): Initialize it.
3908 (print_long_format): Use it.
3909 Mostly from Alen Muzinic.
3911 * src/touch.c (open_maybe_create): New function.
3912 (touch): Rewrite not to use `creat' and to eliminate a race
3913 condition that could make touch truncate a nonempty file.
3914 Report and suggestions from Andrew Tridgell.
3916 1999-03-31 Jim Meyering <meyering@ascend.com>
3918 * src/du.c: Remove prototypes and tsort function definitions.
3920 * src/chown.c (main): Move the declaration of `e' into the scope
3921 where it's used and make it `const'.
3923 * src/install.c (main): Qualify a char* with the `const' keyword.
3924 (install_file_in_dir): Likewise.
3925 * src/ln.c (main): Likewise.
3926 * src/mkdir.c (main): Likewise.
3927 * src/mkfifo.c (main): Likewise.
3928 * src/mknod.c (main): Likewise.
3929 * src/mv.c (main): Likewise.
3930 * src/touch.c (touch): Likewise.
3932 1999-03-30 Jim Meyering <meyering@ascend.com>
3934 * src/*.c: Don't include closeout.h or version-etc.h explicitly.
3935 Now, they're included via sys2.h.
3937 1999-03-29 Jim Meyering <meyering@ascend.com>
3939 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
3940 the catch-all for shared autoconf code, m4/jm-macros.m4.
3941 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
3944 1999-03-29 Paul Eggert <eggert@twinsun.com>
3946 Minor lint removal in code that forks and execs.
3948 * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
3949 against zero. This is to improve portability.
3950 * lib/rename.c (rename): Likewise.
3951 * lib/rmdir.c (rmdir): Likewise.
3953 * lib/rename.c (rename):
3954 (rename): Do not print any error messages, so that the messages
3955 are internationalized properly.
3957 * src/install.c (strip): Use standard "cannot fork" message.
3958 Check for strip nonzero exit status.
3960 1999-03-28 Jim Meyering <meyering@ascend.com>
3962 `chmod =OP' did not properly apply the umask
3963 * lib/modechange.c (make_node_op_equals): New function.
3964 (mode_append_entry): Likewise.
3965 (mode_compile): When none of [ugoa] is specified in an `=OP' change
3966 mode request, insert a `=0' entry into the linked list so that all
3967 bits are cleared first. Use the new functions.
3968 Reported by Andrew Dalke.
3970 New test for the above.
3971 * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
3972 * tests/Makefile.am (SUBDIRS): Add chmod.
3973 * tests/chmod: New directory
3974 * tests/chmod/equal-x: New file.
3976 1999-03-27 Jim Meyering <meyering@ascend.com>
3978 * lib/modechange.c (mode_compile): Upon allocation failure, free
3979 everything starting with the head, not the tail.
3981 * src/install.c (strip): Use pid_t, not int. From John Bley.
3983 1999-03-26 Jim Meyering <meyering@ascend.com>
3985 * src/dd.c (PROGRAM_NAME, AUTHORS): Define
3986 (long_options): Remove unused struct.
3987 (scanargs): Remove useless loop.
3988 (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
3989 * src/mvdir.c: Likewise.
3990 * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
3992 1999-03-25 Jim Meyering <meyering@ascend.com>
3994 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
3995 (noinst_HEADERS): Add version-etc.h.
3997 * lib/long-options.c (parse_long_options): Remove version-, copyright-,
3998 and author-printing code. Do it via version_etc.
4000 * lib/version-etc.c: New file.
4001 * lib/version-etc.h: Prototype for same.
4003 * src/sys2.h (GETOPT_HELP_CHAR): Define.
4004 (GETOPT_VERSION_CHAR): Define.
4005 (GETOPT_HELP_OPTION_DECL): Define.
4006 (GETOPT_VERSION_OPTION_DECL): Define.
4007 (case_GETOPT_HELP_CHAR): Define.
4008 (case_GETOPT_VERSION_CHAR): Define.
4010 * src/chgrp.c: No longer include long-options.h.
4011 Include version-etc.h instead.
4012 (PROGRAM_NAME, AUTHORS): Define.
4013 [long_options]: Add entries for --help and --version.
4014 Remove parse_long_options call.
4015 (main) [getopt switch]: Add a case for each of --help and --version.
4016 * src/chgrp.c: Likewise.
4017 * src/chmod.c: Likewise.
4018 * src/cp.c: Likewise.
4019 * src/df.c: Likewise.
4020 * src/dircolors.c: Likewise.
4021 * src/du.c: Likewise.
4022 * src/install.c: Likewise.
4023 * src/ln.c: Likewise.
4024 * src/ls.c: Likewise.
4025 * src/mkdir.c: Likewise.
4026 * src/mkfifo.c: Likewise.
4027 * src/mknod.c: Likewise.
4028 * src/mv.c: Likewise.
4029 * src/rm.c: Likewise.
4030 * src/rmdir.c: Likewise.
4031 * src/shred.c: Likewise.
4032 * src/touch.c: Likewise.
4034 1999-03-24 Jim Meyering <meyering@ascend.com>
4036 * man/help2man: Import version 1.010.
4038 1999-03-22 Jim Meyering <meyering@ascend.com>
4040 * src/chmod.c (usage): Add one-liner. Suggestion from Karl Berry.
4042 1999-03-19 Jim Meyering <meyering@ascend.com>
4044 * src/automake-wrap: Rewrite the automake-generated rule for
4045 clean-binPROGRAMS so that it removes rm even with a losing PATH on a
4046 losing system (PATH with `.' before /bin on a system where you can't
4047 unlink a running executable). Reported by William Bader.
4049 * configure.in: Use jm_WINSIZE_IN_PTEM.
4050 * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
4051 Required by SCO ODT 2.0 systems. Reported by William Bader.
4053 1999-03-18 Jim Meyering <meyering@ascend.com>
4055 * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
4056 (remove_init): Call hash_initialize with one more argument.
4058 1999-03-15 Jim Meyering <meyering@ascend.com>
4060 Revamp to allow fine-tuning to control when and by how
4061 much the table grows and shrinks.
4062 * lib/hash.c (next_prime): Don't assert.
4063 (hash_reset_tuning): New function.
4064 (check_tuning): New function.
4065 (hash_initialize): Accept and use new tuning parameter.
4066 (hash_rehash): Rewrite, updating for tuning.
4067 (hash_insert): Honor tuning semantics.
4068 (hash_delete): Likewise.
4069 From François Pinard.
4071 * lib/hash.h (struct hash_tuning): Define.
4072 (struct hash_table) [tuning]: Add member.
4073 (hash_initialize): Add `tuning' parameter.
4075 * lib/hash.c (hash_insert): Remove last parameter and change semantics.
4076 * lib/hash.h (hash_insert): Update prototype.
4078 * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
4079 otherwise, we'd do so even when the insertion failed.
4080 From François Pinard.
4082 1999-03-07 Jim Meyering <meyering@ascend.com>
4084 * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
4085 have to be scanned for % signs. Suggestion from François Pinard.
4087 * Makefile.maint: Add two more URLs and the loops to use them.
4089 * lib/long-options.c (parse_long_options): Include `Copyright...' line
4090 in --version output.
4091 Add the `...NO warranty...' message.
4093 1999-03-03 Jim Meyering <meyering@ascend.com>
4095 * lib/long-options.c (_): Define it.
4096 (parse_long_options): Accept new parameter, authors, and print it.
4098 * lib/long-options.h: Update prototype.
4100 * src/chgrp.c: Include long-options.h
4101 [long_options]: Remove the "help" and "version" entries.
4102 (main): Use parse_long_options, including author name(s).
4103 Remove the show_version and show_help blocks.
4104 * src/chmod.c: Likewise.
4105 * src/chown.c: Likewise.
4106 * src/cp.c: Likewise.
4107 * src/dd.c: Likewise.
4108 * src/df.c: Likewise.
4109 * src/dircolors.c: Likewise.
4110 * src/du.c: Likewise.
4111 * src/install.c: Likewise.
4112 * src/ln.c: Likewise.
4113 * src/ls.c: Likewise.
4114 * src/mkdir.c: Likewise.
4115 * src/mkfifo.c: Likewise.
4116 * src/mknod.c: Likewise.
4117 * src/mv.c: Likewise.
4118 * src/mvdir.c: Likewise.
4119 * src/rm.c: Likewise.
4120 * src/rmdir.c: Likewise.
4121 * src/shred.c: Likewise.
4122 * src/sync.c: Likewise.
4123 * src/touch.c: Likewise.
4125 1999-02-18 Paul Eggert <eggert@twinsun.com>
4127 * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
4128 The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
4130 1999-02-17 Jim Meyering <meyering@ascend.com>
4132 * src/shred.c (wipename): Fix string thinko. Now, shredding files
4133 in subdirectories works (dir/file). From Janos Farkas.
4135 1999-02-13 Jim Meyering <meyering@ascend.com>
4137 * src/dircolors.c (dc_parse_stream): Don't try to dereference
4138 NULL if there's an error in our built-in list.
4139 Suggestion from François Pinard.
4141 1999-02-13 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4143 * src/install.c (main): Set x.backup_type only if backups are requested.
4144 (cp_option_init): Initialize backup_type.
4145 (backup_type): Remove unused variable.
4147 * doc/fileutils.texi: Fix use of @item vs @itemx.
4149 1999-02-08 Jim Meyering <meyering@ascend.com>
4151 * src/dircolors.c (slack_codes): Add "DOOR".
4152 (ls_codes): Add corresponding "do".
4153 Reported by John Gotts.
4155 * configure.in (ALL_LINGUAS): Add Italian (it).
4157 1999-02-07 Jim Meyering <meyering@ascend.com>
4159 * Version 4.0d (aka 4.1-b4).
4161 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
4162 is hooked up to the distcheck rule.
4163 * Makefile.am (distcheck-hook): New target and rule -- link to shared
4164 rule, my-distcheck, in Makefile.maint.
4166 * doc/fileutils.texi (shred invocation): New section. From Colin Plumb.
4168 * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
4169 group-member.m4, and just use this new macro.
4170 Use `.$ac_objext', not the literal `.o'.
4172 1999-02-02 Jim Meyering <meyering@ascend.com>
4174 * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
4175 Define to zero if not already defined.
4176 (HAVE_SYMLINKS): Define.
4177 (gobble_file): Remove #ifdef.
4178 (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
4179 rather than #ifdef S_ISLNK.
4180 (print_type_indicator): Remove #ifdefs and reorganize.
4181 (print_color_indicator): Remove #ifdefs.
4182 (length_of_file_name_and_frills): Likewise.
4184 1999-02-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
4186 * src/dircolors.hin: Handle DOOR.
4188 * src/ls.c (print_type_indicator): Print doors as '>'.
4189 (length_of_file_name_and_frills): Account for this.
4190 (indicator_no): Define C_DOOR.
4191 (indicator_name): Add corresponding name.
4193 * lib/filemode.c (ftypelet): Handle doors.
4195 * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
4197 1999-02-01 Jim Meyering <meyering@ascend.com>
4199 * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
4200 argument list. From Akim Demaille.
4202 1999-01-31 Jim Meyering <meyering@ascend.com>
4204 * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
4205 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
4207 * tests/ln/misc: Add test for this.
4208 * src/ln.c (do_link): Allow creation of a hard link to a dangling
4209 symlink. Reported by Alexey Solovyov.
4211 * src/copy.c (copy_internal): Describe any backup-related renaming
4212 operations when in verbose mode.
4213 (copy_internal): Likewise.
4214 Based on changes from Marty Leisner.
4216 * lib/lchown.c: Declare chown.
4218 1999-01-30 Jim Meyering <meyering@ascend.com>
4220 * acconfig.h: Remove uintmax and STAT* #undefs.
4221 * configure.in: Require autoconf 2.13.
4222 Remove test for AFS.
4223 Use 3-argument form of AC_DEFINE*.
4225 1999-01-28 Jim Meyering <meyering@ascend.com>
4227 * po/POTFILES.in: Add src/shred.c.
4229 * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
4230 TM_IN_SYS_TIME based one (for shred).
4232 * acconfig.h: Remove lots of `#undef's, now that we use the
4233 3-argument forms of AC_DEFINE* macros.
4235 1999-01-25 Jim Meyering <meyering@ascend.com>
4237 * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
4239 (AC_CHECK_FUNCS): Add clock_gettime.
4241 * src/shred.c (isaac_seed): Guard clock_gettime with test of
4242 HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
4243 (wipename): Rename local dirfd to dir_fd to avoid shadowing the
4244 function declared in Linux's dirent.h.
4246 1999-01-25 Akim Demaille <demaille@inf.enst.fr>
4248 * lib/argmatch.h (ARRAY_CARDINALITY): Define.
4249 (ARGMATCH_ASSERT): New macro.
4251 * lib/argmatch.c (program_name): Remove dcl.
4253 (argmatch_invalid): Use error rather than fprintf.
4255 1999-01-24 Jim Meyering <meyering@ascend.com>
4257 * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
4258 New version from L. Peter Deutsch.
4260 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
4261 (and hence that of the local `n1', too) to `int' at Paul's request.
4263 * lib/closeout.c: Add comments.
4265 * src/shred.c (fdatasync): Remove function. instead, ...
4266 (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
4269 1999-01-23 Jim Meyering <meyering@ascend.com>
4271 * src/Makefile.am (bin_PROGRAMS): Add shred.
4272 * src/shred.c: New file.
4275 (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
4276 only when in verbose mode.
4277 (fdatasync) [! HAVE_FDATASYNC]: New function.
4279 * man/Makefile.am (man_MANS): Add shred.1.
4280 * man/Makefile.summ (shred-summary): Define.
4281 * man/shred.x: New file.
4283 * src/shred.c: New file. From Colin Plumb.
4284 Include config.h, getopt.h, system.h and error.h.
4285 Use #else/#if, not #elif.
4287 1998-11-05 Paul Eggert <eggert@twinsun.com>
4289 * lib/mktime.c (__mktime_internal): Adopt the traditional (and
4290 problematic) notion of what to do when tm_isdst doesn't match.
4292 1999-01-17 Jim Meyering <meyering@ascend.com>
4294 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
4295 than setting RM and CP.
4296 * tests/cp/*: Now that PATH is set properly, use rm and cp rather
4299 * tests/ln/Makefile.am (TESTS): Add backup-1.
4300 (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
4301 * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
4302 * tests/ln/backup-1: New test for this.
4303 * src/ln.c (do_link): Try to remove DEST even after renaming it.
4304 This fixes a bug reported by Jamie Lokier.
4306 * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
4308 1999-01-16 Jim Meyering <meyering@ascend.com>
4310 * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
4312 * acconfig.h: Remove @BOTTOM@ section.
4313 Instead, add the define and decl via m4/jm-macros.m4.
4315 * src/ls.c: Don't declare base_name.
4316 Use function-style XARGMATCH once again.
4317 * src/touch.c: Likewise.
4318 * acconfig.h: Add a @BOTTOM@ section.
4319 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
4323 * src/cp.c: Remove declarations of base_name and get_version.
4324 (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
4325 Use xget_version and function-style XARGMATCH.
4326 * src/mv.c (main): Likewise.
4327 * src/ln.c (main): Likewise.
4328 * src/install.c (main): Likewise.
4329 * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
4330 unsigned int, not just int.
4331 * lib/backupfile.h (get_version): Adjust prototype.
4332 (xget_version): Add prototype.
4333 (base_name): Remove prototype.
4334 * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
4335 (backup_args): Reorder enum members.
4336 (backup_types): Likewise.
4337 (get_version): Take an additional parameter, `context'.
4338 (xget_version): Like get_version, but if the `version' argument is NULL,
4339 use the value of the envvar VERSION_CONTROL.
4340 (base_name): Declare.
4341 Mostly from Akim Demaille.
4343 * lib/addext.c (base_name): Declare.
4344 * src/sys2.h: Add prototype for base_name.
4346 * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
4347 * lib/argmatch.h: Likewise.
4349 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
4350 (XARGCASEMATCH): Likewise.
4352 * lib/argmatch.c (EXIT_FAILURE): Define.
4353 (ARGMATCH_DIE): Provide default.
4354 (__xargmatch_internal): New function.
4355 s/rogram_name/program_name.
4358 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
4360 * src/touch.c (usage): Don't make it static so that it can be
4361 called from libfu.a by xargmatch.
4362 * src/chgrp.c (usage): Likewise
4363 * src/chmod.c (usage): Likewise
4364 * src/chown.c (usage): Likewise
4365 * src/cp.c (usage): Likewise
4366 * src/dd.c (usage): Likewise
4367 * src/df.c (usage): Likewise
4368 * src/dircolors.c (usage): Likewise
4369 * src/du.c (usage): Likewise
4370 * src/install.c (usage): Likewise
4371 * src/ln.c (usage): Likewise
4372 * src/ls.c (usage): Likewise
4373 * src/mkdir.c (usage): Likewise
4374 * src/mkfifo.c (usage): Likewise
4375 * src/mknod.c (usage): Likewise
4376 * src/mv.c (usage): Likewise
4377 * src/mvdir.c (usage): Likewise
4378 * src/rm.c (usage): Likewise
4379 * src/rmdir.c (usage): Likewise
4380 * src/sync.c (usage): Likewise
4382 1999-01-12 Akim Demaille <demaille@inf.enst.fr>
4384 * lib/backupfile.c (get_version): added the parameters KIND.
4385 (xget_version): like get_version, but if argument is NULL, honor
4386 the envvar VERSION_CONTROL.
4387 * src/cp.c: Remove declarations of base_name and get_version.
4388 (main): Use xget_version.
4389 * src/mv.c (main): Likewise.
4390 * src/ln.c (main): Likewise.
4391 * src/install.c (main): Likewise.
4393 1999-01-12 Jim Meyering <meyering@ascend.com>
4395 * configure.in (ALL_LINGUAS): Add Greek (el).
4396 * po/el.po: New file.
4398 * install-sh: New version from autoconf.
4399 * missing: New version from automake.
4400 * src/ansi2knr.c: Likewise.
4401 * lib/getopt.c: New version from glibc.
4402 * lib/getopt.h: Likewise.
4403 * lib/getopt1.c: Likewise.
4404 * lib/regex.c: Likewise.
4405 * lib/regex.h: Likewise.
4406 * lib/ylwrap: Remove unused file.
4408 1999-01-10 Jim Meyering <meyering@ascend.com>
4410 * Version 4.0c (aka 4.1-b3).
4412 * Upgrade to autoconf-2.13 and automake-1.3b.
4414 * src/copy.c (copy_internal): Handle two more values of errno from
4415 failed rename of a directory into a subdirectory of itself.
4416 Thanks to Volker Borchert for testing many types and combinations
4419 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
4420 to escape_quoting_style.
4421 (argmatch_invalid): Now that the quoted quantity is no longer double
4422 quoted, remove the code that removed leading and trailing double quotes.
4424 * src/ls.c (decode_switches): Now that escape_quoting_style no longer
4425 escapes the SPACE character, arrange for SPACEs to be quoted here.
4426 * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
4427 it no longer escapes ` '.
4428 Suggestion from Paul Eggert.
4430 1999-01-05 Jim Meyering <meyering@ascend.com>
4432 * configure.in (space): Add `for' in message of statvfs check.
4433 From Ulrich Drepper.
4435 1999-01-04 Jim Meyering <meyering@ascend.com>
4439 1999-01-02 Jim Meyering <meyering@ascend.com>
4441 * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
4442 offending quoted argument before using it in explanatory diagnostic.
4443 Use a single fprintf stmt.
4445 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
4446 modify a parameter. Add a `Die_stmt' parameter.
4448 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
4449 (argmatch_to_argument): Add `const' attribute to first parameter.
4451 * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
4452 done in m4/jm-macros.m4).
4454 * lib/backupfile.c (get_version): Adapt to use new interface to
4456 * src/cp.c: Likewise.
4457 * src/ls.c: Likewise.
4458 * src/touch.c: Likewise.
4460 1999-01-01 Jim Meyering <meyering@ascend.com>
4462 * lib/makepath.c (make_dir): New function, factored out of make_path.
4463 (make_path): Use make_dir rather than open-coding it twice.
4464 This effectively reverses the order of the latter pair of stat/mkdir
4465 calls and fixes a race condition bug whereby one of two concurrent
4466 `mkdir -p' processes could fail with EEXIST.
4467 Include locale.h and libintl.h, and define `_()'.
4468 Mark translatable strings.
4470 * lib/xmalloc.c: Add comments.
4471 (xcalloc, xmalloc, xrealloc): Remove prototypes.
4472 (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
4473 * lib/xalloc.h: Add comments.
4474 (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
4475 (xcalloc, xmalloc, xrealloc): Add prototypes here.
4476 Based on changes from Akim Demaille.
4478 * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
4479 (quotearg_n): Change type of 1st parameter from int to unsigned int.
4480 (quotearg_n_options): Likewise.
4481 * lib/quotearg.h (quoting_style_vals): New public array.
4483 (quotearg_n_options): Declare `options' parameter to be `const'.
4485 * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
4487 * lib/backupfile.c (get_version): Use XARGMATCH in place of
4490 1998-12-31 Jim Meyering <meyering@ascend.com>
4492 * src/ls.c (indicator_style_types): New variable.
4493 (format_types): Rename from `formats'.
4494 (color_args): Remove unnecessary `no' string.
4495 (color_types): Remove corresponding `color_never' entry.
4496 (main): Use ARGMATCH_TO_ARGUMENT.
4497 (decode_switches): Use ARGMATCH instead of argmatch code
4498 in each of several cases.
4501 * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
4502 * src/touch.c (main): Likewise.
4503 * lib/backupfile.c (get_version): Likewise.
4506 * lib/strncasecmp.c: New file.
4507 * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
4508 * lib/argmatch.c (strncasecmp): Move to a separate file.
4509 Add curly braces around some one-stmt-but-multiline blocks.
4511 * lib/argmatch.c: Improvements from Akim Demaille.
4512 * lib/argmatch.h: Likewise.
4514 * lib/addext.c (addext): Protoize.
4515 Indent cpp directives to match nesting.
4517 Fix warnings from gcc -W -Wall
4518 * lib/posixtm.c (posix_time_parse): Change type of index `i' from
4519 int to unsigned int.
4520 * lib/getdate.y (__attribute__): Define.
4521 (ATTRIBUTE_UNUSED): Define.
4522 (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
4523 (MonthDayTable): Add initializers for last entry.
4524 (UnitsTable): Likewise.
4525 (OtherTable): Likewise.
4526 (MilitaryTable): Likewise.
4528 1998-12-22 Jim Meyering <meyering@ascend.com>
4532 * configure.in (ALL_LINGUAS): Add chinese (zh).
4534 1998-12-19 Jim Meyering <meyering@ascend.com>
4536 * tests/ln/misc: Use absolute path for final rm.
4538 * Makefile.maint (my-distcheck): Run make with
4539 CFLAGS='-Wformat -Werror'.
4541 1998-12-18 Jim Meyering <meyering@ascend.com>
4543 * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
4544 from format string. From Michiel Bacchiani.
4546 * src/chgrp.c (MAXGID): Define.
4547 Use gid_t (not int) as the type for `group' variables.
4548 (parse_group): Use MAXGID, not INT_MAX.
4550 * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
4551 * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
4553 1998-12-13 Jim Meyering <meyering@ascend.com>
4555 * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
4557 1998-12-12 Jim Meyering <meyering@ascend.com>
4559 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
4560 * src/ls.c: Group DIRED's code together.
4561 (full_time, inhibit_group, col_ext_type): Declare static.
4562 (dired_dump_obstack): Apply sizeof to variable, instead of its type.
4563 (parse_ls_color): Rename ext2 as e2. Move into the block where it
4566 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
4567 * src/ls.c: In order to distinguish col(umn|or):
4568 (init_column_info): Renamed from init_col_info.
4569 (struct column_info): Renamed from struct col_info.
4570 (struct color_ext_type): Renamed from struct col_ext_type.
4572 1998-12-11 Jim Meyering <meyering@ascend.com>
4574 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
4576 * lib/stat.c: Remove file.
4577 * lib/lstat.c: Remove file.
4578 * lib/xstat.in (xstat@): New file.
4580 * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
4582 * tests/ls-2/tests: Add a test for this.
4584 * man/help2man: import version 1.006.
4586 1998-12-07 Jim Meyering <meyering@ascend.com>
4588 * src/copy.c: Use dir_name, not dirname. Include dirname.h.
4589 * src/cp.c: Likewise.
4590 * src/df.c: Likewise.
4591 * src/install.c: Likewise.
4592 * src/ln.c: Likewise.
4593 * src/mvdir.c: Likewise.
4595 * lib/dirname.c (dir_name): Rename from dirname.
4596 Make argument `const'. Include "dirname.h"
4597 * lib/dirname.h: New file.
4598 * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
4600 1998-12-06 Jim Meyering <meyering@ascend.com>
4602 * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
4603 `^[yY]' and `^[nN]' (avoiding regex). From Karl Heuer.
4605 * lib/*.c: Ansideclify.
4607 Fix `ls -R .' formatting bug that broke mktexlsr.
4608 * src/ls.c: Include path-concat.h.
4609 (basename_is_dot_or_dotdot): New function, derived from
4610 is_not_dot_or_dotdot.
4611 (is_not_dot_or_dotdot): Remove function.
4612 (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
4613 instead of is_not_dot_or_dotdot and use path_concat instead of attach.
4615 * tests/ls-2/tests: New file (renamed from quoting),
4616 with new test for the `ls -R .' fix.
4617 * tests/ls-2/quoting: Remove file.
4618 * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
4620 1998-11-29 Jim Meyering <meyering@ascend.com>
4622 * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
4623 * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
4625 * src/dd.c (dd_copy): Rename function from `copy'.
4627 * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
4629 Per Kristian Hove reported that a certain move-directory-into-self
4630 wasn't properly diagnosed.
4632 * tests/mv/into-self-3: New file.
4633 * tests/mv/Makefile.am (TESTS): Add into-self-3.
4634 * src/copy.c (copy_internal): Remove earlier (but less effective)
4635 test for move/copy-into-self.
4636 Instead, deduce the move-into-self condition from errno==EINVAL
4637 after a failed rename.
4638 * src/mv.c (do_move): Don't arrange to remove DEST in the
4639 copied-into-self case.
4641 1998-11-15 Jim Meyering <meyering@ascend.com>
4643 Bob McCracken reported that mv couldn't handle certain combinations
4644 of hard linked source files.
4646 * tests/mv/hard-link-1: New file.
4647 * tests/mv/Makefile.am (TESTS): Add hard-link-1.
4648 * src/mv.c (movefile): Don't free new_dest.
4650 * lib/error.c (error): Don't use strerror_r's return value.
4651 From Johan Danielsson.
4653 1998-11-14 Jim Meyering <meyering@ascend.com>
4657 * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
4658 to avoid matching a prefix of another tag.
4660 1998-11-10 Jim Meyering <meyering@ascend.com>
4662 * configure.in (ALL_LINGUAS): Add Greek (el).
4663 * po/el.po: New file.
4665 1998-11-07 Jim Meyering <meyering@ascend.com>
4669 Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
4670 work on Hurd systems because of an inline definition of lstat in a
4671 system header file). This also makes it so that you may run `ls '' '
4672 on systems that let l?stat operate on the empty string.
4674 * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
4675 and declare the latter.
4676 * lib/stat.c [stat]: Remove #undef.
4677 (rpl_stat): Protoize.
4678 * lib/lstat.c [lstat]: Remove #undef.
4679 (rpl_lstat): Protoize. Use ENOENT, not EINVAL, to be consistent
4681 * acconfig.h: Remove #undef's for lstat and stat.
4683 1998-10-31 Jim Meyering <meyering@ascend.com>
4685 * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
4687 * tests/rm/empty-name: New file.
4689 * acconfig.h (stat): New #undef.
4690 This omission was uncovered when Mark Kettenis reported that
4691 `rm -r ''' got a failed assertion on the Hurd. This change
4692 doesn't fix *that* problem -- see above.
4694 1998-10-25 Jim Meyering <meyering@ascend.com>
4698 * README: Man pages will now be supported to the extent that
4699 people send patches.
4701 * tests/rm/unreadable: Two new tests.
4702 * tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
4703 it out since we're so close to release and since the test compares the
4704 text of diagnostics that are likely to vary between systems.
4705 (TEST_ENVIRONMENT): Add required framework.
4707 * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
4708 pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
4709 Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
4710 (remove_dir): Return `status', rather than always RM_OK.
4712 1998-10-18 Jim Meyering <meyering@ascend.com>
4716 * lib/mktime.c: Update from libc with this additional change from Paul.
4717 * lib/strftime.c: Likewise.
4719 1998-10-17 Paul Eggert <eggert@twinsun.com>
4721 Don't invoke localtime_r or gmtime_r unless it's the GNU C
4722 library's localtime_r and gmtime_r; there are too many buggy
4723 implementations of localtime_r and gmtime_r out there, and
4724 it's not worth keeping track of all the different bugs.
4726 * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
4727 (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
4728 Base it on localtime unless _LIBC.
4730 * strftime.c (__EXTENSIONS__): Remove.
4731 (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
4732 (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
4733 Base them on localtime/gmtime if not _LIBC.
4735 1998-10-17 Jim Meyering <meyering@ascend.com>
4739 * lib/mktime.c: Declare localtime_r if necessary.
4740 * lib/strftime.c: Likewise.
4742 * tests/Fetish.pm (run_tests): Run $prog with --version only
4745 1998-10-11 Jim Meyering <meyering@ascend.com>
4749 1998-10-08 Paul Eggert <eggert@twinsun.com>
4751 * mktime.c (__mktime_internal): When the requested time falls
4752 in a spring-forward gap of size DT, return a time that is DT
4753 away from the requested time, preferring a time whose tm_isdst
4754 differs from the requested value. Bump the max number of
4755 probes from 4 to 6 to account for the extra probes needed to
4756 discover a spring-forward gap in the worst case.
4758 1998-10-08 Paul Eggert <eggert@twinsun.com>
4760 * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
4761 Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
4762 a body that merely expands localtime_r; this works around a
4763 bug in Digital Unix 4.0A and 4.0D.
4765 1998-10-05 Jim Meyering <meyering@ascend.com>
4767 * po/Makefile.in.in (uninstall): Remove (historical?) command that
4768 removed po-Makefile.in.in. From Akim Demaille.
4770 * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
4773 1998-10-04 Jim Meyering <meyering@ascend.com>
4775 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
4778 1998-10-03 Jim Meyering <meyering@ascend.com>
4782 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
4784 * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
4785 Instead, depend on corresponding source file and on configure.in.
4786 Based on suggestion and code from Akim Demaille.
4787 Factor out irregular men into Makefile.summ.
4789 * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
4791 * man/Makefile.summ: New file.
4792 * man/Makefile.maint: Include it.
4794 * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
4796 * tests/mv/Makefile.am (TESTS): Add i-1.
4797 * tests/mv/i-1: New test.
4799 1998-10-02 Jim Meyering <meyering@ascend.com>
4801 * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
4802 * tests/ls-2/run-test: Remove file.
4803 * tests/ls-2/quoting: Include /bin/sh driver framework.
4805 * tests/dircolors/simple: Remove file.
4806 * tests/dircolors/run-test: Embed it here instead.
4807 * tests/dircolors/simple: Rename from run-test.
4809 1998-10-01 Jim Meyering <meyering@ascend.com>
4811 * tests/Makefile.am (EXTRA_DIST): Remove README.
4814 1998-09-28 Jim Meyering <meyering@ascend.com>
4818 * Use automake-1.3b. See notes in README.
4820 * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
4821 Otherwise, `touch a b; echo n|mv -i a b' would remove b.
4824 1998-09-27 Jim Meyering <meyering@ascend.com>
4828 * Makefile.maint (alpha): New target.
4829 (my-distcheck): Tweak.
4831 * lib/backupfile.h: Protect against multiple inclusion.
4834 * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
4835 Now, it is invoked through jm_MACROS.
4837 * lib/strftime.c (my_strftime): Update from FSF.
4839 1998-09-26 Jim Meyering <meyering@ascend.com>
4841 * src/copy.c (copy_internal): Don't preserve hard-linked directories
4842 to avoid damaging the destination filesystem when copying from a
4843 Netapp snapshot directory. With code from Kjetil Torgrim Hollstein
4846 1998-09-24 Jim Meyering <meyering@ascend.com>
4848 * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
4851 1998-09-21 Jim Meyering <meyering@ascend.com>
4853 * man/Makefile.maint ($(man_MANS)): Remove `echo'.
4855 1998-09-20 Jim Meyering <meyering@ascend.com>
4859 * src/install.c (install_file_to_path) [-D]: Create any leading
4860 directories with permissions of 0755.
4862 1998-09-19 Jim Meyering <meyering@ascend.com>
4864 * src/install.c (install_file_to_path): Copy the file after creating
4865 any leading directories.
4866 (main) [case 'v']: Set `x.verbose' to 1, not 0.
4867 Reported by Marty Leisner.
4869 * man/Makefile.am (transform): Define.
4870 (man_MANS): Include ginstall.1, not install.1, to match the name
4871 of the executable in ../src.
4872 * man/ginstall.x: New file.
4873 * man/install.x: Remove file.
4874 * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
4876 * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
4877 Reported by Akim Demaille.
4879 * lib/modechange.c: Fix post-protoization typo.
4881 * lib/posixtm.h (PARAMS): Define and use.
4884 1998-09-12 Jim Meyering <meyering@ascend.com>
4888 * src/remove.c (remove_cwd_entries): Declare to be static.
4890 Automatically generate man pages from combination of --help
4891 output and the contents of new, man/*.x files.
4892 * man/Makefile.am (HELP2MAN): Define.
4894 (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
4895 (MAINTAINERCLEANFILES): Add $(man_MANS).
4896 * man/*.x: New files.
4897 * man/GNUmakefile: New file.
4898 * man/Makefile.maint: New file.
4899 * man/help2man: New file.
4901 1998-09-09 Jim Meyering <meyering@ascend.com>
4903 * lib/modechange.c: Protoize.
4905 1998-09-07 Jim Meyering <meyering@ascend.com>
4909 * src/df.c (show_dev) [!posix_format]: When using --print-type,
4910 let the device path and the file system type share a single (wider)
4911 field if their combined lengths allow it. From Andries Brouwer.
4913 * tests/touch/empty-file: Upon failure, suggest how to rerun the test
4914 with longer delay, in case NFS clock skew was the cause of the failure.
4915 Reported by Kaveh Ghazi.
4917 * tests/ls-2/quoting: Add tests.
4918 * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
4919 (_create_file): Don't include $$ in temp file name.
4920 (run_tests): Use shorter suffixes for temp file names.
4922 1998-09-06 Jim Meyering <meyering@ascend.com>
4924 * src/touch.c: Include posixtm.h.
4925 (usage): Correct the description of the format of the
4926 date string argument to -t option.
4927 (main): Update to use rewritten posixtime function.
4928 Reported by Andries Brouwer.
4930 * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
4931 (noinst_HEADERS): Add posixtm.h.
4933 * lib/posixtm.h: New file.
4934 * lib/posixtm.c: New file. Rewritten based on posixtm.y.
4935 * lib/posixtm.y: Remove file.
4937 1998-09-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4939 * src/ls.c (print_dir_name): Put back.
4940 (print_dir): Also print directory name header if print_dir_name is
4943 1998-08-29 Jim Meyering <meyering@ascend.com>
4947 * src/du.c (long_options): Use corresponding short-option character
4948 in place of `1', and `NULL' in place of pointer in initialization.
4949 * src/cp.c (long_opts): Likewise.
4950 * src/ln.c (long_options): Likewise.
4951 * src/mkdir.c (longopts): Likewise.
4952 * src/rmdir.c (longopts): Likewise.
4953 * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
4955 * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
4956 * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
4958 * tests/Fetish.pm: New file -- moved from ls-2/.
4959 * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
4960 * tests/Makefile.am (SUBDIRS): Add dircolors.
4961 (EXTRA_DIST): Add Fetish.pm.
4962 * tests/dircolors: New directory
4964 * src/ls.c (print_dir_name): Remove global variable.
4965 (print_dir): When trace_dirs is set, always print the directory
4968 1998-08-26 Jim Meyering <meyering@ascend.com>
4970 * src/dircolors.c (dc_parse_stream): Don't segfault when a line
4971 contains only one token. Reported by Olav Morkrid.
4973 1998-08-24 Paul Eggert <eggert@twinsun.com>
4975 * src/system.h (CHAR_MIN, CHAR_MAX):
4976 Renamed from SCHAR_MIN, SCHAR_MAX, since these
4977 macros apply to char, not signed char.
4979 * src/df.c, src/du.c, src/touch.c (long_options, main):
4982 1998-08-18 Paul Eggert <eggert@twinsun.com>
4984 Port nanosecond-resolution times to UnixWare 2.1.2 and
4985 pedantic Solaris 2.6.
4987 * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
4988 * acconfig.h (ST_MTIM_NSEC): New #undef.
4989 * src/system.h (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
4990 Use new ST_MTIM_NSEC macro.
4992 1998-08-16 Jim Meyering <meyering@ascend.com>
4994 * lib/filemode.h (PARAMS): Define and use.
4997 1998-08-15 Jim Meyering <meyering@ascend.com>
5001 * Makefile.maint (announcement): New target.
5003 * tests/mv/into-self: Update to reflect changed behavior of mv.
5004 * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
5005 With prodding from François Pinard :-)
5007 * tests/ls-2/Fetish.pm: New file
5008 * tests/ls-2/run-test: New file
5010 * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
5011 directories (but none of their entries). This makes `cp --archive
5012 --one-file-system' use the same policy `tar --one-file-system' does.
5015 * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
5017 1998-08-14 Jim Meyering <meyering@ascend.com>
5019 * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
5020 Reported by Christian von Roques.
5022 * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
5023 * tests/Makefile.am (SUBDIRS): Add ls-2.
5024 * tests/ls-2: New directory
5026 1998-08-14 Christian von Roques <roques@pond.sub.org>
5028 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
5029 infloop on getmnt(2) returning 0.
5031 * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
5032 not initializing output redirection of : command.
5033 * tests/mv/backup-is-src: Likewise.
5034 * tests/rm/i-1: Likewise.
5036 1998-08-12 Jim Meyering <meyering@ascend.com>
5038 * po/Makefile.in.in: Provide automake-style DESTDIR support.
5039 From Johan Danielsson.
5040 (DISTFILES): Remove ChangeLog.
5041 po/ChangeLog: Remove empty file.
5043 * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
5045 * src/ls.c: Include filemode.h.
5046 * src/chmod.c: Likewise.
5048 * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
5049 From Johan Danielsson.
5050 Protoize. Tsort function definitions and remove prototypes of
5052 (mode_string): Remove prototype.
5053 * lib/filemode.h (mode_string): New file.
5054 * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
5056 1998-08-09 Jim Meyering <meyering@ascend.com>
5060 1998-07-31 Paul Eggert <eggert@twinsun.com>
5062 Add support for filesystems whose timestamps have better resolution
5063 than 1 second (e.g. Solaris 2.6, recent Linux kernels).
5065 * configure.in (AC_STRUCT_ST_MTIM): Add.
5067 * src/copy.c (copy_internal): Compare time stamps with
5068 subsecond resolution if available.
5070 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
5071 rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
5072 stamps with subsecond resolution if available.
5074 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
5075 CTIME_CMP, MTIME_CMP): New macros.
5077 1998-08-01 Jim Meyering <meyering@ascend.com>
5079 * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
5081 1998-07-28 Paul Eggert <eggert@twinsun.com>
5083 * lib/mountlist.c (read_filesystem_list): Remove all_fs
5084 argument, but put the necessary information into the result so
5085 that the caller can ignore filesystems that he's not
5088 * lib/mountlist.h (struct mount_entry):
5089 New members me_dummy, me_remote.
5090 (read_filesystem_list): Remove all_fs argument.
5091 (REMOTE_FS_TYPE): Remove.
5092 (ME_DUMMY, ME_REMOTE): New macros.
5094 * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
5096 * src/df.c (show_all_fs):
5097 Revert to boolean value; the old negative value is
5098 now in show_local_fs.
5099 (show_local_fs): New variable.
5100 (show_dev): New args me_dummy and me_class. Use show_local_fs
5101 and boolean show_all_fs in combination with these new args
5102 to decide whether to show a device.
5103 (show_disk): Pass flags to show_dev.
5104 (show_point): Use a non-dummy mount entry if possible.
5105 (show_all_entries): Pass flags to show_dev.
5106 (main): --local sets show_local_fs now. Ask for file system types if
5107 show_local_fs is nonzero, since ME_REMOTE might need them.
5109 1998-07-27 Jim Meyering <meyering@ascend.com>
5111 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
5113 * tests/install/basic-1: Add a test for this.
5114 * src/install.c: Make copy create each destination file initially
5115 with mode 0600 so strip will work, then apply specified mode.
5116 Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
5118 1998-07-25 Jim Meyering <meyering@ascend.com>
5120 * src/mv.c (chown): Remove unused definition.
5121 Reported by Kaveh Ghazi.
5123 * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
5124 Handle that, so --ignore-fail-on-non-empty works.
5125 (EEXIST): Define to zero if not defined.
5126 (ENOTEMPTY): Likewise.
5128 * tests/cp/same-file: Remove `diff' I'd put in for debugging.
5129 Exit with the status from cmp.
5133 * tests/cp/same-file: Skip three more unportable tests.
5134 These failed on SunOS4.1.4.
5136 * src/copy.c (SAME_INODE): Remove definition.
5137 * src/sys2.h (SAME_INODE): Define it here instead.
5139 * src/remove.c (same_file): New function.
5140 (remove_dir): Use it to give a better diagnostic when rmdir fails
5141 because it can't remove the current directory.
5143 * src/df.c (long_options): Changes table entries not to use this form:
5144 {"all", no_argument, &show_all_fs, 1},
5145 but rather this form:
5146 {"all", no_argument, NULL, 'a'},
5147 Using the latter, all the option handling in one place: the getopt loop.
5149 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
5151 (fsp_to_string): Don't xmalloc return value (yet).
5152 (xatoi): Ansideclify.
5153 (fstype_to_string): Ansideclify.
5154 * lib/mountlist.h: Define and use PARAMS macro.
5156 * lib/utime.c: New file.
5157 * src/touch.c (utime_now): Moved into m4/utimes.m4.
5158 (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
5161 * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
5163 1998-07-22 Paul Eggert <eggert@twinsun.com>
5165 * lib/human.c (human_readable): amt -> damt, to fix typo when
5166 computing which power to use after overflow occurs during
5169 * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
5172 1998-07-21 Paul Eggert <eggert@twinsun.com>
5174 Add df -l or --local option.
5175 * doc/fileutils.texi: Document it.
5176 * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
5177 * lib/mountlist.c (read_filesystem_list):
5178 If all_fs is negative, omit non-local filesytems.
5180 * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
5181 (show_all_fs): If negative, omit non-local filesystems.
5182 All uses of (all_fs != 0) changed to (all_fs > 0).
5183 (long_options, usage, main): Add -l or --local option.
5184 (main): When asking for df of an explicit file name, get all
5185 the mount points, so that we're more likely to find it when
5188 1998-07-18 Jim Meyering <meyering@ascend.com>
5190 * src/copy.c (copy_internal): Add another exclusion from the
5191 sameness test: when --force has been specified, the destination
5192 is unlinked before any copy.
5193 (copy_internal): Add yet another: when both src and dest are symlinks.
5195 * tests/touch: New subdir.
5196 * tests/Makefile.am (SUBDIRS): Add touch.
5197 * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
5199 * tests/mv/into-self-2: New test.
5200 * tests/mv/Makefile.am (TESTS): Add into-self-2.
5202 1998-07-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5204 * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
5207 1998-07-16 Jim Meyering <meyering@ascend.com>
5209 Work around failure of chown calls on m68k-motorola-sysv systems.
5210 * src/chown.c: Include lchown.h.
5211 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
5212 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
5213 * lib/lchown.c: Include lchown.h.
5214 Reported by and with suggestions from Manfred Hollstein.
5216 1998-07-12 Paul Eggert <eggert@twinsun.com>
5218 * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
5220 1998-07-07 Jim Meyering <meyering@ascend.com>
5222 * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
5223 Suggestion from Ulrich Drepper.
5225 1998-07-04 Jim Meyering <meyering@ascend.com>
5227 * lib/safe-read.c (safe_read): Change type of pointer parameter to
5228 `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi.
5229 * lib/safe-read.h: Update prototype.
5231 * src/dircolors.c (parse_line): Add casts to avoid errors from
5232 Irix4's `cc' C compiler. From Kaveh Ghazi.
5234 * lib/xstrtol.c: Include stdio.h. Required on some systems when
5235 using assert. From Kaveh Ghazi.
5237 * tests/mv/backup-is-src: Use cmp, not diff.
5238 Reported by Kaveh Ghazi.
5240 1998-07-03 Jim Meyering <meyering@ascend.com>
5244 * src/remove.c (remove_dir): Use fprintf (not error) to avoid
5247 1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
5249 * lib/mountlist.c (read_filesystem_list):
5250 Don't leak memory on failure.
5251 Don't create a dummy struct mount_entry entry;
5252 use the address-of-the-tail-address method instead.
5253 Preserve errno if possible on failure, setting it to 0 if inapplicable.
5254 Close file descriptor leak if the F_SETLKW failed.
5255 Report an error if SVR4 lock file cannot be opened for some reason
5256 other than a nonexistent lock file.
5258 1998-07-03 Jim Meyering <meyering@ascend.com>
5260 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
5261 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
5262 * acconfig.h (WITH_REGEX): Remove undef.
5263 * lib/Makefile.am (noinst_HEADERS): Add regex.h.
5264 * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
5265 * lib/rx.c: Remove file.
5266 * lib/rx.h: Remove file.
5268 * src/df.c (df_readable): Rename local so as not to shadow global.
5270 * src/copy.c (SAME_INODE): New macro.
5271 Use it to replace open-coded equivalents.
5272 (copy_internal): Rename variable and reverse sense of tests
5273 to make the code a little clearer.
5275 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5277 * src/copy.c (copy_internal): Try harder identifying a relative
5278 symbolic link in the current directory.
5280 * src/copy.c (copy_internal): Don't skip test for same file if
5281 creating a hardlink from symlink over a non-symlink while making
5283 * tests/cp/same-file: Skip tests that depend on link(2) not
5286 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5288 * src/copy.c (copy_internal): Don't call chown on a symlink.
5290 1998-07-01 Jim Meyering <meyering@ascend.com>
5292 * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
5293 configure's --disable-assert option.
5295 1998-06-29 Paul Eggert <eggert@twinsun.com>
5297 * lib/mountlist.c (read_filesystem_list):
5298 Plug file descriptor leak on failure.
5299 Report failure if lock file can't be opened for some reason
5300 other than nonexistence.
5302 1998-06-29 Jim Meyering <meyering@ascend.com>
5306 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
5307 Always close stream and file descriptor before returning.
5309 * src/df.c (main): Move the test of the result of the
5310 read_filesystem_list call up out of if-block -- code in the
5311 else-block depends on it too.
5313 1998-06-29 Paul Eggert <eggert@twinsun.com>
5315 * lib/mountlist.c (read_filesystem_list): If SVR4, lock
5316 /etc/.mnttab.lock if available, to avoid race conditions
5317 (e.g. with the automounter on Solaris 2.6).
5319 Include <errno.h>, <fcntl.h>, <unistd.h>.
5321 1998-06-29 Jim Meyering <meyering@ascend.com>
5323 * lib/mountlist.c (fstype_to_string): Guard with
5324 #if ! HAVE_F_FSTYPENAME_IN_STATFS.
5326 1998-06-28 Paul Eggert <eggert@twinsun.com>
5328 Add support for new --block-size option and
5329 BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
5330 Adjust df output slightly to accommodate larger filesystems.
5332 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
5333 into one, for convenience. All callers changed.
5334 (human_block_size): New function.
5335 * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
5336 Include <stdlib.h> if HAVE_STDLIB_H;
5337 declare getenv unless HAVE_DECL_GETENV.
5339 Include <argmatch.h>, <error.h>, <xstrtoul.h>.
5340 (DEFAULT_BLOCK_SIZE): New macro.
5341 (block_size_args, block_size_types): New constants.
5342 (humblock): New function.
5343 * lib/xstrtol.h (__ZLONG_MAX): Remove.
5344 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
5345 unsigned long to double without losing information.
5346 (bkm_scale_by_power): New function.
5348 * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
5349 Add support for SI-like suffixes like "GB" and "TD".
5350 * src/dd.c (usage): Describe it.
5352 * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
5353 Remove; replace with new variable output_block_size. All uses changed.
5354 (long_options, usage, main): Add --block-size.
5355 (main, decode_switches): Use new human_block_size function to
5356 initialize output block size consistently with other programs.
5358 * src/df.c (print_header, show_dev): Shrink some columns and expand
5359 others, to squeeze in support for today's larger filesystems.
5360 (print_header): Print output block size using power-of-1024 SI format.
5361 (df_readable): Coalesce last two args into one, for convenience.
5362 All callers changed.
5363 (main): Remove check for portable output format and larger
5364 or human-readable block sizes.
5366 * NEWS, doc/fileutils.texi: Describe above changes.
5368 1998-06-28 Jim Meyering <meyering@ascend.com>
5370 * src/ls.c (usage): Make --kilobytes description consistent with
5371 that in du and df. From Göran Uddeborg.
5373 * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
5374 now that we're using the jm_FSTYPENAME autoconf macro.
5375 James Tanis reported the old version didn't compile on BSDI3.
5377 * configure.in: Move big block of list_mounted_fs checks into
5378 new jm_LIST_MOUNTED_FILESYSTEMS macro.
5379 Use new jm_FSTYPENAME macro.
5381 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
5382 * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
5385 1998-06-27 Jim Meyering <meyering@ascend.com>
5387 * src/copy.c (copy_reg): Detect identical source and dest here.
5388 (copy_internal): Make the test symmetric.
5390 * tests/cp/same-file: New file.
5391 * tests/cp/Makefile.am (TESTS): Add it.
5393 1998-06-26 Jim Meyering <meyering@ascend.com>
5395 * src/remove.c (remove_file): Remove `non-directory' part of
5396 `removing non-directory FILE' verbose message.
5398 1998-06-23 Jim Meyering <meyering@ascend.com>
5400 * src/df.c (show_dev): Increase field width for blocks, used,
5401 and available columns from 7 to 8.
5403 1998-06-21 Jim Meyering <meyering@ascend.com>
5405 * aclocal.m4: Regenerate with fixed gettext.m4 installed.
5406 See README-alpha for details.
5408 1998-06-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5410 * src/automake-wrap: Quote `&' in sed replacement text.
5412 1998-05-31 Jim Meyering <meyering@ascend.com>
5416 * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
5417 Reported by Don Parsons.
5419 1998-05-30 Jim Meyering <meyering@ascend.com>
5421 * tests/ls/time-1: Clean up ctime test. Note that it fails also
5422 on Solaris5.5.1 tmpfs file systems.
5424 Solve the `rm -f rm' problem more cleanly.
5425 * src/.rm-warning: Remove file.
5426 * src/automake-wrap: New file.
5427 * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
5428 (Makefile.in): Depend on automake-wrap.
5429 (EXTRA_DIST): Add automake-wrap.
5430 (DISTCLEANFILES): Remove definition.
5431 (rm_DEPENDENCIES): Likewise.
5432 (.rm-warn-stamp): Remove rule.
5434 1998-05-27 Jim Meyering <meyering@ascend.com>
5436 * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
5437 * tests/ls/rt-1: New file, renamed from cr-1.
5439 1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5441 * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
5443 * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
5446 1998-05-25 Jim Meyering <meyering@ascend.com>
5448 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
5449 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
5450 [!_GNU_SOURCE]: Add #undef instead.
5452 1998-05-24 Jim Meyering <meyering@ascend.com>
5456 * src/ansi2knr.c: Use new version from automake-1.3.
5458 * src/chown.c: Accept new option, --dereference.
5459 --no-dereference is now the default.
5460 (enum Change_status) [CH_NOT_APPLIED]: New member.
5461 (change_symlinks): Enable this by default, now.
5462 (describe_change): Handle new case.
5463 (change_file_owner): Add new parameter: cmdline_arg. Update callers.
5464 Reorganize to reflect changed semantics.
5465 (LCHOWN): Remove definitions.
5467 * lib/lchown.c: New file.
5469 1998-05-21 Jim Meyering <meyering@ascend.com>
5471 * configure.in (ALL_LINGUAS): Add russian (ru).
5473 1998-05-16 Jim Meyering <meyering@ascend.com>
5475 * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
5476 (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
5478 * lib/hash.c (is_prime): Ansideclify.
5479 (next_prime): Ansideclify. Add an assertion.
5481 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
5482 lines from the m4/*.m4 macros, so the hack of including some
5483 custom-replaced C source file names here is no longer needed.
5485 * configure.in (jm_MACROS): New wrapper macro.
5486 Remove uses of most jm_* macros.
5488 * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
5489 as part of utimbuf.m4.
5490 (memcmp): Add #undef.
5492 1998-05-12 Jim Meyering <meyering@ascend.com>
5494 * configure.in: Use my replacement AC_ISC_POSIX rather than
5497 * src/copy.c (copy_internal): Plug a small leak.
5499 1998-05-10 Jim Meyering <meyering@ascend.com>
5501 * src/mv.c (do_move): Remove lots of code that was duplicated in
5502 copy.c (copy), now that copy() has better support for mv. This fixes
5503 a bug with cross-filesystem `mv -i' whereby you could get two prompts
5504 for the same destination file and eventually remove the destination
5505 file even though one of the responses was negative.
5506 Reported by Dirk Lattermann.
5508 * src/copy.h: Better support for mv:
5509 [struct cp_options] (move_mode): New member.
5510 * src/copy.c (copy_internal): Use new move_mode member.
5512 (copy): Add parameter.
5514 * tests/cp/Makefile.am (TESTS): Add backup-is-src.
5515 * tests/mv/Makefile.am (TESTS): Likewise.
5517 * lib/userspec.c: Don't declare strdup if it's defined as a macro.
5518 Reported by Lorne Baker.
5520 * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
5522 * src/mv.c (cp_option_init): Initialize new members.
5523 * src/cp.c (cp_option_init): Likewise.
5524 (main): Set new preserve_* options.
5526 1998-05-09 Jim Meyering <meyering@ascend.com>
5528 * src/copy.h: Support for install:
5529 [struct cp_options] (failed_unlink_is_fatal): New member.
5530 (preserve_owner_and_group): New member.
5531 (preserve_chmod_bits): New member.
5532 (preserve_timestamps): New member.
5533 (preserve): Remove member.
5534 (set_mode): New member.
5536 * src/copy.c (new_nondir_mode): New function. Use where appropriate.
5537 Use more-specific preserve_* members in place of removed `preserve'.
5538 (copy_internal): Honor failed_unlink_is_fatal.
5540 * src/install.c (main): Rewrite argv-handling to be clearer.
5541 (copy_file): Rewrite to use copy.c (copy).
5542 (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
5543 `no_need_to_chown' parameter. Fix caller.
5544 (install_file_in_file): Remove now-unnecessary `to_created' parameter.
5545 (cp_option_init): New function.
5546 Update several functions to take new parameter specifying copy options.
5548 * tests/install: New subdir, with one basic test.
5549 * tests/Makefile.am (SUBDIRS): Add install.
5550 * configure.in (AC_OUTPUT): Add tests/install/Makefile.
5552 * src/dd.c: Include safe-read.h.
5553 Don't declare safe_read.
5554 * src/touch.c: Likewise.
5556 * configure.in (jm_TYPE_SSIZE_T): Use it.
5557 * acconfig.h (ssize_t): Add undef.
5559 1998-05-03 Jim Meyering <meyering@ascend.com>
5561 * po/: Update from gettext-0.10.35.
5563 * configure.in: Remove use of AC_LINK_FILES.
5564 (AC_OUTPUT): Remove po/Makefile-generating sed command.
5566 1998-04-28 Jim Meyering <meyering@ascend.com>
5568 * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
5569 Use unsigned char * pointers, not potentially signed ones, to avoid
5572 1998-04-26 Jim Meyering <meyering@ascend.com>
5574 * configure.in: Use jm_ASSERT.
5575 * acconfig.h: Add NDEBUG.
5577 * src/mv.c: Don't define NDEBUG.
5578 * src/cp.c: Likewise.
5580 1998-04-14 Jim Meyering <meyering@ascend.com>
5582 * src/.rm-warning: New file.
5583 * src/Makefile.am (EXTRA_DIST): Add .rm-warning
5584 (DISTCLEANFILES): Add .rm-warn-stamp.
5585 (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
5586 (.rm-warn-stamp): New rule.
5587 (rm_prep): Comment out rule.
5589 * src/df.c (main): Use STREQ in string equality tests, not strcmp.
5590 * src/dircolors.c (dc_parse_stream): Likewise.
5591 (dc_parse_file): Likewise.
5592 * src/du.c (main): Likewise.
5593 * src/ls.c (decode_switches): Likewise.
5594 * src/remove.c (hash_compare_strings): Likewise.
5595 * src/touch.c (main): Likewise.
5597 1998-04-13 Jim Meyering <meyering@ascend.com>
5599 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
5601 1998-04-11 Jim Meyering <meyering@ascend.com>
5603 * lib/hash.c: Add curly braces around statements in
5604 if/else/while/do/etc. that span more than a line -- even around
5605 multiline simple statements or single-line simple statements
5606 preceded by a comment line.
5608 1998-04-09 Jim Meyering <meyering@ascend.com>
5610 * configure.in: Don't use AC_PATH_PROG to check for perl, now that
5613 1998-04-06 Jim Meyering <meyering@ascend.com>
5615 * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
5616 hash_insert. Also declare to be static.
5617 * src/cp-hash.h (hash_insert): Remove declaration.
5619 * lib/hash.c: Lots of minor spec and name changes, and new comments.
5620 (hash_rehash): Rewrite to be easier on the allocator.
5621 From François Pinard.
5622 * lib/hash.h: More comments.
5623 * src/remove.c: Change names/usage of hash-related functions to work
5626 1998-04-05 Jim Meyering <meyering@ascend.com>
5628 * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
5629 This now depends on HAVE_BTOWC so systems that lack btowc (like
5630 solaris-2.5.1) don't lose.
5632 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
5634 * GNUmakefile: Add conditionals so that running `make' in an
5635 unconfigured source directory will get a reasonable diagnostic.
5637 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
5638 know about the m4/ subdirectory.
5639 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
5640 automake-1.2h and the above change) aclocal-related rules and includes.
5642 1998-04-01 Jim Meyering <meyering@eng.ascend.com>
5644 * tests/ls/cr-1: New file.
5645 * tests/ls/Makefile.am (TESTS): Add cr-1.
5647 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
5649 * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
5650 works with `unsigned char'.
5652 (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
5654 * lib/xstrtol.c: Merge with the version from textutils.
5656 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
5658 1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5660 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
5661 rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
5662 rev_cmp_size): Use file name as secondary sort key to get
5665 1998-03-28 Jim Meyering <meyering@eng.ascend.com>
5667 * src/copy.c: Add copyright.
5668 * src/remove.c: Add copyright.
5669 [_AIX]: Add #pragma alloca.
5671 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
5673 * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
5674 dependency and the := assignment of ACLOCAL to make the default
5675 rule use the `-I m4' option.
5677 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
5679 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
5681 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
5682 automatically handles it.
5684 1998-03-21 Jim Meyering <meyering@eng.ascend.com>
5686 * lib/quotearg.h: Update from patch-2.5.3.
5687 * lib/quotearg.c: Likewise.
5688 * src/ls.c (decode_switches): Pass a null pointer instead of address
5689 of quotearg_quoting_options.
5691 1998-03-19 Paul Eggert <eggert@twinsun.com>
5693 * lib/fsusage.h (struct fs_usage): New member
5694 fsu_bavail_top_bit_set.
5695 * lib/fsusage.c: Include <limits.h>.
5696 (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
5697 (get_fs_usage): If top bit of system variable corresponding to
5698 fsu_bavail is set, then set fsu_bavail_top_bit_set, and
5699 sign-extend the value when storing it into fsu_bavail.
5700 * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
5701 assume the original value corresponding to fsu_bavail was negative.
5702 Reported by Arne Juul.
5704 1998-03-18 Jim Meyering <meyering@eng.ascend.com>
5706 * src/Makefile.am (rm-prep): Add dependency and rule to save users
5707 with `.' too early in their PATH from the `rm: cannot unlink `rm':
5708 Text file busy' error. Suggestion from Philippe De Muyter.
5710 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
5714 * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
5715 * lib/closeout.c: Likewise.
5716 * lib/dirname.c: Likewise.
5717 * lib/euidaccess.c: Likewise.
5718 * lib/fileblocks.c: Likewise.
5719 * lib/filemode.c: Likewise.
5720 * lib/ftruncate.c: Likewise.
5721 * lib/group-member.c: Likewise.
5722 * lib/isdir.c: Likewise.
5723 * lib/long-options.c: Likewise.
5724 * lib/mountlist.c: Likewise.
5725 * lib/path-concat.c: Likewise.
5726 * lib/save-cwd.c: Likewise.
5727 * lib/savedir.c: Likewise.
5728 * lib/strcasecmp.c: Likewise.
5729 * lib/strdup.c: Likewise.
5730 * lib/userspec.c: Likewise.
5731 * lib/yesno.c:: Likewise.
5733 * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
5734 Use #if !, not #ifndef with HAVE_ macros.
5735 * src/chown.c: Likewise.
5736 * src/copy.c: Likewise.
5737 * src/dd.c: Likewise.
5738 * src/dircolors.c: Likewise.
5739 * src/install.c: Likewise.
5740 * src/ls.c: Likewise.
5741 * src/mv.c: Likewise.
5742 * src/touch.c: Likewise.
5744 * configure.in: Use jm_PREREQ.
5746 1998-03-14 Jim Meyering <meyering@eng.ascend.com>
5748 Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
5749 With automake-1.2f, that hack is no longer needed.
5751 * src/remove.c: Use `virtual memory exhausted' message, not
5752 `Memory exhausted' to be consistent with the majority of other
5754 Say `removing all...', not `removing any...'.
5755 * src/rmdir.c (remove_parents): Be consistent with documentation of
5756 --verbose option and with remove.c in saying `removing...' before
5757 the operation is attempted.
5759 Suggestions from Santiago Vila.
5761 * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
5762 (copy_internal): Likewise.
5765 * src/copy.h (copy): Update prototype.
5766 * src/cp.c (do_copy): Add unused arg in calls to copy.
5767 * src/mv.c (do_move): Add ©_into_self arg in call to copy.
5768 Don't remove source directory when copy_into_self is nonzero.
5769 Reported by Arne Henrik Juul.
5771 * tests/mv/into-self: Test for the above.
5772 * tests/mv/Makefile.am (TESTS): Add into-self.
5774 1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
5776 * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
5777 about any arbitrary user and group by pretending to be the user
5778 and to belong to the group specified in `spec_arg' argument.
5780 * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
5781 any arbitrary user name.
5782 (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
5785 1998-02-24 Jim Meyering <meyering@eng.ascend.com>
5787 * lib/xstrtol.c (TYPE_SIGNED): Define.
5788 (TYPE_MAXIMUM): Define.
5789 (ULONG_MAX): Use TYPE_MAXIMUM.
5790 (LONG_MAX): Use TYPE_MAXIMUM.
5792 * lib/fnmatch.c: Update from libit.
5793 * lib/idcache.c: Update from libit.
5795 1998-02-23 Paul Eggert <eggert@twinsun.com>
5797 * lib/quotearg.h, lib/quotearg.c: New files.
5798 * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
5799 (noinst_HEADERS): Add quotearg.h.
5801 * src/ls.c: Include new file quotearg.h.
5802 (enum indicator_style): Rename all to classify, and not_programs
5803 to file_type, to match option spellings. All users changed.
5804 (indicator_style_args): New constant.
5805 (quote_funny_chars, quote_as_string, quote_shell): Remove;
5806 (filename_quoting_options, dirname_quoting_options): Use these
5808 (long_options): Add --indicator-style, --quoting-style,
5809 --show-control-chars. Remove --quote-shell.
5810 (dired_dump_obstack): Remove style parameter and don't output style.
5811 (main): Go back to previous method of outputting //DIRED//
5812 and //SUBDIRED// lines, without style. But add a new
5813 //DIRED-OPTIONS// line that does output style.
5814 (decode_switches, usage): Add --indicator-style, --quoting-style,
5815 --show-control-chars. Remove --quote-shell.
5816 (decode_switches): Default from QUOTING_STYLE environment variable.
5817 Set new quoting vars.
5818 (quote_name): Renamed from quote_filename.
5819 Take new arg specifying quoting options.
5820 Always print; do not have a special case for null FILE * argument.
5821 All callers changed.
5822 Move the guts of this function to new file quotearg.c.
5823 (length_of_file_name_and_frills): Use quotearg_buffer instead
5824 of (old) quote_filename to find length of file name.
5826 (decode_switches, parse_ls_color, print_dir, gobble_file,
5827 get_link_name): Quote output in diagnostics.
5829 * NEWS, doc/fileutils.texi: Describe above changes.
5830 * doc/fileutils.texi: Mention that control characters are output
5831 as question marks if output is a terminal.
5833 1998-02-22 Jim Meyering <meyering@eng.ascend.com>
5837 * ChangeLog-1997: New file.
5838 * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
5840 1998-02-21 Jim Meyering <meyering@eng.ascend.com>
5842 * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
5843 * tests/Makefile.am (SUBDIRS): Add mv.
5844 * tests/mv: New directory
5845 * tests/mv/mv-special-1: New test.
5847 1998-02-20 Jim Meyering <meyering@eng.ascend.com>
5849 * src/touch.c: Include get-date.h.
5850 Remove get_date decl.
5852 * lib/getdate.h: Removed. Could cause confusion with an
5853 automake-generated `.y.h' rule.
5854 * lib/get-date.h: Renamed from getdate.h.
5855 * lib/getdate.y: s/getdate.h/get-date.h/
5856 * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
5858 1998-02-19 Jim Meyering <meyering@eng.ascend.com>
5860 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
5861 * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
5863 1998-02-13 Jim Meyering <meyering@eng.ascend.com>
5865 * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
5866 Otherwise, mv tries to open special files.
5867 Reported by Kjetil Torgrim Homme.
5869 1998-02-08 Jim Meyering <meyering@eng.ascend.com>
5871 * Makefile.maint (cvs-dist): Update po/ to clear modified status
5872 of *.po files before running cvs tag -c.
5874 * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
5877 1998-02-07 Jim Meyering <meyering@eng.ascend.com>
5879 * GNUmakefile: New file.
5880 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
5881 Don't include Makefile.maint from here. It's included from GNUmakefile.
5883 * configure.in: Don't use AM_MAINTAINER_MODE.
5884 (jm_PERL): Use this.
5886 * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen.
5887 (CLEANFILES): Remove dcgen.
5888 (dircolors.h): Use $(PERL).
5891 1998-02-01 Jim Meyering <meyering@na-net.ornl.gov>
5893 * POTFILES.in: Add remove.c. Reported by Santiago Vila.
5895 1998-01-28 Jim Meyering <meyering@na-net.ornl.gov>
5897 * src/df.c (print_header): Tweak format to align heading over
5898 last column of `df -i' output. From Andreas Schwab.
5900 1998-01-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
5902 * Makefile.am: Include Makefile.maint from $(srcdir).
5904 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
5908 * Makefile.maint: New file.
5909 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
5910 into Makefile.maint.
5911 Include Makefile.maint.
5912 (EXTRA_DIST): Add Makefile.maint.
5914 * src/cp.c (re_protect): Don't fail for non-root when chown fails
5915 due not only to lack of permission (EPERM), but also to lack of
5916 support (EINVAL). Reported by Bengt Martensson.
5917 * src/copy.c (DO_CHOWN): Likewise.
5919 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
5921 * tests/ls/time-1 (test_failure): Rename does not update ctime;
5922 link does -- so use ln, not mv.
5923 Note that the SunOS4.1.4 failure of the ctime test is expected.
5925 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
5926 bug in Cray C 5.0.3.0 when T == time_t.
5928 * tests/rm/r-1: Adjust expected output for changed format of
5930 * tests/rm/r-2: Likewise.
5932 1998-01-23 Jim Meyering <meyering@na-net.ornl.gov>
5934 * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
5935 C compiler. From Kaveh Ghazi.
5936 (TYPE_MINIMUM): Define.
5937 (TYPE_MAXIMUM): Define.
5938 (TIME_T_MIN): Use TYPE_MINIMUM.
5939 (TIME_T_MAX): Use TYPE_MAXIMUM.
5941 1998-01-22 Jim Meyering <meyering@na-net.ornl.gov>
5943 * src/dd.c: Reorder functions to obviate forward dcls.
5944 (quit): Declare to be inline to stifle compile warning.
5946 * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
5948 * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a
5951 * tests/ls/time-1: Use GNU touch to work around problems with NFS
5952 caching and/or clock skew. Reported by Kaveh Ghazi.
5954 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
5956 * src/Makefile.am (noinst_HEADERS): Add remove.h.
5957 (mv_SOURCES): Define.
5958 (rm_SOURCES): Define.
5960 1998-01-21 Jim Meyering <meyering@na-net.ornl.gov>
5962 * src/install.c: Declare new global, backup_type.
5963 (main): Initialize backup_type unconditionally.
5964 (copy_file): Call find_backup_file_name with new argument, backup_type.
5965 * src/ln.c: Declare new global, backup_type.
5966 (main): Initialize backup_type unconditionally.
5967 (do_link): Call find_backup_file_name with new argument, backup_type.
5969 * src/copy.c (copy_internal): Use x->backup_type, not the global.
5970 (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
5972 * src/copy.h (VALID_SPARSE_MODE): Define.
5973 [struct cp_options] (backup_type): New member.
5975 * src/cp.c [NDEBUG]: Comment out definition.
5976 (do_copy): Use x->backup_type, not the global.
5978 * src/remove.c: New file. Contains guts of old rm.c.
5979 (remove_init): New function.
5980 (remove_fini): New function.
5981 (rm): Take third argument, specifying options.
5982 * src/remove.h: New file. Associated dcls.
5983 * src/rm.c: Remove and minimally librarify guts for use in mv.c.
5984 (main): Pass options (`&x') to rm.
5985 Call remove_init and remove_fini instead of open-coding them.
5987 * src/mv.c (rm_option_init): New function.
5988 (cp_option_init): New function.
5989 (copy_reg): Remove now-unused function.
5990 (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
5991 Set up for and use `remove.c (rm)' in place of unlink.
5993 1998-01-20 Jim Meyering <meyering@na-net.ornl.gov>
5995 * lib/backupfile.c: Use ANSI function definitions.
5996 Remove global declaration of backup_type.
5997 (simple_backup_suffix): Default to `~', not `.orig'.
5998 Use PARAMS, not __BACKUPFILE_P.
5999 (find_backup_file_name): Add parameter, backup_type.
6000 * lib/backupfile.h: Remove extern declaration of backup_type.
6001 Use PARAMS, not __BACKUPFILE_P.
6002 (VALID_BACKUP_TYPE): Define.
6003 (find_backup_file_name): Adjust prototype.
6005 1998-01-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
6007 * src/df.c (print_header): Fix inode format header to line it up
6008 with the rest of the output.
6010 1998-01-13 Jim Meyering <meyering@na-net.ornl.gov>
6012 * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent
6013 with most other implementations.
6015 1998-01-12 Jim Meyering <meyering@na-net.ornl.gov>
6017 * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
6018 Move function-spanning `#if ...BSIZE' directive to follow inclusion
6019 of sys/param.h since BSIZE is sometimes defined in sys/param.h.
6020 Reported by Philippe De Muyter.
6022 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
6026 * src/install.c (install_file_to_path): New function.
6027 FIXME: update fileutils.texi.
6028 (main): Handle new option, -D.
6029 Based on a patch from Marty Leisner.
6030 (usage): Describe -D.
6032 * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
6033 with -l or -t. Now, -u (like -c) implies --sort=time.
6034 (usage): Correct descriptions of --sort, --time, and -t.
6035 Suggestions from Andreas Schwab.
6037 Add test for the above fix.
6038 * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
6039 * tests/Makefile.am (SUBDIRS): Add ls.
6040 * tests/ls: New directory.
6041 * tests/ls/Makefile.am: New file.
6042 * tests/ls/time-1: New file.
6044 * lib/makepath.c (make_path): Reformat 3 if-stmts to test
6045 `if (newly_created_dir)' only once. Suggestion from Andreas Schwab.
6047 1998-01-06 Jim Meyering <meyering@na-net.ornl.gov>
6049 * lib/getdate.y: Move inclusion of getdate.h and dependent extern
6050 declarations down so getdate.h's prototype follows the sometimes-
6051 enabled definition of `const' to nothing. Otherwise, the prototype
6052 wouldn't match the definition because of the defined-away `const'.
6054 (get_date): ANSI-fy definition.
6055 Add %expect directive.
6057 1998-01-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
6059 * lib/makepath.c (make_path): Put only newly created directories
6060 on the LEADING_DIRS list.
6062 1998-01-05 Paul Eggert <eggert@twinsun.com>
6064 * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
6065 (get_fs_usage): If a value consists entirely of 1 bits,
6066 propagate this info to the output by setting it to (uintmax_t) -1.
6067 * src/df.c (df_readable): New function.
6068 (show_dev): If a value consists entirely of 1 bits, or is derived
6069 from some other value that consists entirely of 1 bits, report "-".
6070 Check inode and block counts more carefully for plausibility,
6071 to avoid arithmetic overflow when computing percentages.
6073 1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
6077 * lib/Makefile.in: Regenerated with patched automake-1.2d.
6080 * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
6081 the two booleans, verbose and changes_only. This fixes a bug whereby
6082 --change had the same effect as --verbose.
6083 * src/chmod.c: Likewise.
6084 * src/chown.c: Likewise.
6085 Reported by Paul Eggert.
6087 1998-01-04 Paul Eggert <eggert@twinsun.com>
6089 Check for write errors more carefully.
6091 * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
6092 (noinst_HEADERS): Add closeout.h.
6093 * lib/closeout.c, lib/closeout.h: New files.
6094 * lib/long-options.c (parse_long_options),
6095 src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
6096 src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
6097 src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
6098 src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
6099 (main, usage): Check for write error to stdout before exiting.
6100 Include "closeout.h".
6102 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
6104 * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
6105 just like `fsu.fsu_blocks == 0' as an indicator that usage information
6106 is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
6108 * lib/save-cwd.h: Guard PARAMS-enabling definition with
6109 `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
6110 problems with Irix4's cc. From Kaveh Ghazi.
6111 * lib/getdate.h: Likewise, but just to be consistent.
6113 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
6114 those files will be built via the ANSI2KNR-filtering rules if necessary.
6115 Reported by Kaveh Ghazi.
6117 1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
6121 Fix problem with `install -d'. Reported by Marty Leisner.
6123 * src/install.c (get_ids): When otherwise unspecified,
6124 set uid and gid to -1.
6125 * lib/makepath.c (make_path): Try to change ownership only if we've
6126 just created the directory. Fix latent bug (s/&&/||/ in two places --
6127 also, note that it could not be exercised via install or mkdir)
6128 whereby chown would not be invoked when only one of owner/group is
6131 1998-01-01 Jim Meyering <meyering@na-net.ornl.gov>
6133 * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
6134 only once and never free it.
6137 version-control: never