1 2002-06-11 Paul Eggert <eggert@twinsun.com>
3 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4 New macro. Use it uniformly instead of
5 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
7 reported by Vin Shelton.
9 2002-06-22 Jim Meyering <meyering@lucent.com>
11 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
12 redefinition due to Solaris5.6's definition in /usr/include/sys/euc.h.
14 2002-06-22 Paul Eggert <eggert@twinsun.com>
16 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
17 Do not assume SA_SIGINFO behavior.
18 Bug reported by Jim Meyering on NetBSD 1.5.2.
20 2002-06-22 Jim Meyering <meyering@lucent.com>
22 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
24 * exitfail.c, exitfail.h: Likewise.
25 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
27 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
29 (EXTRA_DIST): Add fnmatch_loop.c.
30 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
32 * fnmatch_loop.c: New file, from diffutils-2.8.2.
33 * fnmatch.c: Update from diffutils-2.8.2.
34 * fnmatch_.h: New file. From diffutils-2.8.2.
35 * fnmatch.h: Remove file.
37 2002-06-18 Paul Eggert <eggert@twinsun.com>
39 * file-type.h: Report an error if neither S_ISREG nor
40 S_IFREG is defined, instead of using a test specific to glibc
41 2.2. This should be safe, since POSIX requires S_ISREG and
42 Unix Version 7 had S_IFREG. We don't need to check for
43 <sys/types.h> since we don't use any symbols that it defines.
45 2002-06-15 Jim Meyering <meyering@lucent.com>
47 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
48 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
49 have been included before this file.
51 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
53 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
54 so that each temporary file name is unique and valid in the first
55 8 characters, for operation under DOS.
57 2002-06-15 Jim Meyering <meyering@lucent.com>
59 Work even with DJGPP 2.03, which lacks support for symlinks.
61 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
63 * lchown.c (S_ISLNK): Likewise.
65 2002-06-14 Jim Meyering <meyering@lucent.com>
67 * file-type.h: Use the version from diffutils-2.8.2.
68 * file-type.c: Likewise.
70 2002-05-27 Jim Meyering <meyering@lucent.com>
72 Fix a problem seen only on nonconforming systems whereby ls.c's
73 use of localtime, and then of gettimeofday would cause trouble:
74 the localtime call used to initialize rpl_gettimeofday's save
75 mechanism would clobber ls's current local time information so
76 that in any long listing the first file would always be listed
77 with date 1970-01-01. Analysis by Volker Borchert.
79 * gettimeofday.c (localtime): Undefine.
80 (rpl_localtime): New function.
82 2002-05-22 Jim Meyering <meyering@lucent.com>
84 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
85 * file-type.h: New file.
86 * file-type.c (file_type): New file/function. Extracted from diffutils.
88 2002-04-29 Paul Eggert <eggert@twinsun.com>
90 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
92 2002-04-28 Paul Eggert <eggert@twinsun.com>
94 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
95 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
96 of 127, since 64 is the largest conceivable number for ancient
98 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
100 2002-04-28 Jim Meyering <meyering@lucent.com>
102 * sig2str.c (WTERMSIG): Remove definition (unused).
104 2002-04-28 Paul Eggert <eggert@twinsun.com>
106 * sig2str.h, sig2str.c: New files.
107 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
109 2002-04-24 Jim Meyering <meyering@lucent.com>
111 * gettext.h: New file, from Gettext.
112 * Makefile.am (INCLUDES): Remove -I../intl.
113 (libfetish_a_SOURCES): Add gettext.h.
115 2002-04-16 Jim Meyering <meyering@lucent.com>
117 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
118 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
119 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
121 2002-04-12 Jim Meyering <meyering@lucent.com>
123 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
125 2002-03-10 Jim Meyering <meyering@lucent.com>
127 * makepath.c (make_path): Remove a comma from a diagnostic.
128 Suggestion from Santiago Vila.
130 2002-03-08 Jim Meyering <meyering@lucent.com>
132 * rename.c: Mention that this wrapper is needed also on
133 mips-dec-ultrix4.4 systems.
135 2002-03-02 Jim Meyering <meyering@lucent.com>
137 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
138 not HAVE_CLOCK_SETTIME.
140 2002-02-27 Paul Eggert <eggert@twinsun.com>
142 * nanosleep.h: Rename to....
143 * timespec.h: New name for nanosleep.h. All uses changed.
145 * gettime.c: New file.
146 * settime.c: New file.
149 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
150 timespec.h. Remove nanosleep.h.
152 2002-02-25 Paul Eggert <eggert@twinsun.com>
154 * acl.c, acl.h: New files.
155 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
157 2002-02-24 Jim Meyering <meyering@lucent.com>
159 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
160 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
161 cause trouble. Reported by Nelson Beebe.
163 2002-02-23 Paul Eggert <eggert@twinsun.com>
165 * path-concat.c (xpath_concat): Reorder code to pacify
166 compilers that don't know that xalloc_die never returns.
168 2002-02-20 Jim Meyering <meyering@lucent.com>
170 * getdate.c: Regenerate using bison-1.33.
172 2002-02-15 Paul Eggert <eggert@twinsun.com>
174 * posixver.c, posixver.h: New files.
175 * Makefile.am (libfetish_a_SOURCES): Add them.
177 2002-02-02 Paul Eggert <eggert@twinsun.com>
178 Bruno Haible <bruno@clisp.org>
180 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
181 (fwrite_success_callback): New declaration.
182 * unicodeio.c (unicode_to_mb): New function, extracted from
183 print_unicode_char. Call failure callback instead of error.
184 (fwrite_success_callback): New function.
185 (exit_failure_callback): New function.
186 (fallback_failure_callback): New function.
187 (print_unicode_char): Call unicode_to_mb.
189 2002-01-26 Jim Meyering <meyering@lucent.com>
191 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
193 2002-01-22 Jim Meyering <meyering@lucent.com>
195 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
196 Otherwise, some versions of automake would omit the rule that makes
197 Makefile from Makefile.in.
199 2001-01-21 Paul Eggert <eggert@twinsun.com>
201 * xmemcoll.h, xmemcoll.c: New files.
202 * Makefile.am (libfetish_a_SOURCES): Add them.
203 * memcoll.c: Include errno.h, and declare errno if not defined.
204 (memcoll): Set errno to zero if there is no error.
206 * quotearg.c (quotearg_buffer_restyled):
207 Fix bug with quoting buffers containing NUL when backslashing escapes.
208 This bug was exposed by the other changes in this patch.
209 (quotearg_n_options): New arg ARGSIZE.
211 (quoting_options_from_style): New function.
212 (quotearg_n_style): Use it.
213 (quotearg_n_style_mem): New function.
215 * quotearg.h (quotearg_n_style_mem): New function.
217 2002-01-16 Jim Meyering <meyering@lucent.com>
219 * getdate.y: Add three semicolons, each just before a closing brace.
220 Bison (as of version 1.31) no longer papers over that mistake.
222 2002-02-14 Paul Eggert <eggert@twinsun.com>
224 * backupfile.c (ISDIGIT): Comment fix.
225 * getdate.y (ISDIGIT): Likewise.
226 * posixtm.c (ISDIGIT, year): Likewise.
227 * strverscmp.c (ISDIGIT): Likewise.
228 * userspec.c (ISDIGIT): Likewise.
230 2002-01-05 Jim Meyering <meyering@lucent.com>
232 * version-etc.c (version_etc_copyright): Update copyright year.
234 2001-01-19 Paul Eggert <eggert@twinsun.com>
236 * closeout.c (close_stdout_status): If ferror (stdout), do
237 not silently exit merely because the output buffer happens to
238 have nothing pending.
240 2001-12-18 Paul Eggert <eggert@twinsun.com>
242 See the big note in ../ChangeLog.
243 * human.c (suffixes): Prefer K to k for 1024.
244 (generate_suffix_backwards): New function.
245 (human_readable_inexact): Use it.
246 * xstrtol.c (__xstrtol): If there is no number but there
247 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
248 Accept 'K' as well as 'k'.
250 2001-12-15 Jim Meyering <meyering@lucent.com>
252 * regex.h (__restrict_arr): Update from libc.
254 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
255 as `remote' if the name starts with `//'. Suggested by Michael Stone.
258 2001-12-10 Jim Meyering <meyering@lucent.com>
260 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
261 Instead, include "xalloc.h".
262 (initbuffer): Don't cast xmalloc return value to char*.
263 (readline): Reword comment.
264 Don't cast xrealloc return value to char*
267 2001-12-09 Jim Meyering <meyering@lucent.com>
269 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
270 `signed and unsigned type in conditional expression'.
271 * posixtm.c (posix_time_parse): Likewise.
273 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
275 * readtokens.c (readtoken): Declare an index to be of type unsigned
276 to avoid a pedantic warning.
278 * getstr.c: Don't include assert.h.
279 (getstr): Remove warning-evoking assertions.
280 Return -1 if offset parameter is out of bounds.
281 Change the type of a local from int to size_t.
283 * strftime.c (my_strftime_localtime_r): Include this function
284 definition in the `#if ! HAVE_TM_GMTOFF' block.
286 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
287 Include xalloc.h instead.
289 2001-12-02 Jim Meyering <meyering@lucent.com>
291 * tempname.c: Don't declare getenv, thus reverting the change of
292 2001-11-18. It's no longer necessary, now that stdlib.h is always
295 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
296 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
298 2001-11-30 Akim Demaille <akim@epita.fr>
300 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
301 before being defined.
303 2001-11-27 Paul Eggert <eggert@twinsun.com>
305 * quotearg.h (quotearg_n, quotearg_n_style):
306 First arg is int, not unsigned.
307 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
308 (SIZE_MAX, UINT_MAX): New macros.
309 (quotearg_n_options): Abort if N is negative.
310 Avoid overflow check on hosts where size_t is 64 bits and int
311 is 32 bits, as overflow is impossible there.
312 Fix off-by-one typo that caused unnecessary reallocation.
314 2001-11-27 Jim Meyering <meyering@lucent.com>
316 * tempname.c: Merge with version from libc.
319 * tempname.c: Include stdlib.h unconditionally. On some old systems
320 for which STDC_HEADERS is 0, it was not included, resulting in a
321 warning about an integer-to-pointer conversion problem with getenv.
322 Reported by Volker Borchert.
324 2001-11-26 Jim Meyering <meyering@lucent.com>
326 * gtod.h: Remove file.
327 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
328 * gettimeofday.c: Don't include gtod.h.
329 (GTOD_init): Remove function.
330 (rpl_gettimeofday): Do its job here instead, rather than aborting.
331 Suggestion from Volker Borchert.
333 2001-11-23 Jim Meyering <meyering@lucent.com>
335 * hash.h (struct hash_table): Don't define here. Merely declare it.
336 * hash.c (struct hash_table): Define it here instead.
338 2001-11-22 Jim Meyering <meyering@lucent.com>
340 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
342 2001-11-18 Paul Eggert <eggert@twinsun.com>
344 * tempname.c (TMP_MAX): Remove; no longer needed.
345 (TEMPORARIES): New macro.
346 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
347 removes an artificial limitation (e.g. HP-UX 10.20, where
350 2001-11-18 Jim Meyering <meyering@lucent.com>
352 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
355 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
356 files will be created before anything else.
358 2001-11-17 Jim Meyering <meyering@lucent.com>
360 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
361 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
362 rather than group writable. Patch by Juan F. Codagnone.
364 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
365 Instead, include "xalloc.h".
367 * mountlist.c: Include unlocked-io.h after all system headers.
368 Remove explicit declarations of xmalloc, xrealloc,
369 and xstrdup. Instead, include "xalloc.h".
371 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
372 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
373 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
375 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
376 Reported by Padraig Brady.
378 * mkstemp.c: #undef mkstemp.
380 (rpl_mkstemp): Rename from mkstemp.
383 2001-11-16 Jim Meyering <meyering@lucent.com>
385 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
386 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
387 determine the amount of total physical memory, use pstat_getstatic.
388 HPUX-11 doesn't define _SC_PHYS_PAGES.
389 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
390 If sysconf couldn't be used to determine the amount of available
391 physical memory, use both pstat_getstatic and pstat_getdynamic.
392 Based on a patch from Bob Proulx.
394 2001-11-05 Jim Meyering <meyering@lucent.com>
396 * xstat.in (slash_aware_lstat): Correct a misleading comment.
398 2001-11-03 Jim Meyering <meyering@lucent.com>
400 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
401 in argmatch_to_argument call.
403 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
406 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
407 e.g., a fault due to an attempt to free a NULL pointer.
409 2001-11-01 Jim Meyering <meyering@lucent.com>
411 * dirfd.c, dirfd.h: New files.
412 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
414 * hash.c (hash_print) [TESTING]: Clean up.
416 2001-10-22 Paul Eggert <eggert@twinsun.com>
418 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
419 to avoid a warning if -Wall.
421 2001-10-21 Paul Eggert <eggert@twinsun.com>
423 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
425 2001-10-21 Jim Meyering <meyering@lucent.com>
427 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
428 this code would end up calling gettext even in packages built
430 * getopt.c (_): Likewise.
431 * regex.c (_): Likewise.
433 2001-10-20 Paul Eggert <eggert@twinsun.com>
435 * error.c (strerror_r): Do not declare unless !_LIBC.
436 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
437 Use strerror_r that is only a macro, even if it is not a function.
438 (strerror): Check for HAVE_DECL_STRERROR before declaring.
439 (private_strerror): Use prototypes, not old-style function definition.
440 (print_errno_message): New function.
441 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
443 (error_tail, error, error_at_line): Use it.
445 2001-10-11 Jim Meyering <meyering@lucent.com>
447 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
448 and quote_n (1, ... to avoid clobbering a buffer.
450 2001-10-05 Jim Meyering <meyering@lucent.com>
452 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
453 * hash-pjw.c: New file (factored out of fileutils' remove.c).
454 * hash-pjw.h: New file.
456 2001-09-30 Jim Meyering <meyering@lucent.com>
458 * mountlist.c [MOUNTED_GETFSSTAT]:
459 Include <sys/ucred.h>, for Apple Darwin.
460 Include sys/mount.h and sys/fs_types.h only if available.
462 (read_filesystem_list): Use FS_TYPE.
464 2001-09-29 Paul Eggert <eggert@twinsun.com>
466 * exclude.c (excluded_filename): 0 -> false, since it's
469 2001-09-28 Paul Eggert <eggert@twinsun.com>
471 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
472 #defines strtoimax. Also treat the other strto* functions
475 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
476 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
477 (strtoimax, strtoumax): Do not declare if already defined as a macro.
479 2001-09-26 Jim Meyering <meyering@lucent.com>
481 Most macros in unlocked-io.h had the wrong number of arguments.
482 * gen-uio: New script.
483 (USE_UNLOCKED_IO): Define to 1 if not already defined.
484 * unlocked-io.hin: Remove file.
485 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
486 rather than trying to embed it here.
487 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
488 Reported by Padraig Brady.
490 2001-09-25 Volker Borchert <bt@teknon.de>
492 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
494 2001-09-23 Jim Meyering <meyering@lucent.com>
496 * mountlist.c: Remove useless parentheses in #if directives.
497 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
498 the deprecated MOUNTED symbol is no longer defined in mntent.h.
500 2001-09-22 Jim Meyering <meyering@lucent.com>
502 * localcharset.c: Update from latest gettext.
503 * config.charset: Likewise.
505 2001-09-20 Jim Meyering <meyering@lucent.com>
507 * xstrtol.c (strtoimax): Guard declaration with
508 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
509 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
510 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
511 (strtoumax): Likewise, for completeness (it wasn't necessary).
513 2001-09-06 Paul Eggert <eggert@twinsun.com>
515 * strtoimax.c (HAVE_LONG_LONG):
516 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
517 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
518 to work around bug in IBM C compiler.
520 2001-09-16 Jim Meyering <meyering@lucent.com>
524 2001-09-04 Paul Eggert <eggert@twinsun.com>
526 * xgetcwd.c: Revert some of the previous change; intead,
527 fix the HAVE_GETCWD_NULL code to behave more like the
528 !HAVE_GETCWD_NULL code used to.
531 (xgetcwd): Do not return NULL when memory is exhausted; instead,
534 2001-09-04 Paul Eggert <eggert@twinsun.com>
536 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
537 Use ssize_t, not int, to store result of readlink.
538 Check for ssize_t overflow as well as size_t overflow,
539 as POSIX says the result of readlink is implementation-defined
540 when ssize_t overflows.
541 Remove unnecessary cast to char*.
542 Use free+malloc instead of realloc, as the storage doesn't need
543 to be preserved and it's clearer and can be more efficient that way.
544 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
545 * xreadlink.h (xreadlink): Update prototype.
547 2001-09-03 Paul Eggert <eggert@twinsun.com>
549 * exclude.c (fnmatch_no_wildcards): Fix confusion between
550 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
551 spotted by Jim Meyering.
553 2001-09-03 Jim Meyering <meyering@lucent.com>
555 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
557 2001-09-03 Paul Eggert <eggert@twinsun.com>
559 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
560 like the HAVE_GETCWD_NULL code.
561 Include pathmax.h if not HAVE_GETCWD.
562 Do not include xalloc.h.
563 (INITIAL_BUFFER_SIZE): New symbol.
564 Do not use xmalloc / xrealloc, since the caller is responsible for
565 handling errors. Preserve errno around `free' during failure.
566 Do not overrun buffer when using getwd.
568 2001-09-03 Paul Eggert <eggert@twinsun.com>
570 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
571 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
573 2001-09-02 Jim Meyering <meyering@lucent.com>
575 * error.c: Update from GNU libc.
577 2001-09-01 Jim Meyering <meyering@lucent.com>
579 * xreadlink.c: New file.
580 * xreadlink.h: New file.
581 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
583 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
584 doesn't conflict with sparc-sun-solaris2.7's definition in
585 /usr/include/sys/int_types.h.
587 * exclude.c: Use `""', not `<>' to #include non-system header files.
588 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
589 and strncasecmp as r-values. Unixware didn't have declarations.
591 2001-08-31 Jim Meyering <meyering@lucent.com>
593 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
594 Use an initial, malloc'd, buffer of length 128 rather than
595 a statically allocated one of length 1024.
597 2001-08-30 Paul Eggert <eggert@twinsun.com>
599 * xgetcwd.c: Don't include pathmax.h.
600 Include stdlib.h and unistd.h if available.
602 (xmalloc, xstrdup, free): Remove decls.
603 (xgetcwd): Don't assume sizes fit in unsigned.
604 Check for overflow when computing sizes.
605 Simplify reallocation code.
607 2001-08-28 Paul Eggert <eggert@twinsun.com>
609 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
611 * strtoimax.c: Renamed from strtoxmax.c, removing the
614 Also, make the following further changes to make this file's
615 configuration more similar to that of strtol.c:
616 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
617 (strtoumax, uintmax_t, strtoull, strtol): Remove.
618 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
619 (strtoimax): Renamed from strtoumax. All uses of unsigned values
620 changed to signed values.
622 And make the following changes as well:
623 Fix copyright notice, as 1999 was missing.
625 (strtoimax): Check sizes at compile-time, not run-time.
626 Prefer strtol to strtoll if both work.
627 (main): Remove; it was not that useful and was a pain to maintain.
629 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
631 2001-08-30 Paul Eggert <eggert@twinsun.com>
633 * savedir.c (savedir): Remove size parameter, as POSIX says that
634 a directory's st_size can have an arbitrary value, so the old
635 usage could waste an arbitrary amount of memory. All uses
637 * savedir.h: Update prototype.
639 2001-08-30 Paul Eggert <eggert@twinsun.com>
641 * xstrtol.c (strtoimax): New decl.
643 2001-08-28 Paul Eggert <eggert@twinsun.com>
645 * xstrtol.h: Add copyright notice.
646 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
647 LONGINT_INVALID_SUFFIX_CHAR.
649 2001-08-30 Paul Eggert <eggert@twinsun.com>
651 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
654 2001-08-30 Paul Eggert <eggert@twinsun.com>
656 * hash.c: Remove '2001' from copyright notice.
658 2001-08-30 Paul Eggert <eggert@twinsun.com>
660 * full-write.h: New file.
661 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
662 * full-write.c: Correct credits, as cccp.c no longer
663 exists and anyway it was so heavily changed from the old cccp
664 code as to be unrecognizable. Include full-write.h.
665 (full_write) Return size_t, with short writes meaning failure.
666 All callers changed. This fixes a bug with large buffers
668 * utime.c: Include full-write.h.
670 2001-08-30 Paul Eggert <eggert@twinsun.com>
672 Merge 'exclude' changes from tar 1.13.22.
673 This fixes one or two unlikely storage allocation overflow bugs,
674 but doesn't change user-visible behavior otherwise.
676 2001-08-30 Paul Eggert <eggert@twinsun.com>
678 * exclude.c (bool): Declare, perhaps by including stdbool.h.
679 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
680 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
681 Include if available.
682 (<xalloc.h>): Include
683 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
684 (verify): New macro. Use it to verify that EXCLUDE macros do not
685 collide with FNM macros.
686 (struct patopts): New struct.
687 (struct exclude): Use it, as exclude patterns now come with options.
688 (new_exclude): Support above changes.
689 (new_exclude, add_exclude_file):
690 Initial size must now be a power of two to simplify overflow checking.
691 (free_exclude, fnmatch_no_wildcards): New function.
692 (excluded_filename): No longer requires options arg, as the options
693 are determined by add_exclude. Now returns bool, not int.
694 (excluded_filename, add_exclude):
695 Add support for the fancy new exclusion options.
696 (add_exclude, add_exclude_file): Now takes int options arg.
697 Check for arithmetic overflow when computing sizes.
698 (add_exclude_file): xrealloc might modify errno, so don't
699 realloc until after errno might be used.
701 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
703 (free_exclude): New decl.
704 (add_exclude, add_exclude_file): Now takes int options arg.
705 (excluded_filename): No longer requires options arg, as the options
706 are determined by add_exclude. Now returns bool, not int.
708 2001-08-30 Paul Eggert <eggert@twinsun.com>
710 * alloca.c (alloca): Arg is of type size_t, not unsigned.
712 2001-08-27 Jim Meyering <meyering@lucent.com>
714 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
716 * version-etc.c (N_): Remove definition.
717 Revert most of last change.
718 Instead, simply don't mark the `Copyright...' string for translation.
719 Based on advice from Paul Eggert.
721 * strtoxmax.c: Tweak comment.
723 2001-08-26 Jim Meyering <meyering@lucent.com>
725 * version-etc.c (version_etc_copyright_fmt): Replace literal year
726 of copyright with `%s' so translators don't get an untranslated
728 (COPYRIGHT_YEAR): Define.
729 (version_etc): Use fprintf rather than fputs.
730 Suggestion from Ulrich Drepper.
732 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
734 * strtoll.c: New file, from GNU libc.
735 * xstrtoimax.c: New file.
737 * xstrtol.h: Add xstrtoimax.
738 * strtoumax.c: New file. Simply include "strtoumax.c".
739 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
741 * strtoumax.c: Factor to work both for unsigned and signed types, ...
742 * strtoxmax.c: ... then renamed to this.
744 2001-08-13 Paul Eggert <eggert@twinsun.com>
746 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
747 Port to Solaris 8, where 'sed' requires a space after the 'r'
748 command, and where sh dislikes "$/". Clean up the spacing a bit.
749 Redirect output to $tmp just once.
751 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
753 * addext.c (<errno.h>): Include.
754 (errno): Declare if not defined.
755 (addext): Work correctly when pathconf returns -1 and leaves
756 errno alone because there is no limit. Also, work even if
757 pathconf returns a value greater than SIZE_MAX.
759 2001-08-12 Jim Meyering <meyering@lucent.com>
761 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
762 Simply `return getcwd (NULL, 0);'.
763 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
764 Use 1300 as initial value for length, not PATH_MAX.
766 * pathmax.h: Clean up cpp syntax.
768 2001-08-12 Jim Meyering <meyering@lucent.com>
770 * gettimeofday.c: New file.
772 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
774 2001-08-04 Jim Meyering <meyering@lucent.com>
776 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
777 to get in sync with glibc.
779 2001-08-03 Paul Eggert <eggert@twinsun.com>
781 The following changes are from gettext 0.10.39 as maintained by
784 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
785 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
786 with inverted sense. All uses changed.
788 * mbswidth.c: Don't include <limits.h>.
789 Include <stdlib.h> and <string.h> unconditionally.
790 (iswcntrl, mbsinit, ISCNTRL): New macros.
791 (mbsnwidth): Use K&R style function declarations.
792 Don't bother checking for MB_LEN_MAX == 1, since the compiler
793 can optimize it when MB_CUR_MAX == 1.
794 The width of control characters is zero, not 1.
796 2001-07-15 Jim Meyering <meyering@lucent.com>
798 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
799 (BUILT_SOURCES): Add unlocked-io.h.
800 (io_functions): Define.
801 (unlocked-io.h): New rule.
802 (DISTCLEANFILES): Add unlocked-io.h.
803 (all-local): Depend on unlocked-io.h, to ensure it is created.
805 * unlocked-io.hin: New file
807 * regex.c: Update from glibc.
809 2001-07-05 Jim Meyering <meyering@lucent.com>
811 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
813 (libfetish_a_SOURCES): Put all .h files here instead.
814 Remove a thus-exposed (better checks in automake) duplicate and
815 two unnecessary .h files.
817 2001-06-11 Jim Meyering <meyering@lucent.com>
819 * regex.c: Update from GNU libc.
821 2001-05-27 Jim Meyering <meyering@lucent.com>
823 * readutmp.h (UT_TYPE): Define.
825 2001-05-24 Jim Meyering <meyering@lucent.com>
827 * argmatch.c: Include "quote.h".
828 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
829 quote function. Reported by Göran Uddeborg.
831 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
833 * dirname.c (dir_name): Compute append_dot using path, not newpath
834 which is not yet declared.
836 2001-05-11 Paul Eggert <eggert@twinsun.com>
838 * Makefile.am (libfetish_a_SOURCES):
839 Add strftime.c, since we now compile it on all hosts.
841 * strftime.c (my_strftime):
842 Define to nstrftime if emacs, but only if my_strftime is not defined.
843 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
844 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
845 Add one more extra argument: a nanoseconds value.
848 (my_strftime function): Add %N format.
849 (emacs_strftimeu): Renamed from emacs_strftime,
850 with extra ut argument.
852 2001-05-11 Paul Eggert <eggert@twinsun.com>
854 dirname code cleanup. base_name now behaves more compatibly
855 with POSIX basename when given file names that have trailing
856 slashes, and similarly for dir_name. Add new primitives
857 base_len and dir_len. Put the directory-name-related decls
860 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
861 * backupfile.c (base_name): Likewise.
862 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
863 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
864 * makepath.c (strip_trailing_slashes): Likewise.
865 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
867 * rename.c (strip_trailing_slashes): Likewise.
868 * same.c (base_name): Likewise.
869 * stripslash.c (ISSLASH): Likewise.
871 * addext.c: Include <dirname.h> after size_t is defined.
872 * backupfile.c: Likewise.
874 * addext.c (addext): Use base_len to trim redundant
875 trailing slashes instead of doing it ourselves.
876 But do not trim the last slash if it is not redundant.
878 * backupfile.c (find_backup_file_name,
879 max_backup_version): Use base_len instead of rolling it ourselves.
880 Handle the case of "" and (on DOS) "C:" correctly.
882 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
883 Include <string.h>, <dirname.h>.
884 (base_name): Allow file names ending in slashes, other than names
885 that are all slashes. In this case, return the basename followed
886 by the slashes. This is more general, and can be used in places
887 where the original base_name purposely had an assertion failure.
888 (base_len): New function.
890 * dirname.c: Include <string.h> instead of <stdlib.h>.
891 Do not include <assert.h>; no longer needed.
893 (memrchr): Remove decl.
894 (dir_name_r): Remove.
895 (dir_len): Renamed from dirlen. All callers changed.
896 Rewrite in terms of base_name, for simplicity and consistency.
897 (dir_name): Never return NULL. All callers changed.
898 Do not include <stdlib.h> in test program; no longer needed.
899 return 0; is fine for test program.
901 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
903 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
905 * path-concat.c (path_concat): Use base_len to compute
906 base length, not strlen; this means we cannot rely on memcpy
909 * same.c (STREQ): Remove.
910 (same_name): Handle the case where the basename ends in trailing '/'.
912 * stripslash.c (strip_trailing_slashes): Return nonzero if
913 a slash was stripped. Do not strip the last slash after a
916 2001-04-08 Jim Meyering <meyering@lucent.com>
918 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
919 recomputed; that's necessary when the offset spans a DST transition.
920 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
922 2001-04-02 Jim Meyering <meyering@lucent.com>
924 * regex.h, regex.c: Update from GNU libc.
926 2001-03-19 Paul Eggert <eggert@twinsun.com>
928 * version-etc.c (version_etc_copyright): Update to 2001.
930 2001-03-16 Paul Eggert <eggert@twinsun.com>
932 * tempname.c (uint64_t): Define to uintmax_t if
933 not defined, and if UINT64_MAX is not defined.
934 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
935 Reported by John David Anglin.
937 2001-03-10 Bruno Haible <haible@clisp.cons.org>
939 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
940 alias if codeset is empty.
941 * config.charset (BeOS): Use wildcard syntax.
943 2001-03-13 Jim Meyering <meyering@lucent.com>
945 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
946 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
949 2001-03-06 Bruno Haible <haible@clisp.cons.org>
951 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
953 * unicodeio.c (print_unicode_char): Simplify accordingly.
955 2001-03-06 Bruno Haible <haible@clisp.cons.org>
957 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
958 support for DOS/DJGPP.
960 2001-02-28 Paul Eggert <eggert@twinsun.com>
962 * Makefile.am (libfetish_a_SOURCES):
963 Add dup-safer.c, fopen-safer.c.
964 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
966 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
968 2001-02-25 Paul Eggert <eggert@twinsun.com>
970 The mkstemp replacement is taken from glibc 2.2.2, with some
971 portability fixes for use outside glibc, as follows:
973 * tempname.c (struct_stat64): New macro.
974 (direxists, __gen_tempname): Use it.
975 This avoids a portability problem with Solaris 8.
977 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
978 (<stddef.h>, <stdint.h>, <string.h>):
979 Include only if STDC_HEADERS || _LIBC.
980 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
981 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
982 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
983 (__set_errno): Define this macro if <errno.h> doesn't.
984 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
985 Define these macros if <stdio.h> doesn't.
986 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
987 Define these macros if <sys/stat.h>
988 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
989 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
990 __xstat64): Define if not _LIBC.
991 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
992 (__gen_tempname): Invoke gettimeofday only if
993 HAVE_GETTIMEOFDAY || _LIBC;
994 otherwise, fall back on plain "time".
995 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
997 * mkstemp.c (__GT_FILE): Define to zero if not defined.
999 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
1001 2001-02-17 Jim Meyering <meyering@lucent.com>
1003 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
1004 around included file name.
1006 * strnlen.c (__strnlen): Merge in a change from GNU libc.
1008 * strftime.c: Update from GNU libc (the only changes were to comments).
1010 2001-02-13 Bruno Haible <haible@clisp.cons.org>
1012 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
1014 2001-02-17 Paul Eggert <eggert@twinsun.com>
1016 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
1017 Remove workaround macros for hosts that have mbrtowc but not
1018 mbstate_t, as we now insist on proper declarations for both
1019 before using mbrtowc.
1021 2001-02-17 Jim Meyering <meyering@lucent.com>
1023 * regex.c: Update from libc.
1025 2001-02-16 Paul Eggert <eggert@twinsun.com>
1027 * alloca.c (malloc): Undef before defining, since stdlib.h
1028 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
1029 Reported by Mark Hounschell via Paul Eggert.
1031 2001-01-30 Bruno Haible <haible@clisp.cons.org>
1033 * config.charset: Update for FreeBSD 4.2.
1035 2001-01-26 Jim Meyering <meyering@lucent.com>
1037 * quotearg.c: Include stddef.h.
1038 * quote.c: Include stddef.h.
1039 Reported by Axel Kittenberger.
1041 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
1042 line in double quotes so that it evokes a better diagnostic.
1043 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
1044 Reported by Axel Kittenberger.
1046 2001-01-15 Bruno Haible <haible@clisp.cons.org>
1048 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
1049 to avoid a warning. Add back 'const' to inptr.
1051 2001-01-16 Jim Meyering <meyering@lucent.com>
1053 * basename.c: Include <stdio.h>, needed by assert on SunOS4.
1056 2001-01-14 Jim Meyering <meyering@lucent.com>
1058 * rename.c: New file. From Volker Borchert.
1059 Include stdlib.h, string.h or strings.h, and xalloc.h.
1060 Use strip_trailing_slashes rather than open-coding it.
1062 2001-01-03 Paul Eggert <eggert@twinsun.com>
1064 * strftime.c: Sync with glibc time/strftime.c 1.81.
1066 2001-01-03 Jim Meyering <meyering@lucent.com>
1068 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
1069 local `inptr' to avoid warning with some system declarations of iconv.
1071 2000-12-29 Paul Eggert <eggert@twinsun.com>
1073 * modechange.c: Do not assume that mode_t uses the
1074 traditional octal encoding. E.g. "chmod 1 FOO" should set
1075 the other-execute bit of FOO even if S_IXOTH != 1.
1077 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
1078 WOTH, XOTH, ALLM): New macros.
1079 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
1080 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
1082 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
1083 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
1085 No need to use uintmax_t; unsigned long is long enough.
1086 Don't bother to get suffix since we don't use it.
1088 2000-12-24 Jim Meyering <meyering@lucent.com>
1090 * hash.c (is_prime): Return explicit boolean values.
1091 (hash_get_first): Return NULL to appease Irix5.6's 89.
1092 Reported by Nelson Beebe.
1094 2000-10-31 Bruno Haible <haible@clisp.cons.org>
1096 * localcharset.c (locale_charset): Add support for Win32.
1098 2000-12-18 Paul Eggert <eggert@twinsun.com>
1100 * physmem.h, physmem.c: New files.
1102 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
1103 (noinst_HEADERS): Add physmem.h.
1105 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
1106 't' for compatibility with Solaris 8 sort.
1108 2000-12-18 Bruno Haible <haible@clisp.cons.org>
1110 * config.charset: Add support for BeOS.
1112 2000-12-16 Jim Meyering <meyering@lucent.com>
1114 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
1115 SHELLS_FILE to a file name that's useful on djgpp systems.
1117 (ADDITIONAL_DEFAULT_SHELLS): Define.
1118 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
1119 Based mostly on a patch from Prashant TR.
1121 2000-12-16 Jim Meyering <meyering@lucent.com>
1123 This bug had a serious impact on chown: `chown N:M FILE' (for integer
1124 N and M) would have treated it like `chown N:N FILE'.
1126 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
1128 2000-10-31 Bruno Haible <haible@clisp.cons.org>
1130 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
1131 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
1132 to the list of canonical encodings. Rename EUC-CN to GB2312.
1134 2000-12-08 Andreas Schwab <schwab@suse.de>
1136 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
1137 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
1139 2000-12-07 Jim Meyering <meyering@lucent.com>
1141 * stripslash.c (ISSLASH): Define.
1142 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
1145 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
1146 (dir_name_r): Declare this function as static.
1147 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
1148 manifest itself on a name containing a mix of slashes and
1150 Make this function work with names starting with a DOS-style
1151 drive letter and colon prefix.
1152 (dir_name): Append `.' if necessary.
1153 Based mostly on patches from Prashant TR and Eli Zaretskii.
1155 * dirname.h (dir_name_r): Remove prototype.
1157 2000-12-05 Jim Meyering <meyering@lucent.com>
1159 * dirname.c (dir_name_r): Add `const' in a few local declarations.
1161 2000-12-04 Jim Meyering <meyering@lucent.com>
1163 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
1164 Also include memory.h, stdlib.h, unistd.h if appropriate.
1165 Reported by Andreas Jaeger (conflicting declaration of malloc).
1167 2000-12-02 Jim Meyering <meyering@lucent.com>
1169 * closeout.h: Make idempotent, to avoid some obscure warnings.
1171 2000-12-01 Paul Eggert <eggert@twinsun.com>
1173 * memrchr.c: Include <config.h> before any system include file.
1175 2000-11-29 Paul Eggert <eggert@twinsun.com>
1177 * dirname.c (dir_name_r): Fix typo: int -> size_t.
1179 2000-11-26 Jim Meyering <meyering@lucent.com>
1181 * memcoll.c: Include sys/types.h. From Werner Almesberger.
1183 2000-11-22 Paul Eggert <eggert@twinsun.com>
1185 * strftime.c (my_strftime): Do not invoke mbrlen with a
1186 size of (size_t) -1; it's not portable.
1188 2000-11-17 Akim Demaille <akim@epita.fr>
1190 * obstack.h: Formatting changes.
1191 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
1192 prevent type checking.
1193 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
1194 cast the value to (void *): assigning a `foo *' to a `void *'
1196 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
1198 2000-11-17 Jim Meyering <meyering@lucent.com>
1200 * strstr.c: Update from GNU libc.
1202 2000-11-16 Jim Meyering <meyering@lucent.com>
1204 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
1206 2000-11-11 Jim Meyering <meyering@lucent.com>
1208 * error.c: Add a couple #includes, merging from GNU libc version.
1210 2000-11-10 Jim Meyering <meyering@lucent.com>
1212 * obstack.h: Update from GNU libc.
1213 * obstack.c: Likewise.
1215 2000-11-06 Paul Eggert <eggert@twinsun.com>
1217 * getusershell.c (setusershell): Use rewind rather than
1218 fseek/fseeko, to avoid configuration hassles with fseeko.
1219 Don't bother opening SHELLS_FILE if shellstream is NULL;
1222 2000-11-05 Jim Meyering <meyering@lucent.com>
1224 * makepath.h (make_dir): Declare.
1225 * makepath.c (make_dir): Remove `static' attribute.
1228 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
1230 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
1231 last one in a bucket, advance to the next bucket.
1233 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
1235 * fnmatch.c: Do not comment out all the code if we are using
1236 the GNU C library, because in some cases we are replacing buggy
1237 code in the GNU C library itself.
1239 2000-10-30 Paul Eggert <eggert@twinsun.com>
1241 * error.h, getline.h, modechange.h:
1242 Remove "2000" from Copyright line, as the file hasn't been
1243 changed this year other than in the copyright notice.
1245 * xalloc.h: Add "2000" to Copyright line, as this file
1246 was changed this year.
1248 2000-10-30 Paul Eggert <eggert@twinsun.com>
1250 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
1251 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
1252 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
1254 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
1256 * regex.h (__restrict_arr): Move definition out of #ifndef block.
1257 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
1258 doesn't define __restrict_arr.
1260 2000-10-29 Jim Meyering <meyering@lucent.com>
1262 * xstat.in: Fix grammar in comment.
1264 2000-10-28 Jim Meyering <meyering@lucent.com>
1266 * memchr.c: Update from libc.
1267 Adjust for portability:
1268 [HAVE_STDLIB_H]: Include stdlib.h.
1269 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
1270 Undef __memchr, too.
1271 [!weak_alias]: Define __memchr to memchr.
1273 * regex.c: Update from libc.
1274 * regex.h: Likewise.
1275 * getopt1.c: Likewise.
1276 * memcmp.c: Likewise.
1278 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
1279 Avoid using fseek, when possible -- it's broken by design.
1280 Patch by Ulrich Drepper.
1282 2000-10-26 Jim Meyering <meyering@lucent.com>
1284 * strftime.c: Update from libc.
1286 2000-10-25 Jim Meyering <meyering@lucent.com>
1288 * obstack.c: Update from libc.
1290 2000-10-23 Jim Meyering <meyering@lucent.com>
1292 * hard-locale.c (hard_locale): Revert last change -- it was simply
1293 wrong. That set_locale call must not have any side effects.
1296 2000-10-22 Jim Meyering <meyering@lucent.com>
1298 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
1299 [CYCLIC]: Remove now-unused definition.
1301 * save-cwd.c (O_DIRECTORY): Define, if needed.
1302 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
1303 Suggestion from Ulrich Drepper.
1305 2000-10-21 Jim Meyering <meyering@lucent.com>
1307 * dirname.c (dir_name_r): New function, factored out of dir_name.
1308 (dir_name): Use dir_name_r.
1309 * dirname.h (dir_name_r): Declare it.
1311 2000-10-21 Jim Meyering <meyering@lucent.com>
1313 * dirname.c (memrchr): Declare if necessary.
1314 (dir_name): Remove the restriction that there be no
1315 trailing slashes. Now, this code skips past them, effectively
1317 [TEST_DIRNAME] (main): New unit tests.
1319 * memrchr.c: New file from GNU libc.
1320 Undef __memrchr, too.
1321 [!weak_alias]: Define __memrchr to memrchr.
1322 Guard weak_alias use with `#ifdef weak_alias'.
1324 2000-10-17 Jim Meyering <meyering@lucent.com>
1326 * quote.h (PARAMS): Define and use.
1327 Reported by Akim Demaille.
1329 * getopt.c: Update from libc.
1331 2000-10-16 Jim Meyering <meyering@lucent.com>
1333 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
1336 2000-09-25 Jim Meyering <meyering@lucent.com>
1338 * md5.h (rol): Define (from GnuPG).
1340 * sha.c: Give credit (GnuPG) where due.
1341 (M): Use rol rather than open-coding it.
1342 Add a FIXME comment.
1344 2000-09-21 Jim Meyering <meyering@lucent.com>
1346 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
1347 Reported by Michael Stone.
1349 2000-09-20 Jim Meyering <meyering@lucent.com>
1351 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
1352 (noinst_HEADERS): Add sha.h.
1353 Based on code from Scott G. Miller and from GnuPG.
1355 2000-09-15 Jim Meyering <meyering@lucent.com>
1357 * regex.c: Update from libc.
1359 2000-09-10 Jim Meyering <meyering@lucent.com>
1361 * getopt.c (_getopt_internal): Update from glibc.
1363 2000-09-09 Jim Meyering <meyering@lucent.com>
1365 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
1366 think it should be used as a general replacement for isascii.
1367 * fnmatch.c: Likewise.
1368 * mbswidth.c: Likewise
1369 * regex.c: Likewise.
1372 * userspec.c: Include sys/param.h and limits.h.
1374 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
1375 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
1376 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
1377 UID, GID. Check range.
1379 2000-09-06 Jim Meyering <meyering@lucent.com>
1381 * getopt.c (_getopt_internal): Update from glibc.
1383 2000-08-30 Jim Meyering <meyering@lucent.com>
1385 * strftime.c: Merge in changes from GNU libc.
1387 2000-08-26 Jim Meyering <meyering@lucent.com>
1389 * closeout.c: Include "__fpending.h".
1390 (close_stdout_status): Return right away if there's nothing to flush.
1392 * Makefile.am (noinst_HEADERS): Add __fpending.h.
1393 * __fpending.c: New file.
1394 * __fpending.h: New file.
1396 2000-08-07 Paul Eggert <eggert@twinsun.com>
1398 Standardize on "memory exhausted" instead of "Memory exhausted"
1399 or "virtual memory exhausted".
1400 * obstack.c (print_and_abort): Use "memory exhausted", not
1401 "virtual memory exhausted".
1402 * same.c (same_name): Invoke xalloc_die instead of printing
1404 * userspec.c (parse_user_spec): Likewise.
1405 * bumpalloc.h: comment fix
1406 * same.c, userspec.c: Include xalloc.h.
1408 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
1409 not char *const and pointing to a constant array.
1410 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
1411 (xrealloc): Comment fix.
1413 * userspec.c (parse_user_spec):
1414 Don't translate a message until just before returning,
1415 to avoid unnecessary translation.
1417 2000-08-07 Jim Meyering <meyering@lucent.com>
1419 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
1420 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
1421 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
1422 getgroups.c, gethostname.c, getopt.h, group-member.c,
1423 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
1424 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
1425 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
1426 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
1427 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
1428 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
1429 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
1430 yesno.c: Back out Copyright date changes for each file with no change
1431 this year. This eases coordination with other programs using the same
1432 source code modules. From Paul Eggert.
1434 2000-08-03 Greg McGary <greg@mcgary.org>
1436 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
1437 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
1438 (EXTEND_BUFFER): Use them.
1440 2000-08-01 Jim Meyering <meyering@lucent.com>
1442 * dirname.c (ISSLASH): Define.
1443 (BACKSLASH_IS_PATH_SEPARATOR): Define.
1444 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
1445 both `\' and `/' may be use as path separators.
1446 Based on a patch from Prashant TR.
1448 2000-07-31 Paul Eggert <eggert@twinsun.com>
1450 * quotearg.c (quotearg_n_options): Don't make the initial
1451 slot vector a constant, since it might get modified.
1453 2000-07-31 Jim Meyering <meyering@lucent.com>
1455 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
1456 * obstack.c (print_and_abort): Likewise.
1458 2000-07-30 Paul Eggert <eggert@twinsun.com>
1460 * quotearg.c (quotearg_n_options): Preallocate a slot 0
1461 buffer, so that the caller can always quote one small
1462 component of a "memory exhausted" message in slot 0.
1463 From a suggestion by Jim Meyering.
1465 2000-07-30 Jim Meyering <meyering@lucent.com>
1467 * makepath.c (make_path): Quote the other instance, too.
1469 * quotearg.c (N_STATIC_SLOTVECS): Define.
1470 (STATIC_BUF_SIZE): Define.
1471 (quotearg_n_options): Use only statically allocated storage when
1472 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
1473 than STATIC_BUF_SIZE.
1475 2000-07-29 Jim Meyering <meyering@lucent.com>
1477 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
1478 * dirname.c (dir_name): Likewise.
1480 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
1482 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
1483 (dir_name): Assert that there are no trailing slashes.
1485 2000-07-18 Bruno Haible <haible@clisp.cons.org>
1487 * mbswidth.h (mbswidth): Add a flags argument.
1488 (mbswidth): New declaration.
1489 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
1490 * mbswidth.c (mbswidth): Add a flags argument.
1491 (mbsnwidth): New function.
1493 2000-07-24 Jim Meyering <meyering@lucent.com>
1495 * mbswidth.c: Remove useless #else. From Bruno Haible.
1497 2000-07-23 Paul Eggert <eggert@twinsun.com>
1499 * mbswidth.c (_XOPEN_SOURCE):
1500 Don't define; this causes problems on Solaris 7.
1501 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
1503 2000-07-23 Paul Eggert <eggert@twinsun.com>
1506 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
1507 so that mbstate_t is always defined.
1509 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
1510 be 1 in at least one GCC installation, and this configuration
1511 error is likely to be common. Ignoring MB_LEN_MAX hurts
1512 performance on hosts that have mbrtowc but have only unibyte
1513 locales, but I assume these hosts are rare.
1515 2000-07-23 Paul Eggert <eggert@twinsun.com>
1517 * quotearg.c: Streamline by invoking multibyte code only if needed.
1518 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
1519 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
1520 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
1521 invoke multibyte primitives.
1523 2000-07-23 Jim Meyering <meyering@lucent.com>
1525 * basename.c (base_name): Add an assertion.
1527 2000-07-15 Bruno Haible <clisp.cons.org>
1529 * quotearg.c: When the system forces us to redefine mbstate_t,
1530 shadow its mbsinit function.
1532 2000-07-16 Bruno Haible <haible@clisp.cons.org>
1534 * mbswidth.h: New file.
1535 * mbswidth.c: New file.
1536 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
1537 (noinst_HEADERS): Add mbswidth.h.
1539 2000-07-17 Bruno Haible <haible@clisp.cons.org>
1541 * config.charset: Add support for FreeBSD. Improve support for HP-UX
1544 2000-07-15 Jim Meyering <meyering@lucent.com>
1546 * makepath.c: Include quote.h.
1547 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
1548 corresponding argument in a `quote (...)' call.
1549 Give better diagnostics.
1551 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
1552 (noinst_HEADERS): Add quote.h.
1554 * quote.c (quote, quote_n): New file. Two functions taken verbatim
1555 from tar's src/misc.c.
1556 * quote.h: New file. Prototypes for same.
1558 2000-07-10 Paul Eggert <eggert@twinsun.com>
1560 From a suggestion by Bruno Haible.
1561 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
1562 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
1563 to decide whether to define the BeOS workaround macro;
1564 this adjusts to the change to AC_MBSTATE_T.
1566 2000-07-13 Paul Eggert <eggert@twinsun.com>
1568 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
1570 * quotearg.c (quoting_style_args, quoting_style_vals,
1571 quotearg_buffer_restyled): Add support for
1572 clocale_quoting_style. Undo previous change to
1573 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
1574 and "{RIGHT QUOTATION MARK}" msgids.
1576 2000-07-05 Paul Eggert <eggert@twinsun.com>
1578 The old behavior of quoting `like this' doesn't look good with
1579 newer, ISO-style fonts. See:
1580 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
1582 Instead, quote "like this" by default. Let the translator
1583 tailor the locale-specific quoting behavior by providing
1584 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
1586 * quotearg.c (N_): New macro.
1587 (gettext_default): New function.
1588 (quotearg_buffer_restyled): Use
1589 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
1590 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
1592 2000-07-09 Jim Meyering <meyering@lucent.com>
1594 * Most files: Update copyright dates to include 2000.
1596 2000-07-08 Jim Meyering <meyering@lucent.com>
1598 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
1600 (xgethostname): Remove now-unnecessary #ifdef.
1601 Move declaration of `err' into loop where it's used.
1603 2000-07-05 Bruno Haible <haible@clisp.cons.org>
1605 * xgethostname.c (xgethostname): Protect against the SunOS5.5 bug
1606 by allocating a larger buffer. Test the gethostname return value for
1607 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
1608 returns an error and ENAMETOOLONG isn't defined.
1610 2000-07-05 Paul Eggert <eggert@twinsun.com>
1611 and Bruno Haible <haible@clisp.cons.org>
1613 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
1615 2000-07-05 Bruno Haible <haible@clisp.cons.org>
1617 * quotearg.c (struct quoting_options): Simplify quote_these_too
1620 2000-07-03 Jim Meyering <meyering@lucent.com>
1622 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
1623 Reported by Bruno Haible.
1625 2000-07-04 Jim Meyering <meyering@lucent.com>
1627 * quotearg.c: Make inclusion of <wchar.h> independent of whether
1628 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
1631 2000-07-03 Paul Eggert <eggert@twinsun.com>
1632 and Bruno Haible <haible@clisp.cons.org>
1634 * quotearg.c (mbrtowc):
1635 Assign to *pwc, and return 1 only if result is nonzero.
1636 (iswprint): Use ISPRINT when substituting our own mbrtowc.
1638 2000-07-03 Jim Meyering <meyering@lucent.com>
1640 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
1641 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
1644 2000-07-02 Jim Meyering <meyering@lucent.com>
1646 * quotearg.c (mbstate_t): Don't define here.
1648 2000-07-02 Jim Meyering <meyering@lucent.com>
1650 * nanosleep.c (SIGCONT): Define if not already defined.
1652 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1654 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
1655 per change in ../m4/ls-mntd-fs.m4.
1656 (read_filesystem_list): Ignore symbolic links.
1658 2000-06-29 Jim Meyering <meyering@lucent.com>
1660 * same.c: Include <string.h> or <strings.h>, as appropriate,
1661 for declaration of strcmp.
1663 * long-options.c: Include <stdlib.h>, for declaration of exit.
1665 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
1666 Avoid warning by casting result to `char *' to remove `const'.
1668 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1670 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
1672 2000-06-26 Paul Eggert <eggert@twinsun.com>
1674 savedir now sets errno on failure and invokes xmalloc to get memory.
1675 Fix a couple of other minor bugs while we're at it.
1677 * savedir.c (<unistd.h>): Do not include; there's no need.
1678 (NAMLEN): Remove macro.
1679 (malloc, realloc): Remove decls.
1681 ("xalloc.h"): Include.
1682 (NAME_SIZE_DEFAULT): New macro.
1683 (savedir): Use xmalloc / xrealloc to allocate memory.
1684 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
1685 Skip "" directory entries.
1686 Use strlen to calculate directory entry length, since the old method
1687 is rarely used these days and isn't worth supporting.
1688 Don't use a pointer after freeing it.
1689 Check for integer overflow when calculating allocation size.
1690 Use memcpy to copy entries, instead of stpcpy.
1691 Set errno properly when returning NULL.
1692 Check for readdir error.
1694 2000-06-26 Jim Meyering <meyering@lucent.com>
1696 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
1698 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1700 * getusershell.c (xmalloc, xrealloc): Remove functions.
1702 Don't include <stdlib.h>. Don't declare malloc, realloc.
1704 2000-06-23 Bruno Haible <haible@clisp.cons.org>
1706 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
1708 2000-06-24 Jim Meyering <meyering@lucent.com>
1710 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
1712 2000-06-21 Jim Meyering <meyering@lucent.com>
1714 * getpass.c: New file, from Bruno Haible. Required for BeOS.
1716 2000-06-19 Paul Eggert <eggert@twinsun.com>
1718 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
1719 (mbrtowc, mbstate_t): Define substitutes if
1720 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
1721 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
1722 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1724 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1726 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
1727 than 1024, return a memory chunk of least possible size, instead
1728 of size PATH_MAX + 2. In the loop, increment the size proportionally.
1729 Use free/xmalloc instead of xrealloc to avoid copying for very long
1732 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1734 * canon-host.c (canon_host): Use malloc and memcpy to copy an
1735 address, not strdup. Include <stdlib.h> and don't declare free().
1737 2000-06-17 Bruno Haible <haible@clisp.cons.org>
1739 * path-concat.c (path_concat): Don't access dir[-1] if dir is
1742 2000-06-21 Jim Meyering <meyering@lucent.com>
1744 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
1745 (noinst_HEADERS): Add getstr.h.
1747 * getline.c (getstr): Move into a separate file.
1748 * getstr.c (getstr): New file, extracted from getline.c, with
1749 the following changes: new parameter, delim2; both delim[12]
1750 parameters have type `int', not `char'. The latter would lose
1751 with 8-bit delimiters.
1752 * getstr.h: New file.
1754 2000-06-19 Jim Meyering <meyering@lucent.com>
1756 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
1758 2000-06-18 Jim Meyering <meyering@lucent.com>
1760 * mkdir.c: Remove file, due mainly to copyright incompatibility.
1761 Besides, these days every porting target provides a mkdir function.
1763 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
1764 (this snippet comes from src/system.h).
1766 2000-06-15 Paul Eggert <eggert@twinsun.com>
1768 * human.c (adjust_value): New function.
1769 (human_readable_inexact): Apply rounding style even when
1770 printing approximate values.
1772 2000-06-14 Paul Eggert <eggert@twinsun.com>
1774 * human.c (human_readable_inexact): Allow an input block
1775 size that is not a multiple of the output block size, and vice versa.
1776 Reported by Piergiorgio Sartor.
1778 2000-06-14 Paul Eggert <eggert@twinsun.com>
1780 * getdate.y (get_date): Apply relative times after time
1781 zone indicator, not before. Reported by Todd A. Jacobs.
1783 2000-06-13 Jim Meyering <meyering@lucent.com>
1785 * Makefile.am (all-local): Depend on lstat.c and stat.c.
1787 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
1789 2000-06-12 Paul Eggert <eggert@twinsun.com>
1791 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
1793 2000-06-04 Paul Eggert <eggert@twinsun.com>
1795 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
1797 2000-06-04 Jim Meyering <meyering@lucent.com>
1799 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
1800 SunOS4.1.4 for which gid_t is an unsigned type.
1802 2000-06-03 Jim Meyering <meyering@lucent.com>
1804 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
1806 2000-05-26 Bruno Haible <haible@clisp.cons.org>
1808 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
1809 newer, don't install charset.alias.
1810 * config.charset: Change the Linux/glibc rules so they become empty
1811 on glibc-2.1 or newer.
1813 2000-06-02 Jim Meyering <meyering@lucent.com>
1815 * mountlist.c: Back out last change. Instead, do this...
1816 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
1817 member using the same `ignore'-testing code.
1818 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
1822 2000-05-29 Jim Meyering <meyering@lucent.com>
1824 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
1825 with the `ignore' attribute. Based on a patch from Mark D. Roth.
1827 2000-05-22 Jim Meyering <meyering@lucent.com>
1829 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
1831 2000-05-18 Jim Meyering <meyering@lucent.com>
1833 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
1834 back, too, since it may have been modified by allocate_entry.
1835 (hash_delete): Rewrite to use neither the assignment operator
1836 nor the comma operator in an if-expression.
1838 2000-05-15 Paul Eggert <eggert@twinsun.com>
1841 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
1842 Remove; no longer needed.
1843 "quotearg.h": Add include.
1844 (file_name): Do not bother to explicitly initialize to NULL; it's less
1845 efficient on some hosts.
1846 (close_stdout_status): Remove test as to whether stdout was already
1847 closed; it breaks for the case "echo x | sort >&-".
1848 Quote file name colons.
1849 Do not assume that _("write error") lacks format strings.
1851 2000-05-15 Jim Meyering <meyering@lucent.com>
1853 * version-etc.c (version_etc_copyright): Update the copyright string
1854 used in all --version output.
1856 2000-05-14 Jim Meyering <meyering@lucent.com>
1858 * closeout.c (close_stdout_set_file_name): New function.
1859 (close_stdout_status): Use new file-scoped global.
1860 Return right away if fstat says the stdout file descriptor is invalid.
1861 * closeout.h (close_stdout_set_file_name): Declare.
1863 2000-05-10 Jim Meyering <meyering@lucent.com>
1865 * closeout.c [default_exit_status]: New file-scoped variable.
1866 (close_stdout_set_status): New function.
1867 * closeout.h (close_stdout_set_status): Declare.
1869 2000-05-08 Jim Meyering <meyering@lucent.com>
1871 * long-options.c: Don't include closeout.h.
1872 (parse_long_options): Don't call close_stdout for --version.
1874 2000-05-06 Jim Meyering <meyering@lucent.com>
1876 * strnlen.c: Undefine __strnlen and strnlen.
1877 [!weak_alias]: Define __strnlen to strnlen.
1879 * atexit.c: New file, from libiberty.
1881 2000-05-06 Jim Meyering <meyering@lucent.com>
1883 * closeout.c (close_stdout_status): Also check for errors on the
1886 2000-05-05 Bruno Haible <haible@clisp.cons.org>
1888 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
1889 instead of xmalloc, xrealloc, path_concat.
1890 (locale_charset): Treat empty environment variables as absent.
1891 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
1893 2000-05-04 Jim Meyering <meyering@lucent.com>
1895 * getopt.c: Update from glibc.
1896 * obstack.c: Likewise.
1897 * obstack.h: Likewise.
1898 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
1900 * regex.h: Likewise.
1901 * strndup.c: Likewise.
1902 * strnlen.c: New file, from glibc.
1904 2000-05-01 Jim Meyering <meyering@lucent.com>
1906 * full-write.c (full_write): Remove `FIXME' part of comment.
1908 2000-04-29 Jim Meyering <meyering@lucent.com>
1910 * path-concat.c: Declare strdup only if it's not defined.
1911 * canon-host.c: Likewise.
1913 2000-04-28 Jim Meyering <meyering@lucent.com>
1915 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
1916 redefinition warning on some systems (HPUX). Otherwise, regex.h is
1917 included first, then limits.h is included by locale.h by libintl.h.
1918 From John David Anglin.
1920 2000-04-25 Jim Meyering <meyering@lucent.com>
1922 * makepath.c (S_IRWXUGO): Define.
1923 (make_path): Always perform explicit chmod if MODE specifies any
1924 of the `special' permission bits. Prompted by a bug report against
1925 install from Mate Wierdl and Joost van Baal.
1927 2000-04-18 Jim Meyering <meyering@lucent.com>
1931 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
1932 getpagesize. For BeOS. Based on a patch from Bruno Haible.
1934 2000-04-17 Jim Meyering <meyering@lucent.com>
1936 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
1937 the definition of it to rpl_strftime also defined-away the system's
1940 2000-04-15 Jim Meyering <meyering@lucent.com>
1942 Use `C' to denote so-called `contiguous' files, the same way
1944 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
1945 (ftypelet): Use S_ISCTG.
1946 From Michael Deutschmann.
1948 2000-04-14 Jim Meyering <meyering@lucent.com>
1950 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
1952 2000-04-08 Jim Meyering <meyering@lucent.com>
1954 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
1955 names don't conflict. Reported by Eli Zaretskii.
1957 2000-03-28 Bruno Haible <haible@clisp.cons.org>
1959 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
1960 bug. Deal with the different error behavior of Irix iconv.
1962 2000-04-07 Jim Meyering <meyering@lucent.com>
1964 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
1965 to work around system header problems on AIX 3.2.5. From Bruno Haible.
1967 2000-04-05 Jim Meyering <meyering@lucent.com>
1969 Portability tweaks required for ultrix4.3.
1970 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
1971 * readutmp.c: Include sys/types.h before sys/stat.h.
1972 * canon-host.c: Declare strdup.
1973 * path-concat.c: Likewise.
1974 From John David Anglin.
1976 2000-04-04 Jim Meyering <meyering@lucent.com>
1978 Be more DOS 8.3-friendly.
1979 * ref-add.sin: Renamed from ref-add.sed.in.
1980 * ref-del.sin: Renamed from ref-del.sed.in.
1981 * Makefile.am: Reflect renaming.
1982 Reported by Eli Zaretskii.
1984 Use a temporary file name that won't clash with `charset.alias'
1985 in the DOS 8.3 name space.
1986 * Makefile.am (charset_tmp): Define.
1987 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
1988 (uninstall-local): Likewise.
1989 Reported by Eli Zaretskii.
1991 2000-03-29 Paul Eggert <eggert@twinsun.com>
1993 * time/strftime.c (my_strftime): Make sure we call the system
1994 strftime, not ourselves, when invoking the underlying strftime.
1996 2000-03-24 Jim Meyering <meyering@lucent.com>
1998 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
1999 (charset_alias): Define.
2000 (install-exec-local): Factor out common code.
2001 (uninstall-local): Split lines longer than 80.
2002 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
2004 (.sed.in.sed): New rule. Don't redirect directly to $@.
2005 (CLEANFILES): Add ref-add.sed and ref-del.sed.
2007 2000-03-19 Bruno Haible <haible@clisp.cons.org>
2009 * config.charset: Output a line containing "Packages using this file".
2010 * ref-add.sed.in, ref-del.sed.in: New files.
2011 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
2012 ref-del.sed): New rules.
2014 2000-03-17 Jim Meyering <meyering@lucent.com>
2016 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
2017 Otherwise, include <strings.h>
2019 2000-03-17 Bruno Haible <haible@clisp.cons.org>
2021 * unicodeio.c (utf8_wctomb): New function.
2022 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
2023 format instead of in UCS-4 with platform dependent endianness.
2025 2000-03-07 Paul Eggert <eggert@twinsun.com>
2027 * savedir.c (savedir): Work even if directory size is
2028 negative; this can happen with some screwy NFS configurations.
2030 2000-03-06 Jim Meyering <meyering@lucent.com>
2032 * localcharset.c (get_charset_aliases): Don't try to free file_name
2033 if it's NULL (because we ran out of memory). From Bruno Haible.
2035 2000-03-05 Jim Meyering <meyering@lucent.com>
2037 * localcharset.c ("path-concat.h"): Include.
2038 (get_charset_aliases): Use path_concat instead of ANSI string
2041 * unicodeio.h (PARAMS): Define.
2042 Use it to guard prototype.
2044 2000-03-04 Jim Meyering <meyering@lucent.com>
2046 * Makefile.am (install-exec-local): Create $(libdir) before installing
2048 (uninstall-local): Uncomment this rule so `make distcheck' works
2051 * unicodeio.c (<errno.h>): Include it.
2052 (errno): Declare if not defined.
2054 * localcharset.c: Add Bruno's comment justifying use of volatile.
2056 * config.charset: New version, incorporating remarks from a linux
2057 i18n mailing list. From Bruno Haible.
2059 2000-03-02 Jim Meyering <meyering@lucent.com>
2061 * Makefile.am (EXTRA_DIST): Add config.charset.
2063 2000-03-01 Jim Meyering <meyering@lucent.com>
2065 * localcharset.c: Guard some #includes with `#if HAVE_...'.
2066 * unicodeio.c: Likewise.
2068 2000-02-02 Bruno Haible <haible@clisp.cons.org>
2070 * config.charset: New file.
2071 * localcharset.c: New file.
2072 * unicodeio.h, unicodeio.c: New files.
2073 * Makefile.am (DEFS): Add -DLIBDIR=...
2074 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
2075 (noinst_HEADERS): Add unicodeio.h.
2076 (all-local, install-exec-local, charset.alias): New targets.
2078 2000-02-28 Paul Eggert <eggert@twinsun.com>
2080 * quotearg.c (ALERT_CHAR): New macro.
2081 (quotearg_buffer_restyled): Use it.
2083 2000-02-27 Jim Meyering <meyering@lucent.com>
2085 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
2086 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
2088 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
2089 not `#if STDC_HEADERS'.
2090 Declare malloc if needed.
2092 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
2093 now that autoconf always defines the HAVE_DECL_ symbols.
2094 * human.c: Likewise.
2096 * strtoumax.c: Likewise.
2098 * backupfile.c: Arrange for cpp to fail if the configure-time
2099 declaration check was not run.
2101 * human.c: Likewise.
2103 * strtoumax.c: Likewise.
2105 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
2106 then first look up the entire `.'-containing string as a login name.
2108 2000-02-18 Paul Eggert <eggert@twinsun.com>
2110 * getdate.y: Handle two-digit years with leading zeros correctly.
2111 (textint): New typedef.
2112 (parser_control): Member year changed from int to textint.
2114 (YYSTYPE): Removed; replaced by %union with int and textint members.
2115 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
2116 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
2117 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
2118 (tSNUMBER, tUNUMBER): Now of type <textintval>.
2119 (date, number, to_year): Use width of number in digits, not its value,
2120 to determine whether it's a 2-digit year, or a 2-digit time.
2121 (yylex): Store number of digits of numeric tokens.
2122 Reported by John Kendall.
2124 (parser_control): Changed from struct parser_control to typedef (for
2125 consistency). All uses changed.
2127 (tID): Removed; not used.
2128 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2130 2000-02-14 Paul Eggert <eggert@twinsun.com>
2132 * getpagesize.h (getpagesize): Port to VMS for Alpha;
2133 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
2135 2000-02-12 Jim Meyering <meyering@lucent.com>
2137 * userspec.c (ISDIGIT): Define it.
2138 (isdigit): Remove definition.
2139 (is_number): Use ISDIGIT, not isdigit.
2140 <libintl.h>: Include.
2142 (parse_user_spec): Mark translatable strings.
2144 2000-02-10 Jim Meyering <meyering@lucent.com>
2146 With these changes, nanosleep.[ch] are finally enough like the other
2147 lib/* replacement files to compile on a few more losing systems.
2149 * nanosleep.h: Don't include config.h.
2150 Remove prototype from declaration of nanosleep.
2151 (PARAMS): Remove now-unneeded definition.
2152 * nanosleep.c: #undef nanosleep.
2153 (rpl_nanosleep): Rename from nanosleep.
2155 2000-02-03 Jim Meyering <meyering@lucent.com>
2157 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
2158 rather than with `#if HAVE_UTMPNAME'.
2160 2000-02-01 Jim Meyering <meyering@lucent.com>
2162 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
2164 2000-01-31 Jim Meyering <meyering@lucent.com>
2166 * nanosleep.h (nanosleep): Guard declaration with
2167 `#if ! HAVE_DECL_NANOSLEEP'.
2168 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
2169 the declaration in that vendor's sys/timers.h.
2170 Reported by Christian Krackowizer.
2172 * quotearg.c (ISASCII): Add #undef and move definition to follow
2173 inclusion of wctype.h to work around solaris2.6 namespace pollution.
2174 (ISPRINT): Likewise.
2175 Reported by Tom Tromey.
2177 2000-01-30 Jim Meyering <meyering@lucent.com>
2179 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
2180 uses of ->ut_name. The latter doesn't work with new Linux header files
2181 where only utmpx.ut_user is declared.
2183 * readutmp.h (UT_USER): Define.
2185 2000-01-23 Jim Meyering <meyering@lucent.com>
2187 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
2190 2000-01-22 Jim Meyering <meyering@lucent.com>
2192 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
2193 [! HAVE_DECL_STRTOULL]: Declare strtoull.
2194 Required for some AIX systems. Reported by Christian Krackowizer.
2195 [TESTING] (main): New function.
2197 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
2198 * dirname.c (dir_name): Support for DOS-style file names with drive
2201 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
2203 * strverscmp.c (ISDIGIT): Define.
2204 (strverscmp): Use ISDIGIT, not isdigit.
2206 2000-01-17 Paul Eggert <eggert@twinsun.com>
2208 * nanosleep.c (nanosleep):
2209 Don't use SA_INTERRUPT to decide whether to call sigaction, as
2210 POSIX.1 doesn't require SA_INTERRUPT and some systems
2211 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
2212 it's been part of POSIX.1 since day 1 (in 1988).
2214 2000-01-17 Jim Meyering <meyering@lucent.com>
2216 * interlock: Remove unused file. Reported by François Pinard.
2218 2000-01-16 Paul Eggert <eggert@twinsun.com>
2220 * quotearg.c (quotearg_buffer_restyled): Do not quote
2221 alert, backslash, formfeed, and vertical tab unnecessarily in
2222 shell quoting style.
2225 version-control: never