1 2002-06-22 Paul Eggert <eggert@twinsun.com>
3 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4 Do not assume SA_SIGINFO behavior.
5 Bug reported by Jim Meyering on NetBSD 1.5.2.
7 2002-06-22 Jim Meyering <meyering@lucent.com>
9 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
11 * exitfail.c, exitfail.h: Likewise.
12 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
14 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
16 (EXTRA_DIST): Add fnmatch_loop.c.
17 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
19 * fnmatch_loop.c: New file, from diffutils-2.8.2.
20 * fnmatch.c: Update from diffutils-2.8.2.
21 * fnmatch_.h: New file. From diffutils-2.8.2.
22 * fnmatch.h: Remove file.
24 2002-06-18 Paul Eggert <eggert@twinsun.com>
26 * file-type.h: Report an error if neither S_ISREG nor
27 S_IFREG is defined, instead of using a test specific to glibc
28 2.2. This should be safe, since POSIX requires S_ISREG and
29 Unix Version 7 had S_IFREG. We don't need to check for
30 <sys/types.h> since we don't use any symbols that it defines.
32 2002-06-15 Jim Meyering <meyering@lucent.com>
34 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
35 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
36 have been included before this file.
38 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
40 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
41 so that each temporary file name is unique and valid in the first
42 8 characters, for operation under DOS.
44 2002-06-15 Jim Meyering <meyering@lucent.com>
46 Work even with DJGPP 2.03, which lacks support for symlinks.
48 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
50 * lchown.c (S_ISLNK): Likewise.
52 2002-06-14 Jim Meyering <meyering@lucent.com>
54 * file-type.h: Use the version from diffutils-2.8.2.
55 * file-type.c: Likewise.
57 2002-05-27 Jim Meyering <meyering@lucent.com>
59 Fix a problem seen only on nonconforming systems whereby ls.c's
60 use of localtime, and then of gettimeofday would cause trouble:
61 the localtime call used to initialize rpl_gettimeofday's save
62 mechanism would clobber ls's current local time information so
63 that in any long listing the first file would always be listed
64 with date 1970-01-01. Analysis by Volker Borchert.
66 * gettimeofday.c (localtime): Undefine.
67 (rpl_localtime): New function.
69 2002-05-22 Jim Meyering <meyering@lucent.com>
71 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
72 * file-type.h: New file.
73 * file-type.c (file_type): New file/function. Extracted from diffutils.
75 2002-04-29 Paul Eggert <eggert@twinsun.com>
77 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
79 2002-04-28 Paul Eggert <eggert@twinsun.com>
81 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
82 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
83 of 127, since 64 is the largest conceivable number for ancient
85 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
87 2002-04-28 Jim Meyering <meyering@lucent.com>
89 * sig2str.c (WTERMSIG): Remove definition (unused).
91 2002-04-28 Paul Eggert <eggert@twinsun.com>
93 * sig2str.h, sig2str.c: New files.
94 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
96 2002-04-24 Jim Meyering <meyering@lucent.com>
98 * gettext.h: New file, from Gettext.
99 * Makefile.am (INCLUDES): Remove -I../intl.
100 (libfetish_a_SOURCES): Add gettext.h.
102 2002-04-16 Jim Meyering <meyering@lucent.com>
104 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
105 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
106 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
108 2002-04-12 Jim Meyering <meyering@lucent.com>
110 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
112 2002-03-10 Jim Meyering <meyering@lucent.com>
114 * makepath.c (make_path): Remove a comma from a diagnostic.
115 Suggestion from Santiago Vila.
117 2002-03-08 Jim Meyering <meyering@lucent.com>
119 * rename.c: Mention that this wrapper is needed also on
120 mips-dec-ultrix4.4 systems.
122 2002-03-02 Jim Meyering <meyering@lucent.com>
124 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
125 not HAVE_CLOCK_SETTIME.
127 2002-02-27 Paul Eggert <eggert@twinsun.com>
129 * nanosleep.h: Rename to....
130 * timespec.h: New name for nanosleep.h. All uses changed.
132 * gettime.c: New file.
133 * settime.c: New file.
136 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
137 timespec.h. Remove nanosleep.h.
139 2002-02-25 Paul Eggert <eggert@twinsun.com>
141 * acl.c, acl.h: New files.
142 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
144 2002-02-24 Jim Meyering <meyering@lucent.com>
146 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
147 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
148 cause trouble. Reported by Nelson Beebe.
150 2002-02-23 Paul Eggert <eggert@twinsun.com>
152 * path-concat.c (xpath_concat): Reorder code to pacify
153 compilers that don't know that xalloc_die never returns.
155 2002-02-20 Jim Meyering <meyering@lucent.com>
157 * getdate.c: Regenerate using bison-1.33.
159 2002-02-15 Paul Eggert <eggert@twinsun.com>
161 * posixver.c, posixver.h: New files.
162 * Makefile.am (libfetish_a_SOURCES): Add them.
164 2002-02-02 Paul Eggert <eggert@twinsun.com>
165 Bruno Haible <bruno@clisp.org>
167 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
168 (fwrite_success_callback): New declaration.
169 * unicodeio.c (unicode_to_mb): New function, extracted from
170 print_unicode_char. Call failure callback instead of error.
171 (fwrite_success_callback): New function.
172 (exit_failure_callback): New function.
173 (fallback_failure_callback): New function.
174 (print_unicode_char): Call unicode_to_mb.
176 2002-01-26 Jim Meyering <meyering@lucent.com>
178 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
180 2002-01-22 Jim Meyering <meyering@lucent.com>
182 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
183 Otherwise, some versions of automake would omit the rule that makes
184 Makefile from Makefile.in.
186 2001-01-21 Paul Eggert <eggert@twinsun.com>
188 * xmemcoll.h, xmemcoll.c: New files.
189 * Makefile.am (libfetish_a_SOURCES): Add them.
190 * memcoll.c: Include errno.h, and declare errno if not defined.
191 (memcoll): Set errno to zero if there is no error.
193 * quotearg.c (quotearg_buffer_restyled):
194 Fix bug with quoting buffers containing NUL when backslashing escapes.
195 This bug was exposed by the other changes in this patch.
196 (quotearg_n_options): New arg ARGSIZE.
198 (quoting_options_from_style): New function.
199 (quotearg_n_style): Use it.
200 (quotearg_n_style_mem): New function.
202 * quotearg.h (quotearg_n_style_mem): New function.
204 2002-01-16 Jim Meyering <meyering@lucent.com>
206 * getdate.y: Add three semicolons, each just before a closing brace.
207 Bison (as of version 1.31) no longer papers over that mistake.
209 2002-02-14 Paul Eggert <eggert@twinsun.com>
211 * backupfile.c (ISDIGIT): Comment fix.
212 * getdate.y (ISDIGIT): Likewise.
213 * posixtm.c (ISDIGIT, year): Likewise.
214 * strverscmp.c (ISDIGIT): Likewise.
215 * userspec.c (ISDIGIT): Likewise.
217 2002-01-05 Jim Meyering <meyering@lucent.com>
219 * version-etc.c (version_etc_copyright): Update copyright year.
221 2001-01-19 Paul Eggert <eggert@twinsun.com>
223 * closeout.c (close_stdout_status): If ferror (stdout), do
224 not silently exit merely because the output buffer happens to
225 have nothing pending.
227 2001-12-18 Paul Eggert <eggert@twinsun.com>
229 See the big note in ../ChangeLog.
230 * human.c (suffixes): Prefer K to k for 1024.
231 (generate_suffix_backwards): New function.
232 (human_readable_inexact): Use it.
233 * xstrtol.c (__xstrtol): If there is no number but there
234 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
235 Accept 'K' as well as 'k'.
237 2001-12-15 Jim Meyering <meyering@lucent.com>
239 * regex.h (__restrict_arr): Update from libc.
241 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
242 as `remote' if the name starts with `//'. Suggested by Michael Stone.
245 2001-12-10 Jim Meyering <meyering@lucent.com>
247 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
248 Instead, include "xalloc.h".
249 (initbuffer): Don't cast xmalloc return value to char*.
250 (readline): Reword comment.
251 Don't cast xrealloc return value to char*
254 2001-12-09 Jim Meyering <meyering@lucent.com>
256 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
257 `signed and unsigned type in conditional expression'.
258 * posixtm.c (posix_time_parse): Likewise.
260 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
262 * readtokens.c (readtoken): Declare an index to be of type unsigned
263 to avoid a pedantic warning.
265 * getstr.c: Don't include assert.h.
266 (getstr): Remove warning-evoking assertions.
267 Return -1 if offset parameter is out of bounds.
268 Change the type of a local from int to size_t.
270 * strftime.c (my_strftime_localtime_r): Include this function
271 definition in the `#if ! HAVE_TM_GMTOFF' block.
273 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
274 Include xalloc.h instead.
276 2001-12-02 Jim Meyering <meyering@lucent.com>
278 * tempname.c: Don't declare getenv, thus reverting the change of
279 2001-11-18. It's no longer necessary, now that stdlib.h is always
282 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
283 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
285 2001-11-30 Akim Demaille <akim@epita.fr>
287 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
288 before being defined.
290 2001-11-27 Paul Eggert <eggert@twinsun.com>
292 * quotearg.h (quotearg_n, quotearg_n_style):
293 First arg is int, not unsigned.
294 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
295 (SIZE_MAX, UINT_MAX): New macros.
296 (quotearg_n_options): Abort if N is negative.
297 Avoid overflow check on hosts where size_t is 64 bits and int
298 is 32 bits, as overflow is impossible there.
299 Fix off-by-one typo that caused unnecessary reallocation.
301 2001-11-27 Jim Meyering <meyering@lucent.com>
303 * tempname.c: Merge with version from libc.
306 * tempname.c: Include stdlib.h unconditionally. On some old systems
307 for which STDC_HEADERS is 0, it was not included, resulting in a
308 warning about an integer-to-pointer conversion problem with getenv.
309 Reported by Volker Borchert.
311 2001-11-26 Jim Meyering <meyering@lucent.com>
313 * gtod.h: Remove file.
314 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
315 * gettimeofday.c: Don't include gtod.h.
316 (GTOD_init): Remove function.
317 (rpl_gettimeofday): Do its job here instead, rather than aborting.
318 Suggestion from Volker Borchert.
320 2001-11-23 Jim Meyering <meyering@lucent.com>
322 * hash.h (struct hash_table): Don't define here. Merely declare it.
323 * hash.c (struct hash_table): Define it here instead.
325 2001-11-22 Jim Meyering <meyering@lucent.com>
327 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
329 2001-11-18 Paul Eggert <eggert@twinsun.com>
331 * tempname.c (TMP_MAX): Remove; no longer needed.
332 (TEMPORARIES): New macro.
333 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
334 removes an artificial limitation (e.g. HP-UX 10.20, where
337 2001-11-18 Jim Meyering <meyering@lucent.com>
339 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
342 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
343 files will be created before anything else.
345 2001-11-17 Jim Meyering <meyering@lucent.com>
347 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
348 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
349 rather than group writable. Patch by Juan F. Codagnone.
351 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
352 Instead, include "xalloc.h".
354 * mountlist.c: Include unlocked-io.h after all system headers.
355 Remove explicit declarations of xmalloc, xrealloc,
356 and xstrdup. Instead, include "xalloc.h".
358 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
359 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
360 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
362 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
363 Reported by Padraig Brady.
365 * mkstemp.c: #undef mkstemp.
367 (rpl_mkstemp): Rename from mkstemp.
370 2001-11-16 Jim Meyering <meyering@lucent.com>
372 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
373 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
374 determine the amount of total physical memory, use pstat_getstatic.
375 HPUX-11 doesn't define _SC_PHYS_PAGES.
376 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
377 If sysconf couldn't be used to determine the amount of available
378 physical memory, use both pstat_getstatic and pstat_getdynamic.
379 Based on a patch from Bob Proulx.
381 2001-11-05 Jim Meyering <meyering@lucent.com>
383 * xstat.in (slash_aware_lstat): Correct a misleading comment.
385 2001-11-03 Jim Meyering <meyering@lucent.com>
387 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
388 in argmatch_to_argument call.
390 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
393 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
394 e.g., a fault due to an attempt to free a NULL pointer.
396 2001-11-01 Jim Meyering <meyering@lucent.com>
398 * dirfd.c, dirfd.h: New files.
399 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
401 * hash.c (hash_print) [TESTING]: Clean up.
403 2001-10-22 Paul Eggert <eggert@twinsun.com>
405 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
406 to avoid a warning if -Wall.
408 2001-10-21 Paul Eggert <eggert@twinsun.com>
410 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
412 2001-10-21 Jim Meyering <meyering@lucent.com>
414 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
415 this code would end up calling gettext even in packages built
417 * getopt.c (_): Likewise.
418 * regex.c (_): Likewise.
420 2001-10-20 Paul Eggert <eggert@twinsun.com>
422 * error.c (strerror_r): Do not declare unless !_LIBC.
423 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
424 Use strerror_r that is only a macro, even if it is not a function.
425 (strerror): Check for HAVE_DECL_STRERROR before declaring.
426 (private_strerror): Use prototypes, not old-style function definition.
427 (print_errno_message): New function.
428 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
430 (error_tail, error, error_at_line): Use it.
432 2001-10-11 Jim Meyering <meyering@lucent.com>
434 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
435 and quote_n (1, ... to avoid clobbering a buffer.
437 2001-10-05 Jim Meyering <meyering@lucent.com>
439 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
440 * hash-pjw.c: New file (factored out of fileutils' remove.c).
441 * hash-pjw.h: New file.
443 2001-09-30 Jim Meyering <meyering@lucent.com>
445 * mountlist.c [MOUNTED_GETFSSTAT]:
446 Include <sys/ucred.h>, for Apple Darwin.
447 Include sys/mount.h and sys/fs_types.h only if available.
449 (read_filesystem_list): Use FS_TYPE.
451 2001-09-29 Paul Eggert <eggert@twinsun.com>
453 * exclude.c (excluded_filename): 0 -> false, since it's
456 2001-09-28 Paul Eggert <eggert@twinsun.com>
458 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
459 #defines strtoimax. Also treat the other strto* functions
462 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
463 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
464 (strtoimax, strtoumax): Do not declare if already defined as a macro.
466 2001-09-26 Jim Meyering <meyering@lucent.com>
468 Most macros in unlocked-io.h had the wrong number of arguments.
469 * gen-uio: New script.
470 (USE_UNLOCKED_IO): Define to 1 if not already defined.
471 * unlocked-io.hin: Remove file.
472 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
473 rather than trying to embed it here.
474 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
475 Reported by Padraig Brady.
477 2001-09-25 Volker Borchert <bt@teknon.de>
479 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
481 2001-09-23 Jim Meyering <meyering@lucent.com>
483 * mountlist.c: Remove useless parentheses in #if directives.
484 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
485 the deprecated MOUNTED symbol is no longer defined in mntent.h.
487 2001-09-22 Jim Meyering <meyering@lucent.com>
489 * localcharset.c: Update from latest gettext.
490 * config.charset: Likewise.
492 2001-09-20 Jim Meyering <meyering@lucent.com>
494 * xstrtol.c (strtoimax): Guard declaration with
495 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
496 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
497 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
498 (strtoumax): Likewise, for completeness (it wasn't necessary).
500 2001-09-06 Paul Eggert <eggert@twinsun.com>
502 * strtoimax.c (HAVE_LONG_LONG):
503 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
504 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
505 to work around bug in IBM C compiler.
507 2001-09-16 Jim Meyering <meyering@lucent.com>
511 2001-09-04 Paul Eggert <eggert@twinsun.com>
513 * xgetcwd.c: Revert some of the previous change; intead,
514 fix the HAVE_GETCWD_NULL code to behave more like the
515 !HAVE_GETCWD_NULL code used to.
518 (xgetcwd): Do not return NULL when memory is exhausted; instead,
521 2001-09-04 Paul Eggert <eggert@twinsun.com>
523 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
524 Use ssize_t, not int, to store result of readlink.
525 Check for ssize_t overflow as well as size_t overflow,
526 as POSIX says the result of readlink is implementation-defined
527 when ssize_t overflows.
528 Remove unnecessary cast to char*.
529 Use free+malloc instead of realloc, as the storage doesn't need
530 to be preserved and it's clearer and can be more efficient that way.
531 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
532 * xreadlink.h (xreadlink): Update prototype.
534 2001-09-03 Paul Eggert <eggert@twinsun.com>
536 * exclude.c (fnmatch_no_wildcards): Fix confusion between
537 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
538 spotted by Jim Meyering.
540 2001-09-03 Jim Meyering <meyering@lucent.com>
542 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
544 2001-09-03 Paul Eggert <eggert@twinsun.com>
546 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
547 like the HAVE_GETCWD_NULL code.
548 Include pathmax.h if not HAVE_GETCWD.
549 Do not include xalloc.h.
550 (INITIAL_BUFFER_SIZE): New symbol.
551 Do not use xmalloc / xrealloc, since the caller is responsible for
552 handling errors. Preserve errno around `free' during failure.
553 Do not overrun buffer when using getwd.
555 2001-09-03 Paul Eggert <eggert@twinsun.com>
557 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
558 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
560 2001-09-02 Jim Meyering <meyering@lucent.com>
562 * error.c: Update from GNU libc.
564 2001-09-01 Jim Meyering <meyering@lucent.com>
566 * xreadlink.c: New file.
567 * xreadlink.h: New file.
568 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
570 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
571 doesn't conflict with sparc-sun-solaris2.7's definition in
572 /usr/include/sys/int_types.h.
574 * exclude.c: Use `""', not `<>' to #include non-system header files.
575 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
576 and strncasecmp as r-values. Unixware didn't have declarations.
578 2001-08-31 Jim Meyering <meyering@lucent.com>
580 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
581 Use an initial, malloc'd, buffer of length 128 rather than
582 a statically allocated one of length 1024.
584 2001-08-30 Paul Eggert <eggert@twinsun.com>
586 * xgetcwd.c: Don't include pathmax.h.
587 Include stdlib.h and unistd.h if available.
589 (xmalloc, xstrdup, free): Remove decls.
590 (xgetcwd): Don't assume sizes fit in unsigned.
591 Check for overflow when computing sizes.
592 Simplify reallocation code.
594 2001-08-28 Paul Eggert <eggert@twinsun.com>
596 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
598 * strtoimax.c: Renamed from strtoxmax.c, removing the
601 Also, make the following further changes to make this file's
602 configuration more similar to that of strtol.c:
603 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
604 (strtoumax, uintmax_t, strtoull, strtol): Remove.
605 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
606 (strtoimax): Renamed from strtoumax. All uses of unsigned values
607 changed to signed values.
609 And make the following changes as well:
610 Fix copyright notice, as 1999 was missing.
612 (strtoimax): Check sizes at compile-time, not run-time.
613 Prefer strtol to strtoll if both work.
614 (main): Remove; it was not that useful and was a pain to maintain.
616 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
618 2001-08-30 Paul Eggert <eggert@twinsun.com>
620 * savedir.c (savedir): Remove size parameter, as POSIX says that
621 a directory's st_size can have an arbitrary value, so the old
622 usage could waste an arbitrary amount of memory. All uses
624 * savedir.h: Update prototype.
626 2001-08-30 Paul Eggert <eggert@twinsun.com>
628 * xstrtol.c (strtoimax): New decl.
630 2001-08-28 Paul Eggert <eggert@twinsun.com>
632 * xstrtol.h: Add copyright notice.
633 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
634 LONGINT_INVALID_SUFFIX_CHAR.
636 2001-08-30 Paul Eggert <eggert@twinsun.com>
638 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
641 2001-08-30 Paul Eggert <eggert@twinsun.com>
643 * hash.c: Remove '2001' from copyright notice.
645 2001-08-30 Paul Eggert <eggert@twinsun.com>
647 * full-write.h: New file.
648 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
649 * full-write.c: Correct credits, as cccp.c no longer
650 exists and anyway it was so heavily changed from the old cccp
651 code as to be unrecognizable. Include full-write.h.
652 (full_write) Return size_t, with short writes meaning failure.
653 All callers changed. This fixes a bug with large buffers
655 * utime.c: Include full-write.h.
657 2001-08-30 Paul Eggert <eggert@twinsun.com>
659 Merge 'exclude' changes from tar 1.13.22.
660 This fixes one or two unlikely storage allocation overflow bugs,
661 but doesn't change user-visible behavior otherwise.
663 2001-08-30 Paul Eggert <eggert@twinsun.com>
665 * exclude.c (bool): Declare, perhaps by including stdbool.h.
666 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
667 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
668 Include if available.
669 (<xalloc.h>): Include
670 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
671 (verify): New macro. Use it to verify that EXCLUDE macros do not
672 collide with FNM macros.
673 (struct patopts): New struct.
674 (struct exclude): Use it, as exclude patterns now come with options.
675 (new_exclude): Support above changes.
676 (new_exclude, add_exclude_file):
677 Initial size must now be a power of two to simplify overflow checking.
678 (free_exclude, fnmatch_no_wildcards): New function.
679 (excluded_filename): No longer requires options arg, as the options
680 are determined by add_exclude. Now returns bool, not int.
681 (excluded_filename, add_exclude):
682 Add support for the fancy new exclusion options.
683 (add_exclude, add_exclude_file): Now takes int options arg.
684 Check for arithmetic overflow when computing sizes.
685 (add_exclude_file): xrealloc might modify errno, so don't
686 realloc until after errno might be used.
688 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
690 (free_exclude): New decl.
691 (add_exclude, add_exclude_file): Now takes int options arg.
692 (excluded_filename): No longer requires options arg, as the options
693 are determined by add_exclude. Now returns bool, not int.
695 2001-08-30 Paul Eggert <eggert@twinsun.com>
697 * alloca.c (alloca): Arg is of type size_t, not unsigned.
699 2001-08-27 Jim Meyering <meyering@lucent.com>
701 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
703 * version-etc.c (N_): Remove definition.
704 Revert most of last change.
705 Instead, simply don't mark the `Copyright...' string for translation.
706 Based on advice from Paul Eggert.
708 * strtoxmax.c: Tweak comment.
710 2001-08-26 Jim Meyering <meyering@lucent.com>
712 * version-etc.c (version_etc_copyright_fmt): Replace literal year
713 of copyright with `%s' so translators don't get an untranslated
715 (COPYRIGHT_YEAR): Define.
716 (version_etc): Use fprintf rather than fputs.
717 Suggestion from Ulrich Drepper.
719 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
721 * strtoll.c: New file, from GNU libc.
722 * xstrtoimax.c: New file.
724 * xstrtol.h: Add xstrtoimax.
725 * strtoumax.c: New file. Simply include "strtoumax.c".
726 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
728 * strtoumax.c: Factor to work both for unsigned and signed types, ...
729 * strtoxmax.c: ... then renamed to this.
731 2001-08-13 Paul Eggert <eggert@twinsun.com>
733 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
734 Port to Solaris 8, where 'sed' requires a space after the 'r'
735 command, and where sh dislikes "$/". Clean up the spacing a bit.
736 Redirect output to $tmp just once.
738 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
740 * addext.c (<errno.h>): Include.
741 (errno): Declare if not defined.
742 (addext): Work correctly when pathconf returns -1 and leaves
743 errno alone because there is no limit. Also, work even if
744 pathconf returns a value greater than SIZE_MAX.
746 2001-08-12 Jim Meyering <meyering@lucent.com>
748 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
749 Simply `return getcwd (NULL, 0);'.
750 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
751 Use 1300 as initial value for length, not PATH_MAX.
753 * pathmax.h: Clean up cpp syntax.
755 2001-08-12 Jim Meyering <meyering@lucent.com>
757 * gettimeofday.c: New file.
759 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
761 2001-08-04 Jim Meyering <meyering@lucent.com>
763 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
764 to get in sync with glibc.
766 2001-08-03 Paul Eggert <eggert@twinsun.com>
768 The following changes are from gettext 0.10.39 as maintained by
771 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
772 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
773 with inverted sense. All uses changed.
775 * mbswidth.c: Don't include <limits.h>.
776 Include <stdlib.h> and <string.h> unconditionally.
777 (iswcntrl, mbsinit, ISCNTRL): New macros.
778 (mbsnwidth): Use K&R style function declarations.
779 Don't bother checking for MB_LEN_MAX == 1, since the compiler
780 can optimize it when MB_CUR_MAX == 1.
781 The width of control characters is zero, not 1.
783 2001-07-15 Jim Meyering <meyering@lucent.com>
785 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
786 (BUILT_SOURCES): Add unlocked-io.h.
787 (io_functions): Define.
788 (unlocked-io.h): New rule.
789 (DISTCLEANFILES): Add unlocked-io.h.
790 (all-local): Depend on unlocked-io.h, to ensure it is created.
792 * unlocked-io.hin: New file
794 * regex.c: Update from glibc.
796 2001-07-05 Jim Meyering <meyering@lucent.com>
798 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
800 (libfetish_a_SOURCES): Put all .h files here instead.
801 Remove a thus-exposed (better checks in automake) duplicate and
802 two unnecessary .h files.
804 2001-06-11 Jim Meyering <meyering@lucent.com>
806 * regex.c: Update from GNU libc.
808 2001-05-27 Jim Meyering <meyering@lucent.com>
810 * readutmp.h (UT_TYPE): Define.
812 2001-05-24 Jim Meyering <meyering@lucent.com>
814 * argmatch.c: Include "quote.h".
815 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
816 quote function. Reported by Göran Uddeborg.
818 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
820 * dirname.c (dir_name): Compute append_dot using path, not newpath
821 which is not yet declared.
823 2001-05-11 Paul Eggert <eggert@twinsun.com>
825 * Makefile.am (libfetish_a_SOURCES):
826 Add strftime.c, since we now compile it on all hosts.
828 * strftime.c (my_strftime):
829 Define to nstrftime if emacs, but only if my_strftime is not defined.
830 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
831 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
832 Add one more extra argument: a nanoseconds value.
835 (my_strftime function): Add %N format.
836 (emacs_strftimeu): Renamed from emacs_strftime,
837 with extra ut argument.
839 2001-05-11 Paul Eggert <eggert@twinsun.com>
841 dirname code cleanup. base_name now behaves more compatibly
842 with POSIX basename when given file names that have trailing
843 slashes, and similarly for dir_name. Add new primitives
844 base_len and dir_len. Put the directory-name-related decls
847 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
848 * backupfile.c (base_name): Likewise.
849 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
850 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
851 * makepath.c (strip_trailing_slashes): Likewise.
852 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
854 * rename.c (strip_trailing_slashes): Likewise.
855 * same.c (base_name): Likewise.
856 * stripslash.c (ISSLASH): Likewise.
858 * addext.c: Include <dirname.h> after size_t is defined.
859 * backupfile.c: Likewise.
861 * addext.c (addext): Use base_len to trim redundant
862 trailing slashes instead of doing it ourselves.
863 But do not trim the last slash if it is not redundant.
865 * backupfile.c (find_backup_file_name,
866 max_backup_version): Use base_len instead of rolling it ourselves.
867 Handle the case of "" and (on DOS) "C:" correctly.
869 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
870 Include <string.h>, <dirname.h>.
871 (base_name): Allow file names ending in slashes, other than names
872 that are all slashes. In this case, return the basename followed
873 by the slashes. This is more general, and can be used in places
874 where the original base_name purposely had an assertion failure.
875 (base_len): New function.
877 * dirname.c: Include <string.h> instead of <stdlib.h>.
878 Do not include <assert.h>; no longer needed.
880 (memrchr): Remove decl.
881 (dir_name_r): Remove.
882 (dir_len): Renamed from dirlen. All callers changed.
883 Rewrite in terms of base_name, for simplicity and consistency.
884 (dir_name): Never return NULL. All callers changed.
885 Do not include <stdlib.h> in test program; no longer needed.
886 return 0; is fine for test program.
888 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
890 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
892 * path-concat.c (path_concat): Use base_len to compute
893 base length, not strlen; this means we cannot rely on memcpy
896 * same.c (STREQ): Remove.
897 (same_name): Handle the case where the basename ends in trailing '/'.
899 * stripslash.c (strip_trailing_slashes): Return nonzero if
900 a slash was stripped. Do not strip the last slash after a
903 2001-04-08 Jim Meyering <meyering@lucent.com>
905 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
906 recomputed; that's necessary when the offset spans a DST transition.
907 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
909 2001-04-02 Jim Meyering <meyering@lucent.com>
911 * regex.h, regex.c: Update from GNU libc.
913 2001-03-19 Paul Eggert <eggert@twinsun.com>
915 * version-etc.c (version_etc_copyright): Update to 2001.
917 2001-03-16 Paul Eggert <eggert@twinsun.com>
919 * tempname.c (uint64_t): Define to uintmax_t if
920 not defined, and if UINT64_MAX is not defined.
921 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
922 Reported by John David Anglin.
924 2001-03-10 Bruno Haible <haible@clisp.cons.org>
926 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
927 alias if codeset is empty.
928 * config.charset (BeOS): Use wildcard syntax.
930 2001-03-13 Jim Meyering <meyering@lucent.com>
932 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
933 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
936 2001-03-06 Bruno Haible <haible@clisp.cons.org>
938 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
940 * unicodeio.c (print_unicode_char): Simplify accordingly.
942 2001-03-06 Bruno Haible <haible@clisp.cons.org>
944 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
945 support for DOS/DJGPP.
947 2001-02-28 Paul Eggert <eggert@twinsun.com>
949 * Makefile.am (libfetish_a_SOURCES):
950 Add dup-safer.c, fopen-safer.c.
951 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
953 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
955 2001-02-25 Paul Eggert <eggert@twinsun.com>
957 The mkstemp replacement is taken from glibc 2.2.2, with some
958 portability fixes for use outside glibc, as follows:
960 * tempname.c (struct_stat64): New macro.
961 (direxists, __gen_tempname): Use it.
962 This avoids a portability problem with Solaris 8.
964 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
965 (<stddef.h>, <stdint.h>, <string.h>):
966 Include only if STDC_HEADERS || _LIBC.
967 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
968 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
969 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
970 (__set_errno): Define this macro if <errno.h> doesn't.
971 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
972 Define these macros if <stdio.h> doesn't.
973 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
974 Define these macros if <sys/stat.h>
975 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
976 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
977 __xstat64): Define if not _LIBC.
978 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
979 (__gen_tempname): Invoke gettimeofday only if
980 HAVE_GETTIMEOFDAY || _LIBC;
981 otherwise, fall back on plain "time".
982 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
984 * mkstemp.c (__GT_FILE): Define to zero if not defined.
986 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
988 2001-02-17 Jim Meyering <meyering@lucent.com>
990 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
991 around included file name.
993 * strnlen.c (__strnlen): Merge in a change from GNU libc.
995 * strftime.c: Update from GNU libc (the only changes were to comments).
997 2001-02-13 Bruno Haible <haible@clisp.cons.org>
999 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
1001 2001-02-17 Paul Eggert <eggert@twinsun.com>
1003 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
1004 Remove workaround macros for hosts that have mbrtowc but not
1005 mbstate_t, as we now insist on proper declarations for both
1006 before using mbrtowc.
1008 2001-02-17 Jim Meyering <meyering@lucent.com>
1010 * regex.c: Update from libc.
1012 2001-02-16 Paul Eggert <eggert@twinsun.com>
1014 * alloca.c (malloc): Undef before defining, since stdlib.h
1015 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
1016 Reported by Mark Hounschell via Paul Eggert.
1018 2001-01-30 Bruno Haible <haible@clisp.cons.org>
1020 * config.charset: Update for FreeBSD 4.2.
1022 2001-01-26 Jim Meyering <meyering@lucent.com>
1024 * quotearg.c: Include stddef.h.
1025 * quote.c: Include stddef.h.
1026 Reported by Axel Kittenberger.
1028 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
1029 line in double quotes so that it evokes a better diagnostic.
1030 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
1031 Reported by Axel Kittenberger.
1033 2001-01-15 Bruno Haible <haible@clisp.cons.org>
1035 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
1036 to avoid a warning. Add back 'const' to inptr.
1038 2001-01-16 Jim Meyering <meyering@lucent.com>
1040 * basename.c: Include <stdio.h>, needed by assert on SunOS4.
1043 2001-01-14 Jim Meyering <meyering@lucent.com>
1045 * rename.c: New file. From Volker Borchert.
1046 Include stdlib.h, string.h or strings.h, and xalloc.h.
1047 Use strip_trailing_slashes rather than open-coding it.
1049 2001-01-03 Paul Eggert <eggert@twinsun.com>
1051 * strftime.c: Sync with glibc time/strftime.c 1.81.
1053 2001-01-03 Jim Meyering <meyering@lucent.com>
1055 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
1056 local `inptr' to avoid warning with some system declarations of iconv.
1058 2000-12-29 Paul Eggert <eggert@twinsun.com>
1060 * modechange.c: Do not assume that mode_t uses the
1061 traditional octal encoding. E.g. "chmod 1 FOO" should set
1062 the other-execute bit of FOO even if S_IXOTH != 1.
1064 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
1065 WOTH, XOTH, ALLM): New macros.
1066 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
1067 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
1069 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
1070 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
1072 No need to use uintmax_t; unsigned long is long enough.
1073 Don't bother to get suffix since we don't use it.
1075 2000-12-24 Jim Meyering <meyering@lucent.com>
1077 * hash.c (is_prime): Return explicit boolean values.
1078 (hash_get_first): Return NULL to appease Irix5.6's 89.
1079 Reported by Nelson Beebe.
1081 2000-10-31 Bruno Haible <haible@clisp.cons.org>
1083 * localcharset.c (locale_charset): Add support for Win32.
1085 2000-12-18 Paul Eggert <eggert@twinsun.com>
1087 * physmem.h, physmem.c: New files.
1089 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
1090 (noinst_HEADERS): Add physmem.h.
1092 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
1093 't' for compatibility with Solaris 8 sort.
1095 2000-12-18 Bruno Haible <haible@clisp.cons.org>
1097 * config.charset: Add support for BeOS.
1099 2000-12-16 Jim Meyering <meyering@lucent.com>
1101 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
1102 SHELLS_FILE to a file name that's useful on djgpp systems.
1104 (ADDITIONAL_DEFAULT_SHELLS): Define.
1105 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
1106 Based mostly on a patch from Prashant TR.
1108 2000-12-16 Jim Meyering <meyering@lucent.com>
1110 This bug had a serious impact on chown: `chown N:M FILE' (for integer
1111 N and M) would have treated it like `chown N:N FILE'.
1113 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
1115 2000-10-31 Bruno Haible <haible@clisp.cons.org>
1117 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
1118 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
1119 to the list of canonical encodings. Rename EUC-CN to GB2312.
1121 2000-12-08 Andreas Schwab <schwab@suse.de>
1123 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
1124 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
1126 2000-12-07 Jim Meyering <meyering@lucent.com>
1128 * stripslash.c (ISSLASH): Define.
1129 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
1132 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
1133 (dir_name_r): Declare this function as static.
1134 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
1135 manifest itself on a name containing a mix of slashes and
1137 Make this function work with names starting with a DOS-style
1138 drive letter and colon prefix.
1139 (dir_name): Append `.' if necessary.
1140 Based mostly on patches from Prashant TR and Eli Zaretskii.
1142 * dirname.h (dir_name_r): Remove prototype.
1144 2000-12-05 Jim Meyering <meyering@lucent.com>
1146 * dirname.c (dir_name_r): Add `const' in a few local declarations.
1148 2000-12-04 Jim Meyering <meyering@lucent.com>
1150 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
1151 Also include memory.h, stdlib.h, unistd.h if appropriate.
1152 Reported by Andreas Jaeger (conflicting declaration of malloc).
1154 2000-12-02 Jim Meyering <meyering@lucent.com>
1156 * closeout.h: Make idempotent, to avoid some obscure warnings.
1158 2000-12-01 Paul Eggert <eggert@twinsun.com>
1160 * memrchr.c: Include <config.h> before any system include file.
1162 2000-11-29 Paul Eggert <eggert@twinsun.com>
1164 * dirname.c (dir_name_r): Fix typo: int -> size_t.
1166 2000-11-26 Jim Meyering <meyering@lucent.com>
1168 * memcoll.c: Include sys/types.h. From Werner Almesberger.
1170 2000-11-22 Paul Eggert <eggert@twinsun.com>
1172 * strftime.c (my_strftime): Do not invoke mbrlen with a
1173 size of (size_t) -1; it's not portable.
1175 2000-11-17 Akim Demaille <akim@epita.fr>
1177 * obstack.h: Formatting changes.
1178 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
1179 prevent type checking.
1180 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
1181 cast the value to (void *): assigning a `foo *' to a `void *'
1183 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
1185 2000-11-17 Jim Meyering <meyering@lucent.com>
1187 * strstr.c: Update from GNU libc.
1189 2000-11-16 Jim Meyering <meyering@lucent.com>
1191 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
1193 2000-11-11 Jim Meyering <meyering@lucent.com>
1195 * error.c: Add a couple #includes, merging from GNU libc version.
1197 2000-11-10 Jim Meyering <meyering@lucent.com>
1199 * obstack.h: Update from GNU libc.
1200 * obstack.c: Likewise.
1202 2000-11-06 Paul Eggert <eggert@twinsun.com>
1204 * getusershell.c (setusershell): Use rewind rather than
1205 fseek/fseeko, to avoid configuration hassles with fseeko.
1206 Don't bother opening SHELLS_FILE if shellstream is NULL;
1209 2000-11-05 Jim Meyering <meyering@lucent.com>
1211 * makepath.h (make_dir): Declare.
1212 * makepath.c (make_dir): Remove `static' attribute.
1215 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
1217 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
1218 last one in a bucket, advance to the next bucket.
1220 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
1222 * fnmatch.c: Do not comment out all the code if we are using
1223 the GNU C library, because in some cases we are replacing buggy
1224 code in the GNU C library itself.
1226 2000-10-30 Paul Eggert <eggert@twinsun.com>
1228 * error.h, getline.h, modechange.h:
1229 Remove "2000" from Copyright line, as the file hasn't been
1230 changed this year other than in the copyright notice.
1232 * xalloc.h: Add "2000" to Copyright line, as this file
1233 was changed this year.
1235 2000-10-30 Paul Eggert <eggert@twinsun.com>
1237 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
1238 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
1239 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
1241 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
1243 * regex.h (__restrict_arr): Move definition out of #ifndef block.
1244 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
1245 doesn't define __restrict_arr.
1247 2000-10-29 Jim Meyering <meyering@lucent.com>
1249 * xstat.in: Fix grammar in comment.
1251 2000-10-28 Jim Meyering <meyering@lucent.com>
1253 * memchr.c: Update from libc.
1254 Adjust for portability:
1255 [HAVE_STDLIB_H]: Include stdlib.h.
1256 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
1257 Undef __memchr, too.
1258 [!weak_alias]: Define __memchr to memchr.
1260 * regex.c: Update from libc.
1261 * regex.h: Likewise.
1262 * getopt1.c: Likewise.
1263 * memcmp.c: Likewise.
1265 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
1266 Avoid using fseek, when possible -- it's broken by design.
1267 Patch by Ulrich Drepper.
1269 2000-10-26 Jim Meyering <meyering@lucent.com>
1271 * strftime.c: Update from libc.
1273 2000-10-25 Jim Meyering <meyering@lucent.com>
1275 * obstack.c: Update from libc.
1277 2000-10-23 Jim Meyering <meyering@lucent.com>
1279 * hard-locale.c (hard_locale): Revert last change -- it was simply
1280 wrong. That set_locale call must not have any side effects.
1283 2000-10-22 Jim Meyering <meyering@lucent.com>
1285 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
1286 [CYCLIC]: Remove now-unused definition.
1288 * save-cwd.c (O_DIRECTORY): Define, if needed.
1289 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
1290 Suggestion from Ulrich Drepper.
1292 2000-10-21 Jim Meyering <meyering@lucent.com>
1294 * dirname.c (dir_name_r): New function, factored out of dir_name.
1295 (dir_name): Use dir_name_r.
1296 * dirname.h (dir_name_r): Declare it.
1298 2000-10-21 Jim Meyering <meyering@lucent.com>
1300 * dirname.c (memrchr): Declare if necessary.
1301 (dir_name): Remove the restriction that there be no
1302 trailing slashes. Now, this code skips past them, effectively
1304 [TEST_DIRNAME] (main): New unit tests.
1306 * memrchr.c: New file from GNU libc.
1307 Undef __memrchr, too.
1308 [!weak_alias]: Define __memrchr to memrchr.
1309 Guard weak_alias use with `#ifdef weak_alias'.
1311 2000-10-17 Jim Meyering <meyering@lucent.com>
1313 * quote.h (PARAMS): Define and use.
1314 Reported by Akim Demaille.
1316 * getopt.c: Update from libc.
1318 2000-10-16 Jim Meyering <meyering@lucent.com>
1320 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
1323 2000-09-25 Jim Meyering <meyering@lucent.com>
1325 * md5.h (rol): Define (from GnuPG).
1327 * sha.c: Give credit (GnuPG) where due.
1328 (M): Use rol rather than open-coding it.
1329 Add a FIXME comment.
1331 2000-09-21 Jim Meyering <meyering@lucent.com>
1333 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
1334 Reported by Michael Stone.
1336 2000-09-20 Jim Meyering <meyering@lucent.com>
1338 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
1339 (noinst_HEADERS): Add sha.h.
1340 Based on code from Scott G. Miller and from GnuPG.
1342 2000-09-15 Jim Meyering <meyering@lucent.com>
1344 * regex.c: Update from libc.
1346 2000-09-10 Jim Meyering <meyering@lucent.com>
1348 * getopt.c (_getopt_internal): Update from glibc.
1350 2000-09-09 Jim Meyering <meyering@lucent.com>
1352 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
1353 think it should be used as a general replacement for isascii.
1354 * fnmatch.c: Likewise.
1355 * mbswidth.c: Likewise
1356 * regex.c: Likewise.
1359 * userspec.c: Include sys/param.h and limits.h.
1361 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
1362 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
1363 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
1364 UID, GID. Check range.
1366 2000-09-06 Jim Meyering <meyering@lucent.com>
1368 * getopt.c (_getopt_internal): Update from glibc.
1370 2000-08-30 Jim Meyering <meyering@lucent.com>
1372 * strftime.c: Merge in changes from GNU libc.
1374 2000-08-26 Jim Meyering <meyering@lucent.com>
1376 * closeout.c: Include "__fpending.h".
1377 (close_stdout_status): Return right away if there's nothing to flush.
1379 * Makefile.am (noinst_HEADERS): Add __fpending.h.
1380 * __fpending.c: New file.
1381 * __fpending.h: New file.
1383 2000-08-07 Paul Eggert <eggert@twinsun.com>
1385 Standardize on "memory exhausted" instead of "Memory exhausted"
1386 or "virtual memory exhausted".
1387 * obstack.c (print_and_abort): Use "memory exhausted", not
1388 "virtual memory exhausted".
1389 * same.c (same_name): Invoke xalloc_die instead of printing
1391 * userspec.c (parse_user_spec): Likewise.
1392 * bumpalloc.h: comment fix
1393 * same.c, userspec.c: Include xalloc.h.
1395 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
1396 not char *const and pointing to a constant array.
1397 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
1398 (xrealloc): Comment fix.
1400 * userspec.c (parse_user_spec):
1401 Don't translate a message until just before returning,
1402 to avoid unnecessary translation.
1404 2000-08-07 Jim Meyering <meyering@lucent.com>
1406 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
1407 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
1408 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
1409 getgroups.c, gethostname.c, getopt.h, group-member.c,
1410 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
1411 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
1412 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
1413 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
1414 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
1415 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
1416 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
1417 yesno.c: Back out Copyright date changes for each file with no change
1418 this year. This eases coordination with other programs using the same
1419 source code modules. From Paul Eggert.
1421 2000-08-03 Greg McGary <greg@mcgary.org>
1423 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
1424 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
1425 (EXTEND_BUFFER): Use them.
1427 2000-08-01 Jim Meyering <meyering@lucent.com>
1429 * dirname.c (ISSLASH): Define.
1430 (BACKSLASH_IS_PATH_SEPARATOR): Define.
1431 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
1432 both `\' and `/' may be use as path separators.
1433 Based on a patch from Prashant TR.
1435 2000-07-31 Paul Eggert <eggert@twinsun.com>
1437 * quotearg.c (quotearg_n_options): Don't make the initial
1438 slot vector a constant, since it might get modified.
1440 2000-07-31 Jim Meyering <meyering@lucent.com>
1442 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
1443 * obstack.c (print_and_abort): Likewise.
1445 2000-07-30 Paul Eggert <eggert@twinsun.com>
1447 * quotearg.c (quotearg_n_options): Preallocate a slot 0
1448 buffer, so that the caller can always quote one small
1449 component of a "memory exhausted" message in slot 0.
1450 From a suggestion by Jim Meyering.
1452 2000-07-30 Jim Meyering <meyering@lucent.com>
1454 * makepath.c (make_path): Quote the other instance, too.
1456 * quotearg.c (N_STATIC_SLOTVECS): Define.
1457 (STATIC_BUF_SIZE): Define.
1458 (quotearg_n_options): Use only statically allocated storage when
1459 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
1460 than STATIC_BUF_SIZE.
1462 2000-07-29 Jim Meyering <meyering@lucent.com>
1464 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
1465 * dirname.c (dir_name): Likewise.
1467 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
1469 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
1470 (dir_name): Assert that there are no trailing slashes.
1472 2000-07-18 Bruno Haible <haible@clisp.cons.org>
1474 * mbswidth.h (mbswidth): Add a flags argument.
1475 (mbswidth): New declaration.
1476 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
1477 * mbswidth.c (mbswidth): Add a flags argument.
1478 (mbsnwidth): New function.
1480 2000-07-24 Jim Meyering <meyering@lucent.com>
1482 * mbswidth.c: Remove useless #else. From Bruno Haible.
1484 2000-07-23 Paul Eggert <eggert@twinsun.com>
1486 * mbswidth.c (_XOPEN_SOURCE):
1487 Don't define; this causes problems on Solaris 7.
1488 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
1490 2000-07-23 Paul Eggert <eggert@twinsun.com>
1493 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
1494 so that mbstate_t is always defined.
1496 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
1497 be 1 in at least one GCC installation, and this configuration
1498 error is likely to be common. Ignoring MB_LEN_MAX hurts
1499 performance on hosts that have mbrtowc but have only unibyte
1500 locales, but I assume these hosts are rare.
1502 2000-07-23 Paul Eggert <eggert@twinsun.com>
1504 * quotearg.c: Streamline by invoking multibyte code only if needed.
1505 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
1506 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
1507 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
1508 invoke multibyte primitives.
1510 2000-07-23 Jim Meyering <meyering@lucent.com>
1512 * basename.c (base_name): Add an assertion.
1514 2000-07-15 Bruno Haible <clisp.cons.org>
1516 * quotearg.c: When the system forces us to redefine mbstate_t,
1517 shadow its mbsinit function.
1519 2000-07-16 Bruno Haible <haible@clisp.cons.org>
1521 * mbswidth.h: New file.
1522 * mbswidth.c: New file.
1523 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
1524 (noinst_HEADERS): Add mbswidth.h.
1526 2000-07-17 Bruno Haible <haible@clisp.cons.org>
1528 * config.charset: Add support for FreeBSD. Improve support for HP-UX
1531 2000-07-15 Jim Meyering <meyering@lucent.com>
1533 * makepath.c: Include quote.h.
1534 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
1535 corresponding argument in a `quote (...)' call.
1536 Give better diagnostics.
1538 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
1539 (noinst_HEADERS): Add quote.h.
1541 * quote.c (quote, quote_n): New file. Two functions taken verbatim
1542 from tar's src/misc.c.
1543 * quote.h: New file. Prototypes for same.
1545 2000-07-10 Paul Eggert <eggert@twinsun.com>
1547 From a suggestion by Bruno Haible.
1548 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
1549 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
1550 to decide whether to define the BeOS workaround macro;
1551 this adjusts to the change to AC_MBSTATE_T.
1553 2000-07-13 Paul Eggert <eggert@twinsun.com>
1555 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
1557 * quotearg.c (quoting_style_args, quoting_style_vals,
1558 quotearg_buffer_restyled): Add support for
1559 clocale_quoting_style. Undo previous change to
1560 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
1561 and "{RIGHT QUOTATION MARK}" msgids.
1563 2000-07-05 Paul Eggert <eggert@twinsun.com>
1565 The old behavior of quoting `like this' doesn't look good with
1566 newer, ISO-style fonts. See:
1567 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
1569 Instead, quote "like this" by default. Let the translator
1570 tailor the locale-specific quoting behavior by providing
1571 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
1573 * quotearg.c (N_): New macro.
1574 (gettext_default): New function.
1575 (quotearg_buffer_restyled): Use
1576 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
1577 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
1579 2000-07-09 Jim Meyering <meyering@lucent.com>
1581 * Most files: Update copyright dates to include 2000.
1583 2000-07-08 Jim Meyering <meyering@lucent.com>
1585 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
1587 (xgethostname): Remove now-unnecessary #ifdef.
1588 Move declaration of `err' into loop where it's used.
1590 2000-07-05 Bruno Haible <haible@clisp.cons.org>
1592 * xgethostname.c (xgethostname): Protect against the SunOS5.5 bug
1593 by allocating a larger buffer. Test the gethostname return value for
1594 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
1595 returns an error and ENAMETOOLONG isn't defined.
1597 2000-07-05 Paul Eggert <eggert@twinsun.com>
1598 and Bruno Haible <haible@clisp.cons.org>
1600 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
1602 2000-07-05 Bruno Haible <haible@clisp.cons.org>
1604 * quotearg.c (struct quoting_options): Simplify quote_these_too
1607 2000-07-03 Jim Meyering <meyering@lucent.com>
1609 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
1610 Reported by Bruno Haible.
1612 2000-07-04 Jim Meyering <meyering@lucent.com>
1614 * quotearg.c: Make inclusion of <wchar.h> independent of whether
1615 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
1618 2000-07-03 Paul Eggert <eggert@twinsun.com>
1619 and Bruno Haible <haible@clisp.cons.org>
1621 * quotearg.c (mbrtowc):
1622 Assign to *pwc, and return 1 only if result is nonzero.
1623 (iswprint): Use ISPRINT when substituting our own mbrtowc.
1625 2000-07-03 Jim Meyering <meyering@lucent.com>
1627 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
1628 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
1631 2000-07-02 Jim Meyering <meyering@lucent.com>
1633 * quotearg.c (mbstate_t): Don't define here.
1635 2000-07-02 Jim Meyering <meyering@lucent.com>
1637 * nanosleep.c (SIGCONT): Define if not already defined.
1639 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1641 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
1642 per change in ../m4/ls-mntd-fs.m4.
1643 (read_filesystem_list): Ignore symbolic links.
1645 2000-06-29 Jim Meyering <meyering@lucent.com>
1647 * same.c: Include <string.h> or <strings.h>, as appropriate,
1648 for declaration of strcmp.
1650 * long-options.c: Include <stdlib.h>, for declaration of exit.
1652 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
1653 Avoid warning by casting result to `char *' to remove `const'.
1655 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1657 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
1659 2000-06-26 Paul Eggert <eggert@twinsun.com>
1661 savedir now sets errno on failure and invokes xmalloc to get memory.
1662 Fix a couple of other minor bugs while we're at it.
1664 * savedir.c (<unistd.h>): Do not include; there's no need.
1665 (NAMLEN): Remove macro.
1666 (malloc, realloc): Remove decls.
1668 ("xalloc.h"): Include.
1669 (NAME_SIZE_DEFAULT): New macro.
1670 (savedir): Use xmalloc / xrealloc to allocate memory.
1671 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
1672 Skip "" directory entries.
1673 Use strlen to calculate directory entry length, since the old method
1674 is rarely used these days and isn't worth supporting.
1675 Don't use a pointer after freeing it.
1676 Check for integer overflow when calculating allocation size.
1677 Use memcpy to copy entries, instead of stpcpy.
1678 Set errno properly when returning NULL.
1679 Check for readdir error.
1681 2000-06-26 Jim Meyering <meyering@lucent.com>
1683 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
1685 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1687 * getusershell.c (xmalloc, xrealloc): Remove functions.
1689 Don't include <stdlib.h>. Don't declare malloc, realloc.
1691 2000-06-23 Bruno Haible <haible@clisp.cons.org>
1693 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
1695 2000-06-24 Jim Meyering <meyering@lucent.com>
1697 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
1699 2000-06-21 Jim Meyering <meyering@lucent.com>
1701 * getpass.c: New file, from Bruno Haible. Required for BeOS.
1703 2000-06-19 Paul Eggert <eggert@twinsun.com>
1705 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
1706 (mbrtowc, mbstate_t): Define substitutes if
1707 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
1708 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
1709 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1711 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1713 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
1714 than 1024, return a memory chunk of least possible size, instead
1715 of size PATH_MAX + 2. In the loop, increment the size proportionally.
1716 Use free/xmalloc instead of xrealloc to avoid copying for very long
1719 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1721 * canon-host.c (canon_host): Use malloc and memcpy to copy an
1722 address, not strdup. Include <stdlib.h> and don't declare free().
1724 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1726 * path-concat.c (path_concat): Don't access dir[-1] if dir is
1729 2000-06-21 Jim Meyering <meyering@lucent.com>
1731 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
1732 (noinst_HEADERS): Add getstr.h.
1734 * getline.c (getstr): Move into a separate file.
1735 * getstr.c (getstr): New file, extracted from getline.c, with
1736 the following changes: new parameter, delim2; both delim[12]
1737 parameters have type `int', not `char'. The latter would lose
1738 with 8-bit delimiters.
1739 * getstr.h: New file.
1741 2000-06-19 Jim Meyering <meyering@lucent.com>
1743 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
1745 2000-06-18 Jim Meyering <meyering@lucent.com>
1747 * mkdir.c: Remove file, due mainly to copyright incompatibility.
1748 Besides, these days every porting target provides a mkdir function.
1750 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
1751 (this snippet comes from src/system.h).
1753 2000-06-15 Paul Eggert <eggert@twinsun.com>
1755 * human.c (adjust_value): New function.
1756 (human_readable_inexact): Apply rounding style even when
1757 printing approximate values.
1759 2000-06-14 Paul Eggert <eggert@twinsun.com>
1761 * human.c (human_readable_inexact): Allow an input block
1762 size that is not a multiple of the output block size, and vice versa.
1763 Reported by Piergiorgio Sartor.
1765 2000-06-14 Paul Eggert <eggert@twinsun.com>
1767 * getdate.y (get_date): Apply relative times after time
1768 zone indicator, not before. Reported by Todd A. Jacobs.
1770 2000-06-13 Jim Meyering <meyering@lucent.com>
1772 * Makefile.am (all-local): Depend on lstat.c and stat.c.
1774 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
1776 2000-06-12 Paul Eggert <eggert@twinsun.com>
1778 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
1780 2000-06-04 Paul Eggert <eggert@twinsun.com>
1782 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
1784 2000-06-04 Jim Meyering <meyering@lucent.com>
1786 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
1787 SunOS4.1.4 for which gid_t is an unsigned type.
1789 2000-06-03 Jim Meyering <meyering@lucent.com>
1791 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
1793 2000-05-26 Bruno Haible <haible@clisp.cons.org>
1795 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
1796 newer, don't install charset.alias.
1797 * config.charset: Change the Linux/glibc rules so they become empty
1798 on glibc-2.1 or newer.
1800 2000-06-02 Jim Meyering <meyering@lucent.com>
1802 * mountlist.c: Back out last change. Instead, do this...
1803 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
1804 member using the same `ignore'-testing code.
1805 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
1809 2000-05-29 Jim Meyering <meyering@lucent.com>
1811 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
1812 with the `ignore' attribute. Based on a patch from Mark D. Roth.
1814 2000-05-22 Jim Meyering <meyering@lucent.com>
1816 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
1818 2000-05-18 Jim Meyering <meyering@lucent.com>
1820 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
1821 back, too, since it may have been modified by allocate_entry.
1822 (hash_delete): Rewrite to use neither the assignment operator
1823 nor the comma operator in an if-expression.
1825 2000-05-15 Paul Eggert <eggert@twinsun.com>
1828 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
1829 Remove; no longer needed.
1830 "quotearg.h": Add include.
1831 (file_name): Do not bother to explicitly initialize to NULL; it's less
1832 efficient on some hosts.
1833 (close_stdout_status): Remove test as to whether stdout was already
1834 closed; it breaks for the case "echo x | sort >&-".
1835 Quote file name colons.
1836 Do not assume that _("write error") lacks format strings.
1838 2000-05-15 Jim Meyering <meyering@lucent.com>
1840 * version-etc.c (version_etc_copyright): Update the copyright string
1841 used in all --version output.
1843 2000-05-14 Jim Meyering <meyering@lucent.com>
1845 * closeout.c (close_stdout_set_file_name): New function.
1846 (close_stdout_status): Use new file-scoped global.
1847 Return right away if fstat says the stdout file descriptor is invalid.
1848 * closeout.h (close_stdout_set_file_name): Declare.
1850 2000-05-10 Jim Meyering <meyering@lucent.com>
1852 * closeout.c [default_exit_status]: New file-scoped variable.
1853 (close_stdout_set_status): New function.
1854 * closeout.h (close_stdout_set_status): Declare.
1856 2000-05-08 Jim Meyering <meyering@lucent.com>
1858 * long-options.c: Don't include closeout.h.
1859 (parse_long_options): Don't call close_stdout for --version.
1861 2000-05-06 Jim Meyering <meyering@lucent.com>
1863 * strnlen.c: Undefine __strnlen and strnlen.
1864 [!weak_alias]: Define __strnlen to strnlen.
1866 * atexit.c: New file, from libiberty.
1868 2000-05-06 Jim Meyering <meyering@lucent.com>
1870 * closeout.c (close_stdout_status): Also check for errors on the
1873 2000-05-05 Bruno Haible <haible@clisp.cons.org>
1875 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
1876 instead of xmalloc, xrealloc, path_concat.
1877 (locale_charset): Treat empty environment variables as absent.
1878 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
1880 2000-05-04 Jim Meyering <meyering@lucent.com>
1882 * getopt.c: Update from glibc.
1883 * obstack.c: Likewise.
1884 * obstack.h: Likewise.
1885 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
1887 * regex.h: Likewise.
1888 * strndup.c: Likewise.
1889 * strnlen.c: New file, from glibc.
1891 2000-05-01 Jim Meyering <meyering@lucent.com>
1893 * full-write.c (full_write): Remove `FIXME' part of comment.
1895 2000-04-29 Jim Meyering <meyering@lucent.com>
1897 * path-concat.c: Declare strdup only if it's not defined.
1898 * canon-host.c: Likewise.
1900 2000-04-28 Jim Meyering <meyering@lucent.com>
1902 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
1903 redefinition warning on some systems (HPUX). Otherwise, regex.h is
1904 included first, then limits.h is included by locale.h by libintl.h.
1905 From John David Anglin.
1907 2000-04-25 Jim Meyering <meyering@lucent.com>
1909 * makepath.c (S_IRWXUGO): Define.
1910 (make_path): Always perform explicit chmod if MODE specifies any
1911 of the `special' permission bits. Prompted by a bug report against
1912 install from Mate Wierdl and Joost van Baal.
1914 2000-04-18 Jim Meyering <meyering@lucent.com>
1918 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
1919 getpagesize. For BeOS. Based on a patch from Bruno Haible.
1921 2000-04-17 Jim Meyering <meyering@lucent.com>
1923 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
1924 the definition of it to rpl_strftime also defined-away the system's
1927 2000-04-15 Jim Meyering <meyering@lucent.com>
1929 Use `C' to denote so-called `contiguous' files, the same way
1931 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
1932 (ftypelet): Use S_ISCTG.
1933 From Michael Deutschmann.
1935 2000-04-14 Jim Meyering <meyering@lucent.com>
1937 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
1939 2000-04-08 Jim Meyering <meyering@lucent.com>
1941 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
1942 names don't conflict. Reported by Eli Zaretskii.
1944 2000-03-28 Bruno Haible <haible@clisp.cons.org>
1946 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
1947 bug. Deal with the different error behavior of Irix iconv.
1949 2000-04-07 Jim Meyering <meyering@lucent.com>
1951 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
1952 to work around system header problems on AIX 3.2.5. From Bruno Haible.
1954 2000-04-05 Jim Meyering <meyering@lucent.com>
1956 Portability tweaks required for ultrix4.3.
1957 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
1958 * readutmp.c: Include sys/types.h before sys/stat.h.
1959 * canon-host.c: Declare strdup.
1960 * path-concat.c: Likewise.
1961 From John David Anglin.
1963 2000-04-04 Jim Meyering <meyering@lucent.com>
1965 Be more DOS 8.3-friendly.
1966 * ref-add.sin: Renamed from ref-add.sed.in.
1967 * ref-del.sin: Renamed from ref-del.sed.in.
1968 * Makefile.am: Reflect renaming.
1969 Reported by Eli Zaretskii.
1971 Use a temporary file name that won't clash with `charset.alias'
1972 in the DOS 8.3 name space.
1973 * Makefile.am (charset_tmp): Define.
1974 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
1975 (uninstall-local): Likewise.
1976 Reported by Eli Zaretskii.
1978 2000-03-29 Paul Eggert <eggert@twinsun.com>
1980 * time/strftime.c (my_strftime): Make sure we call the system
1981 strftime, not ourselves, when invoking the underlying strftime.
1983 2000-03-24 Jim Meyering <meyering@lucent.com>
1985 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
1986 (charset_alias): Define.
1987 (install-exec-local): Factor out common code.
1988 (uninstall-local): Split lines longer than 80.
1989 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
1991 (.sed.in.sed): New rule. Don't redirect directly to $@.
1992 (CLEANFILES): Add ref-add.sed and ref-del.sed.
1994 2000-03-19 Bruno Haible <haible@clisp.cons.org>
1996 * config.charset: Output a line containing "Packages using this file".
1997 * ref-add.sed.in, ref-del.sed.in: New files.
1998 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
1999 ref-del.sed): New rules.
2001 2000-03-17 Jim Meyering <meyering@lucent.com>
2003 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
2004 Otherwise, include <strings.h>
2006 2000-03-17 Bruno Haible <haible@clisp.cons.org>
2008 * unicodeio.c (utf8_wctomb): New function.
2009 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
2010 format instead of in UCS-4 with platform dependent endianness.
2012 2000-03-07 Paul Eggert <eggert@twinsun.com>
2014 * savedir.c (savedir): Work even if directory size is
2015 negative; this can happen with some screwy NFS configurations.
2017 2000-03-06 Jim Meyering <meyering@lucent.com>
2019 * localcharset.c (get_charset_aliases): Don't try to free file_name
2020 if it's NULL (because we ran out of memory). From Bruno Haible.
2022 2000-03-05 Jim Meyering <meyering@lucent.com>
2024 * localcharset.c ("path-concat.h"): Include.
2025 (get_charset_aliases): Use path_concat instead of ANSI string
2028 * unicodeio.h (PARAMS): Define.
2029 Use it to guard prototype.
2031 2000-03-04 Jim Meyering <meyering@lucent.com>
2033 * Makefile.am (install-exec-local): Create $(libdir) before installing
2035 (uninstall-local): Uncomment this rule so `make distcheck' works
2038 * unicodeio.c (<errno.h>): Include it.
2039 (errno): Declare if not defined.
2041 * localcharset.c: Add Bruno's comment justifying use of volatile.
2043 * config.charset: New version, incorporating remarks from a linux
2044 i18n mailing list. From Bruno Haible.
2046 2000-03-02 Jim Meyering <meyering@lucent.com>
2048 * Makefile.am (EXTRA_DIST): Add config.charset.
2050 2000-03-01 Jim Meyering <meyering@lucent.com>
2052 * localcharset.c: Guard some #includes with `#if HAVE_...'.
2053 * unicodeio.c: Likewise.
2055 2000-02-02 Bruno Haible <haible@clisp.cons.org>
2057 * config.charset: New file.
2058 * localcharset.c: New file.
2059 * unicodeio.h, unicodeio.c: New files.
2060 * Makefile.am (DEFS): Add -DLIBDIR=...
2061 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
2062 (noinst_HEADERS): Add unicodeio.h.
2063 (all-local, install-exec-local, charset.alias): New targets.
2065 2000-02-28 Paul Eggert <eggert@twinsun.com>
2067 * quotearg.c (ALERT_CHAR): New macro.
2068 (quotearg_buffer_restyled): Use it.
2070 2000-02-27 Jim Meyering <meyering@lucent.com>
2072 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
2073 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
2075 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
2076 not `#if STDC_HEADERS'.
2077 Declare malloc if needed.
2079 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
2080 now that autoconf always defines the HAVE_DECL_ symbols.
2081 * human.c: Likewise.
2083 * strtoumax.c: Likewise.
2085 * backupfile.c: Arrange for cpp to fail if the configure-time
2086 declaration check was not run.
2088 * human.c: Likewise.
2090 * strtoumax.c: Likewise.
2092 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
2093 then first look up the entire `.'-containing string as a login name.
2095 2000-02-18 Paul Eggert <eggert@twinsun.com>
2097 * getdate.y: Handle two-digit years with leading zeros correctly.
2098 (textint): New typedef.
2099 (parser_control): Member year changed from int to textint.
2101 (YYSTYPE): Removed; replaced by %union with int and textint members.
2102 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
2103 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
2104 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
2105 (tSNUMBER, tUNUMBER): Now of type <textintval>.
2106 (date, number, to_year): Use width of number in digits, not its value,
2107 to determine whether it's a 2-digit year, or a 2-digit time.
2108 (yylex): Store number of digits of numeric tokens.
2109 Reported by John Kendall.
2111 (parser_control): Changed from struct parser_control to typedef (for
2112 consistency). All uses changed.
2114 (tID): Removed; not used.
2115 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2117 2000-02-14 Paul Eggert <eggert@twinsun.com>
2119 * getpagesize.h (getpagesize): Port to VMS for Alpha;
2120 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
2122 2000-02-12 Jim Meyering <meyering@lucent.com>
2124 * userspec.c (ISDIGIT): Define it.
2125 (isdigit): Remove definition.
2126 (is_number): Use ISDIGIT, not isdigit.
2127 <libintl.h>: Include.
2129 (parse_user_spec): Mark translatable strings.
2131 2000-02-10 Jim Meyering <meyering@lucent.com>
2133 With these changes, nanosleep.[ch] are finally enough like the other
2134 lib/* replacement files to compile on a few more losing systems.
2136 * nanosleep.h: Don't include config.h.
2137 Remove prototype from declaration of nanosleep.
2138 (PARAMS): Remove now-unneeded definition.
2139 * nanosleep.c: #undef nanosleep.
2140 (rpl_nanosleep): Rename from nanosleep.
2142 2000-02-03 Jim Meyering <meyering@lucent.com>
2144 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
2145 rather than with `#if HAVE_UTMPNAME'.
2147 2000-02-01 Jim Meyering <meyering@lucent.com>
2149 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
2151 2000-01-31 Jim Meyering <meyering@lucent.com>
2153 * nanosleep.h (nanosleep): Guard declaration with
2154 `#if ! HAVE_DECL_NANOSLEEP'.
2155 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
2156 the declaration in that vendor's sys/timers.h.
2157 Reported by Christian Krackowizer.
2159 * quotearg.c (ISASCII): Add #undef and move definition to follow
2160 inclusion of wctype.h to work around solaris2.6 namespace pollution.
2161 (ISPRINT): Likewise.
2162 Reported by Tom Tromey.
2164 2000-01-30 Jim Meyering <meyering@lucent.com>
2166 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
2167 uses of ->ut_name. The latter doesn't work with new Linux header files
2168 where only utmpx.ut_user is declared.
2170 * readutmp.h (UT_USER): Define.
2172 2000-01-23 Jim Meyering <meyering@lucent.com>
2174 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
2177 2000-01-22 Jim Meyering <meyering@lucent.com>
2179 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
2180 [! HAVE_DECL_STRTOULL]: Declare strtoull.
2181 Required for some AIX systems. Reported by Christian Krackowizer.
2182 [TESTING] (main): New function.
2184 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
2185 * dirname.c (dir_name): Support for DOS-style file names with drive
2188 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
2190 * strverscmp.c (ISDIGIT): Define.
2191 (strverscmp): Use ISDIGIT, not isdigit.
2193 2000-01-17 Paul Eggert <eggert@twinsun.com>
2195 * nanosleep.c (nanosleep):
2196 Don't use SA_INTERRUPT to decide whether to call sigaction, as
2197 POSIX.1 doesn't require SA_INTERRUPT and some systems
2198 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
2199 it's been part of POSIX.1 since day 1 (in 1988).
2201 2000-01-17 Jim Meyering <meyering@lucent.com>
2203 * interlock: Remove unused file. Reported by François Pinard.
2205 2000-01-16 Paul Eggert <eggert@twinsun.com>
2207 * quotearg.c (quotearg_buffer_restyled): Do not quote
2208 alert, backslash, formfeed, and vertical tab unnecessarily in
2209 shell quoting style.
2212 version-control: never