1 1999-04-24 Jim Meyering <meyering@ascend.com>
5 1999-04-22 Jim Meyering <meyering@ascend.com>
7 * src/shred.c (word32): Don't use `#error'; it runs afoul of
10 * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC.
12 1999-04-20 Paul Eggert <eggert@twinsun.com>
14 Replace our temporary hack implementation of strtoumax with
15 something very close to the real code in glibc.
17 * lib/xstrtoumax.c: Remove the temporary strtoumax replacement;
18 we now have a true replacement in strtoumax.c.
19 (__strtol): Always define to strtoumax.
20 (<stdlib.h>): No need to include.
22 (my_strtoumax): Move this to strtoumax.c,
23 rename it to strtoumax, and simplify.
25 * lib/strtoull.c, lib/strtoumax.c: New files.
27 * lib/strtol.c: Update to glibc 2.1.1 version.
29 1999-04-20 Jim Meyering <meyering@ascend.com>
31 * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/.
32 (check-local): Also test and warn if CDPATH is set.
34 1999-04-20 Paul Eggert <eggert@twinsun.com>
36 * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's
38 * config.guess: New file (from autoconf).
39 * config.sub: New file (from autoconf).
41 * src/shred.c <config.h>: Include first, since it can do
42 things like #define const, and this must be done before
43 including any system headers.
45 * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing
46 whether overflow occurred. Improve overflow-detection to use
47 only one conditional branch total, rather than 2N+1
48 conditional branches for an N-digit number.
50 1999-04-18 Jim Meyering <meyering@ascend.com>
52 * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and
53 strtouq, now that they're checked in m4/xstrtoumax.m4.
55 1999-04-18 Paul Eggert <eggert@twinsun.com>
57 * doc/fileutils.texi, src/shred.c (main, longopts):
58 Use -u instead of -R for --remove, so that we can preserve
59 future compatibility with rm.
61 1999-04-18 Jim Meyering <meyering@ascend.com>
63 * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
64 (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
67 1999-04-18 Paul Eggert <eggert@twinsun.com>
69 Fix shred to do the right thing with off_t longer than long.
70 Merge large-integer parsing code with similar code in dd.c,
71 and put the resulting in lib/xstrtoumax.c so that other programs
72 can use it. Instead of adding a new lib/xstrtoumax.h I thought
73 it cleaner to put all the xstroto* declarations into a single
74 header, which for now is lib/xstrtol.h for lack of a better place.
75 (Mayby lib/xstdlib.h would be better? :-)
77 I thought of several other problems with shredding regular files;
78 shredding devices is much more reliable. So I changed the defaults
79 to be more suitable for shredding devices; this should help encourage
80 users to do the right thing.
82 pfstatus isn't portable to environments with varying width
83 fonts, or with internationalized environments where the byte
84 count of the message is not the same as its print width.
85 Rather than deal with this, I just simplified it to not do
86 tricks with carriage-returns and spaces. (I'm also worried
87 that vprintf may not return the right value on some hosts; I
88 vaguelly recall this being a problem.) As a result, -v and -
91 When removing a special file, try to truncate it first, but don't
92 worry if this reports an error.
94 Try to find the size of a non-regular file by seeking to its end.
96 Various porting fixes, mostly because of a port to SunOS 4.1.4 cc.
98 Some other minor bug fixes.
100 * lib/xstrtoul.h: Remove this file.
101 * lib/xstrtoumax.c: New file.
103 * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq.
105 * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove.
106 (__strtol, __strtol_t, __xstrtol): New macros.
108 * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol):
109 New macros to specify the
110 underlying function, its returned type, and our function. Default to
111 values suitable for xstrtol.
113 Include <ctype.h>, since we use its macros.
115 (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
116 (ISSPACE): New macro.
118 (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
121 (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
122 whether STRING_TO_UNSIGNED is defined. Skip isspace chars, not
123 isblank chars, to match strtol. When returning
124 LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
127 * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls.
128 <inttypes.h>: Include if HAVE_INTTYPES_H.
129 (_DECLARE_XSTRTOL): New macro.
130 (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
131 we need only one include file, not three.
132 (_STRTOL_ERROR): Do not undef, as this is no longer needed.
133 Reword overflow message so that it's independent of type.
135 * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c.
136 (noinst_HEADERS): Remove xstrtoul.h.
138 * lib/xmalloc.c (xalloc_fail):
139 Pass xalloc_msg_memory_exhausted through gettext.
142 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
143 (LookupWord, yylex): Don't pass negative char to ctype macros.
145 * doc/fileutils.texi:
146 Explain why shredding devices is more reliable, and why the
147 default options are more suitable for devices.
149 Remove withdrawn options -b or --no-contents, -c or --freed-contents,
150 -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or
153 Add -R or --remove, -s or --size.
155 -v can no longer be doubled.
157 `file system' --> `filesystem' uniformly.
159 * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h.
161 * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h.
162 "human.h", "xalloc.h": Include.
163 (attribute): Remove; no longer needed.
165 (STDOUT_FILENO): New macro.
166 (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.
168 The following changes have effect only if !HAVE_CONFIG_H.
169 <ctype.h>: New include.
170 (RETSIGTYPE): Remove bogus semicolon at end.
171 (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
173 (xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
174 Handle suffixes like the real routine does.
175 (error): Remove bogus assignment of errno to errnum.
176 (xmalloc, xstrdup): New functions.
178 (O_NOCTTY): Define even if !HAVE_CONFIG_H.
179 (S_ISFIFO, S_ISSOCK): New macros, if not already defined.
180 (OUTPUT_BLOCK_SIZE): New macro.
181 (struct Options.verbose): Now a boolean, since we no longer have two
183 (long_opts, usage, main): Remove -D or --device option. Invert -p or
184 --preserve option, and rename it to -R or --remove.
185 (usage): Describe G suffix.
186 (usage): "-" no longer conflicts with -v.
187 (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
188 (ind): Portability fixes: return word32, not unsigned; multiply by
189 sizeof (word32) instead of shifting left by 2.
190 (isaac_refill, isaac_mix): Comment out size of array parameter, as
191 ansi2knr mishandles this.
192 (status_visible, status_pos, pfstatus, flushstatus): Remove, since
193 pfstatus isn't portable to users with varying width fonts, or
194 internationalized messages, and vfprintf is problematic. All callers
195 of pfstatus changed to use error instead; this removes incompatibility
196 of -v with -. All calls to flushstatus removed.
197 (dopass, do_wipefd): Do not translate non-English msgs with gettext.
199 (dopass): Cast lseek constant arguments to (off_t) for benefit
200 of pre-ANSI compilers; fix one lseek call whose args were interchanged.
201 Remove unnecessary casts to (off_t). Do not check for EIO
202 when determining file size; this was just my earlier wild guess.
203 Use human_readable to print off_t, instead of casting to unsigned long
204 (which doesn't work in Solaris 2.6, where off_t is longer than long).
205 Output human-readable sizes, instead of always using "K".
206 Check for offset overflow (it happened to me in SunOS 4.1.4).
207 (do_wipefd): Do not insist on regular files, but do check for special
208 files that cannot possibly be shredded.
209 Use xmalloc instead of malloc + check.
210 Do not inspect st_size for non-regular files.
211 Try to find the size of a non-regular file by seeking to its end.
212 Do not assume that a regular file of size-0 has unknown size.
213 Check for regular files with negative sizes,
214 and for overflow after rounding to next block.
215 Always try to truncate, even for special files, but do not report an
216 error if truncation fails on a special file.
218 (dopass, wipefile): Do not return 1 for special files; the caller
219 doesn't care any more.
221 (wipefd): Remove unnecessary (and nonportable) check for
222 whether the file descriptor is read-only. Remove
223 no-longer-needed check for `-v -'.
225 (incname): Return 1 for carry bit, like the documentation says.
227 (wipename, wipefile): Accept new argument, specifying the
228 quoted file name. All callers changed.
230 (wipename): Use xstrdup instead of strdup+error check.
232 (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
233 errors in NNN more carefully. Restore errno after the check.
234 Check for errors when closing the file descriptor.
235 Use more consistent wording when unable to remove a file.
237 (main): Do not remove files by default.
238 Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
239 exist if !HAVE_CONFIG_H.
240 In diagnostics, quote invalid operands to -n and -s options.
241 Allow T, P, E, Z, and Y suffixes in -s operand.
242 flags.verbose is now a boolean, not a counter.
243 Use STDOUT_FILENO instead of 1, for clarity.
246 Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
249 * src/dd.c: Include xstrtol.h.
250 (parse_integer): Migrate most of the work into the new xstrtoumax fn.
252 * lib/xstrtoumax.c: New file.
254 1999-04-18 Jim Meyering <meyering@ascend.com>
256 * src/dd.c (main): Open the output file with *read* access
257 only if we might need to read to satisfy a `seek=' request.
258 From Matthias Urlichs.
260 1999-04-10 Jim Meyering <meyering@ascend.com>
262 * Makefile.maint (alpha): Add trailing slash for ncftp.
266 * configure.in (AC_OUTPUT): Add tests/dd/Makefile.
267 * tests/Makefile.am (SUBDIRS): Add dd.
268 * tests/dd: New directory
269 * tests/dd/misc: New file.
271 `ls --color' would segfault
272 * src/ls.c: Include assert.h.
273 (color_indicator[]): Add an entry for the type, `door.'
274 (main): Assert that the lengths of the color_indicator and
275 indicator_name arrays are appropriately related.
276 Reported by John Gotts.
278 * src/dd.c (scanargs): Fix bug introduced with last change: now that
279 the loop is gone, manually decrement argc and increment argv.
280 Reported by Andreas Jaeger and jvogel@linkny.com.
282 1999-04-07 Jim Meyering <meyering@ascend.com>
284 * lib/getdate.y (difftm): Protoize.
286 1999-04-06 Jim Meyering <meyering@ascend.com>
288 * lib/strftime.c: Update from master source in libc.
290 1999-04-04 Jim Meyering <meyering@ascend.com>
292 * tests/ln/misc: Comment out the test added on 1999-01-31.
294 * Makefile.maint (url_dir_list): Define properly.
295 (real_dir_list): Likewise.
297 * src/shred.c: Don't include string.h.
298 [!HAVE_CONFIG_H]: Include string.h here.
299 [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
300 (sigill_handler): Change return type and type of local `oldhandler' to
302 (isaac_seed_machdep): Change and type of local `oldhandler' to
308 * tests/cp/same-file: Change the sed command used to extract the
309 filename from ls -l output, to accommodate the change in format.
311 * src/ls.c (print_long_format): Add a space between %s and %3u. This
312 assures that even when modebuf has the trailing `+' and there are more
313 than 99 hard links to a file, the permissions string and the link count
316 1999-04-03 Jim Meyering <meyering@ascend.com>
318 * src/shred.c (dopass): add curly braces to avoid warning about
320 (wipefd): Add parentheses suggested by gcc.
321 (do_wipefd): Remove declaration of unused local.
323 1999-04-02 Colin Plumb <colin@nyx.net>
325 * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
326 to allow standalone compilation.
328 (wipefile): Added support for emulating /dev/fd/# files even if
329 the OS doesn't support them. From Paul Eggert.
331 (main, usage): Changed --device short option to -D.
333 (wipefd, do_wipefd): Renamed function to do_wipefd and added
334 separate wipefd that performs sanity checks on externally-opened file
335 descriptors, such as not append-only. From Paul Eggert.
337 (do_wipefd, isaac_seedfd): Do not read file for any reason.
338 if the file is low-entropy, it's a security hole.
339 (wipefile) Changed to open O_WRONLY and chmod to write-only when
341 (isaac_seedfd) Function deleted as unnecessary.
344 (dopass): Dynamically fall back to fsync() if fdatasync() fails,
345 since POSIX, in their infinitesimal wisdom, encourage implementations
346 that return constant -1, making compile-time testing useless.
349 (dopass): Changed to support a size of -1 to mean "unknown".
350 This entailed changing to a counting-up offset rather than couting-down
351 cursize for the central state variable. Also changed size argument to
352 be call-by-reference so that it can be passed back once known.
353 (sizer) Function deleted as unnecessary.
354 (wipefd): Changed to match. From Paul Eggert
356 (dopass): Try to skip over bad blocks in destination files.
357 Also added ftruncate() for more complete destruction of metadata.
359 (main, usage): Changed "-" to stand for standard output.
360 (wipefd): Added error message to detect conflict with -v.
362 (dopass): Added periodic fsync() calls to keep the pass progress
363 display in sync with reality. Hopefully they're sufficiently far spaced
364 that throughput isn't affected. It might be a good thing to do even in
365 non-verbose mode, to avoid filling up the kernel caches with dirty data.
366 Also added ftruncate() for more complete destruction of metadata.
368 (quotearg_colon): New function to print
369 pathological filenames properly.
370 [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
371 that does most of the work.
372 (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
373 (wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
374 Error messages are also in a more uniform format.
377 (struct Options, main, do_wipefd): Added -s/--size=N flag.
378 (xstrtoul): Added support for valid_suffixes to help this.
379 (usage) Documented it.
381 (error): Changed some arguments from N_() to _(), since error()
382 does not translate its argument. I think this is a bug.
384 (struct Options do_wipefd, wipefd, wipefile, main): moved passes
385 argument into the Options structure as n_iterations, which is now a
386 size_t. From Paul Eggert.
388 (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
389 to manage seeding of RNG with arbitrary-sized data.
390 (isaac_init): commented out as dead code.
391 (isaac_seed): changed to use new functions to prevent any possibility of
394 (isaac_seed): Added support for Solaris' gethrtime()
395 configure.in: Corresponding feature test. From Paul Eggert.
397 (wipename): Change remove() to unlink() for speed & portability.
398 Use lstat() instead of access() to see if a filename is taken. This
399 works even on dangling symlinks and avoids the suid problems of
400 access(2). From Paul Eggert.
402 (isaac_seed_machdep): New function for reading cycle counters
404 1999-04-02 Paul Eggert <eggert@shade.twinsun.com>
406 * configure.in (AC_CHECK_FUNCS): Add gethrtime.
408 * src/shred.c (isaac_seed): Don't overrun the s->mm buffer.
409 Use gethrtime if available. Don't assume that clock_gettime succeeds.
410 Put most random sources first.
412 1999-04-02 Paul Eggert <eggert@twinsun.com>
414 shred: Add new options -bcCklL and fix some porting problems.
415 Remove options -dp. Do not read output files.
417 * src/shred.c (long_opts, usage, main, wipefile): Adjust to
419 ("human.h", "quotearg.h"): New includes.
420 (struct Options): New members contents, links, n_iterations.
421 Remove allow_devices, remove_file. Change n_iterations to size_t.
423 (output_block_size): New var.
424 (usage): Declare __noreturn__ attribute.
425 (fdatasync): Define to -1 if not present, since we need to invoke both
426 fdatasync and fsync if both are present. All invokers of fdatasync
427 now try fdatasync, then fsync.
429 (isaac_seed): Use it to mix in values. Add uid, gid to mix.
430 Don't use gettimeofday, as it has too many porting problems.
431 (isaac_seedfd): Remove, since we no longer read the output files.
432 (sizefd): Remove; we now determine size by writing sequentially.
433 (dopass, wipename, wipefile, main): Clean up error messages.
434 (dopass): Keep track of offset relative to start of file, not
435 end, since we may not know how large the file is. If size is
436 negative, write until we fall off the end of the file.
437 (wipefd): Do not read output file.
438 Return 0 if successful, -1 if not; do not make a special case for
439 non-regular files, since our callers have that info now.
440 (wipename): Now static. Return errno if error.
441 (main): "-" now stands for standard output.
442 Do not shred append-only standard output.
443 (wipefile): Do not grant read permission to file when wiping it.
444 Use symbolic permission (S_IWUSR), not octal.
446 * src/system.h (S_IWUSR): Define if not already defined.
448 * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7.
449 (AC_CHECK_FUNCS): Remove gettimeofday.
451 * doc/fileutils.texi: Document recent changes.
453 1999-04-01 Jim Meyering <meyering@ascend.com>
455 * configure.in (AC_CHECK_FUNCS): Add acl.
456 (AC_CHECK_HEADERS): Add sys/acl.h.
457 * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h.
458 (struct fileinfo): New member `have_acl'.
459 (gobble_file): Initialize it.
460 (print_long_format): Use it.
461 Mostly from Alen Muzinic.
463 * src/touch.c (open_maybe_create): New function.
464 (touch): Rewrite not to use `creat' and to eliminate a race
465 condition that could make touch truncate a nonempty file.
466 Report and suggestions from Andrew Tridgell.
468 1999-03-31 Jim Meyering <meyering@ascend.com>
470 * src/du.c: Remove prototypes and tsort function definitions.
472 * src/chown.c (main): Move the declaration of `e' into the scope
473 where it's used and make it `const'.
475 * src/install.c (main): Qualify a char* with the `const' keyword.
476 (install_file_in_dir): Likewise.
477 * src/ln.c (main): Likewise.
478 * src/mkdir.c (main): Likewise.
479 * src/mkfifo.c (main): Likewise.
480 * src/mknod.c (main): Likewise.
481 * src/mv.c (main): Likewise.
482 * src/touch.c (touch): Likewise.
484 1999-03-30 Jim Meyering <meyering@ascend.com>
486 * src/*.c: Don't include closeout.h or version-etc.h explicitly.
487 Now, they're included via sys2.h.
489 1999-03-29 Jim Meyering <meyering@ascend.com>
491 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
492 the catch-all for shared autoconf code, m4/jm-macros.m4.
493 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
496 1999-03-29 Paul Eggert <eggert@twinsun.com>
498 Minor lint removal in code that forks and execs.
500 * lib/mkdir.c (mkdir): Use pid_t instead of int; check status
501 against zero. This is to improve portability.
502 * lib/rename.c (rename): Likewise.
503 * lib/rmdir.c (rmdir): Likewise.
505 * lib/rename.c (rename):
506 (rename): Do not print any error messages, so that the messages
507 are internationalized properly.
509 * src/install.c (strip): Use standard "cannot fork" message.
510 Check for strip nonzero exit status.
512 1999-03-28 Jim Meyering <meyering@ascend.com>
514 `chmod =OP' did not properly apply the umask
515 * lib/modechange.c (make_node_op_equals): New function.
516 (mode_append_entry): Likewise.
517 (mode_compile): When none of [ugoa] is specified in an `=OP' change
518 mode request, insert a `=0' entry into the linked list so that all
519 bits are cleared first. Use the new functions.
520 Reported by Andrew Dalke.
522 New test for the above.
523 * configure.in (AC_OUTPUT): Add tests/chmod/Makefile.
524 * tests/Makefile.am (SUBDIRS): Add chmod.
525 * tests/chmod: New directory
526 * tests/chmod/equal-x: New file.
528 1999-03-27 Jim Meyering <meyering@ascend.com>
530 * lib/modechange.c (mode_compile): Upon allocation failure, free
531 everything starting with the head, not the tail.
533 * src/install.c (strip): Use pid_t, not int. From John Bley.
535 1999-03-26 Jim Meyering <meyering@ascend.com>
537 * src/dd.c (PROGRAM_NAME, AUTHORS): Define
538 (long_options): Remove unused struct.
539 (scanargs): Remove useless loop.
540 (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
541 * src/mvdir.c: Likewise.
542 * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use.
544 1999-03-25 Jim Meyering <meyering@ascend.com>
546 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
547 (noinst_HEADERS): Add version-etc.h.
549 * lib/long-options.c (parse_long_options): Remove version-, copyright-,
550 and author-printing code. Do it via version_etc.
552 * lib/version-etc.c: New file.
553 * lib/version-etc.h: Prototype for same.
555 * src/sys2.h (GETOPT_HELP_CHAR): Define.
556 (GETOPT_VERSION_CHAR): Define.
557 (GETOPT_HELP_OPTION_DECL): Define.
558 (GETOPT_VERSION_OPTION_DECL): Define.
559 (case_GETOPT_HELP_CHAR): Define.
560 (case_GETOPT_VERSION_CHAR): Define.
562 * src/chgrp.c: No longer include long-options.h.
563 Include version-etc.h instead.
564 (PROGRAM_NAME, AUTHORS): Define.
565 [long_options]: Add entries for --help and --version.
566 Remove parse_long_options call.
567 (main) [getopt switch]: Add a case for each of --help and --version.
568 * src/chgrp.c: Likewise.
569 * src/chmod.c: Likewise.
570 * src/cp.c: Likewise.
571 * src/df.c: Likewise.
572 * src/dircolors.c: Likewise.
573 * src/du.c: Likewise.
574 * src/install.c: Likewise.
575 * src/ln.c: Likewise.
576 * src/ls.c: Likewise.
577 * src/mkdir.c: Likewise.
578 * src/mkfifo.c: Likewise.
579 * src/mknod.c: Likewise.
580 * src/mv.c: Likewise.
581 * src/rm.c: Likewise.
582 * src/rmdir.c: Likewise.
583 * src/shred.c: Likewise.
584 * src/touch.c: Likewise.
586 1999-03-24 Jim Meyering <meyering@ascend.com>
588 * man/help2man: Import version 1.010.
590 1999-03-22 Jim Meyering <meyering@ascend.com>
592 * src/chmod.c (usage): Add one-liner. Suggestion from Karl Berry.
594 1999-03-19 Jim Meyering <meyering@ascend.com>
596 * src/automake-wrap: Rewrite the automake-generated rule for
597 clean-binPROGRAMS so that it removes rm even with a losing PATH on a
598 losing system (PATH with `.' before /bin on a system where you can't
599 unlink a running executable). Reported by William Bader.
601 * configure.in: Use jm_WINSIZE_IN_PTEM.
602 * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h.
603 Required by SCO ODT 2.0 systems. Reported by William Bader.
605 1999-03-18 Jim Meyering <meyering@ascend.com>
607 * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert.
608 (remove_init): Call hash_initialize with one more argument.
610 1999-03-15 Jim Meyering <meyering@ascend.com>
612 Revamp to allow fine-tuning to control when and by how
613 much the table grows and shrinks.
614 * lib/hash.c (next_prime): Don't assert.
615 (hash_reset_tuning): New function.
616 (check_tuning): New function.
617 (hash_initialize): Accept and use new tuning parameter.
618 (hash_rehash): Rewrite, updating for tuning.
619 (hash_insert): Honor tuning semantics.
620 (hash_delete): Likewise.
621 From François Pinard.
623 * lib/hash.h (struct hash_tuning): Define.
624 (struct hash_table) [tuning]: Add member.
625 (hash_initialize): Add `tuning' parameter.
627 * lib/hash.c (hash_insert): Remove last parameter and change semantics.
628 * lib/hash.h (hash_insert): Update prototype.
630 * lib/hash.c (hash_insert): Don't increment n_entries unconditionally --
631 otherwise, we'd do so even when the insertion failed.
632 From François Pinard.
634 1999-03-07 Jim Meyering <meyering@ascend.com>
636 * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't
637 have to be scanned for % signs. Suggestion from François Pinard.
639 * Makefile.maint: Add two more URLs and the loops to use them.
641 * lib/long-options.c (parse_long_options): Include `Copyright...' line
643 Add the `...NO warranty...' message.
645 1999-03-03 Jim Meyering <meyering@ascend.com>
647 * lib/long-options.c (_): Define it.
648 (parse_long_options): Accept new parameter, authors, and print it.
650 * lib/long-options.h: Update prototype.
652 * src/chgrp.c: Include long-options.h
653 [long_options]: Remove the "help" and "version" entries.
654 (main): Use parse_long_options, including author name(s).
655 Remove the show_version and show_help blocks.
656 * src/chmod.c: Likewise.
657 * src/chown.c: Likewise.
658 * src/cp.c: Likewise.
659 * src/dd.c: Likewise.
660 * src/df.c: Likewise.
661 * src/dircolors.c: Likewise.
662 * src/du.c: Likewise.
663 * src/install.c: Likewise.
664 * src/ln.c: Likewise.
665 * src/ls.c: Likewise.
666 * src/mkdir.c: Likewise.
667 * src/mkfifo.c: Likewise.
668 * src/mknod.c: Likewise.
669 * src/mv.c: Likewise.
670 * src/mvdir.c: Likewise.
671 * src/rm.c: Likewise.
672 * src/rmdir.c: Likewise.
673 * src/shred.c: Likewise.
674 * src/sync.c: Likewise.
675 * src/touch.c: Likewise.
677 1999-02-18 Paul Eggert <eggert@twinsun.com>
679 * getdate.y: <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
680 The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
682 1999-02-17 Jim Meyering <meyering@ascend.com>
684 * src/shred.c (wipename): Fix string thinko. Now, shredding files
685 in subdirectories works (dir/file). From Janos Farkas.
687 1999-02-13 Jim Meyering <meyering@ascend.com>
689 * src/dircolors.c (dc_parse_stream): Don't try to dereference
690 NULL if there's an error in our built-in list.
691 Suggestion from François Pinard.
693 1999-02-13 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
695 * src/install.c (main): Set x.backup_type only if backups are requested.
696 (cp_option_init): Initialize backup_type.
697 (backup_type): Remove unused variable.
699 * doc/fileutils.texi: Fix use of @item vs @itemx.
701 1999-02-08 Jim Meyering <meyering@ascend.com>
703 * src/dircolors.c (slack_codes): Add "DOOR".
704 (ls_codes): Add corresponding "do".
705 Reported by John Gotts.
707 * configure.in (ALL_LINGUAS): Add Italian (it).
709 1999-02-07 Jim Meyering <meyering@ascend.com>
711 * Version 4.0d (aka 4.1-b4).
713 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
714 is hooked up to the distcheck rule.
715 * Makefile.am (distcheck-hook): New target and rule -- link to shared
716 rule, my-distcheck, in Makefile.maint.
718 * doc/fileutils.texi (shred invocation): New section. From Colin Plumb.
720 * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file,
721 group-member.m4, and just use this new macro.
722 Use `.$ac_objext', not the literal `.o'.
724 1999-02-02 Jim Meyering <meyering@ascend.com>
726 * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR):
727 Define to zero if not already defined.
728 (HAVE_SYMLINKS): Define.
729 (gobble_file): Remove #ifdef.
730 (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS
731 rather than #ifdef S_ISLNK.
732 (print_type_indicator): Remove #ifdefs and reorganize.
733 (print_color_indicator): Remove #ifdefs.
734 (length_of_file_name_and_frills): Likewise.
736 1999-02-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
738 * src/dircolors.hin: Handle DOOR.
740 * src/ls.c (print_type_indicator): Print doors as '>'.
741 (length_of_file_name_and_frills): Account for this.
742 (indicator_no): Define C_DOOR.
743 (indicator_name): Add corresponding name.
745 * lib/filemode.c (ftypelet): Handle doors.
747 * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing.
749 1999-02-01 Jim Meyering <meyering@ascend.com>
751 * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro
752 argument list. From Akim Demaille.
754 1999-01-31 Jim Meyering <meyering@ascend.com>
756 * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of
757 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
759 * tests/ln/misc: Add test for this.
760 * src/ln.c (do_link): Allow creation of a hard link to a dangling
761 symlink. Reported by Alexey Solovyov.
763 * src/copy.c (copy_internal): Describe any backup-related renaming
764 operations when in verbose mode.
765 (copy_internal): Likewise.
766 Based on changes from Marty Leisner.
768 * lib/lchown.c: Declare chown.
770 1999-01-30 Jim Meyering <meyering@ascend.com>
772 * acconfig.h: Remove uintmax and STAT* #undefs.
773 * configure.in: Require autoconf 2.13.
775 Use 3-argument form of AC_DEFINE*.
777 1999-01-28 Jim Meyering <meyering@ascend.com>
779 * po/POTFILES.in: Add src/shred.c.
781 * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than
782 TM_IN_SYS_TIME based one (for shred).
784 * acconfig.h: Remove lots of `#undef's, now that we use the
785 3-argument forms of AC_DEFINE* macros.
787 1999-01-25 Jim Meyering <meyering@ascend.com>
789 * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of
791 (AC_CHECK_FUNCS): Add clock_gettime.
793 * src/shred.c (isaac_seed): Guard clock_gettime with test of
794 HAVE_CLOCK_GETTIME, not CLOCK_REALTIME.
795 (wipename): Rename local dirfd to dir_fd to avoid shadowing the
796 function declared in Linux's dirent.h.
798 1999-01-25 Akim Demaille <demaille@inf.enst.fr>
800 * lib/argmatch.h (ARRAY_CARDINALITY): Define.
801 (ARGMATCH_ASSERT): New macro.
803 * lib/argmatch.c (program_name): Remove dcl.
805 (argmatch_invalid): Use error rather than fprintf.
807 1999-01-24 Jim Meyering <meyering@ascend.com>
809 * src/ansi2knr.c: Exit nonzero upon failed write to stdout.
810 New version from L. Peter Deutsch.
812 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
813 (and hence that of the local `n1', too) to `int' at Paul's request.
815 * lib/closeout.c: Add comments.
817 * src/shred.c (fdatasync): Remove function. instead, ...
818 (fdatasync) [! HAVE_FDATASYNC]: Define to fsync.
821 1999-01-23 Jim Meyering <meyering@ascend.com>
823 * src/Makefile.am (bin_PROGRAMS): Add shred.
824 * src/shred.c: New file.
827 (wipename): Print the `FILE: deleted' and `FILE: deleting' messages
828 only when in verbose mode.
829 (fdatasync) [! HAVE_FDATASYNC]: New function.
831 * man/Makefile.am (man_MANS): Add shred.1.
832 * man/Makefile.summ (shred-summary): Define.
833 * man/shred.x: New file.
835 * src/shred.c: New file. From Colin Plumb.
836 Include config.h, getopt.h, system.h and error.h.
837 Use #else/#if, not #elif.
839 1998-11-05 Paul Eggert <eggert@twinsun.com>
841 * lib/mktime.c (__mktime_internal): Adopt the traditional (and
842 problematic) notion of what to do when tm_isdst doesn't match.
844 1999-01-17 Jim Meyering <meyering@ascend.com>
846 * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather
847 than setting RM and CP.
848 * tests/cp/*: Now that PATH is set properly, use rm and cp rather
851 * tests/ln/Makefile.am (TESTS): Add backup-1.
852 (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN.
853 * tests/ln/*: Now that PATH is set properly, use ln rather than $LN.
854 * tests/ln/backup-1: New test for this.
855 * src/ln.c (do_link): Try to remove DEST even after renaming it.
856 This fixes a bug reported by Jamie Lokier.
858 * src/ln.c (same_name): Use SAME_INODE rather than open coding it.
860 1999-01-16 Jim Meyering <meyering@ascend.com>
862 * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it.
864 * acconfig.h: Remove @BOTTOM@ section.
865 Instead, add the define and decl via m4/jm-macros.m4.
867 * src/ls.c: Don't declare base_name.
868 Use function-style XARGMATCH once again.
869 * src/touch.c: Likewise.
870 * acconfig.h: Add a @BOTTOM@ section.
871 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
875 * src/cp.c: Remove declarations of base_name and get_version.
876 (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it.
877 Use xget_version and function-style XARGMATCH.
878 * src/mv.c (main): Likewise.
879 * src/ln.c (main): Likewise.
880 * src/install.c (main): Likewise.
881 * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type
882 unsigned int, not just int.
883 * lib/backupfile.h (get_version): Adjust prototype.
884 (xget_version): Add prototype.
885 (base_name): Remove prototype.
886 * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv.
887 (backup_args): Reorder enum members.
888 (backup_types): Likewise.
889 (get_version): Take an additional parameter, `context'.
890 (xget_version): Like get_version, but if the `version' argument is NULL,
891 use the value of the envvar VERSION_CONTROL.
892 (base_name): Declare.
893 Mostly from Akim Demaille.
895 * lib/addext.c: (base_name): Declare.
896 * src/sys2.h: Add prototype for base_name.
898 * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
899 * lib/argmatch.h: Likewise.
901 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
902 (XARGCASEMATCH): Likewise.
904 * lib/argmatch.c (EXIT_FAILURE): Define.
905 (ARGMATCH_DIE): Provide default.
906 (__xargmatch_internal): New function.
907 s/rogram_name/program_name.
910 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
912 * src/touch.c (usage): Don't make it static so that it can be
913 called from libfu.a by xargmatch.
914 * src/chgrp.c (usage): Likewise
915 * src/chmod.c (usage): Likewise
916 * src/chown.c (usage): Likewise
917 * src/cp.c (usage): Likewise
918 * src/dd.c (usage): Likewise
919 * src/df.c (usage): Likewise
920 * src/dircolors.c (usage): Likewise
921 * src/du.c (usage): Likewise
922 * src/install.c (usage): Likewise
923 * src/ln.c (usage): Likewise
924 * src/ls.c (usage): Likewise
925 * src/mkdir.c (usage): Likewise
926 * src/mkfifo.c (usage): Likewise
927 * src/mknod.c (usage): Likewise
928 * src/mv.c (usage): Likewise
929 * src/mvdir.c (usage): Likewise
930 * src/rm.c (usage): Likewise
931 * src/rmdir.c (usage): Likewise
932 * src/sync.c (usage): Likewise
934 1999-01-12 Akim Demaille <demaille@inf.enst.fr>
936 * lib/backupfile.c (get_version): added the parameters KIND.
937 (xget_version): like get_version, but if argument is NULL, honor
938 the envvar VERSION_CONTROL.
939 * src/cp.c: Remove declarations of base_name and get_version.
940 (main): Use xget_version.
941 * src/mv.c (main): Likewise.
942 * src/ln.c (main): Likewise.
943 * src/install.c (main): Likewise.
945 1999-01-12 Jim Meyering <meyering@ascend.com>
947 * configure.in (ALL_LINGUAS): Add Greek (el).
948 * po/el.po: New file.
950 * install-sh: New version from autoconf.
951 * missing: New version from automake.
952 * src/ansi2knr.c: Likewise.
953 * lib/getopt.c: New version from glibc.
954 * lib/getopt.h: Likewise.
955 * lib/getopt1.c: Likewise.
956 * lib/regex.c: Likewise.
957 * lib/regex.h: Likewise.
958 * lib/ylwrap: Remove unused file.
960 1999-01-10 Jim Meyering <meyering@ascend.com>
962 * Version 4.0c (aka 4.1-b3).
964 * Upgrade to autoconf-2.13 and automake-1.3b.
966 * src/copy.c (copy_internal): Handle two more values of errno from
967 failed rename of a directory into a subdirectory of itself.
968 Thanks to Volker Borchert for testing many types and combinations
971 * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style
972 to escape_quoting_style.
973 (argmatch_invalid): Now that the quoted quantity is no longer double
974 quoted, remove the code that removed leading and trailing double quotes.
976 * src/ls.c (decode_switches): Now that escape_quoting_style no longer
977 escapes the SPACE character, arrange for SPACEs to be quoted here.
978 * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that
979 it no longer escapes ` '.
980 Suggestion from Paul Eggert.
982 1999-01-05 Jim Meyering <meyering@ascend.com>
984 * configure.in (space): Add `for' in message of statvfs check.
987 1999-01-04 Jim Meyering <meyering@ascend.com>
991 1999-01-02 Jim Meyering <meyering@ascend.com>
993 * lib/argmatch.c (argmatch_invalid): Remove double quotes from the
994 offending quoted argument before using it in explanatory diagnostic.
995 Use a single fprintf stmt.
997 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
998 modify a parameter. Add a `Die_stmt' parameter.
1000 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
1001 (argmatch_to_argument): Add `const' attribute to first parameter.
1003 * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's
1004 done in m4/jm-macros.m4).
1006 * lib/backupfile.c (get_version): Adapt to use new interface to
1008 * src/cp.c: Likewise.
1009 * src/ls.c: Likewise.
1010 * src/touch.c: Likewise.
1012 1999-01-01 Jim Meyering <meyering@ascend.com>
1014 * lib/makepath.c (make_dir): New function, factored out of make_path.
1015 (make_path): Use make_dir rather than open-coding it twice.
1016 This effectively reverses the order of the latter pair of stat/mkdir
1017 calls and fixes a race condition bug whereby one of two concurrent
1018 `mkdir -p' processes could fail with EEXIST.
1019 Include locale.h and libintl.h, and define `_()'.
1020 Mark translatable strings.
1022 * lib/xmalloc.c: Add comments.
1023 (xcalloc, xmalloc, xrealloc): Remove prototypes.
1024 (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function.
1025 * lib/xalloc.h: Add comments.
1026 (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define.
1027 (xcalloc, xmalloc, xrealloc): Add prototypes here.
1028 Based on changes from Akim Demaille.
1030 * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing.
1031 (quotearg_n): Change type of 1st parameter from int to unsigned int.
1032 (quotearg_n_options): Likewise.
1033 * lib/quotearg.h (quoting_style_vals): New public array.
1035 (quotearg_n_options): Declare `options' parameter to be `const'.
1037 * lib/human.c (humblock): Use ARGMATCH in place of argmatch.
1039 * lib/backupfile.c (get_version): Use XARGMATCH in place of
1042 1998-12-31 Jim Meyering <meyering@ascend.com>
1044 * src/ls.c (indicator_style_types): New variable.
1045 (format_types): Rename from `formats'.
1046 (color_args): Remove unnecessary `no' string.
1047 (color_types): Remove corresponding `color_never' entry.
1048 (main): Use ARGMATCH_TO_ARGUMENT.
1049 (decode_switches): Use ARGMATCH instead of argmatch code
1050 in each of several cases.
1053 * src/cp.c (main): Use XARGMATCH in place of argmatch & co.
1054 * src/touch.c (main): Likewise.
1055 * lib/backupfile.c (get_version): Likewise.
1058 * lib/strncasecmp.c: New file.
1059 * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too.
1060 * lib/argmatch.c (strncasecmp): Move to a separate file.
1061 Add curly braces around some one-stmt-but-multiline blocks.
1063 * lib/argmatch.c: Improvements from Akim Demaille.
1064 * lib/argmatch.h: Likewise.
1066 * lib/addext.c (addext): Protoize.
1067 Indent cpp directives to match nesting.
1069 Fix warnings from gcc -W -Wall
1070 * lib/posixtm.c (posix_time_parse): Change type of index `i' from
1071 int to unsigned int.
1072 * lib/getdate.y (__attribute__): Define.
1073 (ATTRIBUTE_UNUSED): Define.
1074 (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
1075 (MonthDayTable): Add initializers for last entry.
1076 (UnitsTable): Likewise.
1077 (OtherTable): Likewise.
1078 (MilitaryTable): Likewise.
1080 1998-12-22 Jim Meyering <meyering@ascend.com>
1084 * configure.in (ALL_LINGUAS): Add chinese (zh).
1086 1998-12-19 Jim Meyering <meyering@ascend.com>
1088 * tests/ln/misc: Use absolute path for final rm.
1090 * Makefile.maint (my-distcheck): Run make with
1091 CFLAGS='-Wformat -Werror'.
1093 1998-12-18 Jim Meyering <meyering@ascend.com>
1095 * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix
1096 from format string. From Michiel Bacchiani.
1098 * src/chgrp.c (MAXGID): Define.
1099 Use gid_t (not int) as the type for `group' variables.
1100 (parse_group): Use MAXGID, not INT_MAX.
1102 * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions.
1103 * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead.
1105 1998-12-13 Jim Meyering <meyering@ascend.com>
1107 * lib/Makefile.am (EXTRA_DIST): Add xstat.in.
1109 1998-12-12 Jim Meyering <meyering@ascend.com>
1111 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
1112 * src/ls.c: Group DIRED's code together.
1113 (full_time, inhibit_group, col_ext_type): Declare static.
1114 (dired_dump_obstack): Apply sizeof to variable, instead of its type.
1115 (parse_ls_color): Rename ext2 as e2. Move into the block where it
1118 1998-10-15 Akim Demaille <demaille@inf.enst.fr>
1119 * src/ls.c: In order to distinguish col(umn|or):
1120 (init_column_info): Renamed from init_col_info.
1121 (struct column_info): Renamed from struct col_info.
1122 (struct color_ext_type): Renamed from struct col_ext_type.
1124 1998-12-11 Jim Meyering <meyering@ascend.com>
1126 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
1128 * lib/stat.c: Remove file.
1129 * lib/lstat.c: Remove file.
1130 * lib/xstat.in (xstat@): New file.
1132 * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'.
1134 * tests/ls-2/tests: Add a test for this.
1136 * man/help2man: import version 1.006.
1138 1998-12-07 Jim Meyering <meyering@ascend.com>
1140 * src/copy.c: Use dir_name, not dirname. Include dirname.h.
1141 * src/cp.c: Likewise.
1142 * src/df.c: Likewise.
1143 * src/install.c: Likewise.
1144 * src/ln.c: Likewise.
1145 * src/mvdir.c: Likewise.
1147 * lib/dirname.c (dir_name): Rename from dirname.
1148 Make argument `const'. Include "dirname.h"
1149 * lib/dirname.h: New file.
1150 * lib/Makefile.am (noinst_HEADERS): Add dirname.h.
1152 1998-12-06 Jim Meyering <meyering@ascend.com>
1154 * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use
1155 `^[yY]' and `^[nN]' (avoiding regex). From Karl Heuer.
1157 * lib/*.c: Ansideclify.
1159 Fix `ls -R .' formatting bug that broke mktexlsr.
1160 * src/ls.c: Include path-concat.h.
1161 (basename_is_dot_or_dotdot): New function, derived from
1162 is_not_dot_or_dotdot.
1163 (is_not_dot_or_dotdot): Remove function.
1164 (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot'
1165 instead of is_not_dot_or_dotdot and use path_concat instead of attach.
1167 * tests/ls-2/tests: New file (renamed from quoting),
1168 with new test for the `ls -R .' fix.
1169 * tests/ls-2/quoting: Remove file.
1170 * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/.
1172 1998-11-29 Jim Meyering <meyering@ascend.com>
1174 * src/remove.c (DOT_OR_DOTDOT): Move definition from this file...
1175 * src/sys2.h (DOT_OR_DOTDOT): ...to this one.
1177 * src/dd.c (dd_copy): Rename function from `copy'.
1179 * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/.
1181 Per Kristian Hove reported that a certain move-directory-into-self
1182 wasn't properly diagnosed.
1184 * tests/mv/into-self-3: New file.
1185 * tests/mv/Makefile.am (TESTS): Add into-self-3.
1186 * src/copy.c (copy_internal): Remove earlier (but less effective)
1187 test for move/copy-into-self.
1188 Instead, deduce the move-into-self condition from errno==EINVAL
1189 after a failed rename.
1190 * src/mv.c (do_move): Don't arrange to remove DEST in the
1191 copied-into-self case.
1193 1998-11-15 Jim Meyering <meyering@ascend.com>
1195 Bob McCracken reported that mv couldn't handle certain combinations
1196 of hard linked source files.
1198 * tests/mv/hard-link-1: New file.
1199 * tests/mv/Makefile.am (TESTS): Add hard-link-1.
1200 * src/mv.c (movefile): Don't free new_dest.
1202 * lib/error.c (error): Don't use strerror_r's return value.
1203 From Johan Danielsson.
1205 1998-11-14 Jim Meyering <meyering@ascend.com>
1209 * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag
1210 to avoid matching a prefix of another tag.
1212 1998-11-10 Jim Meyering <meyering@ascend.com>
1214 * configure.in (ALL_LINGUAS): Add Greek (el).
1215 * po/el.po: New file.
1217 1998-11-07 Jim Meyering <meyering@ascend.com>
1221 Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't
1222 work on Hurd systems because of an inline definition of lstat in a
1223 system header file). This also makes it so that you may run `ls '' '
1224 on systems that let l?stat operate on the empty string.
1226 * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat
1227 and declare the latter.
1228 * lib/stat.c [stat]: Remove #undef.
1229 (rpl_stat): Protoize.
1230 * lib/lstat.c [lstat]: Remove #undef.
1231 (rpl_lstat): Protoize. Use ENOENT, not EINVAL, to be consistent
1233 * acconfig.h: Remove #undef's for lstat and stat.
1235 1998-10-31 Jim Meyering <meyering@ascend.com>
1237 * tests/rm/Makefile.am (TESTS): Add new test `empty-name',
1239 * tests/rm/empty-name: New file.
1241 * acconfig.h (stat): New #undef.
1242 This omission was uncovered when Mark Kettenis reported that
1243 `rm -r ''' got a failed assertion on the Hurd. This change
1244 doesn't fix *that* problem -- see above.
1246 1998-10-25 Jim Meyering <meyering@ascend.com>
1250 * README: Man pages will now be supported to the extent that
1251 people send patches.
1253 * tests/rm/unreadable: Two new tests.
1254 * tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
1255 it out since we're so close to release and since the test compares the
1256 text of diagnostics that are likely to vary between systems.
1257 (TEST_ENVIRONMENT): Add required framework.
1259 * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
1260 pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
1261 Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
1262 (remove_dir): Return `status', rather than always RM_OK.
1264 1998-10-18 Jim Meyering <meyering@ascend.com>
1268 * lib/mktime.c: Update from libc with this additional change from Paul.
1269 * lib/strftime.c: Likewise.
1271 1998-10-17 Paul Eggert <eggert@twinsun.com>
1273 Don't invoke localtime_r or gmtime_r unless it's the GNU C
1274 library's localtime_r and gmtime_r; there are too many buggy
1275 implementations of localtime_r and gmtime_r out there, and
1276 it's not worth keeping track of all the different bugs.
1278 * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove.
1279 (my_mktime_localtime_r): Renamed from localtime_r; all uses changed.
1280 Base it on localtime unless _LIBC.
1282 * strftime.c (__EXTENSIONS__): Remove.
1283 (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
1284 (my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
1285 Base them on localtime/gmtime if not _LIBC.
1287 1998-10-17 Jim Meyering <meyering@ascend.com>
1291 * lib/mktime.c: Declare localtime_r if necessary.
1292 * lib/strftime.c: Likewise.
1294 * tests/Fetish.pm (run_tests): Run $prog with --version only
1297 1998-10-11 Jim Meyering <meyering@ascend.com>
1301 1998-10-08 Paul Eggert <eggert@twinsun.com>
1303 * mktime.c (__mktime_internal): When the requested time falls
1304 in a spring-forward gap of size DT, return a time that is DT
1305 away from the requested time, preferring a time whose tm_isdst
1306 differs from the requested value. Bump the max number of
1307 probes from 4 to 6 to account for the extra probes needed to
1308 discover a spring-forward gap in the worst case.
1310 1998-10-08 Paul Eggert <eggert@twinsun.com>
1312 * mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
1313 Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
1314 a body that merely expands localtime_r; this works around a
1315 bug in Digital Unix 4.0A and 4.0D.
1317 1998-10-05 Jim Meyering <meyering@ascend.com>
1319 * po/Makefile.in.in (uninstall): Remove (historical?) command that
1320 removed po-Makefile.in.in. From Akim Demaille.
1322 * src/install.c (long_options): Add entry for --suffix=SUFFIX option.
1325 1998-10-04 Jim Meyering <meyering@ascend.com>
1327 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
1330 1998-10-03 Jim Meyering <meyering@ascend.com>
1334 * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
1336 * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
1337 Instead, depend on corresponding source file and on configure.in.
1338 Based on suggestion and code from Akim Demaille.
1339 Factor out irregular men into Makefile.summ.
1341 * man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
1343 * man/Makefile.summ: New file.
1344 * man/Makefile.maint: Include it.
1346 * tests/Fetish.pm: Make `DEBUG' be a little more verbose.
1348 * tests/mv/Makefile.am (TESTS): Add i-1.
1349 * tests/mv/i-1: New test.
1351 1998-10-02 Jim Meyering <meyering@ascend.com>
1353 * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
1354 * tests/ls-2/run-test: Remove file.
1355 * tests/ls-2/quoting: Include /bin/sh driver framework.
1357 * tests/dircolors/simple: Remove file.
1358 * tests/dircolors/run-test: Embed it here instead.
1359 * tests/dircolors/simple: Rename from run-test.
1361 1998-10-01 Jim Meyering <meyering@ascend.com>
1363 * tests/Makefile.am (EXTRA_DIST): Remove README.
1366 1998-09-28 Jim Meyering <meyering@ascend.com>
1370 * Use automake-1.3b. See notes in README.
1372 * src/copy.c (copy_internal): Do honor `n' reply in move-mode.
1373 Otherwise, `touch a b; echo n|mv -i a b' would remove b.
1376 1998-09-27 Jim Meyering <meyering@ascend.com>
1380 * Makefile.maint (alpha): New target.
1381 (my-distcheck): Tweak.
1383 * lib/backupfile.h: Protect against multiple inclusion.
1386 * configure.in: Remove use of AC_FUNC_FNMATCH and associated code.
1387 Now, it is invoked through jm_MACROS.
1389 * lib/strftime.c (my_strftime): Update from FSF.
1391 1998-09-26 Jim Meyering <meyering@ascend.com>
1393 * src/copy.c (copy_internal): Don't preserve hard-linked directories
1394 to avoid damaging the destination filesystem when copying from a
1395 Netapp snapshot directory. With code from Kjetil Torgrim Hollstein
1398 1998-09-24 Jim Meyering <meyering@ascend.com>
1400 * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/.
1403 1998-09-21 Jim Meyering <meyering@ascend.com>
1405 * man/Makefile.maint ($(man_MANS)): Remove `echo'.
1407 1998-09-20 Jim Meyering <meyering@ascend.com>
1411 * src/install.c (install_file_to_path) [-D]: Create any leading
1412 directories with permissions of 0755.
1414 1998-09-19 Jim Meyering <meyering@ascend.com>
1416 * src/install.c (install_file_to_path): Copy the file after creating
1417 any leading directories.
1418 (main) [case 'v']: Set `x.verbose' to 1, not 0.
1419 Reported by Marty Leisner.
1421 * man/Makefile.am (transform): Define.
1422 (man_MANS): Include ginstall.1, not install.1, to match the name
1423 of the executable in ../src.
1424 * man/ginstall.x: New file.
1425 * man/install.x: Remove file.
1426 * man/Makefile.maint (ginstall-summary): Renamed from install-summary.
1428 * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile.
1429 Reported by Akim Demaille.
1431 * lib/modechange.c: Fix post-protoization typo.
1433 * lib/posixtm.h (PARAMS): Define and use.
1436 1998-09-12 Jim Meyering <meyering@ascend.com>
1440 * src/remove.c (remove_cwd_entries): Declare to be static.
1442 Automatically generate man pages from combination of --help
1443 output and the contents of new, man/*.x files.
1444 * man/Makefile.am (HELP2MAN): Define.
1446 (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux).
1447 (MAINTAINERCLEANFILES): Add $(man_MANS).
1448 * man/*.x: New files.
1449 * man/GNUmakefile: New file.
1450 * man/Makefile.maint: New file.
1451 * man/help2man: New file.
1453 1998-09-09 Jim Meyering <meyering@ascend.com>
1455 * lib/modechange.c: Protoize.
1457 1998-09-07 Jim Meyering <meyering@ascend.com>
1461 * src/df.c (show_dev) [!posix_format]: When using --print-type,
1462 let the device path and the file system type share a single (wider)
1463 field if their combined lengths allow it. From Andries Brouwer.
1465 * tests/touch/empty-file: Upon failure, suggest how to rerun the test
1466 with longer delay, in case NFS clock skew was the cause of the failure.
1467 Reported by Kaveh Ghazi.
1469 * tests/ls-2/quoting: Add tests.
1470 * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks.
1471 (_create_file): Don't include $$ in temp file name.
1472 (run_tests): Use shorter suffixes for temp file names.
1474 1998-09-06 Jim Meyering <meyering@ascend.com>
1476 * src/touch.c: Include posixtm.h.
1477 (usage): Correct the description of the format of the
1478 date string argument to -t option.
1479 (main): Update to use rewritten posixtime function.
1480 Reported by Andries Brouwer.
1482 * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c.
1483 (noinst_HEADERS): Add posixtm.h.
1485 * lib/posixtm.h: New file.
1486 * lib/posixtm.c: New file. Rewritten based on posixtm.y.
1487 * lib/posixtm.y: Remove file.
1489 1998-09-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1491 * src/ls.c (print_dir_name): Put back.
1492 (print_dir): Also print directory name header if print_dir_name is
1495 1998-08-29 Jim Meyering <meyering@ascend.com>
1499 * src/du.c (long_options): Use corresponding short-option character
1500 in place of `1', and `NULL' in place of pointer in initialization.
1501 * src/cp.c (long_opts): Likewise.
1502 * src/ln.c (long_options): Likewise.
1503 * src/mkdir.c (longopts): Likewise.
1504 * src/rmdir.c (longopts): Likewise.
1505 * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2
1507 * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1.
1508 * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1.
1510 * tests/Fetish.pm: New file -- moved from ls-2/.
1511 * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile.
1512 * tests/Makefile.am (SUBDIRS): Add dircolors.
1513 (EXTRA_DIST): Add Fetish.pm.
1514 * tests/dircolors: New directory
1516 * src/ls.c (print_dir_name): Remove global variable.
1517 (print_dir): When trace_dirs is set, always print the directory
1520 1998-08-26 Jim Meyering <meyering@ascend.com>
1522 * src/dircolors.c (dc_parse_stream): Don't segfault when a line
1523 contains only one token. Reported by Olav Morkrid.
1525 1998-08-24 Paul Eggert <eggert@twinsun.com>
1527 * src/system.h (CHAR_MIN, CHAR_MAX):
1528 Renamed from SCHAR_MIN, SCHAR_MAX, since these
1529 macros apply to char, not signed char.
1531 * src/df.c, src/du.c, src/touch.c (long_options, main):
1534 1998-08-18 Paul Eggert <eggert@twinsun.com>
1536 Port nanosecond-resolution times to UnixWare 2.1.2 and
1537 pedantic Solaris 2.6.
1539 * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
1540 * acconfig.h (ST_MTIM_NSEC): New #undef.
1541 * src/system.h: (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
1542 Use new ST_MTIM_NSEC macro.
1544 1998-08-16 Jim Meyering <meyering@ascend.com>
1546 * lib/filemode.h (PARAMS): Define and use.
1549 1998-08-15 Jim Meyering <meyering@ascend.com>
1553 * Makefile.maint (announcement): New target.
1555 * tests/mv/into-self: Update to reflect changed behavior of mv.
1556 * src/mv.c (do_move): Fail upon attempt to move a directory into itself.
1557 With prodding from François Pinard :-)
1559 * tests/ls-2/Fetish.pm: New file
1560 * tests/ls-2/run-test: New file
1562 * src/copy.c (copy_internal) [one-file-system]: Do copy mount point
1563 directories (but none of their entries). This makes `cp --archive
1564 --one-file-system' use the same policy `tar --one-file-system' does.
1567 * src/ls.c (qmark_funny_chars): Add comment from Paul eggert.
1569 1998-08-14 Jim Meyering <meyering@ascend.com>
1571 * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh.
1572 Reported by Christian von Roques.
1574 * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile.
1575 * tests/Makefile.am (SUBDIRS): Add ls-2.
1576 * tests/ls-2: New directory
1578 1998-08-14 Christian von Roques <roques@pond.sub.org>
1580 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't
1581 infloop on getmnt(2) returning 0.
1583 * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh,
1584 not initializing output redirection of : command.
1585 * tests/mv/backup-is-src: Likewise.
1586 * tests/rm/i-1: Likewise.
1588 1998-08-12 Jim Meyering <meyering@ascend.com>
1590 * po/Makefile.in.in: Provide automake-style DESTDIR support.
1591 From Johan Danielsson.
1592 (DISTFILES): Remove ChangeLog.
1593 po/ChangeLog: Remove empty file.
1595 * configure.in (AC_STRUCT_ST_DM_MODE): Use it.
1597 * src/ls.c: Include filemode.h.
1598 * src/chmod.c: Likewise.
1600 * lib/filemode.c (ftypelet): Add comments for Cray DMF support.
1601 From Johan Danielsson.
1602 Protoize. Tsort function definitions and remove prototypes of
1604 (mode_string): Remove prototype.
1605 * lib/filemode.h (mode_string): New file.
1606 * lib/Makefile.am (noinst_HEADERS): Add filemode.h.
1608 1998-08-09 Jim Meyering <meyering@ascend.com>
1612 1998-07-31 Paul Eggert <eggert@twinsun.com>
1614 Add support for filesystems whose timestamps have better resolution
1615 than 1 second (e.g. Solaris 2.6, recent Linux kernels).
1617 * configure.in (AC_STRUCT_ST_MTIM): Add.
1619 * src/copy.c (copy_internal): Compare time stamps with
1620 subsecond resolution if available.
1622 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
1623 rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
1624 stamps with subsecond resolution if available.
1626 * src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
1627 CTIME_CMP, MTIME_CMP): New macros.
1629 1998-08-01 Jim Meyering <meyering@ascend.com>
1631 * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no).
1633 1998-07-28 Paul Eggert <eggert@twinsun.com>
1635 * lib/mountlist.c (read_filesystem_list): Remove all_fs
1636 argument, but put the necessary information into the result so
1637 that the caller can ignore filesystems that he's not
1640 * lib/mountlist.h (struct mount_entry):
1641 New members me_dummy, me_remote.
1642 (read_filesystem_list): Remove all_fs argument.
1643 (REMOTE_FS_TYPE): Remove.
1644 (ME_DUMMY, ME_REMOTE): New macros.
1646 * lib/xstrtol.c: Remove duplicate include of <stdio.h>.
1648 * src/df.c (show_all_fs):
1649 Revert to boolean value; the old negative value is
1650 now in show_local_fs.
1651 (show_local_fs): New variable.
1652 (show_dev): New args me_dummy and me_class. Use show_local_fs
1653 and boolean show_all_fs in combination with these new args
1654 to decide whether to show a device.
1655 (show_disk): Pass flags to show_dev.
1656 (show_point): Use a non-dummy mount entry if possible.
1657 (show_all_entries): Pass flags to show_dev.
1658 (main): --local sets show_local_fs now. Ask for file system types if
1659 show_local_fs is nonzero, since ME_REMOTE might need them.
1661 1998-07-27 Jim Meyering <meyering@ascend.com>
1663 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM.
1665 * tests/install/basic-1: Add a test for this.
1666 * src/install.c: Make copy create each destination file initially
1667 with mode 0600 so strip will work, then apply specified mode.
1668 Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
1670 1998-07-25 Jim Meyering <meyering@ascend.com>
1672 * src/mv.c (chown): Remove unused definition.
1673 Reported by Kaveh Ghazi.
1675 * src/rmdir.c (main): rmdir fails with EEXIST on some systems.
1676 Handle that, so --ignore-fail-on-non-empty works.
1677 (EEXIST): Define to zero if not defined.
1678 (ENOTEMPTY): Likewise.
1680 * tests/cp/same-file: Remove `diff' I'd put in for debugging.
1681 Exit with the status from cmp.
1685 * tests/cp/same-file: Skip three more unportable tests.
1686 These failed on SunOS4.1.4.
1688 * src/copy.c (SAME_INODE): Remove definition.
1689 * src/sys2.h (SAME_INODE): Define it here instead.
1691 * src/remove.c (same_file): New function.
1692 (remove_dir): Use it to give a better diagnostic when rmdir fails
1693 because it can't remove the current directory.
1695 * src/df.c (long_options): Changes table entries not to use this form:
1696 {"all", no_argument, &show_all_fs, 1},
1697 but rather this form:
1698 {"all", no_argument, NULL, 'a'},
1699 Using the latter, all the option handling in one place: the getopt loop.
1701 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]:
1703 (fsp_to_string): Don't xmalloc return value (yet).
1704 (xatoi): Ansideclify.
1705 (fstype_to_string): Ansideclify.
1706 * lib/mountlist.h: Define and use PARAMS macro.
1708 * lib/utime.c: New file.
1709 * src/touch.c (utime_now): Moved into m4/utimes.m4.
1710 (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now
1713 * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME.
1715 1998-07-22 Paul Eggert <eggert@twinsun.com>
1717 * lib/human.c (human_readable): amt -> damt, to fix typo when
1718 computing which power to use after overflow occurs during
1721 * lib/xstrtol.c: Include <stdio.h> if NDEBUG is not defined;
1724 1998-07-21 Paul Eggert <eggert@twinsun.com>
1726 Add df -l or --local option.
1727 * doc/fileutils.texi: Document it.
1728 * lib/mountlist.h (REMOTE_FS_TYPE): New macro.
1729 * lib/mountlist.c (read_filesystem_list):
1730 If all_fs is negative, omit non-local filesytems.
1732 * src/df.c (show_dev): Omit local devices if show_all_fs is negative.
1733 (show_all_fs): If negative, omit non-local filesystems.
1734 All uses of (all_fs != 0) changed to (all_fs > 0).
1735 (long_options, usage, main): Add -l or --local option.
1736 (main): When asking for df of an explicit file name, get all
1737 the mount points, so that we're more likely to find it when
1740 1998-07-18 Jim Meyering <meyering@ascend.com>
1742 * src/copy.c (copy_internal): Add another exclusion from the
1743 sameness test: when --force has been specified, the destination
1744 is unlinked before any copy.
1745 (copy_internal): Add yet another: when both src and dest are symlinks.
1747 * tests/touch: New subdir.
1748 * tests/Makefile.am (SUBDIRS): Add touch.
1749 * configure.in (AC_OUTPUT): Add tests/touch/Makefile.
1751 * tests/mv/into-self-2: New test.
1752 * tests/mv/Makefile.am (TESTS): Add into-self-2.
1754 1998-07-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1756 * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on
1759 1998-07-16 Jim Meyering <meyering@ascend.com>
1761 Work around failure of chown calls on m68k-motorola-sysv systems.
1762 * src/chown.c: Include lchown.h.
1763 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
1764 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
1765 * lib/lchown.c: Include lchown.h.
1766 Reported by and with suggestions from Manfred Hollstein.
1768 1998-07-12 Paul Eggert <eggert@twinsun.com>
1770 * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks".
1772 1998-07-07 Jim Meyering <meyering@ascend.com>
1774 * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block.
1775 Suggestion from Ulrich Drepper.
1777 1998-07-04 Jim Meyering <meyering@ascend.com>
1779 * lib/safe-read.c (safe_read): Change type of pointer parameter to
1780 `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi.
1781 * lib/safe-read.h: Update prototype.
1783 * src/dircolors.c (parse_line): Add casts to avoid errors from
1784 Irix4's `cc' C compiler. From Kaveh Ghazi.
1786 * lib/xstrtol.c: Include stdio.h. Required on some systems when
1787 using assert. From Kaveh Ghazi.
1789 * tests/mv/backup-is-src: Use cmp, not diff.
1790 Reported by Kaveh Ghazi.
1792 1998-07-03 Jim Meyering <meyering@ascend.com>
1796 * src/remove.c (remove_dir): Use fprintf (not error) to avoid
1799 1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
1801 * lib/mountlist.c: (read_filesystem_list):
1802 Don't leak memory on failure.
1803 Don't create a dummy struct mount_entry entry;
1804 use the address-of-the-tail-address method instead.
1805 Preserve errno if possible on failure, setting it to 0 if inapplicable.
1806 Close file descriptor leak if the F_SETLKW failed.
1807 Report an error if SVR4 lock file cannot be opened for some reason
1808 other than a nonexistent lock file.
1810 1998-07-03 Jim Meyering <meyering@ascend.com>
1812 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
1813 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
1814 * acconfig.h (WITH_REGEX): Remove undef.
1815 * lib/Makefile.am (noinst_HEADERS): Add regex.h.
1816 * lib/rpmatch.c: Remove #ifdef around <regex.h> inclusion.
1817 * lib/rx.c: Remove file.
1818 * lib/rx.h: Remove file.
1820 * src/df.c (df_readable): Rename local so as not to shadow global.
1822 * src/copy.c (SAME_INODE): New macro.
1823 Use it to replace open-coded equivalents.
1824 (copy_internal): Rename variable and reverse sense of tests
1825 to make the code a little clearer.
1827 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1829 * src/copy.c (copy_internal): Try harder identifying a relative
1830 symbolic link in the current directory.
1832 * src/copy.c (copy_internal): Don't skip test for same file if
1833 creating a hardlink from symlink over a non-symlink while making
1835 * tests/cp/same-file: Skip tests that depend on link(2) not
1838 1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1840 * src/copy.c (copy_internal): Don't call chown on a symlink.
1842 1998-07-01 Jim Meyering <meyering@ascend.com>
1844 * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via
1845 configure's --disable-assert option.
1847 1998-06-29 Paul Eggert <eggert@twinsun.com>
1849 * lib/mountlist.c (read_filesystem_list):
1850 Plug file descriptor leak on failure.
1851 Report failure if lock file can't be opened for some reason
1852 other than nonexistence.
1854 1998-06-29 Jim Meyering <meyering@ascend.com>
1858 * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]:
1859 Always close stream and file descriptor before returning.
1861 * src/df.c (main): Move the test of the result of the
1862 read_filesystem_list call up out of if-block -- code in the
1863 else-block depends on it too.
1865 1998-06-29 Paul Eggert <eggert@twinsun.com>
1867 * lib/mountlist.c: (read_filesystem_list): If SVR4, lock
1868 /etc/.mnttab.lock if available, to avoid race conditions
1869 (e.g. with the automounter on Solaris 2.6).
1871 Include <errno.h>, <fcntl.h>, <unistd.h>.
1873 1998-06-29 Jim Meyering <meyering@ascend.com>
1875 * lib/mountlist.c (fstype_to_string): Guard with
1876 #if ! HAVE_F_FSTYPENAME_IN_STATFS.
1878 1998-06-28 Paul Eggert <eggert@twinsun.com>
1880 Add support for new --block-size option and
1881 BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'.
1882 Adjust df output slightly to accommodate larger filesystems.
1884 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
1885 into one, for convenience. All callers changed.
1886 (human_block_size): New function.
1887 * lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
1888 Include <stdlib.h> if HAVE_STDLIB_H;
1889 declare getenv unless HAVE_DECL_GETENV.
1891 Include <argmatch.h>, <error.h>, <xstrtoul.h>.
1892 (DEFAULT_BLOCK_SIZE): New macro.
1893 (block_size_args, block_size_types): New constants.
1894 (humblock): New function.
1895 * lib/xstrtol.h (__ZLONG_MAX): Remove.
1896 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
1897 unsigned long to double without losing information.
1898 (bkm_scale_by_power): New function.
1900 * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
1901 Add support for SI-like suffixes like "GB" and "TD".
1902 * src/dd.c (usage): Describe it.
1904 * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units):
1905 Remove; replace with new variable output_block_size. All uses changed.
1906 (long_options, usage, main): Add --block-size.
1907 (main, decode_switches): Use new human_block_size function to
1908 initialize output block size consistently with other programs.
1910 * src/df.c (print_header, show_dev): Shrink some columns and expand
1911 others, to squeeze in support for today's larger filesystems.
1912 (print_header): Print output block size using power-of-1024 SI format.
1913 (df_readable): Coalesce last two args into one, for convenience.
1914 All callers changed.
1915 (main): Remove check for portable output format and larger
1916 or human-readable block sizes.
1918 * NEWS, doc/fileutils.texi: Describe above changes.
1920 1998-06-28 Jim Meyering <meyering@ascend.com>
1922 * src/ls.c (usage): Make --kilobytes description consistent with
1923 that in du and df. From Göran Uddeborg.
1925 * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs
1926 now that we're using the jm_FSTYPENAME autoconf macro.
1927 James Tanis reported the old version didn't compile on BSDI3.
1929 * configure.in: Move big block of list_mounted_fs checks into
1930 new jm_LIST_MOUNTED_FILESYSTEMS macro.
1931 Use new jm_FSTYPENAME macro.
1933 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
1934 * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and
1937 1998-06-27 Jim Meyering <meyering@ascend.com>
1939 * src/copy.c (copy_reg): Detect identical source and dest here.
1940 (copy_internal): Make the test symmetric.
1942 * tests/cp/same-file: New file.
1943 * tests/cp/Makefile.am (TESTS): Add it.
1945 1998-06-26 Jim Meyering <meyering@ascend.com>
1947 * src/remove.c (remove_file): Remove `non-directory' part of
1948 `removing non-directory FILE' verbose message.
1950 1998-06-23 Jim Meyering <meyering@ascend.com>
1952 * src/df.c (show_dev): Increase field width for blocks, used,
1953 and available columns from 7 to 8.
1955 1998-06-21 Jim Meyering <meyering@ascend.com>
1957 * aclocal.m4: Regenerate with fixed gettext.m4 installed.
1958 See README-alpha for details.
1960 1998-06-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1962 * src/automake-wrap: Quote `&' in sed replacement text.
1964 1998-05-31 Jim Meyering <meyering@ascend.com>
1968 * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change.
1969 Reported by Don Parsons.
1971 1998-05-30 Jim Meyering <meyering@ascend.com>
1973 * tests/ls/time-1: Clean up ctime test. Note that it fails also
1974 on Solaris5.5.1 tmpfs file systems.
1976 Solve the `rm -f rm' problem more cleanly.
1977 * src/.rm-warning: Remove file.
1978 * src/automake-wrap: New file.
1979 * src/Makefile.am (AUTOMAKE): Define to use automake-wrap.
1980 (Makefile.in): Depend on automake-wrap.
1981 (EXTRA_DIST): Add automake-wrap.
1982 (DISTCLEANFILES): Remove definition.
1983 (rm_DEPENDENCIES): Likewise.
1984 (.rm-warn-stamp): Remove rule.
1986 1998-05-27 Jim Meyering <meyering@ascend.com>
1988 * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/
1989 * tests/ls/rt-1: New file, renamed from cr-1.
1991 1998-05-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
1993 * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".".
1995 * tests/ls/cr-1: Don't use the ctime for testing, it is impossible
1998 1998-05-25 Jim Meyering <meyering@ascend.com>
2000 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
2001 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
2002 [!_GNU_SOURCE]: Add #undef instead.
2004 1998-05-24 Jim Meyering <meyering@ascend.com>
2008 * src/ansi2knr.c: Use new version from automake-1.3.
2010 * src/chown.c: Accept new option, --dereference.
2011 --no-dereference is now the default.
2012 (enum Change_status) [CH_NOT_APPLIED]: New member.
2013 (change_symlinks): Enable this by default, now.
2014 (describe_change): Handle new case.
2015 (change_file_owner): Add new parameter: cmdline_arg. Update callers.
2016 Reorganize to reflect changed semantics.
2017 (LCHOWN): Remove definitions.
2019 * lib/lchown.c: New file.
2021 1998-05-21 Jim Meyering <meyering@ascend.com>
2023 * configure.in (ALL_LINGUAS): Add russian (ru).
2025 1998-05-16 Jim Meyering <meyering@ascend.com>
2027 * src/remove.c (hash_compare_strings): Return true or false, not 1/0.
2028 (remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
2030 * lib/hash.c (is_prime): Ansideclify.
2031 (next_prime): Ansideclify. Add an assertion.
2033 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
2034 lines from the m4/*.m4 macros, so the hack of including some
2035 custom-replaced C source file names here is no longer needed.
2037 * configure.in (jm_MACROS): New wrapper macro.
2038 Remove uses of most jm_* macros.
2040 * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
2041 as part of utimbuf.m4.
2042 (memcmp): Add #undef.
2044 1998-05-12 Jim Meyering <meyering@ascend.com>
2046 * configure.in: Use my replacement AC_ISC_POSIX rather than
2049 * src/copy.c (copy_internal): Plug a small leak.
2051 1998-05-10 Jim Meyering <meyering@ascend.com>
2053 * src/mv.c (do_move): Remove lots of code that was duplicated in
2054 copy.c (copy), now that copy() has better support for mv. This fixes
2055 a bug with cross-filesystem `mv -i' whereby you could get two prompts
2056 for the same destination file and eventually remove the destination
2057 file even though one of the responses was negative.
2058 Reported by Dirk Lattermann.
2060 * src/copy.h: Better support for mv:
2061 [struct cp_options] (move_mode): New member.
2062 * src/copy.c (copy_internal): Use new move_mode member.
2064 (copy): Add parameter.
2066 * tests/cp/Makefile.am (TESTS): Add backup-is-src.
2067 * tests/mv/Makefile.am (TESTS): Likewise.
2069 * lib/userspec.c: Don't declare strdup if it's defined as a macro.
2070 Reported by Lorne Baker.
2072 * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
2074 * src/mv.c (cp_option_init): Initialize new members.
2075 * src/cp.c (cp_option_init): Likewise.
2076 (main): Set new preserve_* options.
2078 1998-05-09 Jim Meyering <meyering@ascend.com>
2080 * src/copy.h: Support for install:
2081 [struct cp_options] (failed_unlink_is_fatal): New member.
2082 (preserve_owner_and_group): New member.
2083 (preserve_chmod_bits): New member.
2084 (preserve_timestamps): New member.
2085 (preserve): Remove member.
2086 (set_mode): New member.
2088 * src/copy.c (new_nondir_mode): New function. Use where appropriate.
2089 Use more-specific preserve_* members in place of removed `preserve'.
2090 (copy_internal): Honor failed_unlink_is_fatal.
2092 * src/install.c (main): Rewrite argv-handling to be clearer.
2093 (copy_file): Rewrite to use copy.c (copy).
2094 (change_attributes): Get rid of now-(with chown wrapper)-unnecessary
2095 `no_need_to_chown' parameter. Fix caller.
2096 (install_file_in_file): Remove now-unnecessary `to_created' parameter.
2097 (cp_option_init): New function.
2098 Update several functions to take new parameter specifying copy options.
2100 * tests/install: New subdir, with one basic test.
2101 * tests/Makefile.am (SUBDIRS): Add install.
2102 * configure.in (AC_OUTPUT): Add tests/install/Makefile.
2104 * src/dd.c: Include safe-read.h.
2105 Don't declare safe_read.
2106 * src/touch.c: Likewise.
2108 * configure.in (jm_TYPE_SSIZE_T): Use it.
2109 * acconfig.h (ssize_t): Add undef.
2111 1998-05-03 Jim Meyering <meyering@ascend.com>
2113 * po/: Update from gettext-0.10.35.
2115 * configure.in: Remove use of AC_LINK_FILES.
2116 (AC_OUTPUT): Remove po/Makefile-generating sed command.
2118 1998-04-28 Jim Meyering <meyering@ascend.com>
2120 * src/dircolors.c (parse_line): Use ISSPACE, not isspace.
2121 Use unsigned char * pointers, not potentially signed ones, to avoid
2124 1998-04-26 Jim Meyering <meyering@ascend.com>
2126 * configure.in: Use jm_ASSERT.
2127 * acconfig.h: Add NDEBUG.
2129 * src/mv.c: Don't define NDEBUG.
2130 * src/cp.c: Likewise.
2132 1998-04-14 Jim Meyering <meyering@ascend.com>
2134 * src/.rm-warning: New file.
2135 * src/Makefile.am (EXTRA_DIST): Add .rm-warning
2136 (DISTCLEANFILES): Add .rm-warn-stamp.
2137 (rm_DEPENDENCIES): Depend on .rm-warn-stamp.
2138 (.rm-warn-stamp): New rule.
2139 (rm_prep): Comment out rule.
2141 * src/df.c (main): Use STREQ in string equality tests, not strcmp.
2142 * src/dircolors.c (dc_parse_stream): Likewise.
2143 (dc_parse_file): Likewise.
2144 * src/du.c (main): Likewise.
2145 * src/ls.c (decode_switches): Likewise.
2146 * src/remove.c (hash_compare_strings): Likewise.
2147 * src/touch.c (main): Likewise.
2149 1998-04-13 Jim Meyering <meyering@ascend.com>
2151 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
2153 1998-04-11 Jim Meyering <meyering@ascend.com>
2155 * lib/hash.c: Add curly braces around statements in
2156 if/else/while/do/etc. that span more than a line -- even around
2157 multiline simple statements or single-line simple statements
2158 preceded by a comment line.
2160 1998-04-09 Jim Meyering <meyering@ascend.com>
2162 * configure.in: Don't use AC_PATH_PROG to check for perl, now that
2165 1998-04-06 Jim Meyering <meyering@ascend.com>
2167 * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
2168 hash_insert. Also declare to be static.
2169 * src/cp-hash.h (hash_insert): Remove declaration.
2171 * lib/hash.c: Lots of minor spec and name changes, and new comments.
2172 (hash_rehash): Rewrite to be easier on the allocator.
2173 From François Pinard.
2174 * lib/hash.h: More comments.
2175 * src/remove.c: Change names/usage of hash-related functions to work
2178 1998-04-05 Jim Meyering <meyering@ascend.com>
2180 * lib/regex.c (WIDE_CHAR_SUPPORT): Define.
2181 This now depends on HAVE_BTOWC so systems that lack btowc (like
2182 solaris-2.5.1) don't lose.
2184 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
2186 * GNUmakefile: Add conditionals so that running `make' in an
2187 unconfigured source directory will get a reasonable diagnostic.
2189 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
2190 know about the m4/ subdirectory.
2191 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
2192 automake-1.2h and the above change) aclocal-related rules and includes.
2194 1998-04-01 Jim Meyering <meyering@eng.ascend.com>
2196 * tests/ls/cr-1: New file.
2197 * tests/ls/Makefile.am (TESTS): Add cr-1.
2199 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
2201 * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
2202 works with `unsigned char'.
2204 (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
2206 * lib/xstrtol.c: Merge with the version from textutils.
2208 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
2210 1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2212 * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
2213 rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
2214 rev_cmp_size): Use file name as secondary sort key to get
2217 1998-03-28 Jim Meyering <meyering@eng.ascend.com>
2219 * src/copy.c: Add copyright.
2220 * src/remove.c: Add copyright.
2221 [_AIX]: Add #pragma alloca.
2223 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
2225 * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
2226 dependency and the := assignment of ACLOCAL to make the default
2227 rule use the `-I m4' option.
2229 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
2231 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
2233 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
2234 automatically handles it.
2236 1998-03-21 Jim Meyering <meyering@eng.ascend.com>
2238 * lib/quotearg.h: Update from patch-2.5.3.
2239 * lib/quotearg.c: Likewise.
2240 * src/ls.c (decode_switches): Pass a null pointer instead of address
2241 of quotearg_quoting_options.
2243 1998-03-19 Paul Eggert <eggert@twinsun.com>
2245 * lib/fsusage.h (struct fs_usage): New member
2246 fsu_bavail_top_bit_set.
2247 * lib/fsusage.c: Include <limits.h>.
2248 (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
2249 (get_fs_usage): If top bit of system variable corresponding to
2250 fsu_bavail is set, then set fsu_bavail_top_bit_set, and
2251 sign-extend the value when storing it into fsu_bavail.
2252 * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
2253 assume the original value corresponding to fsu_bavail was negative.
2254 Reported by Arne Juul.
2256 1998-03-18 Jim Meyering <meyering@eng.ascend.com>
2258 * src/Makefile.am (rm-prep): Add dependency and rule to save users
2259 with `.' too early in their PATH from the `rm: cannot unlink `rm':
2260 Text file busy' error. Suggestion from Philippe De Muyter.
2262 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
2266 * lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
2267 * lib/closeout.c: Likewise.
2268 * lib/dirname.c: Likewise.
2269 * lib/euidaccess.c: Likewise.
2270 * lib/fileblocks.c: Likewise.
2271 * lib/filemode.c: Likewise.
2272 * lib/ftruncate.c: Likewise.
2273 * lib/group-member.c: Likewise.
2274 * lib/isdir.c: Likewise.
2275 * lib/long-options.c: Likewise.
2276 * lib/mountlist.c: Likewise.
2277 * lib/path-concat.c: Likewise.
2278 * lib/save-cwd.c: Likewise.
2279 * lib/savedir.c: Likewise.
2280 * lib/strcasecmp.c: Likewise.
2281 * lib/strdup.c: Likewise.
2282 * lib/userspec.c: Likewise.
2283 * lib/yesno.c:: Likewise.
2285 * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
2286 Use #if !, not #ifndef with HAVE_ macros.
2287 * src/chown.c: Likewise.
2288 * src/copy.c: Likewise.
2289 * src/dd.c: Likewise.
2290 * src/dircolors.c: Likewise.
2291 * src/install.c: Likewise.
2292 * src/ls.c: Likewise.
2293 * src/mv.c: Likewise.
2294 * src/touch.c: Likewise.
2296 * configure.in: Use jm_PREREQ.
2298 1998-03-14 Jim Meyering <meyering@eng.ascend.com>
2300 Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
2301 With automake-1.2f, that hack is no longer needed.
2303 * src/remove.c: Use `virtual memory exhausted' message, not
2304 `Memory exhausted' to be consistent with the majority of other
2306 Say `removing all...', not `removing any...'.
2307 * src/rmdir.c (remove_parents): Be consistent with documentation of
2308 --verbose option and with remove.c in saying `removing...' before
2309 the operation is attempted.
2311 Suggestions from Santiago Vila.
2313 * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
2314 (copy_internal): Likewise.
2317 * src/copy.h (copy): Update prototype.
2318 * src/cp.c (do_copy): Add unused arg in calls to copy.
2319 * src/mv.c (do_move): Add ©_into_self arg in call to copy.
2320 Don't remove source directory when copy_into_self is nonzero.
2321 Reported by Arne Henrik Juul.
2323 * tests/mv/into-self: Test for the above.
2324 * tests/mv/Makefile.am (TESTS): Add into-self.
2326 1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
2328 * userspec.c (parse_user_spec) [__DJGPP__]: Make function know
2329 about any arbitrary user and group by pretending to be the user
2330 and to belong to the group specified in `spec_arg' argument.
2332 * idcache.c (getuidbyname) [__DJGPP__]: Make function know about
2333 any arbitrary user name.
2334 (getgidbyname) [__DJGPP__]: Make function know about any arbitrary
2337 1998-02-24 Jim Meyering <meyering@eng.ascend.com>
2339 * lib/xstrtol.c (TYPE_SIGNED): Define.
2340 (TYPE_MAXIMUM): Define.
2341 (ULONG_MAX): Use TYPE_MAXIMUM.
2342 (LONG_MAX): Use TYPE_MAXIMUM.
2344 * lib/fnmatch.c: Update from libit.
2345 * lib/idcache.c: Update from libit.
2347 1998-02-23 Paul Eggert <eggert@twinsun.com>
2349 * lib/quotearg.h, lib/quotearg.c: New files.
2350 * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
2351 (noinst_HEADERS): Add quotearg.h.
2353 * src/ls.c: Include new file quotearg.h.
2354 (enum indicator_style): Rename all to classify, and not_programs
2355 to file_type, to match option spellings. All users changed.
2356 (indicator_style_args): New constant.
2357 (quote_funny_chars, quote_as_string, quote_shell): Remove;
2358 (filename_quoting_options, dirname_quoting_options): Use these
2360 (long_options): Add --indicator-style, --quoting-style,
2361 --show-control-chars. Remove --quote-shell.
2362 (dired_dump_obstack): Remove style parameter and don't output style.
2363 (main): Go back to previous method of outputting //DIRED//
2364 and //SUBDIRED// lines, without style. But add a new
2365 //DIRED-OPTIONS// line that does output style.
2366 (decode_switches, usage): Add --indicator-style, --quoting-style,
2367 --show-control-chars. Remove --quote-shell.
2368 (decode_switches): Default from QUOTING_STYLE environment variable.
2369 Set new quoting vars.
2370 (quote_name): Renamed from quote_filename.
2371 Take new arg specifying quoting options.
2372 Always print; do not have a special case for null FILE * argument.
2373 All callers changed.
2374 Move the guts of this function to new file quotearg.c.
2375 (length_of_file_name_and_frills): Use quotearg_buffer instead
2376 of (old) quote_filename to find length of file name.
2378 (decode_switches, parse_ls_color, print_dir, gobble_file,
2379 get_link_name): Quote output in diagnostics.
2381 * NEWS, doc/fileutils.texi: Describe above changes.
2382 * doc/fileutils.texi: Mention that control characters are output
2383 as question marks if output is a terminal.
2385 1998-02-22 Jim Meyering <meyering@eng.ascend.com>
2389 * ChangeLog-1997: New file.
2390 * Makefile.am (EXTRA_DIST): Add ChangeLog-1997.
2392 1998-02-21 Jim Meyering <meyering@eng.ascend.com>
2394 * configure.in (AC_OUTPUT): Add tests/mv/Makefile.
2395 * tests/Makefile.am (SUBDIRS): Add mv.
2396 * tests/mv: New directory
2397 * tests/mv/mv-special-1: New test.
2399 1998-02-20 Jim Meyering <meyering@eng.ascend.com>
2401 * src/touch.c: Include get-date.h.
2402 Remove get_date decl.
2404 * lib/getdate.h: Removed. Could cause confusion with an
2405 automake-generated `.y.h' rule.
2406 * lib/get-date.h: Renamed from getdate.h.
2407 * lib/getdate.y: s/getdate.h/get-date.h/
2408 * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
2410 1998-02-19 Jim Meyering <meyering@eng.ascend.com>
2412 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
2413 * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t.
2415 1998-02-13 Jim Meyering <meyering@eng.ascend.com>
2417 * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1.
2418 Otherwise, mv tries to open special files.
2419 Reported by Kjetil Torgrim Homme.
2421 1998-02-08 Jim Meyering <meyering@eng.ascend.com>
2423 * Makefile.maint (cvs-dist): Update po/ to clear modified status
2424 of *.po files before running cvs tag -c.
2426 * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in
2429 1998-02-07 Jim Meyering <meyering@eng.ascend.com>
2431 * GNUmakefile: New file.
2432 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
2433 Don't include Makefile.maint from here. It's included from GNUmakefile.
2435 * configure.in: Don't use AM_MAINTAINER_MODE.
2436 (jm_PERL): Use this.
2438 * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen.
2439 (CLEANFILES): Remove dcgen.
2440 (dircolors.h): Use $(PERL).
2443 1998-02-01 Jim Meyering <meyering@na-net.ornl.gov>
2445 * POTFILES.in: Add remove.c. Reported by Santiago Vila.
2447 1998-01-28 Jim Meyering <meyering@na-net.ornl.gov>
2449 * src/df.c (print_header): Tweak format to align heading over
2450 last column of `df -i' output. From Andreas Schwab.
2452 1998-01-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2454 * Makefile.am: Include Makefile.maint from $(srcdir).
2456 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
2460 * Makefile.maint: New file.
2461 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
2462 into Makefile.maint.
2463 Include Makefile.maint.
2464 (EXTRA_DIST): Add Makefile.maint.
2466 * src/cp.c (re_protect): Don't fail for non-root when chown fails
2467 due not only to lack of permission (EPERM), but also to lack of
2468 support (EINVAL). Reported by Bengt Martensson.
2469 * src/copy.c (DO_CHOWN): Likewise.
2471 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
2473 * tests/ls/time-1 (test_failure): Rename does not update ctime;
2474 link does -- so use ln, not mv.
2475 Note that the SunOS4.1.4 failure of the ctime test is expected.
2477 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
2478 bug in Cray C 5.0.3.0 when T == time_t.
2480 * tests/rm/r-1: Adjust expected output for changed format of
2482 * tests/rm/r-2: Likewise.
2484 1998-01-23 Jim Meyering <meyering@na-net.ornl.gov>
2486 * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's
2487 C compiler. From Kaveh Ghazi.
2488 (TYPE_MINIMUM): Define.
2489 (TYPE_MAXIMUM): Define.
2490 (TIME_T_MIN): Use TYPE_MINIMUM.
2491 (TIME_T_MAX): Use TYPE_MAXIMUM.
2493 1998-01-22 Jim Meyering <meyering@na-net.ornl.gov>
2495 * src/dd.c: Reorder functions to obviate forward dcls.
2496 (quit): Declare to be inline to stifle compile warning.
2498 * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning.
2500 * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a
2503 * tests/ls/time-1: Use GNU touch to work around problems with NFS
2504 caching and/or clock skew. Reported by Kaveh Ghazi.
2506 * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH.
2508 * src/Makefile.am (noinst_HEADERS): Add remove.h.
2509 (mv_SOURCES): Define.
2510 (rm_SOURCES): Define.
2512 1998-01-21 Jim Meyering <meyering@na-net.ornl.gov>
2514 * src/install.c: Declare new global, backup_type.
2515 (main): Initialize backup_type unconditionally.
2516 (copy_file): Call find_backup_file_name with new argument, backup_type.
2517 * src/ln.c: Declare new global, backup_type.
2518 (main): Initialize backup_type unconditionally.
2519 (do_link): Call find_backup_file_name with new argument, backup_type.
2521 * src/copy.c (copy_internal): Use x->backup_type, not the global.
2522 (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
2524 * src/copy.h: (VALID_SPARSE_MODE): Define.
2525 [struct cp_options] (backup_type): New member.
2527 * src/cp.c [NDEBUG]: Comment out definition.
2528 (do_copy): Use x->backup_type, not the global.
2530 * src/remove.c: New file. Contains guts of old rm.c.
2531 (remove_init): New function.
2532 (remove_fini): New function.
2533 (rm): Take third argument, specifying options.
2534 * src/remove.h: New file. Associated dcls.
2535 * src/rm.c: Remove and minimally librarify guts for use in mv.c.
2536 (main): Pass options (`&x') to rm.
2537 Call remove_init and remove_fini instead of open-coding them.
2539 * src/mv.c (rm_option_init): New function.
2540 (cp_option_init): New function.
2541 (copy_reg): Remove now-unused function.
2542 (do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
2543 Set up for and use `remove.c (rm)' in place of unlink.
2545 1998-01-20 Jim Meyering <meyering@na-net.ornl.gov>
2547 * lib/backupfile.c: Use ANSI function definitions.
2548 Remove global declaration of backup_type.
2549 (simple_backup_suffix): Default to `~', not `.orig'.
2550 Use PARAMS, not __BACKUPFILE_P.
2551 (find_backup_file_name): Add parameter, backup_type.
2552 * lib/backupfile.h: Remove extern declaration of backup_type.
2553 Use PARAMS, not __BACKUPFILE_P.
2554 (VALID_BACKUP_TYPE): Define.
2555 (find_backup_file_name): Adjust prototype.
2557 1998-01-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2559 * src/df.c (print_header): Fix inode format header to line it up
2560 with the rest of the output.
2562 1998-01-13 Jim Meyering <meyering@na-net.ornl.gov>
2564 * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent
2565 with most other implementations.
2567 1998-01-12 Jim Meyering <meyering@na-net.ornl.gov>
2569 * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H.
2570 Move function-spanning `#if ...BSIZE' directive to follow inclusion
2571 of sys/param.h since BSIZE is sometimes defined in sys/param.h.
2572 Reported by Philippe De Muyter.
2574 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
2578 * src/install.c (install_file_to_path): New function.
2579 FIXME: update fileutils.texi.
2580 (main): Handle new option, -D.
2581 Based on a patch from Marty Leisner.
2582 (usage): Describe -D.
2584 * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only
2585 with -l or -t. Now, -u (like -c) implies --sort=time.
2586 (usage): Correct descriptions of --sort, --time, and -t.
2587 Suggestions from Andreas Schwab.
2589 Add test for the above fix.
2590 * configure.in (AC_OUTPUT): Add tests/ls/Makefile.
2591 * tests/Makefile.am (SUBDIRS): Add ls.
2592 * tests/ls: New directory.
2593 * tests/ls/Makefile.am: New file.
2594 * tests/ls/time-1: New file.
2596 * lib/makepath.c (make_path): Reformat 3 if-stmts to test
2597 `if (newly_created_dir)' only once. Suggestion from Andreas Schwab.
2599 1998-01-06 Jim Meyering <meyering@na-net.ornl.gov>
2601 * lib/getdate.y: Move inclusion of getdate.h and dependent extern
2602 declarations down so getdate.h's prototype follows the sometimes-
2603 enabled definition of `const' to nothing. Otherwise, the prototype
2604 wouldn't match the definition because of the defined-away `const'.
2606 (get_date): ANSI-fy definition.
2607 Add %expect directive.
2609 1998-01-05 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2611 * lib/makepath.c (make_path): Put only newly created directories
2612 on the LEADING_DIRS list.
2614 1998-01-05 Paul Eggert <eggert@twinsun.com>
2616 * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro.
2617 (get_fs_usage): If a value consists entirely of 1 bits,
2618 propagate this info to the output by setting it to (uintmax_t) -1.
2619 * src/df.c (df_readable): New function.
2620 (show_dev): If a value consists entirely of 1 bits, or is derived
2621 from some other value that consists entirely of 1 bits, report "-".
2622 Check inode and block counts more carefully for plausibility,
2623 to avoid arithmetic overflow when computing percentages.
2625 1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
2629 * lib/Makefile.in: Regenerated with patched automake-1.2d.
2632 * src/chgrp.c: Use a single enumerated type, Verbosity, instead of
2633 the two booleans, verbose and changes_only. This fixes a bug whereby
2634 --change had the same effect as --verbose.
2635 * src/chmod.c: Likewise.
2636 * src/chown.c: Likewise.
2637 Reported by Paul Eggert.
2639 1998-01-04 Paul Eggert <eggert@twinsun.com>
2641 Check for write errors more carefully.
2643 * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
2644 (noinst_HEADERS): Add closeout.h.
2645 * lib/closeout.c, lib/closeout.h: New files.
2646 * lib/long-options.c (parse_long_options),
2647 src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
2648 src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
2649 src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
2650 src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
2651 (main, usage): Check for write error to stdout before exiting.
2652 Include "closeout.h".
2654 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
2656 * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
2657 just like `fsu.fsu_blocks == 0' as an indicator that usage information
2658 is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
2660 * lib/save-cwd.h: Guard PARAMS-enabling definition with
2661 `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
2662 problems with Irix4's cc. From Kaveh Ghazi.
2663 * lib/getdate.h: Likewise, but just to be consistent.
2665 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
2666 those files will be built via the ANSI2KNR-filtering rules if necessary.
2667 Reported by Kaveh Ghazi.
2669 1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
2673 Fix problem with `install -d'. Reported by Marty Leisner.
2675 * src/install.c (get_ids): When otherwise unspecified,
2676 set uid and gid to -1.
2677 * lib/makepath.c (make_path): Try to change ownership only if we've
2678 just created the directory. Fix latent bug (s/&&/||/ in two places --
2679 also, note that it could not be exercised via install or mkdir)
2680 whereby chown would not be invoked when only one of owner/group is
2683 1998-01-01 Jim Meyering <meyering@na-net.ornl.gov>
2685 * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack
2686 only once and never free it.
2689 version-control: never