1 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
3 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4 definitions to be after all include files, to avoid collisions.
5 Problem reported by Bob Proulx.
7 2005-01-04 Bob Proulx <bob@proulx.com>
9 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
10 offsetof() macro construct to avoid compile failure with native HP-UX
13 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
15 * utimens.c (futimens): Robustify the previous patch, by checking
16 for known valid error numbers rather than observed invalid ones.
18 2005-01-03 Jim Meyering <jim@meyering.net>
20 * utimens.c (futimens): Account for the fact that futimes
21 can also fail with errno == ENOSYS in that case.
22 Patch from Dmitry V. Levin.
24 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
26 * utimens.c (futimens) [HAVE_FUTIMES]: Fall back on utimes if
27 futimes fails with errno == ENOENT. Problem reported by
30 2005-01-02 Jim Meyering <jim@meyering.net>
32 * version-etc.c (version_etc_copyright): Update copyright date.
34 2004-12-31 Jim Meyering <jim@meyering.net>
36 * openat.c (rpl_openat): Correct comment.
37 Call free_cwd, to avoid leaking a file descriptor.
39 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
41 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
42 need to extend the stack.
43 (YYINITDEPTH): New macro, so that the initial stack isn't overly
46 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
48 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
51 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
52 Remove now-obsolete comment about AIX.
53 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
54 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
55 (YYMAXDEPTH): New macro.
57 2004-12-11 Jim Meyering <jim@meyering.net>
59 * chdir-long.c: Fail via #error if PATH_MAX is not defined, since
60 this file is now compiled only on systems that define PATH_MAX.
62 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
64 * getdate.y (textint): New member "negative".
65 (time_zone_hhmm): New function.
66 Expect 14 shift-reduce conflicts, not 13.
67 (o_colon_minutes): New rule.
68 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
69 (yylex): Set the "negative" member of signed numbers.
71 2004-12-06 Jim Meyering <jim@meyering.net>
73 * Makefile.am (libfetish_a_SOURCES): Begin removing .c and .h file
74 names, as they are added to AC_LIBSOURCES directives in the
75 corresponding m4/*.m4 files.
77 2004-12-05 Jim Meyering <jim@meyering.net>
79 Currently, fpending.m4 punts (by defining PENDING_OUTPUT_N_BYTES
80 to 1) if it doesn't find a valid expression for the replacement
81 function. Before this change, that might have gone undetected
82 for some time. Now, we'll catch it close to the source.
84 * t-fpending.c: New file. Test the __fpending function.
85 This ensures that if there is an error in the definition of the
86 PENDING_OUTPUT_N_BYTES expression, we'll find about it right away;
87 that value is used only in the rare event that close_stdout's
88 fclose fails with EBADF.
89 * Makefile.am (unit-test): New target.
90 (check): Depend on it.
91 (noinst_PROGRAMS): Define.
93 * Makefile.am (unit-test): Depend on t-fpending.
94 Make the target .PHONY.
96 2004-12-02 Paul Eggert <eggert@cs.ucla.edu>
98 * openat.c: Include "openat.h" before other include files.
100 (openat): Remove #undef; no longer needed now that we include openat.h
102 (rpl_openat): Add comment about mode_t promotion. Simplify
103 code a bit by moving initializations around. Use exit_failure
104 rather than EXIT_FAILURE.
105 * openat.h: Add copyright and authorship notice.
106 (AT_FDCWD): Use the same value Solaris 9 uses, except of type
107 'int' not 'unsigned int'.
109 * save-cwd.c: Include "save-cwd.h" before other include files.
110 (O_DIRECTORY): Remove; not needed here, since "." must be
111 a directory. All uses removed.
112 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
113 universal on Suns, and we also need to test for IRIX.
114 Revamp code to use 'if' rather than '#if'.
115 Avoid unnecessary comparison of cwd->desc to 0.
117 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
119 * hard-locale.c: Assume <locale.h> exists.
121 (GLIBC_VERSION): New macro.
122 (hard_locale): Assume setlocale exists.
123 Rewrite to avoid #ifdef.
124 Use strdup rather than malloc + strcpy.
125 * human.c: Assume <locale.h> exists.
126 (human_readable): Assume localeconv exists.
128 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
130 * getcwd.c (is_ENAMETOOLONG): New macro.
131 (__getcwd.c): Don't restore errno; glibc doesn't.
132 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
133 first, falling back to our code only if its results look suspicious.
134 Ensure that the resulting buffer is only as large as necessary.
136 * readutmp.c: Include readutmp.h first.
137 Include <errno.h>, since readutmp.h no longer does that.
138 * readutmp.h: Don't include <errno.h>,
139 <sys/param.h>, <time.h>; not needed to establish interface.
140 (errno): Remove decl.
141 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
142 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
143 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
145 2004-11-30 Jim Meyering <jim@meyering.net>
147 Change the name of the robust chdir function from chdir to chdir_long.
148 * save-cwd.c: Include chdir-long.h rather than chdir.h.
149 (restore_cwd): Use chdir_long, not chdir.
150 * chdir-long.c: Renamed from chdir.c.
151 * chdir-long.h: Renamed from chdir.h.
152 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd.
153 * Makefile.am (libfetish_a_SOURCES): Reflect name changes.
155 * chdir.c (O_DIRECTORY): Define, if necessary.
156 (memchrcspn): Tiny wrapper around memchr.
157 (rpl_chdir): Use memchrcspn rather than strcspn.
159 2004-11-28 Jim Meyering <jim@meyering.net>
161 * openat.c (rpl_openat): Also accept optional mode parameter.
162 * openat.h (rpl_openat): Adjust prototype.
164 * save-cwd.c: Include "chdir.h", so that if save_cwd/getcwd
165 saves a name longer than PATH_MAX, restore_cwd's chdir can use it.
167 * Makefile.am (libfetish_a_SOURCES): Add chdir.h and openat.h.
169 This is a robust version of chdir, in that it can handle directory
170 names longer than PATH_MAX.
171 * chdir.c, chdir.h: New file.
172 * openat.c, openat.h: New files.
174 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
176 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
177 HP's ANSI C compiler.
178 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
179 Declaring int functions causes warnings on some modern systems and
180 shouldn't be needed to compile on ancient ones.
181 * same.c (MIN) [defined MIN]: Don't define, since it's already
184 * mempcpy.c, mempcpy.h: New files, taken from gnulib.
185 * Makefile.am: (libfetish_a_SOURCES): Add getcwd.h, mempcpy.h.
186 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
187 with the following changes.
188 (__set_errno): Parenthesize properly.
190 (MIN, MAX, MATCHING_INO): New macros.
191 (__getcwd): Define with prototype, not K&R form.
192 Use heuristics to allocate default buffer on stack if possible.
193 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
194 behavior, and to avoid the PATH_MAX limit when computing
196 Use MATCHING_INO to compare inode number to file.
197 Check for arithmetic overflow in size calculations.
198 Fix bug in reallocation of dot array that caused getcwd to fail
199 on directories nested deeper than 75.
200 Be more careful about saving errno on error.
201 Do not use realloc; use only free+malloc, as this is a bit
202 more flexible and avoids a needless copy operation.
203 Do not inspect st_dev and st_ino for symbolic links; POSIX
204 doesn't specify the latter.
205 Check for closedir errors.
206 Avoid needless casts.
207 Use "#ifdef weak_alias" around weak_alias, to be like other
209 The following changes to getcwd.c have effect only when used in
210 gnulib; they have no effect inside glibc proper.
211 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
212 as alloca isn't used.
213 (alloca, __alloca): Likewise.
214 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
215 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
216 unconditionally, as gnulib assumes C89 or better.
217 Do not include <sys/param.h>.
218 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
219 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
221 (NULL) [!defined NULL]: Remove; we assume C89 or better.
222 Include <dirent.h> in a way that is compatible with modern Autoconf.
223 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
224 New macros, if not already defined.
225 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
226 Use "_LIBC", not "defined _LIBC", for consistency.
227 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
229 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
230 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
231 * xgetcwd.c: David MacKenzie's old code was removed, so give
232 credit only to Jim Meyering and adjust the copyright dates.
233 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
234 <stdlib.h>, <unistd.h>, "pathmax.h".
235 Instead, include "xgetcwd.h" (first) and "getcwd.h".
236 (INITIAL_BUFFER_SIZE): Remove.
237 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
239 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
241 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
242 (futimens): New function, which uses futimes if available.
243 (futimens, utimens): Support timespec==NULL, with same semantics
244 as utime and utimens.
245 * utimens.h (futimens): New decl.
247 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
249 * getopt_.h: Re-addition of __getopt_argv_const caused
250 redefinition warnings. To avoid them, include the defines
251 in `#if !defined __need_getopt ... #endif'. The only place
252 where __getopt_argv_const is used is in definitions
253 of getopt_long and getopt_long_only below, which are as well
254 protected by `#ifndef __need_getopt'.
255 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
256 __need_getopt after including <stdio.h> and <unistd.h> These
257 headers might have defined it.
259 2004-11-23 Jim Meyering <jim@meyering.net>
261 * closeout.c: Revert last change, since it seems EBADF is always
264 2004-11-22 Jim Meyering <jim@meyering.net>
266 * closeout.c (EBADF): Fail with `#error ...' if it's not defined,
267 asking the user to report the problem.
269 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
271 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
272 might fail. Problem reported by Yoann Vandoorselaere.
273 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
274 that mishandle size_t overflow.
276 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
278 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
279 (xgetcwd): Set errno correctly when failing.
280 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
281 the failure is actually due to a PATH_MAX problem.
283 Further getopt changes to make it more likely that glibc will
284 buy the changes back.
285 * getopt.c (POSIXLY_CORRECT): New constant.
286 (getopt): Use it, so to preserve glibc semantic
287 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
288 when compiling for libc.
289 * getopt_.h (__getopt_argv_const): Bring it back.
290 (getopt_long, getopt_long_only): Use it.
292 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
293 New arg POSIXLY_CORRECT. All callers changed.
294 (getopt): Argv is now char * const *, as per standard.
295 (_getopt_internal_r, _getopt_internal): Argv is now char **,
296 not char *__getopt_argv_const *.
297 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
298 _getopt_long_only_r): Likewise.
299 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
300 * getopt_int.h (_getopt_internal, _getopt_internal_r,
301 _getopt_long_r, _getopt_long_only_r): Likewise.
302 * getopt_.h (__getopt_argv_const): Remove.
303 (getopt): Argv is now char * const *, as per standard.
305 * canon-host.c: Include "strdup.h".
306 (canon_host): Use getaddrinfo if available, so that IPv6 works.
307 Use strdup instead of malloc/strcpy to duplicate strings.
309 * getdate.y (tORDINAL): New token.
310 (day, relunit): Allow it for relative times.
311 (relative_time_table): Use tORDINAL for ordinals.
313 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
315 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
316 (human_space_before_unit): New constant.
317 * human.c (human_readable): Support it.
319 2004-11-14 Jim Meyering <jim@meyering.net>
321 * closeout.c (close_stdout): Don't fail just because stdout was
322 closed initially, since some programs don't write to stdout in the
323 normal course of operation (other than --version and --help), and
324 we don't want this function to make e.g. `cp 1 2 >&-' fail.
325 But do fail if it was closed and someone has tried to write to it.
328 * __fpending.c, __fpending.h: Restore these files.
329 They're useful after all.
330 * Makefile.am (libfetish_a_SOURCES): Add __fpending.h.
332 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
334 * getopt.c, getopt1.c, getopt_.h, getopt_int.h:
337 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
339 * allocsa.h, mbswidth.c, mktime.c, readlink.c, getdate.y,
340 quotearg.c, strftime.c: Sync from gnulib.
342 2004-11-06 Jim Meyering <jim@meyering.net>
344 * __fpending.c, __fpending.h: Remove files.
346 * Makefile.am (libfetish_a_SOURCES): Remove __fpending.h, now
347 that it's no longer used.
349 Ensure that no close failure goes unreported.
350 * closeout.c (close_stdout): Always close stdout. I.e., don't
351 return early when it seems there's nothing to flush.
352 Don't include __fpending.h.
354 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
356 * unsetenv.c: New file, from gnulib. Needed for new getdate.y.
357 * Makefile.am (libfetish_a_SOURCES): Remove setenv.c.
358 * xreadlink.c: Sync from gnulib.
360 2004-11-03 Jim Meyering <jim@meyering.net>
362 * Makefile.am (libfetish_a_SOURCES): Add setenv.c and setenv.h.
364 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
366 * getdate.y, getpass.c, setenv.h: Sync from gnulib.
368 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
370 * getdate.y, getpagesize.h, mktime.c: Sync from gnulib.
372 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
374 * mktime.c (leapyear): Arg is long int, not int.
375 Change imported from gnulib.
377 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
380 * diacrit.c, diacrit.h: Add copyright notice.
381 * getpass.c (fflush_unlocked, flockfile, funlockfile)
382 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
385 2004-10-13 Jim Meyering <jim@meyering.net>
387 * fts.c (fts_read): When about to fail (by returning NULL) due
388 to a failed fchdir or failed fts_safe_changedir call, set
389 `sp->fts_cur = p'. Do this by removing the explicit `return NULL;'
390 statements and setting p->fts_errno so execution falls through
391 to the common-case code below. Otherwise, after such a failure,
392 calling fts_close would attempt to free an already-freed buffer.
393 Reported by Luis Lopez Lopez in http://bugs.debian.org/276352.
395 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
399 * xalloc.h (xmemdup): Renamed from xclone.
400 * xmalloc.c (xmemdup): Likewise.
401 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
402 XFREE): Remove these long-obsolescent macros.
403 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
406 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
407 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
408 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
409 regex.c, sha1.c, version-etc.c, yesno.c:
410 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
411 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
412 the includer's responsibility.
414 2004-10-03 Paul Eggert <eggert@cs.ucla.edu>
417 * dirfd.h, getpagesize.h: Add copyright notice.
418 * vasnprintf.c: (VASNPRINTF): Set errno=EOVERFLOW if the output is
420 * vasnprintf.h: Doc fix.
421 * vasprintf.c: Don't include <limits.h>.
422 (vasprintf): Rely on vasnprintf to set errno=EOVERFLOW.
424 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
426 * modechange.c (mode_compile): Don't decrement a pointer that
427 points to the start of a string, as the C Standard says the
428 resulting behavior is undefined.
430 2004-09-22 Jim Meyering <jim@meyering.net>
432 * getopt.c: Remove extraneous spaces before TAB.
433 * getopt_.h: Likewise.
435 * backupfile.c: Remove trailing blanks.
436 * euidaccess.c: Likewise.
438 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
440 * backupfile.h (enum backuptype): Rename none -> no_backups,
441 simple -> simple_backups, numbered_existing ->
442 numbered_existing_backups, numbered -> numbered_backups
443 to avoid shadowing problems. All uses changed.
444 * argmatch.c (enum backuptype): Likewise.
445 * backupfile.c (check_extension, numbered_backup):
446 Rename locals to avoid shadowing 'basename'.
447 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
450 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
452 Port to diet libc. Problem reported by Felix von Leitner in
453 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html>
454 * fts.c (fts_stat, fts_open, fts_read): Use "unsigned short int"
455 rather than the unportable "u_short", and similarly for u_int.
456 * fts_.h (FTSENT): Likewise.
458 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
460 * getopt.c, getopt1.c: Sync from gnulib.
461 * getopt_.h: Renamed from getopt.h (this syncs from gnulib).
462 * Makefile.am (libfetish_a_SOURCES): Remove getopt.c, getopt.h,
463 getopt1.c, getopt_int.h.
464 (BUILT_SOURCES, EXTRA_DIST, all-local, $(lib_OBJECTS), getopt.h,
465 MOSTLYCLEANFILES): Add current gnulib snippet for getopt.
466 * .cppi-disable: Add getopt_.h, getopt_int.h.
467 * .cvsignore: Add getopt.h.
469 2004-08-18 Paul Eggert <eggert@cs.ucla.edu>
471 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
472 strings on unbounded length. alloca's performance benefits aren't
475 (parse_with_separator): New function, with most of the internals
476 of the old parse_user_spec. Allow user to omit both user and group,
477 for compatibility with FreeBSD.
478 Clone only the user name, not the entire spec.
479 Do not set *uid, *gid unless entirely successful.
480 Avoid memory leak in some failing cases.
481 Fix regression for USER.GROUP reported by Dmitry V. Levin in
482 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
483 (parse_user_spec): Rewrite to use parse_with_separator.
485 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
487 * fts.c (O_DIRECTORY): Define to 0 if the system doesn't define.
489 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
491 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
492 (union fooround): Use uintmax_t, not long int.
493 The rest is a merge from libc:
494 [defined _LIBC]: Include <shlib-compat.h>.
495 (_obstack) [defined _LIBC]: Remove after 2.3.4.
497 * xgethostname.c: Do not include error.h. (merge from gnulib).
499 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
500 wmemchr or wmemcpy. Problem reported by Robert Dahlem
501 for Reliant Unix 5.43.
503 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
505 * Makefile.am (libfetish_a_SOURCES): Add getpass.h.
506 * getpass.h: New file.
507 * .cpp-disable: Add it.
508 * getpass.c [!_LIBC]: Include it.
510 * obstack.h (obstack_empty_p):
511 Don't assume that chunk->contents is suitably aligned.
512 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
513 Likewise. Problem reported by Benno in
514 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
516 * chown.c (rpl_chown): Work even if the file is writeable but not
517 readable. This could be improved further but it'd take some work.
518 * fts.c (diropen): New function.
519 (fts_open, fts_read, fts_children, fts_safe_changedir):
520 Use it, so that the code works even if the directory
521 is writeable but not readable. We'd like it to work even if
522 the directory is merely executable, but I don't know how to do
525 * xalloc-die.c: New file.
526 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
528 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
529 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
530 (_, N_, xalloc_die): Move to xalloc-die.c.
531 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
532 so that we needn't mess with xalloc_msg_memory_exhausted.
534 * sha1.h (sha1_ctx): Renamed from sha_ctx.
535 (sha1_init_ctx): Renamed from sha_init_ctx.
536 (sha1_process_block): Renamed from sha_process_block.
537 (sha1_process_bytes): Renamed from sha_process_bytes.
538 (sha1_finish_ctx): Renamed from sha_finish_ctx.
539 (sha1_read_ctx): Renamed from sha_read_ctx.
540 (sha1_stream): Renamed from sha_stream.
541 (sha1_buffer): Renamed from sha_buffer.
544 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
546 * canonicalize.h, cycle-check.h, stat-macros.h, strdup.h,
547 strftime.h, xnanosleep.c: Merge from gnulib.
549 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
551 Merge with gnulib and deal with some minor cleanups resulting.
553 * .cppi-disable: Change fnmatch.h to fnmatch_.h.
554 * .cvsignore: Add fnmatch.h, poll.h, stdbool.h, sysexit.h.
555 Remove safe-lstat.c, safe-lstat.h, safe-stat.c, safe-stat.h.
557 * backupfile.h, closeout.h, full-write.h, mbswidth.h, xalloc.h:
558 Add extern "C" wrappers for C++.
560 * dirname.h (IS_ABSOLUTE_FILE_NAME): Port to DOS.
562 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
564 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
565 (ENOSYS): Define if not defined.
566 (settime): Fall back on stime if it exists and settimeofday fails.
567 But don't bother with fallbacks if a method fails with errno == EPERM.
569 * obstack.h: Add white space.
571 * printf-parse.c, printf-parse.h, vasnprintf.c: Merge changes from
572 gnulib, but rewrite to avoid "xsize.h".
574 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
576 * mountlist.c (SIZE_MAX): Define after including files, to avoid
577 a collision on OpenBSD 3.4.
579 * fts.c (LONGEST_MODIFIER): New macro.
580 (PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro.
581 (find_matching_ancestor): Use it for dev_t and ino_t.
583 * getndelim2.c: Sync from gnulib.
585 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
586 sometimes returns a positive errno value even when it succeeds.
587 (print_errno_message) [!LIBC]: Fall back on strerror if
590 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
592 * canonicalize.c (errno): Remove decl; we now assume C89 or better.
593 * chown.c (errno): Likewise.
594 * closeout.c (errno): Likewise.
595 * dup-safer.c (errno): Likewise.
596 * dup2.c (errno): Likewise.
597 * exclude.c (errno): Likewise.
598 * fopen-safer.c (errno): Likewise.
599 * ftruncate.c (errno): Likewise.
600 * full-write.c (errno): Likewise.
601 * getcwd.c (errno): Likewise.
602 * lchown.c (errno): Likewise.
603 * memcoll.c (errno): Likewise.
604 * nanosleep.c (errno): Likewise.
605 * putenv.c (errno): Likewise.
606 * rmdir.c (errno): Likewise.
607 * same.c (errno): Likewise.
608 * savedir.c (errno): Likewise.
609 * setenv.c (errno): Likewise.
610 * stat.c (errno): Likewise.
611 * utime.c (errno): Likewise.
612 * xgetcwd.c (errno): Likewise.
613 * xmemcoll.c (errno): Likewise.
614 * xreadlink.c (errno): Likewise.
615 * xstrtol.c (errno): Likewise.
616 * canonicalize.h (enum canonicalize_mode_t): Reformat comments to
618 * fileblocks.c (textutils_fileblocks_unused): Make it a typedef
619 instead of an int, to save a few bytes in the object file.
620 * getdate.y (lookup_word): Rewrite to avoid cast.
621 * getloadavg.c: Include <stdbool.h>.
622 (getloadavg_initialized): Use bool for booleans.
623 * hard-locale.c (hard_locale): Return bool, not int.
624 * hard-locale.h (hard_locale): Likewise. Include <stdbool.h>.
625 * hash.c (hash_string): Rewrite to avoid cast.
626 * human.h: Use Autoconf-suggested pattern for inttypes and stdint.
627 * strtiomax.c: Likewise.
628 * xstrtol.h: Likewise.
629 * nanosleep.c: Include stdbool.h.
630 (rpl_nanosleep): Usee bool for booleans.
631 * quotearg.c: Include stdbool.h.
632 (quotearg_buffer_restyled): Use bool for booleans.
633 * readtokens.c (readtoken): Rewrite to avoid casts.
634 * same.c (same_name): Return bool, not int.
635 * same.h (same_name): Likewise. Include <stdbool.h>.
636 * version-etc.c (version_etc_va): Use size_t for sizes.
637 * xnanosleep.c: Include limits.h, stdbool.h.
639 (timespec_subtract, xnanosleep): Use bool for booleans.
640 * xstrtoimax.c: Just include xstrtol.h rather than rolling our
642 * xstrtoumax.c: Likewise.
643 * xstrtol.c (__xstrtol): Rewrite to avoid casts.
644 * yesno.c: Include yesno.h first.
645 (yesno): Return bool, not int.
646 * yesno.h (yesno): Likewise. Include <stdbool.h>.
648 * xstrtod.h (xstrtod): Return bool, not int. Invert the
649 sense of the boolean. All uses changed.
650 * xstrtod.c (xstrtod): Likewise.
651 * nanosleep.c: Include stdbool.h. Use bool for booleans.
653 * xgethostname.c: Don't include <sys/types.h> or "exit.h";
655 (errno): Remove decl; we now assume C89 or better.
656 Include unistd.h if available, for gethostname.
657 (ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with
658 existing errno values if any.
659 (gethostname): Remove decl, since unistd.h declares it (or doesn't,
660 in which case it's an older system and it should just work).
661 (xgethostname): Don't assume host name length is less than INT_MAX.
662 Exit if malloc fails, just as the comment says.
664 * save-cwd.c: Include <stdbool.h>.
665 (errno): Remove decl; we now assume C89 or better.
666 (save_cwd): Use bool for booleans.
667 (save_cwd, restore_cwd): Return -1 on failure, not 1, since we set
670 * readutmp.h (UT_USER): Parenthesize properly.
671 (UT_USER_SIZE): New constant.
672 (read_utmp): Don't assume that the number of users is less than
674 * readutmp.c (read_utmp): Likewise.
675 Check for integer overflow in size calculations.
676 Return -1 (not 1) on failure, since we set errno in that case.
678 * posixtm.c (posix_time_parse): Don't assume that the length of
679 the string being parsed is <= UINT_MAX.
681 * mountlist.h (read_file_system_list): Accept bool flag, not int.
682 * mountlist.c (read_file_system_list): Likewise.
683 * mountlist.h: Include <stdbool.h>.
684 * mountlist.c (errno): Remove decl; we now assume C89 or better.
685 (xatoi): Remove; replaced by strtoul. Hence device numbers can now
688 * isdir.c: Remove; no longer needed.
689 * Makefile.am (libfetish_a_SOURCES): Remove isdir.c.
691 * fts_.h: Add an FSF copyright notice, since our changes are becoming
694 * fts_.h: Include stddef.h, for ptrdiff_t.
695 (FTS.fts_nitems): Now size_t, not int, for hosts that allow more
696 than INT_MAX entries in a directory.
697 (FTS_ROOTPARENTLEVEL): Parenthesize properly.
698 (FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
699 than INT_MAX levels deep on 64-bit hosts.
700 (FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
701 the Hurd that don't have arbitrary limits on directory entry lengths.
702 (FTSENT.fts_statp): Now an array, not a pointer, so that we don't
703 have to play unportable games with pointer arithmetic. Keep it array
704 for the benefit of user code that assumes it is a pointer.
705 * fts.c: Include stdint.h if available, as Autoconf suggests.
706 (ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
708 (fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
709 Use size_t for sizes.
710 (fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
712 Use bool when appropriate.
713 (SIZE_MAX, TYPE_SIGNED): New macros.
714 (fts_read): Use u_short for instructions.
715 (fts_build): Use ptrdiff_t for levels. Don't assume file name lengths
716 fit into int. Don't assume nlink_t is signed.
717 (find_matching_ancestor): Don't assume dev, ino fit in int.
718 (fts_stat): Use function prototype; required for bool arg.
719 (fts_sort): Detect integer overflow in size calculations.
720 (fts_alloc): Simplify allocation code, now that fts_statp is an array
723 * fsusage.h: Include <stdbool.h>.
724 (struct fs_usage): Use uintmax_t for block sizes, so that they're
725 not limited to INT_MAX.
726 Use bool for booleans.
727 * fsusage.c: Use Autoconf-suggested pattern for inttypes and stdint.
728 Include unistd.h, for lseek.
730 * fnmatch.c: Include <stdbool.h>.
731 (errno): Remove decl; we now assume C89 or better.
732 * fnmatch_loop.c (EXT, FCT): Use bool when appropriate.
733 (FCT): Use size_t, not unsigned int, for sizes.
734 (EXT): Use size_t, not int, for sizes.
736 * stripslash.c (strip_trailing_slashes): Now returns bool.
737 * dirname.h (strip_trailing_slashes): Likewise.
739 * dirname.c (dir_name): Use bool when appropriate.
741 * argmatch.h (argmatch, __xargmatch_internal, argmatch_invalid):
742 Use ptrdiff_t, not int, when counting arguments, to allow more
743 than INT_MAX arguments.
744 * argmatch.c: Likewise. Use bool when appropriate.
746 2004-08-01 Paul Eggert <eggert@cs.ucla.edu>
748 * safe-read.c (errno): Remove decl; we now assume C89 or better.
749 (safe_rw): Don't work around Tru64 bug unless the bug symptoms
750 manifest themselves. This allows us to do proper reads and writes
751 on other hosts, e.g., "dd" with a block size greater than 2**31.
753 * md5.c (UNALIGNED_P): Use size_t; in practice, this is just as
754 good as uintptr_t in checking for alignments, and has fewer
755 configuration hassles.
756 * sha1.c (UNALIGNED_P): Likewise.
757 * md5.h: Don't include <limits.h>. Include <inttypes.h> if available,
758 as it defines symbols like UINT32_MAX on Solaris 8.
759 (md5_uint32): Assume uint32_t exists; Autoconf will define it
760 otherwise (if the host has a 32-bit unsigned type, anyway).
761 * memchr.c: Don't include inttypes.h or stdint.h.
762 (UNALIGNED_P): Remove.
763 (__memchr): Use size_t, not uintptr_t, to test alignment.
764 * memrchr.c: Likewise, for __memrchr.
766 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
768 * makepath.h: Include <stdbool.h>.
769 (make_path, make_dir): Use bool, not int, since we're not setting
771 Use mode_t for modes, not int. All uses changed.
772 * makepath.c: Likewise.
773 (errno): Remove decl; no longer needed since we assume C89.
775 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
777 * modechange.c: Include <stdbool.h>.
778 (mode_compile): Use bool when appropriate.
780 * memchr.c (UNALIGNED_P): Use sizeof, not alignof, for better
781 performance on m68k-linux. Reported by Andreas Schwab in
782 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00104.html>.
783 * memrchr.c (UNALIGNED_P): Likewise.
785 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
787 * userspec.c: Include <stdbool.h>, "inttostr.h".
788 (V_STRDUP): Don't assume the string's length fits in int.
789 (ISDIGIT): unsigned -> unsigned int
790 (is_number): Define only ifdef __DJGPP__; not needed elsewhere.
791 Use bool instead of int where appropriate.
792 Do not allow empty strings.
793 (parse_user_spec): Parse numbers as decimal integers, even if
794 they have a leading 0. Don't assume uids and gids fit in int.
796 * memchr.c: Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
797 (LONG_MAX_32_BITS): Remove.
798 Include <inttypes.h> and <stdint.h> if available.
799 (alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
800 (__memchr): Don't assume unsigned long int is either 4 or 8 bytes;
801 let it be any number of bytes greater than or equal to 4.
802 * memrchr.c: Likewise, with __memrchr.
804 * md5.h: Include <stdint.h> if HAVE_STDINT_H || _LIBC, not
806 (md5_uint32): Use uint32_t if available. Simplify fallback ifdefs.
807 * md5.c: Don't include <sys/types.h> or <stdlib.h>; <stddef.h>
808 suffices with C89 or better.
809 (alignof): New macro, portable to all C89 hosts.
810 (UNALIGNED): Use it. Use uintptr_t if available, and assume
811 everything is unaligned otherwise; this is more portable than
812 assuming 'unsigned long int' will always work.
815 * getugroups.c: Include <errno.h>.
816 (EOVERFLOW): Define if not defined.
817 (getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
820 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
822 * euidaccess.c [HAVE_LIBGEN_H]: Include <libgen.h>, for
823 eaccess on Solaris and SVR4-like systems.
824 (euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
826 cycle-check integer overflow fixup.
828 * cycle-check.h: Remove now-inaccurate comment about the files
829 you need to include first. You don't need to include any files
830 other than the usual config.h.
831 Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
832 Remove 'struct stat;' not needed since we know sys/stat.h has
833 been included by dev-ino.h.
834 (struct cycle_check_state): Change chdir_counter to uintmax_t,
835 not size_t, since it isn't limited by object sizes.
836 Change magic from long unsigned int to int; that's good enough
838 * cycle-check.c (is_zero_or_power_of_two): Renamed from
839 is_power_of_two, to reflect better what it really does.
840 All uses changed. Arg is now uintmax_t, not unsigned int
841 (it should have been unsigned long int -- that was a bug).
842 (cycle_check): Check for integer overflow in cycle count,
843 and report a cycle if that happens, as it must be a cycle
846 backupfile.c rewrite to avoid arbitrary limits on lengths of
847 numeric backup extensions.
849 * addext.c: Remove; no longer needed.
850 * Makefile.am (libfetish_a_SOURCES): Remove addext.c.
851 * backupfile.h (addext): Remove decl.
852 * backupfile.c: Include "backupfile.h" first.
853 Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h.
854 (CLOSEDIR, INT_STRLEN_BOUND): Remove.
855 (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro.
856 (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro.
857 (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we
858 also look at _XOPEN_NAME_MAX, for better performance on modern
859 hosts that support only file names of length 255 or more.
860 (ISDIGIT): unsigned -> unsigned int
861 (max_backup_version, version_number): Remove.
862 (check_extension): New function. Similar to the old addext, but
863 static, assumes that the extension has already been added,
864 and a bit more careful on DOS hosts.
865 (numbered_backup): New function. It does what max_backup_version
866 and version_number used to do, but it doesn't use integer arithmetic
867 to calculate extensions so it doesn't overflow.
868 (find_backup_file_name): Rewrite to use these new functions.
869 This has a new optimization: we needn't call pathconf if the
870 new numbered backup name has the same length as the old.
871 Also, use xmalloc rather than malloc, so that the caller
872 needn't worry about memory exhaustion.
874 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
876 * euidaccess.c [!defined LIBC]: Included group-member.h, stat-macros.h.
877 (S_IXUSR, S_IXGRP, S_IXOTH, S_IROTH, S_IWOTH, S_IXOTH):
878 Remove; now done by stat-macros.h.
879 (NGROUPS_MAX, group_member): Remove; now done by group-member.h.
880 No need to include <limits.h>.
881 (errno): Remove decl; we now assume C89 or better.
882 (access, getuid, getgid, geteuid, getegid, stat) [defined _LIBC]:
884 (uid, gid, have_ids): Remove these static variables.
885 They weren't accurate for programs that also invoked setreuid etc.
886 (euidaccess) [defined EFF_ONLY_OK || defined ACC_SELF ||
887 HAVE_DECL_EACCSS]: Use builtin substitutes.
888 [defined _LIBC]: Ignore __libc_enable_secure; it's not a
889 correct optimization for programs run as root that later
891 [no builtin substitutes && HAVE_DECL_SETREGID &&
892 PREFER_NONREENTRANT_EUIDACCESS]:
893 Use setreuid+setregid to get the correct answer.
894 [no builtin substitutes && ! (HAVE_DECL_SETREGID &&
895 PREFER_NONREENTRANT_EUIDACCESS)]:
896 Don't assume that the stat macros have their historical values,
897 as POSIX doesn't require this.
898 [defined TEST]: Include <stdlib.h>; don't include errno.h
899 twice; include <error.h> rather than "error.h".
901 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
903 * Makefile.am (libfetish_a_SOURCES): Add fcntl-safer.h,
905 * fcntl-safer.h, open-safer.c: New files.
907 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
909 * c-strtod.c (STRTOD_L): New macro.
910 (C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the
911 code is reentrant on platforms that have strtod_l.
913 * getloadavg.c: Include <errno.h>, <stdio.h>, <stdlib.h> even
914 if HAVE_GETLOADAVG is defined, so that the test program can work.
915 (errno): Remove declaration; not needed in C89 or later.
916 Include "c-strtod.h".
917 Do not include locale.h or define setlocale; no longer needed.
919 (INT_STRLEN_BOUND): New macro.
920 (getloadavg): Use it to compute buffer size.
921 Don't assume that buffer will be properly terminated by 'read'.
922 Use c_strtod instead of setlocale.
923 (main) [defined TEST]: Return int, not void.
925 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
927 * Makefile.am (libfetish_a_SOURCES): Add c-strtold.c.
928 * c-strtold.c: New file.
929 * c-strtod.c: Include <config.h> first.
930 (C_STRTOD, DOUBLE, STRTOD): New macros.
931 (c_strtod): Use them.
932 * c-strtod.h (c_strtold): New decl.
934 2004-07-07 Jim Meyering <jim@meyering.net>
936 Don't infloop when MAXSYMLINKS is not defined.
937 Detect symlink loops much earlier (albeit lazily) on systems
938 with MAXSYMLINKS defined to a large value.
940 * canonicalize.c: Include "cycle-check.h".
941 (canonicalize_filename_mode): Don't try to detect loops by counting
942 symlink-hops. Instead, use the cycle-check module.
944 * cycle-check.h: Include stdbool.h.
945 Forward-declare `struct stat'.
947 * canonicalize.c (canonicalize_filename_mode): Remove do-while(0) loop.
948 Replace each corresponding `break' stmt with `continue'.
950 2004-07-06 Jim Meyering <jim@meyering.net>
952 * canonicalize.c: Include "stat-macros.h".
953 (canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that
954 S_ISLNK is guaranteed to be defined (via stat-macros.h).
956 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
958 * Makefile.am (libfetish_a_SOURCES): Add canonicalize.c
960 * canonicalize.h (canonicalize_mode_t): New type.
961 * canonicalize.c: Include "file-type.h".
962 (canonicalize_filename_mode): New function, based on
963 canonicalize_file_name, supports three canonicalize modes.
964 (canonicalize_file_name)
965 [!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it.
967 2004-07-05 Jim Meyering <jim@meyering.net>
969 * path-concat.c (path_concat): Improve comment. From Paul Eggert.
971 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
973 * canonicalize.c (canonicalize_file_name): Assume that path_concat
975 * path-concat.c (mempcpy): Don't define if a system header defines it.
976 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
977 (longest_relative_suffix): New function.
978 (path_concat): Use it. Assume first argument is not NULL.
979 Port to DOS. Omit redundant separators.
980 Report an error instead of returning NULL.
981 Use mempcpy instead of memcpy.
982 (xpath_concat): Remove: not declared or used.
984 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
986 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
987 FILESYSTEM_PREFIX_LEN. All uses changed.
988 * mountlist.h (read_file_system_list): Renamed from
989 read_filesystem_list. All definitions and uses changed.
991 2004-06-24 Jim Meyering <jim@meyering.net>
993 * obstack.h (obstack_base): Fix parentheses. From Paul Eggert.
995 2004-06-20 Jim Meyering <jim@meyering.net>
997 * obstack.h (obstack_base): Cast to (void *), per documentation.
1000 * yesno.c: Include "yesno.h".
1001 * Makefile.am (libfetish_a_SOURCES): Add yesno.h.
1003 2004-06-19 Jim Meyering <jim@meyering.net>
1005 * filemode.c: Remove all S_IS* and S_IF* definitions.
1006 Instead, just include "stat-macros.h".
1008 * rmdir.c: Likewise.
1009 * makepath.c: Likewise.
1010 * lchown.c: Likewise.
1011 * isdir.c: Likewise.
1012 * canonicalize.c: Likewise.
1014 Add S_IS* definitions from filemode.c.
1015 * stat-macros.h (S_ISCTG): Define to zero if not already defined.
1016 (S_ISOFD): Likewise.
1017 (S_ISOFL): Likewise.
1019 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
1021 * readutmp.c (extract_trimmed_name): Don't apply strchr to a
1022 non-string; this leads to undefined behavior.
1024 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
1026 * fts.c (fts_stat, fts_alloc): Always allocate and use a struct
1027 stat, even if the user isn't interested in the results.
1028 This prevents a core dump in cycle_check when FTS_NOSTAT is set.
1029 * lchown.c (lchown): Return EOPNOTSUPP if not supported; this
1030 is what POSIX-2004 specifies.
1031 * lchown.h (EOPNOTSUPP): Define if not defined.
1034 2004-06-06 Jim Meyering <jim@meyering.net>
1036 * getdate.y: Update from gnulib.
1038 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
1040 * xreadlink.c: Include xreadlink.h first, to catch .h file
1041 dependency problems.
1042 (xreadlink): Accept new arg SIZE, for efficiency.
1043 All decls and uses changed.
1044 * xreadlink.h: Include <stddef.h>, for size_t.
1045 * canonicalize.c (canonicalize_file_name): Update use of xreadlink.
1047 2004-06-01 Jim Meyering <jim@meyering.net>
1049 * xmalloc.c: Update from gnulib.
1051 2004-05-30 Jim Meyering <jim@meyering.net>
1053 * alloca_.h: Remove trailing blank.
1055 2004-05-29 Jim Meyering <jim@meyering.net>
1057 * dirname.h (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Define.
1059 * calloc.c: New file.
1061 2004-05-21 Jim Meyering <jim@meyering.net>
1063 * alloca.c, alloca_.h, fnmatch.c: Update from gnulib.
1064 * localcharset.c, regex.c: Likewise.
1066 2004-05-20 Jim Meyering <jim@meyering.net>
1068 * obstack.c, obstack.h: Update from gnulib.
1070 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1072 * getline.c, getndelim2.c, getndelim2.h: Sync with gnulib.
1074 2004-05-11 Jim Meyering <jim@meyering.net>
1076 Prior to this change, rm required read access to the current
1077 directory on most systems (ones with the fchdir function).
1079 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1080 fails, try write-only, and finally, resort to using xgetcwd.
1082 2004-05-07 Jim Meyering <jim@meyering.net>
1085 * obstack.c (_): Define only if not already defined.
1086 * obstack.h (obstack_finish): Rename local: s/value/__value/.
1088 2004-05-03 Jim Meyering <jim@meyering.net>
1090 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1092 2004-05-01 Jim Meyering <jim@meyering.net>
1094 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1095 Wrap old code with this conditional.
1096 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1097 function that does not dereference symlinks.
1099 2004-04-18 Paul Eggert <eggert@twinsun.com>
1101 * nanosleep.c (suspended): Change its type from int to
1102 sig_atomic_t volatile.
1103 (first_call): Make it private to rpl_nanosleep, and have it
1104 be zero initially as that's a bit faster.
1105 (my_usleep): Round up fractional times instead of truncating them,
1106 as this is the usual meaning for 'sleep'.
1108 2004-04-20 Jim Meyering <jim@meyering.net>
1110 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1112 2004-04-18 Jim Meyering <jim@meyering.net>
1114 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
1115 don't leak memory and do call END_UTMP_ENT.
1117 2004-04-13 Jim Meyering <jim@meyering.net>
1119 * quotearg.c, quotearg.h: Remove trailing blanks.
1121 2004-04-12 Jim Meyering <jim@meyering.net>
1123 * inttostr.h: Update from gnulib.
1125 2004-03-27 Paul Eggert <eggert@twinsun.com>
1127 * utimecmp.c, utimecmp.h: New files.
1128 * Makefile.am (libfetish_a_SOURCES): Add utimecmp.c, utimecmp.h.
1130 2004-04-09 Jim Meyering <jim@meyering.net>
1132 * stat-macros.h: New file, with contents from file-type.h
1133 and coreutils' system.h.
1134 * Makefile.am (libfetish_a_SOURCES): Add stat-macros.h.
1135 * file-type.c: Include "stat-macros.h".
1136 * file-type.h (file_type): Move all macro defiitions to new file,
1139 2004-03-30 Paul Eggert <eggert@twinsun.com>
1141 * cloexec.c, cloexec.h, config.charset, file-type.c, file-type.h:
1142 * getloadavg.c, getndelim2.c, getusershell.c, group-member.c:
1143 * human.c, path-concat.c, printf-args.c, printf-args.h:
1144 * quotearg.c, quotearg.h, setenv.c, strdup.c:
1145 * userspec.c, userspec.h, vasprintf.c: Sync from gnulib.
1147 * allocsa.c, allocsa.h, strdup.h: New files, from gnulib.
1148 * Makefile.am (libfetish_a_SOURCES): Add allocsa.c, allocsa.h,
1151 2004-03-30 Jim Meyering <jim@meyering.net>
1153 * getloadavg.c: Merge changes from emacs (via gnulib).
1155 2004-03-28 Paul Eggert <eggert@twinsun.com>
1157 Fix some gotchas encountered when porting to Solaris 8, using
1158 the Forte 6u2 compiler.
1160 * canonicalize.c [HAVE_UNISTD_H]: Include <unistd.h>,
1161 for resolvepath declaration.
1162 * fts.c: Include dirfd.h, for dirfd.
1164 2004-02-25 Paul Eggert <eggert@twinsun.com>
1166 * human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
1168 2004-03-23 Paul Eggert <eggert@twinsun.com>
1170 * readtokens0.c (readtokens0): Return true on success rather
1171 than on failure. All callers changed. This also happens to fix a
1172 portability bug on pre-C99 hosts, where (bool) INTEGER sometimes
1173 returns false even when INTEGER is nonzero.
1175 2004-03-23 Jim Meyering <jim@meyering.net>
1177 * Makefile.am (libfetish_a_SOURCES): Add getopt_int.h.
1178 * getopt_int.h: New file, from gnulib.
1179 * getopt.c, getopt.h, getopt1.c: Sync from gnulib.
1180 * getopt.c, getopt.h: Remove space(s) before TAB.
1182 * mbswidth.c, mbswidth.h: Sync from gnulib.
1184 2004-03-21 Jim Meyering <jim@meyering.net>
1186 * readtokens0.c, readtokens0.h: New files.
1187 * Makefile.am (libfetish_a_SOURCES): Add readtokens0.c and readtokens0.h
1189 * readtokens.c (readtoken): Don't leak 64 bytes when reading
1190 an empty input stream.
1192 * readtokens.c: Include <stdbool.h>.
1193 (readtoken): Use `size_t' rather than int/long.
1194 All callers adjusted.
1195 Use `bool' rather than `int' where appropriate.
1196 Use memset rather than an explicit loop.
1197 Use x2nrealloc rather than xrealloc.
1198 Allow the use of `\0' as a delimiter.
1199 (readtokens): Likewise.
1200 * readtokens.h (readtoken, readtokens): Update prototypes.
1202 2004-02-29 Paul Eggert <eggert@twinsun.com>
1204 * getdate.h: Include stdbool.h, and timespec.h instead of
1205 the usual <time.h> dance.
1206 (get_date): Change signature to support fractional time stamps.
1207 All callers changed.
1208 * getdate.y: Include "getdate.h" first, as we can now
1209 assume C89 and don't need to worry about 'const'.
1210 Similarly, include "unlocked-io.h" near start, not in middle.
1212 (textint.value): Use long int rather than int.
1213 (textint.digits): Use size_t rather than int.
1214 (BILLION, LOG10_BILLION): New constants.
1215 (parser_control): New member rel_ns. Members day_ordinal,
1216 time_zone, month, day, hour, minutes, rel_year, rel_month,
1217 rel_day, rel_hour, rel_minutes, rel_seconds
1218 are now long int, not int. Member seconds is now struct timespec,
1219 not int. New member timespec_seen. Members dates_seen, days_seen,
1220 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
1222 (%union.intval): Now long int, not int.
1223 New member timespec.
1224 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
1225 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
1226 (spec): Now is a timespec or an item list.
1227 (timespec, items): New nonterminals.
1228 (time, rel, relunit, number, get_date):
1229 Add support for fractional seconds.
1230 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
1231 (gmtime, localtime, mktime): Remove decls; not needed with C89.
1232 (to_hour): First arg is now long int, not int.
1233 (to_year): Returns long int, not int.
1234 Don't treat year -70 like 70.
1235 (tm_diff): Returns long int, not int.
1236 (lookup_word): Use bool instead of int when appropriate.
1237 (yylex): Use size_t for count, not int.
1238 Detect overflow when parsing large integer constants.
1239 Add support for fractions.
1240 (get_date): Make pointers 'const' if possible.
1241 Use more-portable code to detect integer overflow.
1242 (main) [TEST]: Adjust to above changes. Test for localtime failure.
1243 Don't use ctime; it's not reliable if the year has >4 digits.
1245 2004-03-15 Jim Meyering <jim@meyering.net>
1247 `date --date="21:04 +0100" +%S' would print the seconds value
1248 from the current time, rather than `00'.
1249 * getdate.y: For a date string like `10:23 +0100',
1250 set the number of seconds to zero. Reported by Marc Haber.
1252 2004-03-04 Jim Meyering <jim@meyering.net>
1254 * cloexec.c (set_cloexec_flag) [ ! (F_GETFD && F_SETFD)]:
1255 Return true, not false.
1257 2004-03-03 Paul Eggert <eggert@twinsun.com>
1259 * cloexec.c: Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
1260 (set_cloexec_flag): Use bool for booleans. All uses changed.
1261 If F_GETFD returns a negative number (not just -1), report a
1262 failure. Don't use F_SETFD if the flags are already right.
1263 Don't report a failure with F_SETFD unless it returns -1.
1264 * cloexec.h: Include <stdbool.h>.
1265 Adjust signature to use `bool' rather than `int'.
1266 * getloadavg.c (getloadavg): Use `true', not `1'.
1268 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
1270 * cloexec.c: New file.
1271 The set_cloexec_flag implementation imported from GNU C Library
1273 * cloexec.h: New file.
1274 * getloadavg.c: Include "cloexec.h".
1275 (getloadavg): Use set_cloexec_flag instead of manual fcntl call.
1276 * Makefile.am (libfetish_a_SOURCES): Add cloexec.c, cloexec.h.
1278 2004-02-23 Paul Eggert <eggert@twinsun.com>
1280 * userspec.c: Don't include "posixver.h".
1281 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
1282 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
1283 compatible extension. Simplify code by removing a boolean int
1284 that was always nonzero if a string was nonnull.
1286 2004-02-05 Jim Meyering <jim@meyering.net>
1288 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
1289 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
1290 From coreutils' system.h.
1292 2004-01-29 Jim Meyering <jim@meyering.net>
1294 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
1296 2004-01-21 Paul Eggert <eggert@twinsun.com>
1298 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
1299 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
1300 * argmatch.h: Comment fix to match the above.
1301 * long-options.c (parse_long_options): Use prototype
1302 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
1304 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
1305 Now a macro referring to exit_failure, instead of a separate
1306 variable. Include "exitfail.h" to get it.
1307 * xstrtol.h: Include "exitfail.h".
1308 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
1310 2004-01-21 Jim Meyering <jim@meyering.net>
1312 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
1313 so as not to conflict with a different-sized __mktime_internal
1314 function in GNU libc.
1316 2004-01-16 Jim Meyering <jim@meyering.net>
1319 * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED,
1320 rather than HAVE_GETC_UNLOCKED.
1322 2003-10-08 Paul Eggert <eggert@twinsun.com>
1326 * unlocked-io.h: Include <stdio.h>, so that the caller
1327 doesn't have to include <stdio.h> before us.
1328 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
1329 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
1330 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
1331 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
1332 if not declared, so that we can use getpass.c code from libc without
1334 (flockfile, ftrylockfile, funlockfile): New macros.
1336 2004-01-14 Paul Eggert <eggert@twinsun.com>
1340 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
1341 with like-named macro in fnmatch.c.
1342 (EXT): Use an internal constant instead.
1344 Merge fnmatch patches from glibc.
1345 * fnmatch.c (mbsinit): Remove define.
1346 Add libc_hidden_ver (__fnmatch, fnmatch).
1347 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
1348 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
1350 2003-11-24 Paul Eggert <eggert@twinsun.com>
1354 * alloca.c: Remove dependency on xalloc module.
1355 (xalloc_die): Remove.
1356 (memory_full) [!defined emacs]: New macro.
1357 [!defined emacs]: Don't include xalloc.h.
1358 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
1359 address arithmetic overflows. Change datatypes a bit to avoid
1362 2004-01-14 Paul Eggert <eggert@twinsun.com>
1364 * posixver.c: Include posixver.h.
1366 2004-01-12 Jim Meyering <jim@meyering.net>
1368 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
1369 optional configure-time default.
1371 2004-01-10 Jim Meyering <jim@meyering.net>
1373 * version-etc.c (version_etc_copyright): Update copyright date.
1375 2003-12-20 Jim Meyering <jim@meyering.net>
1377 * fts.c [!_LIBC]: Undefine, then define-away __P.
1379 2003-12-19 Jim Meyering <jim@meyering.net>
1381 Rewrite fts to use a hash table or O(1)-mem cycle-detection
1382 code rather than the tree-based tsearch functions.
1383 * fts_.h: Include hash.h and cycle-check.h.
1384 (FTS_TIGHT_CYCLE_CHECK): New value.
1385 (FTS_OPTIONMASK): Adjust to include the new value.
1386 (FTS_NAMEONLY, FTS_STOP): Increase to allow room for new value.
1387 (struct FTS) [active_dir_ht]: New member. Replaces fts_dir_signatures.
1388 (struct FTS) [cycle_state]: New member.
1389 * fts.c: Don't include <search.h>.
1390 [HAVE_INTTYPES_H]: Include <inttypes.h>.
1391 (tdestroy, tfind, tsearch): Remove definitions.
1392 (struct Active_dir): Rename from `known_object'.
1393 (AD_compare, AD_hash): New functions.
1394 (enter_dir, leave_dir): Rewrite to manipulate a hash table
1396 (fts_open): Initialize hash table or cycle_state buffer.
1397 (free_node): Remove function.
1398 (find_matching_ancestor): Renamed/rewritten from look_up_active_dir.
1399 (fts_cross_check): Adapt to use new data structure.
1401 * Makefile.am (libfetish_a_SOURCES): Remove search_.h.
1402 (DISTCLEANFILES): Remove definition.
1404 2003-12-18 Jim Meyering <jim@meyering.net>
1406 Rewrite cycle detection code to work properly.
1407 Add some framework (compiled out by default) to test it.
1408 * fts.c (Dprintf, ENTER_DIR, LEAVE_DIR): Define.
1409 (add_object): Remove function. Rewritten as...
1410 (enter_dir): New function.
1411 (leave_dir, free_node): New functions.
1412 (fts_read): Ensure that we call ENTER_DIR or LEAVE_DIR,
1413 as appropriate, before returning.
1414 (look_up_active_dir, fts_cross_check) [FTS_DEBUG]: New functions.
1415 (fts_stat): Don't perform the cycle check here.
1416 Now it's done via enter_dir.
1418 2003-12-12 Jim Meyering <jim@meyering.net>
1420 * fts_.h (FTS) [fts_dir_signatures]: Add comment.
1422 2003-12-03 Paul Eggert <eggert@twinsun.com>
1424 * getgroups.c (getgroups): xmalloc takes one argument, not two.
1425 Bug reported by Alfred M. Szmidt.
1427 2003-12-02 Jim Meyering <jim@meyering.net>
1429 * Makefile.am (libfetish_a_SOURCES): Reflect sha -> sha1 renaming.
1431 * sha1.c: File renamed from sha.c.
1432 * sha1.h: File renamed from sha.h.
1433 Use SHA1_H, not _SHA_H in #ifndef condition.
1435 * sha.c: Add FSF Copyright.
1436 * sha.h: Correct stale references to MD5 and `16 bytes'.
1437 Patch by Ulrich Drepper.
1439 * sha.h: Add FSF Copyright. Remove reference to Scott Miller,
1440 since this file is now nearly identical to md5.h.
1442 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
1443 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
1444 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
1446 2003-11-29 Jim Meyering <jim@meyering.net>
1448 * c-strtod.c (c_strtod): Save and restore original LC_NUMERIC setting,
1449 in case it was different from the environment-derived value.
1450 Patch by Paul Eggert.
1451 Include "xalloc.h" for declaration of xstrdup.
1453 2003-11-24 Paul Eggert <eggert@twinsun.com>
1455 Parse floating-point operands and options in the C locale.
1456 POSIX requires this for printf, and we might as well be
1457 consistent elsewhere (tail, sleep, seq).
1459 * Makefile.am (libfetish_a_SOURCES): Add c-strtod.c, c-strtod.h.
1460 * c-strtod.c, c-strtod.h: New files.
1461 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
1462 conversion function.
1463 * xstrtod.c (xstrtod): Likewise. All callers changed to
1464 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
1467 * xnanosleep.c: Don't include xstrtod.h; it's not needed.
1469 2003-11-22 Jim Meyering <jim@meyering.net>
1471 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
1473 2003-11-21 Jim Meyering <jim@meyering.net>
1475 * xreadlink.c (xreadlink): Correct outdated comment.
1477 2003-11-17 Jim Meyering <jim@meyering.net>
1479 On systems without utime and without a utimes function capable of
1480 dealing with a NULL struct utimbuf* argument, this utime replacement
1481 could -- in unusual circumstances -- leak a file descriptor.
1482 * utime.c: Include <unistd.h> and <errno.h>.
1483 (utime_null): Be sure to close `fd' and to preserve errno.
1484 Reported by Geoff Collyer via Arnold Robbins.
1486 2003-11-13 Jim Meyering <jim@meyering.net>
1488 * xalloc.h, xstrtol.c: Update from gnulib.
1490 2003-11-11 Jim Meyering <jim@meyering.net>
1492 * ftw.c, ftw_.h: Remove files. No longer used.
1494 2003-11-09 Jim Meyering <jim@meyering.net>
1496 * root-dev-ino.c, root-dev-ino.h: New files.
1497 * Makefile.am (libfetish_a_SOURCES): Add root-dev-ino.c root-dev-ino.h.
1499 * dev-ino.h: Include <sys/types.h> and <sys/stat.h>.
1501 2003-11-06 Jim Meyering <jim@meyering.net>
1503 * free.c: New file, from gnulib.
1505 2003-10-31 Paul Eggert <eggert@twinsun.com>
1507 * mountlist.h (struct mount_entry.me_type_malloced): New member.
1508 * mountlist.c (SIZE_MAX): Define if not defined already.
1509 (read_filesystem_list): Set and use me_type_malloced.
1510 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
1511 whatever the type happens to be), for brevity and consistency.
1512 Check for size calculation overflow on Alphas running OSF/1.
1514 2003-10-31 Jim Meyering <jim@meyering.net>
1516 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
1518 * linebuffer.c: Include <string.h> for declaration of memset.
1520 * alloca.c, linebuffer.c, xmalloc.c, xalloc.h: Update from gnulib.
1521 * exclude.c, getgroups.c, quotearg.c, stdbool_.h: Update from gnulib.
1522 * hash.c, hash-pjw.h: Update from gnulib.
1524 2003-10-25 Jim Meyering <jim@meyering.net>
1526 * hash.c, hash.h: Update from gnulib.
1527 * hash-pjw.c, hash-pjw.h: Likewise.
1528 * obstack.c, obstack.h: Likewise.
1530 2003-10-25 Jim Meyering <meyering@lucent.com>
1532 * fts_.h: Include <features.h> only if _LIBC.
1533 [!_LIBC]: Define-away __THROW, __BEGIN_DECLS, __END_DECLS.
1535 2003-10-19 Jim Meyering <jim@meyering.net>
1537 * vasnprintf.c (vasnprintf): Work around losing snprintf on
1540 2003-09-25 Jim Meyering <jim@meyering.net>
1541 Bruno Haible <bruno@clisp.org>
1543 [Update from gnulib]
1544 This lets translators provide better translations for the
1545 "Written by ..." part of --version output.
1546 * version-etc.h: Include stdarg.h.
1547 (version_etc_copyright): Declare as readonly.
1548 (version_etc): Make this function variadic with a NULL-terminated list
1549 of author name strings.
1550 (version_etc_va): New declaration.
1551 * version-etc.c: Include stdarg.h, stdlib.h.
1552 (version_etc_copyright): Declare as readonly.
1553 (version_etc_va): New function. Provide a different translatable string
1554 for each possible number of authors < 10. Abbreviate when there are 10
1556 (version_etc): Make this function variadic. Call version_etc_va.
1557 Suggestion from Gary V. Vaughan.
1559 * long-options.h (parse_long_options): Change prototype: the authors
1560 string is moved to the end and becomes variadic.
1561 * long-options.c: Include stdarg.h.
1562 (parse_long_options): Make this function variadic, too.
1563 Call version_etc_va, not version_etc.
1565 2003-10-17 Jim Meyering <jim@meyering.net>
1567 * xfts.c, xfts.h: New files.
1568 This factors out code used by du.c, chmod.c, and chown-core.c.
1569 * Makefile.am (libfetish_a_SOURCES): Add xfts.c and xfts.h.
1571 * error.h: Update from gnulib.
1572 * getpass.c: Likewise.
1573 * fnmatch.c: Likewise.
1574 * fnmatch_loop.c: Likewise.
1576 2003-10-16 Jim Meyering <jim@meyering.net>
1578 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
1580 * getgroups.c: Update from gnulib.
1581 * readutmp.c: Fix indentation, from gnulib.
1582 * exclude.c: Update from gnulib.
1583 * xgethostname.c: Include xgethostname.h.
1584 * xgethostname.h: New file, from gnulib.
1585 * Makefile.am (libfetish_a_SOURCES): Add xgethostname.h.
1587 2003-10-15 Jim Meyering <jim@meyering.net>
1589 * userspec.h: New file.
1590 * userspec.c: Include "userspec.h".
1591 * Makefile.am (libfetish_a_SOURCES): Add userspec.h.
1593 2003-10-14 Paul Eggert <eggert@twinsun.com>
1595 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1597 * human.c, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoul.c, xstrtoumax.c:
1600 2003-10-13 Paul Eggert <eggert@twinsun.com>
1602 * xalloc.h, xmalloc.c, xstrdup.c: Import latest version from gnulib.
1604 2003-09-29 Paul Eggert <eggert@twinsun.com>
1606 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1608 2003-10-02 Jim Meyering <jim@meyering.net>
1610 Don't require that the maximum length of a file name
1611 encountered in a traversal fit in an `unsigned short',
1612 and fix some portability bugs (don't depend on gcc).
1614 * fts.c: Include "fts_.h", not <fts.h>.
1615 (ALIGNBYTES) [!(__GNUC__ >= 2)]: Add a definition that works with
1616 compilers that don't have __alignof__.
1617 (MAX): Use a definition that doesn't depend on gcc.
1618 (fts_build): Make `len' and `maxlen' be of type size_t, not int.
1619 Test for overflow in a less type-dependent manner.
1620 Test HAVE_STRUCT_DIRENT_D_TYPE, rather than
1621 defined DT_DIR && defined _DIRENT_HAVE_D_TYPE.
1622 (fts_palloc): Test for overflow in a less type-dependent manner.
1623 (fts_safe_changedir): Use stat, not stat64.
1624 Use fstat, not __fxstat64(_STAT_VER.
1626 * fts_.h [FTS] (fts_pathlen): Change type from int to size_t.
1627 [FTSENT] (fts_pathlen): Change type from u_short to size_t.
1628 (fts_level): Change type from u_short to int.
1630 * Makefile.am (libfetish_a_SOURCES): Add fts.c fts_.h.
1633 2003-09-29 Paul Eggert <eggert@twinsun.com>
1635 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
1636 Fix arg typo in previous patch.
1638 2003-09-28 Jim Meyering <jim@meyering.net>
1640 * error.c: Update from gnulib.
1642 2003-09-19 Jim Meyering <jim@meyering.net>
1644 * version-etc.h: (version_etc): Rename parameter, authors,
1646 * version-etc.c: (version_etc): Likewise.
1647 Combine fprintf and following putc('\n'.
1649 * version-etc.c, version-etc.h: Revert yesterday's changes.
1650 * long-options.c, long-options.h: Likewise.
1652 2003-09-18 Jim Meyering <jim@meyering.net>
1654 This lets translators provide better translations for the
1655 `Written by ...' part of --version output.
1656 * version-etc.c: Include stdarg.h, stdlib.h, string.h, and xalloc.h.
1657 (version_etc): Make this function variadic,
1658 with a NULL-terminated list of author name strings.
1659 (version_etc_va): New function.
1660 Suggestion from Gary V. Vaughan.
1661 * version-etc.h (version_etc_va): Declare it.
1663 * long-options.c: Include stdarg.h.
1664 (parse_long_options): Make this function variadic (authors), too.
1665 Call version_etc_va, not version_etc.
1666 * long-options.h (parse_long_options): Update prototype.
1668 2003-09-16 Paul Eggert <eggert@twinsun.com>
1670 * linebuffer.c (readlinebuffer): Return NULL immediately upon
1671 input error, instead of returning NULL the next time we are called
1672 (and therefore losing track of errno).
1674 2003-09-15 Paul Eggert <eggert@twinsun.com>
1676 * getndelim2.c (getndelim2): Don't trash errno when a read
1677 fails, so that the caller gets the proper errno.
1679 * readutmp.c (read_utmp): Likewise.
1680 Check for fstat error. Close stream and free storage
1683 2003-09-14 Jim Meyering <jim@meyering.net>
1685 * argmatch.c: Update from gnulib.
1687 * Makefile.am (libfetish_a_SOURCES): Add exit.h, strndup.h,
1690 2003-09-13 Jim Meyering <jim@meyering.net>
1692 * setenv.c, strcspn.c, strdup.c, strndup.c, strnlen.c, strpbrk.c:
1693 * strstr.c, strtod.c, strtoimax.c, tempname.c, unicodeio.c, userspec.c:
1694 * vasprintf.h, xgethostname.c, xreadlink.c, xstrdup.c, xstrndup.c:
1695 * xstrndup.h, xstrtod.c, xstrtol.c, yesno.c: Update from gnulib.
1696 * strndup.h: New file, from gnulib.
1697 * exit.h: New file, from GNU gettext, via gnulib.
1699 2003-09-06 Paul Eggert <eggert@twinsun.com>
1701 * time_r.c, time_r.h: New files.
1703 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
1705 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
1706 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
1708 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
1710 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
1711 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
1714 2003-09-13 Jim Meyering <jim@meyering.net>
1716 * strtol.c: Update from gnulib.
1718 2003-09-12 Paul Eggert <eggert@twinsun.com>
1720 * argmatch.c, xgethostname.c, xmalloc.c: Include exit.h.
1721 * obstack.c [!defined _LIBC]: Likewise.
1722 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
1723 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
1724 * exitfail.c: Don't include stdlib.h; no longer needed.
1726 2003-09-12 Paul Eggert <eggert@twinsun.com>
1728 * error.c (error_tail): Assume vprintf.
1730 2003-09-09 Paul Eggert <eggert@twinsun.com>
1734 * getloadavg.c (getloadavg, main): Define via prototypes.
1736 * getopt.h (struct option.name): Assume C89, and use 'const'.
1737 (getopt, etopt_long, getopt_long_only, _getopt_internal)
1738 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
1740 * getopt.c (const): Remove macro.
1741 Include <string.h> unconditionally.
1742 (my_index): Remove; all uses changed to strchr.
1743 (strlen): Remove decl.
1744 (exchange): Remove forward decl; no longer needed.
1745 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
1746 Define with prototype.
1747 * getopt1.c (const): Remove macro.
1748 (getopt_long, getopt_long_only, main): Define with prototype.
1750 * getugroups.c: Include <string.h> unconditionally.
1752 * getusershell.c: Include <stdlib.h> unconditionally.
1753 (getusershell, setusershell, endusershell, readname, main):
1754 Define with prototypes.
1756 * group-member.c: Include group-member.h first.
1757 Include <stdlib.h> unconditionally.
1759 * hard-locale.c: Include hard-locale.h first.
1760 Include <stdlib.h>, <string.h> unconditionally.
1762 * hash.c (free, malloc): Remove decls.
1763 Include <stdlib.h> unconditionally.
1765 * human.c: Include <stdlib.h>, <string.h> unconditionally.
1766 (getenv): Do not declare.
1768 * idcache.c: Include <string.h> unconditionally.
1770 * long-options.c: Include long-options.h first, to test interface.
1771 Include <stdlib.h> unconditionally.
1773 * makepath.c: Include makepath.h first, to test interface.
1774 Include <stdlib.h> and <string.h> unconditionally.
1776 * linebuffer.c: Include <stdlib.h>.
1777 (free): Remove decl.
1779 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1780 rpl_malloc returns void *, not char *.
1781 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
1783 * md5.h: Include <limits.h> unconditionally.
1784 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1785 (__P): Remove; all uses removed.
1786 * md5.c: Include "md5.h" first.
1787 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1788 md5_buffer, md5_process_bytes, md5_process_block):
1789 Define with prototypes.
1790 * sha.h (__P): Remove all uses. (It wasn't defined??)
1791 * sha.c: Include "sha.h" first.
1792 Include <stdlib.h>, <string.h> unconditionally.
1794 * memchr.c (__ptr_t): Remove; all uses changed to void *.
1795 * memcmp.c (__ptr_t): Likewise.
1796 * memrchr.c (__ptr_t): Likewise.
1797 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1798 Include <string.h> unconditionally.
1799 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1800 * memchr.c: Include <stdlib.h> unconditionally.
1801 * memchr.c (LONG_MAX): Remove.
1802 * memrchr.c (LONG_MAX): Likewise.
1803 * memchr.c (__memchr): Define via a prototype.
1804 * memrchr.c (__memrchr): Likewise.
1805 * memcmp.c (__P): Remove, and remove all uses.
1806 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1807 Remove forward decls; no longer needed.
1808 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1809 Use types required by C89 in prototype.
1811 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1812 * savedir.c: Likewise.
1813 * mkdir.c (free): Remove decl.
1814 * rmdir.c (rmdir): Define with a prototype.
1815 * savedir.c: Include savedir.h first, to test interface.
1817 * mktime.c (STDC_HEADERS): Remove.
1818 Include <stdlib.h>, <string.h> unconditionally.
1820 * modechange.c: Include <stdlib.h> unconditionally.
1821 (malloc): Remove decl.
1823 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1824 (free): Remove decl.
1826 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1827 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1828 (This type really should be intptr_t, but that's a C99ism.)
1829 (_obstack_memcpy): Remove: all uses changed to memcpy.
1830 Include <string.h> unconditionally.
1831 (struct obstack): Assume __STDC__ for types of members
1832 chunkfun, freefun, extra_arg.
1833 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1834 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1835 obstack_begin, obstack_specify_allocation,
1836 obstack_specify_allocation_with_arg, obstack_chunkfun,
1837 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1838 Remove unprototyped decls and the macros that use them.
1839 * obstack.c (POINTER): Remove. All uses changed to void *.
1840 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1841 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1842 (defined __STDC__ && __STDC__)]:
1843 Remove nonprototyped code.
1844 Include <stdlib.h> unconditionally.
1845 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1846 _obstack_allocated_p, _obstack_free, obstack_free,
1847 _obstack_memory_used, print_and_abort):
1848 Define using prototypes.
1849 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1850 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1851 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1852 obstack_next_free, obstack_object_size, obstack_room) [0]:
1853 Remove unused, unprototyped code.
1855 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1857 * physmem.c (physmem_total, physmem_available, main): Define
1860 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1861 (main): Define with a prototype.
1863 * posixver.c (getenv): Remove decl.
1865 * putenv.c (malloc): Returns void *, not char *.
1866 Include <string.h> unconditionally.
1867 (strchr, memcpy, NULL): Do not define.
1869 * readtokens.c: Include readtokens.h first, to test interface.
1870 Include <stdlib.h>, <string.h> unconditionally.
1871 (init_tokenbuffer): Define with a prototype.
1873 * regex.c (PARAMS): Remove. All uses removed.
1874 All uses of _RE_ARGS removed, too.
1875 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1877 (bzero): Assume memset exists.
1878 (memcmp, memcpy, NULL): Remove.
1879 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1880 char, or assignments to local vars of type signed char.
1881 (init_syntax_once, PREFIX(extract_number_and_incr),
1882 PREFIX(print_partial_compiled_pattern),
1883 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1884 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1885 PREFIX(regex_grow_registers), PREFIX(regex_compile),
1886 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1887 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1888 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1889 wcs_compile_range, byte_compile_range, truncate_wchar,
1890 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1891 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1892 count_mbs_length, wcs_re_match_2_internal,
1893 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1894 PREFIX(alt_match_null_string_p),
1895 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1896 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1897 regfree, PREFIX(extract_number)): Define with prototype. Remove
1898 now-unnecessary declaration, if any.
1899 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1901 Remove now-unnecessary casts among pointer types.
1902 * regex.h (_RE_ARGS): Remove. All uses removed.
1904 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
1905 (free): Remove decl.
1907 * rpmatch.c: Include <stdlib.h> unconditionally.
1909 * save-cwd.c: Include <stdlib.h> unconditionally.
1910 * xgetcwd.c: Likewise.
1912 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
1913 (free): Remove decl.
1915 The following changes are not K&R related:
1917 * group-member.h: Include <sys/types.h>, so that this file is
1919 * makepath.h: Likewise.
1921 * getusershell.c (readname, default_index, line_size, readname):
1922 Use size_t, not int, for sizes.
1923 (readname): If the size overflows, report an error instead of
1926 2003-09-09 Derek Robert Price <derek@ximbiot.com>
1928 * getndelim2.c: Assume stdlib.h per the C89 spec.
1930 2003-09-08 Paul Eggert <eggert@twinsun.com>
1932 Assume C89 or better; remove K&R cruft.
1933 A few of these changes were first proposed by Derek Robert Price
1934 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
1936 * addext.c: Include <string.h> unconditionally.
1937 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
1938 Don't declare getenv or malloc.
1940 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
1941 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
1943 (find_stack_direction, alloca): Use prototypes.
1945 * atexit.c (atexit): Define using a prototype.
1947 * basename.c, dirname.c, stripslash.c:
1948 Include <string.h> unconditionally.
1950 * bcopy.c: Include <stddef.h>.
1951 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
1953 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
1955 * error.h (error, error_at_line, error_print_progname)
1956 [! (defined (__STDC__) && __STDC__)]: Remove decls.
1957 * error.c: Include error.h first, to check interface.
1958 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1959 (VA_START): Remove; all uses changeed to va_start.
1960 (exit, strerror): Remove decls.
1961 (error_print_progname): Prototype uncondionally.
1962 Don't include <errno.h>; no longer needed.
1963 (private_strerror): Remove.
1964 (error_tail): Always define.
1965 (error, error_at_line): Assume C89 or better; always use prototypes.
1967 * euidaccess.c (main): Define with a prototype.
1969 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
1971 * exitfail.c: Include <stdlib.h> unconditionally.
1973 * fnmatch_.h (__P): Remove. All uses changed to assume prototypes.
1974 * fnmatch.c: Include fnmatch.h first, to test interface.
1975 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
1976 (getenv): Remove decl.
1977 (fnmatch): Define using a prototype.
1978 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
1979 (FCT): Define using a prototype.
1981 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
1983 * gethostname.c: Include <stddef.h>.
1984 (gethostname): Define with prototype. Length is size_t, not int.
1986 2003-09-08 Paul Eggert <eggert@twinsun.com>
1988 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
1989 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
1991 2003-09-09 Jim Meyering <jim@meyering.net>
1993 * getversion.c: Remove unused file. Reported by Paul Eggert.
1995 2003-09-03 Paul Eggert <eggert@twinsun.com>
1997 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
1998 Bug reported by Lute Kamstra in
1999 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
2001 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
2002 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
2003 course with correspondingly smaller numbers for tomorrow and
2004 yesterday. From Tadayoshi Funaba. Originally installed into
2005 sh-utils on 1999-08-07, but the patch was mistakenly reverted by
2006 the next change to that shared file (but this time in fileutils)
2009 2003-08-18 Paul Eggert <eggert@twinsun.com>
2011 * same.c: Include <stdlib.h> and <string.h> unconditionally,
2012 as we're now assuming that part of hosted C89.
2013 (free) [!HAVE_DECL_FREE]: Remove decl; no longer needed.
2014 (same_name): Invoke pathconf on destination, not source, as
2015 that's a bit clearer even if they are the same dir.
2017 2003-08-18 Jim Meyering <jim@meyering.net>
2019 * getopt.h: Remove space before TAB.
2021 2003-08-17 Paul Eggert <eggert@twinsun.com>
2023 * same.c: Include <stdbool.h>, <limits.h>.
2024 (_POSIX_NAME_MAX): Define if not defined.
2026 (same_name): If file names are silently truncated, report
2027 that the file names are the same if they are the same after
2028 the silent truncation.
2030 2003-08-16 Paul Eggert <eggert@twinsun.com>
2033 * Makefile.am (libfetish_a_SOURCES): Remove getndelim2.c,
2034 getndelim2.h, xstrtoimax.c. Add localcharset.h.
2035 (CLEANFILES, SUFFIXES): Initialize to empty.
2036 (EXTRA_DIST): Add getndelim2.c, getndelim2.h.
2037 (install-exec-local): Use $(GLIBC21), not @GLIBC21@.
2038 Do not mkdir libdir if not glibc21.
2039 (charset.alias): @host@ -> $(host).
2040 (SUFFIXES, .sin.sed, CLEANFILES): Reorder rules
2041 to match gnulib module suggestions.
2042 * localcharset.h, readlink.c: New files, from gnulib.
2043 * asnprintf.c, asnprintf.c, asprintf.c, backupfile.h,
2044 canon-host.c, config.charset, dirname.h, euidaccess.c, exclude.c,
2045 fsusage.h, full-write.c, getloadavg.c, getndelim2.h, gettext.h,
2046 group-member.h, hard-locale.h, hash.c, hash.h, hash-pjw.c,
2047 localcharset.c, long-options.h, makepath.h, malloc.c, mbswidth.c,
2048 mbswidth.h, md5.h, memcasecmp.c, memcasecmp.h, memcoll.h,
2049 mkstemp.c, modechange.h, mountlist.h, path-concat.h, pathmax.h,
2050 physmem.h, posixtm.h, printf-args.c, printf-args.h,
2051 printf-parse.c, printf-parse.h, putenv.c, quote.h, readutmp.h,
2052 ref-add.sin, ref-del.sin, safe-read.c, savedir.h, setenv.c,
2053 setenv.h, stdbool_.h, strnlen.c, strpbrk.c, strtoimax.c,
2054 strverscmp.h, tempname.c, unicodeio.c, unicodeio.h,
2055 unistd-safer.h, unlocked-io.h, vasnprintf.c, vasnprintf.h,
2056 vasprintf.c, vasprintf.h, version-etc.h, xgethostname.c,
2057 xmemcoll.c, xstrtoimax.c, xstrtoumax.c: Sync with gnulib.
2059 2003-08-15 Paul Eggert <eggert@twinsun.com>
2061 * physmem.c: Include "physmem.h" before system includes.
2063 2003-08-10 Jim Meyering <jim@meyering.net>
2065 * utimens.c (utimens): Revert most of last change.
2066 Test HAVE_WORKING_UTIMES instead of HAVE_UTIMES.
2068 2003-08-09 Jim Meyering <jim@meyering.net>
2070 * utimens.c (utimens): Test HAVE_UTIME, not HAVE_UTIMES.
2071 Prefer utime, since it works and utimes doesn't on some systems.
2072 FIXME: Revert the above change once we have a working utimes
2073 replacement function.
2075 2003-08-06 Paul Eggert <eggert@twinsun.com>
2077 * Makefile.am (libeftish_a_SOURCES): Add utimens.c, utimens.h.
2078 * utimens.c, utimens.h: New files.
2080 2003-08-09 Jim Meyering <jim@meyering.net>
2082 * unicodeio.c (unicode_to_mb): Change to `Solaris 5.7' in comment.
2083 * putenv.c: Likewise.
2085 * fatal.c, fatal.h: Remove unused files.
2087 * Makefile.am: Use the e.g., `$(FNMATCH_H)' notation for AC_SUBST'd
2088 variable names, rather than @FNMATCH_H@.
2089 Likewise for $(ALLOCA_H).
2090 (fnmatch.h): Use `$@' in the commands, in place of the three copies
2091 of the literal target, `fnmatch.h'.
2092 (alloca.h): Likewise.
2094 2003-08-08 Paul Eggert <eggert@twinsun.com>
2096 * Makefile.am (libfetish_a_SOURCES): Remove fnmatch_.h.
2097 (lib_OBJECTS): New macro, for convenience when cutting and
2098 pasting Makefile.am templates from gnulib.
2099 (EXTRA_DIST): Remove fnmatch_loop.c.
2100 (BUILT_SOURCES): Append $(FNMATCH_H).
2101 * Makefile.am: Import the following changes from gnulib templates
2102 for alloca and fnmatch):
2103 (all-local $(lib_OBJECTS)): New dependencies.
2104 (alloca.h): Use alloca.h-t for temporary.
2105 (EXTRA_DIST): Append fnmatch_.h, fnmatch_loop.c.
2106 (fnmatch.h): New rule.
2107 (MOSTLYCLEANFILES): Add fnmatch.h, fnmatch.h-t.
2108 (DISTCLEANFILES): Remove fnmatch.h
2110 2003-08-08 Jim Meyering <jim@meyering.net>
2112 * mountlist.c (read_filesystem_list) [MOUNTED_GETFSSTAT]:
2113 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
2114 hang on OSF/1 5.1 for DIR on both local and remote file systems.
2115 Reported by (and fix confirmed by) Nelson H. F. Beebe.
2117 2003-08-07 Jim Meyering <jim@meyering.net>
2119 * regex.h (RE_SYNTAX_POSIX_AWK): Remove SPACE in SPACE-TAB sequence.
2121 2003-08-05 Paul Eggert <eggert@twinsun.com>
2123 Merge getline from gnulib.
2124 * getline.h, getline.c: Merge from gnulib.
2125 * getndelim2.h, getndelim2.c: New files, from gnulib.
2126 * getdelim2.c, getdelim2.h: Remove.
2127 * Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
2128 getdelim2.h to getndelim2.c and getndelim2.h.
2130 2003-08-04 Paul Eggert <eggert@twinsun.com>
2132 * regex.c, regex.h: Sync with gnulib.
2134 2003-08-03 Paul Eggert <eggert@twinsun.com>
2136 * stdbool_.h (_Bool): Use a #define, not a typedef.
2138 2003-07-31 Paul Eggert <eggert@twinsun.com>
2140 * bumpalloc.h: Remove.
2141 * Makefile.am (libfetish_a_SOURCES): Remove bumpalloc.h.
2143 2003-07-28 Jim Meyering <jim@meyering.net>
2145 * stdbool_.h: Renamed from stdbool.hin.
2146 * Makefile.am: Reflect renaming: stdbool.hin -> stdbool_.h.
2147 * stdbool.hin: Remove file.
2149 2003-07-28 Paul Eggert <eggert@twinsun.com>
2151 * stdbool.hin (_Bool): Make it signed char, instead of
2152 an enum type, so that it's guaranteed to promote to int.
2154 2003-07-23 Jim Meyering <jim@meyering.net>
2156 * xstrndup.h: New file.
2157 * xstrndup.c: New file, factored out of dircolors.c from coreutils.
2158 * Makefile.am (libfetish_a_SOURCES): Add xstrndup.c and xstrndup.h.
2160 2003-07-23 Jim Meyering <jim@meyering.net>
2162 * lstat.c, save-cwd.c, stat.c, utime.c, xgethostname.c: Normalize
2163 naming of Sun operating systems in comments, e.g., SunOS4 -> SunOS 4,
2164 Solaris5.9 -> Solaris 9. From Paul Eggert.
2166 2003-07-22 Paul Eggert <eggert@twinsun.com>
2168 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
2169 over-parenthesization in macros.
2171 2003-07-18 Paul Eggert <eggert@twinsun.com>
2173 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
2174 * closeout.c: Likewise. Include "closeout.h" right after config.h,
2175 to test that it can stand by itself. Include "exitfail.h".
2176 Clients should set exit_failure instead.
2177 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
2179 2003-07-18 Andreas Schwab <schwab@suse.de>
2181 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
2183 2003-07-17 Paul Eggert <eggert@twinsun.com>
2185 * xalloca.h, xmalloc.c, xmemcoll.c, xmemcoll.h:
2186 Merge with gnulib. Use a single exit_failure variable rather
2187 than a separate one for each module.
2189 2003-07-16 Jim Meyering <jim@meyering.net>
2191 * Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2192 warning from automake -Wall.
2194 2003-07-14 Jim Meyering <jim@meyering.net>
2196 * save-cwd.h: Add copyright.
2198 2003-07-13 Jim Meyering <jim@meyering.net>
2200 * xgethostname.c: Include <stdlib.h> for declaration of free.
2201 (xgethostname): Return NULL, rather than exiting, upon any
2202 non-malloc/realloc error.
2204 2003-07-12 Jim Meyering <jim@meyering.net>
2206 * Makefile.am (BUILT_SOURCES): Use `BUILT_SOURCES += $(STDBOOL_H)'
2207 rather than `all-local: $(STDBOOL_H)'. The latter didn't force
2208 creation of stdbool.h before most other targets.
2209 Likewise for $(ALLOCA_H).
2211 Don't emit diagnostics. Let callers do that.
2212 * save-cwd.c: Don't include "error.h".
2213 (save_cwd): Don't call error. Ensure that errno is valid
2214 when returning nonzero.
2216 * obstack.h: Update from gnulib.
2218 * makepath.c (make_path): Enclose diagnostic in _(...).
2220 2003-07-10 Jim Meyering <jim@meyering.net>
2222 * userspec.c: Include "posixver.h".
2223 (parse_user_spec): Accept `.' as a separator only
2224 in pre-POSIX-200112 mode.
2226 * Makefile.am (libfetish_a_SOURCES): Add these:
2227 printf-args.h, printf-parse.h, vasprintf.h, vasnprintf.h.
2229 Now that a program (`who') uses asprintf, we need all of these:
2230 * asnprintf.c, asprintf.c, printf-args.c, printf-args.h, printf-parse.c:
2231 * printf-parse.h, vasnprintf.c, vasnprintf.h, vasprintf.c, vasprintf.h:
2232 New files, from gnulib.
2234 * alloca_.h, getpass.c, memrchr.c, obstack.h, posixver.c,
2235 strftime.c, strnlen.c, strverscmp.c: Switch from LGPL to GPL.
2237 2003-07-09 Jim Meyering <jim@meyering.net>
2239 * mktime.c: Update from gnulib.
2240 FIXME: but still need to adjust m4/mktime.c so that this fixed
2241 version is used when needed.
2243 Fix the bug that would make `du /' omit the `/' on the last line.
2244 E.g., `du --exclude '[^/]*' -x /' would print only "4\t\n" for me.
2245 * ftw.c (ftw_dir): Don't clobber the leading `/'.
2246 Reported by Chris Lesniewski as http://bugs.debian.org/200542.
2248 2003-07-04 Jim Meyering <jim@meyering.net>
2251 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
2252 having it depend on HAVE_SYS_TYPES_H.
2254 2003-06-18 Jim Meyering <jim@meyering.net>
2256 * inttostr.h (PARAMS): Remove. All uses removed.
2258 Merge in change from gnulib.
2259 * makepath.c: Remove block of alloca-related code in favor
2260 of an unconditional `#include <alloca.h>'.
2262 * xalloc.h: Include <stddef.h>.
2263 Remove unnecessary parentheses.
2264 Use `1990-2000' notation in Copyright line until Emacs'
2265 copyright-update function learns how to handle a comma-separated
2266 list of years that spans a line boundary.
2268 * Makefile.am (libfetish_a_SOURCES): Add getdelim2.c and getdelim2.h.
2270 * getline.c (getdelim2): Move this function into its own file.
2271 * getdelim2.c: Extracted from getline.c.
2273 * linebuffer.c, linebuffer.h: Update from gnulib.
2275 * getdelim2.c, getdelim2.h: New files.
2276 * getstr.c, getstr.h: Remove files.
2278 * same.h: Update from gnulib.
2279 * xstrtol.h: Update from gnulib.
2281 2003-06-17 Paul Eggert <eggert@twinsun.com>
2283 Assume C89, so PARAMS isn't needed.
2284 * backupfile.h (PARAMS): Remove. All uses removed.
2285 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
2286 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
2287 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
2288 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
2289 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
2290 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
2291 xstrtol.h: Likewise.
2292 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h, same.h,
2293 * strverscmp.h: Do not include config.h; no longer needed.
2294 Anyway, config.h should always be included before any other file.
2296 2003-06-17 Jim Meyering <jim@meyering.net>
2298 * getline.c: Update from gnulib.
2300 Merge in changes from gnulib.
2301 * hash.c: Include <stdbool.h> unconditionally.
2303 (CHAR_BIT): Don't define.
2305 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2307 * acl.c: Include <sys/types.h> before <sys/stat.h>.
2308 Required on Ultrix 4.3.
2310 2003-05-20 Derek Price <derek@ximbiot.com>
2312 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
2314 2003-06-10 Jim Meyering <jim@meyering.net>
2316 * getdate.y: Also accept dates of the form May-23-2003.
2317 Suggestion from Karl Berry.
2319 2003-06-09 Jim Meyering <jim@meyering.net>
2321 * gettimeofday.c: Also undefine gmtime.
2322 (rpl_gmtime): New function. Suggestion from Paul Eggert.
2324 2003-06-08 Jim Meyering <jim@meyering.net>
2326 * getline.h: Update from gnulib.
2328 Clean up, as part of merge with emacs version of strftime.c.
2329 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
2330 Remove function, now that we can rely on a working tzset function.
2331 [!_LIBC]: Ensure that the required autoconf test has been run.
2332 * gettimeofday.c: Also undef tzset.
2333 (rpl_tzset): New function, for use by new macro, gl_FUNC_TZSET_CLOBBER.
2335 2003-06-07 Jim Meyering <jim@meyering.net>
2337 * readtokens.h: Add copyright notice.
2339 Remove definition and uses of __P.
2341 * readtokens.c: Put `Free Software Foundation, Inc.' in place of
2342 my name in the copyright comment.
2343 (init_tokenbuffer): Remove unnecessary parentheses around malloc.
2346 * getdate.y: Include alloca.h unconditionally.
2347 * xmemcoll.h: Include <stddef.h>.
2349 * Makefile.am (MOSTLYCLEANFILES): Add alloca.h and alloca.ht.
2350 (MOSTLYCLEANFILES): Add stdbool.ht.
2352 * human.c: Include <stdio.h>, once again, for declaration of sprintf.
2355 * tempname.c: Include <stddef.h> unconditionally.
2356 Include <inttypes.h> as an alternative to <stdint.h>.
2357 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
2358 * xstrtol.h: Likewise.
2359 * xstrtoimax.c: Likewise.
2360 * xstrtoumax.c: Likewise.
2363 * strcasecmp.c: Include <stddef.h>, not <sys/types.h>.
2364 * savedir.c: Include <stddef.h>.
2365 (NULL): Don't define, since <stddef.h> does that.
2367 2003-06-06 Jim Meyering <jim@meyering.net>
2370 * rpmatch.c: Include <limits.h> without checking for HAVE_LIMITS_H.
2371 Include <stddefs.h> unconditionally.
2372 (NULL): Don't define, since <stddef.h> does that.
2373 * rename.c: #undef rename before defining rpl_rename.
2374 [HAVE_CONFIG_H]: Guard inclusion of config.h.
2375 * putenv.c: Include <stddef.h> rather than <sys/types.h>,
2376 as we merely need size_t.
2377 * realloc.c: Likewise.
2378 * quote.c: Don't include <stddef.h> or <sys/types.h>; not needed.
2379 * modechange.c: Include <stddef.h>.
2380 (NULL): Don't define, since <stddef.h> does that.
2381 * memcoll.h: Include <stddef.h>, to get size_t.
2382 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
2383 our interface, instead of including <sys/types.h>
2384 (memcoll): Fall back on a simple algorithm using
2385 memcmp if strcoll doesn't work.
2386 * memcasecmp.h: Include <stddef.h>.
2387 * memcasecmp.c: Don't include <sys/types.h>.
2390 * alloca_.h: New file.
2391 * Makefile.am (EXTRA_DIST): Add alloca_.h.
2392 (all-local $(lib_OBJECTS)): Depend on $(ALLOCA_H).
2393 (alloca.h): New rule.
2395 * addext.c: Update from gnulib.
2396 * backupfile.c: Likewise.
2397 * config.charset: Likewise.
2398 * dirname.h: Likewise.
2399 * fsusage.c: Likewise.
2400 * userspec.c: Likewise.
2401 * xreadlink.c: Likewise.
2402 * xstrtol.c: Likewise.
2403 * __fpending.h: Likewise.
2405 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
2406 (memcpy): Remove definition.
2408 * posixtm.c: Include <stdbool.h> unconditionally.
2410 2003-06-05 Jim Meyering <jim@meyering.net>
2413 * mktime.c: Assume freestanding C89 or better.
2414 (HAVE_LIMITS_H): Remove. Assume it's 1.
2415 (__P): Remove; not used.
2416 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
2417 (mktime, not_equal_tm, print_tm, check_result,
2418 main): Use prototypes. Use const * where appropriate.
2419 (main): Fix typo in testing code that uncovered by above changes.
2420 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
2422 2003-06-04 Paul Eggert <eggert@twinsun.com>
2424 Merge human.c etc. from gnulib.
2425 * exclude.c, human.c, human.h: Merge from gnulib.
2426 * cycle-check.c, cycle-check.h, src/system.h:
2427 Include <stdbool.h> unconditionally.
2429 2003-06-02 Jim Meyering <jim@meyering.net>
2431 * stdbool.hin: New file. From gnulib.
2432 * Makefile.am (MOSTLYCLEANFILES): Initialize.
2433 (stdbool.h): New rule.
2434 (all-local $(lib_OBJECTS)): Depend on $(STDBOOL_H)
2435 (MOSTLYCLEANFILES): Add stdbool.h.
2436 (EXTRA_DIST): Add stdbool.h.
2438 2003-05-30 Jim Meyering <jim@meyering.net>
2440 * addext.c: Update from gnulib.
2441 * mktime.c: Likewise.
2443 2003-05-29 Jim Meyering <jim@meyering.net>
2445 Make the %r format directive honor any locale setting.
2446 * strftime.c: (my_strftime) [!defined _NL_CURRENT && HAVE_STRFTIME]:
2447 Use underlying_strftime for %r.
2449 2003-05-15 Jim Meyering <jim@meyering.net>
2451 * getopt.h: Remove a space before a TAB.
2453 2003-05-13 Jim Meyering <jim@meyering.net>
2455 * setenv.c (setenv): Don't apply cast to argument of free.
2456 * putenv.c (rpl_putenv): Likewise.
2457 * alloca.c (alloca): Likewise.
2459 2003-05-12 Jim Meyering <jim@meyering.net>
2461 * ftw.c (ftw_startup): Always call free_cwd after restore_cwd.
2462 Reported by Matti Aarnio as
2463 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90563.
2464 Forwarded by Tim Waugh.
2466 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
2467 the space-padded-by-default conversion specifiers, %e, %k, %l.
2469 2003-05-07 Paul Eggert <eggert@twinsun.com>
2471 * xnanosleep.c (timespec_subtract): Don't modify the 2nd arg.
2472 Work even if X-Y overflows when subtracting. Make explicit the
2473 assumption that tv_nsec must be in range.
2474 (clock_get_realtime): Remove. All callers changed to invoke gettime,
2476 (xnanosleep): Check for gettime failure every time.
2478 2003-05-06 Jim Meyering <jim@meyering.net>
2480 * xnanosleep.c (clock_get_realtime): Use gettime.c's gettime function,
2481 rather than an inferior, open-coded version that would fail on
2482 AIX systems due to clock_gettime failing with errno == ENOSYS.
2483 Reported by Jérôme Zago.
2485 2003-05-05 Jim Meyering <jim@meyering.net>
2487 Avoid array overrun.
2488 * ftw.c (nftw_arr): Update to reflect complete list of members.
2490 Reported by Olatunji Oluwabukunmi Ruwase.
2492 Make it less likely that the above can happen again.
2493 * ftw.c (struct dummy): Ensure that at least the number of
2494 initializers matches the number of members in the corresponding enum.
2495 * ftw_.h (enum Ftw_option): Name this previously-anonymous enum.
2496 (enum Ftw_option) [FTW_N_MEMBERS]: New member.
2498 2003-05-04 Jim Meyering <jim@meyering.net>
2500 * setenv.c (__set_errno, LOCK, UNLOCK): Define.
2501 (unsetenv): Update from GNU libc.
2502 Ifdef-out this function, since the only caller
2503 is putenv.c and that file now has its own copy.
2505 This avoids a core dump on systems without GNU putenv,
2506 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
2507 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
2508 (unsetenv): New static function, from GNU libc.
2509 (rpl_putenv): Use it.
2511 2003-05-02 Jim Meyering <jim@meyering.net>
2513 * canonicalize.c (canonicalize_file_name) [!HAVE_RESOLVEPATH]:
2514 A memory-allocation error could result in heap corruption. Fix it
2515 by also updating `dest' when rpath may be changed by xrealloc.
2517 2003-04-15 Jim Meyering <jim@meyering.net>
2519 * getloadavg.c: Remove (or replace-with-TAB(s) to retain alignment)
2520 each sequence of spaces before a TAB character.
2521 * md5.c, getopt.c, getopt.h, obstack.h, strftime.c: Likewise.
2523 2003-04-11 Jim Meyering <jim@meyering.net>
2525 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
2527 * canonicalize.c, exclude.c, getgroups.c, getusershell.c:
2528 * group-member.c, idcache.c, mountlist.c, readtokens.c, readutmp.c:
2529 * bumpalloc.h: Remove anachronistic casts of xmalloc, xrealloc,
2530 and xcalloc return values.
2532 * xalloc.h (PARAMS): Remove definitions and uses.
2533 (XMALLOC, XCALLOC, XREALLOC): Remove unnecessary casts.
2535 * xmalloc.c: Remove use of PARAMS.
2537 2003-04-10 Jim Meyering <jim@meyering.net>
2539 * canonicalize.c (canonicalize_file_name) [HAVE_RESOLVEPATH]: Remove
2540 stray semicolon that caused `readlink --canonical RELATIVE_NAME' to
2541 fail on e.g., Solaris systems. Reported by Bruce Korb.
2542 (canonicalize_file_name): Return NULL immediately if resolvepath fails.
2543 Otherwise, `readlink --canonical /no-such-file' would exhaust
2544 virtual memory on some systems (e.g. Solaris).
2545 (canonicalize_file_name): Always free `extra_buf' before returning.
2546 (canonicalize_file_name): NUL-terminate the result.
2548 2003-04-05 Jim Meyering <jim@meyering.net>
2550 * Makefile.am (DEFS): Use += notation rather than `DEFS = ... @DEFS@'.
2551 Use $(VAR) rather than @VAR@, now that we can rely on automake to
2552 emit a definition for each substituted variable.
2554 2003-03-26 Richard Dawe <rich@phekda.freeserve.co.uk>
2556 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2557 Add test-cases for DOS filenames. Declare program_name.
2558 (main): Set up program_name.
2560 2003-03-22 Jim Meyering <jim@meyering.net>
2562 * strftime.c (widen): Cast alloca return value to proper type.
2565 (NEW_PATTERN): Cast alloca return value to proper type.
2566 Otherwise, it wouldn't compile with at least /bin/cc on
2567 ymp-cray-unicos9.0.2.X.
2568 Combine two mostly-identical uses of alloca into one.
2569 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
2571 2003-03-19 Jim Meyering <jim@meyering.net>
2573 DJGPP doesn't have S_ISLNK, so provide a replacement.
2574 * ftw.c (S_IFMT): Define, if necessary.
2575 [STAT_MACROS_BROKEN]: Undefine S_ISLNK.
2576 (S_ISLNK): Define, if necessary.
2577 Based on a patch from Rich Dawe.
2579 * exclude.h (PARAMS): Remove definition and uses.
2580 * exclude.c: Remove uses of `PARAMS'.
2582 * fnmatch_.h: Don't define __const.
2583 (fnmatch): Use const, not __const in prototype.
2586 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
2588 * fchdir-stub.c: New file: trivial stub for fchdir.
2590 2003-03-18 Jim Meyering <jim@meyering.net>
2592 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2594 Use mntctl's return value to drive the entry-processing loop, since
2595 we can't rely on the value of the vmt_length member in the last
2596 entry. On some systems doing so could result in exhausting
2597 virtual memory. Based in part on a patch from Mike Jetzer.
2599 * quote.c (quote_n): Fix typo in comment.
2601 2003-03-17 Jim Meyering <jim@meyering.net>
2603 * raise.c (raise): Rename from rpl_raise.
2604 Without that change, systems lacking raise (SunOS 4) would not be
2605 able to link programs using raise. Reported by Volker Borchert.
2607 * ftw.c (FTW_STAT): Rename from `STAT', to avoid conflict
2608 with STAT definition from <sys/dir.h> on AIX 5.1.
2609 Suggestion from Mike Jetzer and Petter Reinholdtsen.
2611 * fchown-stub.c (fchown): Put function type on its own line.
2612 * readlink-stub.c (readlink): Likewise.
2613 * lstat-stub.c (lstat): Likewise.
2615 2003-03-14 Jim Meyering <jim@meyering.net>
2617 * Makefile.am (AUTOMAKE_OPTIONS): Remove definition --
2618 before it pointed to ../src/ansi2knr. Some of these files
2619 have required an ANSI (c89) compiler for a year or two.
2620 (libfetish_a_SOURCES): Remove unused files: c-stack.c, c-stack.h.
2622 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
2624 * stat.c: Include "xalloc.h".
2626 2003-03-13 Paul Eggert <eggert@twinsun.com>
2628 Merge changes from Bison.
2629 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2630 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2631 when compiling Bison 1.875's `bitset bset = obstack_alloc
2632 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
2634 2003-01-30 Richard Dawe <rich@phekda.freeserve.co.uk>
2636 * fchown-stub.c: New file: trivial stub for fchown.
2637 * lstat-stub.c: New file: trivial stub for lstat.
2638 * readlink-stub.c: New file: trivial stub for readlink.
2640 2003-03-09 Paul Eggert <eggert@twinsun.com>
2642 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2643 Reported by Bruce Becker; see:
2644 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2646 2003-03-03 Paul Eggert <eggert@twinsun.com>
2647 Bruno Haible <bruno@clisp.org>
2649 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2650 Reported by John Hughes, see
2651 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2653 2003-03-09 Jim Meyering <jim@meyering.net>
2655 * ftw.c: Include "save-cwd.h".
2656 (ftw_startup): Avoid use of getcwd, if possible.
2657 Instead, use fopen/fchdir via save_cwd/restore_cwd.
2659 2003-03-08 Jim Meyering <jim@meyering.net>
2661 * xnanosleep.c: Don't use `defined' in a #define directive.
2663 2003-03-07 Jim Meyering <jim@meyering.net>
2665 * Makefile.am (libfetish_a_SOURCES): Remove mmap-stack.h.
2667 * mmap-stack.c, mmap-stack.h: Remove files.
2669 * getcwd.c: #undef getcwd only after *all* included header files.
2670 Declare getcwd unconditionally. The problem was that same.h
2671 included config.h, and that defined getcwd to rpl_getcwd a second
2672 time (after the original #undef), and led to the rpl_getcwd
2673 function calling itself endlessly. This was the cause of at least
2674 the `du' test failures on IRIX 6.5, reported by Nelson Beebe.
2676 * same.h (same_name): Remove unnecessary inclusion of config.h.
2677 It also happened to lead to infinite recursion in getcwd.c.
2678 (PARAMS): Remove definition and use.
2680 2003-03-06 Jim Meyering <jim@meyering.net>
2682 * ftw.c (ftw_startup): Declare `func' parameter to be of type
2683 NFTW_FUNC_T, not void* which may be smaller on 64-bit systems.
2684 Remove now-unnecessary cast.
2685 (FTW_NAME): Cast func argument to type `NFTW_FUNC_T'.
2687 2003-03-05 Jim Meyering <jim@meyering.net>
2689 * physmem.c (ARRAY_SIZE): Define it.
2691 2003-03-04 Jim Meyering <jim@meyering.net>
2693 * makepath.c (CLEANUP_CWD): Call error here, now that restore_cwd
2696 * save-cwd.h (restore_cwd): Update prototype.
2697 * save-cwd.c (restore_cwd): Remove two parameters.
2698 Simplify. Don't call error upon failure. Let callers do that.
2699 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
2700 when auditing is enabled. But don't bother updating the #if.
2702 * xgetcwd.c (xgetcwd): Improve comment.
2704 * getcwd.c: New file.
2706 2003-02-28 Jim Meyering <jim@meyering.net>
2708 * ftw.c (ftw_startup): Return -1 if alloca fails.
2710 2003-02-28 Jim Meyering <jim@meyering.net>
2712 * fts.c (fts_children): If opening `.' fails, set the fts_child
2713 member to NULL before returning. From NetBSD.
2715 * fts.c (fts_children): If fchdir fails, close file descriptor
2716 before returning. From NetBSD.
2718 2003-02-27 Jim Meyering <jim@meyering.net>
2720 * physmem.c (physmem_total, physmem_available): Add comments.
2723 * physmem.c: Merge in portability changes from gcc/libiberty
2724 to support AIX, Tru64, and Windows. See the ChangeLog there
2725 for credits and details. Thanks to Kaveh Ghazi for helping
2726 to keep these files in sync.
2728 2003-02-24 Jim Meyering <jim@meyering.net>
2730 * fts_.h [__USE_FILE_OFFSET64]: Remove #error directive.
2732 (fts_open): Initialize local, tmp, to pacify gcc.
2734 * fts_.h [struct FTS] (fts_dir_signatures): New, opaque member.
2735 * fts.c: Include <search.h>.
2736 (struct known_object): Define.
2737 (object_compare, add_object, find_object): New functions, like
2739 (fts_open): Initialize new member.
2740 (fts_close): Free memory allocated for new member.
2741 (fts_stat): Detect a cycle in O(logN) time per directory processed.
2743 * fts.c [HAVE_CONFIG_H]: Include <config.h>.
2744 Conditionalize inclusion of <sys/param.h>.
2745 Conditionalize inclusion of <include/sys/stat.h> vs <sys/stat.h>.
2746 Include autoconf-recommended block of dirent/NAMELEN-related
2747 definitions and includes. Use NAMLEN throughout, rather than
2749 [_LIBC] (close, closedir, fchdir, open, opendir): Define.
2750 [_LIBC] (readdir, tdestroy, tfind, tsearch): Define.
2751 Remove `__' prefix from all uses of the above. This will help
2752 to merge *BSD changes.
2753 [!_LIBC] (internal_function): Define.
2754 [! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define lstat.
2755 (__set_errno): Define if not already defined.
2757 * fts.c: (fts_open): If fts_alloc returns NULL, don't dereference it.
2758 (fts_read): If fts_safe_changedir fails because it is not
2759 able to chdir into a subdirectory, then inform the caller.
2761 * fts.c, fts_.h: New files, directly from glibc.
2763 2003-02-23 Jim Meyering <jim@meyering.net>
2765 * fts_.h (struct _ftsent) [fts_level]: Change type from short to int,
2766 so it can handle a root-relative file name longer than 32K bytes.
2767 [fts_pathlen, fts_namelen]: Rearrange members to decrease size of
2768 this struct from 84 to 80 bytes.
2770 2003-02-21 Jim Meyering <jim@meyering.net>
2772 * mmap-stack.h: Undefine HAVE_MMAP_STACK, thus disabling
2773 this code on all systems.
2775 Merge in some changes from GNU libc.
2776 * md5.h (md5_uintptr): Define.
2778 * ftw.c: Include <sys/types.h> before <dirent.h>.
2779 This is required for Apple Darwin 6.3 (MacOS 10.2.3).
2780 Patch by Nelson Beebe.
2782 2003-02-19 Jim Meyering <jim@meyering.net>
2784 * md5.c: Merge in some clean-up and optimization changes from glibc.
2785 * sha.c: Apply those same changes here, too.
2787 2003-02-18 Jim Meyering <jim@meyering.net>
2789 * md5.c (md5_stream) [BLOCKSIZE]: Move definition to top of file.
2790 Ensure that it is a multiple of 64.
2791 Rearrange loop exit tests so as to avoid performing an
2792 additional fread after encountering an error or EOF.
2793 * sha.c (sha_stream): Likewise.
2794 Reported by Michael Bacarella.
2796 * Makefile.am (CLEANFILES): Remove ftw.h and search.h.
2797 (DISTCLEANFILES): Add them here.
2800 * sha.c (sha_stream): Rearrange loop exit tests so as to avoid
2801 performing an additional fread after encountering an error or EOF.
2803 2003-02-17 Jim Meyering <jim@meyering.net>
2805 * mmap-stack.h (RUN_WITH_BIG_STACK_4): Define.
2807 * physmem.c: Undo most of last change.
2808 Use sysmp instead, since it provides a cleaner interface.
2811 2003-02-16 Jim Meyering <jim@meyering.net>
2813 * Makefile.am (libfetish_a_SOURCES): Add mmap-stack.h.
2815 * mmap-stack.c (MAP_ANONYMOUS): Use MAP_ANON, if possible.
2816 Initialize `fd' to -1, so Solaris' mmap works with MAP_ANON.
2818 2003-02-15 Jim Meyering <jim@meyering.net>
2820 * mmap-stack.c, mmap-stack.h: New files.
2821 Let the caller run a function with a larger (mmap'd) stack.
2823 Add Irix6 support to physmem.c.
2824 * physmem.c (irix_sysget): New function.
2825 (IRIX_SYSGET_TOTAL, IRIX_SYSGET_AVAILABLE): New macros.
2826 (physmem_total, physmem_available): Use them.
2827 (main) [DEBUG]: New function.
2829 2003-02-11 Jim Meyering <jim@meyering.net>
2831 * Makefile.am (libfetish_a_SOURCES): Add euidaccess.h.
2832 * euidaccess.c: Include "euidaccess.h".
2833 * euidaccess.h: New file.
2835 2003-02-08 Jim Meyering <jim@meyering.net>
2837 * ftw.c (ftw_startup): Don't shadow outer declaration of save_err.
2838 Merge inconsequential changes from libc.
2840 * ftw.c (ftw_startup): When using FTW_CHDIR, always remember
2841 the current directory, not just when DIR contains a slash.
2842 Reported by Manoj Srivastava via Michael Stone as Debian bug #180228.
2844 2003-02-07 Jim Meyering <jim@meyering.net>
2846 Merge inconsequential changes from libc.
2847 * ftw.c: Include limits.h earlier.
2848 Move PATH_MAX definition `down' a little; add comment.
2849 Rename local, saved_errno to save_err.
2851 2003-02-06 Jim Meyering <jim@meyering.net>
2853 Support for pruning.
2854 * ftw_.h (FTW_DPRE) [enum]: New member and definition.
2855 (struct FTW) [skip]: New member.
2857 * search_.h (__restrict): Define to `restrict' or to nothing.
2859 * fsusage.c: Remove declaration of statfs.
2860 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
2861 Reported by Nelson Beebe.
2863 2003-02-05 Jim Meyering <jim@meyering.net>
2865 Fix a heap-corruption bug that affected Solaris systems.
2866 * ftw.c: Include <limits.h>.
2867 (PATH_MAX): Define to 1024, if not already defined.
2868 (process_entry): Allocate enough space to hold the resulting
2869 file name. Don't presume that 2*dirbufsize is enough.
2870 (ftw_startup): Always use PATH_MAX to compute buffer size, now that
2871 it is guaranteed to be defined.
2872 Nelson Beebe reported that du would sometimes segfault on Solaris.
2874 * ftw.c (process_entry): When using FTW_DEPTH, call `func', the
2875 user-supplied callback, once for the current directory before calling
2876 ftw_dir, in case that part of the hierarchy should be pruned.
2877 `func' does that by setting `data->skip'.
2878 (ftw_startup): Likewise.
2880 2003-02-02 Jim Meyering <jim@meyering.net>
2882 * ftw.c (lstat) [!_LIBC && !LSTAT_FOLLOWS_SLASHED_SYMLINK]:
2883 Define to rpl_lstat.
2885 2003-01-25 Jim Meyering <jim@meyering.net>
2887 * ftw.c (ISSLASH, FILESYSTEM_PREFIX_LEN) [_LIBC]: Define.
2888 (base_name): New function.
2889 (ftw_startup): Don't strip trailing slashes.
2890 Use base_name to find the offset of the basename.
2892 2003-01-25 Jim Meyering <jim@meyering.net>
2894 * ftw.c (object_compare): Compare inode numbers before device numbers.
2895 The former is much more likely to differ for any two given file objects.
2897 2003-01-23 Jim Meyering <jim@meyering.net>
2899 * tsearch.c [HAVE_CONFIG_H]: Include <config.h>.
2900 Add autoconf-recommended block of alloca-related code.
2901 Cast each use of alloca to the required type, (node**).
2903 * ftw.c: Add autoconf-recommended block of alloca-related code.
2904 [!_LIBC] (__getcwd): Define to xgetcwd and declare xgetcwd.
2906 2003-01-22 Jim Meyering <jim@meyering.net>
2908 * ftw.c (find_object): Don't use c99-style struct initializer.
2910 * ftw_.h: Change all uses of __const to const.
2911 * search_.h: Likewise.
2913 * Makefile.am (CLEANFILES): Add generated files: ftw.h search.h.
2915 * ftw.c (process_entry): Handle FTW_DCHP.
2916 (ftw_dir): Handle FTW_DCH.
2918 * ftw_.h [!_LIBC && !__USE_XOPEN_EXTENDED]: Define __USE_XOPEN_EXTENDED
2919 and FTW_H_STANDALONE.
2920 [anon enum] (FTW_DCH, FTW_DCHP): New members.
2921 (FTW_DCH, FTW_DCHP): Define.
2923 * ftw.c: Include autoconf-recommended block of dirent/NAMELEN
2924 related definitions and includes. Use NAMELEN throughout,
2925 rather than _D_EXACT_NAMLEN.
2926 [_LIBC]: Define NAMELEN to _D_EXACT_NAMLEN.
2927 (stpcpy): Declare, if necessary.
2928 (mempcpy): Define, if necessary.
2929 [!_LIBC] (__stpcpy, __mempcpy): Define.
2930 [!_LIBC] (LXSTAT, XSTAT): Define.
2932 2003-01-21 Jim Meyering <jim@meyering.net>
2934 * tsearch.c: New file, from GNU libc.
2935 [! weak_alias]: Define __-prefixed names to publicized ones.
2936 [! defined _LIBC] (weak_alias, internal_function): Define-away.
2937 [defined weak_alias]: Guard each use of weak_alias.
2939 2003-01-20 Jim Meyering <jim@meyering.net>
2941 * canonicalize.c: Include "path-concat.h".
2943 * search_.h: New file, from GNU libc.
2945 * Makefile.am (libfetish_a_SOURCES): Use ftw_.h here, too.
2946 (libfetish_a_SOURCES): Add search_.h.
2947 * ftw_.h: Rename from ftw.h.
2949 * obstack.h (obstack_object_size): Declare temporary, __o,
2950 to be const, in order to avoid warnings.
2951 (obstack_room): Likewise.
2952 (obstack_empty_p): Likewise.
2954 Merge in changes from GNU libc
2955 * error.c: Eliminate many `#ifdef USE_IN_LIBIO' conditionals.
2957 2003-01-19 Ulrich Drepper <drepper@redhat.com>
2960 * strftime.c (my_strftime): Handle very large width
2961 specifications for numeric values correctly. Improve checks for
2964 2003-01-19 Jim Meyering <jim@meyering.net>
2966 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2967 (nl_get_alt_digit) [! defined my_strftime]: Define.
2968 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2969 _nl_get_alt_digit and _nl_get_walt_digit.
2971 * strftime.c (my_strftime): Merge in locale-related changes from libc.
2972 These changes have no effect outside of _LIBC.
2974 2003-01-14 Jim Meyering <jim@meyering.net>
2976 * same.c (same_name): Declare *_basename locals to be `const'.
2977 Consolidate declarations and initializations of *_base* locals.
2979 2003-01-11 Bruno Haible <bruno@clisp.org>
2981 * same.c (same_name): Reorder tests so as to avoid calling stat()
2982 when a string comparison is sufficient.
2984 2003-01-11 Bruno Haible <bruno@clisp.org>
2986 * readtokens.c (readtoken): Cast character to 'unsigned char', not
2989 2003-01-14 Jim Meyering <jim@meyering.net>
2991 * ftw.c: Merge in Ulrich's and my changes from libc.
2993 2003-01-12 Jim Meyering <jim@meyering.net>
2995 * ftw.c (ftw_startup): Rename local-shadowing local to pacify gcc.
2996 Also work on systems that have `struct direct', using autoconf's
3000 * ftw.h, ftw.c: New files, from glibc/io.
3002 * Makefile.am (libfetish_a_SOURCES): Add ftw.h.
3004 2003-01-11 Jim Meyering <jim@meyering.net>
3006 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
3008 * canonicalize.c: Don't test HAVE_ERRNO_H. It's not necessary.
3009 Don't test HAVE_STDDEF_H. It's not necessary.
3010 Use definition of PTR_INT_TYPE from obstack.h.
3012 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3014 * canonicalize.c: New file.
3015 The readlink-based implementation imported from GNU C Library.
3016 The resolveip-based implementation imported from src/df.c (show_point).
3017 * canonicalize.h: New file.
3018 * Makefile.am (libfetish_a_SOURCES): Add canonicalize.h.
3020 2003-01-10 Jim Meyering <jim@meyering.net>
3022 * save-cwd.h: Remove uses of PARAMS.
3024 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3026 * xgetcwd.h: New file.
3027 * Makefile.am (libfetish_a_SOURCES): Add xgetcwd.h.
3028 * save-cwd.c: Include "xgetcwd.h".
3029 * xgetcwd.c: Likewise.
3031 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3033 * getgroups.c: Don't declare functions declared by xalloc.h.
3034 Include "xalloc.h" instead.
3035 * group-member.c: Likewise.
3036 * idcache.c: Likewise.
3037 * readutmp.c: Likewise.
3039 2003-01-08 Jim Meyering <jim@meyering.net>
3041 * full-write.c: Undefine and define-away `const' after inclusion
3042 of errno.h, not before. Suggestion from Bruno Haible.
3044 2003-01-06 Jim Meyering <jim@meyering.net>
3046 * full-write.c: Rework so that it may serve to define full_read, too.
3047 * full-read.c: Simply #define FULL_READ and include full-write.c.
3049 * Makefile.am (libfetish_a_SOURCES): Add full-read.c and full-read.h.
3050 * full-read.c, full-read.h: New files.
3054 2002-12-10 Paul Eggert <eggert@twinsun.com>
3055 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
3056 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
3057 Choose values that are less likely to collide with system fnmatch
3059 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
3060 defined (e.g., a pure POSIX system).
3061 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
3062 instead of FNM_FILE_NAME, for compatibility with pure POSIX systems.
3066 * utime.c (utime_null): Use SAFE_READ_ERROR.
3067 (utime_null): No need to call ftruncate if the file was nonempty.
3068 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
3069 * canon-host.c (strdup): Remove unused declaration.
3070 * fsusage.c: Include full_read.h.
3071 (get_fs_usage): Use full_read instead of safe_read.
3072 Patches by Bruno Haible.
3074 2003-01-04 Jim Meyering <jim@meyering.net>
3076 * version-etc.c: Update copyright date.
3078 2002-12-31 Jim Meyering <meyering@lucent.com>
3080 * dev-ino.h: New file.
3081 * cycle-check.c: New file.
3082 * cycle-check.h: New file.
3083 * Makefile.am (libfetish_a_SOURCES): Add cycle-check.c, cycle-check.h,
3086 2002-12-21 Jim Meyering <jim@meyering.net>
3088 * stime.c: Remove file (for real, this time).
3090 2002-12-15 Jim Meyering <jim@meyering.net>
3092 * strftime.h: New file, for declaration of nstrftime.
3093 * Makefile.am (libfetish_a_SOURCES): Add strftime.h.
3095 2002-12-09 Jim Meyering <jim@meyering.net>
3097 * unlocked-io.h: Sync from gnulib.
3099 2002-12-06 Jim Meyering <jim@meyering.net>
3101 * unlocked-io.h: New file, but with proper copyright notice and
3102 attribution. Note: this is *not* the same as the file in gnulib.
3103 This uses #if HAVE_FUNC_UNLOCKED for each `FUNC', rather than
3104 HAVE_DECL_FUNC_UNLOCKED. This usage is consistent with the autoconf
3105 macro in ../m4/jm-glibc-io.m4. Modulo comments, this file still
3106 contains exactly what was generated by gen-uio.
3108 2002-12-04 Paul Eggert <eggert@twinsun.com>
3110 Do not generate unlocked-io.h automatically, since it's easier to
3111 maintain it by hand.
3114 * Makefile.am: Add copyright notice.
3115 (libfetish_a_SOURCES): Add unlocked-io.h.
3116 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
3117 (DISTCLEANFILES, io_functions): Remove macros.
3118 (EXTRA_DIST): Remove gen_uio.
3119 (unlocked-io.h): Remove rule.
3121 2002-12-05 Paul Eggert <eggert@twinsun.com>
3123 * alloca.c [defined emacs]: Include "lisp.h".
3124 (xalloc_die) [defined emacs]: New macro.
3125 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
3126 [! defined emacs]: Include <xalloc.h>.
3127 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
3128 (pointer): Typedef to POINTER_TYPE *.
3129 (malloc): Remove decl; we now always use xmalloc.
3130 (alloca): Use old-style definition, since Emacs needs this.
3131 Check for arithmetic overflow when computing combined size.
3133 2002-12-04 Jim Meyering <jim@meyering.net>
3135 Reflect the fact that stat.c and lstat.c are no longer generated.
3136 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
3137 (DISTCLEANFILES): Likewise.
3138 (EXTRA_DIST): Likewise.
3139 (all_local): Don't depend on stat.c or lstat.c.
3140 (stat.c, lstat.c): Remove rules.
3141 (EXTRA_DIST): Remove xstat.in.
3143 * xstat.in: Remove file. Contents moved into stat.c.
3144 * stat.c: Rework so that it may serve to define rpl_lstat, too.
3145 * lstat.c: Simply #define LSTAT and include stat.c.
3147 * safe-read.c: Rework so that it may serve to define safe_write, too.
3148 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
3150 2002-12-03 Jim Meyering <jim@meyering.net>
3152 * safe-read.h: Update from gnulib (add comments, include stddef.h).
3154 2002-12-02 Jim Meyering <jim@meyering.net>
3156 * safe-read.c (EINTR): Define.
3157 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
3159 2002-12-01 Jim Meyering <jim@meyering.net>
3161 * safe-read.c: Merge from gnulib.
3162 (safe_read): Also exit the loop when read returns zero.
3163 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
3165 * Makefile.am (libfetish_a_SOURCES): Add safe-write.c and safe-write.h.
3167 * strtoll.c: Update from gnulib (trivial changes).
3168 * strdup.c: Likewise.
3169 * strpbrk.c: Likewise.
3170 * strstr.c: Likewise.
3171 * tempname.c: Likewise.
3172 * obstack.c: Likewise.
3173 * getopt.c: Likewise.
3174 * getopt1.c: Likewise.
3175 * getopt.h: Likewise.
3176 * quote.h: Update from gnulib: add Copyright comment.
3177 * quote.c: Likewise.
3179 2002-11-28 Jim Meyering <jim@meyering.net>
3181 * mktime.c: Merge from gnulib/libc, for a slightly uglier solution.
3183 Merge some more, in preparation for merge back into libc.
3184 * error.c (_): Define only if not already defined.
3185 Move definition to follow all #include directives.
3186 Include unlocked-io.h only if !_LIBC.
3188 Merge in changes from libc.
3189 * error.c [_LIBC]: Include <libio/libioP.h>.
3190 [USE_IN_LIBIO]: Include <libio/iolibio.h>
3191 (fflush): Tweak definition to use INTUSE.
3194 2002-11-23 Jim Meyering <jim@meyering.net>
3196 From gnulib, by Bruno Haible
3197 * closeout.c: Include gettext.h instead of <libintl.h>.
3198 * makepath.c: Likewise.
3199 * rpmatch.c: Likewise.
3200 * userspec.c: Likewise.
3201 * version-etc.c: Likewise.
3202 * xmemcoll.c: Likewise.
3203 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3205 * mbswidth.h: Update from gnulib.
3206 * mbswidth.c: Likewise.
3207 * localcharset.c: Likewise.
3208 * config.charset: Likewise.
3209 * unicodeio.c: Likewise.
3211 2002-11-22 Paul Eggert <eggert@twinsun.com>
3213 * quotearg.h: Allow multiple inclusion by surrounding with
3214 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
3215 so that we can be included first.
3216 (PARAMS): Remove; we now assume C89 or later. All uses removed.
3217 * quotearg.c: Include quotearg.h immediately after config.h.
3218 No need to include stddef.h or sys/types.h any more.
3219 Surround local include files with "", not "<>".
3220 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
3221 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
3222 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
3223 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
3224 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
3225 (ISPRINT): Remove; no longer needed now that we assume C89.
3227 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
3230 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
3231 quotearg_char): Use SIZE_MAX rather than
3232 (size_t) -1 when we are talking about "infinity".
3234 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
3236 2002-11-22 Jim Meyering <jim@meyering.net>
3239 * strstr.c: Don't include <sys/types.h>. It's unnecessary.
3241 2002-11-21 Bruno Haible <bruno@clisp.org>
3243 Remove case insensitive option matching.
3244 * argmatch.h (argcasematch): Remove declaration.
3245 (ARGCASEMATCH): Remove macro.
3246 (__xargmatch_internal): Remove case_sensitive argument.
3247 (XARGMATCH): Update.
3248 (XARGCASEMATCH): Remove macro.
3249 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
3250 case_sensitive argument.
3251 (argcasematch): Remove function.
3252 (__xargmatch_internal): Remove case_sensitive argument.
3253 (main): Use XARGMATCH instead of XARGCASEMATCH.
3255 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3257 2002-11-21 Bruno Haible <bruno@clisp.org>
3259 * xmalloc.c: Change compile-time error message. Add comment about
3260 required autoconf version.
3261 * xmalloc.c: Include gettext.h instead of <libintl.h>.
3262 (textdomain): Remove definition.
3264 2002-11-21 Jim Meyering <jim@meyering.net>
3266 * strdup.c (strdup): Merge in changes from gnulib; mainly to
3267 use memcpy rather than strcpy.
3269 * strcspn.c: Update from gnulib.
3271 * sig2str.c (str2signum): Use unsigned, not size_t, for type of index.
3273 * quotearg.c: Use `"'s when including quotearg.h and xalloc.h,
3274 not the `<...>' notation.
3275 Include <errno.h> and declare errno if necessary.
3277 * README: Update from gnulib.
3279 2002-11-20 Paul Eggert <eggert@twinsun.com>
3281 Merge argmatch cleanups from Bison. Assume C89.
3283 * argmatch.c: Include config.h here, not in argmatch.h.
3284 Include stdlib.h, for EXIT_FAILURE.
3285 Always include <string.h>, since we assume C89.
3286 (EXIT_FAILURE): Remove pre-C89 bug workaround.
3287 * argmatch.h: Do not include <config.h> or <sys/types.h>.
3288 Include <stddef.h> instead, since it's all we need for size_t.
3289 (PARAMS): Remove. All uses removed.
3290 (ARRAY_CARDINALITY): Do not bother to #undef.
3291 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
3292 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3293 Remove unnecessary parentheses.
3294 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3295 Insert necessary parentheses.
3296 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
3297 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
3299 2002-11-19 Jim Meyering <jim@meyering.net>
3301 Be careful not to clobber errno.
3302 * quotearg.c (quotearg_buffer_restyled): If mbrtowc returns
3303 `(size_t) -1' (at which point it would also set errno to EILSEQ),
3304 then restore errno to its previous value.
3305 Reported by Phillip Jones via Tim Waugh as
3306 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76334.
3308 Avoid a link-time failure on some Linux systems.
3309 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
3310 (__mon_yday): Declare with the STATIC attribute.
3311 (__mktime_internal): Likewise.
3312 Based on a report from Greg Schafer.
3314 2002-11-14 Jim Meyering <jim@meyering.net>
3316 * long-options.c: Don't include libintl.h, and don't define `_' --
3320 2002-11-10 Jim Meyering <jim@meyering.net>
3322 * raise.c: New file.
3324 2002-11-08 Paul Eggert <eggert@twinsun.com>
3326 * human.c (human_readable): Revamp to avoid warning about unused
3327 variable 'amt'. Unfortunately this means using some gotos.
3329 2002-11-08 Jim Meyering <jim@meyering.net>
3331 * human.c (human_readable): Avoid warnings from gcc -Wshadow.
3333 2002-11-06 Jim Meyering <jim@meyering.net>
3335 * Makefile.am (EXTRA_DIST): Add inttostr.h.
3337 2002-10-07 Paul Eggert <eggert@twinsun.com>
3339 * Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
3341 (EXTRA_DIST): Add inttostr.c.
3342 * inttostr.c, inttostr.h, imaxtostr.c, offtostr.c, umaxtostr.c:
3343 New files, taken from GNU tar.
3345 * human.c, human.h: Rewrite to support locale-specific
3346 notations like thousands separators.
3347 Specify what includer of include.h must include beforehand.
3348 (human_group_digits, human_suppress_point_zero, human_autoscale,
3349 human_base_1024, human_SI, human_B): New enum values.
3350 (human_readable): Rename from human_readable_inexact; put the
3351 options before the sizes. All uses changed. The old human_readable
3352 function has been removed; use inttostr.h instead.
3353 (human_options): Renamed from human_block_size, with new signature
3354 that allows block sizes up to UINTMAX_MAX. All callers changed.
3356 2002-10-13 Jim Meyering <jim@meyering.net>
3358 * xnanosleep.c (initialized): Remove declaration now that it's unused.
3360 2002-10-12 Paul Eggert <eggert@twinsun.com>
3362 * xnanosleep.c: There's no need to futz with the rounding mode,
3363 since the code should work properly even in the default rounding mode.
3364 (<fenv.h>): Do not include.
3365 (#pragma STDC FENV_ACCESS ON): Remove.
3366 (xnanosleep): Don't futz with rounding state.
3368 2002-10-06 Jim Meyering <jim@meyering.net>
3370 * safe-read.c (safe_read): Change type of function
3371 from ssize_t to size_t.
3372 * safe-read.h: Update prototype.
3373 (SAFE_READ_ERROR): Define.
3375 2002-09-28 Jim Meyering <jim@meyering.net>
3377 * makepath.c (make_path): Restore umask *before* creating the final
3380 2002-09-25 Paul Eggert <eggert@twinsun.com>
3382 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
3383 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
3384 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
3385 int. Work more efficiently if X is the same width as uintmax_t.
3386 Do not compare X to -1, to avoid bogus compiler warning.
3387 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
3388 Don't assume that f_frsize and f_bsize are the same type.
3390 2002-09-25 Jim Meyering <jim@meyering.net>
3392 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
3394 * safe-read.c (safe_read): Make comment more precise:
3395 upon error, it returns -1.
3397 2002-09-22 Jim Meyering <jim@meyering.net>
3399 * makepath.c (make_path): Minor reformatting.
3401 2002-09-14 Paul Eggert <eggert@twinsun.com>
3403 * xnanosleep (xnanosleep): Return -1 on failure, not 1,
3404 for consistency with nanosleep. Check errno after nanosleep
3407 2002-09-11 Jim Meyering <jim@meyering.net>
3409 * xnanosleep.c, xnanosleep.h: New files, factored out of sleep.c.
3410 * Makefile.am (libfetish_a_SOURCES): Add them.
3412 2002-09-04 Jim Meyering <jim@meyering.net>
3414 * addext.c (addext): Add a cast to avoid gcc's warning about
3415 `comparison between signed and unsigned'.
3417 * sig2str.c (str2signum, sig2str): Declare loop index variables to be
3418 of type size_t so that they match type of upper bound, thus avoiding
3419 warning about `comparison between signed and unsigned'.
3421 2002-08-31 Jim Meyering <jim@meyering.net>
3423 * mktime.c: Update from GNU libc.
3424 * obstack.c: Likewise.
3425 * getopt.c: Likewise.
3426 * getopt1.c: Likewise.
3428 2002-08-05 Paul Eggert <eggert@twinsun.com>
3430 Fix some minor time-related bugs with POSIX time arguments.
3431 Some valid time stamps were being rejected (notably -1, and
3432 time stamps before 1900 on 64-bit hosts). And some invalid
3433 time stamps were being accepted, e.g. September 31.
3435 * posixtm.h (posixtime): Return bool instead of time_t, so
3436 that we can return (time_t) -1 successfully.
3437 * posixtm.c: Likewise.
3438 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3439 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3440 (t): Remove static var.
3441 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3442 of static var. All uses changed.
3443 (year): Do not reject years before 1900; they can occur with
3445 (posix_time_parse): Do not check for out-of-range components;
3446 that is now the caller's responsibility, since our checks were
3447 only approximations.
3448 (posixtime): Use mktime to check for out-of-range components,
3449 since it knows them exactly.
3450 If mktime returns (time_t) -1, check whether an error actually occurred
3451 by invoking localtime on -1.
3452 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3453 posixtime failures better.
3454 Improve the test data (in comments only).
3456 2002-07-27 Jim Meyering <jim@meyering.net>
3458 * readutmp.h: If we have both utmpx.h and utmp.h, and there exists
3459 the utmp.ut_exit member, but not the utmpx.ut_exit member, then
3460 undefine HAVE_UTMPX_H. For AIX 4.3.3. Doing all this in cpp is
3461 a big kludge; someday we'll put the brains in an autoconf macro.
3462 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3464 2002-07-20 Jim Meyering <jim@meyering.net>
3466 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
3467 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
3469 * gettext.h: Upgrade to gettext-0.11.3.
3471 2002-07-13 Bruno Haible <bruno@clisp.org>
3473 * xstat.in: Include <string.h>.
3474 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
3477 2002-07-09 Jim Meyering <jim@meyering.net>
3479 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
3480 ones. At least on GNU/Linux systems, `auto' means something else.
3483 2002-07-01 Jim Meyering <jim@meyering.net>
3485 * c-stack.c: Include sys/time.h.
3486 From Volker Borchert.
3488 2002-06-11 Paul Eggert <eggert@twinsun.com>
3490 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
3491 New macro. Use it uniformly instead of
3492 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
3493 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
3494 reported by Vin Shelton.
3496 2002-06-22 Jim Meyering <jim@meyering.net>
3498 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
3499 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
3501 2002-06-22 Paul Eggert <eggert@twinsun.com>
3503 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
3504 Do not assume SA_SIGINFO behavior.
3505 Bug reported by Jim Meyering on NetBSD 1.5.2.
3507 2002-06-22 Jim Meyering <jim@meyering.net>
3509 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
3511 * exitfail.c, exitfail.h: Likewise.
3512 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
3514 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
3516 (EXTRA_DIST): Add fnmatch_loop.c.
3517 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
3519 * fnmatch_loop.c: New file, from diffutils-2.8.2.
3520 * fnmatch.c: Update from diffutils-2.8.2.
3521 * fnmatch_.h: New file. From diffutils-2.8.2.
3522 * fnmatch.h: Remove file.
3524 2002-06-18 Paul Eggert <eggert@twinsun.com>
3526 * file-type.h: Report an error if neither S_ISREG nor
3527 S_IFREG is defined, instead of using a test specific to glibc
3528 2.2. This should be safe, since POSIX requires S_ISREG and
3529 Unix Version 7 had S_IFREG. We don't need to check for
3530 <sys/types.h> since we don't use any symbols that it defines.
3532 2002-06-15 Jim Meyering <jim@meyering.net>
3534 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
3535 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
3536 have been included before this file.
3538 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
3540 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
3541 so that each temporary file name is unique and valid in the first
3542 8 characters, for operation under DOS.
3544 2002-06-15 Jim Meyering <jim@meyering.net>
3546 Work even with DJGPP 2.03, which lacks support for symlinks.
3548 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
3550 * lchown.c (S_ISLNK): Likewise.
3552 2002-06-14 Jim Meyering <jim@meyering.net>
3554 * file-type.h: Use the version from diffutils-2.8.2.
3555 * file-type.c: Likewise.
3557 2002-05-27 Jim Meyering <jim@meyering.net>
3559 Fix a problem seen only on nonconforming systems whereby ls.c's
3560 use of localtime, and then of gettimeofday would cause trouble:
3561 the localtime call used to initialize rpl_gettimeofday's save
3562 mechanism would clobber ls's current local time information so
3563 that in any long listing the first file would always be listed
3564 with date 1970-01-01. Analysis by Volker Borchert.
3566 * gettimeofday.c (localtime): Undefine.
3567 (rpl_localtime): New function.
3569 2002-05-22 Jim Meyering <jim@meyering.net>
3571 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
3572 * file-type.h: New file.
3573 * file-type.c (file_type): New file/function. Extracted from diffutils.
3575 2002-04-29 Paul Eggert <eggert@twinsun.com>
3577 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
3579 2002-04-28 Paul Eggert <eggert@twinsun.com>
3581 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
3582 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
3583 of 127, since 64 is the largest conceivable number for ancient
3585 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
3587 2002-04-28 Jim Meyering <jim@meyering.net>
3589 * sig2str.c (WTERMSIG): Remove definition (unused).
3591 2002-04-28 Paul Eggert <eggert@twinsun.com>
3593 * sig2str.h, sig2str.c: New files.
3594 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
3596 2002-04-24 Jim Meyering <jim@meyering.net>
3598 * gettext.h: New file, from Gettext.
3599 * Makefile.am (INCLUDES): Remove -I../intl.
3600 (libfetish_a_SOURCES): Add gettext.h.
3602 2002-04-16 Jim Meyering <jim@meyering.net>
3604 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
3605 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
3606 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
3608 2002-04-12 Jim Meyering <jim@meyering.net>
3610 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
3612 2002-03-10 Jim Meyering <jim@meyering.net>
3614 * makepath.c (make_path): Remove a comma from a diagnostic.
3615 Suggestion from Santiago Vila.
3617 2002-03-08 Jim Meyering <jim@meyering.net>
3619 * rename.c: Mention that this wrapper is needed also on
3620 mips-dec-ultrix4.4 systems.
3622 2002-03-02 Jim Meyering <jim@meyering.net>
3624 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
3625 not HAVE_CLOCK_SETTIME.
3627 2002-02-27 Paul Eggert <eggert@twinsun.com>
3629 * nanosleep.h: Rename to....
3630 * timespec.h: New name for nanosleep.h. All uses changed.
3632 * gettime.c: New file.
3633 * settime.c: New file.
3636 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
3637 timespec.h. Remove nanosleep.h.
3639 2002-02-25 Paul Eggert <eggert@twinsun.com>
3641 * acl.c, acl.h: New files.
3642 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
3644 2002-02-24 Jim Meyering <jim@meyering.net>
3646 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
3647 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
3648 cause trouble. Reported by Nelson Beebe.
3650 2002-02-23 Paul Eggert <eggert@twinsun.com>
3652 * path-concat.c (xpath_concat): Reorder code to pacify
3653 compilers that don't know that xalloc_die never returns.
3655 2002-02-20 Jim Meyering <jim@meyering.net>
3657 * getdate.c: Regenerate using bison-1.33.
3659 2002-02-15 Paul Eggert <eggert@twinsun.com>
3661 * posixver.c, posixver.h: New files.
3662 * Makefile.am (libfetish_a_SOURCES): Add them.
3664 2002-02-02 Paul Eggert <eggert@twinsun.com>
3665 Bruno Haible <bruno@clisp.org>
3667 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
3668 (fwrite_success_callback): New declaration.
3669 * unicodeio.c (unicode_to_mb): New function, extracted from
3670 print_unicode_char. Call failure callback instead of error.
3671 (fwrite_success_callback): New function.
3672 (exit_failure_callback): New function.
3673 (fallback_failure_callback): New function.
3674 (print_unicode_char): Call unicode_to_mb.
3676 2002-01-26 Jim Meyering <jim@meyering.net>
3678 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
3680 2002-01-22 Jim Meyering <jim@meyering.net>
3682 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
3683 Otherwise, some versions of automake would omit the rule that makes
3684 Makefile from Makefile.in.
3686 2001-01-21 Paul Eggert <eggert@twinsun.com>
3688 * xmemcoll.h, xmemcoll.c: New files.
3689 * Makefile.am (libfetish_a_SOURCES): Add them.
3690 * memcoll.c: Include errno.h, and declare errno if not defined.
3691 (memcoll): Set errno to zero if there is no error.
3693 * quotearg.c (quotearg_buffer_restyled):
3694 Fix bug with quoting buffers containing NUL when backslashing escapes.
3695 This bug was exposed by the other changes in this patch.
3696 (quotearg_n_options): New arg ARGSIZE.
3697 All callers changed.
3698 (quoting_options_from_style): New function.
3699 (quotearg_n_style): Use it.
3700 (quotearg_n_style_mem): New function.
3702 * quotearg.h (quotearg_n_style_mem): New function.
3704 2002-01-16 Jim Meyering <jim@meyering.net>
3706 * getdate.y: Add three semicolons, each just before a closing brace.
3707 Bison (as of version 1.31) no longer papers over that mistake.
3709 2002-02-14 Paul Eggert <eggert@twinsun.com>
3711 * backupfile.c (ISDIGIT): Comment fix.
3712 * getdate.y (ISDIGIT): Likewise.
3713 * posixtm.c (ISDIGIT, year): Likewise.
3714 * strverscmp.c (ISDIGIT): Likewise.
3715 * userspec.c (ISDIGIT): Likewise.
3717 2002-01-05 Jim Meyering <jim@meyering.net>
3719 * version-etc.c (version_etc_copyright): Update copyright year.
3721 2001-01-19 Paul Eggert <eggert@twinsun.com>
3723 * closeout.c (close_stdout_status): If ferror (stdout), do
3724 not silently exit merely because the output buffer happens to
3725 have nothing pending.
3727 2001-12-18 Paul Eggert <eggert@twinsun.com>
3729 See the big note in ../ChangeLog.
3730 * human.c (suffixes): Prefer K to k for 1024.
3731 (generate_suffix_backwards): New function.
3732 (human_readable_inexact): Use it.
3733 * xstrtol.c (__xstrtol): If there is no number but there
3734 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
3735 Accept 'K' as well as 'k'.
3737 2001-12-15 Jim Meyering <jim@meyering.net>
3739 * regex.h (__restrict_arr): Update from libc.
3741 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3742 as `remote' if the name starts with `//'. Suggested by Michael Stone.
3745 2001-12-10 Jim Meyering <jim@meyering.net>
3747 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3748 Instead, include "xalloc.h".
3749 (initbuffer): Don't cast xmalloc return value to char*.
3750 (readline): Reword comment.
3751 Don't cast xrealloc return value to char*
3754 2001-12-09 Jim Meyering <jim@meyering.net>
3756 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3757 `signed and unsigned type in conditional expression'.
3758 * posixtm.c (posix_time_parse): Likewise.
3760 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3762 * readtokens.c (readtoken): Declare an index to be of type unsigned
3763 to avoid a pedantic warning.
3765 * getstr.c: Don't include assert.h.
3766 (getstr): Remove warning-evoking assertions.
3767 Return -1 if offset parameter is out of bounds.
3768 Change the type of a local from int to size_t.
3770 * strftime.c (my_strftime_localtime_r): Include this function
3771 definition in the `#if ! HAVE_TM_GMTOFF' block.
3773 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3774 Include xalloc.h instead.
3776 2001-12-02 Jim Meyering <jim@meyering.net>
3778 * tempname.c: Don't declare getenv, thus reverting the change of
3779 2001-11-18. It's no longer necessary, now that stdlib.h is always
3782 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3783 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
3785 2001-11-30 Akim Demaille <akim@epita.fr>
3787 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3788 before being defined.
3790 2001-11-27 Paul Eggert <eggert@twinsun.com>
3792 * quotearg.h (quotearg_n, quotearg_n_style):
3793 First arg is int, not unsigned.
3794 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3795 (SIZE_MAX, UINT_MAX): New macros.
3796 (quotearg_n_options): Abort if N is negative.
3797 Avoid overflow check on hosts where size_t is 64 bits and int
3798 is 32 bits, as overflow is impossible there.
3799 Fix off-by-one typo that caused unnecessary reallocation.
3801 2001-11-27 Jim Meyering <jim@meyering.net>
3803 * tempname.c: Merge with version from libc.
3804 * regex.c: Likewise.
3806 * tempname.c: Include stdlib.h unconditionally. On some old systems
3807 for which STDC_HEADERS is 0, it was not included, resulting in a
3808 warning about an integer-to-pointer conversion problem with getenv.
3809 Reported by Volker Borchert.
3811 2001-11-26 Jim Meyering <jim@meyering.net>
3813 * gtod.h: Remove file.
3814 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3815 * gettimeofday.c: Don't include gtod.h.
3816 (GTOD_init): Remove function.
3817 (rpl_gettimeofday): Do its job here instead, rather than aborting.
3818 Suggestion from Volker Borchert.
3820 2001-11-23 Jim Meyering <jim@meyering.net>
3822 * hash.h (struct hash_table): Don't define here. Merely declare it.
3823 * hash.c (struct hash_table): Define it here instead.
3825 2001-11-22 Jim Meyering <jim@meyering.net>
3827 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3829 2001-11-18 Paul Eggert <eggert@twinsun.com>
3831 * tempname.c (TMP_MAX): Remove; no longer needed.
3832 (TEMPORARIES): New macro.
3833 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
3834 removes an artificial limitation (e.g. HP-UX 10.20, where
3837 2001-11-18 Jim Meyering <jim@meyering.net>
3839 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3842 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3843 files will be created before anything else.
3845 2001-11-17 Jim Meyering <jim@meyering.net>
3847 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3848 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3849 rather than group writable. Patch by Juan F. Codagnone.
3851 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3852 Instead, include "xalloc.h".
3854 * mountlist.c: Include unlocked-io.h after all system headers.
3855 Remove explicit declarations of xmalloc, xrealloc,
3856 and xstrdup. Instead, include "xalloc.h".
3858 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3859 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3860 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3862 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3863 Reported by Padraig Brady.
3865 * mkstemp.c: #undef mkstemp.
3867 (rpl_mkstemp): Rename from mkstemp.
3870 2001-11-16 Jim Meyering <jim@meyering.net>
3872 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3873 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3874 determine the amount of total physical memory, use pstat_getstatic.
3875 HPUX-11 doesn't define _SC_PHYS_PAGES.
3876 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3877 If sysconf couldn't be used to determine the amount of available
3878 physical memory, use both pstat_getstatic and pstat_getdynamic.
3879 Based on a patch from Bob Proulx.
3881 2001-11-05 Jim Meyering <jim@meyering.net>
3883 * xstat.in (slash_aware_lstat): Correct a misleading comment.
3885 2001-11-03 Jim Meyering <jim@meyering.net>
3887 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
3888 in argmatch_to_argument call.
3890 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
3893 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
3894 e.g., a fault due to an attempt to free a NULL pointer.
3896 2001-11-01 Jim Meyering <jim@meyering.net>
3898 * dirfd.c, dirfd.h: New files.
3899 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
3901 * hash.c (hash_print) [TESTING]: Clean up.
3903 2001-10-22 Paul Eggert <eggert@twinsun.com>
3905 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
3906 to avoid a warning if -Wall.
3908 2001-10-21 Paul Eggert <eggert@twinsun.com>
3910 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
3912 2001-10-21 Jim Meyering <jim@meyering.net>
3914 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
3915 this code would end up calling gettext even in packages built
3917 * getopt.c (_): Likewise.
3918 * regex.c (_): Likewise.
3920 2001-10-20 Paul Eggert <eggert@twinsun.com>
3922 * error.c (strerror_r): Do not declare unless !_LIBC.
3923 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
3924 Use strerror_r that is only a macro, even if it is not a function.
3925 (strerror): Check for HAVE_DECL_STRERROR before declaring.
3926 (private_strerror): Use prototypes, not old-style function definition.
3927 (print_errno_message): New function.
3928 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
3930 (error_tail, error, error_at_line): Use it.
3932 2001-10-11 Jim Meyering <jim@meyering.net>
3934 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3935 and quote_n (1, ... to avoid clobbering a buffer.
3937 2001-10-05 Jim Meyering <jim@meyering.net>
3939 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
3940 * hash-pjw.c: New file (factored out of fileutils' remove.c).
3941 * hash-pjw.h: New file.
3943 2001-09-30 Jim Meyering <jim@meyering.net>
3945 * mountlist.c [MOUNTED_GETFSSTAT]:
3946 Include <sys/ucred.h>, for Apple Darwin.
3947 Include sys/mount.h and sys/fs_types.h only if available.
3949 (read_filesystem_list): Use FS_TYPE.
3951 2001-09-29 Paul Eggert <eggert@twinsun.com>
3953 * exclude.c (excluded_filename): 0 -> false, since it's
3956 2001-09-28 Paul Eggert <eggert@twinsun.com>
3958 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
3959 #defines strtoimax. Also treat the other strto* functions
3962 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
3963 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
3964 (strtoimax, strtoumax): Do not declare if already defined as a macro.
3966 2001-09-26 Jim Meyering <jim@meyering.net>
3968 Most macros in unlocked-io.h had the wrong number of arguments.
3969 * gen-uio: New script.
3970 (USE_UNLOCKED_IO): Define to 1 if not already defined.
3971 * unlocked-io.hin: Remove file.
3972 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
3973 rather than trying to embed it here.
3974 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
3975 Reported by Padraig Brady.
3977 2001-09-25 Volker Borchert <bt@teknon.de>
3979 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
3981 2001-09-23 Jim Meyering <jim@meyering.net>
3983 * mountlist.c: Remove useless parentheses in #if directives.
3984 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
3985 the deprecated MOUNTED symbol is no longer defined in mntent.h.
3987 2001-09-22 Jim Meyering <jim@meyering.net>
3989 * localcharset.c: Update from latest gettext.
3990 * config.charset: Likewise.
3992 2001-09-20 Jim Meyering <jim@meyering.net>
3994 * xstrtol.c (strtoimax): Guard declaration with
3995 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3996 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3997 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3998 (strtoumax): Likewise, for completeness (it wasn't necessary).
4000 2001-09-06 Paul Eggert <eggert@twinsun.com>
4002 * strtoimax.c (HAVE_LONG_LONG):
4003 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
4004 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
4005 to work around bug in IBM C compiler.
4007 2001-09-16 Jim Meyering <jim@meyering.net>
4009 * mkdir.c: New file.
4011 2001-09-04 Paul Eggert <eggert@twinsun.com>
4013 * xgetcwd.c: Revert some of the previous change; intead,
4014 fix the HAVE_GETCWD_NULL code to behave more like the
4015 !HAVE_GETCWD_NULL code used to.
4018 (xgetcwd): Do not return NULL when memory is exhausted; instead,
4021 2001-09-04 Paul Eggert <eggert@twinsun.com>
4023 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
4024 Use ssize_t, not int, to store result of readlink.
4025 Check for ssize_t overflow as well as size_t overflow,
4026 as POSIX says the result of readlink is implementation-defined
4027 when ssize_t overflows.
4028 Remove unnecessary cast to char*.
4029 Use free+malloc instead of realloc, as the storage doesn't need
4030 to be preserved and it's clearer and can be more efficient that way.
4031 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
4032 * xreadlink.h (xreadlink): Update prototype.
4034 2001-09-03 Paul Eggert <eggert@twinsun.com>
4036 * exclude.c (fnmatch_no_wildcards): Fix confusion between
4037 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
4038 spotted by Jim Meyering.
4040 2001-09-03 Jim Meyering <jim@meyering.net>
4042 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
4044 2001-09-03 Paul Eggert <eggert@twinsun.com>
4046 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
4047 like the HAVE_GETCWD_NULL code.
4048 Include pathmax.h if not HAVE_GETCWD.
4049 Do not include xalloc.h.
4050 (INITIAL_BUFFER_SIZE): New symbol.
4051 Do not use xmalloc / xrealloc, since the caller is responsible for
4052 handling errors. Preserve errno around `free' during failure.
4053 Do not overrun buffer when using getwd.
4055 2001-09-03 Paul Eggert <eggert@twinsun.com>
4057 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
4058 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
4060 2001-09-02 Jim Meyering <jim@meyering.net>
4062 * error.c: Update from GNU libc.
4064 2001-09-01 Jim Meyering <jim@meyering.net>
4066 * xreadlink.c: New file.
4067 * xreadlink.h: New file.
4068 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
4070 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
4071 doesn't conflict with sparc Solaris 7's definition in
4072 /usr/include/sys/int_types.h.
4074 * exclude.c: Use `""', not `<>' to #include non-system header files.
4075 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
4076 and strncasecmp as r-values. Unixware didn't have declarations.
4078 2001-08-31 Jim Meyering <jim@meyering.net>
4080 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
4081 Use an initial, malloc'd, buffer of length 128 rather than
4082 a statically allocated one of length 1024.
4084 2001-08-30 Paul Eggert <eggert@twinsun.com>
4086 * xgetcwd.c: Don't include pathmax.h.
4087 Include stdlib.h and unistd.h if available.
4089 (xmalloc, xstrdup, free): Remove decls.
4090 (xgetcwd): Don't assume sizes fit in unsigned.
4091 Check for overflow when computing sizes.
4092 Simplify reallocation code.
4094 2001-08-28 Paul Eggert <eggert@twinsun.com>
4096 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
4098 * strtoimax.c: Renamed from strtoxmax.c, removing the
4101 Also, make the following further changes to make this file's
4102 configuration more similar to that of strtol.c:
4103 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
4104 (strtoumax, uintmax_t, strtoull, strtol): Remove.
4105 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
4106 (strtoimax): Renamed from strtoumax. All uses of unsigned values
4107 changed to signed values.
4109 And make the following changes as well:
4110 Fix copyright notice, as 1999 was missing.
4111 (verify): New macro.
4112 (strtoimax): Check sizes at compile-time, not run-time.
4113 Prefer strtol to strtoll if both work.
4114 (main): Remove; it was not that useful and was a pain to maintain.
4116 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
4118 2001-08-30 Paul Eggert <eggert@twinsun.com>
4120 * savedir.c (savedir): Remove size parameter, as POSIX says that
4121 a directory's st_size can have an arbitrary value, so the old
4122 usage could waste an arbitrary amount of memory. All uses
4124 * savedir.h: Update prototype.
4126 2001-08-30 Paul Eggert <eggert@twinsun.com>
4128 * xstrtol.c (strtoimax): New decl.
4130 2001-08-28 Paul Eggert <eggert@twinsun.com>
4132 * xstrtol.h: Add copyright notice.
4133 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
4134 LONGINT_INVALID_SUFFIX_CHAR.
4136 2001-08-30 Paul Eggert <eggert@twinsun.com>
4138 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
4141 2001-08-30 Paul Eggert <eggert@twinsun.com>
4143 * hash.c: Remove '2001' from copyright notice.
4145 2001-08-30 Paul Eggert <eggert@twinsun.com>
4147 * full-write.h: New file.
4148 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
4149 * full-write.c: Correct credits, as cccp.c no longer
4150 exists and anyway it was so heavily changed from the old cccp
4151 code as to be unrecognizable. Include full-write.h.
4152 (full_write) Return size_t, with short writes meaning failure.
4153 All callers changed. This fixes a bug with large buffers
4155 * utime.c: Include full-write.h.
4157 2001-08-30 Paul Eggert <eggert@twinsun.com>
4159 Merge 'exclude' changes from tar 1.13.22.
4160 This fixes one or two unlikely storage allocation overflow bugs,
4161 but doesn't change user-visible behavior otherwise.
4163 2001-08-30 Paul Eggert <eggert@twinsun.com>
4165 * exclude.c (bool): Declare, perhaps by including stdbool.h.
4166 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
4167 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
4168 Include if available.
4169 (<xalloc.h>): Include
4170 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
4171 (verify): New macro. Use it to verify that EXCLUDE macros do not
4172 collide with FNM macros.
4173 (struct patopts): New struct.
4174 (struct exclude): Use it, as exclude patterns now come with options.
4175 (new_exclude): Support above changes.
4176 (new_exclude, add_exclude_file):
4177 Initial size must now be a power of two to simplify overflow checking.
4178 (free_exclude, fnmatch_no_wildcards): New function.
4179 (excluded_filename): No longer requires options arg, as the options
4180 are determined by add_exclude. Now returns bool, not int.
4181 (excluded_filename, add_exclude):
4182 Add support for the fancy new exclusion options.
4183 (add_exclude, add_exclude_file): Now takes int options arg.
4184 Check for arithmetic overflow when computing sizes.
4185 (add_exclude_file): xrealloc might modify errno, so don't
4186 realloc until after errno might be used.
4188 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
4190 (free_exclude): New decl.
4191 (add_exclude, add_exclude_file): Now takes int options arg.
4192 (excluded_filename): No longer requires options arg, as the options
4193 are determined by add_exclude. Now returns bool, not int.
4195 2001-08-30 Paul Eggert <eggert@twinsun.com>
4197 * alloca.c (alloca): Arg is of type size_t, not unsigned.
4199 2001-08-27 Jim Meyering <jim@meyering.net>
4201 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
4203 * version-etc.c (N_): Remove definition.
4204 Revert most of last change.
4205 Instead, simply don't mark the `Copyright...' string for translation.
4206 Based on advice from Paul Eggert.
4208 * strtoxmax.c: Tweak comment.
4210 2001-08-26 Jim Meyering <jim@meyering.net>
4212 * version-etc.c (version_etc_copyright_fmt): Replace literal year
4213 of copyright with `%s' so translators don't get an untranslated
4215 (COPYRIGHT_YEAR): Define.
4216 (version_etc): Use fprintf rather than fputs.
4217 Suggestion from Ulrich Drepper.
4219 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4221 * strtoll.c: New file, from GNU libc.
4222 * xstrtoimax.c: New file.
4224 * xstrtol.h: Add xstrtoimax.
4225 * strtoumax.c: New file. Simply include "strtoumax.c".
4226 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
4228 * strtoumax.c: Factor to work both for unsigned and signed types, ...
4229 * strtoxmax.c: ... then renamed to this.
4231 2001-08-13 Paul Eggert <eggert@twinsun.com>
4233 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
4234 Port to Solaris 8, where 'sed' requires a space after the 'r'
4235 command, and where sh dislikes "$/". Clean up the spacing a bit.
4236 Redirect output to $tmp just once.
4238 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
4240 * addext.c (<errno.h>): Include.
4241 (errno): Declare if not defined.
4242 (addext): Work correctly when pathconf returns -1 and leaves
4243 errno alone because there is no limit. Also, work even if
4244 pathconf returns a value greater than SIZE_MAX.
4246 2001-08-12 Jim Meyering <jim@meyering.net>
4248 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
4249 Simply `return getcwd (NULL, 0);'.
4250 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
4251 Use 1300 as initial value for length, not PATH_MAX.
4253 * pathmax.h: Clean up cpp syntax.
4255 2001-08-12 Jim Meyering <jim@meyering.net>
4257 * gettimeofday.c: New file.
4259 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
4261 2001-08-04 Jim Meyering <jim@meyering.net>
4263 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
4264 to get in sync with glibc.
4266 2001-08-03 Paul Eggert <eggert@twinsun.com>
4268 The following changes are from gettext 0.10.39 as maintained by
4271 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
4272 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
4273 with inverted sense. All uses changed.
4275 * mbswidth.c: Don't include <limits.h>.
4276 Include <stdlib.h> and <string.h> unconditionally.
4277 (iswcntrl, mbsinit, ISCNTRL): New macros.
4278 (mbsnwidth): Use K&R style function declarations.
4279 Don't bother checking for MB_LEN_MAX == 1, since the compiler
4280 can optimize it when MB_CUR_MAX == 1.
4281 The width of control characters is zero, not 1.
4283 2001-07-15 Jim Meyering <jim@meyering.net>
4285 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
4286 (BUILT_SOURCES): Add unlocked-io.h.
4287 (io_functions): Define.
4288 (unlocked-io.h): New rule.
4289 (DISTCLEANFILES): Add unlocked-io.h.
4290 (all-local): Depend on unlocked-io.h, to ensure it is created.
4292 * unlocked-io.hin: New file
4294 * regex.c: Update from glibc.
4296 2001-07-05 Jim Meyering <jim@meyering.net>
4298 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
4300 (libfetish_a_SOURCES): Put all .h files here instead.
4301 Remove a thus-exposed (better checks in automake) duplicate and
4302 two unnecessary .h files.
4304 2001-06-11 Jim Meyering <jim@meyering.net>
4306 * regex.c: Update from GNU libc.
4308 2001-05-27 Jim Meyering <jim@meyering.net>
4310 * readutmp.h (UT_TYPE): Define.
4312 2001-05-24 Jim Meyering <jim@meyering.net>
4314 * argmatch.c: Include "quote.h".
4315 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
4316 quote function. Reported by Göran Uddeborg.
4318 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
4320 * dirname.c (dir_name): Compute append_dot using path, not newpath
4321 which is not yet declared.
4323 2001-05-11 Paul Eggert <eggert@twinsun.com>
4325 * Makefile.am (libfetish_a_SOURCES):
4326 Add strftime.c, since we now compile it on all hosts.
4328 * strftime.c (my_strftime):
4329 Define to nstrftime if emacs, but only if my_strftime is not defined.
4330 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
4331 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
4332 Add one more extra argument: a nanoseconds value.
4335 (my_strftime function): Add %N format.
4336 (emacs_strftimeu): Renamed from emacs_strftime,
4337 with extra ut argument.
4339 2001-05-11 Paul Eggert <eggert@twinsun.com>
4341 dirname code cleanup. base_name now behaves more compatibly
4342 with POSIX basename when given file names that have trailing
4343 slashes, and similarly for dir_name. Add new primitives
4344 base_len and dir_len. Put the directory-name-related decls
4347 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
4348 * backupfile.c (base_name): Likewise.
4349 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
4350 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
4351 * makepath.c (strip_trailing_slashes): Likewise.
4352 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
4354 * rename.c (strip_trailing_slashes): Likewise.
4355 * same.c (base_name): Likewise.
4356 * stripslash.c (ISSLASH): Likewise.
4358 * addext.c: Include <dirname.h> after size_t is defined.
4359 * backupfile.c: Likewise.
4361 * addext.c (addext): Use base_len to trim redundant
4362 trailing slashes instead of doing it ourselves.
4363 But do not trim the last slash if it is not redundant.
4365 * backupfile.c (find_backup_file_name,
4366 max_backup_version): Use base_len instead of rolling it ourselves.
4367 Handle the case of "" and (on DOS) "C:" correctly.
4369 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
4370 Include <string.h>, <dirname.h>.
4371 (base_name): Allow file names ending in slashes, other than names
4372 that are all slashes. In this case, return the basename followed
4373 by the slashes. This is more general, and can be used in places
4374 where the original base_name purposely had an assertion failure.
4375 (base_len): New function.
4377 * dirname.c: Include <string.h> instead of <stdlib.h>.
4378 Do not include <assert.h>; no longer needed.
4380 (memrchr): Remove decl.
4381 (dir_name_r): Remove.
4382 (dir_len): Renamed from dirlen. All callers changed.
4383 Rewrite in terms of base_name, for simplicity and consistency.
4384 (dir_name): Never return NULL. All callers changed.
4385 Do not include <stdlib.h> in test program; no longer needed.
4386 return 0; is fine for test program.
4388 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
4390 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
4392 * path-concat.c (path_concat): Use base_len to compute
4393 base length, not strlen; this means we cannot rely on memcpy
4396 * same.c (STREQ): Remove.
4397 (same_name): Handle the case where the basename ends in trailing '/'.
4399 * stripslash.c (strip_trailing_slashes): Return nonzero if
4400 a slash was stripped. Do not strip the last slash after a
4403 2001-04-08 Jim Meyering <jim@meyering.net>
4405 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
4406 recomputed; that's necessary when the offset spans a DST transition.
4407 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
4409 2001-04-02 Jim Meyering <jim@meyering.net>
4411 * regex.h, regex.c: Update from GNU libc.
4413 2001-03-19 Paul Eggert <eggert@twinsun.com>
4415 * version-etc.c (version_etc_copyright): Update to 2001.
4417 2001-03-16 Paul Eggert <eggert@twinsun.com>
4419 * tempname.c (uint64_t): Define to uintmax_t if
4420 not defined, and if UINT64_MAX is not defined.
4421 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
4422 Reported by John David Anglin.
4424 2001-03-10 Bruno Haible <haible@clisp.cons.org>
4426 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
4427 alias if codeset is empty.
4428 * config.charset (BeOS): Use wildcard syntax.
4430 2001-03-13 Jim Meyering <jim@meyering.net>
4432 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
4433 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
4436 2001-03-06 Bruno Haible <haible@clisp.cons.org>
4438 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
4440 * unicodeio.c (print_unicode_char): Simplify accordingly.
4442 2001-03-06 Bruno Haible <haible@clisp.cons.org>
4444 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
4445 support for DOS/DJGPP.
4447 2001-02-28 Paul Eggert <eggert@twinsun.com>
4449 * Makefile.am (libfetish_a_SOURCES):
4450 Add dup-safer.c, fopen-safer.c.
4451 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
4453 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
4455 2001-02-25 Paul Eggert <eggert@twinsun.com>
4457 The mkstemp replacement is taken from glibc 2.2.2, with some
4458 portability fixes for use outside glibc, as follows:
4460 * tempname.c (struct_stat64): New macro.
4461 (direxists, __gen_tempname): Use it.
4462 This avoids a portability problem with Solaris 8.
4464 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
4465 (<stddef.h>, <stdint.h>, <string.h>):
4466 Include only if STDC_HEADERS || _LIBC.
4467 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
4468 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
4469 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
4470 (__set_errno): Define this macro if <errno.h> doesn't.
4471 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
4472 Define these macros if <stdio.h> doesn't.
4473 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
4474 Define these macros if <sys/stat.h>
4475 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
4476 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
4477 __xstat64): Define if not _LIBC.
4478 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
4479 (__gen_tempname): Invoke gettimeofday only if
4480 HAVE_GETTIMEOFDAY || _LIBC;
4481 otherwise, fall back on plain "time".
4482 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
4484 * mkstemp.c (__GT_FILE): Define to zero if not defined.
4486 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
4488 2001-02-17 Jim Meyering <jim@meyering.net>
4490 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
4491 around included file name.
4493 * strnlen.c (__strnlen): Merge in a change from GNU libc.
4495 * strftime.c: Update from GNU libc (the only changes were to comments).
4497 2001-02-13 Bruno Haible <haible@clisp.cons.org>
4499 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
4501 2001-02-17 Paul Eggert <eggert@twinsun.com>
4503 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
4504 Remove workaround macros for hosts that have mbrtowc but not
4505 mbstate_t, as we now insist on proper declarations for both
4506 before using mbrtowc.
4508 2001-02-17 Jim Meyering <jim@meyering.net>
4510 * regex.c: Update from libc.
4512 2001-02-16 Paul Eggert <eggert@twinsun.com>
4514 * alloca.c (malloc): Undef before defining, since stdlib.h
4515 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
4516 Reported by Mark Hounschell via Paul Eggert.
4518 2001-01-30 Bruno Haible <haible@clisp.cons.org>
4520 * config.charset: Update for FreeBSD 4.2.
4522 2001-01-26 Jim Meyering <jim@meyering.net>
4524 * quotearg.c: Include stddef.h.
4525 * quote.c: Include stddef.h.
4526 Reported by Axel Kittenberger.
4528 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
4529 line in double quotes so that it evokes a better diagnostic.
4530 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
4531 Reported by Axel Kittenberger.
4533 2001-01-15 Bruno Haible <haible@clisp.cons.org>
4535 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
4536 to avoid a warning. Add back 'const' to inptr.
4538 2001-01-16 Jim Meyering <jim@meyering.net>
4540 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
4543 2001-01-14 Jim Meyering <jim@meyering.net>
4545 * rename.c: New file. From Volker Borchert.
4546 Include stdlib.h, string.h or strings.h, and xalloc.h.
4547 Use strip_trailing_slashes rather than open-coding it.
4549 2001-01-03 Paul Eggert <eggert@twinsun.com>
4551 * strftime.c: Sync with glibc time/strftime.c 1.81.
4553 2001-01-03 Jim Meyering <jim@meyering.net>
4555 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
4556 local `inptr' to avoid warning with some system declarations of iconv.
4558 2000-12-29 Paul Eggert <eggert@twinsun.com>
4560 * modechange.c: Do not assume that mode_t uses the
4561 traditional octal encoding. E.g. "chmod 1 FOO" should set
4562 the other-execute bit of FOO even if S_IXOTH != 1.
4564 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
4565 WOTH, XOTH, ALLM): New macros.
4566 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
4567 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
4569 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
4570 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
4572 No need to use uintmax_t; unsigned long is long enough.
4573 Don't bother to get suffix since we don't use it.
4575 2000-12-24 Jim Meyering <jim@meyering.net>
4577 * hash.c (is_prime): Return explicit boolean values.
4578 (hash_get_first): Return NULL to appease Irix5.6's 89.
4579 Reported by Nelson Beebe.
4581 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4583 * localcharset.c (locale_charset): Add support for Win32.
4585 2000-12-18 Paul Eggert <eggert@twinsun.com>
4587 * physmem.h, physmem.c: New files.
4589 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
4590 (noinst_HEADERS): Add physmem.h.
4592 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
4593 't' for compatibility with Solaris 8 sort.
4595 2000-12-18 Bruno Haible <haible@clisp.cons.org>
4597 * config.charset: Add support for BeOS.
4599 2000-12-16 Jim Meyering <jim@meyering.net>
4601 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
4602 SHELLS_FILE to a file name that's useful on djgpp systems.
4604 (ADDITIONAL_DEFAULT_SHELLS): Define.
4605 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
4606 Based mostly on a patch from Prashant TR.
4608 2000-12-16 Jim Meyering <jim@meyering.net>
4610 This bug had a serious impact on chown: `chown N:M FILE' (for integer
4611 N and M) would have treated it like `chown N:N FILE'.
4613 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
4615 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4617 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
4618 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
4619 to the list of canonical encodings. Rename EUC-CN to GB2312.
4621 2000-12-08 Andreas Schwab <schwab@suse.de>
4623 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
4624 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
4626 2000-12-07 Jim Meyering <jim@meyering.net>
4628 * stripslash.c (ISSLASH): Define.
4629 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
4632 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
4633 (dir_name_r): Declare this function as static.
4634 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
4635 manifest itself on a name containing a mix of slashes and
4637 Make this function work with names starting with a DOS-style
4638 drive letter and colon prefix.
4639 (dir_name): Append `.' if necessary.
4640 Based mostly on patches from Prashant TR and Eli Zaretskii.
4642 * dirname.h (dir_name_r): Remove prototype.
4644 2000-12-05 Jim Meyering <jim@meyering.net>
4646 * dirname.c (dir_name_r): Add `const' in a few local declarations.
4648 2000-12-04 Jim Meyering <jim@meyering.net>
4650 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
4651 Also include memory.h, stdlib.h, unistd.h if appropriate.
4652 Reported by Andreas Jaeger (conflicting declaration of malloc).
4654 2000-12-02 Jim Meyering <jim@meyering.net>
4656 * closeout.h: Make idempotent, to avoid some obscure warnings.
4658 2000-12-01 Paul Eggert <eggert@twinsun.com>
4660 * memrchr.c: Include <config.h> before any system include file.
4662 2000-11-29 Paul Eggert <eggert@twinsun.com>
4664 * dirname.c (dir_name_r): Fix typo: int -> size_t.
4666 2000-11-26 Jim Meyering <jim@meyering.net>
4668 * memcoll.c: Include sys/types.h. From Werner Almesberger.
4670 2000-11-22 Paul Eggert <eggert@twinsun.com>
4672 * strftime.c (my_strftime): Do not invoke mbrlen with a
4673 size of (size_t) -1; it's not portable.
4675 2000-11-17 Akim Demaille <akim@epita.fr>
4677 * obstack.h: Formatting changes.
4678 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
4679 prevent type checking.
4680 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
4681 cast the value to (void *): assigning a `foo *' to a `void *'
4683 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
4685 2000-11-17 Jim Meyering <jim@meyering.net>
4687 * strstr.c: Update from GNU libc.
4689 2000-11-16 Jim Meyering <jim@meyering.net>
4691 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
4693 2000-11-11 Jim Meyering <jim@meyering.net>
4695 * error.c: Add a couple #includes, merging from GNU libc version.
4697 2000-11-10 Jim Meyering <jim@meyering.net>
4699 * obstack.h: Update from GNU libc.
4700 * obstack.c: Likewise.
4702 2000-11-06 Paul Eggert <eggert@twinsun.com>
4704 * getusershell.c (setusershell): Use rewind rather than
4705 fseek/fseeko, to avoid configuration hassles with fseeko.
4706 Don't bother opening SHELLS_FILE if shellstream is NULL;
4709 2000-11-05 Jim Meyering <jim@meyering.net>
4711 * makepath.h (make_dir): Declare.
4712 * makepath.c (make_dir): Remove `static' attribute.
4715 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
4717 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
4718 last one in a bucket, advance to the next bucket.
4720 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
4722 * fnmatch.c: Do not comment out all the code if we are using
4723 the GNU C library, because in some cases we are replacing buggy
4724 code in the GNU C library itself.
4726 2000-10-30 Paul Eggert <eggert@twinsun.com>
4728 * error.h, getline.h, modechange.h:
4729 Remove "2000" from Copyright line, as the file hasn't been
4730 changed this year other than in the copyright notice.
4732 * xalloc.h: Add "2000" to Copyright line, as this file
4733 was changed this year.
4735 2000-10-30 Paul Eggert <eggert@twinsun.com>
4737 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
4738 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4739 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4741 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
4743 * regex.h (__restrict_arr): Move definition out of #ifndef block.
4744 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4745 doesn't define __restrict_arr.
4747 2000-10-29 Jim Meyering <jim@meyering.net>
4749 * xstat.in: Fix grammar in comment.
4751 2000-10-28 Jim Meyering <jim@meyering.net>
4753 * memchr.c: Update from libc.
4754 Adjust for portability:
4755 [HAVE_STDLIB_H]: Include stdlib.h.
4756 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4757 Undef __memchr, too.
4758 [!weak_alias]: Define __memchr to memchr.
4760 * regex.c: Update from libc.
4761 * regex.h: Likewise.
4762 * getopt1.c: Likewise.
4763 * memcmp.c: Likewise.
4765 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4766 Avoid using fseek, when possible -- it's broken by design.
4767 Patch by Ulrich Drepper.
4769 2000-10-26 Jim Meyering <jim@meyering.net>
4771 * strftime.c: Update from libc.
4773 2000-10-25 Jim Meyering <jim@meyering.net>
4775 * obstack.c: Update from libc.
4777 2000-10-23 Jim Meyering <jim@meyering.net>
4779 * hard-locale.c (hard_locale): Revert last change -- it was simply
4780 wrong. That set_locale call must not have any side effects.
4783 2000-10-22 Jim Meyering <jim@meyering.net>
4785 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4786 [CYCLIC]: Remove now-unused definition.
4788 * save-cwd.c (O_DIRECTORY): Define, if needed.
4789 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4790 Suggestion from Ulrich Drepper.
4792 2000-10-21 Jim Meyering <jim@meyering.net>
4794 * dirname.c (dir_name_r): New function, factored out of dir_name.
4795 (dir_name): Use dir_name_r.
4796 * dirname.h (dir_name_r): Declare it.
4798 2000-10-21 Jim Meyering <jim@meyering.net>
4800 * dirname.c (memrchr): Declare if necessary.
4801 (dir_name): Remove the restriction that there be no
4802 trailing slashes. Now, this code skips past them, effectively
4804 [TEST_DIRNAME] (main): New unit tests.
4806 * memrchr.c: New file from GNU libc.
4807 Undef __memrchr, too.
4808 [!weak_alias]: Define __memrchr to memrchr.
4809 Guard weak_alias use with `#ifdef weak_alias'.
4811 2000-10-17 Jim Meyering <jim@meyering.net>
4813 * quote.h (PARAMS): Define and use.
4814 Reported by Akim Demaille.
4816 * getopt.c: Update from libc.
4818 2000-10-16 Jim Meyering <jim@meyering.net>
4820 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4823 2000-09-25 Jim Meyering <jim@meyering.net>
4825 * md5.h (rol): Define (from GnuPG).
4827 * sha.c: Give credit (GnuPG) where due.
4828 (M): Use rol rather than open-coding it.
4829 Add a FIXME comment.
4831 2000-09-21 Jim Meyering <jim@meyering.net>
4833 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4834 Reported by Michael Stone.
4836 2000-09-20 Jim Meyering <jim@meyering.net>
4838 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4839 (noinst_HEADERS): Add sha.h.
4840 Based on code from Scott G. Miller and from GnuPG.
4842 2000-09-15 Jim Meyering <jim@meyering.net>
4844 * regex.c: Update from libc.
4846 2000-09-10 Jim Meyering <jim@meyering.net>
4848 * getopt.c (_getopt_internal): Update from glibc.
4850 2000-09-09 Jim Meyering <jim@meyering.net>
4852 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4853 think it should be used as a general replacement for isascii.
4854 * fnmatch.c: Likewise.
4855 * mbswidth.c: Likewise
4856 * regex.c: Likewise.
4859 * userspec.c: Include sys/param.h and limits.h.
4861 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4862 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4863 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4864 UID, GID. Check range.
4866 2000-09-06 Jim Meyering <jim@meyering.net>
4868 * getopt.c (_getopt_internal): Update from glibc.
4870 2000-08-30 Jim Meyering <jim@meyering.net>
4872 * strftime.c: Merge in changes from GNU libc.
4874 2000-08-26 Jim Meyering <jim@meyering.net>
4876 * closeout.c: Include "__fpending.h".
4877 (close_stdout_status): Return right away if there's nothing to flush.
4879 * Makefile.am (noinst_HEADERS): Add __fpending.h.
4880 * __fpending.c: New file.
4881 * __fpending.h: New file.
4883 2000-08-07 Paul Eggert <eggert@twinsun.com>
4885 Standardize on "memory exhausted" instead of "Memory exhausted"
4886 or "virtual memory exhausted".
4887 * obstack.c (print_and_abort): Use "memory exhausted", not
4888 "virtual memory exhausted".
4889 * same.c (same_name): Invoke xalloc_die instead of printing
4891 * userspec.c (parse_user_spec): Likewise.
4892 * bumpalloc.h: comment fix
4893 * same.c, userspec.c: Include xalloc.h.
4895 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
4896 not char *const and pointing to a constant array.
4897 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
4898 (xrealloc): Comment fix.
4900 * userspec.c (parse_user_spec):
4901 Don't translate a message until just before returning,
4902 to avoid unnecessary translation.
4904 2000-08-07 Jim Meyering <jim@meyering.net>
4906 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
4907 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
4908 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
4909 getgroups.c, gethostname.c, getopt.h, group-member.c,
4910 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
4911 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
4912 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
4913 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
4914 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
4915 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
4916 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
4917 yesno.c: Back out Copyright date changes for each file with no change
4918 this year. This eases coordination with other programs using the same
4919 source code modules. From Paul Eggert.
4921 2000-08-03 Greg McGary <greg@mcgary.org>
4923 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
4924 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
4925 (EXTEND_BUFFER): Use them.
4927 2000-08-01 Jim Meyering <jim@meyering.net>
4929 * dirname.c (ISSLASH): Define.
4930 (BACKSLASH_IS_PATH_SEPARATOR): Define.
4931 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
4932 both `\' and `/' may be use as path separators.
4933 Based on a patch from Prashant TR.
4935 2000-07-31 Paul Eggert <eggert@twinsun.com>
4937 * quotearg.c (quotearg_n_options): Don't make the initial
4938 slot vector a constant, since it might get modified.
4940 2000-07-31 Jim Meyering <jim@meyering.net>
4942 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
4943 * obstack.c (print_and_abort): Likewise.
4945 2000-07-30 Paul Eggert <eggert@twinsun.com>
4947 * quotearg.c (quotearg_n_options): Preallocate a slot 0
4948 buffer, so that the caller can always quote one small
4949 component of a "memory exhausted" message in slot 0.
4950 From a suggestion by Jim Meyering.
4952 2000-07-30 Jim Meyering <jim@meyering.net>
4954 * makepath.c (make_path): Quote the other instance, too.
4956 * quotearg.c (N_STATIC_SLOTVECS): Define.
4957 (STATIC_BUF_SIZE): Define.
4958 (quotearg_n_options): Use only statically allocated storage when
4959 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
4960 than STATIC_BUF_SIZE.
4962 2000-07-29 Jim Meyering <jim@meyering.net>
4964 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
4965 * dirname.c (dir_name): Likewise.
4967 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
4969 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
4970 (dir_name): Assert that there are no trailing slashes.
4972 2000-07-18 Bruno Haible <haible@clisp.cons.org>
4974 * mbswidth.h (mbswidth): Add a flags argument.
4975 (mbswidth): New declaration.
4976 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
4977 * mbswidth.c (mbswidth): Add a flags argument.
4978 (mbsnwidth): New function.
4980 2000-07-24 Jim Meyering <jim@meyering.net>
4982 * mbswidth.c: Remove useless #else. From Bruno Haible.
4984 2000-07-23 Paul Eggert <eggert@twinsun.com>
4986 * mbswidth.c (_XOPEN_SOURCE):
4987 Don't define; this causes problems on Solaris 7.
4988 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
4990 2000-07-23 Paul Eggert <eggert@twinsun.com>
4993 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4994 so that mbstate_t is always defined.
4996 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
4997 be 1 in at least one GCC installation, and this configuration
4998 error is likely to be common. Ignoring MB_LEN_MAX hurts
4999 performance on hosts that have mbrtowc but have only unibyte
5000 locales, but I assume these hosts are rare.
5002 2000-07-23 Paul Eggert <eggert@twinsun.com>
5004 * quotearg.c: Streamline by invoking multibyte code only if needed.
5005 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
5006 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
5007 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
5008 invoke multibyte primitives.
5010 2000-07-23 Jim Meyering <jim@meyering.net>
5012 * basename.c (base_name): Add an assertion.
5014 2000-07-15 Bruno Haible <clisp.cons.org>
5016 * quotearg.c: When the system forces us to redefine mbstate_t,
5017 shadow its mbsinit function.
5019 2000-07-16 Bruno Haible <haible@clisp.cons.org>
5021 * mbswidth.h: New file.
5022 * mbswidth.c: New file.
5023 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
5024 (noinst_HEADERS): Add mbswidth.h.
5026 2000-07-17 Bruno Haible <haible@clisp.cons.org>
5028 * config.charset: Add support for FreeBSD. Improve support for HP-UX
5031 2000-07-15 Jim Meyering <jim@meyering.net>
5033 * makepath.c: Include quote.h.
5034 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
5035 corresponding argument in a `quote (...)' call.
5036 Give better diagnostics.
5038 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
5039 (noinst_HEADERS): Add quote.h.
5041 * quote.c (quote, quote_n): New file. Two functions taken verbatim
5042 from tar's src/misc.c.
5043 * quote.h: New file. Prototypes for same.
5045 2000-07-10 Paul Eggert <eggert@twinsun.com>
5047 From a suggestion by Bruno Haible.
5048 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
5049 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
5050 to decide whether to define the BeOS workaround macro;
5051 this adjusts to the change to AC_MBSTATE_T.
5053 2000-07-13 Paul Eggert <eggert@twinsun.com>
5055 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
5057 * quotearg.c (quoting_style_args, quoting_style_vals,
5058 quotearg_buffer_restyled): Add support for
5059 clocale_quoting_style. Undo previous change to
5060 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
5061 and "{RIGHT QUOTATION MARK}" msgids.
5063 2000-07-05 Paul Eggert <eggert@twinsun.com>
5065 The old behavior of quoting `like this' doesn't look good with
5066 newer, ISO-style fonts. See:
5067 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
5069 Instead, quote "like this" by default. Let the translator
5070 tailor the locale-specific quoting behavior by providing
5071 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
5073 * quotearg.c (N_): New macro.
5074 (gettext_default): New function.
5075 (quotearg_buffer_restyled): Use
5076 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
5077 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
5079 2000-07-09 Jim Meyering <jim@meyering.net>
5081 * Most files: Update copyright dates to include 2000.
5083 2000-07-08 Jim Meyering <jim@meyering.net>
5085 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
5087 (xgethostname): Remove now-unnecessary #ifdef.
5088 Move declaration of `err' into loop where it's used.
5090 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5092 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
5093 by allocating a larger buffer. Test the gethostname return value for
5094 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
5095 returns an error and ENAMETOOLONG isn't defined.
5097 2000-07-05 Paul Eggert <eggert@twinsun.com>
5098 and Bruno Haible <haible@clisp.cons.org>
5100 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
5102 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5104 * quotearg.c (struct quoting_options): Simplify quote_these_too
5107 2000-07-03 Jim Meyering <jim@meyering.net>
5109 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
5110 Reported by Bruno Haible.
5112 2000-07-04 Jim Meyering <jim@meyering.net>
5114 * quotearg.c: Make inclusion of <wchar.h> independent of whether
5115 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
5118 2000-07-03 Paul Eggert <eggert@twinsun.com>
5119 and Bruno Haible <haible@clisp.cons.org>
5121 * quotearg.c (mbrtowc):
5122 Assign to *pwc, and return 1 only if result is nonzero.
5123 (iswprint): Use ISPRINT when substituting our own mbrtowc.
5125 2000-07-03 Jim Meyering <jim@meyering.net>
5127 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
5128 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
5131 2000-07-02 Jim Meyering <jim@meyering.net>
5133 * quotearg.c (mbstate_t): Don't define here.
5135 2000-07-02 Jim Meyering <jim@meyering.net>
5137 * nanosleep.c (SIGCONT): Define if not already defined.
5139 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5141 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
5142 per change in ../m4/ls-mntd-fs.m4.
5143 (read_filesystem_list): Ignore symbolic links.
5145 2000-06-29 Jim Meyering <jim@meyering.net>
5147 * same.c: Include <string.h> or <strings.h>, as appropriate,
5148 for declaration of strcmp.
5150 * long-options.c: Include <stdlib.h>, for declaration of exit.
5152 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
5153 Avoid warning by casting result to `char *' to remove `const'.
5155 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5157 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
5159 2000-06-26 Paul Eggert <eggert@twinsun.com>
5161 savedir now sets errno on failure and invokes xmalloc to get memory.
5162 Fix a couple of other minor bugs while we're at it.
5164 * savedir.c (<unistd.h>): Do not include; there's no need.
5165 (NAMLEN): Remove macro.
5166 (malloc, realloc): Remove decls.
5168 ("xalloc.h"): Include.
5169 (NAME_SIZE_DEFAULT): New macro.
5170 (savedir): Use xmalloc / xrealloc to allocate memory.
5171 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
5172 Skip "" directory entries.
5173 Use strlen to calculate directory entry length, since the old method
5174 is rarely used these days and isn't worth supporting.
5175 Don't use a pointer after freeing it.
5176 Check for integer overflow when calculating allocation size.
5177 Use memcpy to copy entries, instead of stpcpy.
5178 Set errno properly when returning NULL.
5179 Check for readdir error.
5181 2000-06-26 Jim Meyering <jim@meyering.net>
5183 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
5185 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5187 * getusershell.c (xmalloc, xrealloc): Remove functions.
5189 Don't include <stdlib.h>. Don't declare malloc, realloc.
5191 2000-06-23 Bruno Haible <haible@clisp.cons.org>
5193 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
5195 2000-06-24 Jim Meyering <jim@meyering.net>
5197 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
5199 2000-06-21 Jim Meyering <jim@meyering.net>
5201 * getpass.c: New file, from Bruno Haible. Required for BeOS.
5203 2000-06-19 Paul Eggert <eggert@twinsun.com>
5205 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
5206 (mbrtowc, mbstate_t): Define substitutes if
5207 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
5208 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
5209 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
5211 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5213 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
5214 than 1024, return a memory chunk of least possible size, instead
5215 of size PATH_MAX + 2. In the loop, increment the size proportionally.
5216 Use free/xmalloc instead of xrealloc to avoid copying for very long
5219 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5221 * canon-host.c (canon_host): Use malloc and memcpy to copy an
5222 address, not strdup. Include <stdlib.h> and don't declare free().
5224 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5226 * path-concat.c (path_concat): Don't access dir[-1] if dir is
5229 2000-06-21 Jim Meyering <jim@meyering.net>
5231 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
5232 (noinst_HEADERS): Add getstr.h.
5234 * getline.c (getstr): Move into a separate file.
5235 * getstr.c (getstr): New file, extracted from getline.c, with
5236 the following changes: new parameter, delim2; both delim[12]
5237 parameters have type `int', not `char'. The latter would lose
5238 with 8-bit delimiters.
5239 * getstr.h: New file.
5241 2000-06-19 Jim Meyering <jim@meyering.net>
5243 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
5245 2000-06-18 Jim Meyering <jim@meyering.net>
5247 * mkdir.c: Remove file, due mainly to copyright incompatibility.
5248 Besides, these days every porting target provides a mkdir function.
5250 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
5251 (this snippet comes from src/system.h).
5253 2000-06-15 Paul Eggert <eggert@twinsun.com>
5255 * human.c (adjust_value): New function.
5256 (human_readable_inexact): Apply rounding style even when
5257 printing approximate values.
5259 2000-06-14 Paul Eggert <eggert@twinsun.com>
5261 * human.c (human_readable_inexact): Allow an input block
5262 size that is not a multiple of the output block size, and vice versa.
5263 Reported by Piergiorgio Sartor.
5265 2000-06-14 Paul Eggert <eggert@twinsun.com>
5267 * getdate.y (get_date): Apply relative times after time
5268 zone indicator, not before. Reported by Todd A. Jacobs.
5270 2000-06-13 Jim Meyering <jim@meyering.net>
5272 * Makefile.am (all-local): Depend on lstat.c and stat.c.
5274 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
5276 2000-06-12 Paul Eggert <eggert@twinsun.com>
5278 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
5280 2000-06-04 Paul Eggert <eggert@twinsun.com>
5282 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
5284 2000-06-04 Jim Meyering <jim@meyering.net>
5286 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
5287 SunOS 4.1.4 for which gid_t is an unsigned type.
5289 2000-06-03 Jim Meyering <jim@meyering.net>
5291 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
5293 2000-05-26 Bruno Haible <haible@clisp.cons.org>
5295 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
5296 newer, don't install charset.alias.
5297 * config.charset: Change the Linux/glibc rules so they become empty
5298 on glibc-2.1 or newer.
5300 2000-06-02 Jim Meyering <jim@meyering.net>
5302 * mountlist.c: Back out last change. Instead, do this...
5303 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
5304 member using the same `ignore'-testing code.
5305 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
5309 2000-05-29 Jim Meyering <jim@meyering.net>
5311 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
5312 with the `ignore' attribute. Based on a patch from Mark D. Roth.
5314 2000-05-22 Jim Meyering <jim@meyering.net>
5316 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
5318 2000-05-18 Jim Meyering <jim@meyering.net>
5320 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
5321 back, too, since it may have been modified by allocate_entry.
5322 (hash_delete): Rewrite to use neither the assignment operator
5323 nor the comma operator in an if-expression.
5325 2000-05-15 Paul Eggert <eggert@twinsun.com>
5328 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
5329 Remove; no longer needed.
5330 "quotearg.h": Add include.
5331 (file_name): Do not bother to explicitly initialize to NULL; it's less
5332 efficient on some hosts.
5333 (close_stdout_status): Remove test as to whether stdout was already
5334 closed; it breaks for the case "echo x | sort >&-".
5335 Quote file name colons.
5336 Do not assume that _("write error") lacks format strings.
5338 2000-05-15 Jim Meyering <jim@meyering.net>
5340 * version-etc.c (version_etc_copyright): Update the copyright string
5341 used in all --version output.
5343 2000-05-14 Jim Meyering <jim@meyering.net>
5345 * closeout.c (close_stdout_set_file_name): New function.
5346 (close_stdout_status): Use new file-scoped global.
5347 Return right away if fstat says the stdout file descriptor is invalid.
5348 * closeout.h (close_stdout_set_file_name): Declare.
5350 2000-05-10 Jim Meyering <jim@meyering.net>
5352 * closeout.c [default_exit_status]: New file-scoped variable.
5353 (close_stdout_set_status): New function.
5354 * closeout.h (close_stdout_set_status): Declare.
5356 2000-05-08 Jim Meyering <jim@meyering.net>
5358 * long-options.c: Don't include closeout.h.
5359 (parse_long_options): Don't call close_stdout for --version.
5361 2000-05-06 Jim Meyering <jim@meyering.net>
5363 * strnlen.c: Undefine __strnlen and strnlen.
5364 [!weak_alias]: Define __strnlen to strnlen.
5366 * atexit.c: New file, from libiberty.
5368 2000-05-06 Jim Meyering <jim@meyering.net>
5370 * closeout.c (close_stdout_status): Also check for errors on the
5373 2000-05-05 Bruno Haible <haible@clisp.cons.org>
5375 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
5376 instead of xmalloc, xrealloc, path_concat.
5377 (locale_charset): Treat empty environment variables as absent.
5378 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
5380 2000-05-04 Jim Meyering <jim@meyering.net>
5382 * getopt.c: Update from glibc.
5383 * obstack.c: Likewise.
5384 * obstack.h: Likewise.
5385 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
5387 * regex.h: Likewise.
5388 * strndup.c: Likewise.
5389 * strnlen.c: New file, from glibc.
5391 2000-05-01 Jim Meyering <jim@meyering.net>
5393 * full-write.c (full_write): Remove `FIXME' part of comment.
5395 2000-04-29 Jim Meyering <jim@meyering.net>
5397 * path-concat.c: Declare strdup only if it's not defined.
5398 * canon-host.c: Likewise.
5400 2000-04-28 Jim Meyering <jim@meyering.net>
5402 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
5403 redefinition warning on some systems (HPUX). Otherwise, regex.h is
5404 included first, then limits.h is included by locale.h by libintl.h.
5405 From John David Anglin.
5407 2000-04-25 Jim Meyering <jim@meyering.net>
5409 * makepath.c (S_IRWXUGO): Define.
5410 (make_path): Always perform explicit chmod if MODE specifies any
5411 of the `special' permission bits. Prompted by a bug report against
5412 install from Mate Wierdl and Joost van Baal.
5414 2000-04-18 Jim Meyering <jim@meyering.net>
5418 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
5419 getpagesize. For BeOS. Based on a patch from Bruno Haible.
5421 2000-04-17 Jim Meyering <jim@meyering.net>
5423 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
5424 the definition of it to rpl_strftime also defined-away the system's
5427 2000-04-15 Jim Meyering <jim@meyering.net>
5429 Use `C' to denote so-called `contiguous' files, the same way
5431 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
5432 (ftypelet): Use S_ISCTG.
5433 From Michael Deutschmann.
5435 2000-04-14 Jim Meyering <jim@meyering.net>
5437 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
5439 2000-04-08 Jim Meyering <jim@meyering.net>
5441 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
5442 names don't conflict. Reported by Eli Zaretskii.
5444 2000-03-28 Bruno Haible <haible@clisp.cons.org>
5446 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
5447 bug. Deal with the different error behavior of Irix iconv.
5449 2000-04-07 Jim Meyering <jim@meyering.net>
5451 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
5452 to work around system header problems on AIX 3.2.5. From Bruno Haible.
5454 2000-04-05 Jim Meyering <jim@meyering.net>
5456 Portability tweaks required for ultrix4.3.
5457 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
5458 * readutmp.c: Include sys/types.h before sys/stat.h.
5459 * canon-host.c: Declare strdup.
5460 * path-concat.c: Likewise.
5461 From John David Anglin.
5463 2000-04-04 Jim Meyering <jim@meyering.net>
5465 Be more DOS 8.3-friendly.
5466 * ref-add.sin: Renamed from ref-add.sed.in.
5467 * ref-del.sin: Renamed from ref-del.sed.in.
5468 * Makefile.am: Reflect renaming.
5469 Reported by Eli Zaretskii.
5471 Use a temporary file name that won't clash with `charset.alias'
5472 in the DOS 8.3 name space.
5473 * Makefile.am (charset_tmp): Define.
5474 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
5475 (uninstall-local): Likewise.
5476 Reported by Eli Zaretskii.
5478 2000-03-29 Paul Eggert <eggert@twinsun.com>
5480 * time/strftime.c (my_strftime): Make sure we call the system
5481 strftime, not ourselves, when invoking the underlying strftime.
5483 2000-03-24 Jim Meyering <jim@meyering.net>
5485 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
5486 (charset_alias): Define.
5487 (install-exec-local): Factor out common code.
5488 (uninstall-local): Split lines longer than 80.
5489 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
5491 (.sed.in.sed): New rule. Don't redirect directly to $@.
5492 (CLEANFILES): Add ref-add.sed and ref-del.sed.
5494 2000-03-19 Bruno Haible <haible@clisp.cons.org>
5496 * config.charset: Output a line containing "Packages using this file".
5497 * ref-add.sed.in, ref-del.sed.in: New files.
5498 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
5499 ref-del.sed): New rules.
5501 2000-03-17 Jim Meyering <jim@meyering.net>
5503 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
5504 Otherwise, include <strings.h>
5506 2000-03-17 Bruno Haible <haible@clisp.cons.org>
5508 * unicodeio.c (utf8_wctomb): New function.
5509 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
5510 format instead of in UCS-4 with platform dependent endianness.
5512 2000-03-07 Paul Eggert <eggert@twinsun.com>
5514 * savedir.c (savedir): Work even if directory size is
5515 negative; this can happen with some screwy NFS configurations.
5517 2000-03-06 Jim Meyering <jim@meyering.net>
5519 * localcharset.c (get_charset_aliases): Don't try to free file_name
5520 if it's NULL (because we ran out of memory). From Bruno Haible.
5522 2000-03-05 Jim Meyering <jim@meyering.net>
5524 * localcharset.c ("path-concat.h"): Include.
5525 (get_charset_aliases): Use path_concat instead of ANSI string
5528 * unicodeio.h (PARAMS): Define.
5529 Use it to guard prototype.
5531 2000-03-04 Jim Meyering <jim@meyering.net>
5533 * Makefile.am (install-exec-local): Create $(libdir) before installing
5535 (uninstall-local): Uncomment this rule so `make distcheck' works
5538 * unicodeio.c (<errno.h>): Include it.
5539 (errno): Declare if not defined.
5541 * localcharset.c: Add Bruno's comment justifying use of volatile.
5543 * config.charset: New version, incorporating remarks from a linux
5544 i18n mailing list. From Bruno Haible.
5546 2000-03-02 Jim Meyering <jim@meyering.net>
5548 * Makefile.am (EXTRA_DIST): Add config.charset.
5550 2000-03-01 Jim Meyering <jim@meyering.net>
5552 * localcharset.c: Guard some #includes with `#if HAVE_...'.
5553 * unicodeio.c: Likewise.
5555 2000-02-02 Bruno Haible <haible@clisp.cons.org>
5557 * config.charset: New file.
5558 * localcharset.c: New file.
5559 * unicodeio.h, unicodeio.c: New files.
5560 * Makefile.am (DEFS): Add -DLIBDIR=...
5561 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
5562 (noinst_HEADERS): Add unicodeio.h.
5563 (all-local, install-exec-local, charset.alias): New targets.
5565 2000-02-28 Paul Eggert <eggert@twinsun.com>
5567 * quotearg.c (ALERT_CHAR): New macro.
5568 (quotearg_buffer_restyled): Use it.
5570 2000-02-27 Jim Meyering <jim@meyering.net>
5572 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
5573 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
5575 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
5576 not `#if STDC_HEADERS'.
5577 Declare malloc if needed.
5579 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
5580 now that autoconf always defines the HAVE_DECL_ symbols.
5581 * human.c: Likewise.
5583 * strtoumax.c: Likewise.
5585 * backupfile.c: Arrange for cpp to fail if the configure-time
5586 declaration check was not run.
5588 * human.c: Likewise.
5590 * strtoumax.c: Likewise.
5592 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
5593 then first look up the entire `.'-containing string as a login name.
5595 2000-02-18 Paul Eggert <eggert@twinsun.com>
5597 * getdate.y: Handle two-digit years with leading zeros correctly.
5598 (textint): New typedef.
5599 (parser_control): Member year changed from int to textint.
5601 (YYSTYPE): Removed; replaced by %union with int and textint members.
5602 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
5603 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
5604 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
5605 (tSNUMBER, tUNUMBER): Now of type <textintval>.
5606 (date, number, to_year): Use width of number in digits, not its value,
5607 to determine whether it's a 2-digit year, or a 2-digit time.
5608 (yylex): Store number of digits of numeric tokens.
5609 Reported by John Kendall.
5611 (parser_control): Changed from struct parser_control to typedef (for
5612 consistency). All uses changed.
5614 (tID): Removed; not used.
5615 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
5617 2000-02-14 Paul Eggert <eggert@twinsun.com>
5619 * getpagesize.h (getpagesize): Port to VMS for Alpha;
5620 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
5622 2000-02-12 Jim Meyering <jim@meyering.net>
5624 * userspec.c (ISDIGIT): Define it.
5625 (isdigit): Remove definition.
5626 (is_number): Use ISDIGIT, not isdigit.
5627 <libintl.h>: Include.
5629 (parse_user_spec): Mark translatable strings.
5631 2000-02-10 Jim Meyering <jim@meyering.net>
5633 With these changes, nanosleep.[ch] are finally enough like the other
5634 lib/* replacement files to compile on a few more losing systems.
5636 * nanosleep.h: Don't include config.h.
5637 Remove prototype from declaration of nanosleep.
5638 (PARAMS): Remove now-unneeded definition.
5639 * nanosleep.c: #undef nanosleep.
5640 (rpl_nanosleep): Rename from nanosleep.
5642 2000-02-03 Jim Meyering <jim@meyering.net>
5644 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
5645 rather than with `#if HAVE_UTMPNAME'.
5647 2000-02-01 Jim Meyering <jim@meyering.net>
5649 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
5651 2000-01-31 Jim Meyering <jim@meyering.net>
5653 * nanosleep.h (nanosleep): Guard declaration with
5654 `#if ! HAVE_DECL_NANOSLEEP'.
5655 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
5656 the declaration in that vendor's sys/timers.h.
5657 Reported by Christian Krackowizer.
5659 * quotearg.c (ISASCII): Add #undef and move definition to follow
5660 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
5661 (ISPRINT): Likewise.
5662 Reported by Tom Tromey.
5664 2000-01-30 Jim Meyering <jim@meyering.net>
5666 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
5667 uses of ->ut_name. The latter doesn't work with new Linux header files
5668 where only utmpx.ut_user is declared.
5670 * readutmp.h (UT_USER): Define.
5672 2000-01-23 Jim Meyering <jim@meyering.net>
5674 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
5677 2000-01-22 Jim Meyering <jim@meyering.net>
5679 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
5680 [! HAVE_DECL_STRTOULL]: Declare strtoull.
5681 Required for some AIX systems. Reported by Christian Krackowizer.
5682 [TESTING] (main): New function.
5684 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
5685 * dirname.c (dir_name): Support for DOS-style file names with drive
5688 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
5690 * strverscmp.c (ISDIGIT): Define.
5691 (strverscmp): Use ISDIGIT, not isdigit.
5693 2000-01-17 Paul Eggert <eggert@twinsun.com>
5695 * nanosleep.c (nanosleep):
5696 Don't use SA_INTERRUPT to decide whether to call sigaction, as
5697 POSIX.1 doesn't require SA_INTERRUPT and some systems
5698 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
5699 it's been part of POSIX.1 since day 1 (in 1988).
5701 2000-01-17 Jim Meyering <jim@meyering.net>
5703 * interlock: Remove unused file. Reported by François Pinard.
5705 2000-01-16 Paul Eggert <eggert@twinsun.com>
5707 * quotearg.c (quotearg_buffer_restyled): Do not quote
5708 alert, backslash, formfeed, and vertical tab unnecessarily in
5709 shell quoting style.