1 2005-09-20 Jim Meyering <jim@meyering.net>
3 * openat.c (fdopendir): Be sure to close the supplied
4 file descriptor before returning. This makes our replacement
5 implementation a little closer to Solaris's, where fdopendir
6 ties the file descriptor to the returned DIR* pointer.
8 2005-09-19 Jim Meyering <jim@meyering.net>
10 * openat.c (unlinkat): New function.
11 * openat.h (unlinkat): Add prototype.
13 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
16 * stat-time.h: New file.
17 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
18 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
20 (timespec_cmp): New function.
21 * utimecmp.c: Include stat-time.h.
22 (SYSCALL_RESOLUTION): Depend on whether various struct stat
23 members exist, not on the obsolescent ST_MTIM_NSEC.
24 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
26 * .cppi-disable: Add stat-time.h.
28 2005-09-16 Jim Meyering <jim@meyering.net>
30 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
31 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
32 int utc, int nanoseconds);
34 date should not have to allocate a megabyte of virtual memory to
35 handle a format argument like +%1048575T. When implemented with
36 strftime, it must allocate such a buffer, use strftime to fill it
37 in, print it, then free it.
38 With fprintftime, it simply prints everything and exits.
39 With no need for memory allocation, that's one fewer way to fail.
41 * fprintftime.c, fprintftime.h: New files.
42 * Makefile.am (libcoreutils_a_SOURCES):
43 Add fprintftime.c and fprintftime.h.
45 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
47 * strftime.c (my_strftime): Rewrite the previous change slightly,
48 to make it a bit faster and (I hope) clearer.
50 2005-09-14 Jim Meyering <jim@meyering.net>
52 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
53 optional field width, not before, so we accept %9:z, not %:9z.
54 (my_strftime): Be sure to use L_('x') for literals.
56 2005-09-13 Paul Eggert <eggert@cs.ucla.edu>
58 Merge md5 from libc, and clean up some sha1 glitches.
59 * md5.h (__GNUC_PREREQ, __THROW, __attribute__): New macros.
60 (__md5_buffer): Renamed from md5_buffer. Add a macro undoing this
61 if _LIBC is not defined. Add __THROW.
62 (__md5_finish_ctx, __md5_init_ctx, __md5_process_block):
63 (__md5_process_bytes, __md5_read_ctx, __md5_stream): Likewise.
64 (struct md5_ctx): Mark buffer as being aligned.
65 (rol): Remove; all uses changed to CYCLIC.
66 * md5.c (CYCLIC): New macro. All uses of rol changed to use CYCLIC.
67 Redo comment to minimize changes from libc.
68 * sha1.h (struct sha1_ctx): Mark buffer as being aligned.
69 * sha1.c (SWAP): Renamed from NOTSWAP, to avoid a horrible misnaming.
70 All uses changed. Remove the old SWAP.
71 Remove obvious comment about BLOCKSIZE.
72 (rol): New macro, moved here from md5.h.
73 (sha1_process_block): Remove an incoherent FIXME comment.
75 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
76 Fix bug in formats like %2N.
78 2005-09-13 Jim Meyering <jim@meyering.net>
80 * xalloc.h: Revert unintended change that removed definitions
81 of X2REALLOC and X2NREALLOC.
83 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
85 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
87 * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h:
88 * regexec.c: Import from gnulib, to fix some 64-bit bugs.
90 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
92 * verify.h (__builtin_constant_p): Remove, undoing previous change.
93 (verify_type__): Solve the problem by using a bit-field rather
96 2005-09-05 Jim Meyering <jim@meyering.net>
98 * verify.h (__builtin_constant_p) [__GNUC__ <= 2]: Define to 1.
99 (verify_type__) [verify_error_if_non_const__]: New member/test,
100 to help detect when verify or verify_expr is mistakenly passed
101 a non-constant argument within a function.
103 2005-08-31 Jim Meyering <jim@meyering.net>
105 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
106 order to avoid an unsuppressible warning from gcc on 64-bit systems.
108 * localcharset.c (get_charset_aliases): Add `void' in parameter list
109 to placate gcc's -Wstrict-prototypes.
111 2005-08-27 Jim Meyering <jim@meyering.net>
113 * md5.c: Use `#error' rather than a string literal to provoke failure.
116 2005-08-25 Jim Meyering <jim@meyering.net>
118 * open-safer.c: Include <config.h>.
119 Otherwise, we'd lose LARGEFILE support in any file using
122 2005-08-24 Jim Meyering <jim@meyering.net>
124 * stdopen.c (stdopen): Revert to iterating over descriptors, but
125 rather than using fstat, use fcntl with its F_GETFD flag, which
126 is more efficient. Unlike the 2-syscall dup-close approach,
127 this one doesn't apply any unnecessary pressure on the file
128 descriptor pool -- thus there is one fewer way to fail.
130 2005-08-23 Jim Meyering <jim@meyering.net>
132 * regcomp.c, regex.c, regex.h, regex_internal.c: Update from gnulib.
133 * regex_internal.h, regexec.c: Likewise.
135 2005-08-19 Jim Meyering <jim@meyering.net>
137 * stdopen.c (stdopen): Return `bool' so caller can detect failure.
139 2005-08-17 Jim Meyering <jim@meyering.net>
141 Make the %s format (seconds since the epoch) work for a negative
142 number and when used with a zero-padded field width, e.g. %015s.
144 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
145 label so that it precedes the code to set `digits'. Otherwise,
146 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
147 print `00-22'. Now, it prints `-0022', as it should.
149 2005-08-15 Bruno Haible <bruno@clisp.org>
152 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
155 2005-08-13 Jim Meyering <jim@meyering.net>
157 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
158 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
159 when run in a time zone for which daylight savings time is in effect
160 for the starting date.
162 2005-08-12 Jim Meyering <jim@meyering.net>
164 * regcomp.c (duplicate_node) [lint]: Set *new_idx to -1, to avoid
165 warnings (unfounded) in caller that it may be used uninitialized.
167 * regex.c (IF_LINT): Define.
169 * regex_internal.c (re_string_realloc_buffers): Rename local-shadowed
170 variable: s/new_array/offsets/.
171 (re_acquire_state) [lint]: Set *err, to avoid warnings in caller.
173 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
174 of unused local, dfa.
175 (proceed_next_node): Remove outer declaration and
176 unnecessary initialization of local-shadowed `dest_node'.
177 Declare it in inner scopes, nearer its uses instead.
179 * regex.h (RE_SYNTAX_POSIX_AWK): Remove useless space-before-TAB.
181 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
182 Use the hash-table-based cycle-detection code not just when
183 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
184 Reported by James Youngman in
185 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
186 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
188 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
189 This lets us compile with -DFTS_DEBUG, once again.
191 2005-08-02 Jim Meyering <jim@meyering.net>
193 * xanstrftime.c, xanstrftime.h: New files.
195 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
197 * getdate.y (relative_time): New type.
198 (RELATIVE_TIME_0): New constant.
199 (parser_control): Use relative_time instead of doing it ourselves.
200 (%union): Add new relative_time rel member.
201 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
203 (relunit, relunit_snumber): Now of type rel.
204 (zone, rel, relunit, get_date): Adjust to above changes.
206 2005-07-12 Jim Meyering <jim@meyering.net>
208 * xalloc.h (X2NREALLOC): Define.
210 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
212 * verify.h (verify_expr): Use ((verify_type__ (R) *) 0), not
213 sizeof (verify_type__ (R)), to pacify C++ compilers. Problem
214 reported by Bruno Haible.
216 * version-etc-fsf.c (version_etc_copyright): Parameterize the
217 copyright symbol and the year.
218 * version-etc.c (COPYRIGHT_YEAR): New constant.
219 (version_etc_va): Use parameterized copyright notice.
220 Reword to conform to the current GNU coding standards.
222 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
224 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
225 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
226 [!LDAV_DONE]: Avoid unused variable warning.
228 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
229 and Paul Eggert <eggert@cs.ucla.edu>
231 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
232 in wint_t, not wchar_t. Remove now-unnecessary cast.
234 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
236 Switch to Isamu Hasegawa's implementation of regex, which is
238 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
239 New files, from gnulib.
240 * regex.h, regex.c: Sync from gnulib.
241 * Makefile.am (libcoreutils_a_SOURCES): Remove regex.h; gnulib
242 now does this automatically for us.
243 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h.
245 2005-07-04 Paul Eggert <eggert@cs.ucla.edu>
247 * verify.h (GL_CONCAT0, GL_CONCAT): Define unconditionally; don't
248 depend on whether verify_decl is defined.
249 (verify): Renamed from verify_decl. All uses changed.
250 Use an extern function decl, as it can't possibly collide with other
252 (verify_expr): Renamed from verify. All uses changed.
253 (verify_type__): New private macro.
254 (verify, verify_expr): Use it.
256 2005-07-04 Jim Meyering <jim@meyering.net>
258 * verify.h (verify, verify_decl): New file/macros.
259 * Makefile.am (libcoreutils_a_SOURCES): Add verify.h here, temporarily.
260 Eventually, it'll be pulled in via AC_LIBSOURCES.
262 * argmatch.h (verify_dcl): Rename from VERIFY. Update use.
264 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
266 Remove the dependency of the strftime module on the tzset module.
267 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
268 Copy the input structure, to work around some of the bug with
269 Solaris 2.5.1 and Solaris 2.6.
271 2005-07-03 Jim Meyering <jim@meyering.net>
273 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
274 the .tm_year member, since otherwise gcc-4.0 would now warn about
275 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
277 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
279 * Makefile.am (libcoreutils_a_SOURCES): Undo previous change.
281 * Makefile.am (libcoreutils_a_SOURCES): Add fcntl--.h, stdio--h,
282 stdlib--.h, unistd--.h.
283 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
284 * lstat.c: Sync from gnulib.
285 * lstat.h: New file, from gnulib.
288 2005-07-03 Jim Meyering <jim@meyering.net>
290 * fd-reopen.c: Include <unistd.h> for declaration of close.
292 2005-07-02 Paul Eggert <eggert@cs.ucla.edu>
294 Cleanup to isolate "safer" functions to a small part of the code.
295 * fcntl--.h, stdio--.h, stdlib--.h, unistd--.h, fcntl-safer.h:
296 * open-safer.c, stdlib-safer.h, mkstemp-safer.c, fd-reopen.h:
297 * fd-reopen.c: New files.
298 * fopen-safer.c: Include stdio-safer.h first, to check interface.
299 Don't bother including stdio.h, since stdio-safer.h does.
300 * fts.c (fd_safer): Remove decl.
301 Include fcntl--.h rather than unistd-safer.h
302 (fts_safe_changedir): Don't call fd_safer; no longer needed
303 now that we include fcntl--.h.
304 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
305 Do not include unistd-safer.h.
306 (getloadavg): Don't call fd_safer; no longer needed
307 now that we include fcntl--.h.
308 * getusershell.c: Include stdio--.h rather than stdio.h
310 (getusershell): Call fopen, not fopen_safer.
311 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
312 Do not include unistd-safer.h.
313 (save_cwd): Don't call fd_safer; no longer needed
314 now that we include fcntl--.h.
316 2005-07-02 Jim Meyering <jim@meyering.net>
318 * getopt_.h: Assume HAVE_UNISTD_H, i.e., include <unistd.h>
321 * fnmatch.c: Update from gnulib.
323 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
324 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
325 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
326 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
327 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
328 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
329 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
330 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
331 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
333 2005-07-01 Jim Meyering <jim@meyering.net>
335 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
336 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
337 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
338 and don't include <sys/file.h>).
340 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
342 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
343 declares only 'struct timespec;' (!).
345 2005-06-30 Jim Meyering <jim@meyering.net>
347 * stdopen.c: Add copyright.
348 Include <fcntl.h> and <unistd.h> unconditionally --
349 it seems to be ok to do this, these days.
351 * stdopen.c: Rewritten by Paul Eggert.
352 Now, the minimum overhead is just two system calls: dup and close.
354 * stdopen.c: New file. As yet unused.
355 The minimum overhead is three fstat calls.
356 * stdopen.h: New file.
358 * argmatch.h [!VERIFY] (VERIFY): Define.
359 (ARGMATCH_VERIFY): Use it, so this macro may be used more than
360 once in any given scope.
362 * xalloc.h (VERIFY_EXPR): Undef before defining, and add a comment.
364 2005-06-29 Jim Meyering <jim@meyering.net>
366 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
367 type name. Use the variable name instead.
368 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
370 * xalloc.h (VERIFY_EXPR): Define.
371 (X2REALLOC): New macro, to make using x2realloc a little safer.
373 2005-06-26 Jim Meyering <jim@meyering.net>
375 * Makefile.am (libcoreutils_a_SOURCES): Remove diacrit.c and diacrit.h.
377 2005-06-25 Jim Meyering <jim@meyering.net>
379 * Makefile.am (libcoreutils_a_SOURCES): Remove
380 root-dev-ino.c and root-dev-ino.h.
381 (libcoreutils_a_SOURCES): Remove dev-ino.h too, now that we
382 get it via root-dev-ino.m4
383 (libcoreutils_a_SOURCES): Remove version-etc.c version-etc.h
384 and version-etc-fsf.c.
386 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
388 * canon-host.c (canon_host) [HAVE_GETADDRINFO]: Use `= { 0, };' to
389 initialize local `hint'. This undoes the previous change, and
392 2005-06-23 Jim Meyering <jim@meyering.net>
394 * Makefile.am (libcoreutils_a_SOURCES): Remove xreadlink.c
396 (libcoreutils_a_SOURCES): Remove xstrtod.c and xstrtod.h.
398 * backupfile.c (backup_args): Change a `0' to NULL.
400 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
402 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
403 (ranged_convert): Don't save conversion in a temporary struct.
404 This causes a warning with GCC 4.0.0, and anyway in the typical
405 case it's not worth the extra 100 bytes or so of code.
406 (ranged_convert, __mktime_internal): When calling a function via a
407 pointer P, use P () rather than (*P) (), as we now assume C89 or better.
409 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
410 "who -r" failed to give output. Problem reported by Tim Waugh.
412 2005-06-22 Jim Meyering <jim@meyering.net>
414 * xmalloc.c: Update from gnulib.
416 2005-06-19 Jim Meyering <jim@meyering.net>
418 * Makefile.am (libcoreutils_a_SOURCES): Remove xgetcwd.c, xgetcwd.h,
421 2005-06-16 Jim Meyering <jim@meyering.net>
423 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
424 when either N or S is zero.
426 2005-06-15 Jim Meyering <jim@meyering.net>
428 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
429 stop us from restricting permissions of just-created absolute-named
432 2005-06-14 Paul Eggert <eggert@cs.ucla.edu>
434 Improve quality of diagnostics on restore_cwd failure.
435 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
436 (make_dir_parents): Last arg is now int * (for errno), not bool *.
437 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
438 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
439 each time through the loop. Do not diagnose restore_cwd failure;
440 that is the caller's job (and perhaps the caller does not care).
442 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
443 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
444 If the file already exists but is not a directory, don't bother
445 to try to make its parents.
446 Close potential file descriptor leak if we can't chdir("/") (!).
447 Don't always return true if chdir($PWD) fails; return true only
448 if the requested action was done successfully (except for the
450 Don't log final directory unless we actually made it.
451 Refactor to avoid duplicate code to fix up permissions.
452 Don't attempt to fix up parent permissions if chdir($PWD) fails.
454 2005-06-14 Jim Meyering <jim@meyering.net>
456 * openat-die.c (openat_save_fail): Rename from openat_save_die.
457 (openat_restore_fail): Rename from openat_restore_die.
458 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
460 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
461 to restore initial working directory.
463 Provide an alternative to exiting immediately upon save_cwd or
464 restore_cwd failure. Now, an application can arrange e.g.,
465 to perform a longjump in that case.
466 * openat.c: Include dirname.h.
467 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
468 (rpl_openat, fdopendir, fstatat): Call openat_save_die
469 and openat_restore_die rather than calling error directly.
470 Don't include "error.h" or "exitfail.h"; they're no longer needed.
472 * openat-die.c (openat_save_die, openat_restore_die): New file.
473 * openat.h (openat_save_die, openat_restore_die): Declare and define.
475 2005-06-13 Jim Meyering <jim@meyering.net>
477 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
478 to tell caller if/when we change the working directory and are
479 unable to return to the initial one.
480 * mkdir-p.h (make_dir_parents): Update prototype.
482 2005-06-12 Jim Meyering <jim@meyering.net>
484 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
485 `return false'. This fixes a bug introduced on 2004-07-30.
487 2005-06-01 Paul Eggert <eggert@cs.ucla.edu>
489 Use "file name" when talking about file names, instead of "filename"
490 or "path", as per the GNU coding standards.
491 * mkdir-p.c: Renamed from makepath.c.
492 (make_dir_parents): Renamed from make_path. All callers changed.
493 * mkdir-p.h: Likewise. All includers changed.
494 * filenamecat.c: Renamed from path-concat.c.
495 (file_name_concat): Renamed from path_concat. All callers changed.
496 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
497 * filenamecat.h: Likewise. All includers changed.
498 * acl.c: Don't use "path" or "filename" to mean "file name"
499 in comments or local variable names.
500 * basename.c: Likewise.
501 * canonicalize.c, canonicalize.h: Likewise.
502 * dirname.c, dirname.h: Likewise.
503 * euidaccess.c: Likewise.
504 * exclude.c: Likewise
505 * fnmatch_.h, fnmatch_loop.c: Likewise.
506 * fsusage.c, fsuage.h: Likewise.
507 * fts.c, fts_.h: Likewise.
508 * getcwd.c: Likewise.
509 * getloadavg.c: Likewise.
510 * mkstemp.c: Likewise.
511 * mountlist.c, mountlist.h: Likewise.
512 * openat.c, openat.h: Likewise.
513 * readlink-stub.c: Likewise.
514 * readutmp.c, readutmp.h: Likewise.
515 * rename.c: Likewise.
518 * savedir.c: Likewise.
519 * stripslash.c: Likewise.
520 * tempname.c: Likewise.
521 * xreadlink.c: Likewise.
522 * exclude.c (excluded_file_name): Renamed from excluded_filename.
524 * exclude.h: Likewise.
526 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
528 * euidaccess.c (getuid, getgid, getuid, getegid)
529 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
530 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
531 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
532 * pathmax.h: Include <limits.h> unconditionally, since other
533 files have been getting away with it for years (MORE/BSD 4.3
535 * userspec.c (getpwnam, getgrnam, getgrgid)
536 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
538 2005-05-29 Paul Eggert <eggert@cs.ucla.edu>
540 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
541 Define to 256, not 255, as per modern POSIX.
543 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
545 * fts.c: Don't worry about debugging on pre-C99-comopatible hosts;
546 the configuration hassle isn't worth it.
547 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
548 (LONGEST_MODIFIER, PRIuMAX): Remove.
550 * strnumcmp.c, strnumcmp.h, strnumcmp-in.h, strintcmp.c:
553 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
555 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
556 so that unistd-safer.h (GPL'ed code) need not be included.
558 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
560 Split the fts code into GPL'ed and LGPL'ed parts, and fix some
561 minor memory-allocation bugs.
563 * fts.c: Don't include "cycle-check.h" or "hash.h".
564 (setup_dir, free_dir): New functions.
565 (enter_dir, leave_dir): Define trivial
566 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
567 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
568 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
569 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
571 (fts_open): Use setup_dir.
572 (fts_close): Use free_dir.
573 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
574 This adds a label and some gotos, but the alternatives were messier.
575 Check for memory allocation failure when entering a dir.
576 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
577 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
578 (FTS): New member fts_cycle, that is a union that contains the
579 old active_dir_ht and cycle_state. All uses changed to mention
580 fts_cycle.ht and fts_cycle.state.
581 * fts-cycle.c: New file, containing GPL'ed code migrated out of
582 fts.c, with the following changes:
583 (setup_dir, free_dir): New functions.
584 (enter_dir): Now returns bool. Return true if successful, false
585 if memory exhausted. All callers changed.
586 Do not bother partly cleaning up on
587 memory allocation failure; that is free_dir's job.
588 However, free ad if hash_insert fails, to avoid memory leak.
589 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
590 fts->fts_options to see which union member to use.
592 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
594 * chown.c (rpl_chown): Return -1 on failure.
596 2005-05-20 Jim Meyering <jim@meyering.net>
598 * fts.c (fts_open): Remove useless but otherwise harmless malloc call.
599 Spotted by Paul Eggert.
601 2005-05-19 Jim Meyering <jim@meyering.net>
603 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
604 Use #define rather than a static function, to avoid a warning
605 when the function was not used.
607 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
609 * canonicalize.c: Include canonicalize.h first, to test interface.
610 Include <stddef.h> unconditionally, since we assume C89 now.
611 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
612 * fts.c: Include fts_.h first, to check interface.
613 Do not include intprops.h; no longer needed.
614 Include cycle-check.h and hash.h, since fts_.h no longer does.
615 Remove unnecessary casts of closedir to void.
616 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
617 decide whether to decrement nlinks.
618 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
619 (FTS): Use struct hash_table * instead of Hash_table, so that
620 we no longer need to include hash.h here.
622 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
624 * unlinkdir.c, unlinkdir.h: New files.
626 2005-05-14 Jim Meyering <jim@meyering.net>
628 * unlocked-io.h, gethrxtime.c, gethrxtime.h, mountlist.h,
629 * xtime.h, path-concat.c: Correct cpp indentation.
631 2005-05-14 Jim Meyering <jim@meyering.net>
633 Update FSF postal mail address everywhere.
635 2005-05-09 Paul Eggert <eggert@cs.ucla.edu>
637 * fts_.h (FTS): Use correct type for fts_compar member.
638 (FTSENT): New member fts_fts. Remove members fts_ino, fts_dev,
639 fts_nlink; no longer needed now that fts_statp is always there.
640 All uses changed to use fts_statp instead.
641 * fts.c (__P): Remove. All uses rewritten to assume C89 or better.
642 (fts_open): Don't cast a function value in a possibly-unsafe way.
643 (fts_compar): New function.
644 (fts_sort): Use it. But optimize the common case where all
645 pointers smell the same.
647 2005-05-08 Paul Eggert <eggert@cs.ucla.edu>
649 * yesno.c: Include getline.h, not ctype.h.
650 (yesno): Don't remove leading white space; POSIX doesn't allow it.
651 Use getline to remove arbitrary restriction on response length.
653 2005-05-05 Paul Eggert <eggert@cs.ucla.edu>
655 * makepath.c (make_path): chdir to "//", not "/", if the file name
656 starts with exactly two slashes. This doesn't solve the problem
657 in general but it's better than nothing. Problem reported by
658 Pierre A. Humblet via Eric Blake.
660 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
662 * modechange.h (mode_free): Remove; all callers changed to invoke
664 * modechange.c: Likewise.
665 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
666 (MODE_DONE): New constant.
667 (struct mode_change): Remove 'next' member.
668 (make_node_op_equals): New function; like the old one of the
669 same name, except it allocates an array.
670 (mode_compile, mode_create_from_ref): Use it.
671 (mode_compile): Allocate result as an array, not a linked list.
672 Parse octal string ourself, so that we catch mistakes like "+0".
673 (mode_adjust): Arg is an array, not a linked list.
675 * mbswidth.c, regex.c, strtol.c: Sync from gnulib.
677 2005-04-28 Paul Eggert <eggert@cs.ucla.edu>
679 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
680 [!_LIBC] Include "stat-macros.h" instead.
682 * file-type.c: Include file-type.h first.
683 * filetype.h: Don't assume <sys/stat.h> was included first.
685 * modechange.c: Include stat-macros.h, xalloc.h.
686 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
687 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
688 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
689 Remove. This is now stat-macros.h's job.
690 (talloc): Remove. All callers replaced by xalloc, so that
691 our invokers don't have to worry about reporting memory failures.
692 (make_node_op_equals): Remove.
693 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
695 (struct mode_change): Moved here from modechange.h.
696 (mode_append_entry): Remove.
697 (mode_compile): Remove MASKED_OPS arg, since it encouraged
698 apps to have incorrect behavior. Use simpler algorithm for head
699 and tail. Don't futz with umask; that's now the job of mode_adjust.
700 Detect more invalid usages rather than having somewhat-random behavior.
701 Don't insert an "a=" action, as that leads to incorrect behavior.
702 (mode_compile, mode_create_from_ref): Return NULL on error instead
703 of an enum, since now there's only one way to have an error. All
705 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
706 at the correct time. Simplify calculation of "+u" and its ilk.
707 Don't mishandle "+X".
708 (mode_free): Remove "register" and localize decls.
709 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
710 (struct mode_change): Move to modechange.c; callers don't
711 need to see this stuff.
712 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
713 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
714 (mode_change, mode_adjust): Reflect the new signatures noted above.
716 2005-04-18 Paul Eggert <eggert@cs.ucla.edu>
718 * Makefile.am (noinst_LIBRARIES): fetish -> coreutils.
719 (libcoreutils_a_SOURCES): Renamed from libfetish_a_SOURCES.
721 (libcoreutils_a_LIBADD): Renamed from libfetish_a_LIBADD.
723 (libcoreutils_a_DEPENDENCIES): Renamed from libfetish_a_DEPENDENCIES.
725 * chdir-long.c: fetish->coreutils in comment.
726 * t-chdir-long: fetish->coreutils in compilation command.
728 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
730 * getdate.y (zone): Allow relunit_snumber after tZONE, so
731 that "UTC +1 second" continues to work. Problem reported
733 (relunit_snumber): New rule.
736 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
738 * getdate.y (universal_time_zone_table): New constant.
739 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
740 universal_time_zone_table.
741 (lookup_zone): Prefer universal_time_zone_table to
742 local_time_zone_table, so that "GMT" time stamps are allowed in
743 London during the summer. Problem reported by Ian Abbott.
745 2005-04-11 Paul Eggert <eggert@cs.ucla.edu>
747 Add bulletproofing for cases where stdin, stdout, or stderr are closed.
748 * fcntl-safer.h, open-safer.c: Remove.
749 * fd-safer.c: New file.
750 * dup-safer.c: Include unistd-safer.h first, to test interface.
751 (dup_safer) [!deefined F_DUPD]: Use new fd_safer function instead of
752 rolling our own code.
753 * fts.c: Include unistd-safer.h.
754 (fts_safe_changedir): Use fd_safer.
755 * getloadavg.c: Include unistd-safer.h.
756 (getloadavg): Use fd_safer.
757 * getusershell.c: Include stdio-safer.h.
758 (getusershell): Use fopen_safer.
759 * save-cwd.c: Include unistd-safer.h.
760 (save_cwd): Use fd_safer.
761 * unistd-safer.h (fd_safer): New decl.
762 * Makefile.am (libfetish_a_SOURCES): Remove dup-safer.c,
763 fcntl-safer.h, fopen-safer.c, open-safer.c, stdio-safer.h,
766 2005-04-09 Jim Meyering <jim@meyering.net>
768 * fts.c (__attribute__, ATTRIBUTE_UNUSED): Define.
769 Mark parameter `sp' with ATTRIBUTE_UNUSED.
771 Avoid warnings from gcc-4.
772 * canon-host.c (canon_host) [HAVE_GETADDRINFO]: Use memset
773 rather than `= { 0 };' to initialize local `hint'.
774 * unicodeio.c (__attribute__, ATTRIBUTE_UNUSED): Define.
775 (exit_failure_callback, fallback_failure_callback): Mark unused
776 parameters with ATTRIBUTE_UNUSED.
778 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
779 -Wuninitialized: initialize tm0.tm_year.
781 * human.c (humblock): Set *options even when returning due to
782 xstrtoumax conversion failure. Thanks to a used-uninitialized
785 2005-04-08 Paul Eggert <eggert@cs.ucla.edu>
787 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
788 that might redefine system include files.
789 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
790 (my_usleep): Use NULL rather than (void *) 0.
791 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
792 Use siginterrupt to specify that system calls should be interrupted.
793 (rpl_nanosleep): Move initialization of suspended closer to call of
796 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
798 * getdate.y (parser_control): rels_seen is now a boolean, not a
799 count, since there's no maximum. All uses changed.
800 Add member dsts_seen.
801 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
803 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
804 Use pc_rels_seen to decide whther a date is absolute.
806 * getdate.y (number): Don't overwrite year.
807 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
810 2005-03-30 Paul Eggert <eggert@cs.ucla.edu>
812 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
813 * readutmp.c: Likewise. Include signal.h, stdbool.h.
814 (desirable_utmp_entry): New function.
815 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
816 using x2nrealloc, to simplify logic.
817 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
818 size calculation. Do not assume utmp file is a regular file.
819 * readutmp.h (UT_PID): Moved here from ../src/who.c.
820 (READ_UTMP_CHECK_PIDS): New constant.
822 2005-03-29 Jim Meyering <jim@meyering.net>
824 * long-options.c (long_options): Use NULL, not `0'.
826 2005-03-27 Jim Meyering <jim@meyering.net>
828 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
830 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
832 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
833 "one's complement" -> "ones' complement" in comment, as per Knuth.
834 "value of type" -> "type or expression" in comment.
835 * mktime.c, strftime.c: Propagate intprops.h comment nits.
837 2005-03-26 Jim Meyering <jim@meyering.net>
840 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
841 Correct typos: s/or/of/.
843 2005-03-23 Jim Meyering <jim@meyering.net>
845 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
847 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
849 * Makefile.am (libfetish_a_SOURCES): Remove stat-macros.h, xstrtoul.c,
850 as they are now done by Autoconf macros.
852 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
854 * gettext.h, regex.c, setenv.c, vasprintf.c: Sync from gnulib.
855 * vasnprintf.c (EOVERFLOW): Define if not already defined.
856 This merges a change from gnulib.
858 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
860 * strftime.c (my_strftime): If the underlying strftime returns 0
861 (which shouldn't happen), generate nothing instead of returning 0
862 immediately, so that nstrftime (NULL, ...) doesn't return 0.
864 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
866 * strftime.c (my_strftime): Prepend space to format so that we can
867 reliably distinguish strftime failure from empty output on POSIX
870 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
872 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
873 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
875 * strtol.c: Likewise.
877 2005-03-14 Jim Meyering <jim@meyering.net>
879 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
880 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
881 to be nonzero so that we (and caller) can detect the difference
882 between a valid zero-length expansion and an error return, even
883 when the underlying strftime fails before writing anything into
886 2005-03-11 Jim Meyering <jim@meyering.net>
888 * getdate.c: Regenerate using bison-2.0.
890 2005-03-10 Jim Meyering <jim@meyering.net>
892 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
893 so that this module works on systems without fchdir.
895 * Makefile.am (libfetish_a_SOURCES): Remove xstrtol.c and xstrtol.h.
897 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
899 Factor int-properties macros into a single file, except for
901 * intprops.h: New file.
902 * getloadavg.c: Include it instead of limits.h.
903 (INT_STRLEN_BOUND): Remove.
904 * human.c: Include intprops.h.
905 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
906 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
907 * inttostr.h: Include intprops.h instead of limits.h.
908 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
909 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
910 for consistency with intprops.h.
911 (time_t_is_integer, twos_complement_arithmetic): Use them.
912 * sig2str.h: Include <signal.h>, intprops.h.
913 (INT_STRLEN_BOUND): Remove.
914 * strftime.c (TYPE_SIGNED): Remove.
915 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
916 * strtol.c: Adjust comments to match intprops.h.
917 * userspec.c: Include intprops.h.
918 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
919 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
920 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
921 instead of rolling our own expressions.
922 * xstrtol.c: Include xstrtol.h first, to test interface.
923 * fts.c: Include intprops.h.
924 (TYPE_SIGNED): Remove.
926 2005-03-09 Jim Meyering <jim@meyering.net>
928 More migration to AC_LIBSOURCES/AC_LIBOBJ.
929 * Makefile.am (libfetish_a_SOURCES): Remove two more pairs of files:
930 cycle-check.c, cycle-check.h and argmatch.c, argmatch.h.
932 * cycle-check.c: Don't include "xalloc.h". It's not used.
934 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
936 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
937 The workaround isn't strictly needed for POSIX conformance, and
938 it's too much of a pain to configure and maintain. We'll ask
939 people to fix their kernels instead.
940 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
941 (NANOSLEEP_BUG_WORKAROUND): Remove.
942 (xnanosleep): Remove the workaround.
944 2005-02-27 Jim Meyering <jim@meyering.net>
946 * xnanosleep.c (xnanosleep): Work around bug in Linux-2.6.8.1's
947 nanosleep whereby it fails without setting errno upon being resumed
948 after being suspended.
950 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
952 * vasnprintf.c (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
953 integer overflow again. Actually, neither this nor the 2005-01-23
954 change fixes any bug on any plausible platform; it's more of a
957 * config.charset, gettext.h, localcharset.c: Sync from gnulib.
959 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
961 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
963 (my_strftime): Do not mishandle years close to INT_MAX, by doing
964 the right thing even if adding 1900 would overflow. Similarly
965 for tm_mon + 1 and tm_yday + 1.
966 Make %Y always equivalent to %C%y, and similarly for %G and %g.
967 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
968 (DO_SIGNED_NUMBER): New macro.
969 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
971 2005-02-21 Paul Eggert <eggert@cs.ucla.edu>
973 * Makefile.am (libfetish_a_SOURCES): Remove xnanosleep.c,
974 xnanosleep.h; now done by ../m4/xnanosleep.m4 automatically.
976 2005-02-20 Paul Eggert <eggert@cs.ucla.edu>
978 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
979 * timespec.h (gettime): Return void, since it always
980 succeeds now. All uses changed.
981 * gettime.c (gettime) Likewise.
982 [HAVE_NANOTIME]: Prefer nanotime.
983 Assume gettimeofday succeeds, as POSIX requires.
984 Assime time () succeeds, since other code already does.
985 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
986 (timespec_subtract): Remove.
987 (NANOSLEEP_BUG_WORKAROUND): New constant.
988 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
989 things considerably. Use it only on GNU/Linux hosts, since the
990 workaround shouldn't be needed elsewhere.
992 2005-02-20 Neil Conway <neilc@samurai.com>
994 * xgethostname.c (xgethostname): Check for ENOMEM, which is
995 returned by OSX/Darwin if the specified buffer is not large
996 enough for the hostname.
998 2005-02-20 Jim Meyering <jim@meyering.net>
1001 * Makefile.am (libfetish_a_SOURCES): Remove
1002 linebuffer.[ch] and stripslash.c.
1004 2005-02-11 Jim Meyering <jim@meyering.net>
1006 Remove names of files that are now mentioned in AC_LIBSOURCES
1007 and AC_LIBOBJ uses in inttostr.m4.
1008 * Makefile.am (libfetish_a_SOURCES): Remove imaxtostr.c,
1009 offtostr.c, and umaxtostr.c.
1010 (EXTRA_DIST): Remove inttostr.c and inttostr.h.
1012 2005-02-08 Jim Meyering <jim@meyering.net>
1014 * Makefile.am (libfetish_a_SOURCES): Remove memcasecmp.c
1017 2005-02-07 Jim Meyering <jim@meyering.net>
1019 * Makefile.am (libfetish_a_SOURCES): Remove fts.c, fts_.h, and
1020 getcwd.h now that they're mentioned in AC_LIBSOURCES and AC_LIBOBJ
1021 uses in the corresponding ../m4/*.m4.
1023 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
1025 * memrchr.h: New file.
1026 * chdir-long.c: Include it.
1027 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>.
1028 Don't bother including stddef.h.
1030 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
1032 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
1034 Include <sys/types.h>, for dev_t.
1035 (ME_DUMMY, ME_REMOTE): Move from here....
1036 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
1037 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
1039 Include mountlist.h first, to test the interface.
1041 2005-01-29 Jim Meyering <jim@meyering.net>
1043 * Makefile.am (libfetish_a_SOURCES): Remove many files from this
1044 list, now that automake determines their names automatically,
1045 thanks to the new AC_LIBSOURCES and AC_LIBOBJ uses in the
1046 corresponding ../m4/*.m4 files.
1047 (EXTRA_DIST): Add getdate.c here, so that we continue to distribute it.
1049 2005-01-25 Jim Meyering <jim@meyering.net>
1051 * path-concat.c: Don't include assert.h.
1052 (path_concat): Remove assertion that would have triggered
1053 for ABASE starting with more than one slash.
1054 Reported by Andreas Schwab.
1056 * path-concat.c (path_concat): Set *BASE_IN_RESULT
1057 properly when ABASE is an absolute file name.
1058 Correct the description of this function.
1060 Add an assertion and a test driver.
1061 This fixes a bug introduced on 2004-07-02.
1062 Andreas Schwab reported the resulting failure of cp --parents:
1063 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
1065 2005-01-23 Jim Meyering <jim@meyering.net>
1067 * vasnprintf.c (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
1070 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
1073 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1074 not needed. This removes a dependency on the gettext module.
1075 [defined _LIBC]: Do not include <libintl.h>; not needed.
1077 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
1079 * save-cwd.c (save_cwd): Remove code to support the case
1080 where fchdir is missing or flaky.
1082 * Makefile.am (libfetish_a_SOURCES): Add version-etc-fsf.c.
1084 2005-01-20 Simon Josefsson <jas@extundo.com>
1086 * version-etc-fsf.c: New file, with version_etc_copyright.
1087 * version-etc.c: Remove version_etc_copyright.
1088 * version-etc.h (version_etc_copyright): Use [] instead of * in
1089 prototype, suggested by Paul Eggert.
1091 2005-01-19 Jim Meyering <jim@meyering.net>
1093 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
1094 same value as for Solaris 9.
1096 * chdir-long.c (chdir_long): Rewrite to remove limitation on
1097 component length. This included changing the parameter to be
1098 of type `char *' rather than `char const *'.
1099 * chdir-long.h (chdir_long): Update prototype.
1100 * t-chdir-long: A test harness to exercize chdir-long.c's
1101 sample main program.
1103 * openat.c (fdopendir, fstatat): New functions.
1104 * openat.h: Include headers required for use of DIR and struct stat.
1105 [AT_SYMLINK_NOFOLLOW]: Define.
1106 (fdopendir, fstatat): Add prototypes.
1108 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
1110 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
1111 definitions to be after all include files, to avoid collisions.
1112 Problem reported by Bob Proulx.
1114 2005-01-04 Bob Proulx <bob@proulx.com>
1116 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
1117 offsetof() macro construct to avoid compile failure with native HP-UX
1118 11.0 ANSI C compiler.
1120 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
1122 * utimens.c (futimens): Robustify the previous patch, by checking
1123 for known valid error numbers rather than observed invalid ones.
1125 2005-01-03 Jim Meyering <jim@meyering.net>
1127 * utimens.c (futimens): Account for the fact that futimes
1128 can also fail with errno == ENOSYS in that case.
1129 Patch from Dmitry V. Levin.
1131 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
1133 * utimens.c (futimens) [HAVE_FUTIMES]: Fall back on utimes if
1134 futimes fails with errno == ENOENT. Problem reported by
1137 2005-01-02 Jim Meyering <jim@meyering.net>
1139 * version-etc.c (version_etc_copyright): Update copyright date.
1141 2004-12-31 Jim Meyering <jim@meyering.net>
1143 * openat.c (rpl_openat): Correct comment.
1144 Call free_cwd, to avoid leaking a file descriptor.
1146 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
1148 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1149 need to extend the stack.
1150 (YYINITDEPTH): New macro, so that the initial stack isn't overly
1153 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1155 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1158 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1159 Remove now-obsolete comment about AIX.
1160 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1161 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1162 (YYMAXDEPTH): New macro.
1164 2004-12-11 Jim Meyering <jim@meyering.net>
1166 * chdir-long.c: Fail via #error if PATH_MAX is not defined, since
1167 this file is now compiled only on systems that define PATH_MAX.
1169 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1171 * getdate.y (textint): New member "negative".
1172 (time_zone_hhmm): New function.
1173 Expect 14 shift-reduce conflicts, not 13.
1174 (o_colon_minutes): New rule.
1175 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1176 (yylex): Set the "negative" member of signed numbers.
1178 2004-12-06 Jim Meyering <jim@meyering.net>
1180 * Makefile.am (libfetish_a_SOURCES): Begin removing .c and .h file
1181 names, as they are added to AC_LIBSOURCES directives in the
1182 corresponding m4/*.m4 files.
1184 2004-12-05 Jim Meyering <jim@meyering.net>
1186 Currently, fpending.m4 punts (by defining PENDING_OUTPUT_N_BYTES
1187 to 1) if it doesn't find a valid expression for the replacement
1188 function. Before this change, that might have gone undetected
1189 for some time. Now, we'll catch it close to the source.
1191 * t-fpending.c: New file. Test the __fpending function.
1192 This ensures that if there is an error in the definition of the
1193 PENDING_OUTPUT_N_BYTES expression, we'll find about it right away;
1194 that value is used only in the rare event that close_stdout's
1195 fclose fails with EBADF.
1196 * Makefile.am (unit-test): New target.
1197 (check): Depend on it.
1198 (noinst_PROGRAMS): Define.
1200 * Makefile.am (unit-test): Depend on t-fpending.
1201 Make the target .PHONY.
1203 2004-12-02 Paul Eggert <eggert@cs.ucla.edu>
1205 * openat.c: Include "openat.h" before other include files.
1206 Include "exitfail.h".
1207 (openat): Remove #undef; no longer needed now that we include openat.h
1209 (rpl_openat): Add comment about mode_t promotion. Simplify
1210 code a bit by moving initializations around. Use exit_failure
1211 rather than EXIT_FAILURE.
1212 * openat.h: Add copyright and authorship notice.
1213 (AT_FDCWD): Use the same value Solaris 9 uses, except of type
1214 'int' not 'unsigned int'.
1216 * save-cwd.c: Include "save-cwd.h" before other include files.
1217 (O_DIRECTORY): Remove; not needed here, since "." must be
1218 a directory. All uses removed.
1219 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
1220 universal on Suns, and we also need to test for IRIX.
1221 Revamp code to use 'if' rather than '#if'.
1222 Avoid unnecessary comparison of cwd->desc to 0.
1224 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
1226 * hard-locale.c: Assume <locale.h> exists.
1228 (GLIBC_VERSION): New macro.
1229 (hard_locale): Assume setlocale exists.
1230 Rewrite to avoid #ifdef.
1231 Use strdup rather than malloc + strcpy.
1232 * human.c: Assume <locale.h> exists.
1233 (human_readable): Assume localeconv exists.
1235 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1237 * getcwd.c (is_ENAMETOOLONG): New macro.
1238 (__getcwd.c): Don't restore errno; glibc doesn't.
1239 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1240 first, falling back to our code only if its results look suspicious.
1241 Ensure that the resulting buffer is only as large as necessary.
1243 * readutmp.c: Include readutmp.h first.
1244 Include <errno.h>, since readutmp.h no longer does that.
1245 * readutmp.h: Don't include <errno.h>,
1246 <sys/param.h>, <time.h>; not needed to establish interface.
1247 (errno): Remove decl.
1248 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1249 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1250 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1252 2004-11-30 Jim Meyering <jim@meyering.net>
1254 Change the name of the robust chdir function from chdir to chdir_long.
1255 * save-cwd.c: Include chdir-long.h rather than chdir.h.
1256 (restore_cwd): Use chdir_long, not chdir.
1257 * chdir-long.c: Renamed from chdir.c.
1258 * chdir-long.h: Renamed from chdir.h.
1259 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd.
1260 * Makefile.am (libfetish_a_SOURCES): Reflect name changes.
1262 * chdir.c (O_DIRECTORY): Define, if necessary.
1263 (memchrcspn): Tiny wrapper around memchr.
1264 (rpl_chdir): Use memchrcspn rather than strcspn.
1266 2004-11-28 Jim Meyering <jim@meyering.net>
1268 * openat.c (rpl_openat): Also accept optional mode parameter.
1269 * openat.h (rpl_openat): Adjust prototype.
1271 * save-cwd.c: Include "chdir.h", so that if save_cwd/getcwd
1272 saves a name longer than PATH_MAX, restore_cwd's chdir can use it.
1274 * Makefile.am (libfetish_a_SOURCES): Add chdir.h and openat.h.
1276 This is a robust version of chdir, in that it can handle directory
1277 names longer than PATH_MAX.
1278 * chdir.c, chdir.h: New file.
1279 * openat.c, openat.h: New files.
1281 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1283 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1284 HP's ANSI C compiler.
1285 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1286 Declaring int functions causes warnings on some modern systems and
1287 shouldn't be needed to compile on ancient ones.
1288 * same.c (MIN) [defined MIN]: Don't define, since it's already
1291 * mempcpy.c, mempcpy.h: New files, taken from gnulib.
1292 * Makefile.am: (libfetish_a_SOURCES): Add getcwd.h, mempcpy.h.
1293 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1294 with the following changes.
1295 (__set_errno): Parenthesize properly.
1296 Include <stdbool.h>.
1297 (MIN, MAX, MATCHING_INO): New macros.
1298 (__getcwd): Define with prototype, not K&R form.
1299 Use heuristics to allocate default buffer on stack if possible.
1300 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1301 behavior, and to avoid the PATH_MAX limit when computing
1303 Use MATCHING_INO to compare inode number to file.
1304 Check for arithmetic overflow in size calculations.
1305 Fix bug in reallocation of dot array that caused getcwd to fail
1306 on directories nested deeper than 75.
1307 Be more careful about saving errno on error.
1308 Do not use realloc; use only free+malloc, as this is a bit
1309 more flexible and avoids a needless copy operation.
1310 Do not inspect st_dev and st_ino for symbolic links; POSIX
1311 doesn't specify the latter.
1312 Check for closedir errors.
1313 Avoid needless casts.
1314 Use "#ifdef weak_alias" around weak_alias, to be like other
1316 The following changes to getcwd.c have effect only when used in
1317 gnulib; they have no effect inside glibc proper.
1318 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1319 as alloca isn't used.
1320 (alloca, __alloca): Likewise.
1321 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1322 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1323 unconditionally, as gnulib assumes C89 or better.
1324 Do not include <sys/param.h>.
1325 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1326 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1328 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1329 Include <dirent.h> in a way that is compatible with modern Autoconf.
1330 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1331 New macros, if not already defined.
1332 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1333 Use "_LIBC", not "defined _LIBC", for consistency.
1334 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1336 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1337 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1338 * xgetcwd.c: David MacKenzie's old code was removed, so give
1339 credit only to Jim Meyering and adjust the copyright dates.
1340 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1341 <stdlib.h>, <unistd.h>, "pathmax.h".
1342 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1343 (INITIAL_BUFFER_SIZE): Remove.
1344 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1346 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1348 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1349 (futimens): New function, which uses futimes if available.
1350 (futimens, utimens): Support timespec==NULL, with same semantics
1351 as utime and utimens.
1352 * utimens.h (futimens): New decl.
1354 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1356 * getopt_.h: Re-addition of __getopt_argv_const caused
1357 redefinition warnings. To avoid them, include the defines
1358 in `#if !defined __need_getopt ... #endif'. The only place
1359 where __getopt_argv_const is used is in definitions
1360 of getopt_long and getopt_long_only below, which are as well
1361 protected by `#ifndef __need_getopt'.
1362 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1363 __need_getopt after including <stdio.h> and <unistd.h> These
1364 headers might have defined it.
1366 2004-11-23 Jim Meyering <jim@meyering.net>
1368 * closeout.c: Revert last change, since it seems EBADF is always
1371 2004-11-22 Jim Meyering <jim@meyering.net>
1373 * closeout.c (EBADF): Fail with `#error ...' if it's not defined,
1374 asking the user to report the problem.
1376 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1378 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1379 might fail. Problem reported by Yoann Vandoorselaere.
1380 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1381 that mishandle size_t overflow.
1383 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1385 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1386 (xgetcwd): Set errno correctly when failing.
1387 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1388 the failure is actually due to a PATH_MAX problem.
1390 Further getopt changes to make it more likely that glibc will
1391 buy the changes back.
1392 * getopt.c (POSIXLY_CORRECT): New constant.
1393 (getopt): Use it, so to preserve glibc semantic
1394 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1395 when compiling for libc.
1396 * getopt_.h (__getopt_argv_const): Bring it back.
1397 (getopt_long, getopt_long_only): Use it.
1399 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1400 New arg POSIXLY_CORRECT. All callers changed.
1401 (getopt): Argv is now char * const *, as per standard.
1402 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1403 not char *__getopt_argv_const *.
1404 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1405 _getopt_long_only_r): Likewise.
1406 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1407 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1408 _getopt_long_r, _getopt_long_only_r): Likewise.
1409 * getopt_.h (__getopt_argv_const): Remove.
1410 (getopt): Argv is now char * const *, as per standard.
1412 * canon-host.c: Include "strdup.h".
1413 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1414 Use strdup instead of malloc/strcpy to duplicate strings.
1416 * getdate.y (tORDINAL): New token.
1417 (day, relunit): Allow it for relative times.
1418 (relative_time_table): Use tORDINAL for ordinals.
1420 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
1422 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1423 (human_space_before_unit): New constant.
1424 * human.c (human_readable): Support it.
1426 2004-11-14 Jim Meyering <jim@meyering.net>
1428 * closeout.c (close_stdout): Don't fail just because stdout was
1429 closed initially, since some programs don't write to stdout in the
1430 normal course of operation (other than --version and --help), and
1431 we don't want this function to make e.g. `cp 1 2 >&-' fail.
1432 But do fail if it was closed and someone has tried to write to it.
1433 E.g., printf foo >&-
1435 * __fpending.c, __fpending.h: Restore these files.
1436 They're useful after all.
1437 * Makefile.am (libfetish_a_SOURCES): Add __fpending.h.
1439 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1441 * getopt.c, getopt1.c, getopt_.h, getopt_int.h:
1444 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1446 * allocsa.h, mbswidth.c, mktime.c, readlink.c, getdate.y,
1447 quotearg.c, strftime.c: Sync from gnulib.
1449 2004-11-06 Jim Meyering <jim@meyering.net>
1451 * __fpending.c, __fpending.h: Remove files.
1453 * Makefile.am (libfetish_a_SOURCES): Remove __fpending.h, now
1454 that it's no longer used.
1456 Ensure that no close failure goes unreported.
1457 * closeout.c (close_stdout): Always close stdout. I.e., don't
1458 return early when it seems there's nothing to flush.
1459 Don't include __fpending.h.
1461 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1463 * unsetenv.c: New file, from gnulib. Needed for new getdate.y.
1464 * Makefile.am (libfetish_a_SOURCES): Remove setenv.c.
1465 * xreadlink.c: Sync from gnulib.
1467 2004-11-03 Jim Meyering <jim@meyering.net>
1469 * Makefile.am (libfetish_a_SOURCES): Add setenv.c and setenv.h.
1471 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1473 * getdate.y, getpass.c, setenv.h: Sync from gnulib.
1475 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1477 * getdate.y, getpagesize.h, mktime.c: Sync from gnulib.
1479 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1481 * mktime.c (leapyear): Arg is long int, not int.
1482 Change imported from gnulib.
1484 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
1487 * diacrit.c, diacrit.h: Add copyright notice.
1488 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1489 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1492 2004-10-13 Jim Meyering <jim@meyering.net>
1494 * fts.c (fts_read): When about to fail (by returning NULL) due
1495 to a failed fchdir or failed fts_safe_changedir call, set
1496 `sp->fts_cur = p'. Do this by removing the explicit `return NULL;'
1497 statements and setting p->fts_errno so execution falls through
1498 to the common-case code below. Otherwise, after such a failure,
1499 calling fts_close would attempt to free an already-freed buffer.
1500 Reported by Luis Lopez Lopez in http://bugs.debian.org/276352.
1502 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1506 * xalloc.h (xmemdup): Renamed from xclone.
1507 * xmalloc.c (xmemdup): Likewise.
1508 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1509 XFREE): Remove these long-obsolescent macros.
1510 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1511 * xstrdup.c: Remove.
1513 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1514 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1515 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1516 regex.c, sha1.c, version-etc.c, yesno.c:
1517 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1518 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1519 the includer's responsibility.
1521 2004-10-03 Paul Eggert <eggert@cs.ucla.edu>
1524 * dirfd.h, getpagesize.h: Add copyright notice.
1525 * vasnprintf.c: (VASNPRINTF): Set errno=EOVERFLOW if the output is
1527 * vasnprintf.h: Doc fix.
1528 * vasprintf.c: Don't include <limits.h>.
1529 (vasprintf): Rely on vasnprintf to set errno=EOVERFLOW.
1531 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
1533 * modechange.c (mode_compile): Don't decrement a pointer that
1534 points to the start of a string, as the C Standard says the
1535 resulting behavior is undefined.
1537 2004-09-22 Jim Meyering <jim@meyering.net>
1539 * getopt.c: Remove extraneous spaces before TAB.
1540 * getopt_.h: Likewise.
1542 * backupfile.c: Remove trailing blanks.
1543 * euidaccess.c: Likewise.
1545 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1547 * backupfile.h (enum backuptype): Rename none -> no_backups,
1548 simple -> simple_backups, numbered_existing ->
1549 numbered_existing_backups, numbered -> numbered_backups
1550 to avoid shadowing problems. All uses changed.
1551 * argmatch.c (enum backuptype): Likewise.
1552 * backupfile.c (check_extension, numbered_backup):
1553 Rename locals to avoid shadowing 'basename'.
1554 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1557 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
1559 Port to diet libc. Problem reported by Felix von Leitner in
1560 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html>
1561 * fts.c (fts_stat, fts_open, fts_read): Use "unsigned short int"
1562 rather than the unportable "u_short", and similarly for u_int.
1563 * fts_.h (FTSENT): Likewise.
1565 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1567 * getopt.c, getopt1.c: Sync from gnulib.
1568 * getopt_.h: Renamed from getopt.h (this syncs from gnulib).
1569 * Makefile.am (libfetish_a_SOURCES): Remove getopt.c, getopt.h,
1570 getopt1.c, getopt_int.h.
1571 (BUILT_SOURCES, EXTRA_DIST, all-local, $(lib_OBJECTS), getopt.h,
1572 MOSTLYCLEANFILES): Add current gnulib snippet for getopt.
1573 * .cppi-disable: Add getopt_.h, getopt_int.h.
1574 * .cvsignore: Add getopt.h.
1576 2004-08-18 Paul Eggert <eggert@cs.ucla.edu>
1578 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1579 strings on unbounded length. alloca's performance benefits aren't
1580 that important here.
1582 (parse_with_separator): New function, with most of the internals
1583 of the old parse_user_spec. Allow user to omit both user and group,
1584 for compatibility with FreeBSD.
1585 Clone only the user name, not the entire spec.
1586 Do not set *uid, *gid unless entirely successful.
1587 Avoid memory leak in some failing cases.
1588 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1589 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1590 (parse_user_spec): Rewrite to use parse_with_separator.
1592 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1594 * fts.c (O_DIRECTORY): Define to 0 if the system doesn't define.
1596 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1598 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1599 (union fooround): Use uintmax_t, not long int.
1600 The rest is a merge from libc:
1601 [defined _LIBC]: Include <shlib-compat.h>.
1602 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1604 * xgethostname.c: Do not include error.h. (merge from gnulib).
1606 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1607 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1608 for Reliant Unix 5.43.
1610 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1612 * Makefile.am (libfetish_a_SOURCES): Add getpass.h.
1613 * getpass.h: New file.
1614 * .cpp-disable: Add it.
1615 * getpass.c [!_LIBC]: Include it.
1617 * obstack.h (obstack_empty_p):
1618 Don't assume that chunk->contents is suitably aligned.
1619 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1620 Likewise. Problem reported by Benno in
1621 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1623 * chown.c (rpl_chown): Work even if the file is writeable but not
1624 readable. This could be improved further but it'd take some work.
1625 * fts.c (diropen): New function.
1626 (fts_open, fts_read, fts_children, fts_safe_changedir):
1627 Use it, so that the code works even if the directory
1628 is writeable but not readable. We'd like it to work even if
1629 the directory is merely executable, but I don't know how to do
1632 * xalloc-die.c: New file.
1633 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1635 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1636 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1637 (_, N_, xalloc_die): Move to xalloc-die.c.
1638 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1639 so that we needn't mess with xalloc_msg_memory_exhausted.
1641 * sha1.h (sha1_ctx): Renamed from sha_ctx.
1642 (sha1_init_ctx): Renamed from sha_init_ctx.
1643 (sha1_process_block): Renamed from sha_process_block.
1644 (sha1_process_bytes): Renamed from sha_process_bytes.
1645 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1646 (sha1_read_ctx): Renamed from sha_read_ctx.
1647 (sha1_stream): Renamed from sha_stream.
1648 (sha1_buffer): Renamed from sha_buffer.
1651 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
1653 * canonicalize.h, cycle-check.h, stat-macros.h, strdup.h,
1654 strftime.h, xnanosleep.c: Merge from gnulib.
1656 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1658 Merge with gnulib and deal with some minor cleanups resulting.
1660 * .cppi-disable: Change fnmatch.h to fnmatch_.h.
1661 * .cvsignore: Add fnmatch.h, poll.h, stdbool.h, sysexit.h.
1662 Remove safe-lstat.c, safe-lstat.h, safe-stat.c, safe-stat.h.
1664 * backupfile.h, closeout.h, full-write.h, mbswidth.h, xalloc.h:
1665 Add extern "C" wrappers for C++.
1667 * dirname.h (IS_ABSOLUTE_FILE_NAME): Port to DOS.
1669 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1671 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1672 (ENOSYS): Define if not defined.
1673 (settime): Fall back on stime if it exists and settimeofday fails.
1674 But don't bother with fallbacks if a method fails with errno == EPERM.
1676 * obstack.h: Add white space.
1678 * printf-parse.c, printf-parse.h, vasnprintf.c: Merge changes from
1679 gnulib, but rewrite to avoid "xsize.h".
1681 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
1683 * mountlist.c (SIZE_MAX): Define after including files, to avoid
1684 a collision on OpenBSD 3.4.
1686 * fts.c (LONGEST_MODIFIER): New macro.
1687 (PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro.
1688 (find_matching_ancestor): Use it for dev_t and ino_t.
1690 * getndelim2.c: Sync from gnulib.
1692 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1693 sometimes returns a positive errno value even when it succeeds.
1694 (print_errno_message) [!LIBC]: Fall back on strerror if
1697 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
1699 * canonicalize.c (errno): Remove decl; we now assume C89 or better.
1700 * chown.c (errno): Likewise.
1701 * closeout.c (errno): Likewise.
1702 * dup-safer.c (errno): Likewise.
1703 * dup2.c (errno): Likewise.
1704 * exclude.c (errno): Likewise.
1705 * fopen-safer.c (errno): Likewise.
1706 * ftruncate.c (errno): Likewise.
1707 * full-write.c (errno): Likewise.
1708 * getcwd.c (errno): Likewise.
1709 * lchown.c (errno): Likewise.
1710 * memcoll.c (errno): Likewise.
1711 * nanosleep.c (errno): Likewise.
1712 * putenv.c (errno): Likewise.
1713 * rmdir.c (errno): Likewise.
1714 * same.c (errno): Likewise.
1715 * savedir.c (errno): Likewise.
1716 * setenv.c (errno): Likewise.
1717 * stat.c (errno): Likewise.
1718 * utime.c (errno): Likewise.
1719 * xgetcwd.c (errno): Likewise.
1720 * xmemcoll.c (errno): Likewise.
1721 * xreadlink.c (errno): Likewise.
1722 * xstrtol.c (errno): Likewise.
1723 * canonicalize.h (enum canonicalize_mode_t): Reformat comments to
1725 * fileblocks.c (textutils_fileblocks_unused): Make it a typedef
1726 instead of an int, to save a few bytes in the object file.
1727 * getdate.y (lookup_word): Rewrite to avoid cast.
1728 * getloadavg.c: Include <stdbool.h>.
1729 (getloadavg_initialized): Use bool for booleans.
1730 * hard-locale.c (hard_locale): Return bool, not int.
1731 * hard-locale.h (hard_locale): Likewise. Include <stdbool.h>.
1732 * hash.c (hash_string): Rewrite to avoid cast.
1733 * human.h: Use Autoconf-suggested pattern for inttypes and stdint.
1734 * strtiomax.c: Likewise.
1735 * xstrtol.h: Likewise.
1736 * nanosleep.c: Include stdbool.h.
1737 (rpl_nanosleep): Usee bool for booleans.
1738 * quotearg.c: Include stdbool.h.
1739 (quotearg_buffer_restyled): Use bool for booleans.
1740 * readtokens.c (readtoken): Rewrite to avoid casts.
1741 * same.c (same_name): Return bool, not int.
1742 * same.h (same_name): Likewise. Include <stdbool.h>.
1743 * version-etc.c (version_etc_va): Use size_t for sizes.
1744 * xnanosleep.c: Include limits.h, stdbool.h.
1746 (timespec_subtract, xnanosleep): Use bool for booleans.
1747 * xstrtoimax.c: Just include xstrtol.h rather than rolling our
1748 own include pattern.
1749 * xstrtoumax.c: Likewise.
1750 * xstrtol.c (__xstrtol): Rewrite to avoid casts.
1751 * yesno.c: Include yesno.h first.
1752 (yesno): Return bool, not int.
1753 * yesno.h (yesno): Likewise. Include <stdbool.h>.
1755 * xstrtod.h (xstrtod): Return bool, not int. Invert the
1756 sense of the boolean. All uses changed.
1757 * xstrtod.c (xstrtod): Likewise.
1758 * nanosleep.c: Include stdbool.h. Use bool for booleans.
1760 * xgethostname.c: Don't include <sys/types.h> or "exit.h";
1762 (errno): Remove decl; we now assume C89 or better.
1763 Include unistd.h if available, for gethostname.
1764 (ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with
1765 existing errno values if any.
1766 (gethostname): Remove decl, since unistd.h declares it (or doesn't,
1767 in which case it's an older system and it should just work).
1768 (xgethostname): Don't assume host name length is less than INT_MAX.
1769 Exit if malloc fails, just as the comment says.
1771 * save-cwd.c: Include <stdbool.h>.
1772 (errno): Remove decl; we now assume C89 or better.
1773 (save_cwd): Use bool for booleans.
1774 (save_cwd, restore_cwd): Return -1 on failure, not 1, since we set
1777 * readutmp.h (UT_USER): Parenthesize properly.
1778 (UT_USER_SIZE): New constant.
1779 (read_utmp): Don't assume that the number of users is less than
1781 * readutmp.c (read_utmp): Likewise.
1782 Check for integer overflow in size calculations.
1783 Return -1 (not 1) on failure, since we set errno in that case.
1785 * posixtm.c (posix_time_parse): Don't assume that the length of
1786 the string being parsed is <= UINT_MAX.
1788 * mountlist.h (read_file_system_list): Accept bool flag, not int.
1789 * mountlist.c (read_file_system_list): Likewise.
1790 * mountlist.h: Include <stdbool.h>.
1791 * mountlist.c (errno): Remove decl; we now assume C89 or better.
1792 (xatoi): Remove; replaced by strtoul. Hence device numbers can now
1795 * isdir.c: Remove; no longer needed.
1796 * Makefile.am (libfetish_a_SOURCES): Remove isdir.c.
1798 * fts_.h: Add an FSF copyright notice, since our changes are becoming
1801 * fts_.h: Include stddef.h, for ptrdiff_t.
1802 (FTS.fts_nitems): Now size_t, not int, for hosts that allow more
1803 than INT_MAX entries in a directory.
1804 (FTS_ROOTPARENTLEVEL): Parenthesize properly.
1805 (FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
1806 than INT_MAX levels deep on 64-bit hosts.
1807 (FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
1808 the Hurd that don't have arbitrary limits on directory entry lengths.
1809 (FTSENT.fts_statp): Now an array, not a pointer, so that we don't
1810 have to play unportable games with pointer arithmetic. Keep it array
1811 for the benefit of user code that assumes it is a pointer.
1812 * fts.c: Include stdint.h if available, as Autoconf suggests.
1813 (ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
1815 (fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
1816 Use size_t for sizes.
1817 (fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
1819 Use bool when appropriate.
1820 (SIZE_MAX, TYPE_SIGNED): New macros.
1821 (fts_read): Use u_short for instructions.
1822 (fts_build): Use ptrdiff_t for levels. Don't assume file name lengths
1823 fit into int. Don't assume nlink_t is signed.
1824 (find_matching_ancestor): Don't assume dev, ino fit in int.
1825 (fts_stat): Use function prototype; required for bool arg.
1826 (fts_sort): Detect integer overflow in size calculations.
1827 (fts_alloc): Simplify allocation code, now that fts_statp is an array
1830 * fsusage.h: Include <stdbool.h>.
1831 (struct fs_usage): Use uintmax_t for block sizes, so that they're
1832 not limited to INT_MAX.
1833 Use bool for booleans.
1834 * fsusage.c: Use Autoconf-suggested pattern for inttypes and stdint.
1835 Include unistd.h, for lseek.
1837 * fnmatch.c: Include <stdbool.h>.
1838 (errno): Remove decl; we now assume C89 or better.
1839 * fnmatch_loop.c (EXT, FCT): Use bool when appropriate.
1840 (FCT): Use size_t, not unsigned int, for sizes.
1841 (EXT): Use size_t, not int, for sizes.
1843 * stripslash.c (strip_trailing_slashes): Now returns bool.
1844 * dirname.h (strip_trailing_slashes): Likewise.
1845 Include <stdbool.h>.
1846 * dirname.c (dir_name): Use bool when appropriate.
1848 * argmatch.h (argmatch, __xargmatch_internal, argmatch_invalid):
1849 Use ptrdiff_t, not int, when counting arguments, to allow more
1850 than INT_MAX arguments.
1851 * argmatch.c: Likewise. Use bool when appropriate.
1853 2004-08-01 Paul Eggert <eggert@cs.ucla.edu>
1855 * safe-read.c (errno): Remove decl; we now assume C89 or better.
1856 (safe_rw): Don't work around Tru64 bug unless the bug symptoms
1857 manifest themselves. This allows us to do proper reads and writes
1858 on other hosts, e.g., "dd" with a block size greater than 2**31.
1860 * md5.c (UNALIGNED_P): Use size_t; in practice, this is just as
1861 good as uintptr_t in checking for alignments, and has fewer
1862 configuration hassles.
1863 * sha1.c (UNALIGNED_P): Likewise.
1864 * md5.h: Don't include <limits.h>. Include <inttypes.h> if available,
1865 as it defines symbols like UINT32_MAX on Solaris 8.
1866 (md5_uint32): Assume uint32_t exists; Autoconf will define it
1867 otherwise (if the host has a 32-bit unsigned type, anyway).
1868 * memchr.c: Don't include inttypes.h or stdint.h.
1869 (UNALIGNED_P): Remove.
1870 (__memchr): Use size_t, not uintptr_t, to test alignment.
1871 * memrchr.c: Likewise, for __memrchr.
1873 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
1875 * makepath.h: Include <stdbool.h>.
1876 (make_path, make_dir): Use bool, not int, since we're not setting
1878 Use mode_t for modes, not int. All uses changed.
1879 * makepath.c: Likewise.
1880 (errno): Remove decl; no longer needed since we assume C89.
1882 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
1884 * modechange.c: Include <stdbool.h>.
1885 (mode_compile): Use bool when appropriate.
1887 * memchr.c (UNALIGNED_P): Use sizeof, not alignof, for better
1888 performance on m68k-linux. Reported by Andreas Schwab in
1889 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00104.html>.
1890 * memrchr.c (UNALIGNED_P): Likewise.
1892 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
1894 * userspec.c: Include <stdbool.h>, "inttostr.h".
1895 (V_STRDUP): Don't assume the string's length fits in int.
1896 (ISDIGIT): unsigned -> unsigned int
1897 (is_number): Define only ifdef __DJGPP__; not needed elsewhere.
1898 Use bool instead of int where appropriate.
1899 Do not allow empty strings.
1900 (parse_user_spec): Parse numbers as decimal integers, even if
1901 they have a leading 0. Don't assume uids and gids fit in int.
1903 * memchr.c: Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
1904 (LONG_MAX_32_BITS): Remove.
1905 Include <inttypes.h> and <stdint.h> if available.
1906 (alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
1907 (__memchr): Don't assume unsigned long int is either 4 or 8 bytes;
1908 let it be any number of bytes greater than or equal to 4.
1909 * memrchr.c: Likewise, with __memrchr.
1911 * md5.h: Include <stdint.h> if HAVE_STDINT_H || _LIBC, not
1913 (md5_uint32): Use uint32_t if available. Simplify fallback ifdefs.
1914 * md5.c: Don't include <sys/types.h> or <stdlib.h>; <stddef.h>
1915 suffices with C89 or better.
1916 (alignof): New macro, portable to all C89 hosts.
1917 (UNALIGNED): Use it. Use uintptr_t if available, and assume
1918 everything is unaligned otherwise; this is more portable than
1919 assuming 'unsigned long int' will always work.
1922 * getugroups.c: Include <errno.h>.
1923 (EOVERFLOW): Define if not defined.
1924 (getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
1927 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
1929 * euidaccess.c [HAVE_LIBGEN_H]: Include <libgen.h>, for
1930 eaccess on Solaris and SVR4-like systems.
1931 (euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
1933 cycle-check integer overflow fixup.
1935 * cycle-check.h: Remove now-inaccurate comment about the files
1936 you need to include first. You don't need to include any files
1937 other than the usual config.h.
1938 Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
1939 Remove 'struct stat;' not needed since we know sys/stat.h has
1940 been included by dev-ino.h.
1941 (struct cycle_check_state): Change chdir_counter to uintmax_t,
1942 not size_t, since it isn't limited by object sizes.
1943 Change magic from long unsigned int to int; that's good enough
1945 * cycle-check.c (is_zero_or_power_of_two): Renamed from
1946 is_power_of_two, to reflect better what it really does.
1947 All uses changed. Arg is now uintmax_t, not unsigned int
1948 (it should have been unsigned long int -- that was a bug).
1949 (cycle_check): Check for integer overflow in cycle count,
1950 and report a cycle if that happens, as it must be a cycle
1953 backupfile.c rewrite to avoid arbitrary limits on lengths of
1954 numeric backup extensions.
1956 * addext.c: Remove; no longer needed.
1957 * Makefile.am (libfetish_a_SOURCES): Remove addext.c.
1958 * backupfile.h (addext): Remove decl.
1959 * backupfile.c: Include "backupfile.h" first.
1960 Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h.
1961 (CLOSEDIR, INT_STRLEN_BOUND): Remove.
1962 (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro.
1963 (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro.
1964 (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we
1965 also look at _XOPEN_NAME_MAX, for better performance on modern
1966 hosts that support only file names of length 255 or more.
1967 (ISDIGIT): unsigned -> unsigned int
1968 (max_backup_version, version_number): Remove.
1969 (check_extension): New function. Similar to the old addext, but
1970 static, assumes that the extension has already been added,
1971 and a bit more careful on DOS hosts.
1972 (numbered_backup): New function. It does what max_backup_version
1973 and version_number used to do, but it doesn't use integer arithmetic
1974 to calculate extensions so it doesn't overflow.
1975 (find_backup_file_name): Rewrite to use these new functions.
1976 This has a new optimization: we needn't call pathconf if the
1977 new numbered backup name has the same length as the old.
1978 Also, use xmalloc rather than malloc, so that the caller
1979 needn't worry about memory exhaustion.
1981 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
1983 * euidaccess.c [!defined LIBC]: Included group-member.h, stat-macros.h.
1984 (S_IXUSR, S_IXGRP, S_IXOTH, S_IROTH, S_IWOTH, S_IXOTH):
1985 Remove; now done by stat-macros.h.
1986 (NGROUPS_MAX, group_member): Remove; now done by group-member.h.
1987 No need to include <limits.h>.
1988 (errno): Remove decl; we now assume C89 or better.
1989 (access, getuid, getgid, geteuid, getegid, stat) [defined _LIBC]:
1991 (uid, gid, have_ids): Remove these static variables.
1992 They weren't accurate for programs that also invoked setreuid etc.
1993 (euidaccess) [defined EFF_ONLY_OK || defined ACC_SELF ||
1994 HAVE_DECL_EACCSS]: Use builtin substitutes.
1995 [defined _LIBC]: Ignore __libc_enable_secure; it's not a
1996 correct optimization for programs run as root that later
1998 [no builtin substitutes && HAVE_DECL_SETREGID &&
1999 PREFER_NONREENTRANT_EUIDACCESS]:
2000 Use setreuid+setregid to get the correct answer.
2001 [no builtin substitutes && ! (HAVE_DECL_SETREGID &&
2002 PREFER_NONREENTRANT_EUIDACCESS)]:
2003 Don't assume that the stat macros have their historical values,
2004 as POSIX doesn't require this.
2005 [defined TEST]: Include <stdlib.h>; don't include errno.h
2006 twice; include <error.h> rather than "error.h".
2008 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
2010 * Makefile.am (libfetish_a_SOURCES): Add fcntl-safer.h,
2012 * fcntl-safer.h, open-safer.c: New files.
2014 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
2016 * c-strtod.c (STRTOD_L): New macro.
2017 (C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the
2018 code is reentrant on platforms that have strtod_l.
2020 * getloadavg.c: Include <errno.h>, <stdio.h>, <stdlib.h> even
2021 if HAVE_GETLOADAVG is defined, so that the test program can work.
2022 (errno): Remove declaration; not needed in C89 or later.
2023 Include "c-strtod.h".
2024 Do not include locale.h or define setlocale; no longer needed.
2026 (INT_STRLEN_BOUND): New macro.
2027 (getloadavg): Use it to compute buffer size.
2028 Don't assume that buffer will be properly terminated by 'read'.
2029 Use c_strtod instead of setlocale.
2030 (main) [defined TEST]: Return int, not void.
2032 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
2034 * Makefile.am (libfetish_a_SOURCES): Add c-strtold.c.
2035 * c-strtold.c: New file.
2036 * c-strtod.c: Include <config.h> first.
2037 (C_STRTOD, DOUBLE, STRTOD): New macros.
2038 (c_strtod): Use them.
2039 * c-strtod.h (c_strtold): New decl.
2041 2004-07-07 Jim Meyering <jim@meyering.net>
2043 Don't infloop when MAXSYMLINKS is not defined.
2044 Detect symlink loops much earlier (albeit lazily) on systems
2045 with MAXSYMLINKS defined to a large value.
2047 * canonicalize.c: Include "cycle-check.h".
2048 (canonicalize_filename_mode): Don't try to detect loops by counting
2049 symlink-hops. Instead, use the cycle-check module.
2051 * cycle-check.h: Include stdbool.h.
2052 Forward-declare `struct stat'.
2054 * canonicalize.c (canonicalize_filename_mode): Remove do-while(0) loop.
2055 Replace each corresponding `break' stmt with `continue'.
2057 2004-07-06 Jim Meyering <jim@meyering.net>
2059 * canonicalize.c: Include "stat-macros.h".
2060 (canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that
2061 S_ISLNK is guaranteed to be defined (via stat-macros.h).
2063 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
2065 * Makefile.am (libfetish_a_SOURCES): Add canonicalize.c
2067 * canonicalize.h (canonicalize_mode_t): New type.
2068 * canonicalize.c: Include "file-type.h".
2069 (canonicalize_filename_mode): New function, based on
2070 canonicalize_file_name, supports three canonicalize modes.
2071 (canonicalize_file_name)
2072 [!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it.
2074 2004-07-05 Jim Meyering <jim@meyering.net>
2076 * path-concat.c (path_concat): Improve comment. From Paul Eggert.
2078 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
2080 * canonicalize.c (canonicalize_file_name): Assume that path_concat
2082 * path-concat.c (mempcpy): Don't define if a system header defines it.
2083 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
2084 (longest_relative_suffix): New function.
2085 (path_concat): Use it. Assume first argument is not NULL.
2086 Port to DOS. Omit redundant separators.
2087 Report an error instead of returning NULL.
2088 Use mempcpy instead of memcpy.
2089 (xpath_concat): Remove: not declared or used.
2091 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
2093 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
2094 FILESYSTEM_PREFIX_LEN. All uses changed.
2095 * mountlist.h (read_file_system_list): Renamed from
2096 read_filesystem_list. All definitions and uses changed.
2098 2004-06-24 Jim Meyering <jim@meyering.net>
2100 * obstack.h (obstack_base): Fix parentheses. From Paul Eggert.
2102 2004-06-20 Jim Meyering <jim@meyering.net>
2104 * obstack.h (obstack_base): Cast to (void *), per documentation.
2106 * yesno.h: New file.
2107 * yesno.c: Include "yesno.h".
2108 * Makefile.am (libfetish_a_SOURCES): Add yesno.h.
2110 2004-06-19 Jim Meyering <jim@meyering.net>
2112 * filemode.c: Remove all S_IS* and S_IF* definitions.
2113 Instead, just include "stat-macros.h".
2115 * rmdir.c: Likewise.
2116 * makepath.c: Likewise.
2117 * lchown.c: Likewise.
2118 * isdir.c: Likewise.
2119 * canonicalize.c: Likewise.
2121 Add S_IS* definitions from filemode.c.
2122 * stat-macros.h (S_ISCTG): Define to zero if not already defined.
2123 (S_ISOFD): Likewise.
2124 (S_ISOFL): Likewise.
2126 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
2128 * readutmp.c (extract_trimmed_name): Don't apply strchr to a
2129 non-string; this leads to undefined behavior.
2131 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
2133 * fts.c (fts_stat, fts_alloc): Always allocate and use a struct
2134 stat, even if the user isn't interested in the results.
2135 This prevents a core dump in cycle_check when FTS_NOSTAT is set.
2136 * lchown.c (lchown): Return EOPNOTSUPP if not supported; this
2137 is what POSIX-2004 specifies.
2138 * lchown.h (EOPNOTSUPP): Define if not defined.
2141 2004-06-06 Jim Meyering <jim@meyering.net>
2143 * getdate.y: Update from gnulib.
2145 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
2147 * xreadlink.c: Include xreadlink.h first, to catch .h file
2148 dependency problems.
2149 (xreadlink): Accept new arg SIZE, for efficiency.
2150 All decls and uses changed.
2151 * xreadlink.h: Include <stddef.h>, for size_t.
2152 * canonicalize.c (canonicalize_file_name): Update use of xreadlink.
2154 2004-06-01 Jim Meyering <jim@meyering.net>
2156 * xmalloc.c: Update from gnulib.
2158 2004-05-30 Jim Meyering <jim@meyering.net>
2160 * alloca_.h: Remove trailing blank.
2162 2004-05-29 Jim Meyering <jim@meyering.net>
2164 * dirname.h (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Define.
2166 * calloc.c: New file.
2168 2004-05-21 Jim Meyering <jim@meyering.net>
2170 * alloca.c, alloca_.h, fnmatch.c: Update from gnulib.
2171 * localcharset.c, regex.c: Likewise.
2173 2004-05-20 Jim Meyering <jim@meyering.net>
2175 * obstack.c, obstack.h: Update from gnulib.
2177 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
2179 * getline.c, getndelim2.c, getndelim2.h: Sync with gnulib.
2181 2004-05-11 Jim Meyering <jim@meyering.net>
2183 Prior to this change, rm required read access to the current
2184 directory on most systems (ones with the fchdir function).
2186 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
2187 fails, try write-only, and finally, resort to using xgetcwd.
2189 2004-05-07 Jim Meyering <jim@meyering.net>
2192 * obstack.c (_): Define only if not already defined.
2193 * obstack.h (obstack_finish): Rename local: s/value/__value/.
2195 2004-05-03 Jim Meyering <jim@meyering.net>
2197 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
2199 2004-05-01 Jim Meyering <jim@meyering.net>
2201 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
2202 Wrap old code with this conditional.
2203 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
2204 function that does not dereference symlinks.
2206 2004-04-18 Paul Eggert <eggert@twinsun.com>
2208 * nanosleep.c (suspended): Change its type from int to
2209 sig_atomic_t volatile.
2210 (first_call): Make it private to rpl_nanosleep, and have it
2211 be zero initially as that's a bit faster.
2212 (my_usleep): Round up fractional times instead of truncating them,
2213 as this is the usual meaning for 'sleep'.
2215 2004-04-20 Jim Meyering <jim@meyering.net>
2217 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
2219 2004-04-18 Jim Meyering <jim@meyering.net>
2221 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2222 don't leak memory and do call END_UTMP_ENT.
2224 2004-04-13 Jim Meyering <jim@meyering.net>
2226 * quotearg.c, quotearg.h: Remove trailing blanks.
2228 2004-04-12 Jim Meyering <jim@meyering.net>
2230 * inttostr.h: Update from gnulib.
2232 2004-03-27 Paul Eggert <eggert@twinsun.com>
2234 * utimecmp.c, utimecmp.h: New files.
2235 * Makefile.am (libfetish_a_SOURCES): Add utimecmp.c, utimecmp.h.
2237 2004-04-09 Jim Meyering <jim@meyering.net>
2239 * stat-macros.h: New file, with contents from file-type.h
2240 and coreutils' system.h.
2241 * Makefile.am (libfetish_a_SOURCES): Add stat-macros.h.
2242 * file-type.c: Include "stat-macros.h".
2243 * file-type.h (file_type): Move all macro defiitions to new file,
2246 2004-03-30 Paul Eggert <eggert@twinsun.com>
2248 * cloexec.c, cloexec.h, config.charset, file-type.c, file-type.h:
2249 * getloadavg.c, getndelim2.c, getusershell.c, group-member.c:
2250 * human.c, path-concat.c, printf-args.c, printf-args.h:
2251 * quotearg.c, quotearg.h, setenv.c, strdup.c:
2252 * userspec.c, userspec.h, vasprintf.c: Sync from gnulib.
2254 * allocsa.c, allocsa.h, strdup.h: New files, from gnulib.
2255 * Makefile.am (libfetish_a_SOURCES): Add allocsa.c, allocsa.h,
2258 2004-03-30 Jim Meyering <jim@meyering.net>
2260 * getloadavg.c: Merge changes from emacs (via gnulib).
2262 2004-03-28 Paul Eggert <eggert@twinsun.com>
2264 Fix some gotchas encountered when porting to Solaris 8, using
2265 the Forte 6u2 compiler.
2267 * canonicalize.c [HAVE_UNISTD_H]: Include <unistd.h>,
2268 for resolvepath declaration.
2269 * fts.c: Include dirfd.h, for dirfd.
2271 2004-02-25 Paul Eggert <eggert@twinsun.com>
2273 * human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
2275 2004-03-23 Paul Eggert <eggert@twinsun.com>
2277 * readtokens0.c (readtokens0): Return true on success rather
2278 than on failure. All callers changed. This also happens to fix a
2279 portability bug on pre-C99 hosts, where (bool) INTEGER sometimes
2280 returns false even when INTEGER is nonzero.
2282 2004-03-23 Jim Meyering <jim@meyering.net>
2284 * Makefile.am (libfetish_a_SOURCES): Add getopt_int.h.
2285 * getopt_int.h: New file, from gnulib.
2286 * getopt.c, getopt.h, getopt1.c: Sync from gnulib.
2287 * getopt.c, getopt.h: Remove space(s) before TAB.
2289 * mbswidth.c, mbswidth.h: Sync from gnulib.
2291 2004-03-21 Jim Meyering <jim@meyering.net>
2293 * readtokens0.c, readtokens0.h: New files.
2294 * Makefile.am (libfetish_a_SOURCES): Add readtokens0.c and readtokens0.h
2296 * readtokens.c (readtoken): Don't leak 64 bytes when reading
2297 an empty input stream.
2299 * readtokens.c: Include <stdbool.h>.
2300 (readtoken): Use `size_t' rather than int/long.
2301 All callers adjusted.
2302 Use `bool' rather than `int' where appropriate.
2303 Use memset rather than an explicit loop.
2304 Use x2nrealloc rather than xrealloc.
2305 Allow the use of `\0' as a delimiter.
2306 (readtokens): Likewise.
2307 * readtokens.h (readtoken, readtokens): Update prototypes.
2309 2004-02-29 Paul Eggert <eggert@twinsun.com>
2311 * getdate.h: Include stdbool.h, and timespec.h instead of
2312 the usual <time.h> dance.
2313 (get_date): Change signature to support fractional time stamps.
2314 All callers changed.
2315 * getdate.y: Include "getdate.h" first, as we can now
2316 assume C89 and don't need to worry about 'const'.
2317 Similarly, include "unlocked-io.h" near start, not in middle.
2319 (textint.value): Use long int rather than int.
2320 (textint.digits): Use size_t rather than int.
2321 (BILLION, LOG10_BILLION): New constants.
2322 (parser_control): New member rel_ns. Members day_ordinal,
2323 time_zone, month, day, hour, minutes, rel_year, rel_month,
2324 rel_day, rel_hour, rel_minutes, rel_seconds
2325 are now long int, not int. Member seconds is now struct timespec,
2326 not int. New member timespec_seen. Members dates_seen, days_seen,
2327 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2329 (%union.intval): Now long int, not int.
2330 New member timespec.
2331 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2332 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2333 (spec): Now is a timespec or an item list.
2334 (timespec, items): New nonterminals.
2335 (time, rel, relunit, number, get_date):
2336 Add support for fractional seconds.
2337 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2338 (gmtime, localtime, mktime): Remove decls; not needed with C89.
2339 (to_hour): First arg is now long int, not int.
2340 (to_year): Returns long int, not int.
2341 Don't treat year -70 like 70.
2342 (tm_diff): Returns long int, not int.
2343 (lookup_word): Use bool instead of int when appropriate.
2344 (yylex): Use size_t for count, not int.
2345 Detect overflow when parsing large integer constants.
2346 Add support for fractions.
2347 (get_date): Make pointers 'const' if possible.
2348 Use more-portable code to detect integer overflow.
2349 (main) [TEST]: Adjust to above changes. Test for localtime failure.
2350 Don't use ctime; it's not reliable if the year has >4 digits.
2352 2004-03-15 Jim Meyering <jim@meyering.net>
2354 `date --date="21:04 +0100" +%S' would print the seconds value
2355 from the current time, rather than `00'.
2356 * getdate.y: For a date string like `10:23 +0100',
2357 set the number of seconds to zero. Reported by Marc Haber.
2359 2004-03-04 Jim Meyering <jim@meyering.net>
2361 * cloexec.c (set_cloexec_flag) [ ! (F_GETFD && F_SETFD)]:
2362 Return true, not false.
2364 2004-03-03 Paul Eggert <eggert@twinsun.com>
2366 * cloexec.c: Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
2367 (set_cloexec_flag): Use bool for booleans. All uses changed.
2368 If F_GETFD returns a negative number (not just -1), report a
2369 failure. Don't use F_SETFD if the flags are already right.
2370 Don't report a failure with F_SETFD unless it returns -1.
2371 * cloexec.h: Include <stdbool.h>.
2372 Adjust signature to use `bool' rather than `int'.
2373 * getloadavg.c (getloadavg): Use `true', not `1'.
2375 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
2377 * cloexec.c: New file.
2378 The set_cloexec_flag implementation imported from GNU C Library
2380 * cloexec.h: New file.
2381 * getloadavg.c: Include "cloexec.h".
2382 (getloadavg): Use set_cloexec_flag instead of manual fcntl call.
2383 * Makefile.am (libfetish_a_SOURCES): Add cloexec.c, cloexec.h.
2385 2004-02-23 Paul Eggert <eggert@twinsun.com>
2387 * userspec.c: Don't include "posixver.h".
2388 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2389 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2390 compatible extension. Simplify code by removing a boolean int
2391 that was always nonzero if a string was nonnull.
2393 2004-02-05 Jim Meyering <jim@meyering.net>
2395 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2396 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2397 From coreutils' system.h.
2399 2004-01-29 Jim Meyering <jim@meyering.net>
2401 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2403 2004-01-21 Paul Eggert <eggert@twinsun.com>
2405 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2406 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2407 * argmatch.h: Comment fix to match the above.
2408 * long-options.c (parse_long_options): Use prototype
2409 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2411 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2412 Now a macro referring to exit_failure, instead of a separate
2413 variable. Include "exitfail.h" to get it.
2414 * xstrtol.h: Include "exitfail.h".
2415 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2417 2004-01-21 Jim Meyering <jim@meyering.net>
2419 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2420 so as not to conflict with a different-sized __mktime_internal
2421 function in GNU libc.
2423 2004-01-16 Jim Meyering <jim@meyering.net>
2426 * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED,
2427 rather than HAVE_GETC_UNLOCKED.
2429 2003-10-08 Paul Eggert <eggert@twinsun.com>
2433 * unlocked-io.h: Include <stdio.h>, so that the caller
2434 doesn't have to include <stdio.h> before us.
2435 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2436 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2437 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2438 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2439 if not declared, so that we can use getpass.c code from libc without
2441 (flockfile, ftrylockfile, funlockfile): New macros.
2443 2004-01-14 Paul Eggert <eggert@twinsun.com>
2447 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2448 with like-named macro in fnmatch.c.
2449 (EXT): Use an internal constant instead.
2451 Merge fnmatch patches from glibc.
2452 * fnmatch.c (mbsinit): Remove define.
2453 Add libc_hidden_ver (__fnmatch, fnmatch).
2454 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2455 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2457 2003-11-24 Paul Eggert <eggert@twinsun.com>
2461 * alloca.c: Remove dependency on xalloc module.
2462 (xalloc_die): Remove.
2463 (memory_full) [!defined emacs]: New macro.
2464 [!defined emacs]: Don't include xalloc.h.
2465 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2466 address arithmetic overflows. Change datatypes a bit to avoid
2469 2004-01-14 Paul Eggert <eggert@twinsun.com>
2471 * posixver.c: Include posixver.h.
2473 2004-01-12 Jim Meyering <jim@meyering.net>
2475 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2476 optional configure-time default.
2478 2004-01-10 Jim Meyering <jim@meyering.net>
2480 * version-etc.c (version_etc_copyright): Update copyright date.
2482 2003-12-20 Jim Meyering <jim@meyering.net>
2484 * fts.c [!_LIBC]: Undefine, then define-away __P.
2486 2003-12-19 Jim Meyering <jim@meyering.net>
2488 Rewrite fts to use a hash table or O(1)-mem cycle-detection
2489 code rather than the tree-based tsearch functions.
2490 * fts_.h: Include hash.h and cycle-check.h.
2491 (FTS_TIGHT_CYCLE_CHECK): New value.
2492 (FTS_OPTIONMASK): Adjust to include the new value.
2493 (FTS_NAMEONLY, FTS_STOP): Increase to allow room for new value.
2494 (struct FTS) [active_dir_ht]: New member. Replaces fts_dir_signatures.
2495 (struct FTS) [cycle_state]: New member.
2496 * fts.c: Don't include <search.h>.
2497 [HAVE_INTTYPES_H]: Include <inttypes.h>.
2498 (tdestroy, tfind, tsearch): Remove definitions.
2499 (struct Active_dir): Rename from `known_object'.
2500 (AD_compare, AD_hash): New functions.
2501 (enter_dir, leave_dir): Rewrite to manipulate a hash table
2503 (fts_open): Initialize hash table or cycle_state buffer.
2504 (free_node): Remove function.
2505 (find_matching_ancestor): Renamed/rewritten from look_up_active_dir.
2506 (fts_cross_check): Adapt to use new data structure.
2508 * Makefile.am (libfetish_a_SOURCES): Remove search_.h.
2509 (DISTCLEANFILES): Remove definition.
2511 2003-12-18 Jim Meyering <jim@meyering.net>
2513 Rewrite cycle detection code to work properly.
2514 Add some framework (compiled out by default) to test it.
2515 * fts.c (Dprintf, ENTER_DIR, LEAVE_DIR): Define.
2516 (add_object): Remove function. Rewritten as...
2517 (enter_dir): New function.
2518 (leave_dir, free_node): New functions.
2519 (fts_read): Ensure that we call ENTER_DIR or LEAVE_DIR,
2520 as appropriate, before returning.
2521 (look_up_active_dir, fts_cross_check) [FTS_DEBUG]: New functions.
2522 (fts_stat): Don't perform the cycle check here.
2523 Now it's done via enter_dir.
2525 2003-12-12 Jim Meyering <jim@meyering.net>
2527 * fts_.h (FTS) [fts_dir_signatures]: Add comment.
2529 2003-12-03 Paul Eggert <eggert@twinsun.com>
2531 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2532 Bug reported by Alfred M. Szmidt.
2534 2003-12-02 Jim Meyering <jim@meyering.net>
2536 * Makefile.am (libfetish_a_SOURCES): Reflect sha -> sha1 renaming.
2538 * sha1.c: File renamed from sha.c.
2539 * sha1.h: File renamed from sha.h.
2540 Use SHA1_H, not _SHA_H in #ifndef condition.
2542 * sha.c: Add FSF Copyright.
2543 * sha.h: Correct stale references to MD5 and `16 bytes'.
2544 Patch by Ulrich Drepper.
2546 * sha.h: Add FSF Copyright. Remove reference to Scott Miller,
2547 since this file is now nearly identical to md5.h.
2549 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2550 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2551 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2553 2003-11-29 Jim Meyering <jim@meyering.net>
2555 * c-strtod.c (c_strtod): Save and restore original LC_NUMERIC setting,
2556 in case it was different from the environment-derived value.
2557 Patch by Paul Eggert.
2558 Include "xalloc.h" for declaration of xstrdup.
2560 2003-11-24 Paul Eggert <eggert@twinsun.com>
2562 Parse floating-point operands and options in the C locale.
2563 POSIX requires this for printf, and we might as well be
2564 consistent elsewhere (tail, sleep, seq).
2566 * Makefile.am (libfetish_a_SOURCES): Add c-strtod.c, c-strtod.h.
2567 * c-strtod.c, c-strtod.h: New files.
2568 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2569 conversion function.
2570 * xstrtod.c (xstrtod): Likewise. All callers changed to
2571 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2574 * xnanosleep.c: Don't include xstrtod.h; it's not needed.
2576 2003-11-22 Jim Meyering <jim@meyering.net>
2578 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2580 2003-11-21 Jim Meyering <jim@meyering.net>
2582 * xreadlink.c (xreadlink): Correct outdated comment.
2584 2003-11-17 Jim Meyering <jim@meyering.net>
2586 On systems without utime and without a utimes function capable of
2587 dealing with a NULL struct utimbuf* argument, this utime replacement
2588 could -- in unusual circumstances -- leak a file descriptor.
2589 * utime.c: Include <unistd.h> and <errno.h>.
2590 (utime_null): Be sure to close `fd' and to preserve errno.
2591 Reported by Geoff Collyer via Arnold Robbins.
2593 2003-11-13 Jim Meyering <jim@meyering.net>
2595 * xalloc.h, xstrtol.c: Update from gnulib.
2597 2003-11-11 Jim Meyering <jim@meyering.net>
2599 * ftw.c, ftw_.h: Remove files. No longer used.
2601 2003-11-09 Jim Meyering <jim@meyering.net>
2603 * root-dev-ino.c, root-dev-ino.h: New files.
2604 * Makefile.am (libfetish_a_SOURCES): Add root-dev-ino.c root-dev-ino.h.
2606 * dev-ino.h: Include <sys/types.h> and <sys/stat.h>.
2608 2003-11-06 Jim Meyering <jim@meyering.net>
2610 * free.c: New file, from gnulib.
2612 2003-10-31 Paul Eggert <eggert@twinsun.com>
2614 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2615 * mountlist.c (SIZE_MAX): Define if not defined already.
2616 (read_filesystem_list): Set and use me_type_malloced.
2617 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2618 whatever the type happens to be), for brevity and consistency.
2619 Check for size calculation overflow on Alphas running OSF/1.
2621 2003-10-31 Jim Meyering <jim@meyering.net>
2623 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2625 * linebuffer.c: Include <string.h> for declaration of memset.
2627 * alloca.c, linebuffer.c, xmalloc.c, xalloc.h: Update from gnulib.
2628 * exclude.c, getgroups.c, quotearg.c, stdbool_.h: Update from gnulib.
2629 * hash.c, hash-pjw.h: Update from gnulib.
2631 2003-10-25 Jim Meyering <jim@meyering.net>
2633 * hash.c, hash.h: Update from gnulib.
2634 * hash-pjw.c, hash-pjw.h: Likewise.
2635 * obstack.c, obstack.h: Likewise.
2637 2003-10-25 Jim Meyering <meyering@lucent.com>
2639 * fts_.h: Include <features.h> only if _LIBC.
2640 [!_LIBC]: Define-away __THROW, __BEGIN_DECLS, __END_DECLS.
2642 2003-10-19 Jim Meyering <jim@meyering.net>
2644 * vasnprintf.c (vasnprintf): Work around losing snprintf on
2647 2003-09-25 Jim Meyering <jim@meyering.net>
2648 Bruno Haible <bruno@clisp.org>
2650 [Update from gnulib]
2651 This lets translators provide better translations for the
2652 "Written by ..." part of --version output.
2653 * version-etc.h: Include stdarg.h.
2654 (version_etc_copyright): Declare as readonly.
2655 (version_etc): Make this function variadic with a NULL-terminated list
2656 of author name strings.
2657 (version_etc_va): New declaration.
2658 * version-etc.c: Include stdarg.h, stdlib.h.
2659 (version_etc_copyright): Declare as readonly.
2660 (version_etc_va): New function. Provide a different translatable string
2661 for each possible number of authors < 10. Abbreviate when there are 10
2663 (version_etc): Make this function variadic. Call version_etc_va.
2664 Suggestion from Gary V. Vaughan.
2666 * long-options.h (parse_long_options): Change prototype: the authors
2667 string is moved to the end and becomes variadic.
2668 * long-options.c: Include stdarg.h.
2669 (parse_long_options): Make this function variadic, too.
2670 Call version_etc_va, not version_etc.
2672 2003-10-17 Jim Meyering <jim@meyering.net>
2674 * xfts.c, xfts.h: New files.
2675 This factors out code used by du.c, chmod.c, and chown-core.c.
2676 * Makefile.am (libfetish_a_SOURCES): Add xfts.c and xfts.h.
2678 * error.h: Update from gnulib.
2679 * getpass.c: Likewise.
2680 * fnmatch.c: Likewise.
2681 * fnmatch_loop.c: Likewise.
2683 2003-10-16 Jim Meyering <jim@meyering.net>
2685 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2687 * getgroups.c: Update from gnulib.
2688 * readutmp.c: Fix indentation, from gnulib.
2689 * exclude.c: Update from gnulib.
2690 * xgethostname.c: Include xgethostname.h.
2691 * xgethostname.h: New file, from gnulib.
2692 * Makefile.am (libfetish_a_SOURCES): Add xgethostname.h.
2694 2003-10-15 Jim Meyering <jim@meyering.net>
2696 * userspec.h: New file.
2697 * userspec.c: Include "userspec.h".
2698 * Makefile.am (libfetish_a_SOURCES): Add userspec.h.
2700 2003-10-14 Paul Eggert <eggert@twinsun.com>
2702 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
2704 * human.c, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoul.c, xstrtoumax.c:
2707 2003-10-13 Paul Eggert <eggert@twinsun.com>
2709 * xalloc.h, xmalloc.c, xstrdup.c: Import latest version from gnulib.
2711 2003-09-29 Paul Eggert <eggert@twinsun.com>
2713 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
2715 2003-10-02 Jim Meyering <jim@meyering.net>
2717 Don't require that the maximum length of a file name
2718 encountered in a traversal fit in an `unsigned short',
2719 and fix some portability bugs (don't depend on gcc).
2721 * fts.c: Include "fts_.h", not <fts.h>.
2722 (ALIGNBYTES) [!(__GNUC__ >= 2)]: Add a definition that works with
2723 compilers that don't have __alignof__.
2724 (MAX): Use a definition that doesn't depend on gcc.
2725 (fts_build): Make `len' and `maxlen' be of type size_t, not int.
2726 Test for overflow in a less type-dependent manner.
2727 Test HAVE_STRUCT_DIRENT_D_TYPE, rather than
2728 defined DT_DIR && defined _DIRENT_HAVE_D_TYPE.
2729 (fts_palloc): Test for overflow in a less type-dependent manner.
2730 (fts_safe_changedir): Use stat, not stat64.
2731 Use fstat, not __fxstat64(_STAT_VER.
2733 * fts_.h [FTS] (fts_pathlen): Change type from int to size_t.
2734 [FTSENT] (fts_pathlen): Change type from u_short to size_t.
2735 (fts_level): Change type from u_short to int.
2737 * Makefile.am (libfetish_a_SOURCES): Add fts.c fts_.h.
2740 2003-09-29 Paul Eggert <eggert@twinsun.com>
2742 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2743 Fix arg typo in previous patch.
2745 2003-09-28 Jim Meyering <jim@meyering.net>
2747 * error.c: Update from gnulib.
2749 2003-09-19 Jim Meyering <jim@meyering.net>
2751 * version-etc.h: (version_etc): Rename parameter, authors,
2753 * version-etc.c: (version_etc): Likewise.
2754 Combine fprintf and following putc('\n'.
2756 * version-etc.c, version-etc.h: Revert yesterday's changes.
2757 * long-options.c, long-options.h: Likewise.
2759 2003-09-18 Jim Meyering <jim@meyering.net>
2761 This lets translators provide better translations for the
2762 `Written by ...' part of --version output.
2763 * version-etc.c: Include stdarg.h, stdlib.h, string.h, and xalloc.h.
2764 (version_etc): Make this function variadic,
2765 with a NULL-terminated list of author name strings.
2766 (version_etc_va): New function.
2767 Suggestion from Gary V. Vaughan.
2768 * version-etc.h (version_etc_va): Declare it.
2770 * long-options.c: Include stdarg.h.
2771 (parse_long_options): Make this function variadic (authors), too.
2772 Call version_etc_va, not version_etc.
2773 * long-options.h (parse_long_options): Update prototype.
2775 2003-09-16 Paul Eggert <eggert@twinsun.com>
2777 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2778 input error, instead of returning NULL the next time we are called
2779 (and therefore losing track of errno).
2781 2003-09-15 Paul Eggert <eggert@twinsun.com>
2783 * getndelim2.c (getndelim2): Don't trash errno when a read
2784 fails, so that the caller gets the proper errno.
2786 * readutmp.c (read_utmp): Likewise.
2787 Check for fstat error. Close stream and free storage
2790 2003-09-14 Jim Meyering <jim@meyering.net>
2792 * argmatch.c: Update from gnulib.
2794 * Makefile.am (libfetish_a_SOURCES): Add exit.h, strndup.h,
2797 2003-09-13 Jim Meyering <jim@meyering.net>
2799 * setenv.c, strcspn.c, strdup.c, strndup.c, strnlen.c, strpbrk.c:
2800 * strstr.c, strtod.c, strtoimax.c, tempname.c, unicodeio.c, userspec.c:
2801 * vasprintf.h, xgethostname.c, xreadlink.c, xstrdup.c, xstrndup.c:
2802 * xstrndup.h, xstrtod.c, xstrtol.c, yesno.c: Update from gnulib.
2803 * strndup.h: New file, from gnulib.
2804 * exit.h: New file, from GNU gettext, via gnulib.
2806 2003-09-06 Paul Eggert <eggert@twinsun.com>
2808 * time_r.c, time_r.h: New files.
2810 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
2812 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
2813 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
2815 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
2817 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
2818 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
2821 2003-09-13 Jim Meyering <jim@meyering.net>
2823 * strtol.c: Update from gnulib.
2825 2003-09-12 Paul Eggert <eggert@twinsun.com>
2827 * argmatch.c, xgethostname.c, xmalloc.c: Include exit.h.
2828 * obstack.c [!defined _LIBC]: Likewise.
2829 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2830 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2831 * exitfail.c: Don't include stdlib.h; no longer needed.
2833 2003-09-12 Paul Eggert <eggert@twinsun.com>
2835 * error.c (error_tail): Assume vprintf.
2837 2003-09-09 Paul Eggert <eggert@twinsun.com>
2841 * getloadavg.c (getloadavg, main): Define via prototypes.
2843 * getopt.h (struct option.name): Assume C89, and use 'const'.
2844 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2845 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2847 * getopt.c (const): Remove macro.
2848 Include <string.h> unconditionally.
2849 (my_index): Remove; all uses changed to strchr.
2850 (strlen): Remove decl.
2851 (exchange): Remove forward decl; no longer needed.
2852 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
2853 Define with prototype.
2854 * getopt1.c (const): Remove macro.
2855 (getopt_long, getopt_long_only, main): Define with prototype.
2857 * getugroups.c: Include <string.h> unconditionally.
2859 * getusershell.c: Include <stdlib.h> unconditionally.
2860 (getusershell, setusershell, endusershell, readname, main):
2861 Define with prototypes.
2863 * group-member.c: Include group-member.h first.
2864 Include <stdlib.h> unconditionally.
2866 * hard-locale.c: Include hard-locale.h first.
2867 Include <stdlib.h>, <string.h> unconditionally.
2869 * hash.c (free, malloc): Remove decls.
2870 Include <stdlib.h> unconditionally.
2872 * human.c: Include <stdlib.h>, <string.h> unconditionally.
2873 (getenv): Do not declare.
2875 * idcache.c: Include <string.h> unconditionally.
2877 * long-options.c: Include long-options.h first, to test interface.
2878 Include <stdlib.h> unconditionally.
2880 * makepath.c: Include makepath.h first, to test interface.
2881 Include <stdlib.h> and <string.h> unconditionally.
2883 * linebuffer.c: Include <stdlib.h>.
2884 (free): Remove decl.
2886 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
2887 rpl_malloc returns void *, not char *.
2888 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
2890 * md5.h: Include <limits.h> unconditionally.
2891 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
2892 (__P): Remove; all uses removed.
2893 * md5.c: Include "md5.h" first.
2894 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
2895 md5_buffer, md5_process_bytes, md5_process_block):
2896 Define with prototypes.
2897 * sha.h (__P): Remove all uses. (It wasn't defined??)
2898 * sha.c: Include "sha.h" first.
2899 Include <stdlib.h>, <string.h> unconditionally.
2901 * memchr.c (__ptr_t): Remove; all uses changed to void *.
2902 * memcmp.c (__ptr_t): Likewise.
2903 * memrchr.c (__ptr_t): Likewise.
2904 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
2905 Include <string.h> unconditionally.
2906 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
2907 * memchr.c: Include <stdlib.h> unconditionally.
2908 * memchr.c (LONG_MAX): Remove.
2909 * memrchr.c (LONG_MAX): Likewise.
2910 * memchr.c (__memchr): Define via a prototype.
2911 * memrchr.c (__memrchr): Likewise.
2912 * memcmp.c (__P): Remove, and remove all uses.
2913 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
2914 Remove forward decls; no longer needed.
2915 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
2916 Use types required by C89 in prototype.
2918 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
2919 * savedir.c: Likewise.
2920 * mkdir.c (free): Remove decl.
2921 * rmdir.c (rmdir): Define with a prototype.
2922 * savedir.c: Include savedir.h first, to test interface.
2924 * mktime.c (STDC_HEADERS): Remove.
2925 Include <stdlib.h>, <string.h> unconditionally.
2927 * modechange.c: Include <stdlib.h> unconditionally.
2928 (malloc): Remove decl.
2930 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
2931 (free): Remove decl.
2933 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
2934 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
2935 (This type really should be intptr_t, but that's a C99ism.)
2936 (_obstack_memcpy): Remove: all uses changed to memcpy.
2937 Include <string.h> unconditionally.
2938 (struct obstack): Assume __STDC__ for types of members
2939 chunkfun, freefun, extra_arg.
2940 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
2941 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
2942 obstack_begin, obstack_specify_allocation,
2943 obstack_specify_allocation_with_arg, obstack_chunkfun,
2944 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
2945 Remove unprototyped decls and the macros that use them.
2946 * obstack.c (POINTER): Remove. All uses changed to void *.
2947 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
2948 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
2949 (defined __STDC__ && __STDC__)]:
2950 Remove nonprototyped code.
2951 Include <stdlib.h> unconditionally.
2952 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
2953 _obstack_allocated_p, _obstack_free, obstack_free,
2954 _obstack_memory_used, print_and_abort):
2955 Define using prototypes.
2956 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
2957 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
2958 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
2959 obstack_next_free, obstack_object_size, obstack_room) [0]:
2960 Remove unused, unprototyped code.
2962 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
2964 * physmem.c (physmem_total, physmem_available, main): Define
2967 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
2968 (main): Define with a prototype.
2970 * posixver.c (getenv): Remove decl.
2972 * putenv.c (malloc): Returns void *, not char *.
2973 Include <string.h> unconditionally.
2974 (strchr, memcpy, NULL): Do not define.
2976 * readtokens.c: Include readtokens.h first, to test interface.
2977 Include <stdlib.h>, <string.h> unconditionally.
2978 (init_tokenbuffer): Define with a prototype.
2980 * regex.c (PARAMS): Remove. All uses removed.
2981 All uses of _RE_ARGS removed, too.
2982 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2984 (bzero): Assume memset exists.
2985 (memcmp, memcpy, NULL): Remove.
2986 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
2987 char, or assignments to local vars of type signed char.
2988 (init_syntax_once, PREFIX(extract_number_and_incr),
2989 PREFIX(print_partial_compiled_pattern),
2990 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
2991 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
2992 PREFIX(regex_grow_registers), PREFIX(regex_compile),
2993 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
2994 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
2995 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
2996 wcs_compile_range, byte_compile_range, truncate_wchar,
2997 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
2998 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
2999 count_mbs_length, wcs_re_match_2_internal,
3000 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3001 PREFIX(alt_match_null_string_p),
3002 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3003 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3004 regfree, PREFIX(extract_number)): Define with prototype. Remove
3005 now-unnecessary declaration, if any.
3006 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3008 Remove now-unnecessary casts among pointer types.
3009 * regex.h (_RE_ARGS): Remove. All uses removed.
3011 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3012 (free): Remove decl.
3014 * rpmatch.c: Include <stdlib.h> unconditionally.
3016 * save-cwd.c: Include <stdlib.h> unconditionally.
3017 * xgetcwd.c: Likewise.
3019 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3020 (free): Remove decl.
3022 The following changes are not K&R related:
3024 * group-member.h: Include <sys/types.h>, so that this file is
3026 * makepath.h: Likewise.
3028 * getusershell.c (readname, default_index, line_size, readname):
3029 Use size_t, not int, for sizes.
3030 (readname): If the size overflows, report an error instead of
3033 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3035 * getndelim2.c: Assume stdlib.h per the C89 spec.
3037 2003-09-08 Paul Eggert <eggert@twinsun.com>
3039 Assume C89 or better; remove K&R cruft.
3040 A few of these changes were first proposed by Derek Robert Price
3041 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3043 * addext.c: Include <string.h> unconditionally.
3044 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3045 Don't declare getenv or malloc.
3047 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3048 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3050 (find_stack_direction, alloca): Use prototypes.
3052 * atexit.c (atexit): Define using a prototype.
3054 * basename.c, dirname.c, stripslash.c:
3055 Include <string.h> unconditionally.
3057 * bcopy.c: Include <stddef.h>.
3058 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3060 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3062 * error.h (error, error_at_line, error_print_progname)
3063 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3064 * error.c: Include error.h first, to check interface.
3065 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3066 (VA_START): Remove; all uses changeed to va_start.
3067 (exit, strerror): Remove decls.
3068 (error_print_progname): Prototype uncondionally.
3069 Don't include <errno.h>; no longer needed.
3070 (private_strerror): Remove.
3071 (error_tail): Always define.
3072 (error, error_at_line): Assume C89 or better; always use prototypes.
3074 * euidaccess.c (main): Define with a prototype.
3076 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3078 * exitfail.c: Include <stdlib.h> unconditionally.
3080 * fnmatch_.h (__P): Remove. All uses changed to assume prototypes.
3081 * fnmatch.c: Include fnmatch.h first, to test interface.
3082 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3083 (getenv): Remove decl.
3084 (fnmatch): Define using a prototype.
3085 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3086 (FCT): Define using a prototype.
3088 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3090 * gethostname.c: Include <stddef.h>.
3091 (gethostname): Define with prototype. Length is size_t, not int.
3093 2003-09-08 Paul Eggert <eggert@twinsun.com>
3095 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3096 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3098 2003-09-09 Jim Meyering <jim@meyering.net>
3100 * getversion.c: Remove unused file. Reported by Paul Eggert.
3102 2003-09-03 Paul Eggert <eggert@twinsun.com>
3104 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3105 Bug reported by Lute Kamstra in
3106 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3108 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3109 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3110 course with correspondingly smaller numbers for tomorrow and
3111 yesterday. From Tadayoshi Funaba. Originally installed into
3112 sh-utils on 1999-08-07, but the patch was mistakenly reverted by
3113 the next change to that shared file (but this time in fileutils)
3116 2003-08-18 Paul Eggert <eggert@twinsun.com>
3118 * same.c: Include <stdlib.h> and <string.h> unconditionally,
3119 as we're now assuming that part of hosted C89.
3120 (free) [!HAVE_DECL_FREE]: Remove decl; no longer needed.
3121 (same_name): Invoke pathconf on destination, not source, as
3122 that's a bit clearer even if they are the same dir.
3124 2003-08-18 Jim Meyering <jim@meyering.net>
3126 * getopt.h: Remove space before TAB.
3128 2003-08-17 Paul Eggert <eggert@twinsun.com>
3130 * same.c: Include <stdbool.h>, <limits.h>.
3131 (_POSIX_NAME_MAX): Define if not defined.
3133 (same_name): If file names are silently truncated, report
3134 that the file names are the same if they are the same after
3135 the silent truncation.
3137 2003-08-16 Paul Eggert <eggert@twinsun.com>
3140 * Makefile.am (libfetish_a_SOURCES): Remove getndelim2.c,
3141 getndelim2.h, xstrtoimax.c. Add localcharset.h.
3142 (CLEANFILES, SUFFIXES): Initialize to empty.
3143 (EXTRA_DIST): Add getndelim2.c, getndelim2.h.
3144 (install-exec-local): Use $(GLIBC21), not @GLIBC21@.
3145 Do not mkdir libdir if not glibc21.
3146 (charset.alias): @host@ -> $(host).
3147 (SUFFIXES, .sin.sed, CLEANFILES): Reorder rules
3148 to match gnulib module suggestions.
3149 * localcharset.h, readlink.c: New files, from gnulib.
3150 * asnprintf.c, asnprintf.c, asprintf.c, backupfile.h,
3151 canon-host.c, config.charset, dirname.h, euidaccess.c, exclude.c,
3152 fsusage.h, full-write.c, getloadavg.c, getndelim2.h, gettext.h,
3153 group-member.h, hard-locale.h, hash.c, hash.h, hash-pjw.c,
3154 localcharset.c, long-options.h, makepath.h, malloc.c, mbswidth.c,
3155 mbswidth.h, md5.h, memcasecmp.c, memcasecmp.h, memcoll.h,
3156 mkstemp.c, modechange.h, mountlist.h, path-concat.h, pathmax.h,
3157 physmem.h, posixtm.h, printf-args.c, printf-args.h,
3158 printf-parse.c, printf-parse.h, putenv.c, quote.h, readutmp.h,
3159 ref-add.sin, ref-del.sin, safe-read.c, savedir.h, setenv.c,
3160 setenv.h, stdbool_.h, strnlen.c, strpbrk.c, strtoimax.c,
3161 strverscmp.h, tempname.c, unicodeio.c, unicodeio.h,
3162 unistd-safer.h, unlocked-io.h, vasnprintf.c, vasnprintf.h,
3163 vasprintf.c, vasprintf.h, version-etc.h, xgethostname.c,
3164 xmemcoll.c, xstrtoimax.c, xstrtoumax.c: Sync with gnulib.
3166 2003-08-15 Paul Eggert <eggert@twinsun.com>
3168 * physmem.c: Include "physmem.h" before system includes.
3170 2003-08-10 Jim Meyering <jim@meyering.net>
3172 * utimens.c (utimens): Revert most of last change.
3173 Test HAVE_WORKING_UTIMES instead of HAVE_UTIMES.
3175 2003-08-09 Jim Meyering <jim@meyering.net>
3177 * utimens.c (utimens): Test HAVE_UTIME, not HAVE_UTIMES.
3178 Prefer utime, since it works and utimes doesn't on some systems.
3179 FIXME: Revert the above change once we have a working utimes
3180 replacement function.
3182 2003-08-06 Paul Eggert <eggert@twinsun.com>
3184 * Makefile.am (libeftish_a_SOURCES): Add utimens.c, utimens.h.
3185 * utimens.c, utimens.h: New files.
3187 2003-08-09 Jim Meyering <jim@meyering.net>
3189 * unicodeio.c (unicode_to_mb): Change to `Solaris 5.7' in comment.
3190 * putenv.c: Likewise.
3192 * fatal.c, fatal.h: Remove unused files.
3194 * Makefile.am: Use the e.g., `$(FNMATCH_H)' notation for AC_SUBST'd
3195 variable names, rather than @FNMATCH_H@.
3196 Likewise for $(ALLOCA_H).
3197 (fnmatch.h): Use `$@' in the commands, in place of the three copies
3198 of the literal target, `fnmatch.h'.
3199 (alloca.h): Likewise.
3201 2003-08-08 Paul Eggert <eggert@twinsun.com>
3203 * Makefile.am (libfetish_a_SOURCES): Remove fnmatch_.h.
3204 (lib_OBJECTS): New macro, for convenience when cutting and
3205 pasting Makefile.am templates from gnulib.
3206 (EXTRA_DIST): Remove fnmatch_loop.c.
3207 (BUILT_SOURCES): Append $(FNMATCH_H).
3208 * Makefile.am: Import the following changes from gnulib templates
3209 for alloca and fnmatch):
3210 (all-local $(lib_OBJECTS)): New dependencies.
3211 (alloca.h): Use alloca.h-t for temporary.
3212 (EXTRA_DIST): Append fnmatch_.h, fnmatch_loop.c.
3213 (fnmatch.h): New rule.
3214 (MOSTLYCLEANFILES): Add fnmatch.h, fnmatch.h-t.
3215 (DISTCLEANFILES): Remove fnmatch.h
3217 2003-08-08 Jim Meyering <jim@meyering.net>
3219 * mountlist.c (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3220 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3221 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3222 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3224 2003-08-07 Jim Meyering <jim@meyering.net>
3226 * regex.h (RE_SYNTAX_POSIX_AWK): Remove SPACE in SPACE-TAB sequence.
3228 2003-08-05 Paul Eggert <eggert@twinsun.com>
3230 Merge getline from gnulib.
3231 * getline.h, getline.c: Merge from gnulib.
3232 * getndelim2.h, getndelim2.c: New files, from gnulib.
3233 * getdelim2.c, getdelim2.h: Remove.
3234 * Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
3235 getdelim2.h to getndelim2.c and getndelim2.h.
3237 2003-08-04 Paul Eggert <eggert@twinsun.com>
3239 * regex.c, regex.h: Sync with gnulib.
3241 2003-08-03 Paul Eggert <eggert@twinsun.com>
3243 * stdbool_.h (_Bool): Use a #define, not a typedef.
3245 2003-07-31 Paul Eggert <eggert@twinsun.com>
3247 * bumpalloc.h: Remove.
3248 * Makefile.am (libfetish_a_SOURCES): Remove bumpalloc.h.
3250 2003-07-28 Jim Meyering <jim@meyering.net>
3252 * stdbool_.h: Renamed from stdbool.hin.
3253 * Makefile.am: Reflect renaming: stdbool.hin -> stdbool_.h.
3254 * stdbool.hin: Remove file.
3256 2003-07-28 Paul Eggert <eggert@twinsun.com>
3258 * stdbool.hin (_Bool): Make it signed char, instead of
3259 an enum type, so that it's guaranteed to promote to int.
3261 2003-07-23 Jim Meyering <jim@meyering.net>
3263 * xstrndup.h: New file.
3264 * xstrndup.c: New file, factored out of dircolors.c from coreutils.
3265 * Makefile.am (libfetish_a_SOURCES): Add xstrndup.c and xstrndup.h.
3267 2003-07-23 Jim Meyering <jim@meyering.net>
3269 * lstat.c, save-cwd.c, stat.c, utime.c, xgethostname.c: Normalize
3270 naming of Sun operating systems in comments, e.g., SunOS4 -> SunOS 4,
3271 Solaris5.9 -> Solaris 9. From Paul Eggert.
3273 2003-07-22 Paul Eggert <eggert@twinsun.com>
3275 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3276 over-parenthesization in macros.
3278 2003-07-18 Paul Eggert <eggert@twinsun.com>
3280 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3281 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3282 to test that it can stand by itself. Include "exitfail.h".
3283 Clients should set exit_failure instead.
3284 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3286 2003-07-18 Andreas Schwab <schwab@suse.de>
3288 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3290 2003-07-17 Paul Eggert <eggert@twinsun.com>
3292 * xalloca.h, xmalloc.c, xmemcoll.c, xmemcoll.h:
3293 Merge with gnulib. Use a single exit_failure variable rather
3294 than a separate one for each module.
3296 2003-07-16 Jim Meyering <jim@meyering.net>
3298 * Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
3299 warning from automake -Wall.
3301 2003-07-14 Jim Meyering <jim@meyering.net>
3303 * save-cwd.h: Add copyright.
3305 2003-07-13 Jim Meyering <jim@meyering.net>
3307 * xgethostname.c: Include <stdlib.h> for declaration of free.
3308 (xgethostname): Return NULL, rather than exiting, upon any
3309 non-malloc/realloc error.
3311 2003-07-12 Jim Meyering <jim@meyering.net>
3313 * Makefile.am (BUILT_SOURCES): Use `BUILT_SOURCES += $(STDBOOL_H)'
3314 rather than `all-local: $(STDBOOL_H)'. The latter didn't force
3315 creation of stdbool.h before most other targets.
3316 Likewise for $(ALLOCA_H).
3318 Don't emit diagnostics. Let callers do that.
3319 * save-cwd.c: Don't include "error.h".
3320 (save_cwd): Don't call error. Ensure that errno is valid
3321 when returning nonzero.
3323 * obstack.h: Update from gnulib.
3325 * makepath.c (make_path): Enclose diagnostic in _(...).
3327 2003-07-10 Jim Meyering <jim@meyering.net>
3329 * userspec.c: Include "posixver.h".
3330 (parse_user_spec): Accept `.' as a separator only
3331 in pre-POSIX-200112 mode.
3333 * Makefile.am (libfetish_a_SOURCES): Add these:
3334 printf-args.h, printf-parse.h, vasprintf.h, vasnprintf.h.
3336 Now that a program (`who') uses asprintf, we need all of these:
3337 * asnprintf.c, asprintf.c, printf-args.c, printf-args.h, printf-parse.c:
3338 * printf-parse.h, vasnprintf.c, vasnprintf.h, vasprintf.c, vasprintf.h:
3339 New files, from gnulib.
3341 * alloca_.h, getpass.c, memrchr.c, obstack.h, posixver.c,
3342 strftime.c, strnlen.c, strverscmp.c: Switch from LGPL to GPL.
3344 2003-07-09 Jim Meyering <jim@meyering.net>
3346 * mktime.c: Update from gnulib.
3347 FIXME: but still need to adjust m4/mktime.c so that this fixed
3348 version is used when needed.
3350 Fix the bug that would make `du /' omit the `/' on the last line.
3351 E.g., `du --exclude '[^/]*' -x /' would print only "4\t\n" for me.
3352 * ftw.c (ftw_dir): Don't clobber the leading `/'.
3353 Reported by Chris Lesniewski as http://bugs.debian.org/200542.
3355 2003-07-04 Jim Meyering <jim@meyering.net>
3358 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3359 having it depend on HAVE_SYS_TYPES_H.
3361 2003-06-18 Jim Meyering <jim@meyering.net>
3363 * inttostr.h (PARAMS): Remove. All uses removed.
3365 Merge in change from gnulib.
3366 * makepath.c: Remove block of alloca-related code in favor
3367 of an unconditional `#include <alloca.h>'.
3369 * xalloc.h: Include <stddef.h>.
3370 Remove unnecessary parentheses.
3371 Use `1990-2000' notation in Copyright line until Emacs'
3372 copyright-update function learns how to handle a comma-separated
3373 list of years that spans a line boundary.
3375 * Makefile.am (libfetish_a_SOURCES): Add getdelim2.c and getdelim2.h.
3377 * getline.c (getdelim2): Move this function into its own file.
3378 * getdelim2.c: Extracted from getline.c.
3380 * linebuffer.c, linebuffer.h: Update from gnulib.
3382 * getdelim2.c, getdelim2.h: New files.
3383 * getstr.c, getstr.h: Remove files.
3385 * same.h: Update from gnulib.
3386 * xstrtol.h: Update from gnulib.
3388 2003-06-17 Paul Eggert <eggert@twinsun.com>
3390 Assume C89, so PARAMS isn't needed.
3391 * backupfile.h (PARAMS): Remove. All uses removed.
3392 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3393 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3394 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3395 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3396 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3397 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3398 xstrtol.h: Likewise.
3399 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h, same.h,
3400 * strverscmp.h: Do not include config.h; no longer needed.
3401 Anyway, config.h should always be included before any other file.
3403 2003-06-17 Jim Meyering <jim@meyering.net>
3405 * getline.c: Update from gnulib.
3407 Merge in changes from gnulib.
3408 * hash.c: Include <stdbool.h> unconditionally.
3410 (CHAR_BIT): Don't define.
3412 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3414 * acl.c: Include <sys/types.h> before <sys/stat.h>.
3415 Required on Ultrix 4.3.
3417 2003-05-20 Derek Price <derek@ximbiot.com>
3419 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3421 2003-06-10 Jim Meyering <jim@meyering.net>
3423 * getdate.y: Also accept dates of the form May-23-2003.
3424 Suggestion from Karl Berry.
3426 2003-06-09 Jim Meyering <jim@meyering.net>
3428 * gettimeofday.c: Also undefine gmtime.
3429 (rpl_gmtime): New function. Suggestion from Paul Eggert.
3431 2003-06-08 Jim Meyering <jim@meyering.net>
3433 * getline.h: Update from gnulib.
3435 Clean up, as part of merge with emacs version of strftime.c.
3436 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3437 Remove function, now that we can rely on a working tzset function.
3438 [!_LIBC]: Ensure that the required autoconf test has been run.
3439 * gettimeofday.c: Also undef tzset.
3440 (rpl_tzset): New function, for use by new macro, gl_FUNC_TZSET_CLOBBER.
3442 2003-06-07 Jim Meyering <jim@meyering.net>
3444 * readtokens.h: Add copyright notice.
3446 Remove definition and uses of __P.
3448 * readtokens.c: Put `Free Software Foundation, Inc.' in place of
3449 my name in the copyright comment.
3450 (init_tokenbuffer): Remove unnecessary parentheses around malloc.
3453 * getdate.y: Include alloca.h unconditionally.
3454 * xmemcoll.h: Include <stddef.h>.
3456 * Makefile.am (MOSTLYCLEANFILES): Add alloca.h and alloca.ht.
3457 (MOSTLYCLEANFILES): Add stdbool.ht.
3459 * human.c: Include <stdio.h>, once again, for declaration of sprintf.
3462 * tempname.c: Include <stddef.h> unconditionally.
3463 Include <inttypes.h> as an alternative to <stdint.h>.
3464 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
3465 * xstrtol.h: Likewise.
3466 * xstrtoimax.c: Likewise.
3467 * xstrtoumax.c: Likewise.
3470 * strcasecmp.c: Include <stddef.h>, not <sys/types.h>.
3471 * savedir.c: Include <stddef.h>.
3472 (NULL): Don't define, since <stddef.h> does that.
3474 2003-06-06 Jim Meyering <jim@meyering.net>
3477 * rpmatch.c: Include <limits.h> without checking for HAVE_LIMITS_H.
3478 Include <stddefs.h> unconditionally.
3479 (NULL): Don't define, since <stddef.h> does that.
3480 * rename.c: #undef rename before defining rpl_rename.
3481 [HAVE_CONFIG_H]: Guard inclusion of config.h.
3482 * putenv.c: Include <stddef.h> rather than <sys/types.h>,
3483 as we merely need size_t.
3484 * realloc.c: Likewise.
3485 * quote.c: Don't include <stddef.h> or <sys/types.h>; not needed.
3486 * modechange.c: Include <stddef.h>.
3487 (NULL): Don't define, since <stddef.h> does that.
3488 * memcoll.h: Include <stddef.h>, to get size_t.
3489 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3490 our interface, instead of including <sys/types.h>
3491 (memcoll): Fall back on a simple algorithm using
3492 memcmp if strcoll doesn't work.
3493 * memcasecmp.h: Include <stddef.h>.
3494 * memcasecmp.c: Don't include <sys/types.h>.
3497 * alloca_.h: New file.
3498 * Makefile.am (EXTRA_DIST): Add alloca_.h.
3499 (all-local $(lib_OBJECTS)): Depend on $(ALLOCA_H).
3500 (alloca.h): New rule.
3502 * addext.c: Update from gnulib.
3503 * backupfile.c: Likewise.
3504 * config.charset: Likewise.
3505 * dirname.h: Likewise.
3506 * fsusage.c: Likewise.
3507 * userspec.c: Likewise.
3508 * xreadlink.c: Likewise.
3509 * xstrtol.c: Likewise.
3510 * __fpending.h: Likewise.
3512 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3513 (memcpy): Remove definition.
3515 * posixtm.c: Include <stdbool.h> unconditionally.
3517 2003-06-05 Jim Meyering <jim@meyering.net>
3520 * mktime.c: Assume freestanding C89 or better.
3521 (HAVE_LIMITS_H): Remove. Assume it's 1.
3522 (__P): Remove; not used.
3523 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3524 (mktime, not_equal_tm, print_tm, check_result,
3525 main): Use prototypes. Use const * where appropriate.
3526 (main): Fix typo in testing code that uncovered by above changes.
3527 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3529 2003-06-04 Paul Eggert <eggert@twinsun.com>
3531 Merge human.c etc. from gnulib.
3532 * exclude.c, human.c, human.h: Merge from gnulib.
3533 * cycle-check.c, cycle-check.h, src/system.h:
3534 Include <stdbool.h> unconditionally.
3536 2003-06-02 Jim Meyering <jim@meyering.net>
3538 * stdbool.hin: New file. From gnulib.
3539 * Makefile.am (MOSTLYCLEANFILES): Initialize.
3540 (stdbool.h): New rule.
3541 (all-local $(lib_OBJECTS)): Depend on $(STDBOOL_H)
3542 (MOSTLYCLEANFILES): Add stdbool.h.
3543 (EXTRA_DIST): Add stdbool.h.
3545 2003-05-30 Jim Meyering <jim@meyering.net>
3547 * addext.c: Update from gnulib.
3548 * mktime.c: Likewise.
3550 2003-05-29 Jim Meyering <jim@meyering.net>
3552 Make the %r format directive honor any locale setting.
3553 * strftime.c: (my_strftime) [!defined _NL_CURRENT && HAVE_STRFTIME]:
3554 Use underlying_strftime for %r.
3556 2003-05-15 Jim Meyering <jim@meyering.net>
3558 * getopt.h: Remove a space before a TAB.
3560 2003-05-13 Jim Meyering <jim@meyering.net>
3562 * setenv.c (setenv): Don't apply cast to argument of free.
3563 * putenv.c (rpl_putenv): Likewise.
3564 * alloca.c (alloca): Likewise.
3566 2003-05-12 Jim Meyering <jim@meyering.net>
3568 * ftw.c (ftw_startup): Always call free_cwd after restore_cwd.
3569 Reported by Matti Aarnio as
3570 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90563.
3571 Forwarded by Tim Waugh.
3573 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3574 the space-padded-by-default conversion specifiers, %e, %k, %l.
3576 2003-05-07 Paul Eggert <eggert@twinsun.com>
3578 * xnanosleep.c (timespec_subtract): Don't modify the 2nd arg.
3579 Work even if X-Y overflows when subtracting. Make explicit the
3580 assumption that tv_nsec must be in range.
3581 (clock_get_realtime): Remove. All callers changed to invoke gettime,
3583 (xnanosleep): Check for gettime failure every time.
3585 2003-05-06 Jim Meyering <jim@meyering.net>
3587 * xnanosleep.c (clock_get_realtime): Use gettime.c's gettime function,
3588 rather than an inferior, open-coded version that would fail on
3589 AIX systems due to clock_gettime failing with errno == ENOSYS.
3590 Reported by Jérôme Zago.
3592 2003-05-05 Jim Meyering <jim@meyering.net>
3594 Avoid array overrun.
3595 * ftw.c (nftw_arr): Update to reflect complete list of members.
3597 Reported by Olatunji Oluwabukunmi Ruwase.
3599 Make it less likely that the above can happen again.
3600 * ftw.c (struct dummy): Ensure that at least the number of
3601 initializers matches the number of members in the corresponding enum.
3602 * ftw_.h (enum Ftw_option): Name this previously-anonymous enum.
3603 (enum Ftw_option) [FTW_N_MEMBERS]: New member.
3605 2003-05-04 Jim Meyering <jim@meyering.net>
3607 * setenv.c (__set_errno, LOCK, UNLOCK): Define.
3608 (unsetenv): Update from GNU libc.
3609 Ifdef-out this function, since the only caller
3610 is putenv.c and that file now has its own copy.
3612 This avoids a core dump on systems without GNU putenv,
3613 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3614 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3615 (unsetenv): New static function, from GNU libc.
3616 (rpl_putenv): Use it.
3618 2003-05-02 Jim Meyering <jim@meyering.net>
3620 * canonicalize.c (canonicalize_file_name) [!HAVE_RESOLVEPATH]:
3621 A memory-allocation error could result in heap corruption. Fix it
3622 by also updating `dest' when rpath may be changed by xrealloc.
3624 2003-04-15 Jim Meyering <jim@meyering.net>
3626 * getloadavg.c: Remove (or replace-with-TAB(s) to retain alignment)
3627 each sequence of spaces before a TAB character.
3628 * md5.c, getopt.c, getopt.h, obstack.h, strftime.c: Likewise.
3630 2003-04-11 Jim Meyering <jim@meyering.net>
3632 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3634 * canonicalize.c, exclude.c, getgroups.c, getusershell.c:
3635 * group-member.c, idcache.c, mountlist.c, readtokens.c, readutmp.c:
3636 * bumpalloc.h: Remove anachronistic casts of xmalloc, xrealloc,
3637 and xcalloc return values.
3639 * xalloc.h (PARAMS): Remove definitions and uses.
3640 (XMALLOC, XCALLOC, XREALLOC): Remove unnecessary casts.
3642 * xmalloc.c: Remove use of PARAMS.
3644 2003-04-10 Jim Meyering <jim@meyering.net>
3646 * canonicalize.c (canonicalize_file_name) [HAVE_RESOLVEPATH]: Remove
3647 stray semicolon that caused `readlink --canonical RELATIVE_NAME' to
3648 fail on e.g., Solaris systems. Reported by Bruce Korb.
3649 (canonicalize_file_name): Return NULL immediately if resolvepath fails.
3650 Otherwise, `readlink --canonical /no-such-file' would exhaust
3651 virtual memory on some systems (e.g. Solaris).
3652 (canonicalize_file_name): Always free `extra_buf' before returning.
3653 (canonicalize_file_name): NUL-terminate the result.
3655 2003-04-05 Jim Meyering <jim@meyering.net>
3657 * Makefile.am (DEFS): Use += notation rather than `DEFS = ... @DEFS@'.
3658 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3659 emit a definition for each substituted variable.
3661 2003-03-26 Richard Dawe <rich@phekda.freeserve.co.uk>
3663 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
3664 Add test-cases for DOS filenames. Declare program_name.
3665 (main): Set up program_name.
3667 2003-03-22 Jim Meyering <jim@meyering.net>
3669 * strftime.c (widen): Cast alloca return value to proper type.
3672 (NEW_PATTERN): Cast alloca return value to proper type.
3673 Otherwise, it wouldn't compile with at least /bin/cc on
3674 ymp-cray-unicos9.0.2.X.
3675 Combine two mostly-identical uses of alloca into one.
3676 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3678 2003-03-19 Jim Meyering <jim@meyering.net>
3680 DJGPP doesn't have S_ISLNK, so provide a replacement.
3681 * ftw.c (S_IFMT): Define, if necessary.
3682 [STAT_MACROS_BROKEN]: Undefine S_ISLNK.
3683 (S_ISLNK): Define, if necessary.
3684 Based on a patch from Rich Dawe.
3686 * exclude.h (PARAMS): Remove definition and uses.
3687 * exclude.c: Remove uses of `PARAMS'.
3689 * fnmatch_.h: Don't define __const.
3690 (fnmatch): Use const, not __const in prototype.
3693 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3695 * fchdir-stub.c: New file: trivial stub for fchdir.
3697 2003-03-18 Jim Meyering <jim@meyering.net>
3699 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3701 Use mntctl's return value to drive the entry-processing loop, since
3702 we can't rely on the value of the vmt_length member in the last
3703 entry. On some systems doing so could result in exhausting
3704 virtual memory. Based in part on a patch from Mike Jetzer.
3706 * quote.c (quote_n): Fix typo in comment.
3708 2003-03-17 Jim Meyering <jim@meyering.net>
3710 * raise.c (raise): Rename from rpl_raise.
3711 Without that change, systems lacking raise (SunOS 4) would not be
3712 able to link programs using raise. Reported by Volker Borchert.
3714 * ftw.c (FTW_STAT): Rename from `STAT', to avoid conflict
3715 with STAT definition from <sys/dir.h> on AIX 5.1.
3716 Suggestion from Mike Jetzer and Petter Reinholdtsen.
3718 * fchown-stub.c (fchown): Put function type on its own line.
3719 * readlink-stub.c (readlink): Likewise.
3720 * lstat-stub.c (lstat): Likewise.
3722 2003-03-14 Jim Meyering <jim@meyering.net>
3724 * Makefile.am (AUTOMAKE_OPTIONS): Remove definition --
3725 before it pointed to ../src/ansi2knr. Some of these files
3726 have required an ANSI (c89) compiler for a year or two.
3727 (libfetish_a_SOURCES): Remove unused files: c-stack.c, c-stack.h.
3729 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3731 * stat.c: Include "xalloc.h".
3733 2003-03-13 Paul Eggert <eggert@twinsun.com>
3735 Merge changes from Bison.
3736 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
3737 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
3738 when compiling Bison 1.875's `bitset bset = obstack_alloc
3739 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
3741 2003-01-30 Richard Dawe <rich@phekda.freeserve.co.uk>
3743 * fchown-stub.c: New file: trivial stub for fchown.
3744 * lstat-stub.c: New file: trivial stub for lstat.
3745 * readlink-stub.c: New file: trivial stub for readlink.
3747 2003-03-09 Paul Eggert <eggert@twinsun.com>
3749 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
3750 Reported by Bruce Becker; see:
3751 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
3753 2003-03-03 Paul Eggert <eggert@twinsun.com>
3754 Bruno Haible <bruno@clisp.org>
3756 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
3757 Reported by John Hughes, see
3758 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
3760 2003-03-09 Jim Meyering <jim@meyering.net>
3762 * ftw.c: Include "save-cwd.h".
3763 (ftw_startup): Avoid use of getcwd, if possible.
3764 Instead, use fopen/fchdir via save_cwd/restore_cwd.
3766 2003-03-08 Jim Meyering <jim@meyering.net>
3768 * xnanosleep.c: Don't use `defined' in a #define directive.
3770 2003-03-07 Jim Meyering <jim@meyering.net>
3772 * Makefile.am (libfetish_a_SOURCES): Remove mmap-stack.h.
3774 * mmap-stack.c, mmap-stack.h: Remove files.
3776 * getcwd.c: #undef getcwd only after *all* included header files.
3777 Declare getcwd unconditionally. The problem was that same.h
3778 included config.h, and that defined getcwd to rpl_getcwd a second
3779 time (after the original #undef), and led to the rpl_getcwd
3780 function calling itself endlessly. This was the cause of at least
3781 the `du' test failures on IRIX 6.5, reported by Nelson Beebe.
3783 * same.h (same_name): Remove unnecessary inclusion of config.h.
3784 It also happened to lead to infinite recursion in getcwd.c.
3785 (PARAMS): Remove definition and use.
3787 2003-03-06 Jim Meyering <jim@meyering.net>
3789 * ftw.c (ftw_startup): Declare `func' parameter to be of type
3790 NFTW_FUNC_T, not void* which may be smaller on 64-bit systems.
3791 Remove now-unnecessary cast.
3792 (FTW_NAME): Cast func argument to type `NFTW_FUNC_T'.
3794 2003-03-05 Jim Meyering <jim@meyering.net>
3796 * physmem.c (ARRAY_SIZE): Define it.
3798 2003-03-04 Jim Meyering <jim@meyering.net>
3800 * makepath.c (CLEANUP_CWD): Call error here, now that restore_cwd
3803 * save-cwd.h (restore_cwd): Update prototype.
3804 * save-cwd.c (restore_cwd): Remove two parameters.
3805 Simplify. Don't call error upon failure. Let callers do that.
3806 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3807 when auditing is enabled. But don't bother updating the #if.
3809 * xgetcwd.c (xgetcwd): Improve comment.
3811 * getcwd.c: New file.
3813 2003-02-28 Jim Meyering <jim@meyering.net>
3815 * ftw.c (ftw_startup): Return -1 if alloca fails.
3817 2003-02-28 Jim Meyering <jim@meyering.net>
3819 * fts.c (fts_children): If opening `.' fails, set the fts_child
3820 member to NULL before returning. From NetBSD.
3822 * fts.c (fts_children): If fchdir fails, close file descriptor
3823 before returning. From NetBSD.
3825 2003-02-27 Jim Meyering <jim@meyering.net>
3827 * physmem.c (physmem_total, physmem_available): Add comments.
3830 * physmem.c: Merge in portability changes from gcc/libiberty
3831 to support AIX, Tru64, and Windows. See the ChangeLog there
3832 for credits and details. Thanks to Kaveh Ghazi for helping
3833 to keep these files in sync.
3835 2003-02-24 Jim Meyering <jim@meyering.net>
3837 * fts_.h [__USE_FILE_OFFSET64]: Remove #error directive.
3839 (fts_open): Initialize local, tmp, to pacify gcc.
3841 * fts_.h [struct FTS] (fts_dir_signatures): New, opaque member.
3842 * fts.c: Include <search.h>.
3843 (struct known_object): Define.
3844 (object_compare, add_object, find_object): New functions, like
3846 (fts_open): Initialize new member.
3847 (fts_close): Free memory allocated for new member.
3848 (fts_stat): Detect a cycle in O(logN) time per directory processed.
3850 * fts.c [HAVE_CONFIG_H]: Include <config.h>.
3851 Conditionalize inclusion of <sys/param.h>.
3852 Conditionalize inclusion of <include/sys/stat.h> vs <sys/stat.h>.
3853 Include autoconf-recommended block of dirent/NAMELEN-related
3854 definitions and includes. Use NAMLEN throughout, rather than
3856 [_LIBC] (close, closedir, fchdir, open, opendir): Define.
3857 [_LIBC] (readdir, tdestroy, tfind, tsearch): Define.
3858 Remove `__' prefix from all uses of the above. This will help
3859 to merge *BSD changes.
3860 [!_LIBC] (internal_function): Define.
3861 [! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define lstat.
3862 (__set_errno): Define if not already defined.
3864 * fts.c: (fts_open): If fts_alloc returns NULL, don't dereference it.
3865 (fts_read): If fts_safe_changedir fails because it is not
3866 able to chdir into a subdirectory, then inform the caller.
3868 * fts.c, fts_.h: New files, directly from glibc.
3870 2003-02-23 Jim Meyering <jim@meyering.net>
3872 * fts_.h (struct _ftsent) [fts_level]: Change type from short to int,
3873 so it can handle a root-relative file name longer than 32K bytes.
3874 [fts_pathlen, fts_namelen]: Rearrange members to decrease size of
3875 this struct from 84 to 80 bytes.
3877 2003-02-21 Jim Meyering <jim@meyering.net>
3879 * mmap-stack.h: Undefine HAVE_MMAP_STACK, thus disabling
3880 this code on all systems.
3882 Merge in some changes from GNU libc.
3883 * md5.h (md5_uintptr): Define.
3885 * ftw.c: Include <sys/types.h> before <dirent.h>.
3886 This is required for Apple Darwin 6.3 (MacOS 10.2.3).
3887 Patch by Nelson Beebe.
3889 2003-02-19 Jim Meyering <jim@meyering.net>
3891 * md5.c: Merge in some clean-up and optimization changes from glibc.
3892 * sha.c: Apply those same changes here, too.
3894 2003-02-18 Jim Meyering <jim@meyering.net>
3896 * md5.c (md5_stream) [BLOCKSIZE]: Move definition to top of file.
3897 Ensure that it is a multiple of 64.
3898 Rearrange loop exit tests so as to avoid performing an
3899 additional fread after encountering an error or EOF.
3900 * sha.c (sha_stream): Likewise.
3901 Reported by Michael Bacarella.
3903 * Makefile.am (CLEANFILES): Remove ftw.h and search.h.
3904 (DISTCLEANFILES): Add them here.
3907 * sha.c (sha_stream): Rearrange loop exit tests so as to avoid
3908 performing an additional fread after encountering an error or EOF.
3910 2003-02-17 Jim Meyering <jim@meyering.net>
3912 * mmap-stack.h (RUN_WITH_BIG_STACK_4): Define.
3914 * physmem.c: Undo most of last change.
3915 Use sysmp instead, since it provides a cleaner interface.
3918 2003-02-16 Jim Meyering <jim@meyering.net>
3920 * Makefile.am (libfetish_a_SOURCES): Add mmap-stack.h.
3922 * mmap-stack.c (MAP_ANONYMOUS): Use MAP_ANON, if possible.
3923 Initialize `fd' to -1, so Solaris' mmap works with MAP_ANON.
3925 2003-02-15 Jim Meyering <jim@meyering.net>
3927 * mmap-stack.c, mmap-stack.h: New files.
3928 Let the caller run a function with a larger (mmap'd) stack.
3930 Add Irix6 support to physmem.c.
3931 * physmem.c (irix_sysget): New function.
3932 (IRIX_SYSGET_TOTAL, IRIX_SYSGET_AVAILABLE): New macros.
3933 (physmem_total, physmem_available): Use them.
3934 (main) [DEBUG]: New function.
3936 2003-02-11 Jim Meyering <jim@meyering.net>
3938 * Makefile.am (libfetish_a_SOURCES): Add euidaccess.h.
3939 * euidaccess.c: Include "euidaccess.h".
3940 * euidaccess.h: New file.
3942 2003-02-08 Jim Meyering <jim@meyering.net>
3944 * ftw.c (ftw_startup): Don't shadow outer declaration of save_err.
3945 Merge inconsequential changes from libc.
3947 * ftw.c (ftw_startup): When using FTW_CHDIR, always remember
3948 the current directory, not just when DIR contains a slash.
3949 Reported by Manoj Srivastava via Michael Stone as Debian bug #180228.
3951 2003-02-07 Jim Meyering <jim@meyering.net>
3953 Merge inconsequential changes from libc.
3954 * ftw.c: Include limits.h earlier.
3955 Move PATH_MAX definition `down' a little; add comment.
3956 Rename local, saved_errno to save_err.
3958 2003-02-06 Jim Meyering <jim@meyering.net>
3960 Support for pruning.
3961 * ftw_.h (FTW_DPRE) [enum]: New member and definition.
3962 (struct FTW) [skip]: New member.
3964 * search_.h (__restrict): Define to `restrict' or to nothing.
3966 * fsusage.c: Remove declaration of statfs.
3967 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3968 Reported by Nelson Beebe.
3970 2003-02-05 Jim Meyering <jim@meyering.net>
3972 Fix a heap-corruption bug that affected Solaris systems.
3973 * ftw.c: Include <limits.h>.
3974 (PATH_MAX): Define to 1024, if not already defined.
3975 (process_entry): Allocate enough space to hold the resulting
3976 file name. Don't presume that 2*dirbufsize is enough.
3977 (ftw_startup): Always use PATH_MAX to compute buffer size, now that
3978 it is guaranteed to be defined.
3979 Nelson Beebe reported that du would sometimes segfault on Solaris.
3981 * ftw.c (process_entry): When using FTW_DEPTH, call `func', the
3982 user-supplied callback, once for the current directory before calling
3983 ftw_dir, in case that part of the hierarchy should be pruned.
3984 `func' does that by setting `data->skip'.
3985 (ftw_startup): Likewise.
3987 2003-02-02 Jim Meyering <jim@meyering.net>
3989 * ftw.c (lstat) [!_LIBC && !LSTAT_FOLLOWS_SLASHED_SYMLINK]:
3990 Define to rpl_lstat.
3992 2003-01-25 Jim Meyering <jim@meyering.net>
3994 * ftw.c (ISSLASH, FILESYSTEM_PREFIX_LEN) [_LIBC]: Define.
3995 (base_name): New function.
3996 (ftw_startup): Don't strip trailing slashes.
3997 Use base_name to find the offset of the basename.
3999 2003-01-25 Jim Meyering <jim@meyering.net>
4001 * ftw.c (object_compare): Compare inode numbers before device numbers.
4002 The former is much more likely to differ for any two given file objects.
4004 2003-01-23 Jim Meyering <jim@meyering.net>
4006 * tsearch.c [HAVE_CONFIG_H]: Include <config.h>.
4007 Add autoconf-recommended block of alloca-related code.
4008 Cast each use of alloca to the required type, (node**).
4010 * ftw.c: Add autoconf-recommended block of alloca-related code.
4011 [!_LIBC] (__getcwd): Define to xgetcwd and declare xgetcwd.
4013 2003-01-22 Jim Meyering <jim@meyering.net>
4015 * ftw.c (find_object): Don't use c99-style struct initializer.
4017 * ftw_.h: Change all uses of __const to const.
4018 * search_.h: Likewise.
4020 * Makefile.am (CLEANFILES): Add generated files: ftw.h search.h.
4022 * ftw.c (process_entry): Handle FTW_DCHP.
4023 (ftw_dir): Handle FTW_DCH.
4025 * ftw_.h [!_LIBC && !__USE_XOPEN_EXTENDED]: Define __USE_XOPEN_EXTENDED
4026 and FTW_H_STANDALONE.
4027 [anon enum] (FTW_DCH, FTW_DCHP): New members.
4028 (FTW_DCH, FTW_DCHP): Define.
4030 * ftw.c: Include autoconf-recommended block of dirent/NAMELEN
4031 related definitions and includes. Use NAMELEN throughout,
4032 rather than _D_EXACT_NAMLEN.
4033 [_LIBC]: Define NAMELEN to _D_EXACT_NAMLEN.
4034 (stpcpy): Declare, if necessary.
4035 (mempcpy): Define, if necessary.
4036 [!_LIBC] (__stpcpy, __mempcpy): Define.
4037 [!_LIBC] (LXSTAT, XSTAT): Define.
4039 2003-01-21 Jim Meyering <jim@meyering.net>
4041 * tsearch.c: New file, from GNU libc.
4042 [! weak_alias]: Define __-prefixed names to publicized ones.
4043 [! defined _LIBC] (weak_alias, internal_function): Define-away.
4044 [defined weak_alias]: Guard each use of weak_alias.
4046 2003-01-20 Jim Meyering <jim@meyering.net>
4048 * canonicalize.c: Include "path-concat.h".
4050 * search_.h: New file, from GNU libc.
4052 * Makefile.am (libfetish_a_SOURCES): Use ftw_.h here, too.
4053 (libfetish_a_SOURCES): Add search_.h.
4054 * ftw_.h: Rename from ftw.h.
4056 * obstack.h (obstack_object_size): Declare temporary, __o,
4057 to be const, in order to avoid warnings.
4058 (obstack_room): Likewise.
4059 (obstack_empty_p): Likewise.
4061 Merge in changes from GNU libc
4062 * error.c: Eliminate many `#ifdef USE_IN_LIBIO' conditionals.
4064 2003-01-19 Ulrich Drepper <drepper@redhat.com>
4067 * strftime.c (my_strftime): Handle very large width
4068 specifications for numeric values correctly. Improve checks for
4071 2003-01-19 Jim Meyering <jim@meyering.net>
4073 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4074 (nl_get_alt_digit) [! defined my_strftime]: Define.
4075 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4076 _nl_get_alt_digit and _nl_get_walt_digit.
4078 * strftime.c (my_strftime): Merge in locale-related changes from libc.
4079 These changes have no effect outside of _LIBC.
4081 2003-01-14 Jim Meyering <jim@meyering.net>
4083 * same.c (same_name): Declare *_basename locals to be `const'.
4084 Consolidate declarations and initializations of *_base* locals.
4086 2003-01-11 Bruno Haible <bruno@clisp.org>
4088 * same.c (same_name): Reorder tests so as to avoid calling stat()
4089 when a string comparison is sufficient.
4091 2003-01-11 Bruno Haible <bruno@clisp.org>
4093 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4096 2003-01-14 Jim Meyering <jim@meyering.net>
4098 * ftw.c: Merge in Ulrich's and my changes from libc.
4100 2003-01-12 Jim Meyering <jim@meyering.net>
4102 * ftw.c (ftw_startup): Rename local-shadowing local to pacify gcc.
4103 Also work on systems that have `struct direct', using autoconf's
4107 * ftw.h, ftw.c: New files, from glibc/io.
4109 * Makefile.am (libfetish_a_SOURCES): Add ftw.h.
4111 2003-01-11 Jim Meyering <jim@meyering.net>
4113 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4115 * canonicalize.c: Don't test HAVE_ERRNO_H. It's not necessary.
4116 Don't test HAVE_STDDEF_H. It's not necessary.
4117 Use definition of PTR_INT_TYPE from obstack.h.
4119 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
4121 * canonicalize.c: New file.
4122 The readlink-based implementation imported from GNU C Library.
4123 The resolveip-based implementation imported from src/df.c (show_point).
4124 * canonicalize.h: New file.
4125 * Makefile.am (libfetish_a_SOURCES): Add canonicalize.h.
4127 2003-01-10 Jim Meyering <jim@meyering.net>
4129 * save-cwd.h: Remove uses of PARAMS.
4131 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
4133 * xgetcwd.h: New file.
4134 * Makefile.am (libfetish_a_SOURCES): Add xgetcwd.h.
4135 * save-cwd.c: Include "xgetcwd.h".
4136 * xgetcwd.c: Likewise.
4138 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
4140 * getgroups.c: Don't declare functions declared by xalloc.h.
4141 Include "xalloc.h" instead.
4142 * group-member.c: Likewise.
4143 * idcache.c: Likewise.
4144 * readutmp.c: Likewise.
4146 2003-01-08 Jim Meyering <jim@meyering.net>
4148 * full-write.c: Undefine and define-away `const' after inclusion
4149 of errno.h, not before. Suggestion from Bruno Haible.
4151 2003-01-06 Jim Meyering <jim@meyering.net>
4153 * full-write.c: Rework so that it may serve to define full_read, too.
4154 * full-read.c: Simply #define FULL_READ and include full-write.c.
4156 * Makefile.am (libfetish_a_SOURCES): Add full-read.c and full-read.h.
4157 * full-read.c, full-read.h: New files.
4161 2002-12-10 Paul Eggert <eggert@twinsun.com>
4162 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4163 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4164 Choose values that are less likely to collide with system fnmatch
4166 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4167 defined (e.g., a pure POSIX system).
4168 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4169 instead of FNM_FILE_NAME, for compatibility with pure POSIX systems.
4173 * utime.c (utime_null): Use SAFE_READ_ERROR.
4174 (utime_null): No need to call ftruncate if the file was nonempty.
4175 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4176 * canon-host.c (strdup): Remove unused declaration.
4177 * fsusage.c: Include full_read.h.
4178 (get_fs_usage): Use full_read instead of safe_read.
4179 Patches by Bruno Haible.
4181 2003-01-04 Jim Meyering <jim@meyering.net>
4183 * version-etc.c: Update copyright date.
4185 2002-12-31 Jim Meyering <meyering@lucent.com>
4187 * dev-ino.h: New file.
4188 * cycle-check.c: New file.
4189 * cycle-check.h: New file.
4190 * Makefile.am (libfetish_a_SOURCES): Add cycle-check.c, cycle-check.h,
4193 2002-12-21 Jim Meyering <jim@meyering.net>
4195 * stime.c: Remove file (for real, this time).
4197 2002-12-15 Jim Meyering <jim@meyering.net>
4199 * strftime.h: New file, for declaration of nstrftime.
4200 * Makefile.am (libfetish_a_SOURCES): Add strftime.h.
4202 2002-12-09 Jim Meyering <jim@meyering.net>
4204 * unlocked-io.h: Sync from gnulib.
4206 2002-12-06 Jim Meyering <jim@meyering.net>
4208 * unlocked-io.h: New file, but with proper copyright notice and
4209 attribution. Note: this is *not* the same as the file in gnulib.
4210 This uses #if HAVE_FUNC_UNLOCKED for each `FUNC', rather than
4211 HAVE_DECL_FUNC_UNLOCKED. This usage is consistent with the autoconf
4212 macro in ../m4/jm-glibc-io.m4. Modulo comments, this file still
4213 contains exactly what was generated by gen-uio.
4215 2002-12-04 Paul Eggert <eggert@twinsun.com>
4217 Do not generate unlocked-io.h automatically, since it's easier to
4218 maintain it by hand.
4221 * Makefile.am: Add copyright notice.
4222 (libfetish_a_SOURCES): Add unlocked-io.h.
4223 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4224 (DISTCLEANFILES, io_functions): Remove macros.
4225 (EXTRA_DIST): Remove gen_uio.
4226 (unlocked-io.h): Remove rule.
4228 2002-12-05 Paul Eggert <eggert@twinsun.com>
4230 * alloca.c [defined emacs]: Include "lisp.h".
4231 (xalloc_die) [defined emacs]: New macro.
4232 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4233 [! defined emacs]: Include <xalloc.h>.
4234 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4235 (pointer): Typedef to POINTER_TYPE *.
4236 (malloc): Remove decl; we now always use xmalloc.
4237 (alloca): Use old-style definition, since Emacs needs this.
4238 Check for arithmetic overflow when computing combined size.
4240 2002-12-04 Jim Meyering <jim@meyering.net>
4242 Reflect the fact that stat.c and lstat.c are no longer generated.
4243 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4244 (DISTCLEANFILES): Likewise.
4245 (EXTRA_DIST): Likewise.
4246 (all_local): Don't depend on stat.c or lstat.c.
4247 (stat.c, lstat.c): Remove rules.
4248 (EXTRA_DIST): Remove xstat.in.
4250 * xstat.in: Remove file. Contents moved into stat.c.
4251 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4252 * lstat.c: Simply #define LSTAT and include stat.c.
4254 * safe-read.c: Rework so that it may serve to define safe_write, too.
4255 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4257 2002-12-03 Jim Meyering <jim@meyering.net>
4259 * safe-read.h: Update from gnulib (add comments, include stddef.h).
4261 2002-12-02 Jim Meyering <jim@meyering.net>
4263 * safe-read.c (EINTR): Define.
4264 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4266 2002-12-01 Jim Meyering <jim@meyering.net>
4268 * safe-read.c: Merge from gnulib.
4269 (safe_read): Also exit the loop when read returns zero.
4270 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4272 * Makefile.am (libfetish_a_SOURCES): Add safe-write.c and safe-write.h.
4274 * strtoll.c: Update from gnulib (trivial changes).
4275 * strdup.c: Likewise.
4276 * strpbrk.c: Likewise.
4277 * strstr.c: Likewise.
4278 * tempname.c: Likewise.
4279 * obstack.c: Likewise.
4280 * getopt.c: Likewise.
4281 * getopt1.c: Likewise.
4282 * getopt.h: Likewise.
4283 * quote.h: Update from gnulib: add Copyright comment.
4284 * quote.c: Likewise.
4286 2002-11-28 Jim Meyering <jim@meyering.net>
4288 * mktime.c: Merge from gnulib/libc, for a slightly uglier solution.
4290 Merge some more, in preparation for merge back into libc.
4291 * error.c (_): Define only if not already defined.
4292 Move definition to follow all #include directives.
4293 Include unlocked-io.h only if !_LIBC.
4295 Merge in changes from libc.
4296 * error.c [_LIBC]: Include <libio/libioP.h>.
4297 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4298 (fflush): Tweak definition to use INTUSE.
4301 2002-11-23 Jim Meyering <jim@meyering.net>
4303 From gnulib, by Bruno Haible
4304 * closeout.c: Include gettext.h instead of <libintl.h>.
4305 * makepath.c: Likewise.
4306 * rpmatch.c: Likewise.
4307 * userspec.c: Likewise.
4308 * version-etc.c: Likewise.
4309 * xmemcoll.c: Likewise.
4310 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4312 * mbswidth.h: Update from gnulib.
4313 * mbswidth.c: Likewise.
4314 * localcharset.c: Likewise.
4315 * config.charset: Likewise.
4316 * unicodeio.c: Likewise.
4318 2002-11-22 Paul Eggert <eggert@twinsun.com>
4320 * quotearg.h: Allow multiple inclusion by surrounding with
4321 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4322 so that we can be included first.
4323 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4324 * quotearg.c: Include quotearg.h immediately after config.h.
4325 No need to include stddef.h or sys/types.h any more.
4326 Surround local include files with "", not "<>".
4327 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4328 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4329 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4330 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4331 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4332 (ISPRINT): Remove; no longer needed now that we assume C89.
4334 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4337 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4338 quotearg_char): Use SIZE_MAX rather than
4339 (size_t) -1 when we are talking about "infinity".
4341 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4343 2002-11-22 Jim Meyering <jim@meyering.net>
4346 * strstr.c: Don't include <sys/types.h>. It's unnecessary.
4348 2002-11-21 Bruno Haible <bruno@clisp.org>
4350 Remove case insensitive option matching.
4351 * argmatch.h (argcasematch): Remove declaration.
4352 (ARGCASEMATCH): Remove macro.
4353 (__xargmatch_internal): Remove case_sensitive argument.
4354 (XARGMATCH): Update.
4355 (XARGCASEMATCH): Remove macro.
4356 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4357 case_sensitive argument.
4358 (argcasematch): Remove function.
4359 (__xargmatch_internal): Remove case_sensitive argument.
4360 (main): Use XARGMATCH instead of XARGCASEMATCH.
4362 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4364 2002-11-21 Bruno Haible <bruno@clisp.org>
4366 * xmalloc.c: Change compile-time error message. Add comment about
4367 required autoconf version.
4368 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4369 (textdomain): Remove definition.
4371 2002-11-21 Jim Meyering <jim@meyering.net>
4373 * strdup.c (strdup): Merge in changes from gnulib; mainly to
4374 use memcpy rather than strcpy.
4376 * strcspn.c: Update from gnulib.
4378 * sig2str.c (str2signum): Use unsigned, not size_t, for type of index.
4380 * quotearg.c: Use `"'s when including quotearg.h and xalloc.h,
4381 not the `<...>' notation.
4382 Include <errno.h> and declare errno if necessary.
4384 * README: Update from gnulib.
4386 2002-11-20 Paul Eggert <eggert@twinsun.com>
4388 Merge argmatch cleanups from Bison. Assume C89.
4390 * argmatch.c: Include config.h here, not in argmatch.h.
4391 Include stdlib.h, for EXIT_FAILURE.
4392 Always include <string.h>, since we assume C89.
4393 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4394 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4395 Include <stddef.h> instead, since it's all we need for size_t.
4396 (PARAMS): Remove. All uses removed.
4397 (ARRAY_CARDINALITY): Do not bother to #undef.
4398 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4399 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4400 Remove unnecessary parentheses.
4401 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4402 Insert necessary parentheses.
4403 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4404 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4406 2002-11-19 Jim Meyering <jim@meyering.net>
4408 Be careful not to clobber errno.
4409 * quotearg.c (quotearg_buffer_restyled): If mbrtowc returns
4410 `(size_t) -1' (at which point it would also set errno to EILSEQ),
4411 then restore errno to its previous value.
4412 Reported by Phillip Jones via Tim Waugh as
4413 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76334.
4415 Avoid a link-time failure on some Linux systems.
4416 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4417 (__mon_yday): Declare with the STATIC attribute.
4418 (__mktime_internal): Likewise.
4419 Based on a report from Greg Schafer.
4421 2002-11-14 Jim Meyering <jim@meyering.net>
4423 * long-options.c: Don't include libintl.h, and don't define `_' --
4427 2002-11-10 Jim Meyering <jim@meyering.net>
4429 * raise.c: New file.
4431 2002-11-08 Paul Eggert <eggert@twinsun.com>
4433 * human.c (human_readable): Revamp to avoid warning about unused
4434 variable 'amt'. Unfortunately this means using some gotos.
4436 2002-11-08 Jim Meyering <jim@meyering.net>
4438 * human.c (human_readable): Avoid warnings from gcc -Wshadow.
4440 2002-11-06 Jim Meyering <jim@meyering.net>
4442 * Makefile.am (EXTRA_DIST): Add inttostr.h.
4444 2002-10-07 Paul Eggert <eggert@twinsun.com>
4446 * Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4448 (EXTRA_DIST): Add inttostr.c.
4449 * inttostr.c, inttostr.h, imaxtostr.c, offtostr.c, umaxtostr.c:
4450 New files, taken from GNU tar.
4452 * human.c, human.h: Rewrite to support locale-specific
4453 notations like thousands separators.
4454 Specify what includer of include.h must include beforehand.
4455 (human_group_digits, human_suppress_point_zero, human_autoscale,
4456 human_base_1024, human_SI, human_B): New enum values.
4457 (human_readable): Rename from human_readable_inexact; put the
4458 options before the sizes. All uses changed. The old human_readable
4459 function has been removed; use inttostr.h instead.
4460 (human_options): Renamed from human_block_size, with new signature
4461 that allows block sizes up to UINTMAX_MAX. All callers changed.
4463 2002-10-13 Jim Meyering <jim@meyering.net>
4465 * xnanosleep.c (initialized): Remove declaration now that it's unused.
4467 2002-10-12 Paul Eggert <eggert@twinsun.com>
4469 * xnanosleep.c: There's no need to futz with the rounding mode,
4470 since the code should work properly even in the default rounding mode.
4471 (<fenv.h>): Do not include.
4472 (#pragma STDC FENV_ACCESS ON): Remove.
4473 (xnanosleep): Don't futz with rounding state.
4475 2002-10-06 Jim Meyering <jim@meyering.net>
4477 * safe-read.c (safe_read): Change type of function
4478 from ssize_t to size_t.
4479 * safe-read.h: Update prototype.
4480 (SAFE_READ_ERROR): Define.
4482 2002-09-28 Jim Meyering <jim@meyering.net>
4484 * makepath.c (make_path): Restore umask *before* creating the final
4487 2002-09-25 Paul Eggert <eggert@twinsun.com>
4489 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4490 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4491 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4492 int. Work more efficiently if X is the same width as uintmax_t.
4493 Do not compare X to -1, to avoid bogus compiler warning.
4494 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4495 Don't assume that f_frsize and f_bsize are the same type.
4497 2002-09-25 Jim Meyering <jim@meyering.net>
4499 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4501 * safe-read.c (safe_read): Make comment more precise:
4502 upon error, it returns -1.
4504 2002-09-22 Jim Meyering <jim@meyering.net>
4506 * makepath.c (make_path): Minor reformatting.
4508 2002-09-14 Paul Eggert <eggert@twinsun.com>
4510 * xnanosleep (xnanosleep): Return -1 on failure, not 1,
4511 for consistency with nanosleep. Check errno after nanosleep
4514 2002-09-11 Jim Meyering <jim@meyering.net>
4516 * xnanosleep.c, xnanosleep.h: New files, factored out of sleep.c.
4517 * Makefile.am (libfetish_a_SOURCES): Add them.
4519 2002-09-04 Jim Meyering <jim@meyering.net>
4521 * addext.c (addext): Add a cast to avoid gcc's warning about
4522 `comparison between signed and unsigned'.
4524 * sig2str.c (str2signum, sig2str): Declare loop index variables to be
4525 of type size_t so that they match type of upper bound, thus avoiding
4526 warning about `comparison between signed and unsigned'.
4528 2002-08-31 Jim Meyering <jim@meyering.net>
4530 * mktime.c: Update from GNU libc.
4531 * obstack.c: Likewise.
4532 * getopt.c: Likewise.
4533 * getopt1.c: Likewise.
4535 2002-08-05 Paul Eggert <eggert@twinsun.com>
4537 Fix some minor time-related bugs with POSIX time arguments.
4538 Some valid time stamps were being rejected (notably -1, and
4539 time stamps before 1900 on 64-bit hosts). And some invalid
4540 time stamps were being accepted, e.g. September 31.
4542 * posixtm.h (posixtime): Return bool instead of time_t, so
4543 that we can return (time_t) -1 successfully.
4544 * posixtm.c: Likewise.
4545 [HAVE_STDBOOL_H]: Include <stdbool.h>.
4546 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
4547 (t): Remove static var.
4548 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
4549 of static var. All uses changed.
4550 (year): Do not reject years before 1900; they can occur with
4552 (posix_time_parse): Do not check for out-of-range components;
4553 that is now the caller's responsibility, since our checks were
4554 only approximations.
4555 (posixtime): Use mktime to check for out-of-range components,
4556 since it knows them exactly.
4557 If mktime returns (time_t) -1, check whether an error actually occurred
4558 by invoking localtime on -1.
4559 (main) [TEST_POSIXTIME]: Check for input data errors, and report
4560 posixtime failures better.
4561 Improve the test data (in comments only).
4563 2002-07-27 Jim Meyering <jim@meyering.net>
4565 * readutmp.h: If we have both utmpx.h and utmp.h, and there exists
4566 the utmp.ut_exit member, but not the utmpx.ut_exit member, then
4567 undefine HAVE_UTMPX_H. For AIX 4.3.3. Doing all this in cpp is
4568 a big kludge; someday we'll put the brains in an autoconf macro.
4569 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4571 2002-07-20 Jim Meyering <jim@meyering.net>
4573 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4574 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4576 * gettext.h: Upgrade to gettext-0.11.3.
4578 2002-07-13 Bruno Haible <bruno@clisp.org>
4580 * xstat.in: Include <string.h>.
4581 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4584 2002-07-09 Jim Meyering <jim@meyering.net>
4586 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4587 ones. At least on GNU/Linux systems, `auto' means something else.
4590 2002-07-01 Jim Meyering <jim@meyering.net>
4592 * c-stack.c: Include sys/time.h.
4593 From Volker Borchert.
4595 2002-06-11 Paul Eggert <eggert@twinsun.com>
4597 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4598 New macro. Use it uniformly instead of
4599 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4600 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4601 reported by Vin Shelton.
4603 2002-06-22 Jim Meyering <jim@meyering.net>
4605 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4606 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4608 2002-06-22 Paul Eggert <eggert@twinsun.com>
4610 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4611 Do not assume SA_SIGINFO behavior.
4612 Bug reported by Jim Meyering on NetBSD 1.5.2.
4614 2002-06-22 Jim Meyering <jim@meyering.net>
4616 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4618 * exitfail.c, exitfail.h: Likewise.
4619 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4621 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4623 (EXTRA_DIST): Add fnmatch_loop.c.
4624 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4626 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4627 * fnmatch.c: Update from diffutils-2.8.2.
4628 * fnmatch_.h: New file. From diffutils-2.8.2.
4629 * fnmatch.h: Remove file.
4631 2002-06-18 Paul Eggert <eggert@twinsun.com>
4633 * file-type.h: Report an error if neither S_ISREG nor
4634 S_IFREG is defined, instead of using a test specific to glibc
4635 2.2. This should be safe, since POSIX requires S_ISREG and
4636 Unix Version 7 had S_IFREG. We don't need to check for
4637 <sys/types.h> since we don't use any symbols that it defines.
4639 2002-06-15 Jim Meyering <jim@meyering.net>
4641 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4642 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4643 have been included before this file.
4645 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4647 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4648 so that each temporary file name is unique and valid in the first
4649 8 characters, for operation under DOS.
4651 2002-06-15 Jim Meyering <jim@meyering.net>
4653 Work even with DJGPP 2.03, which lacks support for symlinks.
4655 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4657 * lchown.c (S_ISLNK): Likewise.
4659 2002-06-14 Jim Meyering <jim@meyering.net>
4661 * file-type.h: Use the version from diffutils-2.8.2.
4662 * file-type.c: Likewise.
4664 2002-05-27 Jim Meyering <jim@meyering.net>
4666 Fix a problem seen only on nonconforming systems whereby ls.c's
4667 use of localtime, and then of gettimeofday would cause trouble:
4668 the localtime call used to initialize rpl_gettimeofday's save
4669 mechanism would clobber ls's current local time information so
4670 that in any long listing the first file would always be listed
4671 with date 1970-01-01. Analysis by Volker Borchert.
4673 * gettimeofday.c (localtime): Undefine.
4674 (rpl_localtime): New function.
4676 2002-05-22 Jim Meyering <jim@meyering.net>
4678 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4679 * file-type.h: New file.
4680 * file-type.c (file_type): New file/function. Extracted from diffutils.
4682 2002-04-29 Paul Eggert <eggert@twinsun.com>
4684 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4686 2002-04-28 Paul Eggert <eggert@twinsun.com>
4688 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4689 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4690 of 127, since 64 is the largest conceivable number for ancient
4692 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4694 2002-04-28 Jim Meyering <jim@meyering.net>
4696 * sig2str.c (WTERMSIG): Remove definition (unused).
4698 2002-04-28 Paul Eggert <eggert@twinsun.com>
4700 * sig2str.h, sig2str.c: New files.
4701 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4703 2002-04-24 Jim Meyering <jim@meyering.net>
4705 * gettext.h: New file, from Gettext.
4706 * Makefile.am (INCLUDES): Remove -I../intl.
4707 (libfetish_a_SOURCES): Add gettext.h.
4709 2002-04-16 Jim Meyering <jim@meyering.net>
4711 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4712 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4713 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4715 2002-04-12 Jim Meyering <jim@meyering.net>
4717 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4719 2002-03-10 Jim Meyering <jim@meyering.net>
4721 * makepath.c (make_path): Remove a comma from a diagnostic.
4722 Suggestion from Santiago Vila.
4724 2002-03-08 Jim Meyering <jim@meyering.net>
4726 * rename.c: Mention that this wrapper is needed also on
4727 mips-dec-ultrix4.4 systems.
4729 2002-03-02 Jim Meyering <jim@meyering.net>
4731 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4732 not HAVE_CLOCK_SETTIME.
4734 2002-02-27 Paul Eggert <eggert@twinsun.com>
4736 * nanosleep.h: Rename to....
4737 * timespec.h: New name for nanosleep.h. All uses changed.
4739 * gettime.c: New file.
4740 * settime.c: New file.
4743 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4744 timespec.h. Remove nanosleep.h.
4746 2002-02-25 Paul Eggert <eggert@twinsun.com>
4748 * acl.c, acl.h: New files.
4749 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4751 2002-02-24 Jim Meyering <jim@meyering.net>
4753 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4754 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4755 cause trouble. Reported by Nelson Beebe.
4757 2002-02-23 Paul Eggert <eggert@twinsun.com>
4759 * path-concat.c (xpath_concat): Reorder code to pacify
4760 compilers that don't know that xalloc_die never returns.
4762 2002-02-20 Jim Meyering <jim@meyering.net>
4764 * getdate.c: Regenerate using bison-1.33.
4766 2002-02-15 Paul Eggert <eggert@twinsun.com>
4768 * posixver.c, posixver.h: New files.
4769 * Makefile.am (libfetish_a_SOURCES): Add them.
4771 2002-02-02 Paul Eggert <eggert@twinsun.com>
4772 Bruno Haible <bruno@clisp.org>
4774 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4775 (fwrite_success_callback): New declaration.
4776 * unicodeio.c (unicode_to_mb): New function, extracted from
4777 print_unicode_char. Call failure callback instead of error.
4778 (fwrite_success_callback): New function.
4779 (exit_failure_callback): New function.
4780 (fallback_failure_callback): New function.
4781 (print_unicode_char): Call unicode_to_mb.
4783 2002-01-26 Jim Meyering <jim@meyering.net>
4785 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4787 2002-01-22 Jim Meyering <jim@meyering.net>
4789 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4790 Otherwise, some versions of automake would omit the rule that makes
4791 Makefile from Makefile.in.
4793 2001-01-21 Paul Eggert <eggert@twinsun.com>
4795 * xmemcoll.h, xmemcoll.c: New files.
4796 * Makefile.am (libfetish_a_SOURCES): Add them.
4797 * memcoll.c: Include errno.h, and declare errno if not defined.
4798 (memcoll): Set errno to zero if there is no error.
4800 * quotearg.c (quotearg_buffer_restyled):
4801 Fix bug with quoting buffers containing NUL when backslashing escapes.
4802 This bug was exposed by the other changes in this patch.
4803 (quotearg_n_options): New arg ARGSIZE.
4804 All callers changed.
4805 (quoting_options_from_style): New function.
4806 (quotearg_n_style): Use it.
4807 (quotearg_n_style_mem): New function.
4809 * quotearg.h (quotearg_n_style_mem): New function.
4811 2002-01-16 Jim Meyering <jim@meyering.net>
4813 * getdate.y: Add three semicolons, each just before a closing brace.
4814 Bison (as of version 1.31) no longer papers over that mistake.
4816 2002-02-14 Paul Eggert <eggert@twinsun.com>
4818 * backupfile.c (ISDIGIT): Comment fix.
4819 * getdate.y (ISDIGIT): Likewise.
4820 * posixtm.c (ISDIGIT, year): Likewise.
4821 * strverscmp.c (ISDIGIT): Likewise.
4822 * userspec.c (ISDIGIT): Likewise.
4824 2002-01-05 Jim Meyering <jim@meyering.net>
4826 * version-etc.c (version_etc_copyright): Update copyright year.
4828 2001-01-19 Paul Eggert <eggert@twinsun.com>
4830 * closeout.c (close_stdout_status): If ferror (stdout), do
4831 not silently exit merely because the output buffer happens to
4832 have nothing pending.
4834 2001-12-18 Paul Eggert <eggert@twinsun.com>
4836 See the big note in ../ChangeLog.
4837 * human.c (suffixes): Prefer K to k for 1024.
4838 (generate_suffix_backwards): New function.
4839 (human_readable_inexact): Use it.
4840 * xstrtol.c (__xstrtol): If there is no number but there
4841 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
4842 Accept 'K' as well as 'k'.
4844 2001-12-15 Jim Meyering <jim@meyering.net>
4846 * regex.h (__restrict_arr): Update from libc.
4848 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
4849 as `remote' if the name starts with `//'. Suggested by Michael Stone.
4852 2001-12-10 Jim Meyering <jim@meyering.net>
4854 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
4855 Instead, include "xalloc.h".
4856 (initbuffer): Don't cast xmalloc return value to char*.
4857 (readline): Reword comment.
4858 Don't cast xrealloc return value to char*
4861 2001-12-09 Jim Meyering <jim@meyering.net>
4863 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
4864 `signed and unsigned type in conditional expression'.
4865 * posixtm.c (posix_time_parse): Likewise.
4867 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
4869 * readtokens.c (readtoken): Declare an index to be of type unsigned
4870 to avoid a pedantic warning.
4872 * getstr.c: Don't include assert.h.
4873 (getstr): Remove warning-evoking assertions.
4874 Return -1 if offset parameter is out of bounds.
4875 Change the type of a local from int to size_t.
4877 * strftime.c (my_strftime_localtime_r): Include this function
4878 definition in the `#if ! HAVE_TM_GMTOFF' block.
4880 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
4881 Include xalloc.h instead.
4883 2001-12-02 Jim Meyering <jim@meyering.net>
4885 * tempname.c: Don't declare getenv, thus reverting the change of
4886 2001-11-18. It's no longer necessary, now that stdlib.h is always
4889 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
4890 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
4892 2001-11-30 Akim Demaille <akim@epita.fr>
4894 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
4895 before being defined.
4897 2001-11-27 Paul Eggert <eggert@twinsun.com>
4899 * quotearg.h (quotearg_n, quotearg_n_style):
4900 First arg is int, not unsigned.
4901 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4902 (SIZE_MAX, UINT_MAX): New macros.
4903 (quotearg_n_options): Abort if N is negative.
4904 Avoid overflow check on hosts where size_t is 64 bits and int
4905 is 32 bits, as overflow is impossible there.
4906 Fix off-by-one typo that caused unnecessary reallocation.
4908 2001-11-27 Jim Meyering <jim@meyering.net>
4910 * tempname.c: Merge with version from libc.
4911 * regex.c: Likewise.
4913 * tempname.c: Include stdlib.h unconditionally. On some old systems
4914 for which STDC_HEADERS is 0, it was not included, resulting in a
4915 warning about an integer-to-pointer conversion problem with getenv.
4916 Reported by Volker Borchert.
4918 2001-11-26 Jim Meyering <jim@meyering.net>
4920 * gtod.h: Remove file.
4921 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
4922 * gettimeofday.c: Don't include gtod.h.
4923 (GTOD_init): Remove function.
4924 (rpl_gettimeofday): Do its job here instead, rather than aborting.
4925 Suggestion from Volker Borchert.
4927 2001-11-23 Jim Meyering <jim@meyering.net>
4929 * hash.h (struct hash_table): Don't define here. Merely declare it.
4930 * hash.c (struct hash_table): Define it here instead.
4932 2001-11-22 Jim Meyering <jim@meyering.net>
4934 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
4936 2001-11-18 Paul Eggert <eggert@twinsun.com>
4938 * tempname.c (TMP_MAX): Remove; no longer needed.
4939 (TEMPORARIES): New macro.
4940 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
4941 removes an artificial limitation (e.g. HP-UX 10.20, where
4944 2001-11-18 Jim Meyering <jim@meyering.net>
4946 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
4949 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
4950 files will be created before anything else.
4952 2001-11-17 Jim Meyering <jim@meyering.net>
4954 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
4955 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
4956 rather than group writable. Patch by Juan F. Codagnone.
4958 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
4959 Instead, include "xalloc.h".
4961 * mountlist.c: Include unlocked-io.h after all system headers.
4962 Remove explicit declarations of xmalloc, xrealloc,
4963 and xstrdup. Instead, include "xalloc.h".
4965 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
4966 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
4967 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
4969 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
4970 Reported by Padraig Brady.
4972 * mkstemp.c: #undef mkstemp.
4974 (rpl_mkstemp): Rename from mkstemp.
4977 2001-11-16 Jim Meyering <jim@meyering.net>
4979 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
4980 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
4981 determine the amount of total physical memory, use pstat_getstatic.
4982 HPUX-11 doesn't define _SC_PHYS_PAGES.
4983 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
4984 If sysconf couldn't be used to determine the amount of available
4985 physical memory, use both pstat_getstatic and pstat_getdynamic.
4986 Based on a patch from Bob Proulx.
4988 2001-11-05 Jim Meyering <jim@meyering.net>
4990 * xstat.in (slash_aware_lstat): Correct a misleading comment.
4992 2001-11-03 Jim Meyering <jim@meyering.net>
4994 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
4995 in argmatch_to_argument call.
4997 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5000 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5001 e.g., a fault due to an attempt to free a NULL pointer.
5003 2001-11-01 Jim Meyering <jim@meyering.net>
5005 * dirfd.c, dirfd.h: New files.
5006 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5008 * hash.c (hash_print) [TESTING]: Clean up.
5010 2001-10-22 Paul Eggert <eggert@twinsun.com>
5012 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5013 to avoid a warning if -Wall.
5015 2001-10-21 Paul Eggert <eggert@twinsun.com>
5017 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5019 2001-10-21 Jim Meyering <jim@meyering.net>
5021 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5022 this code would end up calling gettext even in packages built
5024 * getopt.c (_): Likewise.
5025 * regex.c (_): Likewise.
5027 2001-10-20 Paul Eggert <eggert@twinsun.com>
5029 * error.c (strerror_r): Do not declare unless !_LIBC.
5030 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5031 Use strerror_r that is only a macro, even if it is not a function.
5032 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5033 (private_strerror): Use prototypes, not old-style function definition.
5034 (print_errno_message): New function.
5035 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5037 (error_tail, error, error_at_line): Use it.
5039 2001-10-11 Jim Meyering <jim@meyering.net>
5041 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5042 and quote_n (1, ... to avoid clobbering a buffer.
5044 2001-10-05 Jim Meyering <jim@meyering.net>
5046 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5047 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5048 * hash-pjw.h: New file.
5050 2001-09-30 Jim Meyering <jim@meyering.net>
5052 * mountlist.c [MOUNTED_GETFSSTAT]:
5053 Include <sys/ucred.h>, for Apple Darwin.
5054 Include sys/mount.h and sys/fs_types.h only if available.
5056 (read_filesystem_list): Use FS_TYPE.
5058 2001-09-29 Paul Eggert <eggert@twinsun.com>
5060 * exclude.c (excluded_filename): 0 -> false, since it's
5063 2001-09-28 Paul Eggert <eggert@twinsun.com>
5065 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5066 #defines strtoimax. Also treat the other strto* functions
5069 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5070 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5071 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5073 2001-09-26 Jim Meyering <jim@meyering.net>
5075 Most macros in unlocked-io.h had the wrong number of arguments.
5076 * gen-uio: New script.
5077 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5078 * unlocked-io.hin: Remove file.
5079 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5080 rather than trying to embed it here.
5081 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5082 Reported by Padraig Brady.
5084 2001-09-25 Volker Borchert <bt@teknon.de>
5086 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5088 2001-09-23 Jim Meyering <jim@meyering.net>
5090 * mountlist.c: Remove useless parentheses in #if directives.
5091 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5092 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5094 2001-09-22 Jim Meyering <jim@meyering.net>
5096 * localcharset.c: Update from latest gettext.
5097 * config.charset: Likewise.
5099 2001-09-20 Jim Meyering <jim@meyering.net>
5101 * xstrtol.c (strtoimax): Guard declaration with
5102 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5103 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5104 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5105 (strtoumax): Likewise, for completeness (it wasn't necessary).
5107 2001-09-06 Paul Eggert <eggert@twinsun.com>
5109 * strtoimax.c (HAVE_LONG_LONG):
5110 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5111 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5112 to work around bug in IBM C compiler.
5114 2001-09-16 Jim Meyering <jim@meyering.net>
5116 * mkdir.c: New file.
5118 2001-09-04 Paul Eggert <eggert@twinsun.com>
5120 * xgetcwd.c: Revert some of the previous change; intead,
5121 fix the HAVE_GETCWD_NULL code to behave more like the
5122 !HAVE_GETCWD_NULL code used to.
5125 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5128 2001-09-04 Paul Eggert <eggert@twinsun.com>
5130 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5131 Use ssize_t, not int, to store result of readlink.
5132 Check for ssize_t overflow as well as size_t overflow,
5133 as POSIX says the result of readlink is implementation-defined
5134 when ssize_t overflows.
5135 Remove unnecessary cast to char*.
5136 Use free+malloc instead of realloc, as the storage doesn't need
5137 to be preserved and it's clearer and can be more efficient that way.
5138 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5139 * xreadlink.h (xreadlink): Update prototype.
5141 2001-09-03 Paul Eggert <eggert@twinsun.com>
5143 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5144 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5145 spotted by Jim Meyering.
5147 2001-09-03 Jim Meyering <jim@meyering.net>
5149 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5151 2001-09-03 Paul Eggert <eggert@twinsun.com>
5153 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5154 like the HAVE_GETCWD_NULL code.
5155 Include pathmax.h if not HAVE_GETCWD.
5156 Do not include xalloc.h.
5157 (INITIAL_BUFFER_SIZE): New symbol.
5158 Do not use xmalloc / xrealloc, since the caller is responsible for
5159 handling errors. Preserve errno around `free' during failure.
5160 Do not overrun buffer when using getwd.
5162 2001-09-03 Paul Eggert <eggert@twinsun.com>
5164 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5165 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5167 2001-09-02 Jim Meyering <jim@meyering.net>
5169 * error.c: Update from GNU libc.
5171 2001-09-01 Jim Meyering <jim@meyering.net>
5173 * xreadlink.c: New file.
5174 * xreadlink.h: New file.
5175 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5177 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5178 doesn't conflict with sparc Solaris 7's definition in
5179 /usr/include/sys/int_types.h.
5181 * exclude.c: Use `""', not `<>' to #include non-system header files.
5182 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5183 and strncasecmp as r-values. Unixware didn't have declarations.
5185 2001-08-31 Jim Meyering <jim@meyering.net>
5187 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5188 Use an initial, malloc'd, buffer of length 128 rather than
5189 a statically allocated one of length 1024.
5191 2001-08-30 Paul Eggert <eggert@twinsun.com>
5193 * xgetcwd.c: Don't include pathmax.h.
5194 Include stdlib.h and unistd.h if available.
5196 (xmalloc, xstrdup, free): Remove decls.
5197 (xgetcwd): Don't assume sizes fit in unsigned.
5198 Check for overflow when computing sizes.
5199 Simplify reallocation code.
5201 2001-08-28 Paul Eggert <eggert@twinsun.com>
5203 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5205 * strtoimax.c: Renamed from strtoxmax.c, removing the
5208 Also, make the following further changes to make this file's
5209 configuration more similar to that of strtol.c:
5210 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5211 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5212 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5213 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5214 changed to signed values.
5216 And make the following changes as well:
5217 Fix copyright notice, as 1999 was missing.
5218 (verify): New macro.
5219 (strtoimax): Check sizes at compile-time, not run-time.
5220 Prefer strtol to strtoll if both work.
5221 (main): Remove; it was not that useful and was a pain to maintain.
5223 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5225 2001-08-30 Paul Eggert <eggert@twinsun.com>
5227 * savedir.c (savedir): Remove size parameter, as POSIX says that
5228 a directory's st_size can have an arbitrary value, so the old
5229 usage could waste an arbitrary amount of memory. All uses
5231 * savedir.h: Update prototype.
5233 2001-08-30 Paul Eggert <eggert@twinsun.com>
5235 * xstrtol.c (strtoimax): New decl.
5237 2001-08-28 Paul Eggert <eggert@twinsun.com>
5239 * xstrtol.h: Add copyright notice.
5240 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5241 LONGINT_INVALID_SUFFIX_CHAR.
5243 2001-08-30 Paul Eggert <eggert@twinsun.com>
5245 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5248 2001-08-30 Paul Eggert <eggert@twinsun.com>
5250 * hash.c: Remove '2001' from copyright notice.
5252 2001-08-30 Paul Eggert <eggert@twinsun.com>
5254 * full-write.h: New file.
5255 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5256 * full-write.c: Correct credits, as cccp.c no longer
5257 exists and anyway it was so heavily changed from the old cccp
5258 code as to be unrecognizable. Include full-write.h.
5259 (full_write) Return size_t, with short writes meaning failure.
5260 All callers changed. This fixes a bug with large buffers
5262 * utime.c: Include full-write.h.
5264 2001-08-30 Paul Eggert <eggert@twinsun.com>
5266 Merge 'exclude' changes from tar 1.13.22.
5267 This fixes one or two unlikely storage allocation overflow bugs,
5268 but doesn't change user-visible behavior otherwise.
5270 2001-08-30 Paul Eggert <eggert@twinsun.com>
5272 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5273 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5274 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5275 Include if available.
5276 (<xalloc.h>): Include
5277 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5278 (verify): New macro. Use it to verify that EXCLUDE macros do not
5279 collide with FNM macros.
5280 (struct patopts): New struct.
5281 (struct exclude): Use it, as exclude patterns now come with options.
5282 (new_exclude): Support above changes.
5283 (new_exclude, add_exclude_file):
5284 Initial size must now be a power of two to simplify overflow checking.
5285 (free_exclude, fnmatch_no_wildcards): New function.
5286 (excluded_filename): No longer requires options arg, as the options
5287 are determined by add_exclude. Now returns bool, not int.
5288 (excluded_filename, add_exclude):
5289 Add support for the fancy new exclusion options.
5290 (add_exclude, add_exclude_file): Now takes int options arg.
5291 Check for arithmetic overflow when computing sizes.
5292 (add_exclude_file): xrealloc might modify errno, so don't
5293 realloc until after errno might be used.
5295 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5297 (free_exclude): New decl.
5298 (add_exclude, add_exclude_file): Now takes int options arg.
5299 (excluded_filename): No longer requires options arg, as the options
5300 are determined by add_exclude. Now returns bool, not int.
5302 2001-08-30 Paul Eggert <eggert@twinsun.com>
5304 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5306 2001-08-27 Jim Meyering <jim@meyering.net>
5308 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5310 * version-etc.c (N_): Remove definition.
5311 Revert most of last change.
5312 Instead, simply don't mark the `Copyright...' string for translation.
5313 Based on advice from Paul Eggert.
5315 * strtoxmax.c: Tweak comment.
5317 2001-08-26 Jim Meyering <jim@meyering.net>
5319 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5320 of copyright with `%s' so translators don't get an untranslated
5322 (COPYRIGHT_YEAR): Define.
5323 (version_etc): Use fprintf rather than fputs.
5324 Suggestion from Ulrich Drepper.
5326 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5328 * strtoll.c: New file, from GNU libc.
5329 * xstrtoimax.c: New file.
5331 * xstrtol.h: Add xstrtoimax.
5332 * strtoumax.c: New file. Simply include "strtoumax.c".
5333 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5335 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5336 * strtoxmax.c: ... then renamed to this.
5338 2001-08-13 Paul Eggert <eggert@twinsun.com>
5340 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5341 Port to Solaris 8, where 'sed' requires a space after the 'r'
5342 command, and where sh dislikes "$/". Clean up the spacing a bit.
5343 Redirect output to $tmp just once.
5345 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5347 * addext.c (<errno.h>): Include.
5348 (errno): Declare if not defined.
5349 (addext): Work correctly when pathconf returns -1 and leaves
5350 errno alone because there is no limit. Also, work even if
5351 pathconf returns a value greater than SIZE_MAX.
5353 2001-08-12 Jim Meyering <jim@meyering.net>
5355 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5356 Simply `return getcwd (NULL, 0);'.
5357 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5358 Use 1300 as initial value for length, not PATH_MAX.
5360 * pathmax.h: Clean up cpp syntax.
5362 2001-08-12 Jim Meyering <jim@meyering.net>
5364 * gettimeofday.c: New file.
5366 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5368 2001-08-04 Jim Meyering <jim@meyering.net>
5370 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5371 to get in sync with glibc.
5373 2001-08-03 Paul Eggert <eggert@twinsun.com>
5375 The following changes are from gettext 0.10.39 as maintained by
5378 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5379 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5380 with inverted sense. All uses changed.
5382 * mbswidth.c: Don't include <limits.h>.
5383 Include <stdlib.h> and <string.h> unconditionally.
5384 (iswcntrl, mbsinit, ISCNTRL): New macros.
5385 (mbsnwidth): Use K&R style function declarations.
5386 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5387 can optimize it when MB_CUR_MAX == 1.
5388 The width of control characters is zero, not 1.
5390 2001-07-15 Jim Meyering <jim@meyering.net>
5392 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5393 (BUILT_SOURCES): Add unlocked-io.h.
5394 (io_functions): Define.
5395 (unlocked-io.h): New rule.
5396 (DISTCLEANFILES): Add unlocked-io.h.
5397 (all-local): Depend on unlocked-io.h, to ensure it is created.
5399 * unlocked-io.hin: New file
5401 * regex.c: Update from glibc.
5403 2001-07-05 Jim Meyering <jim@meyering.net>
5405 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5407 (libfetish_a_SOURCES): Put all .h files here instead.
5408 Remove a thus-exposed (better checks in automake) duplicate and
5409 two unnecessary .h files.
5411 2001-06-11 Jim Meyering <jim@meyering.net>
5413 * regex.c: Update from GNU libc.
5415 2001-05-27 Jim Meyering <jim@meyering.net>
5417 * readutmp.h (UT_TYPE): Define.
5419 2001-05-24 Jim Meyering <jim@meyering.net>
5421 * argmatch.c: Include "quote.h".
5422 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5423 quote function. Reported by Göran Uddeborg.
5425 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5427 * dirname.c (dir_name): Compute append_dot using path, not newpath
5428 which is not yet declared.
5430 2001-05-11 Paul Eggert <eggert@twinsun.com>
5432 * Makefile.am (libfetish_a_SOURCES):
5433 Add strftime.c, since we now compile it on all hosts.
5435 * strftime.c (my_strftime):
5436 Define to nstrftime if emacs, but only if my_strftime is not defined.
5437 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5438 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5439 Add one more extra argument: a nanoseconds value.
5442 (my_strftime function): Add %N format.
5443 (emacs_strftimeu): Renamed from emacs_strftime,
5444 with extra ut argument.
5446 2001-05-11 Paul Eggert <eggert@twinsun.com>
5448 dirname code cleanup. base_name now behaves more compatibly
5449 with POSIX basename when given file names that have trailing
5450 slashes, and similarly for dir_name. Add new primitives
5451 base_len and dir_len. Put the directory-name-related decls
5454 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5455 * backupfile.c (base_name): Likewise.
5456 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5457 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5458 * makepath.c (strip_trailing_slashes): Likewise.
5459 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5461 * rename.c (strip_trailing_slashes): Likewise.
5462 * same.c (base_name): Likewise.
5463 * stripslash.c (ISSLASH): Likewise.
5465 * addext.c: Include <dirname.h> after size_t is defined.
5466 * backupfile.c: Likewise.
5468 * addext.c (addext): Use base_len to trim redundant
5469 trailing slashes instead of doing it ourselves.
5470 But do not trim the last slash if it is not redundant.
5472 * backupfile.c (find_backup_file_name,
5473 max_backup_version): Use base_len instead of rolling it ourselves.
5474 Handle the case of "" and (on DOS) "C:" correctly.
5476 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5477 Include <string.h>, <dirname.h>.
5478 (base_name): Allow file names ending in slashes, other than names
5479 that are all slashes. In this case, return the basename followed
5480 by the slashes. This is more general, and can be used in places
5481 where the original base_name purposely had an assertion failure.
5482 (base_len): New function.
5484 * dirname.c: Include <string.h> instead of <stdlib.h>.
5485 Do not include <assert.h>; no longer needed.
5487 (memrchr): Remove decl.
5488 (dir_name_r): Remove.
5489 (dir_len): Renamed from dirlen. All callers changed.
5490 Rewrite in terms of base_name, for simplicity and consistency.
5491 (dir_name): Never return NULL. All callers changed.
5492 Do not include <stdlib.h> in test program; no longer needed.
5493 return 0; is fine for test program.
5495 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5497 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5499 * path-concat.c (path_concat): Use base_len to compute
5500 base length, not strlen; this means we cannot rely on memcpy
5503 * same.c (STREQ): Remove.
5504 (same_name): Handle the case where the basename ends in trailing '/'.
5506 * stripslash.c (strip_trailing_slashes): Return nonzero if
5507 a slash was stripped. Do not strip the last slash after a
5510 2001-04-08 Jim Meyering <jim@meyering.net>
5512 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5513 recomputed; that's necessary when the offset spans a DST transition.
5514 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5516 2001-04-02 Jim Meyering <jim@meyering.net>
5518 * regex.h, regex.c: Update from GNU libc.
5520 2001-03-19 Paul Eggert <eggert@twinsun.com>
5522 * version-etc.c (version_etc_copyright): Update to 2001.
5524 2001-03-16 Paul Eggert <eggert@twinsun.com>
5526 * tempname.c (uint64_t): Define to uintmax_t if
5527 not defined, and if UINT64_MAX is not defined.
5528 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5529 Reported by John David Anglin.
5531 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5533 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5534 alias if codeset is empty.
5535 * config.charset (BeOS): Use wildcard syntax.
5537 2001-03-13 Jim Meyering <jim@meyering.net>
5539 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5540 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5543 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5545 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5547 * unicodeio.c (print_unicode_char): Simplify accordingly.
5549 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5551 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5552 support for DOS/DJGPP.
5554 2001-02-28 Paul Eggert <eggert@twinsun.com>
5556 * Makefile.am (libfetish_a_SOURCES):
5557 Add dup-safer.c, fopen-safer.c.
5558 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5560 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5562 2001-02-25 Paul Eggert <eggert@twinsun.com>
5564 The mkstemp replacement is taken from glibc 2.2.2, with some
5565 portability fixes for use outside glibc, as follows:
5567 * tempname.c (struct_stat64): New macro.
5568 (direxists, __gen_tempname): Use it.
5569 This avoids a portability problem with Solaris 8.
5571 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5572 (<stddef.h>, <stdint.h>, <string.h>):
5573 Include only if STDC_HEADERS || _LIBC.
5574 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5575 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5576 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5577 (__set_errno): Define this macro if <errno.h> doesn't.
5578 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5579 Define these macros if <stdio.h> doesn't.
5580 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5581 Define these macros if <sys/stat.h>
5582 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5583 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5584 __xstat64): Define if not _LIBC.
5585 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5586 (__gen_tempname): Invoke gettimeofday only if
5587 HAVE_GETTIMEOFDAY || _LIBC;
5588 otherwise, fall back on plain "time".
5589 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5591 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5593 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5595 2001-02-17 Jim Meyering <jim@meyering.net>
5597 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5598 around included file name.
5600 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5602 * strftime.c: Update from GNU libc (the only changes were to comments).
5604 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5606 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5608 2001-02-17 Paul Eggert <eggert@twinsun.com>
5610 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5611 Remove workaround macros for hosts that have mbrtowc but not
5612 mbstate_t, as we now insist on proper declarations for both
5613 before using mbrtowc.
5615 2001-02-17 Jim Meyering <jim@meyering.net>
5617 * regex.c: Update from libc.
5619 2001-02-16 Paul Eggert <eggert@twinsun.com>
5621 * alloca.c (malloc): Undef before defining, since stdlib.h
5622 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5623 Reported by Mark Hounschell via Paul Eggert.
5625 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5627 * config.charset: Update for FreeBSD 4.2.
5629 2001-01-26 Jim Meyering <jim@meyering.net>
5631 * quotearg.c: Include stddef.h.
5632 * quote.c: Include stddef.h.
5633 Reported by Axel Kittenberger.
5635 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5636 line in double quotes so that it evokes a better diagnostic.
5637 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5638 Reported by Axel Kittenberger.
5640 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5642 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5643 to avoid a warning. Add back 'const' to inptr.
5645 2001-01-16 Jim Meyering <jim@meyering.net>
5647 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5650 2001-01-14 Jim Meyering <jim@meyering.net>
5652 * rename.c: New file. From Volker Borchert.
5653 Include stdlib.h, string.h or strings.h, and xalloc.h.
5654 Use strip_trailing_slashes rather than open-coding it.
5656 2001-01-03 Paul Eggert <eggert@twinsun.com>
5658 * strftime.c: Sync with glibc time/strftime.c 1.81.
5660 2001-01-03 Jim Meyering <jim@meyering.net>
5662 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5663 local `inptr' to avoid warning with some system declarations of iconv.
5665 2000-12-29 Paul Eggert <eggert@twinsun.com>
5667 * modechange.c: Do not assume that mode_t uses the
5668 traditional octal encoding. E.g. "chmod 1 FOO" should set
5669 the other-execute bit of FOO even if S_IXOTH != 1.
5671 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5672 WOTH, XOTH, ALLM): New macros.
5673 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5674 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5676 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5677 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5679 No need to use uintmax_t; unsigned long is long enough.
5680 Don't bother to get suffix since we don't use it.
5682 2000-12-24 Jim Meyering <jim@meyering.net>
5684 * hash.c (is_prime): Return explicit boolean values.
5685 (hash_get_first): Return NULL to appease Irix5.6's 89.
5686 Reported by Nelson Beebe.
5688 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5690 * localcharset.c (locale_charset): Add support for Win32.
5692 2000-12-18 Paul Eggert <eggert@twinsun.com>
5694 * physmem.h, physmem.c: New files.
5696 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5697 (noinst_HEADERS): Add physmem.h.
5699 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5700 't' for compatibility with Solaris 8 sort.
5702 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5704 * config.charset: Add support for BeOS.
5706 2000-12-16 Jim Meyering <jim@meyering.net>
5708 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5709 SHELLS_FILE to a file name that's useful on djgpp systems.
5711 (ADDITIONAL_DEFAULT_SHELLS): Define.
5712 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5713 Based mostly on a patch from Prashant TR.
5715 2000-12-16 Jim Meyering <jim@meyering.net>
5717 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5718 N and M) would have treated it like `chown N:N FILE'.
5720 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5722 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5724 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5725 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5726 to the list of canonical encodings. Rename EUC-CN to GB2312.
5728 2000-12-08 Andreas Schwab <schwab@suse.de>
5730 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5731 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5733 2000-12-07 Jim Meyering <jim@meyering.net>
5735 * stripslash.c (ISSLASH): Define.
5736 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5739 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5740 (dir_name_r): Declare this function as static.
5741 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5742 manifest itself on a name containing a mix of slashes and
5744 Make this function work with names starting with a DOS-style
5745 drive letter and colon prefix.
5746 (dir_name): Append `.' if necessary.
5747 Based mostly on patches from Prashant TR and Eli Zaretskii.
5749 * dirname.h (dir_name_r): Remove prototype.
5751 2000-12-05 Jim Meyering <jim@meyering.net>
5753 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5755 2000-12-04 Jim Meyering <jim@meyering.net>
5757 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5758 Also include memory.h, stdlib.h, unistd.h if appropriate.
5759 Reported by Andreas Jaeger (conflicting declaration of malloc).
5761 2000-12-02 Jim Meyering <jim@meyering.net>
5763 * closeout.h: Make idempotent, to avoid some obscure warnings.
5765 2000-12-01 Paul Eggert <eggert@twinsun.com>
5767 * memrchr.c: Include <config.h> before any system include file.
5769 2000-11-29 Paul Eggert <eggert@twinsun.com>
5771 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5773 2000-11-26 Jim Meyering <jim@meyering.net>
5775 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5777 2000-11-22 Paul Eggert <eggert@twinsun.com>
5779 * strftime.c (my_strftime): Do not invoke mbrlen with a
5780 size of (size_t) -1; it's not portable.
5782 2000-11-17 Akim Demaille <akim@epita.fr>
5784 * obstack.h: Formatting changes.
5785 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5786 prevent type checking.
5787 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5788 cast the value to (void *): assigning a `foo *' to a `void *'
5790 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5792 2000-11-17 Jim Meyering <jim@meyering.net>
5794 * strstr.c: Update from GNU libc.
5796 2000-11-16 Jim Meyering <jim@meyering.net>
5798 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5800 2000-11-11 Jim Meyering <jim@meyering.net>
5802 * error.c: Add a couple #includes, merging from GNU libc version.
5804 2000-11-10 Jim Meyering <jim@meyering.net>
5806 * obstack.h: Update from GNU libc.
5807 * obstack.c: Likewise.
5809 2000-11-06 Paul Eggert <eggert@twinsun.com>
5811 * getusershell.c (setusershell): Use rewind rather than
5812 fseek/fseeko, to avoid configuration hassles with fseeko.
5813 Don't bother opening SHELLS_FILE if shellstream is NULL;
5816 2000-11-05 Jim Meyering <jim@meyering.net>
5818 * makepath.h (make_dir): Declare.
5819 * makepath.c (make_dir): Remove `static' attribute.
5822 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5824 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5825 last one in a bucket, advance to the next bucket.
5827 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5829 * fnmatch.c: Do not comment out all the code if we are using
5830 the GNU C library, because in some cases we are replacing buggy
5831 code in the GNU C library itself.
5833 2000-10-30 Paul Eggert <eggert@twinsun.com>
5835 * error.h, getline.h, modechange.h:
5836 Remove "2000" from Copyright line, as the file hasn't been
5837 changed this year other than in the copyright notice.
5839 * xalloc.h: Add "2000" to Copyright line, as this file
5840 was changed this year.
5842 2000-10-30 Paul Eggert <eggert@twinsun.com>
5844 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
5845 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
5846 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
5848 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
5850 * regex.h (__restrict_arr): Move definition out of #ifndef block.
5851 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
5852 doesn't define __restrict_arr.
5854 2000-10-29 Jim Meyering <jim@meyering.net>
5856 * xstat.in: Fix grammar in comment.
5858 2000-10-28 Jim Meyering <jim@meyering.net>
5860 * memchr.c: Update from libc.
5861 Adjust for portability:
5862 [HAVE_STDLIB_H]: Include stdlib.h.
5863 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
5864 Undef __memchr, too.
5865 [!weak_alias]: Define __memchr to memchr.
5867 * regex.c: Update from libc.
5868 * regex.h: Likewise.
5869 * getopt1.c: Likewise.
5870 * memcmp.c: Likewise.
5872 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
5873 Avoid using fseek, when possible -- it's broken by design.
5874 Patch by Ulrich Drepper.
5876 2000-10-26 Jim Meyering <jim@meyering.net>
5878 * strftime.c: Update from libc.
5880 2000-10-25 Jim Meyering <jim@meyering.net>
5882 * obstack.c: Update from libc.
5884 2000-10-23 Jim Meyering <jim@meyering.net>
5886 * hard-locale.c (hard_locale): Revert last change -- it was simply
5887 wrong. That set_locale call must not have any side effects.
5890 2000-10-22 Jim Meyering <jim@meyering.net>
5892 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
5893 [CYCLIC]: Remove now-unused definition.
5895 * save-cwd.c (O_DIRECTORY): Define, if needed.
5896 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
5897 Suggestion from Ulrich Drepper.
5899 2000-10-21 Jim Meyering <jim@meyering.net>
5901 * dirname.c (dir_name_r): New function, factored out of dir_name.
5902 (dir_name): Use dir_name_r.
5903 * dirname.h (dir_name_r): Declare it.
5905 2000-10-21 Jim Meyering <jim@meyering.net>
5907 * dirname.c (memrchr): Declare if necessary.
5908 (dir_name): Remove the restriction that there be no
5909 trailing slashes. Now, this code skips past them, effectively
5911 [TEST_DIRNAME] (main): New unit tests.
5913 * memrchr.c: New file from GNU libc.
5914 Undef __memrchr, too.
5915 [!weak_alias]: Define __memrchr to memrchr.
5916 Guard weak_alias use with `#ifdef weak_alias'.
5918 2000-10-17 Jim Meyering <jim@meyering.net>
5920 * quote.h (PARAMS): Define and use.
5921 Reported by Akim Demaille.
5923 * getopt.c: Update from libc.
5925 2000-10-16 Jim Meyering <jim@meyering.net>
5927 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
5930 2000-09-25 Jim Meyering <jim@meyering.net>
5932 * md5.h (rol): Define (from GnuPG).
5934 * sha.c: Give credit (GnuPG) where due.
5935 (M): Use rol rather than open-coding it.
5936 Add a FIXME comment.
5938 2000-09-21 Jim Meyering <jim@meyering.net>
5940 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
5941 Reported by Michael Stone.
5943 2000-09-20 Jim Meyering <jim@meyering.net>
5945 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
5946 (noinst_HEADERS): Add sha.h.
5947 Based on code from Scott G. Miller and from GnuPG.
5949 2000-09-15 Jim Meyering <jim@meyering.net>
5951 * regex.c: Update from libc.
5953 2000-09-10 Jim Meyering <jim@meyering.net>
5955 * getopt.c (_getopt_internal): Update from glibc.
5957 2000-09-09 Jim Meyering <jim@meyering.net>
5959 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
5960 think it should be used as a general replacement for isascii.
5961 * fnmatch.c: Likewise.
5962 * mbswidth.c: Likewise
5963 * regex.c: Likewise.
5966 * userspec.c: Include sys/param.h and limits.h.
5968 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5969 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
5970 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
5971 UID, GID. Check range.
5973 2000-09-06 Jim Meyering <jim@meyering.net>
5975 * getopt.c (_getopt_internal): Update from glibc.
5977 2000-08-30 Jim Meyering <jim@meyering.net>
5979 * strftime.c: Merge in changes from GNU libc.
5981 2000-08-26 Jim Meyering <jim@meyering.net>
5983 * closeout.c: Include "__fpending.h".
5984 (close_stdout_status): Return right away if there's nothing to flush.
5986 * Makefile.am (noinst_HEADERS): Add __fpending.h.
5987 * __fpending.c: New file.
5988 * __fpending.h: New file.
5990 2000-08-07 Paul Eggert <eggert@twinsun.com>
5992 Standardize on "memory exhausted" instead of "Memory exhausted"
5993 or "virtual memory exhausted".
5994 * obstack.c (print_and_abort): Use "memory exhausted", not
5995 "virtual memory exhausted".
5996 * same.c (same_name): Invoke xalloc_die instead of printing
5998 * userspec.c (parse_user_spec): Likewise.
5999 * bumpalloc.h: comment fix
6000 * same.c, userspec.c: Include xalloc.h.
6002 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6003 not char *const and pointing to a constant array.
6004 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6005 (xrealloc): Comment fix.
6007 * userspec.c (parse_user_spec):
6008 Don't translate a message until just before returning,
6009 to avoid unnecessary translation.
6011 2000-08-07 Jim Meyering <jim@meyering.net>
6013 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6014 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6015 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6016 getgroups.c, gethostname.c, getopt.h, group-member.c,
6017 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6018 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6019 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6020 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6021 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6022 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6023 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6024 yesno.c: Back out Copyright date changes for each file with no change
6025 this year. This eases coordination with other programs using the same
6026 source code modules. From Paul Eggert.
6028 2000-08-03 Greg McGary <greg@mcgary.org>
6030 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6031 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6032 (EXTEND_BUFFER): Use them.
6034 2000-08-01 Jim Meyering <jim@meyering.net>
6036 * dirname.c (ISSLASH): Define.
6037 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6038 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6039 both `\' and `/' may be use as path separators.
6040 Based on a patch from Prashant TR.
6042 2000-07-31 Paul Eggert <eggert@twinsun.com>
6044 * quotearg.c (quotearg_n_options): Don't make the initial
6045 slot vector a constant, since it might get modified.
6047 2000-07-31 Jim Meyering <jim@meyering.net>
6049 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6050 * obstack.c (print_and_abort): Likewise.
6052 2000-07-30 Paul Eggert <eggert@twinsun.com>
6054 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6055 buffer, so that the caller can always quote one small
6056 component of a "memory exhausted" message in slot 0.
6057 From a suggestion by Jim Meyering.
6059 2000-07-30 Jim Meyering <jim@meyering.net>
6061 * makepath.c (make_path): Quote the other instance, too.
6063 * quotearg.c (N_STATIC_SLOTVECS): Define.
6064 (STATIC_BUF_SIZE): Define.
6065 (quotearg_n_options): Use only statically allocated storage when
6066 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6067 than STATIC_BUF_SIZE.
6069 2000-07-29 Jim Meyering <jim@meyering.net>
6071 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6072 * dirname.c (dir_name): Likewise.
6074 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6076 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6077 (dir_name): Assert that there are no trailing slashes.
6079 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6081 * mbswidth.h (mbswidth): Add a flags argument.
6082 (mbswidth): New declaration.
6083 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6084 * mbswidth.c (mbswidth): Add a flags argument.
6085 (mbsnwidth): New function.
6087 2000-07-24 Jim Meyering <jim@meyering.net>
6089 * mbswidth.c: Remove useless #else. From Bruno Haible.
6091 2000-07-23 Paul Eggert <eggert@twinsun.com>
6093 * mbswidth.c (_XOPEN_SOURCE):
6094 Don't define; this causes problems on Solaris 7.
6095 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6097 2000-07-23 Paul Eggert <eggert@twinsun.com>
6100 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6101 so that mbstate_t is always defined.
6103 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6104 be 1 in at least one GCC installation, and this configuration
6105 error is likely to be common. Ignoring MB_LEN_MAX hurts
6106 performance on hosts that have mbrtowc but have only unibyte
6107 locales, but I assume these hosts are rare.
6109 2000-07-23 Paul Eggert <eggert@twinsun.com>
6111 * quotearg.c: Streamline by invoking multibyte code only if needed.
6112 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6113 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6114 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6115 invoke multibyte primitives.
6117 2000-07-23 Jim Meyering <jim@meyering.net>
6119 * basename.c (base_name): Add an assertion.
6121 2000-07-15 Bruno Haible <clisp.cons.org>
6123 * quotearg.c: When the system forces us to redefine mbstate_t,
6124 shadow its mbsinit function.
6126 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6128 * mbswidth.h: New file.
6129 * mbswidth.c: New file.
6130 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6131 (noinst_HEADERS): Add mbswidth.h.
6133 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6135 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6138 2000-07-15 Jim Meyering <jim@meyering.net>
6140 * makepath.c: Include quote.h.
6141 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6142 corresponding argument in a `quote (...)' call.
6143 Give better diagnostics.
6145 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6146 (noinst_HEADERS): Add quote.h.
6148 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6149 from tar's src/misc.c.
6150 * quote.h: New file. Prototypes for same.
6152 2000-07-10 Paul Eggert <eggert@twinsun.com>
6154 From a suggestion by Bruno Haible.
6155 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6156 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6157 to decide whether to define the BeOS workaround macro;
6158 this adjusts to the change to AC_MBSTATE_T.
6160 2000-07-13 Paul Eggert <eggert@twinsun.com>
6162 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6164 * quotearg.c (quoting_style_args, quoting_style_vals,
6165 quotearg_buffer_restyled): Add support for
6166 clocale_quoting_style. Undo previous change to
6167 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6168 and "{RIGHT QUOTATION MARK}" msgids.
6170 2000-07-05 Paul Eggert <eggert@twinsun.com>
6172 The old behavior of quoting `like this' doesn't look good with
6173 newer, ISO-style fonts. See:
6174 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6176 Instead, quote "like this" by default. Let the translator
6177 tailor the locale-specific quoting behavior by providing
6178 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6180 * quotearg.c (N_): New macro.
6181 (gettext_default): New function.
6182 (quotearg_buffer_restyled): Use
6183 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6184 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6186 2000-07-09 Jim Meyering <jim@meyering.net>
6188 * Most files: Update copyright dates to include 2000.
6190 2000-07-08 Jim Meyering <jim@meyering.net>
6192 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6194 (xgethostname): Remove now-unnecessary #ifdef.
6195 Move declaration of `err' into loop where it's used.
6197 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6199 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6200 by allocating a larger buffer. Test the gethostname return value for
6201 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6202 returns an error and ENAMETOOLONG isn't defined.
6204 2000-07-05 Paul Eggert <eggert@twinsun.com>
6205 and Bruno Haible <haible@clisp.cons.org>
6207 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6209 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6211 * quotearg.c (struct quoting_options): Simplify quote_these_too
6214 2000-07-03 Jim Meyering <jim@meyering.net>
6216 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6217 Reported by Bruno Haible.
6219 2000-07-04 Jim Meyering <jim@meyering.net>
6221 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6222 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6225 2000-07-03 Paul Eggert <eggert@twinsun.com>
6226 and Bruno Haible <haible@clisp.cons.org>
6228 * quotearg.c (mbrtowc):
6229 Assign to *pwc, and return 1 only if result is nonzero.
6230 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6232 2000-07-03 Jim Meyering <jim@meyering.net>
6234 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6235 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6238 2000-07-02 Jim Meyering <jim@meyering.net>
6240 * quotearg.c (mbstate_t): Don't define here.
6242 2000-07-02 Jim Meyering <jim@meyering.net>
6244 * nanosleep.c (SIGCONT): Define if not already defined.
6246 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6248 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6249 per change in ../m4/ls-mntd-fs.m4.
6250 (read_filesystem_list): Ignore symbolic links.
6252 2000-06-29 Jim Meyering <jim@meyering.net>
6254 * same.c: Include <string.h> or <strings.h>, as appropriate,
6255 for declaration of strcmp.
6257 * long-options.c: Include <stdlib.h>, for declaration of exit.
6259 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6260 Avoid warning by casting result to `char *' to remove `const'.
6262 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6264 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6266 2000-06-26 Paul Eggert <eggert@twinsun.com>
6268 savedir now sets errno on failure and invokes xmalloc to get memory.
6269 Fix a couple of other minor bugs while we're at it.
6271 * savedir.c (<unistd.h>): Do not include; there's no need.
6272 (NAMLEN): Remove macro.
6273 (malloc, realloc): Remove decls.
6275 ("xalloc.h"): Include.
6276 (NAME_SIZE_DEFAULT): New macro.
6277 (savedir): Use xmalloc / xrealloc to allocate memory.
6278 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6279 Skip "" directory entries.
6280 Use strlen to calculate directory entry length, since the old method
6281 is rarely used these days and isn't worth supporting.
6282 Don't use a pointer after freeing it.
6283 Check for integer overflow when calculating allocation size.
6284 Use memcpy to copy entries, instead of stpcpy.
6285 Set errno properly when returning NULL.
6286 Check for readdir error.
6288 2000-06-26 Jim Meyering <jim@meyering.net>
6290 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6292 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6294 * getusershell.c (xmalloc, xrealloc): Remove functions.
6296 Don't include <stdlib.h>. Don't declare malloc, realloc.
6298 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6300 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6302 2000-06-24 Jim Meyering <jim@meyering.net>
6304 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6306 2000-06-21 Jim Meyering <jim@meyering.net>
6308 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6310 2000-06-19 Paul Eggert <eggert@twinsun.com>
6312 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6313 (mbrtowc, mbstate_t): Define substitutes if
6314 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6315 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6316 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6318 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6320 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6321 than 1024, return a memory chunk of least possible size, instead
6322 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6323 Use free/xmalloc instead of xrealloc to avoid copying for very long
6326 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6328 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6329 address, not strdup. Include <stdlib.h> and don't declare free().
6331 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6333 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6336 2000-06-21 Jim Meyering <jim@meyering.net>
6338 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6339 (noinst_HEADERS): Add getstr.h.
6341 * getline.c (getstr): Move into a separate file.
6342 * getstr.c (getstr): New file, extracted from getline.c, with
6343 the following changes: new parameter, delim2; both delim[12]
6344 parameters have type `int', not `char'. The latter would lose
6345 with 8-bit delimiters.
6346 * getstr.h: New file.
6348 2000-06-19 Jim Meyering <jim@meyering.net>
6350 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6352 2000-06-18 Jim Meyering <jim@meyering.net>
6354 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6355 Besides, these days every porting target provides a mkdir function.
6357 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6358 (this snippet comes from src/system.h).
6360 2000-06-15 Paul Eggert <eggert@twinsun.com>
6362 * human.c (adjust_value): New function.
6363 (human_readable_inexact): Apply rounding style even when
6364 printing approximate values.
6366 2000-06-14 Paul Eggert <eggert@twinsun.com>
6368 * human.c (human_readable_inexact): Allow an input block
6369 size that is not a multiple of the output block size, and vice versa.
6370 Reported by Piergiorgio Sartor.
6372 2000-06-14 Paul Eggert <eggert@twinsun.com>
6374 * getdate.y (get_date): Apply relative times after time
6375 zone indicator, not before. Reported by Todd A. Jacobs.
6377 2000-06-13 Jim Meyering <jim@meyering.net>
6379 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6381 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6383 2000-06-12 Paul Eggert <eggert@twinsun.com>
6385 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6387 2000-06-04 Paul Eggert <eggert@twinsun.com>
6389 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6391 2000-06-04 Jim Meyering <jim@meyering.net>
6393 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6394 SunOS 4.1.4 for which gid_t is an unsigned type.
6396 2000-06-03 Jim Meyering <jim@meyering.net>
6398 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6400 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6402 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6403 newer, don't install charset.alias.
6404 * config.charset: Change the Linux/glibc rules so they become empty
6405 on glibc-2.1 or newer.
6407 2000-06-02 Jim Meyering <jim@meyering.net>
6409 * mountlist.c: Back out last change. Instead, do this...
6410 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6411 member using the same `ignore'-testing code.
6412 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6416 2000-05-29 Jim Meyering <jim@meyering.net>
6418 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6419 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6421 2000-05-22 Jim Meyering <jim@meyering.net>
6423 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6425 2000-05-18 Jim Meyering <jim@meyering.net>
6427 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6428 back, too, since it may have been modified by allocate_entry.
6429 (hash_delete): Rewrite to use neither the assignment operator
6430 nor the comma operator in an if-expression.
6432 2000-05-15 Paul Eggert <eggert@twinsun.com>
6435 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6436 Remove; no longer needed.
6437 "quotearg.h": Add include.
6438 (file_name): Do not bother to explicitly initialize to NULL; it's less
6439 efficient on some hosts.
6440 (close_stdout_status): Remove test as to whether stdout was already
6441 closed; it breaks for the case "echo x | sort >&-".
6442 Quote file name colons.
6443 Do not assume that _("write error") lacks format strings.
6445 2000-05-15 Jim Meyering <jim@meyering.net>
6447 * version-etc.c (version_etc_copyright): Update the copyright string
6448 used in all --version output.
6450 2000-05-14 Jim Meyering <jim@meyering.net>
6452 * closeout.c (close_stdout_set_file_name): New function.
6453 (close_stdout_status): Use new file-scoped global.
6454 Return right away if fstat says the stdout file descriptor is invalid.
6455 * closeout.h (close_stdout_set_file_name): Declare.
6457 2000-05-10 Jim Meyering <jim@meyering.net>
6459 * closeout.c [default_exit_status]: New file-scoped variable.
6460 (close_stdout_set_status): New function.
6461 * closeout.h (close_stdout_set_status): Declare.
6463 2000-05-08 Jim Meyering <jim@meyering.net>
6465 * long-options.c: Don't include closeout.h.
6466 (parse_long_options): Don't call close_stdout for --version.
6468 2000-05-06 Jim Meyering <jim@meyering.net>
6470 * strnlen.c: Undefine __strnlen and strnlen.
6471 [!weak_alias]: Define __strnlen to strnlen.
6473 * atexit.c: New file, from libiberty.
6475 2000-05-06 Jim Meyering <jim@meyering.net>
6477 * closeout.c (close_stdout_status): Also check for errors on the
6480 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6482 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6483 instead of xmalloc, xrealloc, path_concat.
6484 (locale_charset): Treat empty environment variables as absent.
6485 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6487 2000-05-04 Jim Meyering <jim@meyering.net>
6489 * getopt.c: Update from glibc.
6490 * obstack.c: Likewise.
6491 * obstack.h: Likewise.
6492 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6494 * regex.h: Likewise.
6495 * strndup.c: Likewise.
6496 * strnlen.c: New file, from glibc.
6498 2000-05-01 Jim Meyering <jim@meyering.net>
6500 * full-write.c (full_write): Remove `FIXME' part of comment.
6502 2000-04-29 Jim Meyering <jim@meyering.net>
6504 * path-concat.c: Declare strdup only if it's not defined.
6505 * canon-host.c: Likewise.
6507 2000-04-28 Jim Meyering <jim@meyering.net>
6509 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6510 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6511 included first, then limits.h is included by locale.h by libintl.h.
6512 From John David Anglin.
6514 2000-04-25 Jim Meyering <jim@meyering.net>
6516 * makepath.c (S_IRWXUGO): Define.
6517 (make_path): Always perform explicit chmod if MODE specifies any
6518 of the `special' permission bits. Prompted by a bug report against
6519 install from Mate Wierdl and Joost van Baal.
6521 2000-04-18 Jim Meyering <jim@meyering.net>
6525 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6526 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6528 2000-04-17 Jim Meyering <jim@meyering.net>
6530 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6531 the definition of it to rpl_strftime also defined-away the system's
6534 2000-04-15 Jim Meyering <jim@meyering.net>
6536 Use `C' to denote so-called `contiguous' files, the same way
6538 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6539 (ftypelet): Use S_ISCTG.
6540 From Michael Deutschmann.
6542 2000-04-14 Jim Meyering <jim@meyering.net>
6544 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6546 2000-04-08 Jim Meyering <jim@meyering.net>
6548 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6549 names don't conflict. Reported by Eli Zaretskii.
6551 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6553 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6554 bug. Deal with the different error behavior of Irix iconv.
6556 2000-04-07 Jim Meyering <jim@meyering.net>
6558 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6559 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6561 2000-04-05 Jim Meyering <jim@meyering.net>
6563 Portability tweaks required for ultrix4.3.
6564 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6565 * readutmp.c: Include sys/types.h before sys/stat.h.
6566 * canon-host.c: Declare strdup.
6567 * path-concat.c: Likewise.
6568 From John David Anglin.
6570 2000-04-04 Jim Meyering <jim@meyering.net>
6572 Be more DOS 8.3-friendly.
6573 * ref-add.sin: Renamed from ref-add.sed.in.
6574 * ref-del.sin: Renamed from ref-del.sed.in.
6575 * Makefile.am: Reflect renaming.
6576 Reported by Eli Zaretskii.
6578 Use a temporary file name that won't clash with `charset.alias'
6579 in the DOS 8.3 name space.
6580 * Makefile.am (charset_tmp): Define.
6581 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6582 (uninstall-local): Likewise.
6583 Reported by Eli Zaretskii.
6585 2000-03-29 Paul Eggert <eggert@twinsun.com>
6587 * time/strftime.c (my_strftime): Make sure we call the system
6588 strftime, not ourselves, when invoking the underlying strftime.
6590 2000-03-24 Jim Meyering <jim@meyering.net>
6592 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6593 (charset_alias): Define.
6594 (install-exec-local): Factor out common code.
6595 (uninstall-local): Split lines longer than 80.
6596 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6598 (.sed.in.sed): New rule. Don't redirect directly to $@.
6599 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6601 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6603 * config.charset: Output a line containing "Packages using this file".
6604 * ref-add.sed.in, ref-del.sed.in: New files.
6605 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6606 ref-del.sed): New rules.
6608 2000-03-17 Jim Meyering <jim@meyering.net>
6610 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6611 Otherwise, include <strings.h>
6613 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6615 * unicodeio.c (utf8_wctomb): New function.
6616 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6617 format instead of in UCS-4 with platform dependent endianness.
6619 2000-03-07 Paul Eggert <eggert@twinsun.com>
6621 * savedir.c (savedir): Work even if directory size is
6622 negative; this can happen with some screwy NFS configurations.
6624 2000-03-06 Jim Meyering <jim@meyering.net>
6626 * localcharset.c (get_charset_aliases): Don't try to free file_name
6627 if it's NULL (because we ran out of memory). From Bruno Haible.
6629 2000-03-05 Jim Meyering <jim@meyering.net>
6631 * localcharset.c ("path-concat.h"): Include.
6632 (get_charset_aliases): Use path_concat instead of ANSI string
6635 * unicodeio.h (PARAMS): Define.
6636 Use it to guard prototype.
6638 2000-03-04 Jim Meyering <jim@meyering.net>
6640 * Makefile.am (install-exec-local): Create $(libdir) before installing
6642 (uninstall-local): Uncomment this rule so `make distcheck' works
6645 * unicodeio.c (<errno.h>): Include it.
6646 (errno): Declare if not defined.
6648 * localcharset.c: Add Bruno's comment justifying use of volatile.
6650 * config.charset: New version, incorporating remarks from a linux
6651 i18n mailing list. From Bruno Haible.
6653 2000-03-02 Jim Meyering <jim@meyering.net>
6655 * Makefile.am (EXTRA_DIST): Add config.charset.
6657 2000-03-01 Jim Meyering <jim@meyering.net>
6659 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6660 * unicodeio.c: Likewise.
6662 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6664 * config.charset: New file.
6665 * localcharset.c: New file.
6666 * unicodeio.h, unicodeio.c: New files.
6667 * Makefile.am (DEFS): Add -DLIBDIR=...
6668 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6669 (noinst_HEADERS): Add unicodeio.h.
6670 (all-local, install-exec-local, charset.alias): New targets.
6672 2000-02-28 Paul Eggert <eggert@twinsun.com>
6674 * quotearg.c (ALERT_CHAR): New macro.
6675 (quotearg_buffer_restyled): Use it.
6677 2000-02-27 Jim Meyering <jim@meyering.net>
6679 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6680 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6682 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6683 not `#if STDC_HEADERS'.
6684 Declare malloc if needed.
6686 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6687 now that autoconf always defines the HAVE_DECL_ symbols.
6688 * human.c: Likewise.
6690 * strtoumax.c: Likewise.
6692 * backupfile.c: Arrange for cpp to fail if the configure-time
6693 declaration check was not run.
6695 * human.c: Likewise.
6697 * strtoumax.c: Likewise.
6699 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6700 then first look up the entire `.'-containing string as a login name.
6702 2000-02-18 Paul Eggert <eggert@twinsun.com>
6704 * getdate.y: Handle two-digit years with leading zeros correctly.
6705 (textint): New typedef.
6706 (parser_control): Member year changed from int to textint.
6708 (YYSTYPE): Removed; replaced by %union with int and textint members.
6709 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6710 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6711 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6712 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6713 (date, number, to_year): Use width of number in digits, not its value,
6714 to determine whether it's a 2-digit year, or a 2-digit time.
6715 (yylex): Store number of digits of numeric tokens.
6716 Reported by John Kendall.
6718 (parser_control): Changed from struct parser_control to typedef (for
6719 consistency). All uses changed.
6721 (tID): Removed; not used.
6722 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6724 2000-02-14 Paul Eggert <eggert@twinsun.com>
6726 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6727 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6729 2000-02-12 Jim Meyering <jim@meyering.net>
6731 * userspec.c (ISDIGIT): Define it.
6732 (isdigit): Remove definition.
6733 (is_number): Use ISDIGIT, not isdigit.
6734 <libintl.h>: Include.
6736 (parse_user_spec): Mark translatable strings.
6738 2000-02-10 Jim Meyering <jim@meyering.net>
6740 With these changes, nanosleep.[ch] are finally enough like the other
6741 lib/* replacement files to compile on a few more losing systems.
6743 * nanosleep.h: Don't include config.h.
6744 Remove prototype from declaration of nanosleep.
6745 (PARAMS): Remove now-unneeded definition.
6746 * nanosleep.c: #undef nanosleep.
6747 (rpl_nanosleep): Rename from nanosleep.
6749 2000-02-03 Jim Meyering <jim@meyering.net>
6751 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6752 rather than with `#if HAVE_UTMPNAME'.
6754 2000-02-01 Jim Meyering <jim@meyering.net>
6756 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6758 2000-01-31 Jim Meyering <jim@meyering.net>
6760 * nanosleep.h (nanosleep): Guard declaration with
6761 `#if ! HAVE_DECL_NANOSLEEP'.
6762 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6763 the declaration in that vendor's sys/timers.h.
6764 Reported by Christian Krackowizer.
6766 * quotearg.c (ISASCII): Add #undef and move definition to follow
6767 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6768 (ISPRINT): Likewise.
6769 Reported by Tom Tromey.
6771 2000-01-30 Jim Meyering <jim@meyering.net>
6773 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6774 uses of ->ut_name. The latter doesn't work with new Linux header files
6775 where only utmpx.ut_user is declared.
6777 * readutmp.h (UT_USER): Define.
6779 2000-01-23 Jim Meyering <jim@meyering.net>
6781 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6784 2000-01-22 Jim Meyering <jim@meyering.net>
6786 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6787 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6788 Required for some AIX systems. Reported by Christian Krackowizer.
6789 [TESTING] (main): New function.
6791 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6792 * dirname.c (dir_name): Support for DOS-style file names with drive
6795 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6797 * strverscmp.c (ISDIGIT): Define.
6798 (strverscmp): Use ISDIGIT, not isdigit.
6800 2000-01-17 Paul Eggert <eggert@twinsun.com>
6802 * nanosleep.c (nanosleep):
6803 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6804 POSIX.1 doesn't require SA_INTERRUPT and some systems
6805 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6806 it's been part of POSIX.1 since day 1 (in 1988).
6808 2000-01-17 Jim Meyering <jim@meyering.net>
6810 * interlock: Remove unused file. Reported by François Pinard.
6812 2000-01-16 Paul Eggert <eggert@twinsun.com>
6814 * quotearg.c (quotearg_buffer_restyled): Do not quote
6815 alert, backslash, formfeed, and vertical tab unnecessarily in
6816 shell quoting style.