1 1999-11-27 Jim Meyering <meyering@ascend.com>
3 * tests/mv/setup: Don't set/use DF or MKDIR. Use df and mkdir instead.
4 * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH
5 * tests/mv/backup-is-src: Likewise for RM and MV.
6 * tests/mv/hard-link-1: Likewise.
7 * tests/mv/into-self: Likewise.
8 * tests/mv/into-self-3: Likewise.
10 Add test for 1999-05-23 change to src/copy.c (copy_internal).
11 * tests/mv/partition-perm: New file.
12 * tests/mv/Makefile.am (TESTS): Add partition-perm.
16 1999-11-22 Paul Eggert <eggert@twinsun.com>
18 * src/df.c (df_readable): Now returns char const *, not char *.
20 (ceil_percent): Now returns double, not int.
21 Be more careful about adding 1 to a wild value.
22 (show_dev): Don't filter out wild sizes from the underlying operating
23 system; instead, show them to the user as faithfully as possible.
25 1999-11-23 Jim Meyering <meyering@ascend.com>
27 * doc/getdate.texi (Calendar date item): Correction regarding 0..68/
28 69-99 split for 1900 vs 2000. From Peter Moulder.
30 1999-11-22 Jim Meyering <meyering@ascend.com>
32 * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c.
34 1999-11-20 Jim Meyering <meyering@ascend.com>
36 * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate
38 (remove_parents): Use it.
41 * tests/cp/cp-mv-backup: Run `diff -c' if the test fails.
43 * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH.
44 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc.
46 * src/chgrp.c: Declare lstat; needed on e.g. SunOS4.
47 Reported by Tom Tromey.
49 1999-11-19 Jim Meyering <meyering@ascend.com>
51 * lib/strstr.c (strstr): Include config.h.
52 Add a `;' between shloop label and `}'.
55 1999-11-17 Jim Meyering <meyering@ascend.com>
57 * src/mkdir.c (S_IRWXUGO): Define if necessary.
58 (main): Use chmod to set the permissions if bits other than those
59 of S_IRWXUGO were requested. Reported by Sami Farin.
61 1999-11-14 Paul Eggert <eggert@twinsun.com>
63 * touch.c (touch): Simplify code a tad, using fd == -1 instead
64 of separate valid_fd variable.
66 1999-11-13 Jim Meyering <meyering@ascend.com>
68 * src/touch.c (touch): Don't fail just because we couldn't open
69 an existing file. This makes it so that touching a read-only
70 file now works. Also clean up and simplify.
71 Based on a patch from Chip Salzenberg.
72 * tests/touch/no-rights: New test for this.
73 * tests/touch/Makefile.am (TESTS): Add no-rights.
75 1999-11-12 Jim Meyering <meyering@ascend.com>
77 * src/remove.c (print_nth_dir): Write one fewer byte so we don't print
79 (rm): Fix bugs in (and test, this time) the very rarely used code
80 to warn about directory cycles.
81 Reported by michael@roka.net.
83 1999-11-11 Jim Meyering <meyering@ascend.com>
85 * src/copy.c (copy_internal): Treat src and dest as the `same' in
86 `mv src symlink-to-src' when src and dest are on different partitions.
87 Otherwise, that `mv' command would silently remove `src'.
88 Reported by Michael Stone.
89 * tests/mv/into-self-2: Add a test for this fix.
91 * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others
92 just like that also dated back to 1992 were fixed in 1998-01-02).
93 Richard Braakman reported that using `install -d -g foo 1/2`
94 only sets the group on the intermediate directory, not the final
95 component. From Michael Stone.
97 1999-11-07 Paul Eggert <eggert@set.twinsun.com>
99 * human.c (default_block_size): New function.
100 (humblock): Use it if no block size is specified.
101 (human_block_size): If the specified block size is zero, report an
102 error if report_errors is nonzero; otherwise use the default.
104 1999-11-07 Jim Meyering <meyering@ascend.com>
106 * src/dircolors.hin: Add several more TERM types.
108 Add .png for real this time.
109 Change the image types colors to be visible in a black-on-white xterm.
112 * src/chgrp.c (xstat): New global.
114 (change_file_group): Use it. Before this change, when running chgrp
115 on a symlink without --dereference (-h) and when the requested group
116 is the same as the group for the *symlink*, chgrp would do nothing.
117 Now it changes the group of the file referenced through the symlink.
118 Reported by Martin Mitchell.
120 * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
121 * src/chown.c: Define and use REFERENCE_FILE_OPTION and
122 DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
123 * src/chgrp.c: Likewise.
125 * tests/ln/misc: Add hard-link-to-symlink test.
126 Move framework_failure test to the end.
127 Fix a typo: s/||/&&/.
129 * src/ln.c (do_link): Warn that making a hard link to a symbolic link
132 * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'.
133 * tests/ln/backup-1: Likewise.
135 * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
136 * tests/Makefile.am (SUBDIRS): Add rmdir.
137 * tests/rmdir: New directory
138 * tests/rmdir/ignore: New file.
140 * src/rmdir.c (remove_parents): Use the correct test (just as in
141 main) in handling --ignore-fail-on-non-empty. From Michael Stone.
142 (usage): Improve description of --parents. Based on suggestion from
145 1999-11-06 Jim Meyering <meyering@ascend.com>
147 Allow hard links to symlinks on systems that support it.
148 * src/ln.c (STAT_LIKE_LINK): Define.
149 (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
150 the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
152 * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is
153 accepted as the short form of --file-type, per the documentation.
154 From James Sneeringer.
156 * src/ln.c (do_link): Fix typo (in which the function name `symlink'
157 was tested instead of the variable `symbolic_link') that could make
158 ln perform an unneeded `stat' call.
160 1999-11-05 Jim Meyering <meyering@ascend.com>
162 * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated
164 * src/copy.c: Likewise.
165 * lib/fileblocks.c: Likewise.
167 * configure.in: Move some type/header/member tests into
168 m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
169 fileutils, textutils, and sh-utils.
171 1999-11-02 Jim Meyering <meyering@ascend.com>
173 * man/help2man: Import version 1.018.
174 * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
175 * man/*.x: Include one-line summary in [NAME] section.
176 * man/Makefile.summ: Remove the one-line summaries.
177 Suggestion for clean-up from Akim Demaille.
179 * configure.in (ALL_LINGUAS): Add Galician (gl).
181 1999-11-01 Jim Meyering <meyering@ascend.com>
183 * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and
184 other special files like /dev/zero.
186 * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
188 1999-10-31 Jim Meyering <meyering@ascend.com>
190 * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around
193 * doc/fileutils.texi: Document new --backup[=METHOD] option for
194 cp, mv, ln, and install.
196 * src/ln.c: Convert --backup to take an optional argument.
197 Deprecate --version-control (-V) in comments.
198 (usage): Remove mention of --version-control.
199 (main): Make -V warn then fall through into --backup case.
200 [--backup case]: Handle optional arg.
201 * src/install.c: Likewise.
203 1999-10-24 Jim Meyering <meyering@ascend.com>
205 * src/cp.c (do_copy): Constify `dest', and cast-away the new
206 const in assignment to new_dest.
208 1999-10-23 Jim Meyering <meyering@ascend.com>
210 * tests/touch/Makefile.am (TESTS): Add dangling-symlink.
211 * tests/touch/dangling-symlink: New file.
213 1999-10-23 Paul Eggert <eggert@twinsun.com>
215 * src/touch.c (full_write): Remove unused decl.
216 (open_maybe_create): Remove.
217 (touch): Don't record whether the file was created; this isn't
218 possible to do reliably and portably without race conditions.
219 If the file was created and if amtime_now is nonzero, this
220 change means we'll have to do another utime system call, but
221 that's no more harmful than the previous version of this code.
222 Reported by Gabor Z. Papp.
224 1999-10-21 Jim Meyering <meyering@ascend.com>
226 * configure.in (ALL_LINGUAS): Add Japanese (pa).
228 1999-10-17 Jim Meyering <meyering@ascend.com>
230 * tests/mv/backup-is-src: Remove use of mv's now-deprecated
231 -V option. Use --b=simple instead of -b -V simple.
233 * src/mv.c: Convert --backup to take an optional argument.
234 Deprecate --version-control (-V) in comments.
235 (usage): Remove mention of --version-control.
236 (main): Make -V warn then fall through into --backup case.
237 [--backup case]: Handle optional arg.
239 Accept new option: --target-directory=DIR
240 * src/cp.c (TARGET_DIRECTORY_OPTION): Define.
241 (SPARSE_OPTION): Define.
242 (usage): Describe it.
243 (do_copy): Change meanings/names of first two parameters: use `n_files'
244 in place of `argc - optind', and `file' instead of `argv + optind'.
245 Add parameter, target_directory.
246 (main): Pass new arg, target_directory.
248 1999-10-16 Jim Meyering <meyering@ascend.com>
250 * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option.
251 Use --b=simple instead of -b -V simple.
252 * tests/cp/backup-1: Replace use of cp's now-deprecated
253 --version-control option with use of --backup=simple.
255 * src/cp.c: Convert --backup to take an optional argument.
256 Deprecate --version-control (-V) in comments.
257 (usage): Remove mention of --version-control.
258 (main): Make -V warn then fall through into --backup case.
259 [--backup case]: Handle optional arg.
261 * tests/cp/Makefile.am (TESTS): Add cp-mv-backup.
262 * tests/cp/cp-mv-backup: New file.
264 1999-10-11 Jim Meyering <meyering@ascend.com>
266 * lib/getopt.c: Merge changes from latest glibc.
267 * lib/getopt.h: Likewise.
268 * lib/getopt1.c: Likewise.
270 1999-10-09 Jim Meyering <meyering@ascend.com>
272 Accept new option: --target-directory=DIR
273 * src/ln.c (TARGET_DIRECTORY_OPTION): Define.
274 (usage): Describe it.
275 (main): Implement it.
276 Make code clearer: use new variable `n_files' in place of
277 `argc - optind'. Use `file' instead of `argv + optind'.
279 1999-10-04 Jim Meyering <meyering@ascend.com>
281 * depcomp: New file, for automake's new dependency support.
282 * missing: New version, from automake's user-dep-gen-branch.
284 * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too.
285 * src/sys2.h (__attribute__): Likewise.
286 Wrap with #ifndef __attribute__.
288 1999-10-03 Paul Eggert <eggert@twinsun.com>
290 * getdate.y (__attribute__): Define to empty if GCC claims to
291 be before 2.8; this is needed for OPENStep 4.2 cc. Also,
292 define to empty if strict ANSI.
294 1999-10-03 Jim Meyering <meyering@ascend.com>
296 Accept new option: --target-directory=DIR
297 * src/mv.c (TARGET_DIRECTORY_OPTION): Define.
298 (usage): Describe it.
299 (main): Implement it.
300 Remove unused variable, stdin_tty.
301 Make code clearer: use new variable `n_files' in place of
302 `argc - optind'. Use `file' instead of `argv + optind'.
304 1999-09-28 Jim Meyering <meyering@ascend.com>
306 * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
307 Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
308 * src/sys2.h: Likewise.
310 * lib/xalloc.h (__attribute__): Protect against redefinition.
313 1999-09-26 Jim Meyering <meyering@ascend.com>
315 * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and
317 Use explicit exit to help avoid warnings.
320 * lib/path-concat.c (DIRECTORY_SEPARATOR): Define.
322 (path_concat): Allow parameter DIR to be NULL.
323 (xpath_concat): New function.
326 * lib/xalloc.h (__attribute__): Define.
327 (ATTRIBUTE_NORETURN): Define.
328 (xalloc_die): Declare.
329 (NEW): Define as yet unused macro.
335 * lib/basename.c (base_name): Add prototype. From Akim Demaille.
337 1999-09-19 Jim Meyering <meyering@ascend.com>
339 * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
340 (S_ISLNK): Define if necessary.
341 This is necessary on a NEC SX-4 with SUPER-UX 9.1.
342 Based on a patch from Holger Berger.
344 * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
345 Change many counter and index variables to be of unsigned type.
346 (dd_copy): Add new unsigned variable, n_bytes_read, in place of
347 many uses of `nread'.
349 * src/sys2.h (__attribute__): Define.
350 (ATTRIBUTE_NORETURN): Remove #else clause.
351 (ATTRIBUTE_UNUSED): Define.
353 1999-09-17 Jim Meyering <meyering@ascend.com>
355 * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this
356 is done in m4/jm-macros.m4.
358 1999-09-09 Jim Meyering <meyering@ascend.com>
360 * src/touch.c (usage): Remove misleading sentence in --help output.
363 * src/Makefile.am (EXTRAdir): Remove unused variable.
365 1999-09-03 Paul Eggert <eggert@twinsun.com>
367 * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
370 1999-09-01 Jim Meyering <meyering@ascend.com>
372 * src/cp.c: Remove declaration of xstrdup.
373 * src/df.c: Likewise.
374 * src/ls.c: Likewise.
376 1999-09-01 Akim Demaille <akim@epita.fr>
378 * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'.
379 * lib/xalloc.h (xalloc_fail_func): Likewise.
380 (xstrdup): Add protoype.
382 * lib/version-etc.c (version_etc_copyright): Default copyright string.
383 (version_etc): Use it.
384 * lib/version-etc.h: Declare it.
386 1999-08-29 Jim Meyering <meyering@ascend.com>
388 * configure.in (AC_YACC): Remove use, now that we require bison.
390 * src/dircolors.hin: Add .rpm, .png, and .fli.
393 1999-08-28 Paul Eggert <eggert@twinsun.com>
395 * getdate.y: Add copyright notice.
397 (number): Handle `Nov 11 1996' example; see Risks Digest 20.55
398 http://catless.ncl.ac.uk/Risks/20.55.html#subj18
401 (<stdio.h>): Include only if testing.
403 (ISLOWER, PC): New macros.
404 (<string.h>): Include if HAVE_STRING_H, not USG.
406 (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
408 (EPOCH_YEAR): Renamed from EPOCH.
409 (table): Renamed from TABLE.
410 (meridian): Now an anonymous enum.
411 (struct parser_control): New type.
412 (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
413 (yyInput, ..., yyRelYear): Migrated into struct parser_control.
414 (%pure_parser): Added, so that the parser is pure.
415 (%union): Removed; the type is now just plain int.
416 All %type directives removed.
417 (tLOCAL_ZONE): New %token.
418 (month_day_table): Renamed from MonthDayTable.
419 (gmtime, localtime, mktime, time): Declare only if not defined.
420 (meridian_table): New table.
421 (dst_table): New table.
422 (units_table): renamed from UnitsTable.
423 (relative_time_table): Renamed from OtherTable.
424 (time_zone_table): Renamed from TimezoneTable. Modernized data.
425 (military_table): Renamed from MilitaryTable.
426 (to_hour): Renamed from ToHour.
427 (to_year): Renamed from ToYear.
428 (lookup_zone): New function.
429 (LookupWord): Renamed from lookup_word.
430 Use lookup_zone for time zones.
431 (yylex): Now reentrant. All callers changed.
432 (get_date): Add support for local time zone abbreviations.
435 1999-08-22 Jim Meyering <meyering@ascend.com>
437 * src/sys2.h (IF_LINT): Define new macro.
438 * src/df.c (main): Rename locals i and j.
439 Use IF_LINT macro instead of #ifdef lint...
441 * src/dd.c (parse_integer): Add `const' to char* parameter and
442 add a separate `suffix' variable.
444 1999-08-20 Jim Meyering <meyering@ascend.com>
446 * src/chown.c (usage): Tweak --help output to make it more consistent
448 * src/chgrp.c (usage): Tweak --help output to make it more consistent
451 1999-08-17 Jim Meyering <meyering@ascend.com>
453 * configure.in: Remove check for rename and the code that would
454 enable building of the `mvdir' program.
455 * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@.
456 (EXTRA_PROGRAMS): Remove obsolete mvdir.
457 * lib/rename.c: Remove obsolete file. (it had a bug, too)
458 * src/mvdir.c: Remove obsolete file.
459 * po/POTFILES.in: Remove mvdir.c
461 * doc/fileutils.texi (chown, chgrp invocation): Make these sections
462 consistent with each other.
464 1999-08-16 Jim Meyering <meyering@ascend.com>
466 * src/chown.c (groupname): Declare to be `const'.
467 (change_dir_owner): Declare statp parameter to be `const'.
468 (usage): Make the output be more consistent with that from chgrp.
470 This change is nearly identical to the chown.c change of 1998-05-24
471 * src/chgrp.c: Accept new option, --dereference.
472 --no-dereference is now the default. Include lchown.h.
473 (enum Change_status) [CH_NOT_APPLIED]: New member.
474 (change_symlinks): Enable this by default, now.
475 (describe_change): Handle new case.
476 (change_file_group): Add new parameter: cmdline_arg. Update callers.
477 Reorganize to reflect changed semantics.
478 (LCHOWN): Remove definitions.
481 1999-08-10 Jim Meyering <meyering@ascend.com>
483 * po/POTFILES.in: Add lib/quotearg.c.
485 1999-08-09 Paul Eggert <eggert@twinsun.com>
487 * NEWS, doc/fileutils.texi, src/ls.c (usage):
488 Add ls --quoting-style=locale.
490 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE):
491 Change from escape_quoting_style to locale_quoting_style.
492 (argmatch_invalid): Use new quotearg_style primitive for simplicity.
493 Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
495 * lib/quotearg.h (locale_quoting_style): New enum value.
496 (quotearg_n_style, quotearg_style): New decls.
498 * lib/quotearg.c: Include <libintl.h> if ENABLE_NLS.
500 (quoting_style_args, quoting_style_v, quotearg_buffer): Add support
501 for locale_quoting_style, using _("`") and _("'") for open and close
503 Do not quote spaces in escape_quoting_style.
504 (quotearg_n_style, quotearg_style): New functions.
506 1999-08-08 Jim Meyering <meyering@ascend.com>
508 * src/touch.c (usage): Clarify description of --time=WORD.
511 * lib/savedir.c (savedir): Change type of name_size parameter to off_t.
512 * lib/savedir.h (savedir): Update prototype.
513 * src/chmod.c (change_dir_mode): Remove cast of savedir arg.
514 * src/chown.c (change_dir_owner): Likewise.
515 * src/chgrp.c (change_dir_group): Likewise.
516 * src/copy.c (copy_dir): Likewise.
517 * src/du.c (count_entry): Likewise.
518 Suggestion from Bob Proulx.
520 1999-08-07 Jim Meyering <meyering@ascend.com>
522 * po/POTFILES.in: Add lots of lib/*.c files.
523 Remove src/cp-hash.c, since it doesn't use _().
525 1999-08-04 Jim Meyering <meyering@ascend.com>
527 * configure.in: Remove getline-testing code. Now it's in m4/.
529 1999-08-01 Paul Eggert <eggert@twinsun.com>
531 * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
533 1999-07-30 Jim Meyering <meyering@ascend.com>
535 * src/ls.c (usage): Explain about default wrt --hide-control-chars and
536 --show-control-chars. Reported by Germano Leichsenring.
538 1999-07-28 Jim Meyering <meyering@ascend.com>
540 * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
542 1999-07-24 Jim Meyering <meyering@ascend.com>
544 * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
545 (dd_copy): Use those to page-align both the input and output buffers.
547 1999-06-01 Volker Borchert <bt@teknon.de>
549 * tests/Makefile.am: Make envvar-check depend on check-recursive rather
550 than on `check' so that its tests are performed before any real tests.
552 1999-07-15 Jim Meyering <meyering@ascend.com>
554 * src/dd.c: Include getpagesize.h.
555 (dd_copy): Page-align the input buffer.
556 Based on a patch from Scott Lurndal.
558 * getpagesize.h: New file.
559 * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h.
561 * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
562 Work around SunOS botch also when block size is different from 1k.
565 1999-07-10 Jim Meyering <meyering@ascend.com>
567 * man/help2man: Import version 1.012.
569 1999-07-04 Jim Meyering <meyering@ascend.com>
571 * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax.
573 1999-07-04 Paul Eggert <eggert@twinsun.com>
575 * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
576 expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
577 (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
580 1999-06-27 Paul Eggert <eggert@twinsun.com>
582 Fix some incompatibilities between `df -P' and POSIX.2.
584 * lib/human.h (enum human_inexact_style): New enum.
585 (human_readable_inexact): New decl.
587 * lib/human.c (human_readable): New function.
588 (human_readable_inexact): Renamed from human_readable, with new arg
589 INEXACT_STYLE. Add support for ceiling and floor.
591 * src/df.c (print_header): Conform to POSIX if posix_format).
592 (df_readable): Take ceiling if posix_format.
593 (ceil_percent): New function.
594 (show_dev): Take ceiling of percent if posix_format.
595 Align with POSIX-conforming header if posix_format.
597 * doc/fileutils.texi: Document these changes.
599 1999-05-27 Volker Borchert <bt@teknon.de>
601 * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
603 1999-05-23 Jim Meyering <meyering@ascend.com>
605 * src/copy.c (copy_internal): Don't apply the umask in move_mode.
606 Otherwise, `mv' would not preserve the permissions when copying
607 between partitions. Reported by David Godfrey
611 * tests/cp/same-file: Correct erroneous expected output from
612 the `cp -f foo foo' tests.
613 * po/POTFILES.in: Add same.c.
614 * lib/same.h: New file.
615 * lib/same.c: New file (function extracted from ln.c).
616 * lib/Makefile.am (libfu_a_SOURCES): Add same.c.
617 (noinst_HEADERS): Add same.h.
618 * src/copy.c: Include same.h.
619 * src/ln.c (same_name): Remove function.
620 <same.h>: Include this instead.
621 <dirname.h>: No longer include this.
622 * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'.
624 * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not
625 remove FILE. Suggestion from Chris Yeo.
626 * tests/mv/force: New test, for the above fix.
627 * tests/mv/Makefile.am (TESTS): Add force.
628 (TESTS_ENVIRONMENT): Change PATH to be absolute.
630 * tests/mv/force (mv): New test.
632 1999-05-17 Paul Eggert <eggert@twinsun.com>
634 * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we
635 have an absolute timestamp, or if the relative timestamp
636 mentions days, months, or years. Reported by Volker Borchert.
638 * lib/human.c (human_readable): Allow from_block_size to be zero.
640 1999-05-14 Jim Meyering <meyering@ascend.com>
642 * tests/Makefile.am (envvar-check): Renamed from check-local.
643 (check): Depend on envvar-check so the envvar check is performed
644 before all other tests. Reported by Volker Borchert.
645 * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
646 so CDPATH is mentioned in the message. Reported by Volker Borchert.
648 * src/df.c (main): When asking for info on an explicit file name,
649 just warn rather than failing if the table of mounted filesystems
650 cannot be read. Based on a patch from Mark Kettenis.
652 * lib/version-etc.c (version_etc): Put version info and author names
653 on the first two lines respectively rather than putting the three
654 lines of copyright info between them.
656 * src/touch.c (open_maybe_create): Handle Solaris' failure mode when
657 FILE is a directory. Reported by Vin Shelton.
659 * lib/human.c: Include <string.h> or <strings.h> for strlen prototype.
660 * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes.
661 * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on
662 64-bit systems. From Ulrich Drepper.
664 1999-05-12 Jim Meyering <meyering@ascend.com>
666 * src/shred.c (main): Put `u' for -u in getopt_long's string argument.
669 1999-05-07 Jim Meyering <meyering@ascend.com>
673 * tests/touch/dir-1: New test.
674 * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual
675 upper-case program names. Add a definition of PATH.
678 * src/mkdir.c (main): Use better wording in diagnostic: `cannot
679 create directory' rather than `cannot make directory'. The former
680 also matches the one in makepath.c.
682 * src/dd.c: (apply_translations): Use TOUPPER and TOLOWER,
683 not toupper and tolower.
685 1999-05-05 Jim Meyering <meyering@ascend.com>
687 * lib/makepath.c (make_dir): When reporting a mkdir failure and the
688 target cannot be `stat'ed, use the errno from the failed mkdir call,
689 not the one from the stat call. Before this change, running
690 `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
691 elicit `No such file or directory' instead of `Permission denied'.
693 * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
694 (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
695 Based on a patch from Kaveh Ghazi.
697 * src/ls.c (USE_ACL): Define this only #if
698 (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
699 Use `USE_ACL' in place of `HAVE_ACL' everywhere else. From Kaveh Ghazi.
701 1999-05-04 Jim Meyering <meyering@ascend.com>
703 * lib/makepath.c: Include makepath.h libintl.h, not after it.
704 Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
705 (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
706 which is necessary on Irix4 since cc doesn't define __STDC__.)
709 1999-04-30 Jim Meyering <meyering@ascend.com>
711 * Makefile.maint: Define several tag-related make variables.
712 (cvs-dist): Use the make variables instead of shell ones.
713 (announcement): Automatically generate diffs for all ChangeLog files,
714 not just the top level one.
716 1999-04-30 Paul Eggert <eggert@twinsun.com>
718 * lib/dup2.c: New file.
720 1999-04-30 Jim Meyering <meyering@ascend.com>
722 * src/touch.c (touch): Only do the fstat if we need to.
723 Resort to calling stat for directories, but only when necessary.
724 (usage): Mention --no-create.
726 * src/copy.c (copy_internal): Move the one-file-system test so that
727 it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
728 Prior to this change, `cp --one-file-system' would traverse a file-
729 system boundary if the destination directory existed. From Ton Hospel.
731 1999-04-27 Paul Eggert <eggert@twinsun.com>
733 * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO
734 for output, to avoid confusion with closed input and output fds.
735 (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
737 (open_fd): New function.
738 (main): Use it, instead of open, to ensure that file descriptors
741 1999-04-26 Paul Eggert <eggert@twinsun.com>
743 * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead
746 * src/dd.c (skip): Don't fstat the input file; the result is
749 1999-04-26 Jim Meyering <meyering@ascend.com>
751 * tests/mv/into-self-2: Update to reflect this change by reversing
752 the order of arguments so the symlink is the source, not the
753 destination (otherwise, the mv command would now succeed).
755 * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail.
756 That is, even though source and destination are `the same,' don't fail
757 if the destination is a symlink. From Peter Samuelson.
759 1999-04-26 Paul Eggert <eggert@twinsun.com>
761 * src/dd.c (main): If you can't open an output file (with
762 seek=...) read-write, then open it for write and report an
763 error if we can't seek.
765 * lib/filemode.c (setst, ftypelet, mode_string):
766 * lib/mkdir.c (mkdir):
767 * lib/makepath.c (make_path):
768 * lib/modechange.c (make_node_op_equals, mode_compile,
769 mode_create_from_ref, mode_adjust):
770 * lib/modechange.h (mode_adjust):
771 * src/chmod.c (describe_change, change_file_mode):
772 * src/copy.c (copy_reg, copy_internal):
773 * src/copy.h (struct cp_options.umask_kill):
774 * src/cp.c (do_copy, cp_option_init, main):
776 * src/install.c (mode, cp_option_init, DIR_MODE):
777 * src/mkdir.c (main):
778 * src/mkfifo.c (main):
779 * src/mknod.c (main):
780 * src/mv.c (cp_option_init):
781 * src/touch.c (open_maybe_create):
782 Use proper mode_t types and macros.
783 Don't assume the traditional Unix values for mode bits.
785 * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH,
786 S_IXOTH): Define if not defined.
788 * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
789 * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU):
790 Define if not defined.
791 * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
792 Define if not defined.
793 (CHMOD_MODE_BITS): New macro.
794 * src/install.c (isodigit): Remove unused macro.
796 * src/mkfifo.c, src/mknod.c (usage):
797 Use symbolic mode as default, not octal.
799 * lib/utime.c (utime_null):
800 Don't pass 0666 to open; it's not needed and isn't
801 guaranteed to be portable.
803 * lib/filemode.h: <config.h>, <sys/types.h>: Include for mode_t.
804 (mode_string): Now takes mode_t.
806 * lib/modechange.h: Include <config.h>, <sys/types.h> for mode_t.
807 (struct mode_change): Members affected and value are now mode_t instead
810 * doc/fileutils.texi, doc/perm.texi:
811 Don't assume traditional Unix mode numbering.
813 * lib/modechange.c: modechange.h now includes sys/types.h.
815 (isodigit, oatoi): Remove.
816 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
817 S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
818 S_IRWXO): Define if not defined.
819 (CHMOD_MODE_BITS): New macro.
820 (mode_compile): Convert from octal with xstrtoul, not our own routine.
822 1999-04-24 Jim Meyering <meyering@ascend.com>
826 1999-04-22 Jim Meyering <meyering@ascend.com>
828 * src/shred.c (word32): Don't use `#error'; it runs afoul of
829 SunOS 4.1.4 cc. From Paul Eggert.
831 * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
833 1999-04-20 Paul Eggert <eggert@twinsun.com>
835 Replace our temporary hack implementation of strtoumax with
836 something very close to the real code in glibc.
838 * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
839 we now have a true replacement in strtoumax.c.
840 (__strtol): Always define to strtoumax.
841 (<stdlib.h>): No need to include.
843 (my_strtoumax): Move this to strtoumax.c,
844 rename it to strtoumax, and simplify.
846 * lib/strtoull.c, lib/strtoumax.c: New files.
848 * lib/strtol.c: Update to glibc 2.1.1 version.
850 1999-04-20 Jim Meyering <meyering@ascend.com>
852 * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
853 (check-local): Also test and warn if CDPATH is set.
855 1999-04-20 Paul Eggert <eggert@twinsun.com>
857 * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
859 * config.guess: New file (from autoconf).
860 * config.sub: New file (from autoconf).
862 * src/shred.c <config.h>: Include first, since it can do
863 things like #define const, and this must be done before
864 including any system headers.
866 * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
867 whether overflow occurred. Improve overflow-detection to use
868 only one conditional branch total, rather than 2N+1
869 conditional branches for an N-digit number.
871 1999-04-18 Jim Meyering <meyering@ascend.com>
873 * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
874 strtouq, now that they're checked in m4/xstrtoumax.m4.
876 1999-04-18 Paul Eggert <eggert@twinsun.com>
878 * doc/fileutils.texi, src/shred.c (main, longopts):
879 Use -u instead of -R for --remove, so that we can preserve
880 future compatibility with rm.
882 1999-04-18 Jim Meyering <meyering@ascend.com>
884 * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
885 (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
888 1999-04-18 Paul Eggert <eggert@twinsun.com>
890 Fix shred to do the right thing with off_t longer than long.
891 Merge large-integer parsing code with similar code in dd.c,
892 and put the resulting in lib/xstrtoumax.c so that other programs
893 can use it. Instead of adding a new lib/xstrtoumax.h I thought
894 it cleaner to put all the xstroto* declarations into a single
895 header, which for now is lib/xstrtol.h for lack of a better place.
896 (Mayby lib/xstdlib.h would be better? :-)
898 I thought of several other problems with shredding regular files;
899 shredding devices is much more reliable. So I changed the defaults
900 to be more suitable for shredding devices; this should help encourage
901 users to do the right thing.
903 pfstatus isn't portable to environments with varying width
904 fonts, or with internationalized environments where the byte
905 count of the message is not the same as its print width.
906 Rather than deal with this, I just simplified it to not do
907 tricks with carriage-returns and spaces. (I'm also worried
908 that vprintf may not return the right value on some hosts; I
909 vaguelly recall this being a problem.) As a result, -v and -
912 When removing a special file, try to truncate it first, but don't
913 worry if this reports an error.
915 Try to find the size of a non-regular file by seeking to its end.
917 Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
919 Some other minor bug fixes.
921 * lib/xstrtoul.h: Remove this file.
922 * lib/xstrtoumax.c: New file.
924 * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
926 * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
927 (__strtol, __strtol_t, __xstrtol): New macros.
929 * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
930 New macros to specify the
931 underlying function, its returned type, and our function. Default to
932 values suitable for xstrtol.
934 Include <ctype.h>, since we use its macros.
936 (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
937 (ISSPACE): New macro.
939 (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
942 (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
943 whether STRING_TO_UNSIGNED is defined. Skip isspace chars, not
944 isblank chars, to match strtol. When returning
945 LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
948 * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
949 <inttypes.h>: Include if HAVE_INTTYPES_H.
950 (_DECLARE_XSTRTOL): New macro.
951 (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
952 we need only one include file, not three.
953 (_STRTOL_ERROR): Do not undef, as this is no longer needed.
954 Reword overflow message so that it's independent of type.
956 * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
957 (noinst_HEADERS): Remove xstrtoul.h.
959 * lib/xmalloc.c (xalloc_fail):
960 Pass xalloc_msg_memory_exhausted through gettext.
963 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
964 (LookupWord, yylex): Don't pass negative char to ctype macros.
966 * doc/fileutils.texi:
967 Explain why shredding devices is more reliable, and why the
968 default options are more suitable for devices.
970 Remove withdrawn options -b or --no-contents, -c or --freed-contents,
971 -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
974 Add -R or --remove, -s or --size.
976 -v can no longer be doubled.
978 `file system' --> `filesystem' uniformly.
980 * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
982 * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
983 "human.h", "xalloc.h": Include.
984 (attribute): Remove; no longer needed.
986 (STDOUT_FILENO): New macro.
987 (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
989 The following changes have effect only if !HAVE_CONFIG_H.
990 <ctype.h>: New include.
991 (RETSIGTYPE): Remove bogus semicolon at end.
992 (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
994 (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
995 Handle suffixes like the real routine does.
996 (error): Remove bogus assignment of errno to errnum.
997 (xmalloc, xstrdup): New functions.
999 (O_NOCTTY): Define even if !HAVE_CONFIG_H.
1000 (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
1001 (OUTPUT_BLOCK_SIZE): New macro.
1002 (struct Options.verbose): Now a boolean, since we no longer have two
1003 levels of verbosity.
1004 (long_opts, usage, main): Remove -D or --device option. Invert -p or
1005 --preserve option, and rename it to -R or --remove.
1006 (usage): Describe G suffix.
1007 (usage): "-" no longer conflicts with -v.
1008 (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
1009 (ind): Portability fixes: return word32, not unsigned; multiply by
1010 sizeof (word32) instead of shifting left by 2.
1011 (isaac_refill, isaac_mix): Comment out size of array parameter, as
1012 ansi2knr mishandles this.
1013 (status_visible, status_pos, pfstatus, flushstatus): Remove, since
1014 pfstatus isn't portable to users with varying width fonts, or
1015 internationalized messages, and vfprintf is problematic. All callers
1016 of pfstatus changed to use error instead; this removes incompatibility
1017 of -v with -. All calls to flushstatus removed.
1018 (dopass, do_wipefd): Do not translate non-English msgs with gettext.
1020 (dopass): Cast lseek constant arguments to (off_t) for benefit
1021 of pre-ANSI compilers; fix one lseek call whose args were interchanged.
1022 Remove unnecessary casts to (off_t). Do not check for EIO
1023 when determining file size; this was just my earlier wild guess.
1024 Use human_readable to print off_t, instead of casting to unsigned long
1025 (which doesn't work in Solaris 2.6, where off_t is longer than long).
1026 Output human-readable sizes, instead of always using "K".
1027 Check for offset overflow (it happened to me in SunOS 4.1.4).
1028 (do_wipefd): Do not insist on regular files, but do check for special
1029 files that cannot possibly be shredded.
1030 Use xmalloc instead of malloc + check.
1031 Do not inspect st_size for non-regular files.
1032 Try to find the size of a non-regular file by seeking to its end.
1033 Do not assume that a regular file of size-0 has unknown size.
1034 Check for regular files with negative sizes,
1035 and for overflow after rounding to next block.
1036 Always try to truncate, even for special files, but do not report an
1037 error if truncation fails on a special file.
1039 (dopass, wipefile): Do not return 1 for special files; the caller
1040 doesn't care any more.
1042 (wipefd): Remove unnecessary (and nonportable) check for
1043 whether the file descriptor is read-only. Remove
1044 no-longer-needed check for `-v -'.
1046 (incname): Return 1 for carry bit, like the documentation says.
1048 (wipename, wipefile): Accept new argument, specifying the
1049 quoted file name. All callers changed.
1051 (wipename): Use xstrdup instead of strdup+error check.
1053 (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
1054 errors in NNN more carefully. Restore errno after the check.
1055 Check for errors when closing the file descriptor.
1056 Use more consistent wording when unable to remove a file.
1058 (main): Do not remove files by default.
1059 Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
1060 exist if !HAVE_CONFIG_H.
1061 In diagnostics, quote invalid operands to -n and -s options.
1062 Allow T, P, E, Z, and Y suffixes in -s operand.
1063 flags.verbose is now a boolean, not a counter.
1064 Use STDOUT_FILENO instead of 1, for clarity.
1067 Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
1068 xstrto... functions.
1070 * src/dd.c: Include xstrtol.h.
1071 (parse_integer): Migrate most of the work into the new xstrtoumax fn.
1073 * lib/xstrtoumax.c: New file.
1075 1999-04-18 Jim Meyering <meyering@ascend.com>
1077 * src/dd.c (main): Open the output file with *read* access
1078 only if we might need to read to satisfy a `seek=' request.
1079 From Matthias Urlichs.
1081 1999-04-10 Jim Meyering <meyering@ascend.com>
1083 * Makefile.maint (alpha): Add trailing slash for ncftp.
1087 * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
1088 * tests/Makefile.am (SUBDIRS): Add dd.
1089 * tests/dd: New directory
1090 * tests/dd/misc: New file.
1092 `ls --color' would segfault
1093 * src/ls.c: Include assert.h.
1094 (color_indicator[]): Add an entry for the type, `door.'
1095 (main): Assert that the lengths of the color_indicator and
1096 indicator_name arrays are appropriately related.
1097 Reported by John Gotts.
1099 * src/dd.c (scanargs): Fix bug introduced with last change: now that
1100 the loop is gone, manually decrement argc and increment argv.
1101 Reported by Andreas Jaeger and jvogel@linkny.com.
1103 1999-04-07 Jim Meyering <meyering@ascend.com>
1105 * lib/getdate.y (difftm): Protoize.
1107 1999-04-06 Jim Meyering <meyering@ascend.com>
1109 * lib/strftime.c: Update from master source in libc.
1111 1999-04-04 Jim Meyering <meyering@ascend.com>
1113 * tests/ln/misc: Comment out the test added on 1999-01-31.
1115 * Makefile.maint (url_dir_list): Define properly.
1116 (real_dir_list): Likewise.
1118 * src/shred.c: Don't include string.h.
1119 [!HAVE_CONFIG_H]: Include string.h here.
1120 [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
1121 (sigill_handler): Change return type and type of local `oldhandler' to
1123 (isaac_seed_machdep): Change and type of local `oldhandler' to
1129 * tests/cp/same-file: Change the sed command used to extract the
1130 filename from ls -l output, to accommodate the change in format.
1132 * src/ls.c (print_long_format): Add a space between %s and %3u. This
1133 assures that even when modebuf has the trailing `+' and there are more
1134 than 99 hard links to a file, the permissions string and the link count
1137 1999-04-03 Jim Meyering <meyering@ascend.com>
1139 * src/shred.c (dopass): add curly braces to avoid warning about
1141 (wipefd): Add parentheses suggested by gcc.
1142 (do_wipefd): Remove declaration of unused local.
1144 1999-04-02 Colin Plumb <colin@nyx.net>
1146 * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
1147 to allow standalone compilation.
1149 (wipefile): Added support for emulating /dev/fd/# files even if
1150 the OS doesn't support them. From Paul Eggert.
1152 (main, usage): Changed --device short option to -D.
1154 (wipefd, do_wipefd): Renamed function to do_wipefd and added
1155 separate wipefd that performs sanity checks on externally-opened file
1156 descriptors, such as not append-only. From Paul Eggert.
1158 (do_wipefd, isaac_seedfd): Do not read file for any reason.
1159 if the file is low-entropy, it's a security hole.
1160 (wipefile) Changed to open O_WRONLY and chmod to write-only when
1162 (isaac_seedfd) Function deleted as unnecessary.
1165 (dopass): Dynamically fall back to fsync() if fdatasync() fails,
1166 since POSIX, in their infinitesimal wisdom, encourage implementations
1167 that return constant -1, making compile-time testing useless.
1170 (dopass): Changed to support a size of -1 to mean "unknown".
1171 This entailed changing to a counting-up offset rather than couting-down
1172 cursize for the central state variable. Also changed size argument to
1173 be call-by-reference so that it can be passed back once known.
1174 (sizer) Function deleted as unnecessary.
1175 (wipefd): Changed to match. From Paul Eggert
1177 (dopass): Try to skip over bad blocks in destination files.
1178 Also added ftruncate() for more complete destruction of metadata.
1180 (main, usage): Changed "-" to stand for standard output.
1181 (wipefd): Added error message to detect conflict with -v.
1183 (dopass): Added periodic fsync() calls to keep the pass progress
1184 display in sync with reality. Hopefully they're sufficiently far spaced
1185 that throughput isn't affected. It might be a good thing to do even in
1186 non-verbose mode, to avoid filling up the kernel caches with dirty data.
1187 Also added ftruncate() for more complete destruction of metadata.
1189 (quotearg_colon): New function to print
1190 pathological filenames properly.
1191 [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
1192 that does most of the work.
1193 (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
1194 (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
1195 Error messages are also in a more uniform format.
1198 (struct Options, main, do_wipefd): Added -s/--size=N flag.
1199 (xstrtoul): Added support for valid_suffixes to help this.
1200 (usage) Documented it.
1202 (error): Changed some arguments from N_() to _(), since error()
1203 does not translate its argument. I think this is a bug.
1205 (struct Options do_wipefd, wipefd, wipefile, main): moved passes
1206 argument into the Options structure as n_iterations, which is now a
1207 size_t. From Paul Eggert.
1209 (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
1210 to manage seeding of RNG with arbitrary-sized data.
1211 (isaac_init): commented out as dead code.
1212 (isaac_seed): changed to use new functions to prevent any possibility of
1215 (isaac_seed): Added support for Solaris' gethrtime()
1216 configure.in: Corresponding feature test. From Paul Eggert.
1218 (wipename): Change remove() to unlink() for speed & portability.
1219 Use lstat() instead of access() to see if a filename is taken. This
1220 works even on dangling symlinks and avoids the suid problems of
1221 access(2). From Paul Eggert.
1223 (isaac_seed_machdep): New function for reading cycle counters
1225 1999-04-02 Paul Eggert <eggert@shade.twinsun.com>
1227 * configure.in (AC_CHECK_FUNCS): Add gethrtime.
1229 * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
1230 Use gethrtime if available. Don't assume that clock_gettime succeeds.
1231 Put most random sources first.
1233 1999-04-02 Paul Eggert <eggert@twinsun.com>
1235 shred: Add new options -bcCklL and fix some porting problems.
1236 Remove options -dp. Do not read output files.
1238 * src/shred.c (long_opts, usage, main, wipefile): Adjust to
1240 ("human.h", "quotearg.h"): New includes.
1241 (struct Options): New members contents, links, n_iterations.
1242 Remove allow_devices, remove_file. Change n_iterations to size_t.
1244 (output_block_size): New var.
1245 (usage): Declare __noreturn__ attribute.
1246 (fdatasync): Define to -1 if not present, since we need to invoke both
1247 fdatasync and fsync if both are present. All invokers of fdatasync
1248 now try fdatasync, then fsync.
1250 (isaac_seed): Use it to mix in values. Add uid, gid to mix.
1251 Don't use gettimeofday, as it has too many porting problems.
1252 (isaac_seedfd): Remove, since we no longer read the output files.
1253 (sizefd): Remove; we now determine size by writing sequentially.
1254 (dopass, wipename, wipefile, main): Clean up error messages.
1255 (dopass): Keep track of offset relative to start of file, not
1256 end, since we may not know how large the file is. If size is
1257 negative, write until we fall off the end of the file.
1258 (wipefd): Do not read output file.
1259 Return 0 if successful, -1 if not; do not make a special case for
1260 non-regular files, since our callers have that info now.
1261 (wipename): Now static. Return errno if error.
1262 (main): "-" now stands for standard output.
1263 Do not shred append-only standard output.
1264 (wipefile): Do not grant read permission to file when wiping it.
1265 Use symbolic permission (S_IWUSR), not octal.
1267 * src/system.h (S_IWUSR): Define if not already defined.
1269 * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
1270 (AC_CHECK_FUNCS): Remove gettimeofday.
1272 * doc/fileutils.texi: Document recent changes.
1274 1999-04-01 Jim Meyering <meyering@ascend.com>
1276 * configure.in (AC_CHECK_FUNCS): Add acl.
1277 (AC_CHECK_HEADERS): Add sys/acl.h.
1278 * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
1279 (struct fileinfo): New member `have_acl'.
1280 (gobble_file): Initialize it.
1281 (print_long_format): Use it.
1282 Mostly from Alen Muzinic.
1284 * src/touch.c (open_maybe_create): New function.
1285 (touch): Rewrite not to use `creat' and to eliminate a race
1286 condition that could make touch truncate a nonempty file.
1287 Report and suggestions from Andrew Tridgell.
1289 1999-03-31 Jim Meyering <meyering@ascend.com>
1291 * src/du.c: Remove prototypes and tsort function definitions.
1293 * src/chown.c (main): Move the declaration of `e' into the scope
1294 where it's used and make it `const'.
1296 * src/install.c (main): Qualify a char* with the `const' keyword.
1297 (install_file_in_dir): Likewise.
1298 * src/ln.c (main): Likewise.
1299 * src/mkdir.c (main): Likewise.
1300 * src/mkfifo.c (main): Likewise.
1301 * src/mknod.c (main): Likewise.
1302 * src/mv.c (main): Likewise.
1303 * src/touch.c (touch): Likewise.
1305 1999-03-30 Jim Meyering <meyering@ascend.com>
1307 * src/*.c: Don't include closeout.h or version-etc.h explicitly.
1308 Now, they're included via sys2.h.
1310 1999-03-29 Jim Meyering <meyering@ascend.com>
1312 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
1313 the catch-all for shared autoconf code, m4/jm-macros.m4.
1314 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
1317 1999-03-29 Paul Eggert <eggert@twinsun.com>
1319 Minor lint removal in code that forks and execs.
1321 * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
1322 against zero. This is to improve portability.
1323 * lib/rename.c (rename): Likewise.
1324 * lib/rmdir.c (rmdir): Likewise.
1326 * lib/rename.c (rename):
1327 (rename): Do not print any error messages, so that the messages
1328 are internationalized properly.
1330 * src/install.c (strip): Use standard "cannot fork" message.
1331 Check for strip nonzero exit status.
1333 1999-03-28 Jim Meyering <meyering@ascend.com>
1335 `chmod =OP' did not properly apply the umask
1336 * lib/modechange.c (make_node_op_equals): New function.
1337 (mode_append_entry): Likewise.
1338 (mode_compile): When none of [ugoa] is specified in an `=OP' change
1339 mode request, insert a `=0' entry into the linked list so that all
1340 bits are cleared first. Use the new functions.
1341 Reported by Andrew Dalke.
1343 New test for the above.
1344 * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
1345 * tests/Makefile.am (SUBDIRS): Add chmod.
1346 * tests/chmod: New directory
1347 * tests/chmod/equal-x: New file.
1349 1999-03-27 Jim Meyering <meyering@ascend.com>
1351 * lib/modechange.c (mode_compile): Upon allocation failure, free
1352 everything starting with the head, not the tail.
1354 * src/install.c (strip): Use pid_t, not int. From John Bley.
1356 1999-03-26 Jim Meyering <meyering@ascend.com>
1358 * src/dd.c (PROGRAM_NAME, AUTHORS): Define
1359 (long_options): Remove unused struct.
1360 (scanargs): Remove useless loop.
1361 (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
1362 * src/mvdir.c: Likewise.
1363 * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
1365 1999-03-25 Jim Meyering <meyering@ascend.com>
1367 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
1368 (noinst_HEADERS): Add version-etc.h.
1370 * lib/long-options.c (parse_long_options): Remove version-, copyright-,
1371 and author-printing code. Do it via version_etc.
1373 * lib/version-etc.c: New file.
1374 * lib/version-etc.h: Prototype for same.
1376 * src/sys2.h (GETOPT_HELP_CHAR): Define.
1377 (GETOPT_VERSION_CHAR): Define.
1378 (GETOPT_HELP_OPTION_DECL): Define.
1379 (GETOPT_VERSION_OPTION_DECL): Define.
1380 (case_GETOPT_HELP_CHAR): Define.
1381 (case_GETOPT_VERSION_CHAR): Define.
1383 * src/chgrp.c: No longer include long-options.h.
1384 Include version-etc.h instead.
1385 (PROGRAM_NAME, AUTHORS): Define.
1386 [long_options]: Add entries for --help and --version.
1387 Remove parse_long_options call.
1388 (main) [getopt switch]: Add a case for each of --help and --version.
1389 * src/chgrp.c: Likewise.
1390 * src/chmod.c: Likewise.
1391 * src/cp.c: Likewise.
1392 * src/df.c: Likewise.
1393 * src/dircolors.c: Likewise.
1394 * src/du.c: Likewise.
1395 * src/install.c: Likewise.
1396 * src/ln.c: Likewise.
1397 * src/ls.c: Likewise.
1398 * src/mkdir.c: Likewise.
1399 * src/mkfifo.c: Likewise.
1400 * src/mknod.c: Likewise.
1401 * src/mv.c: Likewise.
1402 * src/rm.c: Likewise.
1403 * src/rmdir.c: Likewise.
1404 * src/shred.c: Likewise.
1405 * src/touch.c: Likewise.
1407 1999-03-24 Jim Meyering <meyering@ascend.com>
1409 * man/help2man: Import version 1.010.
1411 1999-03-22 Jim Meyering <meyering@ascend.com>
1413 * src/chmod.c (usage): Add one-liner. Suggestion from Karl Berry.
1415 1999-03-19 Jim Meyering <meyering@ascend.com>
1417 * src/automake-wrap: Rewrite the automake-generated rule for
1418 clean-binPROGRAMS so that it removes rm even with a losing PATH on a
1419 losing system (PATH with `.' before /bin on a system where you can't
1420 unlink a running executable). Reported by William Bader.
1422 * configure.in: Use jm_WINSIZE_IN_PTEM.
1423 * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
1424 Required by SCO ODT 2.0 systems. Reported by William Bader.
1426 1999-03-18 Jim Meyering <meyering@ascend.com>
1428 * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
1429 (remove_init): Call hash_initialize with one more argument.
1431 1999-03-15 Jim Meyering <meyering@ascend.com>
1433 Revamp to allow fine-tuning to control when and by how
1434 much the table grows and shrinks.
1435 * lib/hash.c (next_prime): Don't assert.
1436 (hash_reset_tuning): New function.
1437 (check_tuning): New function.
1438 (hash_initialize): Accept and use new tuning parameter.
1439 (hash_rehash): Rewrite, updating for tuning.
1440 (hash_insert): Honor tuning semantics.
1441 (hash_delete): Likewise.
1442 From François Pinard.
1444 * lib/hash.h (struct hash_tuning): Define.
1445 (struct hash_table) [tuning]: Add member.
1446 (hash_initialize): Add `tuning' parameter.
1448 * lib/hash.c (hash_insert): Remove last parameter and change semantics.
1449 * lib/hash.h (hash_insert): Update prototype.
1451 * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
1452 otherwise, we'd do so even when the insertion failed.
1453 From François Pinard.
1455 1999-03-07 Jim Meyering <meyering@ascend.com>
1457 * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
1458 have to be scanned for % signs. Suggestion from François Pinard.
1460 * Makefile.maint: Add two more URLs and the loops to use them.
1462 * lib/long-options.c (parse_long_options): Include `Copyright...' line
1463 in --version output.
1464 Add the `...NO warranty...' message.
1466 1999-03-03 Jim Meyering <meyering@ascend.com>
1468 * lib/long-options.c (_): Define it.
1469 (parse_long_options): Accept new parameter, authors, and print it.
1471 * lib/long-options.h: Update prototype.
1473 * src/chgrp.c: Include long-options.h
1474 [long_options]: Remove the "help" and "version" entries.
1475 (main): Use parse_long_options, including author name(s).
1476 Remove the show_version and show_help blocks.
1477 * src/chmod.c: Likewise.
1478 * src/chown.c: Likewise.
1479 * src/cp.c: Likewise.
1480 * src/dd.c: Likewise.
1481 * src/df.c: Likewise.
1482 * src/dircolors.c: Likewise.
1483 * src/du.c: Likewise.
1484 * src/install.c: Likewise.
1485 * src/ln.c: Likewise.
1486 * src/ls.c: Likewise.
1487 * src/mkdir.c: Likewise.
1488 * src/mkfifo.c: Likewise.
1489 * src/mknod.c: Likewise.
1490 * src/mv.c: Likewise.
1491 * src/mvdir.c: Likewise.
1492 * src/rm.c: Likewise.
1493 * src/rmdir.c: Likewise.
1494 * src/shred.c: Likewise.
1495 * src/sync.c: Likewise.
1496 * src/touch.c: Likewise.
1498 1999-02-18 Paul Eggert <eggert@twinsun.com>
1500 * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
1501 The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
1503 1999-02-17 Jim Meyering <meyering@ascend.com>
1505 * src/shred.c (wipename): Fix string thinko. Now, shredding files
1506 in subdirectories works (dir/file). From Janos Farkas.
1508 1999-02-13 Jim Meyering <meyering@ascend.com>
1510 * src/dircolors.c (dc_parse_stream): Don't try to dereference
1511 NULL if there's an error in our built-in list.
1512 Suggestion from François Pinard.
1514 1999-02-13 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
1516 * src/install.c (main): Set x.backup_type only if backups are requested.
1517 (cp_option_init): Initialize backup_type.
1518 (backup_type): Remove unused variable.
1520 * doc/fileutils.texi: Fix use of @item vs @itemx.
1522 1999-02-08 Jim Meyering <meyering@ascend.com>
1524 * src/dircolors.c (slack_codes): Add "DOOR".
1525 (ls_codes): Add corresponding "do".
1526 Reported by John Gotts.
1528 * configure.in (ALL_LINGUAS): Add Italian (it).
1530 1999-02-07 Jim Meyering <meyering@ascend.com>
1532 * Version 4.0d (aka 4.1-b4).
1534 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
1535 is hooked up to the distcheck rule.
1536 * Makefile.am (distcheck-hook): New target and rule -- link to shared
1537 rule, my-distcheck, in Makefile.maint.
1539 * doc/fileutils.texi (shred invocation): New section. From Colin Plumb.
1541 * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
1542 group-member.m4, and just use this new macro.
1543 Use `.$ac_objext', not the literal `.o'.
1545 1999-02-02 Jim Meyering <meyering@ascend.com>
1547 * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
1548 Define to zero if not already defined.
1549 (HAVE_SYMLINKS): Define.
1550 (gobble_file): Remove #ifdef.
1551 (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
1552 rather than #ifdef S_ISLNK.
1553 (print_type_indicator): Remove #ifdefs and reorganize.
1554 (print_color_indicator): Remove #ifdefs.
1555 (length_of_file_name_and_frills): Likewise.
1557 1999-02-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1559 * src/dircolors.hin: Handle DOOR.
1561 * src/ls.c (print_type_indicator): Print doors as '>'.
1562 (length_of_file_name_and_frills): Account for this.
1563 (indicator_no): Define C_DOOR.
1564 (indicator_name): Add corresponding name.
1566 * lib/filemode.c (ftypelet): Handle doors.
1568 * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
1570 1999-02-01 Jim Meyering <meyering@ascend.com>
1572 * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
1573 argument list. From Akim Demaille.
1575 1999-01-31 Jim Meyering <meyering@ascend.com>
1577 * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
1578 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
1580 * tests/ln/misc: Add test for this.
1581 * src/ln.c (do_link): Allow creation of a hard link to a dangling
1582 symlink. Reported by Alexey Solovyov.
1584 * src/copy.c (copy_internal): Describe any backup-related renaming
1585 operations when in verbose mode.
1586 (copy_internal): Likewise.
1587 Based on changes from Marty Leisner.
1589 * lib/lchown.c: Declare chown.
1591 1999-01-30 Jim Meyering <meyering@ascend.com>
1593 * acconfig.h: Remove uintmax and STAT* #undefs.
1594 * configure.in: Require autoconf 2.13.
1595 Remove test for AFS.
1596 Use 3-argument form of AC_DEFINE*.
1598 1999-01-28 Jim Meyering <meyering@ascend.com>
1600 * po/POTFILES.in: Add src/shred.c.
1602 * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
1603 TM_IN_SYS_TIME based one (for shred).
1605 * acconfig.h: Remove lots of `#undef's, now that we use the
1606 3-argument forms of AC_DEFINE* macros.
1608 1999-01-25 Jim Meyering <meyering@ascend.com>
1610 * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
1612 (AC_CHECK_FUNCS): Add clock_gettime.
1614 * src/shred.c (isaac_seed): Guard clock_gettime with test of
1615 HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
1616 (wipename): Rename local dirfd to dir_fd to avoid shadowing the
1617 function declared in Linux's dirent.h.
1619 1999-01-25 Akim Demaille <demaille@inf.enst.fr>
1621 * lib/argmatch.h (ARRAY_CARDINALITY): Define.
1622 (ARGMATCH_ASSERT): New macro.
1624 * lib/argmatch.c (program_name): Remove dcl.
1626 (argmatch_invalid): Use error rather than fprintf.
1628 1999-01-24 Jim Meyering <meyering@ascend.com>
1630 * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
1631 New version from L. Peter Deutsch.
1633 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
1634 (and hence that of the local `n1', too) to `int' at Paul's request.
1636 * lib/closeout.c: Add comments.
1638 * src/shred.c (fdatasync): Remove function. instead, ...
1639 (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
1642 1999-01-23 Jim Meyering <meyering@ascend.com>
1644 * src/Makefile.am (bin_PROGRAMS): Add shred.
1645 * src/shred.c: New file.
1648 (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
1649 only when in verbose mode.
1650 (fdatasync) [! HAVE_FDATASYNC]: New function.
1652 * man/Makefile.am (man_MANS): Add shred.1.
1653 * man/Makefile.summ (shred-summary): Define.
1654 * man/shred.x: New file.
1656 * src/shred.c: New file. From Colin Plumb.
1657 Include config.h, getopt.h, system.h and error.h.
1658 Use #else/#if, not #elif.
1660 1998-11-05 Paul Eggert <eggert@twinsun.com>
1662 * lib/mktime.c (__mktime_internal): Adopt the traditional (and
1663 problematic) notion of what to do when tm_isdst doesn't match.
1665 1999-01-17 Jim Meyering <meyering@ascend.com>
1667 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
1668 than setting RM and CP.
1669 * tests/cp/*: Now that PATH is set properly, use rm and cp rather
1672 * tests/ln/Makefile.am (TESTS): Add backup-1.
1673 (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
1674 * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
1675 * tests/ln/backup-1: New test for this.
1676 * src/ln.c (do_link): Try to remove DEST even after renaming it.
1677 This fixes a bug reported by Jamie Lokier.
1679 * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
1681 1999-01-16 Jim Meyering <meyering@ascend.com>
1683 * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
1685 * acconfig.h: Remove @BOTTOM@ section.
1686 Instead, add the define and decl via m4/jm-macros.m4.
1688 * src/ls.c: Don't declare base_name.
1689 Use function-style XARGMATCH once again.
1690 * src/touch.c: Likewise.
1691 * acconfig.h: Add a @BOTTOM@ section.
1692 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
1696 * src/cp.c: Remove declarations of base_name and get_version.
1697 (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
1698 Use xget_version and function-style XARGMATCH.
1699 * src/mv.c (main): Likewise.
1700 * src/ln.c (main): Likewise.
1701 * src/install.c (main): Likewise.
1702 * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
1703 unsigned int, not just int.
1704 * lib/backupfile.h (get_version): Adjust prototype.
1705 (xget_version): Add prototype.
1706 (base_name): Remove prototype.
1707 * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
1708 (backup_args): Reorder enum members.
1709 (backup_types): Likewise.
1710 (get_version): Take an additional parameter, `context'.
1711 (xget_version): Like get_version, but if the `version' argument is NULL,
1712 use the value of the envvar VERSION_CONTROL.
1713 (base_name): Declare.
1714 Mostly from Akim Demaille.
1716 * lib/addext.c: (base_name): Declare.
1717 * src/sys2.h: Add prototype for base_name.
1719 * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
1720 * lib/argmatch.h: Likewise.
1722 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
1723 (XARGCASEMATCH): Likewise.
1725 * lib/argmatch.c (EXIT_FAILURE): Define.
1726 (ARGMATCH_DIE): Provide default.
1727 (__xargmatch_internal): New function.
1728 s/rogram_name/program_name.
1731 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
1733 * src/touch.c (usage): Don't make it static so that it can be
1734 called from libfu.a by xargmatch.
1735 * src/chgrp.c (usage): Likewise
1736 * src/chmod.c (usage): Likewise
1737 * src/chown.c (usage): Likewise
1738 * src/cp.c (usage): Likewise
1739 * src/dd.c (usage): Likewise
1740 * src/df.c (usage): Likewise
1741 * src/dircolors.c (usage): Likewise
1742 * src/du.c (usage): Likewise
1743 * src/install.c (usage): Likewise
1744 * src/ln.c (usage): Likewise
1745 * src/ls.c (usage): Likewise
1746 * src/mkdir.c (usage): Likewise
1747 * src/mkfifo.c (usage): Likewise
1748 * src/mknod.c (usage): Likewise
1749 * src/mv.c (usage): Likewise
1750 * src/mvdir.c (usage): Likewise
1751 * src/rm.c (usage): Likewise
1752 * src/rmdir.c (usage): Likewise
1753 * src/sync.c (usage): Likewise
1755 1999-01-12 Akim Demaille <demaille@inf.enst.fr>
1757 * lib/backupfile.c (get_version): added the parameters KIND.
1758 (xget_version): like get_version, but if argument is NULL, honor
1759 the envvar VERSION_CONTROL.
1760 * src/cp.c: Remove declarations of base_name and get_version.
1761 (main): Use xget_version.
1762 * src/mv.c (main): Likewise.
1763 * src/ln.c (main): Likewise.
1764 * src/install.c (main): Likewise.
1766 1999-01-12 Jim Meyering <meyering@ascend.com>
1768 * configure.in (ALL_LINGUAS): Add Greek (el).
1769 * po/el.po: New file.
1771 * install-sh: New version from autoconf.
1772 * missing: New version from automake.
1773 * src/ansi2knr.c: Likewise.
1774 * lib/getopt.c: New version from glibc.
1775 * lib/getopt.h: Likewise.
1776 * lib/getopt1.c: Likewise.
1777 * lib/regex.c: Likewise.
1778 * lib/regex.h: Likewise.
1779 * lib/ylwrap: Remove unused file.
1781 1999-01-10 Jim Meyering <meyering@ascend.com>
1783 * Version 4.0c (aka 4.1-b3).
1785 * Upgrade to autoconf-2.13 and automake-1.3b.
1787 * src/copy.c (copy_internal): Handle two more values of errno from
1788 failed rename of a directory into a subdirectory of itself.
1789 Thanks to Volker Borchert for testing many types and combinations
1792 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
1793 to escape_quoting_style.
1794 (argmatch_invalid): Now that the quoted quantity is no longer double
1795 quoted, remove the code that removed leading and trailing double quotes.
1797 * src/ls.c (decode_switches): Now that escape_quoting_style no longer
1798 escapes the SPACE character, arrange for SPACEs to be quoted here.
1799 * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
1800 it no longer escapes ` '.
1801 Suggestion from Paul Eggert.
1803 1999-01-05 Jim Meyering <meyering@ascend.com>
1805 * configure.in (space): Add `for' in message of statvfs check.
1806 From Ulrich Drepper.
1808 1999-01-04 Jim Meyering <meyering@ascend.com>
1812 1999-01-02 Jim Meyering <meyering@ascend.com>
1814 * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
1815 offending quoted argument before using it in explanatory diagnostic.
1816 Use a single fprintf stmt.
1818 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
1819 modify a parameter. Add a `Die_stmt' parameter.
1821 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
1822 (argmatch_to_argument): Add `const' attribute to first parameter.
1824 * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
1825 done in m4/jm-macros.m4).
1827 * lib/backupfile.c (get_version): Adapt to use new interface to
1829 * src/cp.c: Likewise.
1830 * src/ls.c: Likewise.
1831 * src/touch.c: Likewise.
1833 1999-01-01 Jim Meyering <meyering@ascend.com>
1835 * lib/makepath.c (make_dir): New function, factored out of make_path.
1836 (make_path): Use make_dir rather than open-coding it twice.
1837 This effectively reverses the order of the latter pair of stat/mkdir
1838 calls and fixes a race condition bug whereby one of two concurrent
1839 `mkdir -p' processes could fail with EEXIST.
1840 Include locale.h and libintl.h, and define `_()'.
1841 Mark translatable strings.
1843 * lib/xmalloc.c: Add comments.
1844 (xcalloc, xmalloc, xrealloc): Remove prototypes.
1845 (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
1846 * lib/xalloc.h: Add comments.
1847 (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
1848 (xcalloc, xmalloc, xrealloc): Add prototypes here.
1849 Based on changes from Akim Demaille.
1851 * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
1852 (quotearg_n): Change type of 1st parameter from int to unsigned int.
1853 (quotearg_n_options): Likewise.
1854 * lib/quotearg.h (quoting_style_vals): New public array.
1856 (quotearg_n_options): Declare `options' parameter to be `const'.
1858 * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
1860 * lib/backupfile.c (get_version): Use XARGMATCH in place of
1863 1998-12-31 Jim Meyering <meyering@ascend.com>
1865 * src/ls.c (indicator_style_types): New variable.
1866 (format_types): Rename from `formats'.
1867 (color_args): Remove unnecessary `no' string.
1868 (color_types): Remove corresponding `color_never' entry.
1869 (main): Use ARGMATCH_TO_ARGUMENT.
1870 (decode_switches): Use ARGMATCH instead of argmatch code
1871 in each of several cases.
1874 * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
1875 * src/touch.c (main): Likewise.
1876 * lib/backupfile.c (get_version): Likewise.
1879 * lib/strncasecmp.c: New file.
1880 * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
1881 * lib/argmatch.c (strncasecmp): Move to a separate file.
1882 Add curly braces around some one-stmt-but-multiline blocks.
1884 * lib/argmatch.c: Improvements from Akim Demaille.
1885 * lib/argmatch.h: Likewise.
1887 * lib/addext.c (addext): Protoize.
1888 Indent cpp directives to match nesting.
1890 Fix warnings from gcc -W -Wall
1891 * lib/posixtm.c (posix_time_parse): Change type of index `i' from
1892 int to unsigned int.
1893 * lib/getdate.y (__attribute__): Define.
1894 (ATTRIBUTE_UNUSED): Define.
1895 (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
1896 (MonthDayTable): Add initializers for last entry.
1897 (UnitsTable): Likewise.
1898 (OtherTable): Likewise.
1899 (MilitaryTable): Likewise.
1901 1998-12-22 Jim Meyering <meyering@ascend.com>
1905 * configure.in (ALL_LINGUAS): Add chinese (zh).
1907 1998-12-19 Jim Meyering <meyering@ascend.com>
1909 * tests/ln/misc: Use absolute path for final rm.
1911 * Makefile.maint (my-distcheck): Run make with
1912 CFLAGS='-Wformat -Werror'.
1914 1998-12-18 Jim Meyering <meyering@ascend.com>
1916 * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
1917 from format string. From Michiel Bacchiani.
1919 * src/chgrp.c (MAXGID): Define.
1920 Use gid_t (not int) as the type for `group' variables.
1921 (parse_group): Use MAXGID, not INT_MAX.
1923 * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
1924 * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
1926 1998-12-13 Jim Meyering <meyering@ascend.com>
1928 * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
1930 1998-12-12 Jim Meyering <meyering@ascend.com>
1932 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
1933 * src/ls.c: Group DIRED's code together.
1934 (full_time, inhibit_group, col_ext_type): Declare static.
1935 (dired_dump_obstack): Apply sizeof to variable, instead of its type.
1936 (parse_ls_color): Rename ext2 as e2. Move into the block where it
1939 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
1940 * src/ls.c: In order to distinguish col(umn|or):
1941 (init_column_info): Renamed from init_col_info.
1942 (struct column_info): Renamed from struct col_info.
1943 (struct color_ext_type): Renamed from struct col_ext_type.
1945 1998-12-11 Jim Meyering <meyering@ascend.com>
1947 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
1949 * lib/stat.c: Remove file.
1950 * lib/lstat.c: Remove file.
1951 * lib/xstat.in (xstat@): New file.
1953 * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
1955 * tests/ls-2/tests: Add a test for this.
1957 * man/help2man: import version 1.006.
1959 1998-12-07 Jim Meyering <meyering@ascend.com>
1961 * src/copy.c: Use dir_name, not dirname. Include dirname.h.
1962 * src/cp.c: Likewise.
1963 * src/df.c: Likewise.
1964 * src/install.c: Likewise.
1965 * src/ln.c: Likewise.
1966 * src/mvdir.c: Likewise.
1968 * lib/dirname.c (dir_name): Rename from dirname.
1969 Make argument `const'. Include "dirname.h"
1970 * lib/dirname.h: New file.
1971 * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
1973 1998-12-06 Jim Meyering <meyering@ascend.com>
1975 * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
1976 `^[yY]' and `^[nN]' (avoiding regex). From Karl Heuer.
1978 * lib/*.c: Ansideclify.
1980 Fix `ls -R .' formatting bug that broke mktexlsr.
1981 * src/ls.c: Include path-concat.h.
1982 (basename_is_dot_or_dotdot): New function, derived from
1983 is_not_dot_or_dotdot.
1984 (is_not_dot_or_dotdot): Remove function.
1985 (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
1986 instead of is_not_dot_or_dotdot and use path_concat instead of attach.
1988 * tests/ls-2/tests: New file (renamed from quoting),
1989 with new test for the `ls -R .' fix.
1990 * tests/ls-2/quoting: Remove file.
1991 * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
1993 1998-11-29 Jim Meyering <meyering@ascend.com>
1995 * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
1996 * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
1998 * src/dd.c (dd_copy): Rename function from `copy'.
2000 * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
2002 Per Kristian Hove reported that a certain move-directory-into-self
2003 wasn't properly diagnosed.
2005 * tests/mv/into-self-3: New file.
2006 * tests/mv/Makefile.am (TESTS): Add into-self-3.
2007 * src/copy.c (copy_internal): Remove earlier (but less effective)
2008 test for move/copy-into-self.
2009 Instead, deduce the move-into-self condition from errno==EINVAL
2010 after a failed rename.
2011 * src/mv.c (do_move): Don't arrange to remove DEST in the
2012 copied-into-self case.
2014 1998-11-15 Jim Meyering <meyering@ascend.com>
2016 Bob McCracken reported that mv couldn't handle certain combinations
2017 of hard linked source files.
2019 * tests/mv/hard-link-1: New file.
2020 * tests/mv/Makefile.am (TESTS): Add hard-link-1.
2021 * src/mv.c (movefile): Don't free new_dest.
2023 * lib/error.c (error): Don't use strerror_r's return value.
2024 From Johan Danielsson.
2026 1998-11-14 Jim Meyering <meyering@ascend.com>
2030 * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
2031 to avoid matching a prefix of another tag.
2033 1998-11-10 Jim Meyering <meyering@ascend.com>
2035 * configure.in (ALL_LINGUAS): Add Greek (el).
2036 * po/el.po: New file.
2038 1998-11-07 Jim Meyering <meyering@ascend.com>
2042 Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
2043 work on Hurd systems because of an inline definition of lstat in a
2044 system header file). This also makes it so that you may run `ls '' '
2045 on systems that let l?stat operate on the empty string.
2047 * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
2048 and declare the latter.
2049 * lib/stat.c [stat]: Remove #undef.
2050 (rpl_stat): Protoize.
2051 * lib/lstat.c [lstat]: Remove #undef.
2052 (rpl_lstat): Protoize. Use ENOENT, not EINVAL, to be consistent
2054 * acconfig.h: Remove #undef's for lstat and stat.
2056 1998-10-31 Jim Meyering <meyering@ascend.com>
2058 * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
2060 * tests/rm/empty-name: New file.
2062 * acconfig.h (stat): New #undef.
2063 This omission was uncovered when Mark Kettenis reported that
2064 `rm -r ''' got a failed assertion on the Hurd. This change
2065 doesn't fix *that* problem -- see above.
2067 1998-10-25 Jim Meyering <meyering@ascend.com>
2071 * README: Man pages will now be supported to the extent that
2072 people send patches.
2074 * tests/rm/unreadable: Two new tests.
2075 * tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
2076 it out since we're so close to release and since the test compares the
2077 text of diagnostics that are likely to vary between systems.
2078 (TEST_ENVIRONMENT): Add required framework.
2080 * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
2081 pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
2082 Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
2083 (remove_dir): Return `status', rather than always RM_OK.
2085 1998-10-18 Jim Meyering <meyering@ascend.com>
2089 * lib/mktime.c: Update from libc with this additional change from Paul.
2090 * lib/strftime.c: Likewise.
2092 1998-10-17 Paul Eggert <eggert@twinsun.com>
2094 Don't invoke localtime_r or gmtime_r unless it's the GNU C
2095 library's localtime_r and gmtime_r; there are too many buggy
2096 implementations of localtime_r and gmtime_r out there, and
2097 it's not worth keeping track of all the different bugs.
2099 * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
2100 (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
2101 Base it on localtime unless _LIBC.
2103 * strftime.c (__EXTENSIONS__): Remove.
2104 (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
2105 (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
2106 Base them on localtime/gmtime if not _LIBC.
2108 1998-10-17 Jim Meyering <meyering@ascend.com>
2112 * lib/mktime.c: Declare localtime_r if necessary.
2113 * lib/strftime.c: Likewise.
2115 * tests/Fetish.pm (run_tests): Run $prog with --version only
2118 1998-10-11 Jim Meyering <meyering@ascend.com>
2122 1998-10-08 Paul Eggert <eggert@twinsun.com>
2124 * mktime.c (__mktime_internal): When the requested time falls
2125 in a spring-forward gap of size DT, return a time that is DT
2126 away from the requested time, preferring a time whose tm_isdst
2127 differs from the requested value. Bump the max number of
2128 probes from 4 to 6 to account for the extra probes needed to
2129 discover a spring-forward gap in the worst case.
2131 1998-10-08 Paul Eggert <eggert@twinsun.com>
2133 * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
2134 Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
2135 a body that merely expands localtime_r; this works around a
2136 bug in Digital Unix 4.0A and 4.0D.
2138 1998-10-05 Jim Meyering <meyering@ascend.com>
2140 * po/Makefile.in.in (uninstall): Remove (historical?) command that
2141 removed po-Makefile.in.in. From Akim Demaille.
2143 * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
2146 1998-10-04 Jim Meyering <meyering@ascend.com>
2148 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
2151 1998-10-03 Jim Meyering <meyering@ascend.com>
2155 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
2157 * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
2158 Instead, depend on corresponding source file and on configure.in.
2159 Based on suggestion and code from Akim Demaille.
2160 Factor out irregular men into Makefile.summ.
2162 * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
2164 * man/Makefile.summ: New file.
2165 * man/Makefile.maint: Include it.
2167 * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
2169 * tests/mv/Makefile.am (TESTS): Add i-1.
2170 * tests/mv/i-1: New test.
2172 1998-10-02 Jim Meyering <meyering@ascend.com>
2174 * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
2175 * tests/ls-2/run-test: Remove file.
2176 * tests/ls-2/quoting: Include /bin/sh driver framework.
2178 * tests/dircolors/simple: Remove file.
2179 * tests/dircolors/run-test: Embed it here instead.
2180 * tests/dircolors/simple: Rename from run-test.
2182 1998-10-01 Jim Meyering <meyering@ascend.com>
2184 * tests/Makefile.am (EXTRA_DIST): Remove README.
2187 1998-09-28 Jim Meyering <meyering@ascend.com>
2191 * Use automake-1.3b. See notes in README.
2193 * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
2194 Otherwise, `touch a b; echo n|mv -i a b' would remove b.
2197 1998-09-27 Jim Meyering <meyering@ascend.com>
2201 * Makefile.maint (alpha): New target.
2202 (my-distcheck): Tweak.
2204 * lib/backupfile.h: Protect against multiple inclusion.
2207 * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
2208 Now, it is invoked through jm_MACROS.
2210 * lib/strftime.c (my_strftime): Update from FSF.
2212 1998-09-26 Jim Meyering <meyering@ascend.com>
2214 * src/copy.c (copy_internal): Don't preserve hard-linked directories
2215 to avoid damaging the destination filesystem when copying from a
2216 Netapp snapshot directory. With code from Kjetil Torgrim Hollstein
2219 1998-09-24 Jim Meyering <meyering@ascend.com>
2221 * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
2224 1998-09-21 Jim Meyering <meyering@ascend.com>
2226 * man/Makefile.maint ($(man_MANS)): Remove `echo'.
2228 1998-09-20 Jim Meyering <meyering@ascend.com>
2232 * src/install.c (install_file_to_path) [-D]: Create any leading
2233 directories with permissions of 0755.
2235 1998-09-19 Jim Meyering <meyering@ascend.com>
2237 * src/install.c (install_file_to_path): Copy the file after creating
2238 any leading directories.
2239 (main) [case 'v']: Set `x.verbose' to 1, not 0.
2240 Reported by Marty Leisner.
2242 * man/Makefile.am (transform): Define.
2243 (man_MANS): Include ginstall.1, not install.1, to match the name
2244 of the executable in ../src.
2245 * man/ginstall.x: New file.
2246 * man/install.x: Remove file.
2247 * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
2249 * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
2250 Reported by Akim Demaille.
2252 * lib/modechange.c: Fix post-protoization typo.
2254 * lib/posixtm.h (PARAMS): Define and use.
2257 1998-09-12 Jim Meyering <meyering@ascend.com>
2261 * src/remove.c (remove_cwd_entries): Declare to be static.
2263 Automatically generate man pages from combination of --help
2264 output and the contents of new, man/*.x files.
2265 * man/Makefile.am (HELP2MAN): Define.
2267 (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
2268 (MAINTAINERCLEANFILES): Add $(man_MANS).
2269 * man/*.x: New files.
2270 * man/GNUmakefile: New file.
2271 * man/Makefile.maint: New file.
2272 * man/help2man: New file.
2274 1998-09-09 Jim Meyering <meyering@ascend.com>
2276 * lib/modechange.c: Protoize.
2278 1998-09-07 Jim Meyering <meyering@ascend.com>
2282 * src/df.c (show_dev) [!posix_format]: When using --print-type,
2283 let the device path and the file system type share a single (wider)
2284 field if their combined lengths allow it. From Andries Brouwer.
2286 * tests/touch/empty-file: Upon failure, suggest how to rerun the test
2287 with longer delay, in case NFS clock skew was the cause of the failure.
2288 Reported by Kaveh Ghazi.
2290 * tests/ls-2/quoting: Add tests.
2291 * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
2292 (_create_file): Don't include $$ in temp file name.
2293 (run_tests): Use shorter suffixes for temp file names.
2295 1998-09-06 Jim Meyering <meyering@ascend.com>
2297 * src/touch.c: Include posixtm.h.
2298 (usage): Correct the description of the format of the
2299 date string argument to -t option.
2300 (main): Update to use rewritten posixtime function.
2301 Reported by Andries Brouwer.
2303 * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
2304 (noinst_HEADERS): Add posixtm.h.
2306 * lib/posixtm.h: New file.
2307 * lib/posixtm.c: New file. Rewritten based on posixtm.y.
2308 * lib/posixtm.y: Remove file.
2310 1998-09-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2312 * src/ls.c (print_dir_name): Put back.
2313 (print_dir): Also print directory name header if print_dir_name is
2316 1998-08-29 Jim Meyering <meyering@ascend.com>
2320 * src/du.c (long_options): Use corresponding short-option character
2321 in place of `1', and `NULL' in place of pointer in initialization.
2322 * src/cp.c (long_opts): Likewise.
2323 * src/ln.c (long_options): Likewise.
2324 * src/mkdir.c (longopts): Likewise.
2325 * src/rmdir.c (longopts): Likewise.
2326 * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
2328 * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
2329 * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
2331 * tests/Fetish.pm: New file -- moved from ls-2/.
2332 * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
2333 * tests/Makefile.am (SUBDIRS): Add dircolors.
2334 (EXTRA_DIST): Add Fetish.pm.
2335 * tests/dircolors: New directory
2337 * src/ls.c (print_dir_name): Remove global variable.
2338 (print_dir): When trace_dirs is set, always print the directory
2341 1998-08-26 Jim Meyering <meyering@ascend.com>
2343 * src/dircolors.c (dc_parse_stream): Don't segfault when a line
2344 contains only one token. Reported by Olav Morkrid.
2346 1998-08-24 Paul Eggert <eggert@twinsun.com>
2348 * src/system.h (CHAR_MIN, CHAR_MAX):
2349 Renamed from SCHAR_MIN, SCHAR_MAX, since these
2350 macros apply to char, not signed char.
2352 * src/df.c, src/du.c, src/touch.c (long_options, main):
2355 1998-08-18 Paul Eggert <eggert@twinsun.com>
2357 Port nanosecond-resolution times to UnixWare 2.1.2 and
2358 pedantic Solaris 2.6.
2360 * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
2361 * acconfig.h (ST_MTIM_NSEC): New #undef.
2362 * src/system.h: (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
2363 Use new ST_MTIM_NSEC macro.
2365 1998-08-16 Jim Meyering <meyering@ascend.com>
2367 * lib/filemode.h (PARAMS): Define and use.
2370 1998-08-15 Jim Meyering <meyering@ascend.com>
2374 * Makefile.maint (announcement): New target.
2376 * tests/mv/into-self: Update to reflect changed behavior of mv.
2377 * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
2378 With prodding from François Pinard :-)
2380 * tests/ls-2/Fetish.pm: New file
2381 * tests/ls-2/run-test: New file
2383 * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
2384 directories (but none of their entries). This makes `cp --archive
2385 --one-file-system' use the same policy `tar --one-file-system' does.
2388 * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
2390 1998-08-14 Jim Meyering <meyering@ascend.com>
2392 * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
2393 Reported by Christian von Roques.
2395 * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
2396 * tests/Makefile.am (SUBDIRS): Add ls-2.
2397 * tests/ls-2: New directory
2399 1998-08-14 Christian von Roques <roques@pond.sub.org>
2401 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
2402 infloop on getmnt(2) returning 0.
2404 * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
2405 not initializing output redirection of : command.
2406 * tests/mv/backup-is-src: Likewise.
2407 * tests/rm/i-1: Likewise.
2409 1998-08-12 Jim Meyering <meyering@ascend.com>
2411 * po/Makefile.in.in: Provide automake-style DESTDIR support.
2412 From Johan Danielsson.
2413 (DISTFILES): Remove ChangeLog.
2414 po/ChangeLog: Remove empty file.
2416 * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
2418 * src/ls.c: Include filemode.h.
2419 * src/chmod.c: Likewise.
2421 * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
2422 From Johan Danielsson.
2423 Protoize. Tsort function definitions and remove prototypes of
2425 (mode_string): Remove prototype.
2426 * lib/filemode.h (mode_string): New file.
2427 * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
2429 1998-08-09 Jim Meyering <meyering@ascend.com>
2433 1998-07-31 Paul Eggert <eggert@twinsun.com>
2435 Add support for filesystems whose timestamps have better resolution
2436 than 1 second (e.g. Solaris 2.6, recent Linux kernels).
2438 * configure.in (AC_STRUCT_ST_MTIM): Add.
2440 * src/copy.c (copy_internal): Compare time stamps with
2441 subsecond resolution if available.
2443 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
2444 rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
2445 stamps with subsecond resolution if available.
2447 * src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
2448 CTIME_CMP, MTIME_CMP): New macros.
2450 1998-08-01 Jim Meyering <meyering@ascend.com>
2452 * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
2454 1998-07-28 Paul Eggert <eggert@twinsun.com>
2456 * lib/mountlist.c (read_filesystem_list): Remove all_fs
2457 argument, but put the necessary information into the result so
2458 that the caller can ignore filesystems that he's not
2461 * lib/mountlist.h (struct mount_entry):
2462 New members me_dummy, me_remote.
2463 (read_filesystem_list): Remove all_fs argument.
2464 (REMOTE_FS_TYPE): Remove.
2465 (ME_DUMMY, ME_REMOTE): New macros.
2467 * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
2469 * src/df.c (show_all_fs):
2470 Revert to boolean value; the old negative value is
2471 now in show_local_fs.
2472 (show_local_fs): New variable.
2473 (show_dev): New args me_dummy and me_class. Use show_local_fs
2474 and boolean show_all_fs in combination with these new args
2475 to decide whether to show a device.
2476 (show_disk): Pass flags to show_dev.
2477 (show_point): Use a non-dummy mount entry if possible.
2478 (show_all_entries): Pass flags to show_dev.
2479 (main): --local sets show_local_fs now. Ask for file system types if
2480 show_local_fs is nonzero, since ME_REMOTE might need them.
2482 1998-07-27 Jim Meyering <meyering@ascend.com>
2484 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
2486 * tests/install/basic-1: Add a test for this.
2487 * src/install.c: Make copy create each destination file initially
2488 with mode 0600 so strip will work, then apply specified mode.
2489 Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
2491 1998-07-25 Jim Meyering <meyering@ascend.com>
2493 * src/mv.c (chown): Remove unused definition.
2494 Reported by Kaveh Ghazi.
2496 * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
2497 Handle that, so --ignore-fail-on-non-empty works.
2498 (EEXIST): Define to zero if not defined.
2499 (ENOTEMPTY): Likewise.
2501 * tests/cp/same-file: Remove `diff' I'd put in for debugging.
2502 Exit with the status from cmp.
2506 * tests/cp/same-file: Skip three more unportable tests.
2507 These failed on SunOS4.1.4.
2509 * src/copy.c (SAME_INODE): Remove definition.
2510 * src/sys2.h (SAME_INODE): Define it here instead.
2512 * src/remove.c (same_file): New function.
2513 (remove_dir): Use it to give a better diagnostic when rmdir fails
2514 because it can't remove the current directory.
2516 * src/df.c (long_options): Changes table entries not to use this form:
2517 {"all", no_argument, &show_all_fs, 1},
2518 but rather this form:
2519 {"all", no_argument, NULL, 'a'},
2520 Using the latter, all the option handling in one place: the getopt loop.
2522 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
2524 (fsp_to_string): Don't xmalloc return value (yet).
2525 (xatoi): Ansideclify.
2526 (fstype_to_string): Ansideclify.
2527 * lib/mountlist.h: Define and use PARAMS macro.
2529 * lib/utime.c: New file.
2530 * src/touch.c (utime_now): Moved into m4/utimes.m4.
2531 (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
2534 * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
2536 1998-07-22 Paul Eggert <eggert@twinsun.com>
2538 * lib/human.c (human_readable): amt -> damt, to fix typo when
2539 computing which power to use after overflow occurs during
2542 * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
2545 1998-07-21 Paul Eggert <eggert@twinsun.com>
2547 Add df -l or --local option.
2548 * doc/fileutils.texi: Document it.
2549 * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
2550 * lib/mountlist.c (read_filesystem_list):
2551 If all_fs is negative, omit non-local filesytems.
2553 * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
2554 (show_all_fs): If negative, omit non-local filesystems.
2555 All uses of (all_fs != 0) changed to (all_fs > 0).
2556 (long_options, usage, main): Add -l or --local option.
2557 (main): When asking for df of an explicit file name, get all
2558 the mount points, so that we're more likely to find it when
2561 1998-07-18 Jim Meyering <meyering@ascend.com>
2563 * src/copy.c (copy_internal): Add another exclusion from the
2564 sameness test: when --force has been specified, the destination
2565 is unlinked before any copy.
2566 (copy_internal): Add yet another: when both src and dest are symlinks.
2568 * tests/touch: New subdir.
2569 * tests/Makefile.am (SUBDIRS): Add touch.
2570 * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
2572 * tests/mv/into-self-2: New test.
2573 * tests/mv/Makefile.am (TESTS): Add into-self-2.
2575 1998-07-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2577 * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
2580 1998-07-16 Jim Meyering <meyering@ascend.com>
2582 Work around failure of chown calls on m68k-motorola-sysv systems.
2583 * src/chown.c: Include lchown.h.
2584 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
2585 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
2586 * lib/lchown.c: Include lchown.h.
2587 Reported by and with suggestions from Manfred Hollstein.
2589 1998-07-12 Paul Eggert <eggert@twinsun.com>
2591 * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
2593 1998-07-07 Jim Meyering <meyering@ascend.com>
2595 * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
2596 Suggestion from Ulrich Drepper.
2598 1998-07-04 Jim Meyering <meyering@ascend.com>
2600 * lib/safe-read.c (safe_read): Change type of pointer parameter to
2601 `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi.
2602 * lib/safe-read.h: Update prototype.
2604 * src/dircolors.c (parse_line): Add casts to avoid errors from
2605 Irix4's `cc' C compiler. From Kaveh Ghazi.
2607 * lib/xstrtol.c: Include stdio.h. Required on some systems when
2608 using assert. From Kaveh Ghazi.
2610 * tests/mv/backup-is-src: Use cmp, not diff.
2611 Reported by Kaveh Ghazi.
2613 1998-07-03 Jim Meyering <meyering@ascend.com>
2617 * src/remove.c (remove_dir): Use fprintf (not error) to avoid
2620 1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
2622 * lib/mountlist.c: (read_filesystem_list):
2623 Don't leak memory on failure.
2624 Don't create a dummy struct mount_entry entry;
2625 use the address-of-the-tail-address method instead.
2626 Preserve errno if possible on failure, setting it to 0 if inapplicable.
2627 Close file descriptor leak if the F_SETLKW failed.
2628 Report an error if SVR4 lock file cannot be opened for some reason
2629 other than a nonexistent lock file.
2631 1998-07-03 Jim Meyering <meyering@ascend.com>
2633 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
2634 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
2635 * acconfig.h (WITH_REGEX): Remove undef.
2636 * lib/Makefile.am (noinst_HEADERS): Add regex.h.
2637 * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
2638 * lib/rx.c: Remove file.
2639 * lib/rx.h: Remove file.
2641 * src/df.c (df_readable): Rename local so as not to shadow global.
2643 * src/copy.c (SAME_INODE): New macro.
2644 Use it to replace open-coded equivalents.
2645 (copy_internal): Rename variable and reverse sense of tests
2646 to make the code a little clearer.
2648 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2650 * src/copy.c (copy_internal): Try harder identifying a relative
2651 symbolic link in the current directory.
2653 * src/copy.c (copy_internal): Don't skip test for same file if
2654 creating a hardlink from symlink over a non-symlink while making
2656 * tests/cp/same-file: Skip tests that depend on link(2) not
2659 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2661 * src/copy.c (copy_internal): Don't call chown on a symlink.
2663 1998-07-01 Jim Meyering <meyering@ascend.com>
2665 * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
2666 configure's --disable-assert option.
2668 1998-06-29 Paul Eggert <eggert@twinsun.com>
2670 * lib/mountlist.c (read_filesystem_list):
2671 Plug file descriptor leak on failure.
2672 Report failure if lock file can't be opened for some reason
2673 other than nonexistence.
2675 1998-06-29 Jim Meyering <meyering@ascend.com>
2679 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
2680 Always close stream and file descriptor before returning.
2682 * src/df.c (main): Move the test of the result of the
2683 read_filesystem_list call up out of if-block -- code in the
2684 else-block depends on it too.
2686 1998-06-29 Paul Eggert <eggert@twinsun.com>
2688 * lib/mountlist.c: (read_filesystem_list): If SVR4, lock
2689 /etc/.mnttab.lock if available, to avoid race conditions
2690 (e.g. with the automounter on Solaris 2.6).
2692 Include <errno.h>, <fcntl.h>, <unistd.h>.
2694 1998-06-29 Jim Meyering <meyering@ascend.com>
2696 * lib/mountlist.c (fstype_to_string): Guard with
2697 #if ! HAVE_F_FSTYPENAME_IN_STATFS.
2699 1998-06-28 Paul Eggert <eggert@twinsun.com>
2701 Add support for new --block-size option and
2702 BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
2703 Adjust df output slightly to accommodate larger filesystems.
2705 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
2706 into one, for convenience. All callers changed.
2707 (human_block_size): New function.
2708 * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
2709 Include <stdlib.h> if HAVE_STDLIB_H;
2710 declare getenv unless HAVE_DECL_GETENV.
2712 Include <argmatch.h>, <error.h>, <xstrtoul.h>.
2713 (DEFAULT_BLOCK_SIZE): New macro.
2714 (block_size_args, block_size_types): New constants.
2715 (humblock): New function.
2716 * lib/xstrtol.h (__ZLONG_MAX): Remove.
2717 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
2718 unsigned long to double without losing information.
2719 (bkm_scale_by_power): New function.
2721 * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
2722 Add support for SI-like suffixes like "GB" and "TD".
2723 * src/dd.c (usage): Describe it.
2725 * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
2726 Remove; replace with new variable output_block_size. All uses changed.
2727 (long_options, usage, main): Add --block-size.
2728 (main, decode_switches): Use new human_block_size function to
2729 initialize output block size consistently with other programs.
2731 * src/df.c (print_header, show_dev): Shrink some columns and expand
2732 others, to squeeze in support for today's larger filesystems.
2733 (print_header): Print output block size using power-of-1024 SI format.
2734 (df_readable): Coalesce last two args into one, for convenience.
2735 All callers changed.
2736 (main): Remove check for portable output format and larger
2737 or human-readable block sizes.
2739 * NEWS, doc/fileutils.texi: Describe above changes.
2741 1998-06-28 Jim Meyering <meyering@ascend.com>
2743 * src/ls.c (usage): Make --kilobytes description consistent with
2744 that in du and df. From Göran Uddeborg.
2746 * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
2747 now that we're using the jm_FSTYPENAME autoconf macro.
2748 James Tanis reported the old version didn't compile on BSDI3.
2750 * configure.in: Move big block of list_mounted_fs checks into
2751 new jm_LIST_MOUNTED_FILESYSTEMS macro.
2752 Use new jm_FSTYPENAME macro.
2754 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
2755 * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
2758 1998-06-27 Jim Meyering <meyering@ascend.com>
2760 * src/copy.c (copy_reg): Detect identical source and dest here.
2761 (copy_internal): Make the test symmetric.
2763 * tests/cp/same-file: New file.
2764 * tests/cp/Makefile.am (TESTS): Add it.
2766 1998-06-26 Jim Meyering <meyering@ascend.com>
2768 * src/remove.c (remove_file): Remove `non-directory' part of
2769 `removing non-directory FILE' verbose message.
2771 1998-06-23 Jim Meyering <meyering@ascend.com>
2773 * src/df.c (show_dev): Increase field width for blocks, used,
2774 and available columns from 7 to 8.
2776 1998-06-21 Jim Meyering <meyering@ascend.com>
2778 * aclocal.m4: Regenerate with fixed gettext.m4 installed.
2779 See README-alpha for details.
2781 1998-06-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2783 * src/automake-wrap: Quote `&' in sed replacement text.
2785 1998-05-31 Jim Meyering <meyering@ascend.com>
2789 * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
2790 Reported by Don Parsons.
2792 1998-05-30 Jim Meyering <meyering@ascend.com>
2794 * tests/ls/time-1: Clean up ctime test. Note that it fails also
2795 on Solaris5.5.1 tmpfs file systems.
2797 Solve the `rm -f rm' problem more cleanly.
2798 * src/.rm-warning: Remove file.
2799 * src/automake-wrap: New file.
2800 * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
2801 (Makefile.in): Depend on automake-wrap.
2802 (EXTRA_DIST): Add automake-wrap.
2803 (DISTCLEANFILES): Remove definition.
2804 (rm_DEPENDENCIES): Likewise.
2805 (.rm-warn-stamp): Remove rule.
2807 1998-05-27 Jim Meyering <meyering@ascend.com>
2809 * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
2810 * tests/ls/rt-1: New file, renamed from cr-1.
2812 1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2814 * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
2816 * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
2819 1998-05-25 Jim Meyering <meyering@ascend.com>
2821 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
2822 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
2823 [!_GNU_SOURCE]: Add #undef instead.
2825 1998-05-24 Jim Meyering <meyering@ascend.com>
2829 * src/ansi2knr.c: Use new version from automake-1.3.
2831 * src/chown.c: Accept new option, --dereference.
2832 --no-dereference is now the default.
2833 (enum Change_status) [CH_NOT_APPLIED]: New member.
2834 (change_symlinks): Enable this by default, now.
2835 (describe_change): Handle new case.
2836 (change_file_owner): Add new parameter: cmdline_arg. Update callers.
2837 Reorganize to reflect changed semantics.
2838 (LCHOWN): Remove definitions.
2840 * lib/lchown.c: New file.
2842 1998-05-21 Jim Meyering <meyering@ascend.com>
2844 * configure.in (ALL_LINGUAS): Add russian (ru).
2846 1998-05-16 Jim Meyering <meyering@ascend.com>
2848 * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
2849 (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
2851 * lib/hash.c (is_prime): Ansideclify.
2852 (next_prime): Ansideclify. Add an assertion.
2854 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
2855 lines from the m4/*.m4 macros, so the hack of including some
2856 custom-replaced C source file names here is no longer needed.
2858 * configure.in (jm_MACROS): New wrapper macro.
2859 Remove uses of most jm_* macros.
2861 * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
2862 as part of utimbuf.m4.
2863 (memcmp): Add #undef.
2865 1998-05-12 Jim Meyering <meyering@ascend.com>
2867 * configure.in: Use my replacement AC_ISC_POSIX rather than
2870 * src/copy.c (copy_internal): Plug a small leak.
2872 1998-05-10 Jim Meyering <meyering@ascend.com>
2874 * src/mv.c (do_move): Remove lots of code that was duplicated in
2875 copy.c (copy), now that copy() has better support for mv. This fixes
2876 a bug with cross-filesystem `mv -i' whereby you could get two prompts
2877 for the same destination file and eventually remove the destination
2878 file even though one of the responses was negative.
2879 Reported by Dirk Lattermann.
2881 * src/copy.h: Better support for mv:
2882 [struct cp_options] (move_mode): New member.
2883 * src/copy.c (copy_internal): Use new move_mode member.
2885 (copy): Add parameter.
2887 * tests/cp/Makefile.am (TESTS): Add backup-is-src.
2888 * tests/mv/Makefile.am (TESTS): Likewise.
2890 * lib/userspec.c: Don't declare strdup if it's defined as a macro.
2891 Reported by Lorne Baker.
2893 * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
2895 * src/mv.c (cp_option_init): Initialize new members.
2896 * src/cp.c (cp_option_init): Likewise.
2897 (main): Set new preserve_* options.
2899 1998-05-09 Jim Meyering <meyering@ascend.com>
2901 * src/copy.h: Support for install:
2902 [struct cp_options] (failed_unlink_is_fatal): New member.
2903 (preserve_owner_and_group): New member.
2904 (preserve_chmod_bits): New member.
2905 (preserve_timestamps): New member.
2906 (preserve): Remove member.
2907 (set_mode): New member.
2909 * src/copy.c (new_nondir_mode): New function. Use where appropriate.
2910 Use more-specific preserve_* members in place of removed `preserve'.
2911 (copy_internal): Honor failed_unlink_is_fatal.
2913 * src/install.c (main): Rewrite argv-handling to be clearer.
2914 (copy_file): Rewrite to use copy.c (copy).
2915 (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
2916 `no_need_to_chown' parameter. Fix caller.
2917 (install_file_in_file): Remove now-unnecessary `to_created' parameter.
2918 (cp_option_init): New function.
2919 Update several functions to take new parameter specifying copy options.
2921 * tests/install: New subdir, with one basic test.
2922 * tests/Makefile.am (SUBDIRS): Add install.
2923 * configure.in (AC_OUTPUT): Add tests/install/Makefile.
2925 * src/dd.c: Include safe-read.h.
2926 Don't declare safe_read.
2927 * src/touch.c: Likewise.
2929 * configure.in (jm_TYPE_SSIZE_T): Use it.
2930 * acconfig.h (ssize_t): Add undef.
2932 1998-05-03 Jim Meyering <meyering@ascend.com>
2934 * po/: Update from gettext-0.10.35.
2936 * configure.in: Remove use of AC_LINK_FILES.
2937 (AC_OUTPUT): Remove po/Makefile-generating sed command.
2939 1998-04-28 Jim Meyering <meyering@ascend.com>
2941 * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
2942 Use unsigned char * pointers, not potentially signed ones, to avoid
2945 1998-04-26 Jim Meyering <meyering@ascend.com>
2947 * configure.in: Use jm_ASSERT.
2948 * acconfig.h: Add NDEBUG.
2950 * src/mv.c: Don't define NDEBUG.
2951 * src/cp.c: Likewise.
2953 1998-04-14 Jim Meyering <meyering@ascend.com>
2955 * src/.rm-warning: New file.
2956 * src/Makefile.am (EXTRA_DIST): Add .rm-warning
2957 (DISTCLEANFILES): Add .rm-warn-stamp.
2958 (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
2959 (.rm-warn-stamp): New rule.
2960 (rm_prep): Comment out rule.
2962 * src/df.c (main): Use STREQ in string equality tests, not strcmp.
2963 * src/dircolors.c (dc_parse_stream): Likewise.
2964 (dc_parse_file): Likewise.
2965 * src/du.c (main): Likewise.
2966 * src/ls.c (decode_switches): Likewise.
2967 * src/remove.c (hash_compare_strings): Likewise.
2968 * src/touch.c (main): Likewise.
2970 1998-04-13 Jim Meyering <meyering@ascend.com>
2972 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
2974 1998-04-11 Jim Meyering <meyering@ascend.com>
2976 * lib/hash.c: Add curly braces around statements in
2977 if/else/while/do/etc. that span more than a line -- even around
2978 multiline simple statements or single-line simple statements
2979 preceded by a comment line.
2981 1998-04-09 Jim Meyering <meyering@ascend.com>
2983 * configure.in: Don't use AC_PATH_PROG to check for perl, now that
2986 1998-04-06 Jim Meyering <meyering@ascend.com>
2988 * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
2989 hash_insert. Also declare to be static.
2990 * src/cp-hash.h (hash_insert): Remove declaration.
2992 * lib/hash.c: Lots of minor spec and name changes, and new comments.
2993 (hash_rehash): Rewrite to be easier on the allocator.
2994 From François Pinard.
2995 * lib/hash.h: More comments.
2996 * src/remove.c: Change names/usage of hash-related functions to work
2999 1998-04-05 Jim Meyering <meyering@ascend.com>
3001 * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
3002 This now depends on HAVE_BTOWC so systems that lack btowc (like
3003 solaris-2.5.1) don't lose.
3005 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
3007 * GNUmakefile: Add conditionals so that running `make' in an
3008 unconfigured source directory will get a reasonable diagnostic.
3010 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
3011 know about the m4/ subdirectory.
3012 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
3013 automake-1.2h and the above change) aclocal-related rules and includes.
3015 1998-04-01 Jim Meyering <meyering@eng.ascend.com>
3017 * tests/ls/cr-1: New file.
3018 * tests/ls/Makefile.am (TESTS): Add cr-1.
3020 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
3022 * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
3023 works with `unsigned char'.
3025 (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
3027 * lib/xstrtol.c: Merge with the version from textutils.
3029 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
3031 1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3033 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
3034 rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
3035 rev_cmp_size): Use file name as secondary sort key to get
3038 1998-03-28 Jim Meyering <meyering@eng.ascend.com>
3040 * src/copy.c: Add copyright.
3041 * src/remove.c: Add copyright.
3042 [_AIX]: Add #pragma alloca.
3044 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
3046 * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
3047 dependency and the := assignment of ACLOCAL to make the default
3048 rule use the `-I m4' option.
3050 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
3052 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
3054 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
3055 automatically handles it.
3057 1998-03-21 Jim Meyering <meyering@eng.ascend.com>
3059 * lib/quotearg.h: Update from patch-2.5.3.
3060 * lib/quotearg.c: Likewise.
3061 * src/ls.c (decode_switches): Pass a null pointer instead of address
3062 of quotearg_quoting_options.
3064 1998-03-19 Paul Eggert <eggert@twinsun.com>
3066 * lib/fsusage.h (struct fs_usage): New member
3067 fsu_bavail_top_bit_set.
3068 * lib/fsusage.c: Include <limits.h>.
3069 (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
3070 (get_fs_usage): If top bit of system variable corresponding to
3071 fsu_bavail is set, then set fsu_bavail_top_bit_set, and
3072 sign-extend the value when storing it into fsu_bavail.
3073 * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
3074 assume the original value corresponding to fsu_bavail was negative.
3075 Reported by Arne Juul.
3077 1998-03-18 Jim Meyering <meyering@eng.ascend.com>
3079 * src/Makefile.am (rm-prep): Add dependency and rule to save users
3080 with `.' too early in their PATH from the `rm: cannot unlink `rm':
3081 Text file busy' error. Suggestion from Philippe De Muyter.
3083 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
3087 * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
3088 * lib/closeout.c: Likewise.
3089 * lib/dirname.c: Likewise.
3090 * lib/euidaccess.c: Likewise.
3091 * lib/fileblocks.c: Likewise.
3092 * lib/filemode.c: Likewise.
3093 * lib/ftruncate.c: Likewise.
3094 * lib/group-member.c: Likewise.
3095 * lib/isdir.c: Likewise.
3096 * lib/long-options.c: Likewise.
3097 * lib/mountlist.c: Likewise.
3098 * lib/path-concat.c: Likewise.
3099 * lib/save-cwd.c: Likewise.
3100 * lib/savedir.c: Likewise.
3101 * lib/strcasecmp.c: Likewise.
3102 * lib/strdup.c: Likewise.
3103 * lib/userspec.c: Likewise.
3104 * lib/yesno.c:: Likewise.
3106 * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
3107 Use #if !, not #ifndef with HAVE_ macros.
3108 * src/chown.c: Likewise.
3109 * src/copy.c: Likewise.
3110 * src/dd.c: Likewise.
3111 * src/dircolors.c: Likewise.
3112 * src/install.c: Likewise.
3113 * src/ls.c: Likewise.
3114 * src/mv.c: Likewise.
3115 * src/touch.c: Likewise.
3117 * configure.in: Use jm_PREREQ.
3119 1998-03-14 Jim Meyering <meyering@eng.ascend.com>
3121 Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
3122 With automake-1.2f, that hack is no longer needed.
3124 * src/remove.c: Use `virtual memory exhausted' message, not
3125 `Memory exhausted' to be consistent with the majority of other
3127 Say `removing all...', not `removing any...'.
3128 * src/rmdir.c (remove_parents): Be consistent with documentation of
3129 --verbose option and with remove.c in saying `removing...' before
3130 the operation is attempted.
3132 Suggestions from Santiago Vila.
3134 * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
3135 (copy_internal): Likewise.
3138 * src/copy.h (copy): Update prototype.
3139 * src/cp.c (do_copy): Add unused arg in calls to copy.
3140 * src/mv.c (do_move): Add ©_into_self arg in call to copy.
3141 Don't remove source directory when copy_into_self is nonzero.
3142 Reported by Arne Henrik Juul.
3144 * tests/mv/into-self: Test for the above.
3145 * tests/mv/Makefile.am (TESTS): Add into-self.
3147 1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
3149 * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
3150 about any arbitrary user and group by pretending to be the user
3151 and to belong to the group specified in `spec_arg' argument.
3153 * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
3154 any arbitrary user name.
3155 (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
3158 1998-02-24 Jim Meyering <meyering@eng.ascend.com>
3160 * lib/xstrtol.c (TYPE_SIGNED): Define.
3161 (TYPE_MAXIMUM): Define.
3162 (ULONG_MAX): Use TYPE_MAXIMUM.
3163 (LONG_MAX): Use TYPE_MAXIMUM.
3165 * lib/fnmatch.c: Update from libit.
3166 * lib/idcache.c: Update from libit.
3168 1998-02-23 Paul Eggert <eggert@twinsun.com>
3170 * lib/quotearg.h, lib/quotearg.c: New files.
3171 * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
3172 (noinst_HEADERS): Add quotearg.h.
3174 * src/ls.c: Include new file quotearg.h.
3175 (enum indicator_style): Rename all to classify, and not_programs
3176 to file_type, to match option spellings. All users changed.
3177 (indicator_style_args): New constant.
3178 (quote_funny_chars, quote_as_string, quote_shell): Remove;
3179 (filename_quoting_options, dirname_quoting_options): Use these
3181 (long_options): Add --indicator-style, --quoting-style,
3182 --show-control-chars. Remove --quote-shell.
3183 (dired_dump_obstack): Remove style parameter and don't output style.
3184 (main): Go back to previous method of outputting //DIRED//
3185 and //SUBDIRED// lines, without style. But add a new
3186 //DIRED-OPTIONS// line that does output style.
3187 (decode_switches, usage): Add --indicator-style, --quoting-style,
3188 --show-control-chars. Remove --quote-shell.
3189 (decode_switches): Default from QUOTING_STYLE environment variable.
3190 Set new quoting vars.
3191 (quote_name): Renamed from quote_filename.
3192 Take new arg specifying quoting options.
3193 Always print; do not have a special case for null FILE * argument.
3194 All callers changed.
3195 Move the guts of this function to new file quotearg.c.
3196 (length_of_file_name_and_frills): Use quotearg_buffer instead
3197 of (old) quote_filename to find length of file name.
3199 (decode_switches, parse_ls_color, print_dir, gobble_file,
3200 get_link_name): Quote output in diagnostics.
3202 * NEWS, doc/fileutils.texi: Describe above changes.
3203 * doc/fileutils.texi: Mention that control characters are output
3204 as question marks if output is a terminal.
3206 1998-02-22 Jim Meyering <meyering@eng.ascend.com>
3210 * ChangeLog-1997: New file.
3211 * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
3213 1998-02-21 Jim Meyering <meyering@eng.ascend.com>
3215 * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
3216 * tests/Makefile.am (SUBDIRS): Add mv.
3217 * tests/mv: New directory
3218 * tests/mv/mv-special-1: New test.
3220 1998-02-20 Jim Meyering <meyering@eng.ascend.com>
3222 * src/touch.c: Include get-date.h.
3223 Remove get_date decl.
3225 * lib/getdate.h: Removed. Could cause confusion with an
3226 automake-generated `.y.h' rule.
3227 * lib/get-date.h: Renamed from getdate.h.
3228 * lib/getdate.y: s/getdate.h/get-date.h/
3229 * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
3231 1998-02-19 Jim Meyering <meyering@eng.ascend.com>
3233 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
3234 * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
3236 1998-02-13 Jim Meyering <meyering@eng.ascend.com>
3238 * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
3239 Otherwise, mv tries to open special files.
3240 Reported by Kjetil Torgrim Homme.
3242 1998-02-08 Jim Meyering <meyering@eng.ascend.com>
3244 * Makefile.maint (cvs-dist): Update po/ to clear modified status
3245 of *.po files before running cvs tag -c.
3247 * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
3250 1998-02-07 Jim Meyering <meyering@eng.ascend.com>
3252 * GNUmakefile: New file.
3253 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
3254 Don't include Makefile.maint from here. It's included from GNUmakefile.
3256 * configure.in: Don't use AM_MAINTAINER_MODE.
3257 (jm_PERL): Use this.
3259 * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen.
3260 (CLEANFILES): Remove dcgen.
3261 (dircolors.h): Use $(PERL).
3264 1998-02-01 Jim Meyering <meyering@na-net.ornl.gov>
3266 * POTFILES.in: Add remove.c. Reported by Santiago Vila.
3268 1998-01-28 Jim Meyering <meyering@na-net.ornl.gov>
3270 * src/df.c (print_header): Tweak format to align heading over
3271 last column of `df -i' output. From Andreas Schwab.
3273 1998-01-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3275 * Makefile.am: Include Makefile.maint from $(srcdir).
3277 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
3281 * Makefile.maint: New file.
3282 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
3283 into Makefile.maint.
3284 Include Makefile.maint.
3285 (EXTRA_DIST): Add Makefile.maint.
3287 * src/cp.c (re_protect): Don't fail for non-root when chown fails
3288 due not only to lack of permission (EPERM), but also to lack of
3289 support (EINVAL). Reported by Bengt Martensson.
3290 * src/copy.c (DO_CHOWN): Likewise.
3292 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
3294 * tests/ls/time-1 (test_failure): Rename does not update ctime;
3295 link does -- so use ln, not mv.
3296 Note that the SunOS4.1.4 failure of the ctime test is expected.
3298 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
3299 bug in Cray C 5.0.3.0 when T == time_t.
3301 * tests/rm/r-1: Adjust expected output for changed format of
3303 * tests/rm/r-2: Likewise.
3305 1998-01-23 Jim Meyering <meyering@na-net.ornl.gov>
3307 * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
3308 C compiler. From Kaveh Ghazi.
3309 (TYPE_MINIMUM): Define.
3310 (TYPE_MAXIMUM): Define.
3311 (TIME_T_MIN): Use TYPE_MINIMUM.
3312 (TIME_T_MAX): Use TYPE_MAXIMUM.
3314 1998-01-22 Jim Meyering <meyering@na-net.ornl.gov>
3316 * src/dd.c: Reorder functions to obviate forward dcls.
3317 (quit): Declare to be inline to stifle compile warning.
3319 * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
3321 * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a
3324 * tests/ls/time-1: Use GNU touch to work around problems with NFS
3325 caching and/or clock skew. Reported by Kaveh Ghazi.
3327 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
3329 * src/Makefile.am (noinst_HEADERS): Add remove.h.
3330 (mv_SOURCES): Define.
3331 (rm_SOURCES): Define.
3333 1998-01-21 Jim Meyering <meyering@na-net.ornl.gov>
3335 * src/install.c: Declare new global, backup_type.
3336 (main): Initialize backup_type unconditionally.
3337 (copy_file): Call find_backup_file_name with new argument, backup_type.
3338 * src/ln.c: Declare new global, backup_type.
3339 (main): Initialize backup_type unconditionally.
3340 (do_link): Call find_backup_file_name with new argument, backup_type.
3342 * src/copy.c (copy_internal): Use x->backup_type, not the global.
3343 (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
3345 * src/copy.h: (VALID_SPARSE_MODE): Define.
3346 [struct cp_options] (backup_type): New member.
3348 * src/cp.c [NDEBUG]: Comment out definition.
3349 (do_copy): Use x->backup_type, not the global.
3351 * src/remove.c: New file. Contains guts of old rm.c.
3352 (remove_init): New function.
3353 (remove_fini): New function.
3354 (rm): Take third argument, specifying options.
3355 * src/remove.h: New file. Associated dcls.
3356 * src/rm.c: Remove and minimally librarify guts for use in mv.c.
3357 (main): Pass options (`&x') to rm.
3358 Call remove_init and remove_fini instead of open-coding them.
3360 * src/mv.c (rm_option_init): New function.
3361 (cp_option_init): New function.
3362 (copy_reg): Remove now-unused function.
3363 (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
3364 Set up for and use `remove.c (rm)' in place of unlink.
3366 1998-01-20 Jim Meyering <meyering@na-net.ornl.gov>
3368 * lib/backupfile.c: Use ANSI function definitions.
3369 Remove global declaration of backup_type.
3370 (simple_backup_suffix): Default to `~', not `.orig'.
3371 Use PARAMS, not __BACKUPFILE_P.
3372 (find_backup_file_name): Add parameter, backup_type.
3373 * lib/backupfile.h: Remove extern declaration of backup_type.
3374 Use PARAMS, not __BACKUPFILE_P.
3375 (VALID_BACKUP_TYPE): Define.
3376 (find_backup_file_name): Adjust prototype.
3378 1998-01-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3380 * src/df.c (print_header): Fix inode format header to line it up
3381 with the rest of the output.
3383 1998-01-13 Jim Meyering <meyering@na-net.ornl.gov>
3385 * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent
3386 with most other implementations.
3388 1998-01-12 Jim Meyering <meyering@na-net.ornl.gov>
3390 * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
3391 Move function-spanning `#if ...BSIZE' directive to follow inclusion
3392 of sys/param.h since BSIZE is sometimes defined in sys/param.h.
3393 Reported by Philippe De Muyter.
3395 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
3399 * src/install.c (install_file_to_path): New function.
3400 FIXME: update fileutils.texi.
3401 (main): Handle new option, -D.
3402 Based on a patch from Marty Leisner.
3403 (usage): Describe -D.
3405 * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
3406 with -l or -t. Now, -u (like -c) implies --sort=time.
3407 (usage): Correct descriptions of --sort, --time, and -t.
3408 Suggestions from Andreas Schwab.
3410 Add test for the above fix.
3411 * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
3412 * tests/Makefile.am (SUBDIRS): Add ls.
3413 * tests/ls: New directory.
3414 * tests/ls/Makefile.am: New file.
3415 * tests/ls/time-1: New file.
3417 * lib/makepath.c (make_path): Reformat 3 if-stmts to test
3418 `if (newly_created_dir)' only once. Suggestion from Andreas Schwab.
3420 1998-01-06 Jim Meyering <meyering@na-net.ornl.gov>
3422 * lib/getdate.y: Move inclusion of getdate.h and dependent extern
3423 declarations down so getdate.h's prototype follows the sometimes-
3424 enabled definition of `const' to nothing. Otherwise, the prototype
3425 wouldn't match the definition because of the defined-away `const'.
3427 (get_date): ANSI-fy definition.
3428 Add %expect directive.
3430 1998-01-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
3432 * lib/makepath.c (make_path): Put only newly created directories
3433 on the LEADING_DIRS list.
3435 1998-01-05 Paul Eggert <eggert@twinsun.com>
3437 * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
3438 (get_fs_usage): If a value consists entirely of 1 bits,
3439 propagate this info to the output by setting it to (uintmax_t) -1.
3440 * src/df.c (df_readable): New function.
3441 (show_dev): If a value consists entirely of 1 bits, or is derived
3442 from some other value that consists entirely of 1 bits, report "-".
3443 Check inode and block counts more carefully for plausibility,
3444 to avoid arithmetic overflow when computing percentages.
3446 1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
3450 * lib/Makefile.in: Regenerated with patched automake-1.2d.
3453 * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
3454 the two booleans, verbose and changes_only. This fixes a bug whereby
3455 --change had the same effect as --verbose.
3456 * src/chmod.c: Likewise.
3457 * src/chown.c: Likewise.
3458 Reported by Paul Eggert.
3460 1998-01-04 Paul Eggert <eggert@twinsun.com>
3462 Check for write errors more carefully.
3464 * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
3465 (noinst_HEADERS): Add closeout.h.
3466 * lib/closeout.c, lib/closeout.h: New files.
3467 * lib/long-options.c (parse_long_options),
3468 src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
3469 src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
3470 src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
3471 src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
3472 (main, usage): Check for write error to stdout before exiting.
3473 Include "closeout.h".
3475 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
3477 * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
3478 just like `fsu.fsu_blocks == 0' as an indicator that usage information
3479 is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
3481 * lib/save-cwd.h: Guard PARAMS-enabling definition with
3482 `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
3483 problems with Irix4's cc. From Kaveh Ghazi.
3484 * lib/getdate.h: Likewise, but just to be consistent.
3486 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
3487 those files will be built via the ANSI2KNR-filtering rules if necessary.
3488 Reported by Kaveh Ghazi.
3490 1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
3494 Fix problem with `install -d'. Reported by Marty Leisner.
3496 * src/install.c (get_ids): When otherwise unspecified,
3497 set uid and gid to -1.
3498 * lib/makepath.c (make_path): Try to change ownership only if we've
3499 just created the directory. Fix latent bug (s/&&/||/ in two places --
3500 also, note that it could not be exercised via install or mkdir)
3501 whereby chown would not be invoked when only one of owner/group is
3504 1998-01-01 Jim Meyering <meyering@na-net.ornl.gov>
3506 * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
3507 only once and never free it.
3510 version-control: never