1 1998-08-09 Jim Meyering <meyering@ascend.com>
5 1998-07-31 Paul Eggert <eggert@twinsun.com>
7 Add support for filesystems whose timestamps have better resolution
8 than 1 second (e.g. Solaris 2.6, recent Linux kernels).
10 * configure.in (AC_STRUCT_ST_MTIM): Add.
12 * src/copy.c (copy_internal): Compare time stamps with
13 subsecond resolution if available.
15 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
16 rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
17 stamps with subsecond resolution if available.
19 * src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
20 CTIME_CMP, MTIME_CMP): New macros.
22 1998-08-01 Jim Meyering <meyering@ascend.com>
24 * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
26 1998-07-28 Paul Eggert <eggert@twinsun.com>
28 * lib/mountlist.c (read_filesystem_list): Remove all_fs
29 argument, but put the necessary information into the result so
30 that the caller can ignore filesystems that he's not
33 * lib/mountlist.h (struct mount_entry):
34 New members me_dummy, me_remote.
35 (read_filesystem_list): Remove all_fs argument.
36 (REMOTE_FS_TYPE): Remove.
37 (ME_DUMMY, ME_REMOTE): New macros.
39 * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
41 * src/df.c (show_all_fs):
42 Revert to boolean value; the old negative value is
44 (show_local_fs): New variable.
45 (show_dev): New args me_dummy and me_class. Use show_local_fs
46 and boolean show_all_fs in combination with these new args
47 to decide whether to show a device.
48 (show_disk): Pass flags to show_dev.
49 (show_point): Use a non-dummy mount entry if possible.
50 (show_all_entries): Pass flags to show_dev.
51 (main): --local sets show_local_fs now. Ask for file system types if
52 show_local_fs is nonzero, since ME_REMOTE might need them.
54 1998-07-27 Jim Meyering <meyering@ascend.com>
56 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
58 * tests/install/basic-1: Add a test for this.
59 * src/install.c: Make copy create each destination file initially
60 with mode 0600 so strip will work, then apply specified mode.
61 Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
63 1998-07-25 Jim Meyering <meyering@ascend.com>
65 * src/mv.c (chown): Remove unused definition.
66 Reported by Kaveh Ghazi.
68 * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
69 Handle that, so --ignore-fail-on-non-empty works.
70 (EEXIST): Define to zero if not defined.
71 (ENOTEMPTY): Likewise.
73 * tests/cp/same-file: Remove `diff' I'd put in for debugging.
74 Exit with the status from cmp.
78 * tests/cp/same-file: Skip three more unportable tests.
79 These failed on SunOS4.1.4.
81 * src/copy.c (SAME_INODE): Remove definition.
82 * src/sys2.h (SAME_INODE): Define it here instead.
84 * src/remove.c (same_file): New function.
85 (remove_dir): Use it to give a better diagnostic when rmdir fails
86 because it can't remove the current directory.
88 * src/df.c (long_options): Changes table entries not to use this form:
89 {"all", no_argument, &show_all_fs, 1},
91 {"all", no_argument, NULL, 'a'},
92 Using the latter, all the option handling in one place: the getopt loop.
94 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
96 (fsp_to_string): Don't xmalloc return value (yet).
98 (fstype_to_string): Ansideclify.
99 * lib/mountlist.h: Define and use PARAMS macro.
101 * lib/utime.c: New file.
102 * src/touch.c (utime_now): Moved into m4/utimes.m4.
103 (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
106 * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
108 1998-07-22 Paul Eggert <eggert@twinsun.com>
110 * lib/human.c (human_readable): amt -> damt, to fix typo when
111 computing which power to use after overflow occurs during
114 * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
117 1998-07-21 Paul Eggert <eggert@twinsun.com>
119 Add df -l or --local option.
120 * doc/fileutils.texi: Document it.
121 * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
122 * lib/mountlist.c (read_filesystem_list):
123 If all_fs is negative, omit non-local filesytems.
125 * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
126 (show_all_fs): If negative, omit non-local filesystems.
127 All uses of (all_fs != 0) changed to (all_fs > 0).
128 (long_options, usage, main): Add -l or --local option.
129 (main): When asking for df of an explicit file name, get all
130 the mount points, so that we're more likely to find it when
133 1998-07-18 Jim Meyering <meyering@ascend.com>
135 * src/copy.c (copy_internal): Add another exclusion from the
136 sameness test: when --force has been specified, the destination
137 is unlinked before any copy.
138 (copy_internal): Add yet another: when both src and dest are symlinks.
140 * tests/touch: New subdir.
141 * tests/Makefile.am (SUBDIRS): Add touch.
142 * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
144 * tests/mv/into-self-2: New test.
145 * tests/mv/Makefile.am (TESTS): Add into-self-2.
147 1998-07-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
149 * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
152 1998-07-16 Jim Meyering <meyering@ascend.com>
154 Work around failure of chown calls on m68k-motorola-sysv systems.
155 * src/chown.c: Include lchown.h.
156 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
157 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
158 * lib/lchown.c: Include lchown.h.
159 Reported by and with suggestions from Manfred Hollstein.
161 1998-07-12 Paul Eggert <eggert@twinsun.com>
163 * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
165 1998-07-07 Jim Meyering <meyering@ascend.com>
167 * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
168 Suggestion from Ulrich Drepper.
170 1998-07-04 Jim Meyering <meyering@ascend.com>
172 * lib/safe-read.c (safe_read): Change type of pointer parameter to
173 `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi.
174 * lib/safe-read.h: Update prototype.
176 * src/dircolors.c (parse_line): Add casts to avoid errors from
177 Irix4's `cc' C compiler. From Kaveh Ghazi.
179 * lib/xstrtol.c: Include stdio.h. Required on some systems when
180 using assert. From Kaveh Ghazi.
182 * tests/mv/backup-is-src: Use cmp, not diff.
183 Reported by Kaveh Ghazi.
185 1998-07-03 Jim Meyering <meyering@ascend.com>
189 * src/remove.c (remove_dir): Use fprintf (not error) to avoid
192 1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
194 * lib/mountlist.c: (read_filesystem_list):
195 Don't leak memory on failure.
196 Don't create a dummy struct mount_entry entry;
197 use the address-of-the-tail-address method instead.
198 Preserve errno if possible on failure, setting it to 0 if inapplicable.
199 Close file descriptor leak if the F_SETLKW failed.
200 Report an error if SVR4 lock file cannot be opened for some reason
201 other than a nonexistent lock file.
203 1998-07-03 Jim Meyering <meyering@ascend.com>
205 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
206 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
207 * acconfig.h (WITH_REGEX): Remove undef.
208 * lib/Makefile.am (noinst_HEADERS): Add regex.h.
209 * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
210 * lib/rx.c: Remove file.
211 * lib/rx.h: Remove file.
213 * src/df.c (df_readable): Rename local so as not to shadow global.
215 * src/copy.c (SAME_INODE): New macro.
216 Use it to replace open-coded equivalents.
217 (copy_internal): Rename variable and reverse sense of tests
218 to make the code a little clearer.
220 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
222 * src/copy.c (copy_internal): Try harder identifying a relative
223 symbolic link in the current directory.
225 * src/copy.c (copy_internal): Don't skip test for same file if
226 creating a hardlink from symlink over a non-symlink while making
228 * tests/cp/same-file: Skip tests that depend on link(2) not
231 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
233 * src/copy.c (copy_internal): Don't call chown on a symlink.
235 1998-07-01 Jim Meyering <meyering@ascend.com>
237 * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
238 configure's --disable-assert option.
240 1998-06-29 Paul Eggert <eggert@twinsun.com>
242 * lib/mountlist.c (read_filesystem_list):
243 Plug file descriptor leak on failure.
244 Report failure if lock file can't be opened for some reason
245 other than nonexistence.
247 1998-06-29 Jim Meyering <meyering@ascend.com>
251 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
252 Always close stream and file descriptor before returning.
254 * src/df.c (main): Move the test of the result of the
255 read_filesystem_list call up out of if-block -- code in the
256 else-block depends on it too.
258 1998-06-29 Paul Eggert <eggert@twinsun.com>
260 * lib/mountlist.c: (read_filesystem_list): If SVR4, lock
261 /etc/.mnttab.lock if available, to avoid race conditions
262 (e.g. with the automounter on Solaris 2.6).
264 Include <errno.h>, <fcntl.h>, <unistd.h>.
266 1998-06-29 Jim Meyering <meyering@ascend.com>
268 * lib/mountlist.c (fstype_to_string): Guard with
269 #if ! HAVE_F_FSTYPENAME_IN_STATFS.
271 1998-06-28 Paul Eggert <eggert@twinsun.com>
273 Add support for new --block-size option and
274 BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
275 Adjust df output slightly to accommodate larger filesystems.
277 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
278 into one, for convenience. All callers changed.
279 (human_block_size): New function.
280 * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
281 Include <stdlib.h> if HAVE_STDLIB_H;
282 declare getenv unless HAVE_DECL_GETENV.
284 Include <argmatch.h>, <error.h>, <xstrtoul.h>.
285 (DEFAULT_BLOCK_SIZE): New macro.
286 (block_size_args, block_size_types): New constants.
287 (humblock): New function.
288 * lib/xstrtol.h (__ZLONG_MAX): Remove.
289 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
290 unsigned long to double without losing information.
291 (bkm_scale_by_power): New function.
293 * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
294 Add support for SI-like suffixes like "GB" and "TD".
295 * src/dd.c (usage): Describe it.
297 * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
298 Remove; replace with new variable output_block_size. All uses changed.
299 (long_options, usage, main): Add --block-size.
300 (main, decode_switches): Use new human_block_size function to
301 initialize output block size consistently with other programs.
303 * src/df.c (print_header, show_dev): Shrink some columns and expand
304 others, to squeeze in support for today's larger filesystems.
305 (print_header): Print output block size using power-of-1024 SI format.
306 (df_readable): Coalesce last two args into one, for convenience.
308 (main): Remove check for portable output format and larger
309 or human-readable block sizes.
311 * NEWS, doc/fileutils.texi: Describe above changes.
313 1998-06-28 Jim Meyering <meyering@ascend.com>
315 * src/ls.c (usage): Make --kilobytes description consistent with
316 that in du and df. From Göran Uddeborg.
318 * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
319 now that we're using the jm_FSTYPENAME autoconf macro.
320 James Tanis reported the old version didn't compile on BSDI3.
322 * configure.in: Move big block of list_mounted_fs checks into
323 new jm_LIST_MOUNTED_FILESYSTEMS macro.
324 Use new jm_FSTYPENAME macro.
326 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
327 * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
330 1998-06-27 Jim Meyering <meyering@ascend.com>
332 * src/copy.c (copy_reg): Detect identical source and dest here.
333 (copy_internal): Make the test symmetric.
335 * tests/cp/same-file: New file.
336 * tests/cp/Makefile.am (TESTS): Add it.
338 1998-06-26 Jim Meyering <meyering@ascend.com>
340 * src/remove.c (remove_file): Remove `non-directory' part of
341 `removing non-directory FILE' verbose message.
343 1998-06-23 Jim Meyering <meyering@ascend.com>
345 * src/df.c (show_dev): Increase field width for blocks, used,
346 and available columns from 7 to 8.
348 1998-06-21 Jim Meyering <meyering@ascend.com>
350 * aclocal.m4: Regenerate with fixed gettext.m4 installed.
351 See README-alpha for details.
353 1998-06-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
355 * src/automake-wrap: Quote `&' in sed replacement text.
357 1998-05-31 Jim Meyering <meyering@ascend.com>
361 * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
362 Reported by Don Parsons.
364 1998-05-30 Jim Meyering <meyering@ascend.com>
366 * tests/ls/time-1: Clean up ctime test. Note that it fails also
367 on Solaris5.5.1 tmpfs file systems.
369 Solve the `rm -f rm' problem more cleanly.
370 * src/.rm-warning: Remove file.
371 * src/automake-wrap: New file.
372 * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
373 (Makefile.in): Depend on automake-wrap.
374 (EXTRA_DIST): Add automake-wrap.
375 (DISTCLEANFILES): Remove definition.
376 (rm_DEPENDENCIES): Likewise.
377 (.rm-warn-stamp): Remove rule.
379 1998-05-27 Jim Meyering <meyering@ascend.com>
381 * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
382 * tests/ls/rt-1: New file, renamed from cr-1.
384 1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
386 * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
388 * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
391 1998-05-25 Jim Meyering <meyering@ascend.com>
393 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
394 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
395 [!_GNU_SOURCE]: Add #undef instead.
397 1998-05-24 Jim Meyering <meyering@ascend.com>
401 * src/ansi2knr.c: Use new version from automake-1.3.
403 * src/chown.c: Accept new option, --dereference.
404 --no-dereference is now the default.
405 (enum Change_status) [CH_NOT_APPLIED]: New member.
406 (change_symlinks): Enable this by default, now.
407 (describe_change): Handle new case.
408 (change_file_owner): Add new parameter: cmdline_arg. Update callers.
409 Reorganize to reflect changed semantics.
410 (LCHOWN): Remove definitions.
412 * lib/lchown.c: New file.
414 1998-05-21 Jim Meyering <meyering@ascend.com>
416 * configure.in (ALL_LINGUAS): Add russian (ru).
418 1998-05-16 Jim Meyering <meyering@ascend.com>
420 * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
421 (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
423 * lib/hash.c (is_prime): Ansideclify.
424 (next_prime): Ansideclify. Add an assertion.
426 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
427 lines from the m4/*.m4 macros, so the hack of including some
428 custom-replaced C source file names here is no longer needed.
430 * configure.in (jm_MACROS): New wrapper macro.
431 Remove uses of most jm_* macros.
433 * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
434 as part of utimbuf.m4.
435 (memcmp): Add #undef.
437 1998-05-12 Jim Meyering <meyering@ascend.com>
439 * configure.in: Use my replacement AC_ISC_POSIX rather than
442 * src/copy.c (copy_internal): Plug a small leak.
444 1998-05-10 Jim Meyering <meyering@ascend.com>
446 * src/mv.c (do_move): Remove lots of code that was duplicated in
447 copy.c (copy), now that copy() has better support for mv. This fixes
448 a bug with cross-filesystem `mv -i' whereby you could get two prompts
449 for the same destination file and eventually remove the destination
450 file even though one of the responses was negative.
451 Reported by Dirk Lattermann.
453 * src/copy.h: Better support for mv:
454 [struct cp_options] (move_mode): New member.
455 * src/copy.c (copy_internal): Use new move_mode member.
457 (copy): Add parameter.
459 * tests/cp/Makefile.am (TESTS): Add backup-is-src.
460 * tests/mv/Makefile.am (TESTS): Likewise.
462 * lib/userspec.c: Don't declare strdup if it's defined as a macro.
463 Reported by Lorne Baker.
465 * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
467 * src/mv.c (cp_option_init): Initialize new members.
468 * src/cp.c (cp_option_init): Likewise.
469 (main): Set new preserve_* options.
471 1998-05-09 Jim Meyering <meyering@ascend.com>
473 * src/copy.h: Support for install:
474 [struct cp_options] (failed_unlink_is_fatal): New member.
475 (preserve_owner_and_group): New member.
476 (preserve_chmod_bits): New member.
477 (preserve_timestamps): New member.
478 (preserve): Remove member.
479 (set_mode): New member.
481 * src/copy.c (new_nondir_mode): New function. Use where appropriate.
482 Use more-specific preserve_* members in place of removed `preserve'.
483 (copy_internal): Honor failed_unlink_is_fatal.
485 * src/install.c (main): Rewrite argv-handling to be clearer.
486 (copy_file): Rewrite to use copy.c (copy).
487 (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
488 `no_need_to_chown' parameter. Fix caller.
489 (install_file_in_file): Remove now-unnecessary `to_created' parameter.
490 (cp_option_init): New function.
491 Update several functions to take new parameter specifying copy options.
493 * tests/install: New subdir, with one basic test.
494 * tests/Makefile.am (SUBDIRS): Add install.
495 * configure.in (AC_OUTPUT): Add tests/install/Makefile.
497 * src/dd.c: Include safe-read.h.
498 Don't declare safe_read.
499 * src/touch.c: Likewise.
501 * configure.in (jm_TYPE_SSIZE_T): Use it.
502 * acconfig.h (ssize_t): Add undef.
504 1998-05-03 Jim Meyering <meyering@ascend.com>
506 * po/: Update from gettext-0.10.35.
508 * configure.in: Remove use of AC_LINK_FILES.
509 (AC_OUTPUT): Remove po/Makefile-generating sed command.
511 1998-04-28 Jim Meyering <meyering@ascend.com>
513 * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
514 Use unsigned char * pointers, not potentially signed ones, to avoid
517 1998-04-26 Jim Meyering <meyering@ascend.com>
519 * configure.in: Use jm_ASSERT.
520 * acconfig.h: Add NDEBUG.
522 * src/mv.c: Don't define NDEBUG.
523 * src/cp.c: Likewise.
525 1998-04-14 Jim Meyering <meyering@ascend.com>
527 * src/.rm-warning: New file.
528 * src/Makefile.am (EXTRA_DIST): Add .rm-warning
529 (DISTCLEANFILES): Add .rm-warn-stamp.
530 (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
531 (.rm-warn-stamp): New rule.
532 (rm_prep): Comment out rule.
534 * src/df.c (main): Use STREQ in string equality tests, not strcmp.
535 * src/dircolors.c (dc_parse_stream): Likewise.
536 (dc_parse_file): Likewise.
537 * src/du.c (main): Likewise.
538 * src/ls.c (decode_switches): Likewise.
539 * src/remove.c (hash_compare_strings): Likewise.
540 * src/touch.c (main): Likewise.
542 1998-04-13 Jim Meyering <meyering@ascend.com>
544 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
546 1998-04-11 Jim Meyering <meyering@ascend.com>
548 * lib/hash.c: Add curly braces around statements in
549 if/else/while/do/etc. that span more than a line -- even around
550 multiline simple statements or single-line simple statements
551 preceded by a comment line.
553 1998-04-09 Jim Meyering <meyering@ascend.com>
555 * configure.in: Don't use AC_PATH_PROG to check for perl, now that
558 1998-04-06 Jim Meyering <meyering@ascend.com>
560 * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
561 hash_insert. Also declare to be static.
562 * src/cp-hash.h (hash_insert): Remove declaration.
564 * lib/hash.c: Lots of minor spec and name changes, and new comments.
565 (hash_rehash): Rewrite to be easier on the allocator.
566 From François Pinard.
567 * lib/hash.h: More comments.
568 * src/remove.c: Change names/usage of hash-related functions to work
571 1998-04-05 Jim Meyering <meyering@ascend.com>
573 * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
574 This now depends on HAVE_BTOWC so systems that lack btowc (like
575 solaris-2.5.1) don't lose.
577 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
579 * GNUmakefile: Add conditionals so that running `make' in an
580 unconfigured source directory will get a reasonable diagnostic.
582 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
583 know about the m4/ subdirectory.
584 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
585 automake-1.2h and the above change) aclocal-related rules and includes.
587 1998-04-01 Jim Meyering <meyering@eng.ascend.com>
589 * tests/ls/cr-1: New file.
590 * tests/ls/Makefile.am (TESTS): Add cr-1.
592 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
594 * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
595 works with `unsigned char'.
597 (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
599 * lib/xstrtol.c: Merge with the version from textutils.
601 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
603 1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
605 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
606 rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
607 rev_cmp_size): Use file name as secondary sort key to get
610 1998-03-28 Jim Meyering <meyering@eng.ascend.com>
612 * src/copy.c: Add copyright.
613 * src/remove.c: Add copyright.
614 [_AIX]: Add #pragma alloca.
616 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
618 * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
619 dependency and the := assignment of ACLOCAL to make the default
620 rule use the `-I m4' option.
622 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
624 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
626 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
627 automatically handles it.
629 1998-03-21 Jim Meyering <meyering@eng.ascend.com>
631 * lib/quotearg.h: Update from patch-2.5.3.
632 * lib/quotearg.c: Likewise.
633 * src/ls.c (decode_switches): Pass a null pointer instead of address
634 of quotearg_quoting_options.
636 1998-03-19 Paul Eggert <eggert@twinsun.com>
638 * lib/fsusage.h (struct fs_usage): New member
639 fsu_bavail_top_bit_set.
640 * lib/fsusage.c: Include <limits.h>.
641 (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
642 (get_fs_usage): If top bit of system variable corresponding to
643 fsu_bavail is set, then set fsu_bavail_top_bit_set, and
644 sign-extend the value when storing it into fsu_bavail.
645 * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
646 assume the original value corresponding to fsu_bavail was negative.
647 Reported by Arne Juul.
649 1998-03-18 Jim Meyering <meyering@eng.ascend.com>
651 * src/Makefile.am (rm-prep): Add dependency and rule to save users
652 with `.' too early in their PATH from the `rm: cannot unlink `rm':
653 Text file busy' error. Suggestion from Philippe De Muyter.
655 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
659 * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
660 * lib/closeout.c: Likewise.
661 * lib/dirname.c: Likewise.
662 * lib/euidaccess.c: Likewise.
663 * lib/fileblocks.c: Likewise.
664 * lib/filemode.c: Likewise.
665 * lib/ftruncate.c: Likewise.
666 * lib/group-member.c: Likewise.
667 * lib/isdir.c: Likewise.
668 * lib/long-options.c: Likewise.
669 * lib/mountlist.c: Likewise.
670 * lib/path-concat.c: Likewise.
671 * lib/save-cwd.c: Likewise.
672 * lib/savedir.c: Likewise.
673 * lib/strcasecmp.c: Likewise.
674 * lib/strdup.c: Likewise.
675 * lib/userspec.c: Likewise.
676 * lib/yesno.c:: Likewise.
678 * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
679 Use #if !, not #ifndef with HAVE_ macros.
680 * src/chown.c: Likewise.
681 * src/copy.c: Likewise.
682 * src/dd.c: Likewise.
683 * src/dircolors.c: Likewise.
684 * src/install.c: Likewise.
685 * src/ls.c: Likewise.
686 * src/mv.c: Likewise.
687 * src/touch.c: Likewise.
689 * configure.in: Use jm_PREREQ.
691 1998-03-14 Jim Meyering <meyering@eng.ascend.com>
693 Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
694 With automake-1.2f, that hack is no longer needed.
696 * src/remove.c: Use `virtual memory exhausted' message, not
697 `Memory exhausted' to be consistent with the majority of other
699 Say `removing all...', not `removing any...'.
700 * src/rmdir.c (remove_parents): Be consistent with documentation of
701 --verbose option and with remove.c in saying `removing...' before
702 the operation is attempted.
704 Suggestions from Santiago Vila.
706 * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
707 (copy_internal): Likewise.
710 * src/copy.h (copy): Update prototype.
711 * src/cp.c (do_copy): Add unused arg in calls to copy.
712 * src/mv.c (do_move): Add ©_into_self arg in call to copy.
713 Don't remove source directory when copy_into_self is nonzero.
714 Reported by Arne Henrik Juul.
716 * tests/mv/into-self: Test for the above.
717 * tests/mv/Makefile.am (TESTS): Add into-self.
719 1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
721 * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
722 about any arbitrary user and group by pretending to be the user
723 and to belong to the group specified in `spec_arg' argument.
725 * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
726 any arbitrary user name.
727 (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
730 1998-02-24 Jim Meyering <meyering@eng.ascend.com>
732 * lib/xstrtol.c (TYPE_SIGNED): Define.
733 (TYPE_MAXIMUM): Define.
734 (ULONG_MAX): Use TYPE_MAXIMUM.
735 (LONG_MAX): Use TYPE_MAXIMUM.
737 * lib/fnmatch.c: Update from libit.
738 * lib/idcache.c: Update from libit.
740 1998-02-23 Paul Eggert <eggert@twinsun.com>
742 * lib/quotearg.h, lib/quotearg.c: New files.
743 * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
744 (noinst_HEADERS): Add quotearg.h.
746 * src/ls.c: Include new file quotearg.h.
747 (enum indicator_style): Rename all to classify, and not_programs
748 to file_type, to match option spellings. All users changed.
749 (indicator_style_args): New constant.
750 (quote_funny_chars, quote_as_string, quote_shell): Remove;
751 (filename_quoting_options, dirname_quoting_options): Use these
753 (long_options): Add --indicator-style, --quoting-style,
754 --show-control-chars. Remove --quote-shell.
755 (dired_dump_obstack): Remove style parameter and don't output style.
756 (main): Go back to previous method of outputting //DIRED//
757 and //SUBDIRED// lines, without style. But add a new
758 //DIRED-OPTIONS// line that does output style.
759 (decode_switches, usage): Add --indicator-style, --quoting-style,
760 --show-control-chars. Remove --quote-shell.
761 (decode_switches): Default from QUOTING_STYLE environment variable.
762 Set new quoting vars.
763 (quote_name): Renamed from quote_filename.
764 Take new arg specifying quoting options.
765 Always print; do not have a special case for null FILE * argument.
767 Move the guts of this function to new file quotearg.c.
768 (length_of_file_name_and_frills): Use quotearg_buffer instead
769 of (old) quote_filename to find length of file name.
771 (decode_switches, parse_ls_color, print_dir, gobble_file,
772 get_link_name): Quote output in diagnostics.
774 * NEWS, doc/fileutils.texi: Describe above changes.
775 * doc/fileutils.texi: Mention that control characters are output
776 as question marks if output is a terminal.
778 1998-02-22 Jim Meyering <meyering@eng.ascend.com>
782 * ChangeLog-1997: New file.
783 * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
785 1998-02-21 Jim Meyering <meyering@eng.ascend.com>
787 * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
788 * tests/Makefile.am (SUBDIRS): Add mv.
789 * tests/mv: New directory
790 * tests/mv/mv-special-1: New test.
792 1998-02-20 Jim Meyering <meyering@eng.ascend.com>
794 * src/touch.c: Include get-date.h.
795 Remove get_date decl.
797 * lib/getdate.h: Removed. Could cause confusion with an
798 automake-generated `.y.h' rule.
799 * lib/get-date.h: Renamed from getdate.h.
800 * lib/getdate.y: s/getdate.h/get-date.h/
801 * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
803 1998-02-19 Jim Meyering <meyering@eng.ascend.com>
805 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
806 * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
808 1998-02-13 Jim Meyering <meyering@eng.ascend.com>
810 * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
811 Otherwise, mv tries to open special files.
812 Reported by Kjetil Torgrim Homme.
814 1998-02-08 Jim Meyering <meyering@eng.ascend.com>
816 * Makefile.maint (cvs-dist): Update po/ to clear modified status
817 of *.po files before running cvs tag -c.
819 * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
822 1998-02-07 Jim Meyering <meyering@eng.ascend.com>
824 * GNUmakefile: New file.
825 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
826 Don't include Makefile.maint from here. It's included from GNUmakefile.
828 * configure.in: Don't use AM_MAINTAINER_MODE.
831 * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen.
832 (CLEANFILES): Remove dcgen.
833 (dircolors.h): Use $(PERL).
836 1998-02-01 Jim Meyering <meyering@na-net.ornl.gov>
838 * POTFILES.in: Add remove.c. Reported by Santiago Vila.
840 1998-01-28 Jim Meyering <meyering@na-net.ornl.gov>
842 * src/df.c (print_header): Tweak format to align heading over
843 last column of `df -i' output. From Andreas Schwab.
845 1998-01-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
847 * Makefile.am: Include Makefile.maint from $(srcdir).
849 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
853 * Makefile.maint: New file.
854 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
856 Include Makefile.maint.
857 (EXTRA_DIST): Add Makefile.maint.
859 * src/cp.c (re_protect): Don't fail for non-root when chown fails
860 due not only to lack of permission (EPERM), but also to lack of
861 support (EINVAL). Reported by Bengt Martensson.
862 * src/copy.c (DO_CHOWN): Likewise.
864 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
866 * tests/ls/time-1 (test_failure): Rename does not update ctime;
867 link does -- so use ln, not mv.
868 Note that the SunOS4.1.4 failure of the ctime test is expected.
870 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
871 bug in Cray C 5.0.3.0 when T == time_t.
873 * tests/rm/r-1: Adjust expected output for changed format of
875 * tests/rm/r-2: Likewise.
877 1998-01-23 Jim Meyering <meyering@na-net.ornl.gov>
879 * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
880 C compiler. From Kaveh Ghazi.
881 (TYPE_MINIMUM): Define.
882 (TYPE_MAXIMUM): Define.
883 (TIME_T_MIN): Use TYPE_MINIMUM.
884 (TIME_T_MAX): Use TYPE_MAXIMUM.
886 1998-01-22 Jim Meyering <meyering@na-net.ornl.gov>
888 * src/dd.c: Reorder functions to obviate forward dcls.
889 (quit): Declare to be inline to stifle compile warning.
891 * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
893 * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a
896 * tests/ls/time-1: Use GNU touch to work around problems with NFS
897 caching and/or clock skew. Reported by Kaveh Ghazi.
899 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
901 * src/Makefile.am (noinst_HEADERS): Add remove.h.
902 (mv_SOURCES): Define.
903 (rm_SOURCES): Define.
905 1998-01-21 Jim Meyering <meyering@na-net.ornl.gov>
907 * src/install.c: Declare new global, backup_type.
908 (main): Initialize backup_type unconditionally.
909 (copy_file): Call find_backup_file_name with new argument, backup_type.
910 * src/ln.c: Declare new global, backup_type.
911 (main): Initialize backup_type unconditionally.
912 (do_link): Call find_backup_file_name with new argument, backup_type.
914 * src/copy.c (copy_internal): Use x->backup_type, not the global.
915 (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
917 * src/copy.h: (VALID_SPARSE_MODE): Define.
918 [struct cp_options] (backup_type): New member.
920 * src/cp.c [NDEBUG]: Comment out definition.
921 (do_copy): Use x->backup_type, not the global.
923 * src/remove.c: New file. Contains guts of old rm.c.
924 (remove_init): New function.
925 (remove_fini): New function.
926 (rm): Take third argument, specifying options.
927 * src/remove.h: New file. Associated dcls.
928 * src/rm.c: Remove and minimally librarify guts for use in mv.c.
929 (main): Pass options (`&x') to rm.
930 Call remove_init and remove_fini instead of open-coding them.
932 * src/mv.c (rm_option_init): New function.
933 (cp_option_init): New function.
934 (copy_reg): Remove now-unused function.
935 (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
936 Set up for and use `remove.c (rm)' in place of unlink.
938 1998-01-20 Jim Meyering <meyering@na-net.ornl.gov>
940 * lib/backupfile.c: Use ANSI function definitions.
941 Remove global declaration of backup_type.
942 (simple_backup_suffix): Default to `~', not `.orig'.
943 Use PARAMS, not __BACKUPFILE_P.
944 (find_backup_file_name): Add parameter, backup_type.
945 * lib/backupfile.h: Remove extern declaration of backup_type.
946 Use PARAMS, not __BACKUPFILE_P.
947 (VALID_BACKUP_TYPE): Define.
948 (find_backup_file_name): Adjust prototype.
950 1998-01-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
952 * src/df.c (print_header): Fix inode format header to line it up
953 with the rest of the output.
955 1998-01-13 Jim Meyering <meyering@na-net.ornl.gov>
957 * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent
958 with most other implementations.
960 1998-01-12 Jim Meyering <meyering@na-net.ornl.gov>
962 * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
963 Move function-spanning `#if ...BSIZE' directive to follow inclusion
964 of sys/param.h since BSIZE is sometimes defined in sys/param.h.
965 Reported by Philippe De Muyter.
967 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
971 * src/install.c (install_file_to_path): New function.
972 FIXME: update fileutils.texi.
973 (main): Handle new option, -D.
974 Based on a patch from Marty Leisner.
975 (usage): Describe -D.
977 * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
978 with -l or -t. Now, -u (like -c) implies --sort=time.
979 (usage): Correct descriptions of --sort, --time, and -t.
980 Suggestions from Andreas Schwab.
982 Add test for the above fix.
983 * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
984 * tests/Makefile.am (SUBDIRS): Add ls.
985 * tests/ls: New directory.
986 * tests/ls/Makefile.am: New file.
987 * tests/ls/time-1: New file.
989 * lib/makepath.c (make_path): Reformat 3 if-stmts to test
990 `if (newly_created_dir)' only once. Suggestion from Andreas Schwab.
992 1998-01-06 Jim Meyering <meyering@na-net.ornl.gov>
994 * lib/getdate.y: Move inclusion of getdate.h and dependent extern
995 declarations down so getdate.h's prototype follows the sometimes-
996 enabled definition of `const' to nothing. Otherwise, the prototype
997 wouldn't match the definition because of the defined-away `const'.
999 (get_date): ANSI-fy definition.
1000 Add %expect directive.
1002 1998-01-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1004 * lib/makepath.c (make_path): Put only newly created directories
1005 on the LEADING_DIRS list.
1007 1998-01-05 Paul Eggert <eggert@twinsun.com>
1009 * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
1010 (get_fs_usage): If a value consists entirely of 1 bits,
1011 propagate this info to the output by setting it to (uintmax_t) -1.
1012 * src/df.c (df_readable): New function.
1013 (show_dev): If a value consists entirely of 1 bits, or is derived
1014 from some other value that consists entirely of 1 bits, report "-".
1015 Check inode and block counts more carefully for plausibility,
1016 to avoid arithmetic overflow when computing percentages.
1018 1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
1022 * lib/Makefile.in: Regenerated with patched automake-1.2d.
1025 * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
1026 the two booleans, verbose and changes_only. This fixes a bug whereby
1027 --change had the same effect as --verbose.
1028 * src/chmod.c: Likewise.
1029 * src/chown.c: Likewise.
1030 Reported by Paul Eggert.
1032 1998-01-04 Paul Eggert <eggert@twinsun.com>
1034 Check for write errors more carefully.
1036 * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
1037 (noinst_HEADERS): Add closeout.h.
1038 * lib/closeout.c, lib/closeout.h: New files.
1039 * lib/long-options.c (parse_long_options),
1040 src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
1041 src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
1042 src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
1043 src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
1044 (main, usage): Check for write error to stdout before exiting.
1045 Include "closeout.h".
1047 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
1049 * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
1050 just like `fsu.fsu_blocks == 0' as an indicator that usage information
1051 is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
1053 * lib/save-cwd.h: Guard PARAMS-enabling definition with
1054 `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
1055 problems with Irix4's cc. From Kaveh Ghazi.
1056 * lib/getdate.h: Likewise, but just to be consistent.
1058 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
1059 those files will be built via the ANSI2KNR-filtering rules if necessary.
1060 Reported by Kaveh Ghazi.
1062 1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
1066 Fix problem with `install -d'. Reported by Marty Leisner.
1068 * src/install.c (get_ids): When otherwise unspecified,
1069 set uid and gid to -1.
1070 * lib/makepath.c (make_path): Try to change ownership only if we've
1071 just created the directory. Fix latent bug (s/&&/||/ in two places --
1072 also, note that it could not be exercised via install or mkdir)
1073 whereby chown would not be invoked when only one of owner/group is
1076 1998-01-01 Jim Meyering <meyering@na-net.ornl.gov>
1078 * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
1079 only once and never free it.
1082 version-control: never