be058cf149edf90278687896e2a93b6dffb73af0
[gnulib.git] / lib / ChangeLog
1 2002-11-22  Paul Eggert  <eggert@twinsun.com>
2
3         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4         hint that one should use `if (! x) abort ();' rather than `assert
5         (x);', and anyway it's one less thing to worry about configuring.
6         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7         hash_rehash, hash_insert): Use abort rather than assert.
8
9 2002-11-22  Paul Eggert  <eggert@twinsun.com>
10
11         * quotearg.h: Allow multiple inclusion by surrounding with
12         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
13         so that we can be included first.
14         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
15         * quotearg.c: Include quotearg.h immediately after config.h.
16         No need to include stddef.h or sys/types.h any more.
17         Surround local include files with "", not "<>".
18         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
19         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
20         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
21         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
23         (ISPRINT): Remove; no longer needed now that we assume C89.
24
25         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
26         Preserve errno.
27
28         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
29         quotearg_char): Use SIZE_MAX rather than
30         (size_t) -1 when we are talking about "infinity".
31
32         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
33
34 2002-11-22  Bruno Haible  <bruno@clisp.org>
35
36         * safe-read.h: Assume C89. Add comments.
37         (safe_read): Change return type to size_t.
38         * safe-read.c (safe_read): Change return type to size_t. Handle byte
39         counts > SSIZE_MAX correctly.
40         * safe-write.h: New file.
41         * safe-write.c: New file.
42         * full-read.h: New file.
43         * full-read.c: New file.
44         * full-write.h: Assume C89. Add comments.
45         * full-write.c: Include safe-write.h.
46         (full_write): Rewritten to use safe_write.
47         Suggested by Jim Meyering and Paul Eggert.
48
49 2002-11-21  Bruno Haible  <bruno@clisp.org>
50
51         Remove case insensitive option matching.
52         * argmatch.h (argcasematch): Remove declaration.
53         (ARGCASEMATCH): Remove macro.
54         (__xargmatch_internal): Remove case_sensitive argument.
55         (XARGMATCH): Update.
56         (XARGCASEMATCH): Remove macro.
57         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
58         case_sensitive argument.
59         (argcasematch): Remove function.
60         (__xargmatch_internal): Remove case_sensitive argument.
61         (main): Use XARGMATCH instead of XARGCASEMATCH.
62
63         * xmalloc.c: Change compile-time error message. Add comment about
64         required autoconf version.
65
66 2002-11-21  Jim Meyering  <jim@meyering.net>
67
68         * strdup.c (strdup): Tweak comment and initial #if/#include.
69
70         Merge in changes from the coreutils.
71
72         2002-09-25  Paul Eggert  <eggert@twinsun.com>
73         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
74         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
75         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
76         int.  Work more efficiently if X is the same width as uintmax_t.
77         Do not compare X to -1, to avoid bogus compiler warning.
78         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
79         Don't assume that f_frsize and f_bsize are the same type.
80
81         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
82         on FreeBSD.
83
84         * makepath.c (make_path): Restore umask *before* creating the final
85         component.
86         (make_path): Minor reformatting.
87
88         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
89         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
90
91         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
92         ones.  At least on GNU/Linux systems, `auto' means something else.
93         From Michael Stone.
94
95 2002-11-20  Paul Eggert  <eggert@twinsun.com>
96
97         Merge argmatch cleanups from Bison.  Assume C89.
98
99         * argmatch.c: Include config.h here, not in argmatch.h.
100         Include stdlib.h, for EXIT_FAILURE.
101         Always include <string.h>, since we assume C89.
102         (EXIT_FAILURE): Remove pre-C89 bug workaround.
103         * argmatch.h: Do not include <config.h> or <sys/types.h>.
104         Include <stddef.h> instead, since it's all we need for size_t.
105         (PARAMS): Remove.  All uses removed.
106         (ARRAY_CARDINALITY): Do not bother to #undef.
107         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
108         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
109         Remove unnecessary parentheses.
110         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
111         Insert necessary parentheses.
112         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
113         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
114
115 2002-11-19  Bruno Haible  <bruno@clisp.org>
116
117         * mbswidth.c: Include mbswidth.h right at the beginning.
118         * mbswidth.h: Include <stddef.h>, for size_t.
119
120         * mbswidth.h (PARAMS): Remove macro.
121         (mbswidth, mbsnwidth): Use ANSI C function declarations.
122         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
123
124         * gcd.h (PARAMS): Remove macro.
125         (gcd): Use ANSI C function declarations.
126         * gcd.c (gcd): Likewise.
127
128 2002-11-15  Bruno Haible  <bruno@clisp.org>
129
130         * strcspn.c: Include <stddef.h>.
131         (strcspn): Use ANSI C function declaration. Change return type to
132         size_t. Use NULL.
133         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
134         (strpbrk): Use NULL.
135         * strpbrk.h (PARAMS): Remove macro.
136         (strpbrk): Use ANSI C function declaration.
137         * strstr.c: Don't include <sys/types.h>.
138         * strstr.h (PARAMS): Remove macro.
139         (strstr): Use ANSI C function declarations.
140
141 2002-11-06  Bruno Haible  <bruno@clisp.org>
142
143         * gcd.h (gcd): Change argument type to 'unsigned long'.
144         * gcd.c (gcd): Likewise.
145
146 2002-11-05  Bruno Haible  <bruno@clisp.org>
147
148         * gcd.h: New file, from gettext-0.11.5.
149         * gcd.c: New file, from gettext-0.11.5.
150
151 2002-11-05  Bruno Haible  <bruno@clisp.org>
152
153         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
154         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
155         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
156         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
157
158         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
159         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
160
161         * closeout.c: Include gettext.h instead of <libintl.h>.
162         * human.c: Include gettext.h instead of <libintl.h>.
163         * quotearg.c: Include gettext.h instead of <libintl.h>.
164         * rpmatch.c: Include gettext.h instead of <libintl.h>.
165         * unicodeio.c: Include gettext.h instead of <libintl.h>.
166         * userspec.c: Include gettext.h instead of <libintl.h>.
167         * version-etc.c: Include gettext.h instead of <libintl.h>.
168         * xmalloc.c: Include gettext.h instead of <libintl.h>.
169         (textdomain): Remove definition.
170         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
171
172         * long-options.c: Remove include of <libintl.h> and definition of _.
173         * same.c: Remove include of <libintl.h> and definition of _.
174
175 2002-11-04  Bruno Haible  <bruno@clisp.org>
176
177         * stpcpy.h: New file, from GNU gettext-0.11.5.
178         * strcase.h: New file, from GNU gettext-0.11.5.
179         * strpbrk.h: New file, from GNU gettext-0.11.5.
180         * strstr.h: New file, from GNU gettext-0.11.5.
181         * xgetcwd.h: New file, from GNU gettext-0.11.5.
182
183 2002-05-09  Bruno Haible  <bruno@clisp.org>
184
185         * config.charset: Update for newest glibc. Add canonical names
186         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
187
188 2002-05-09  Bruno Haible  <bruno@clisp.org>
189
190         * localcharset.c (get_charset_aliases): Add more Windows specific
191         aliases.
192
193 2002-05-08  Owen Taylor  <otaylor@redhat.com>
194
195         * config.charset: A few additions for Solaris.
196
197 2001-12-05  Bruno Haible  <bruno@clisp.org>
198
199         * localcharset.c (locale_charset): Don't return an empty string.
200
201 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
202
203         * config.charset: msdos in uk_UA uses CP1125.
204
205 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
206
207         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
208         * localcharset.c (locale_charset): Declare as extern "C".
209
210 2002-02-15  Bruno Haible  <bruno@clisp.org>
211
212         * config.charset [msdosdjgpp]: For Russian, use CP866.
213
214 2002-02-11  Bruno Haible  <bruno@clisp.org>
215
216         * config.charset: Add support for NetBSD.
217
218 2002-09-25    <karl@gnu.org>
219
220         * strdup.c: copy from libc/string (via ../config/srclist*).
221         * getopt*: copy from libc/posix.
222         * gettext.h: copy from gettext.
223         * .cppi-disable: add strdup.c, gettext.h.
224
225 2002-07-01  Jim Meyering  <meyering@lucent.com>
226
227         * c-stack.c: Include sys/time.h.
228         From Volker Borchert.
229
230 2002-06-11  Paul Eggert  <eggert@twinsun.com>
231
232         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
233         New macro.  Use it uniformly instead of
234         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
235         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
236         reported by Vin Shelton.
237
238 2002-06-22  Jim Meyering  <meyering@lucent.com>
239
240         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
241         redefinition due to Solaris5.6's definition in /usr/include/sys/euc.h.
242
243 2002-06-22  Paul Eggert  <eggert@twinsun.com>
244
245         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
246         Do not assume SA_SIGINFO behavior.
247         Bug reported by Jim Meyering on NetBSD 1.5.2.
248
249 2002-06-22  Jim Meyering  <meyering@lucent.com>
250
251         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
252
253         * exitfail.c, exitfail.h: Likewise.
254         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
255
256         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
257         of fnmatch.h.
258         (EXTRA_DIST): Add fnmatch_loop.c.
259         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
260
261         * fnmatch_loop.c: New file, from diffutils-2.8.2.
262         * fnmatch.c: Update from diffutils-2.8.2.
263         * fnmatch_.h: New file.  From diffutils-2.8.2.
264         * fnmatch.h: Remove file.
265
266 2002-06-18  Paul Eggert  <eggert@twinsun.com>
267
268         * file-type.h: Report an error if neither S_ISREG nor
269         S_IFREG is defined, instead of using a test specific to glibc
270         2.2.  This should be safe, since POSIX requires S_ISREG and
271         Unix Version 7 had S_IFREG.  We don't need to check for
272         <sys/types.h> since we don't use any symbols that it defines.
273
274 2002-06-15  Jim Meyering  <meyering@lucent.com>
275
276         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
277         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
278         have been included before this file.
279
280 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
281
282         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
283         so that each temporary file name is unique and valid in the first
284         8 characters, for operation under DOS.
285
286 2002-06-15  Jim Meyering  <meyering@lucent.com>
287
288         Work even with DJGPP 2.03, which lacks support for symlinks.
289         From Richard Dawe.
290         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
291         is defined.
292         * lchown.c (S_ISLNK): Likewise.
293
294 2002-06-14  Jim Meyering  <meyering@lucent.com>
295
296         * file-type.h: Use the version from diffutils-2.8.2.
297         * file-type.c: Likewise.
298
299 2002-05-27  Jim Meyering  <meyering@lucent.com>
300
301         Fix a problem seen only on nonconforming systems whereby ls.c's
302         use of localtime, and then of gettimeofday would cause trouble:
303         the localtime call used to initialize rpl_gettimeofday's save
304         mechanism would clobber ls's current local time information so
305         that in any long listing the first file would always be listed
306         with date 1970-01-01.  Analysis by Volker Borchert.
307
308         * gettimeofday.c (localtime): Undefine.
309         (rpl_localtime): New function.
310
311 2002-05-22  Jim Meyering  <meyering@lucent.com>
312
313         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
314         * file-type.h: New file.
315         * file-type.c (file_type): New file/function.  Extracted from diffutils.
316
317 2002-04-29  Paul Eggert  <eggert@twinsun.com>
318
319         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
320
321 2002-04-28  Paul Eggert  <eggert@twinsun.com>
322
323         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
324         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
325         of 127, since 64 is the largest conceivable number for ancient
326         nonstandard hosts.
327         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
328
329 2002-04-28  Jim Meyering  <meyering@lucent.com>
330
331         * sig2str.c (WTERMSIG): Remove definition (unused).
332
333 2002-04-28  Paul Eggert  <eggert@twinsun.com>
334
335         * sig2str.h, sig2str.c: New files.
336         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
337
338 2002-04-24  Jim Meyering  <meyering@lucent.com>
339
340         * gettext.h: New file, from Gettext.
341         * Makefile.am (INCLUDES): Remove -I../intl.
342         (libfetish_a_SOURCES): Add gettext.h.
343
344 2002-04-16  Jim Meyering  <meyering@lucent.com>
345
346         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
347         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
348         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
349
350 2002-04-12  Jim Meyering  <meyering@lucent.com>
351
352         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
353
354 2002-03-10  Jim Meyering  <meyering@lucent.com>
355
356         * makepath.c (make_path): Remove a comma from a diagnostic.
357         Suggestion from Santiago Vila.
358
359 2002-03-08  Jim Meyering  <meyering@lucent.com>
360
361         * rename.c: Mention that this wrapper is needed also on
362         mips-dec-ultrix4.4 systems.
363
364 2002-03-02  Jim Meyering  <meyering@lucent.com>
365
366         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
367         not HAVE_CLOCK_SETTIME.
368
369 2002-02-27  Paul Eggert  <eggert@twinsun.com>
370
371         * nanosleep.h: Rename to....
372         * timespec.h: New name for nanosleep.h.  All uses changed.
373
374         * gettime.c: New file.
375         * settime.c: New file.
376         * stime.c: Remove.
377
378         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
379         timespec.h.  Remove nanosleep.h.
380
381 2002-02-25  Paul Eggert  <eggert@twinsun.com>
382
383         * acl.c, acl.h: New files.
384         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
385
386 2002-02-24  Jim Meyering  <meyering@lucent.com>
387
388         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
389         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
390         cause trouble.  Reported by Nelson Beebe.
391
392 2002-02-23  Paul Eggert  <eggert@twinsun.com>
393
394         * path-concat.c (xpath_concat): Reorder code to pacify
395         compilers that don't know that xalloc_die never returns.
396
397 2002-02-20  Jim Meyering  <meyering@lucent.com>
398
399         * getdate.c: Regenerate using bison-1.33.
400
401 2002-02-15  Paul Eggert  <eggert@twinsun.com>
402
403         * posixver.c, posixver.h: New files.
404         * Makefile.am (libfetish_a_SOURCES): Add them.
405
406 2002-02-02  Paul Eggert  <eggert@twinsun.com>
407             Bruno Haible  <bruno@clisp.org>
408
409         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
410         (fwrite_success_callback): New declaration.
411         * unicodeio.c (unicode_to_mb): New function, extracted from
412         print_unicode_char. Call failure callback instead of error.
413         (fwrite_success_callback): New function.
414         (exit_failure_callback): New function.
415         (fallback_failure_callback): New function.
416         (print_unicode_char): Call unicode_to_mb.
417
418 2002-01-26  Jim Meyering  <meyering@lucent.com>
419
420         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
421
422 2002-01-22  Jim Meyering  <meyering@lucent.com>
423
424         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
425         Otherwise, some versions of automake would omit the rule that makes
426         Makefile from Makefile.in.
427
428 2001-01-21  Paul Eggert  <eggert@twinsun.com>
429
430         * xmemcoll.h, xmemcoll.c: New files.
431         * Makefile.am (libfetish_a_SOURCES): Add them.
432         * memcoll.c: Include errno.h, and declare errno if not defined.
433         (memcoll): Set errno to zero if there is no error.
434
435         * quotearg.c (quotearg_buffer_restyled):
436         Fix bug with quoting buffers containing NUL when backslashing escapes.
437         This bug was exposed by the other changes in this patch.
438         (quotearg_n_options): New arg ARGSIZE.
439         All callers changed.
440         (quoting_options_from_style): New function.
441         (quotearg_n_style): Use it.
442         (quotearg_n_style_mem): New function.
443
444         * quotearg.h (quotearg_n_style_mem): New function.
445
446 2002-01-16  Jim Meyering  <meyering@lucent.com>
447
448         * getdate.y: Add three semicolons, each just before a closing brace.
449         Bison (as of version 1.31) no longer papers over that mistake.
450
451 2002-02-14  Paul Eggert  <eggert@twinsun.com>
452
453         * backupfile.c (ISDIGIT): Comment fix.
454         * getdate.y (ISDIGIT): Likewise.
455         * posixtm.c (ISDIGIT, year): Likewise.
456         * strverscmp.c (ISDIGIT): Likewise.
457         * userspec.c (ISDIGIT): Likewise.
458
459 2002-01-05  Jim Meyering  <meyering@lucent.com>
460
461         * version-etc.c (version_etc_copyright): Update copyright year.
462
463 2001-01-19  Paul Eggert  <eggert@twinsun.com>
464
465         * closeout.c (close_stdout_status): If ferror (stdout), do
466         not silently exit merely because the output buffer happens to
467         have nothing pending.
468
469 2001-12-18  Paul Eggert  <eggert@twinsun.com>
470
471         See the big note in ../ChangeLog.
472         * human.c (suffixes): Prefer K to k for 1024.
473         (generate_suffix_backwards): New function.
474         (human_readable_inexact): Use it.
475         * xstrtol.c (__xstrtol): If there is no number but there
476         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
477         Accept 'K' as well as 'k'.
478
479 2001-12-15  Jim Meyering  <meyering@lucent.com>
480
481         * regex.h (__restrict_arr): Update from libc.
482
483         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
484         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
485         (STREQ): Define.
486
487 2001-12-10  Jim Meyering  <meyering@lucent.com>
488
489         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
490         Instead, include "xalloc.h".
491         (initbuffer): Don't cast xmalloc return value to char*.
492         (readline): Reword comment.
493         Don't cast xrealloc return value to char*
494         Return NULL, not 0.
495
496 2001-12-09  Jim Meyering  <meyering@lucent.com>
497
498         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
499         `signed and unsigned type in conditional expression'.
500         * posixtm.c (posix_time_parse): Likewise.
501
502         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
503
504         * readtokens.c (readtoken): Declare an index to be of type unsigned
505         to avoid a pedantic warning.
506
507         * getstr.c: Don't include assert.h.
508         (getstr): Remove warning-evoking assertions.
509         Return -1 if offset parameter is out of bounds.
510         Change the type of a local from int to size_t.
511
512         * strftime.c (my_strftime_localtime_r): Include this function
513         definition in the `#if ! HAVE_TM_GMTOFF' block.
514
515         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
516         Include xalloc.h instead.
517
518 2001-12-02  Jim Meyering  <meyering@lucent.com>
519
520         * tempname.c: Don't declare getenv, thus reverting the change of
521         2001-11-18.  It's no longer necessary, now that stdlib.h is always
522         included.
523
524         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
525         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
526
527 2001-11-30  Akim Demaille  <akim@epita.fr>
528
529         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
530         before being defined.
531
532 2001-11-27  Paul Eggert  <eggert@twinsun.com>
533
534         * quotearg.h (quotearg_n, quotearg_n_style):
535         First arg is int, not unsigned.
536         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
537         (SIZE_MAX, UINT_MAX): New macros.
538         (quotearg_n_options): Abort if N is negative.
539         Avoid overflow check on hosts where size_t is 64 bits and int
540         is 32 bits, as overflow is impossible there.
541         Fix off-by-one typo that caused unnecessary reallocation.
542
543 2001-11-27  Jim Meyering  <meyering@lucent.com>
544
545         * tempname.c: Merge with version from libc.
546         * regex.c: Likewise.
547
548         * tempname.c: Include stdlib.h unconditionally.  On some old systems
549         for which STDC_HEADERS is 0, it was not included, resulting in a
550         warning about an integer-to-pointer conversion problem with getenv.
551         Reported by Volker Borchert.
552
553 2001-11-26  Jim Meyering  <meyering@lucent.com>
554
555         * gtod.h: Remove file.
556         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
557         * gettimeofday.c: Don't include gtod.h.
558         (GTOD_init): Remove function.
559         (rpl_gettimeofday): Do its job here instead, rather than aborting.
560         Suggestion from Volker Borchert.
561
562 2001-11-23  Jim Meyering  <meyering@lucent.com>
563
564         * hash.h (struct hash_table): Don't define here.  Merely declare it.
565         * hash.c (struct hash_table): Define it here instead.
566
567 2001-11-22  Jim Meyering  <meyering@lucent.com>
568
569         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
570
571 2001-11-18  Paul Eggert  <eggert@twinsun.com>
572
573         * tempname.c (TMP_MAX): Remove; no longer needed.
574         (TEMPORARIES): New macro.
575         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
576         removes an artificial limitation (e.g. HP-UX 10.20, where
577         TMP_MAX is 17576).
578
579 2001-11-18  Jim Meyering  <meyering@lucent.com>
580
581         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
582         on SunOS4.
583
584         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
585         files will be created before anything else.
586
587 2001-11-17  Jim Meyering  <meyering@lucent.com>
588
589         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
590         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
591         rather than group writable.  Patch by Juan F. Codagnone.
592
593         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
594         Instead, include "xalloc.h".
595
596         * mountlist.c: Include unlocked-io.h after all system headers.
597         Remove explicit declarations of xmalloc, xrealloc,
598         and xstrdup.  Instead, include "xalloc.h".
599
600         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
601         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
602         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
603
604         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
605         Reported by Padraig Brady.
606
607         * mkstemp.c: #undef mkstemp.
608         Include config.h.
609         (rpl_mkstemp): Rename from mkstemp.
610         Protoize.
611
612 2001-11-16  Jim Meyering  <meyering@lucent.com>
613
614         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
615         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
616         determine the amount of total physical memory, use pstat_getstatic.
617         HPUX-11 doesn't define _SC_PHYS_PAGES.
618         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
619         If sysconf couldn't be used to determine the amount of available
620         physical memory, use both pstat_getstatic and pstat_getdynamic.
621         Based on a patch from Bob Proulx.
622
623 2001-11-05  Jim Meyering  <meyering@lucent.com>
624
625         * xstat.in (slash_aware_lstat): Correct a misleading comment.
626
627 2001-11-03  Jim Meyering  <meyering@lucent.com>
628
629         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
630         in argmatch_to_argument call.
631
632         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
633         argument.
634
635         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
636         e.g., a fault due to an attempt to free a NULL pointer.
637
638 2001-11-01  Jim Meyering  <meyering@lucent.com>
639
640         * dirfd.c, dirfd.h: New files.
641         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
642
643         * hash.c (hash_print) [TESTING]: Clean up.
644
645 2001-10-22  Paul Eggert  <eggert@twinsun.com>
646
647         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
648         to avoid a warning if -Wall.
649
650 2001-10-21  Paul Eggert  <eggert@twinsun.com>
651
652         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
653
654 2001-10-21  Jim Meyering  <meyering@lucent.com>
655
656         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
657         this code would end up calling gettext even in packages built
658         with --disable-nls.
659         * getopt.c (_): Likewise.
660         * regex.c (_): Likewise.
661
662 2001-10-20  Paul Eggert  <eggert@twinsun.com>
663
664         * error.c (strerror_r): Do not declare unless !_LIBC.
665         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
666         Use strerror_r that is only a macro, even if it is not a function.
667         (strerror): Check for HAVE_DECL_STRERROR before declaring.
668         (private_strerror): Use prototypes, not old-style function definition.
669         (print_errno_message): New function.
670         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
671         char*-flavored one.
672         (error_tail, error, error_at_line): Use it.
673
674 2001-10-11  Jim Meyering  <meyering@lucent.com>
675
676         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
677         and quote_n (1, ... to avoid clobbering a buffer.
678
679 2001-10-05  Jim Meyering  <meyering@lucent.com>
680
681         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
682         * hash-pjw.c: New file (factored out of fileutils' remove.c).
683         * hash-pjw.h: New file.
684
685 2001-09-30  Jim Meyering  <meyering@lucent.com>
686
687         * mountlist.c [MOUNTED_GETFSSTAT]:
688         Include <sys/ucred.h>, for Apple Darwin.
689         Include sys/mount.h and sys/fs_types.h only if available.
690         (FS_TYPE): Define.
691         (read_filesystem_list): Use FS_TYPE.
692
693 2001-09-29  Paul Eggert  <eggert@twinsun.com>
694
695         * exclude.c (excluded_filename): 0 -> false, since it's
696         a boolean context.
697
698 2001-09-28  Paul Eggert  <eggert@twinsun.com>
699
700         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
701         #defines strtoimax.  Also treat the other strto* functions
702         like strtoimax.
703
704         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
705         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
706         (strtoimax, strtoumax): Do not declare if already defined as a macro.
707
708 2001-09-26  Jim Meyering  <meyering@lucent.com>
709
710         Most macros in unlocked-io.h had the wrong number of arguments.
711         * gen-uio: New script.
712         (USE_UNLOCKED_IO): Define to 1 if not already defined.
713         * unlocked-io.hin: Remove file.
714         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
715         rather than trying to embed it here.
716         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
717         Reported by Padraig Brady.
718
719 2001-09-25  Volker Borchert  <bt@teknon.de>
720
721         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
722
723 2001-09-23  Jim Meyering  <meyering@lucent.com>
724
725         * mountlist.c: Remove useless parentheses in #if directives.
726         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
727         the deprecated MOUNTED symbol is no longer defined in mntent.h.
728
729 2001-09-22  Jim Meyering  <meyering@lucent.com>
730
731         * localcharset.c: Update from latest gettext.
732         * config.charset: Likewise.
733
734 2001-09-20  Jim Meyering  <meyering@lucent.com>
735
736         * xstrtol.c (strtoimax): Guard declaration with
737         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
738         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
739         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
740         (strtoumax): Likewise, for completeness (it wasn't necessary).
741
742 2001-09-06  Paul Eggert  <eggert@twinsun.com>
743
744         * strtoimax.c (HAVE_LONG_LONG):
745         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
746         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
747         to work around bug in IBM C compiler.
748
749 2001-09-16  Jim Meyering  <meyering@lucent.com>
750
751         * mkdir.c: New file.
752
753 2001-09-04  Paul Eggert  <eggert@twinsun.com>
754
755         * xgetcwd.c: Revert some of the previous change; intead,
756         fix the HAVE_GETCWD_NULL code to behave more like the
757         !HAVE_GETCWD_NULL code used to.
758
759         Include "xalloc.h".
760         (xgetcwd): Do not return NULL when memory is exhausted; instead,
761         invoke xalloc_die.
762
763 2001-09-04  Paul Eggert  <eggert@twinsun.com>
764
765         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
766         Use ssize_t, not int, to store result of readlink.
767         Check for ssize_t overflow as well as size_t overflow,
768         as POSIX says the result of readlink is implementation-defined
769         when ssize_t overflows.
770         Remove unnecessary cast to char*.
771         Use free+malloc instead of realloc, as the storage doesn't need
772         to be preserved and it's clearer and can be more efficient that way.
773         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
774         * xreadlink.h (xreadlink): Update prototype.
775
776 2001-09-03  Paul Eggert  <eggert@twinsun.com>
777
778         * exclude.c (fnmatch_no_wildcards): Fix confusion between
779         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
780         spotted by Jim Meyering.
781
782 2001-09-03  Jim Meyering  <meyering@lucent.com>
783
784         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
785
786 2001-09-03  Paul Eggert  <eggert@twinsun.com>
787
788         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
789         like the HAVE_GETCWD_NULL code.
790         Include pathmax.h if not HAVE_GETCWD.
791         Do not include xalloc.h.
792         (INITIAL_BUFFER_SIZE): New symbol.
793         Do not use xmalloc / xrealloc, since the caller is responsible for
794         handling errors.  Preserve errno around `free' during failure.
795         Do not overrun buffer when using getwd.
796
797 2001-09-03  Paul Eggert  <eggert@twinsun.com>
798
799         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
800         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
801
802 2001-09-02  Jim Meyering  <meyering@lucent.com>
803
804         * error.c: Update from GNU libc.
805
806 2001-09-01  Jim Meyering  <meyering@lucent.com>
807
808         * xreadlink.c: New file.
809         * xreadlink.h: New file.
810         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
811
812         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
813         doesn't conflict with sparc-sun-solaris2.7's definition in
814         /usr/include/sys/int_types.h.
815
816         * exclude.c: Use `""', not `<>' to #include non-system header files.
817         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
818         and strncasecmp as r-values.  Unixware didn't have declarations.
819
820 2001-08-31  Jim Meyering  <meyering@lucent.com>
821
822         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
823         Use an initial, malloc'd, buffer of length 128 rather than
824         a statically allocated one of length 1024.
825
826 2001-08-30  Paul Eggert  <eggert@twinsun.com>
827
828         * xgetcwd.c: Don't include pathmax.h.
829         Include stdlib.h and unistd.h if available.
830         Include xalloc.h.
831         (xmalloc, xstrdup, free): Remove decls.
832         (xgetcwd): Don't assume sizes fit in unsigned.
833         Check for overflow when computing sizes.
834         Simplify reallocation code.
835
836 2001-08-28  Paul Eggert  <eggert@twinsun.com>
837
838         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
839
840         * strtoimax.c: Renamed from strtoxmax.c, removing the
841         old strtoimax.c.
842
843         Also, make the following further changes to make this file's
844         configuration more similar to that of strtol.c:
845         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
846         (strtoumax, uintmax_t, strtoull, strtol): Remove.
847         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
848         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
849         changed to signed values.
850
851         And make the following changes as well:
852         Fix copyright notice, as 1999 was missing.
853         (verify): New macro.
854         (strtoimax): Check sizes at compile-time, not run-time.
855         Prefer strtol to strtoll if both work.
856         (main): Remove; it was not that useful and was a pain to maintain.
857
858         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
859
860 2001-08-30  Paul Eggert  <eggert@twinsun.com>
861
862         * savedir.c (savedir): Remove size parameter, as POSIX says that
863         a directory's st_size can have an arbitrary value, so the old
864         usage could waste an arbitrary amount of memory.  All uses
865         changed.
866         * savedir.h: Update prototype.
867
868 2001-08-30  Paul Eggert  <eggert@twinsun.com>
869
870         * xstrtol.c (strtoimax): New decl.
871
872 2001-08-28  Paul Eggert  <eggert@twinsun.com>
873
874         * xstrtol.h: Add copyright notice.
875         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
876         LONGINT_INVALID_SUFFIX_CHAR.
877
878 2001-08-30  Paul Eggert  <eggert@twinsun.com>
879
880         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
881         tm to be declared.
882
883 2001-08-30  Paul Eggert  <eggert@twinsun.com>
884
885         * hash.c: Remove '2001' from copyright notice.
886
887 2001-08-30  Paul Eggert  <eggert@twinsun.com>
888
889         * full-write.h: New file.
890         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
891         * full-write.c: Correct credits, as cccp.c no longer
892         exists and anyway it was so heavily changed from the old cccp
893         code as to be unrecognizable.  Include full-write.h.
894         (full_write) Return size_t, with short writes meaning failure.
895         All callers changed.  This fixes a bug with large buffers
896         on 64-bit hosts.
897         * utime.c: Include full-write.h.
898
899 2001-08-30  Paul Eggert  <eggert@twinsun.com>
900
901         Merge 'exclude' changes from tar 1.13.22.
902         This fixes one or two unlikely storage allocation overflow bugs,
903         but doesn't change user-visible behavior otherwise.
904
905 2001-08-30  Paul Eggert  <eggert@twinsun.com>
906
907         * exclude.c (bool): Declare, perhaps by including stdbool.h.
908         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
909         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
910         Include if available.
911         (<xalloc.h>): Include
912         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
913         (verify): New macro.  Use it to verify that EXCLUDE macros do not
914         collide with FNM macros.
915         (struct patopts): New struct.
916         (struct exclude): Use it, as exclude patterns now come with options.
917         (new_exclude): Support above changes.
918         (new_exclude, add_exclude_file):
919         Initial size must now be a power of two to simplify overflow checking.
920         (free_exclude, fnmatch_no_wildcards): New function.
921         (excluded_filename): No longer requires options arg, as the options
922         are determined by add_exclude.  Now returns bool, not int.
923         (excluded_filename, add_exclude):
924         Add support for the fancy new exclusion options.
925         (add_exclude, add_exclude_file): Now takes int options arg.
926         Check for arithmetic overflow when computing sizes.
927         (add_exclude_file): xrealloc might modify errno, so don't
928         realloc until after errno might be used.
929
930         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
931         New macros.
932         (free_exclude): New decl.
933         (add_exclude, add_exclude_file): Now takes int options arg.
934         (excluded_filename): No longer requires options arg, as the options
935         are determined by add_exclude.  Now returns bool, not int.
936
937 2001-08-30  Paul Eggert  <eggert@twinsun.com>
938
939         * alloca.c (alloca): Arg is of type size_t, not unsigned.
940
941 2001-08-27  Jim Meyering  <meyering@lucent.com>
942
943         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
944
945         * version-etc.c (N_): Remove definition.
946         Revert most of last change.
947         Instead, simply don't mark the `Copyright...' string for translation.
948         Based on advice from Paul Eggert.
949
950         * strtoxmax.c: Tweak comment.
951
952 2001-08-26  Jim Meyering  <meyering@lucent.com>
953
954         * version-etc.c (version_etc_copyright_fmt): Replace literal year
955         of copyright with `%s' so translators don't get an untranslated
956         message in 2002.
957         (COPYRIGHT_YEAR): Define.
958         (version_etc): Use fprintf rather than fputs.
959         Suggestion from Ulrich Drepper.
960
961         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
962
963         * strtoll.c: New file, from GNU libc.
964         * xstrtoimax.c: New file.
965
966         * xstrtol.h: Add xstrtoimax.
967         * strtoumax.c: New file.  Simply include "strtoumax.c".
968         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
969
970         * strtoumax.c: Factor to work both for unsigned and signed types, ...
971         * strtoxmax.c: ... then renamed to this.
972
973 2001-08-13  Paul Eggert  <eggert@twinsun.com>
974
975         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
976         Port to Solaris 8, where 'sed' requires a space after the 'r'
977         command, and where sh dislikes "$/".  Clean up the spacing a bit.
978         Redirect output to $tmp just once.
979
980 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
981
982         * addext.c (<errno.h>): Include.
983         (errno): Declare if not defined.
984         (addext): Work correctly when pathconf returns -1 and leaves
985         errno alone because there is no limit.  Also, work even if
986         pathconf returns a value greater than SIZE_MAX.
987
988 2001-08-12  Jim Meyering  <meyering@lucent.com>
989
990         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
991         Simply `return getcwd (NULL, 0);'.
992         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
993         Use 1300 as initial value for length, not PATH_MAX.
994
995         * pathmax.h: Clean up cpp syntax.
996
997 2001-08-12  Jim Meyering  <meyering@lucent.com>
998
999         * gettimeofday.c: New file.
1000         * gtod.h: New file.
1001         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
1002
1003 2001-08-04  Jim Meyering  <meyering@lucent.com>
1004
1005         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
1006         to get in sync with glibc.
1007
1008 2001-08-03  Paul Eggert  <eggert@twinsun.com>
1009
1010         The following changes are from gettext 0.10.39 as maintained by
1011         Bruno Haible.
1012
1013         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
1014         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
1015         with inverted sense.  All uses changed.
1016
1017         * mbswidth.c: Don't include <limits.h>.
1018         Include <stdlib.h> and <string.h> unconditionally.
1019         (iswcntrl, mbsinit, ISCNTRL): New macros.
1020         (mbsnwidth): Use K&R style function declarations.
1021         Don't bother checking for MB_LEN_MAX == 1, since the compiler
1022         can optimize it when MB_CUR_MAX == 1.
1023         The width of control characters is zero, not 1.
1024
1025 2001-07-15  Jim Meyering  <meyering@lucent.com>
1026
1027         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
1028         (BUILT_SOURCES): Add unlocked-io.h.
1029         (io_functions): Define.
1030         (unlocked-io.h): New rule.
1031         (DISTCLEANFILES): Add unlocked-io.h.
1032         (all-local): Depend on unlocked-io.h, to ensure it is created.
1033
1034         * unlocked-io.hin: New file
1035
1036         * regex.c: Update from glibc.
1037
1038 2001-07-05  Jim Meyering  <meyering@lucent.com>
1039
1040         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
1041         recommendation.
1042         (libfetish_a_SOURCES): Put all .h files here instead.
1043         Remove a thus-exposed (better checks in automake) duplicate and
1044         two unnecessary .h files.
1045
1046 2001-06-11  Jim Meyering  <meyering@lucent.com>
1047
1048         * regex.c: Update from GNU libc.
1049
1050 2001-05-27  Jim Meyering  <meyering@lucent.com>
1051
1052         * readutmp.h (UT_TYPE): Define.
1053
1054 2001-05-24  Jim Meyering  <meyering@lucent.com>
1055
1056         * argmatch.c: Include "quote.h".
1057         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
1058         quote function.  Reported by Göran Uddeborg.
1059
1060 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
1061
1062         * dirname.c (dir_name): Compute append_dot using path, not newpath
1063         which is not yet declared.
1064
1065 2001-05-11  Paul Eggert  <eggert@twinsun.com>
1066
1067         * Makefile.am (libfetish_a_SOURCES):
1068         Add strftime.c, since we now compile it on all hosts.
1069
1070         * strftime.c (my_strftime):
1071         Define to nstrftime if emacs, but only if my_strftime is not defined.
1072         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
1073         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
1074         Add one more extra argument: a nanoseconds value.
1075         All uses changed.
1076         (ns): New macro.
1077         (my_strftime function): Add %N format.
1078         (emacs_strftimeu): Renamed from emacs_strftime,
1079         with extra ut argument.
1080
1081 2001-05-11  Paul Eggert  <eggert@twinsun.com>
1082
1083         dirname code cleanup.  base_name now behaves more compatibly
1084         with POSIX basename when given file names that have trailing
1085         slashes, and similarly for dir_name.  Add new primitives
1086         base_len and dir_len.  Put the directory-name-related decls
1087         into dirname.h.
1088
1089         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
1090         * backupfile.c (base_name): Likewise.
1091         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
1092         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
1093         * makepath.c (strip_trailing_slashes): Likewise.
1094         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
1095         Likewise.
1096         * rename.c (strip_trailing_slashes): Likewise.
1097         * same.c (base_name): Likewise.
1098         * stripslash.c (ISSLASH): Likewise.
1099
1100         * addext.c: Include <dirname.h> after size_t is defined.
1101         * backupfile.c: Likewise.
1102
1103         * addext.c (addext): Use base_len to trim redundant
1104         trailing slashes instead of doing it ourselves.
1105         But do not trim the last slash if it is not redundant.
1106
1107         * backupfile.c (find_backup_file_name,
1108         max_backup_version): Use base_len instead of rolling it ourselves.
1109         Handle the case of "" and (on DOS) "C:" correctly.
1110
1111         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
1112         Include <string.h>, <dirname.h>.
1113         (base_name): Allow file names ending in slashes, other than names
1114         that are all slashes.  In this case, return the basename followed
1115         by the slashes.  This is more general, and can be used in places
1116         where the original base_name purposely had an assertion failure.
1117         (base_len): New function.
1118
1119         * dirname.c: Include <string.h> instead of <stdlib.h>.
1120         Do not include <assert.h>; no longer needed.
1121         Include xalloc.h.
1122         (memrchr): Remove decl.
1123         (dir_name_r): Remove.
1124         (dir_len): Renamed from dirlen.  All callers changed.
1125         Rewrite in terms of base_name, for simplicity and consistency.
1126         (dir_name): Never return NULL.  All callers changed.
1127         Do not include <stdlib.h> in test program; no longer needed.
1128         return 0; is fine for test program.
1129
1130         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
1131         New macros.
1132         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
1133
1134         * path-concat.c (path_concat): Use base_len to compute
1135         base length, not strlen; this means we cannot rely on memcpy
1136         to null-terminate.
1137
1138         * same.c (STREQ): Remove.
1139         (same_name): Handle the case where the basename ends in trailing '/'.
1140
1141         * stripslash.c (strip_trailing_slashes): Return nonzero if
1142         a slash was stripped.  Do not strip the last slash after a
1143         file system prefix.
1144
1145 2001-04-08  Jim Meyering  <meyering@lucent.com>
1146
1147         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
1148         recomputed; that's necessary when the offset spans a DST transition.
1149         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
1150
1151 2001-04-02  Jim Meyering  <meyering@lucent.com>
1152
1153         * regex.h, regex.c: Update from GNU libc.
1154
1155 2001-03-19  Paul Eggert  <eggert@twinsun.com>
1156
1157         * version-etc.c (version_etc_copyright): Update to 2001.
1158
1159 2001-03-16  Paul Eggert  <eggert@twinsun.com>
1160
1161         * tempname.c (uint64_t): Define to uintmax_t if
1162         not defined, and if UINT64_MAX is not defined.
1163         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
1164         Reported by John David Anglin.
1165
1166 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
1167
1168         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
1169         alias if codeset is empty.
1170         * config.charset (BeOS): Use wildcard syntax.
1171
1172 2001-03-13  Jim Meyering  <meyering@lucent.com>
1173
1174         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
1175         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
1176         From Bruno Haible.
1177
1178 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
1179
1180         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
1181         Don't return NULL.
1182         * unicodeio.c (print_unicode_char): Simplify accordingly.
1183
1184 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
1185
1186         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
1187         support for DOS/DJGPP.
1188
1189 2001-02-28  Paul Eggert  <eggert@twinsun.com>
1190
1191         * Makefile.am (libfetish_a_SOURCES):
1192         Add dup-safer.c, fopen-safer.c.
1193         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
1194
1195         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
1196
1197 2001-02-25  Paul Eggert  <eggert@twinsun.com>
1198
1199         The mkstemp replacement is taken from glibc 2.2.2, with some
1200         portability fixes for use outside glibc, as follows:
1201
1202         * tempname.c (struct_stat64): New macro.
1203         (direxists, __gen_tempname): Use it.
1204         This avoids a portability problem with Solaris 8.
1205
1206         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
1207         (<stddef.h>, <stdint.h>, <string.h>):
1208         Include only if STDC_HEADERS || _LIBC.
1209         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
1210         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
1211         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
1212         (__set_errno): Define this macro if <errno.h> doesn't.
1213         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
1214         Define these macros if <stdio.h> doesn't.
1215         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
1216         Define these macros if <sys/stat.h>
1217         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
1218         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
1219         __xstat64): Define if not _LIBC.
1220         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
1221         (__gen_tempname): Invoke gettimeofday only if
1222         HAVE_GETTIMEOFDAY || _LIBC;
1223         otherwise, fall back on plain "time".
1224         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
1225
1226         * mkstemp.c (__GT_FILE): Define to zero if not defined.
1227
1228         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
1229
1230 2001-02-17  Jim Meyering  <meyering@lucent.com>
1231
1232         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
1233         around included file name.
1234
1235         * strnlen.c (__strnlen): Merge in a change from GNU libc.
1236
1237         * strftime.c: Update from GNU libc (the only changes were to comments).
1238
1239 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
1240
1241         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
1242
1243 2001-02-17  Paul Eggert  <eggert@twinsun.com>
1244
1245         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
1246         Remove workaround macros for hosts that have mbrtowc but not
1247         mbstate_t, as we now insist on proper declarations for both
1248         before using mbrtowc.
1249
1250 2001-02-17  Jim Meyering  <meyering@lucent.com>
1251
1252         * regex.c: Update from libc.
1253
1254 2001-02-16  Paul Eggert  <eggert@twinsun.com>
1255
1256         * alloca.c (malloc): Undef before defining, since stdlib.h
1257         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
1258         Reported by Mark Hounschell via Paul Eggert.
1259
1260 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
1261
1262         * config.charset: Update for FreeBSD 4.2.
1263
1264 2001-01-26  Jim Meyering  <meyering@lucent.com>
1265
1266         * quotearg.c: Include stddef.h.
1267         * quote.c: Include stddef.h.
1268         Reported by Axel Kittenberger.
1269
1270         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
1271         line in double quotes so that it evokes a better diagnostic.
1272         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
1273         Reported by Axel Kittenberger.
1274
1275 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
1276
1277         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
1278         to avoid a warning.  Add back 'const' to inptr.
1279
1280 2001-01-16  Jim Meyering  <meyering@lucent.com>
1281
1282         * basename.c: Include <stdio.h>, needed by assert on SunOS4.
1283         From Bruno Haible.
1284
1285 2001-01-14  Jim Meyering  <meyering@lucent.com>
1286
1287         * rename.c: New file.  From Volker Borchert.
1288         Include stdlib.h, string.h or strings.h, and xalloc.h.
1289         Use strip_trailing_slashes rather than open-coding it.
1290
1291 2001-01-03  Paul Eggert  <eggert@twinsun.com>
1292
1293         * strftime.c: Sync with glibc time/strftime.c 1.81.
1294
1295 2001-01-03  Jim Meyering  <meyering@lucent.com>
1296
1297         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
1298         local `inptr' to avoid warning with some system declarations of iconv.
1299
1300 2000-12-29  Paul Eggert  <eggert@twinsun.com>
1301
1302         * modechange.c: Do not assume that mode_t uses the
1303         traditional octal encoding.  E.g. "chmod 1 FOO" should set
1304         the other-execute bit of FOO even if S_IXOTH != 1.
1305
1306         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
1307         WOTH, XOTH, ALLM): New macros.
1308         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
1309          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
1310         Use them.
1311         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
1312         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
1313         (mode_compile):
1314         No need to use uintmax_t; unsigned long is long enough.
1315         Don't bother to get suffix since we don't use it.
1316
1317 2000-12-24  Jim Meyering  <meyering@lucent.com>
1318
1319         * hash.c (is_prime): Return explicit boolean values.
1320         (hash_get_first): Return NULL to appease Irix5.6's 89.
1321         Reported by Nelson Beebe.
1322
1323 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
1324
1325         * localcharset.c (locale_charset): Add support for Win32.
1326
1327 2000-12-18  Paul Eggert  <eggert@twinsun.com>
1328
1329         * physmem.h, physmem.c: New files.
1330
1331         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
1332         (noinst_HEADERS): Add physmem.h.
1333
1334         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
1335         't' for compatibility with Solaris 8 sort.
1336
1337 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
1338
1339         * config.charset: Add support for BeOS.
1340
1341 2000-12-16  Jim Meyering  <meyering@lucent.com>
1342
1343         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
1344         SHELLS_FILE to a file name that's useful on djgpp systems.
1345         Include stdlib.h.
1346         (ADDITIONAL_DEFAULT_SHELLS): Define.
1347         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
1348         Based mostly on a patch from Prashant TR.
1349
1350 2000-12-16  Jim Meyering  <meyering@lucent.com>
1351
1352         This bug had a serious impact on chown: `chown N:M FILE' (for integer
1353         N and M) would have treated it like `chown N:N FILE'.
1354
1355         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
1356
1357 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
1358
1359         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
1360         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
1361         to the list of canonical encodings. Rename EUC-CN to GB2312.
1362
1363 2000-12-08  Andreas Schwab  <schwab@suse.de>
1364
1365         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
1366         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
1367
1368 2000-12-07  Jim Meyering  <meyering@lucent.com>
1369
1370         * stripslash.c (ISSLASH): Define.
1371         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
1372         From Prashant TR.
1373
1374         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
1375         (dir_name_r): Declare this function as static.
1376         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
1377         manifest itself on a name containing a mix of slashes and
1378         backslashes.
1379         Make this function work with names starting with a DOS-style
1380         drive letter and colon prefix.
1381         (dir_name): Append `.' if necessary.
1382         Based mostly on patches from Prashant TR and Eli Zaretskii.
1383
1384         * dirname.h (dir_name_r): Remove prototype.
1385
1386 2000-12-05  Jim Meyering  <meyering@lucent.com>
1387
1388         * dirname.c (dir_name_r): Add `const' in a few local declarations.
1389
1390 2000-12-04  Jim Meyering  <meyering@lucent.com>
1391
1392         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
1393         Also include memory.h, stdlib.h, unistd.h if appropriate.
1394         Reported by Andreas Jaeger (conflicting declaration of malloc).
1395
1396 2000-12-02  Jim Meyering  <meyering@lucent.com>
1397
1398         * closeout.h: Make idempotent, to avoid some obscure warnings.
1399
1400 2000-12-01  Paul Eggert  <eggert@twinsun.com>
1401
1402         * memrchr.c: Include <config.h> before any system include file.
1403
1404 2000-11-29  Paul Eggert  <eggert@twinsun.com>
1405
1406         * dirname.c (dir_name_r): Fix typo: int -> size_t.
1407
1408 2000-11-26  Jim Meyering  <meyering@lucent.com>
1409
1410         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
1411
1412 2000-11-22  Paul Eggert  <eggert@twinsun.com>
1413
1414         * strftime.c (my_strftime): Do not invoke mbrlen with a
1415         size of (size_t) -1; it's not portable.
1416
1417 2000-11-17  Akim Demaille  <akim@epita.fr>
1418
1419         * obstack.h: Formatting changes.
1420         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
1421         prevent type checking.
1422         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
1423         cast the value to (void *): assigning a `foo *' to a `void *'
1424         variable is valid.
1425         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
1426
1427 2000-11-17  Jim Meyering  <meyering@lucent.com>
1428
1429         * strstr.c: Update from GNU libc.
1430
1431 2000-11-16  Jim Meyering  <meyering@lucent.com>
1432
1433         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
1434
1435 2000-11-11  Jim Meyering  <meyering@lucent.com>
1436
1437         * error.c: Add a couple #includes, merging from GNU libc version.
1438
1439 2000-11-10  Jim Meyering  <meyering@lucent.com>
1440
1441         * obstack.h: Update from GNU libc.
1442         * obstack.c: Likewise.
1443
1444 2000-11-06  Paul Eggert  <eggert@twinsun.com>
1445
1446         * getusershell.c (setusershell): Use rewind rather than
1447         fseek/fseeko, to avoid configuration hassles with fseeko.
1448         Don't bother opening SHELLS_FILE if shellstream is NULL;
1449         it's not necessary.
1450
1451 2000-11-05  Jim Meyering  <meyering@lucent.com>
1452
1453         * makepath.h (make_dir): Declare.
1454         * makepath.c (make_dir): Remove `static' attribute.
1455         Tweak a comment.
1456
1457 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
1458
1459         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
1460         last one in a bucket, advance to the next bucket.
1461
1462 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
1463
1464         * fnmatch.c: Do not comment out all the code if we are using
1465         the GNU C library, because in some cases we are replacing buggy
1466         code in the GNU C library itself.
1467
1468 2000-10-30  Paul Eggert  <eggert@twinsun.com>
1469
1470         * error.h, getline.h, modechange.h:
1471         Remove "2000" from Copyright line, as the file hasn't been
1472         changed this year other than in the copyright notice.
1473
1474         * xalloc.h: Add "2000" to Copyright line, as this file
1475         was changed this year.
1476
1477 2000-10-30  Paul Eggert  <eggert@twinsun.com>
1478
1479         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
1480         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
1481         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
1482
1483 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
1484
1485         * regex.h (__restrict_arr): Move definition out of #ifndef block.
1486         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
1487         doesn't define __restrict_arr.
1488
1489 2000-10-29  Jim Meyering  <meyering@lucent.com>
1490
1491         * xstat.in: Fix grammar in comment.
1492
1493 2000-10-28  Jim Meyering  <meyering@lucent.com>
1494
1495         * memchr.c: Update from libc.
1496         Adjust for portability:
1497         [HAVE_STDLIB_H]: Include stdlib.h.
1498         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
1499         Undef __memchr, too.
1500         [!weak_alias]: Define __memchr to memchr.
1501
1502         * regex.c: Update from libc.
1503         * regex.h: Likewise.
1504         * getopt1.c: Likewise.
1505         * memcmp.c: Likewise.
1506
1507         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
1508         Avoid using fseek, when possible -- it's broken by design.
1509         Patch by Ulrich Drepper.
1510
1511 2000-10-26  Jim Meyering  <meyering@lucent.com>
1512
1513         * strftime.c: Update from libc.
1514
1515 2000-10-25  Jim Meyering  <meyering@lucent.com>
1516
1517         * obstack.c: Update from libc.
1518
1519 2000-10-23  Jim Meyering  <meyering@lucent.com>
1520
1521         * hard-locale.c (hard_locale): Revert last change -- it was simply
1522         wrong.  That set_locale call must not have any side effects.
1523         From Paul Eggert.
1524
1525 2000-10-22  Jim Meyering  <meyering@lucent.com>
1526
1527         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
1528         [CYCLIC]: Remove now-unused definition.
1529
1530         * save-cwd.c (O_DIRECTORY): Define, if needed.
1531         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
1532         Suggestion from Ulrich Drepper.
1533
1534 2000-10-21  Jim Meyering  <meyering@lucent.com>
1535
1536         * dirname.c (dir_name_r): New function, factored out of dir_name.
1537         (dir_name): Use dir_name_r.
1538         * dirname.h (dir_name_r): Declare it.
1539
1540 2000-10-21  Jim Meyering  <meyering@lucent.com>
1541
1542         * dirname.c (memrchr): Declare if necessary.
1543         (dir_name): Remove the restriction that there be no
1544         trailing slashes.  Now, this code skips past them, effectively
1545         ignoring them.
1546         [TEST_DIRNAME] (main): New unit tests.
1547
1548         * memrchr.c: New file from GNU libc.
1549         Undef __memrchr, too.
1550         [!weak_alias]: Define __memrchr to memrchr.
1551         Guard weak_alias use with `#ifdef weak_alias'.
1552
1553 2000-10-17  Jim Meyering  <meyering@lucent.com>
1554
1555         * quote.h (PARAMS): Define and use.
1556         Reported by Akim Demaille.
1557
1558         * getopt.c: Update from libc.
1559
1560 2000-10-16  Jim Meyering  <meyering@lucent.com>
1561
1562         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
1563         From Jan Fedak.
1564
1565 2000-09-25  Jim Meyering  <meyering@lucent.com>
1566
1567         * md5.h (rol): Define (from GnuPG).
1568
1569         * sha.c: Give credit (GnuPG) where due.
1570         (M): Use rol rather than open-coding it.
1571         Add a FIXME comment.
1572
1573 2000-09-21  Jim Meyering  <meyering@lucent.com>
1574
1575         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
1576         Reported by Michael Stone.
1577
1578 2000-09-20  Jim Meyering  <meyering@lucent.com>
1579
1580         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
1581         (noinst_HEADERS): Add sha.h.
1582         Based on code from Scott G. Miller and from GnuPG.
1583
1584 2000-09-15  Jim Meyering  <meyering@lucent.com>
1585
1586         * regex.c: Update from libc.
1587
1588 2000-09-10  Jim Meyering  <meyering@lucent.com>
1589
1590         * getopt.c (_getopt_internal): Update from glibc.
1591
1592 2000-09-09  Jim Meyering  <meyering@lucent.com>
1593
1594         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
1595         think it should be used as a general replacement for isascii.
1596         * fnmatch.c: Likewise.
1597         * mbswidth.c: Likewise
1598         * regex.c: Likewise.
1599
1600         Don't use atoi.
1601         * userspec.c: Include sys/param.h and limits.h.
1602         Include xstrtol.h.
1603         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
1604         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
1605         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
1606         UID, GID.  Check range.
1607
1608 2000-09-06  Jim Meyering  <meyering@lucent.com>
1609
1610         * getopt.c (_getopt_internal): Update from glibc.
1611
1612 2000-08-30  Jim Meyering  <meyering@lucent.com>
1613
1614         * strftime.c: Merge in changes from GNU libc.
1615
1616 2000-08-26  Jim Meyering  <meyering@lucent.com>
1617
1618         * closeout.c: Include "__fpending.h".
1619         (close_stdout_status): Return right away if there's nothing to flush.
1620
1621         * Makefile.am (noinst_HEADERS): Add __fpending.h.
1622         * __fpending.c: New file.
1623         * __fpending.h: New file.
1624
1625 2000-08-07  Paul Eggert  <eggert@twinsun.com>
1626
1627         Standardize on "memory exhausted" instead of "Memory exhausted"
1628         or "virtual memory exhausted".
1629         * obstack.c (print_and_abort): Use "memory exhausted", not
1630         "virtual memory exhausted".
1631         * same.c (same_name): Invoke xalloc_die instead of printing
1632         our own message.
1633         * userspec.c (parse_user_spec): Likewise.
1634         * bumpalloc.h: comment fix
1635         * same.c, userspec.c: Include xalloc.h.
1636
1637         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
1638         not char *const and pointing to a constant array.
1639         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
1640         (xrealloc): Comment fix.
1641
1642         * userspec.c (parse_user_spec):
1643         Don't translate a message until just before returning,
1644         to avoid unnecessary translation.
1645
1646 2000-08-07  Jim Meyering  <meyering@lucent.com>
1647
1648         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
1649         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
1650         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
1651         getgroups.c, gethostname.c, getopt.h, group-member.c,
1652         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
1653         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
1654         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
1655         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
1656         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
1657         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
1658         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
1659         yesno.c: Back out Copyright date changes for each file with no change
1660         this year.  This eases coordination with other programs using the same
1661         source code modules.  From Paul Eggert.
1662
1663 2000-08-03  Greg McGary  <greg@mcgary.org>
1664
1665         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
1666         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
1667         (EXTEND_BUFFER): Use them.
1668
1669 2000-08-01  Jim Meyering  <meyering@lucent.com>
1670
1671         * dirname.c (ISSLASH): Define.
1672         (BACKSLASH_IS_PATH_SEPARATOR): Define.
1673         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
1674         both `\' and `/' may be use as path separators.
1675         Based on a patch from Prashant TR.
1676
1677 2000-07-31  Paul Eggert  <eggert@twinsun.com>
1678
1679         * quotearg.c (quotearg_n_options): Don't make the initial
1680         slot vector a constant, since it might get modified.
1681
1682 2000-07-31  Jim Meyering  <meyering@lucent.com>
1683
1684         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
1685         * obstack.c (print_and_abort): Likewise.
1686
1687 2000-07-30  Paul Eggert  <eggert@twinsun.com>
1688
1689         * quotearg.c (quotearg_n_options): Preallocate a slot 0
1690         buffer, so that the caller can always quote one small
1691         component of a "memory exhausted" message in slot 0.
1692         From a suggestion by Jim Meyering.
1693
1694 2000-07-30  Jim Meyering  <meyering@lucent.com>
1695
1696         * makepath.c (make_path): Quote the other instance, too.
1697
1698         * quotearg.c (N_STATIC_SLOTVECS): Define.
1699         (STATIC_BUF_SIZE): Define.
1700         (quotearg_n_options): Use only statically allocated storage when
1701         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
1702         than STATIC_BUF_SIZE.
1703
1704 2000-07-29  Jim Meyering  <meyering@lucent.com>
1705
1706         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
1707         * dirname.c (dir_name): Likewise.
1708
1709         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
1710
1711         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
1712         (dir_name): Assert that there are no trailing slashes.
1713
1714 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
1715
1716         * mbswidth.h (mbswidth): Add a flags argument.
1717         (mbswidth): New declaration.
1718         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
1719         * mbswidth.c (mbswidth): Add a flags argument.
1720         (mbsnwidth): New function.
1721
1722 2000-07-24  Jim Meyering  <meyering@lucent.com>
1723
1724         * mbswidth.c: Remove useless #else.  From Bruno Haible.
1725
1726 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1727
1728         * mbswidth.c (_XOPEN_SOURCE):
1729         Don't define; this causes problems on Solaris 7.
1730         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
1731
1732 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1733
1734         * quotearg.c:
1735         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
1736         so that mbstate_t is always defined.
1737
1738         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
1739         be 1 in at least one GCC installation, and this configuration
1740         error is likely to be common.  Ignoring MB_LEN_MAX hurts
1741         performance on hosts that have mbrtowc but have only unibyte
1742         locales, but I assume these hosts are rare.
1743
1744 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1745
1746         * quotearg.c: Streamline by invoking multibyte code only if needed.
1747         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
1748         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
1749         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
1750         invoke multibyte primitives.
1751
1752 2000-07-23  Jim Meyering  <meyering@lucent.com>
1753
1754         * basename.c (base_name): Add an assertion.
1755
1756 2000-07-15  Bruno Haible  <clisp.cons.org>
1757
1758         * quotearg.c: When the system forces us to redefine mbstate_t,
1759         shadow its mbsinit function.
1760
1761 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
1762
1763         * mbswidth.h: New file.
1764         * mbswidth.c: New file.
1765         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
1766         (noinst_HEADERS): Add mbswidth.h.
1767
1768 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
1769
1770         * config.charset: Add support for FreeBSD. Improve support for HP-UX
1771         and IRIX 6.
1772
1773 2000-07-15  Jim Meyering  <meyering@lucent.com>
1774
1775         * makepath.c: Include quote.h.
1776         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
1777         corresponding argument in a `quote (...)' call.
1778         Give better diagnostics.
1779
1780         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
1781         (noinst_HEADERS): Add quote.h.
1782
1783         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
1784         from tar's src/misc.c.
1785         * quote.h: New file.  Prototypes for same.
1786
1787 2000-07-10  Paul Eggert  <eggert@twinsun.com>
1788
1789         From a suggestion by Bruno Haible.
1790         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
1791         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
1792         to decide whether to define the BeOS workaround macro;
1793         this adjusts to the change to AC_MBSTATE_T.
1794
1795 2000-07-13  Paul Eggert  <eggert@twinsun.com>
1796
1797         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
1798
1799         * quotearg.c (quoting_style_args, quoting_style_vals,
1800         quotearg_buffer_restyled): Add support for
1801         clocale_quoting_style.  Undo previous change to
1802         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
1803         and "{RIGHT QUOTATION MARK}" msgids.
1804
1805 2000-07-05  Paul Eggert  <eggert@twinsun.com>
1806
1807         The old behavior of quoting `like this' doesn't look good with
1808         newer, ISO-style fonts.  See:
1809         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
1810
1811         Instead, quote "like this" by default.  Let the translator
1812         tailor the locale-specific quoting behavior by providing
1813         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
1814
1815         * quotearg.c (N_): New macro.
1816         (gettext_default): New function.
1817         (quotearg_buffer_restyled): Use
1818         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
1819         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
1820
1821 2000-07-09  Jim Meyering  <meyering@lucent.com>
1822
1823         * Most files: Update copyright dates to include 2000.
1824
1825 2000-07-08  Jim Meyering  <meyering@lucent.com>
1826
1827         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
1828         if not defined.
1829         (xgethostname): Remove now-unnecessary #ifdef.
1830         Move declaration of `err' into loop where it's used.
1831
1832 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
1833
1834         * xgethostname.c (xgethostname): Protect against the SunOS5.5 bug
1835         by allocating a larger buffer. Test the gethostname return value for
1836         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
1837         returns an error and ENAMETOOLONG isn't defined.
1838
1839 2000-07-05  Paul Eggert  <eggert@twinsun.com>
1840         and Bruno Haible  <haible@clisp.cons.org>
1841
1842         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
1843
1844 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
1845
1846         * quotearg.c (struct quoting_options): Simplify quote_these_too
1847         dimension.
1848
1849 2000-07-03  Jim Meyering  <meyering@lucent.com>
1850
1851         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
1852         Reported by Bruno Haible.
1853
1854 2000-07-04  Jim Meyering  <meyering@lucent.com>
1855
1856         * quotearg.c: Make inclusion of <wchar.h> independent of whether
1857         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
1858         lacks mbrtowc.
1859
1860 2000-07-03  Paul Eggert  <eggert@twinsun.com>
1861         and Bruno Haible  <haible@clisp.cons.org>
1862
1863         * quotearg.c (mbrtowc):
1864         Assign to *pwc, and return 1 only if result is nonzero.
1865         (iswprint): Use ISPRINT when substituting our own mbrtowc.
1866
1867 2000-07-03  Jim Meyering  <meyering@lucent.com>
1868
1869         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
1870         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
1871         From Bob Proulx.
1872
1873 2000-07-02  Jim Meyering  <meyering@lucent.com>
1874
1875         * quotearg.c (mbstate_t): Don't define here.
1876
1877 2000-07-02  Jim Meyering  <meyering@lucent.com>
1878
1879         * nanosleep.c (SIGCONT): Define if not already defined.
1880
1881 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1882
1883         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
1884         per change in ../m4/ls-mntd-fs.m4.
1885         (read_filesystem_list): Ignore symbolic links.
1886
1887 2000-06-29  Jim Meyering  <meyering@lucent.com>
1888
1889         * same.c: Include <string.h> or <strings.h>, as appropriate,
1890         for declaration of strcmp.
1891
1892         * long-options.c: Include <stdlib.h>, for declaration of exit.
1893
1894         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
1895         Avoid warning by casting result to `char *' to remove `const'.
1896
1897 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1898
1899         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
1900
1901 2000-06-26  Paul Eggert  <eggert@twinsun.com>
1902
1903         savedir now sets errno on failure and invokes xmalloc to get memory.
1904         Fix a couple of other minor bugs while we're at it.
1905
1906         * savedir.c (<unistd.h>): Do not include; there's no need.
1907         (NAMLEN): Remove macro.
1908         (malloc, realloc): Remove decls.
1909         (stpcpy): Likewise.
1910         ("xalloc.h"): Include.
1911         (NAME_SIZE_DEFAULT): New macro.
1912         (savedir): Use xmalloc / xrealloc to allocate memory.
1913         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
1914         Skip "" directory entries.
1915         Use strlen to calculate directory entry length, since the old method
1916         is rarely used these days and isn't worth supporting.
1917         Don't use a pointer after freeing it.
1918         Check for integer overflow when calculating allocation size.
1919         Use memcpy to copy entries, instead of stpcpy.
1920         Set errno properly when returning NULL.
1921         Check for readdir error.
1922
1923 2000-06-26  Jim Meyering  <meyering@lucent.com>
1924
1925         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
1926
1927 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1928
1929         * getusershell.c (xmalloc, xrealloc): Remove functions.
1930         Include xalloc.h.
1931         Don't include <stdlib.h>.  Don't declare malloc, realloc.
1932
1933 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
1934
1935         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
1936
1937 2000-06-24  Jim Meyering  <meyering@lucent.com>
1938
1939         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
1940
1941 2000-06-21  Jim Meyering  <meyering@lucent.com>
1942
1943         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
1944
1945 2000-06-19  Paul Eggert  <eggert@twinsun.com>
1946
1947         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
1948         (mbrtowc, mbstate_t): Define substitutes if
1949         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
1950         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
1951         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1952
1953 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1954
1955         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
1956         than 1024, return a memory chunk of least possible size, instead
1957         of size PATH_MAX + 2. In the loop, increment the size proportionally.
1958         Use free/xmalloc instead of xrealloc to avoid copying for very long
1959         paths.
1960
1961 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1962
1963         * canon-host.c (canon_host): Use malloc and memcpy to copy an
1964         address, not strdup.  Include <stdlib.h> and don't declare free().
1965
1966 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1967
1968         * path-concat.c (path_concat): Don't access dir[-1] if dir is
1969         the empty string.
1970
1971 2000-06-21  Jim Meyering  <meyering@lucent.com>
1972
1973         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
1974         (noinst_HEADERS): Add getstr.h.
1975
1976         * getline.c (getstr): Move into a separate file.
1977         * getstr.c (getstr): New file, extracted from getline.c, with
1978         the following changes: new parameter, delim2; both delim[12]
1979         parameters have type `int', not `char'.  The latter would lose
1980         with 8-bit delimiters.
1981         * getstr.h: New file.
1982
1983 2000-06-19  Jim Meyering  <meyering@lucent.com>
1984
1985         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
1986
1987 2000-06-18  Jim Meyering  <meyering@lucent.com>
1988
1989         * mkdir.c: Remove file, due mainly to copyright incompatibility.
1990         Besides, these days every porting target provides a mkdir function.
1991
1992         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
1993         (this snippet comes from src/system.h).
1994
1995 2000-06-15  Paul Eggert  <eggert@twinsun.com>
1996
1997         * human.c (adjust_value): New function.
1998         (human_readable_inexact): Apply rounding style even when
1999         printing approximate values.
2000
2001 2000-06-14  Paul Eggert  <eggert@twinsun.com>
2002
2003         * human.c (human_readable_inexact): Allow an input block
2004         size that is not a multiple of the output block size, and vice versa.
2005         Reported by Piergiorgio Sartor.
2006
2007 2000-06-14  Paul Eggert  <eggert@twinsun.com>
2008
2009         * getdate.y (get_date): Apply relative times after time
2010         zone indicator, not before.  Reported by Todd A. Jacobs.
2011
2012 2000-06-13  Jim Meyering  <meyering@lucent.com>
2013
2014         * Makefile.am (all-local): Depend on lstat.c and stat.c.
2015
2016         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
2017
2018 2000-06-12  Paul Eggert  <eggert@twinsun.com>
2019
2020         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
2021
2022 2000-06-04  Paul Eggert  <eggert@twinsun.com>
2023
2024         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
2025
2026 2000-06-04  Jim Meyering  <meyering@lucent.com>
2027
2028         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
2029         SunOS4.1.4 for which gid_t is an unsigned type.
2030
2031 2000-06-03  Jim Meyering  <meyering@lucent.com>
2032
2033         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
2034
2035 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
2036
2037         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
2038         newer, don't install charset.alias.
2039         * config.charset: Change the Linux/glibc rules so they become empty
2040         on glibc-2.1 or newer.
2041
2042 2000-06-02  Jim Meyering  <meyering@lucent.com>
2043
2044         * mountlist.c: Back out last change.  Instead, do this...
2045         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
2046         member using the same `ignore'-testing code.
2047         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
2048         fs_type strings.
2049         From Mark D. Roth.
2050
2051 2000-05-29  Jim Meyering  <meyering@lucent.com>
2052
2053         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
2054         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
2055
2056 2000-05-22  Jim Meyering  <meyering@lucent.com>
2057
2058         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
2059
2060 2000-05-18  Jim Meyering  <meyering@lucent.com>
2061
2062         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
2063         back, too, since it may have been modified by allocate_entry.
2064         (hash_delete): Rewrite to use neither the assignment operator
2065         nor the comma operator in an if-expression.
2066
2067 2000-05-15  Paul Eggert  <eggert@twinsun.com>
2068
2069         * closeout.c:
2070         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
2071         Remove; no longer needed.
2072         "quotearg.h": Add include.
2073         (file_name): Do not bother to explicitly initialize to NULL; it's less
2074         efficient on some hosts.
2075         (close_stdout_status): Remove test as to whether stdout was already
2076         closed; it breaks for the case "echo x | sort >&-".
2077         Quote file name colons.
2078         Do not assume that _("write error") lacks format strings.
2079
2080 2000-05-15  Jim Meyering  <meyering@lucent.com>
2081
2082         * version-etc.c (version_etc_copyright): Update the copyright string
2083         used in all --version output.
2084
2085 2000-05-14  Jim Meyering  <meyering@lucent.com>
2086
2087         * closeout.c (close_stdout_set_file_name): New function.
2088         (close_stdout_status): Use new file-scoped global.
2089         Return right away if fstat says the stdout file descriptor is invalid.
2090         * closeout.h (close_stdout_set_file_name): Declare.
2091
2092 2000-05-10  Jim Meyering  <meyering@lucent.com>
2093
2094         * closeout.c [default_exit_status]: New file-scoped variable.
2095         (close_stdout_set_status): New function.
2096         * closeout.h (close_stdout_set_status): Declare.
2097
2098 2000-05-08  Jim Meyering  <meyering@lucent.com>
2099
2100         * long-options.c: Don't include closeout.h.
2101         (parse_long_options): Don't call close_stdout for --version.
2102
2103 2000-05-06  Jim Meyering  <meyering@lucent.com>
2104
2105         * strnlen.c: Undefine __strnlen and strnlen.
2106         [!weak_alias]: Define __strnlen to strnlen.
2107
2108         * atexit.c: New file, from libiberty.
2109
2110 2000-05-06  Jim Meyering  <meyering@lucent.com>
2111
2112         * closeout.c (close_stdout_status): Also check for errors on the
2113         stderr stream.
2114
2115 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
2116
2117         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
2118         instead of xmalloc, xrealloc, path_concat.
2119         (locale_charset): Treat empty environment variables as absent.
2120         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
2121
2122 2000-05-04  Jim Meyering  <meyering@lucent.com>
2123
2124         * getopt.c: Update from glibc.
2125         * obstack.c: Likewise.
2126         * obstack.h: Likewise.
2127         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
2128
2129         * regex.h: Likewise.
2130         * strndup.c: Likewise.
2131         * strnlen.c: New file, from glibc.
2132
2133 2000-05-01  Jim Meyering  <meyering@lucent.com>
2134
2135         * full-write.c (full_write): Remove `FIXME' part of comment.
2136
2137 2000-04-29  Jim Meyering  <meyering@lucent.com>
2138
2139         * path-concat.c: Declare strdup only if it's not defined.
2140         * canon-host.c: Likewise.
2141
2142 2000-04-28  Jim Meyering  <meyering@lucent.com>
2143
2144         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
2145         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
2146         included first, then limits.h is included by locale.h by libintl.h.
2147         From John David Anglin.
2148
2149 2000-04-25  Jim Meyering  <meyering@lucent.com>
2150
2151         * makepath.c (S_IRWXUGO): Define.
2152         (make_path): Always perform explicit chmod if MODE specifies any
2153         of the `special' permission bits.  Prompted by a bug report against
2154         install from Mate Wierdl and Joost van Baal.
2155
2156 2000-04-18  Jim Meyering  <meyering@lucent.com>
2157
2158         * README: New file.
2159
2160         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
2161         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
2162
2163 2000-04-17  Jim Meyering  <meyering@lucent.com>
2164
2165         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
2166         the definition of it to rpl_strftime also defined-away the system's
2167         declaration.
2168
2169 2000-04-15  Jim Meyering  <meyering@lucent.com>
2170
2171         Use `C' to denote so-called `contiguous' files, the same way
2172         that tar does.
2173         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
2174         (ftypelet): Use S_ISCTG.
2175         From Michael Deutschmann.
2176
2177 2000-04-14  Jim Meyering  <meyering@lucent.com>
2178
2179         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
2180
2181 2000-04-08  Jim Meyering  <meyering@lucent.com>
2182
2183         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
2184         names don't conflict.  Reported by Eli Zaretskii.
2185
2186 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
2187
2188         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
2189         bug.  Deal with the different error behavior of Irix iconv.
2190
2191 2000-04-07  Jim Meyering  <meyering@lucent.com>
2192
2193         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
2194         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
2195
2196 2000-04-05  Jim Meyering  <meyering@lucent.com>
2197
2198         Portability tweaks required for ultrix4.3.
2199         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
2200         * readutmp.c: Include sys/types.h before sys/stat.h.
2201         * canon-host.c: Declare strdup.
2202         * path-concat.c: Likewise.
2203         From John David Anglin.
2204
2205 2000-04-04  Jim Meyering  <meyering@lucent.com>
2206
2207         Be more DOS 8.3-friendly.
2208         * ref-add.sin: Renamed from ref-add.sed.in.
2209         * ref-del.sin: Renamed from ref-del.sed.in.
2210         * Makefile.am: Reflect renaming.
2211         Reported by Eli Zaretskii.
2212
2213         Use a temporary file name that won't clash with `charset.alias'
2214         in the DOS 8.3 name space.
2215         * Makefile.am (charset_tmp): Define.
2216         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
2217         (uninstall-local): Likewise.
2218         Reported by Eli Zaretskii.
2219
2220 2000-03-29  Paul Eggert  <eggert@twinsun.com>
2221
2222         * time/strftime.c (my_strftime): Make sure we call the system
2223         strftime, not ourselves, when invoking the underlying strftime.
2224
2225 2000-03-24  Jim Meyering  <meyering@lucent.com>
2226
2227         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
2228         (charset_alias): Define.
2229         (install-exec-local): Factor out common code.
2230         (uninstall-local): Split lines longer than 80.
2231         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
2232         (SUFFIXES): Define.
2233         (.sed.in.sed): New rule.  Don't redirect directly to $@.
2234         (CLEANFILES): Add ref-add.sed and ref-del.sed.
2235
2236 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
2237
2238         * config.charset: Output a line containing "Packages using this file".
2239         * ref-add.sed.in, ref-del.sed.in: New files.
2240         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
2241         ref-del.sed): New rules.
2242
2243 2000-03-17  Jim Meyering  <meyering@lucent.com>
2244
2245         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
2246         Otherwise, include <strings.h>
2247
2248 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
2249
2250         * unicodeio.c (utf8_wctomb): New function.
2251         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
2252         format instead of in UCS-4 with platform dependent endianness.
2253
2254 2000-03-07  Paul Eggert  <eggert@twinsun.com>
2255
2256         * savedir.c (savedir): Work even if directory size is
2257         negative; this can happen with some screwy NFS configurations.
2258
2259 2000-03-06  Jim Meyering  <meyering@lucent.com>
2260
2261         * localcharset.c (get_charset_aliases): Don't try to free file_name
2262         if it's NULL (because we ran out of memory).  From Bruno Haible.
2263
2264 2000-03-05  Jim Meyering  <meyering@lucent.com>
2265
2266         * localcharset.c ("path-concat.h"): Include.
2267         (get_charset_aliases): Use path_concat instead of ANSI string
2268         concatenation.
2269
2270         * unicodeio.h (PARAMS): Define.
2271         Use it to guard prototype.
2272
2273 2000-03-04  Jim Meyering  <meyering@lucent.com>
2274
2275         * Makefile.am (install-exec-local): Create $(libdir) before installing
2276         into it.
2277         (uninstall-local): Uncomment this rule so `make distcheck' works
2278         once again.
2279
2280         * unicodeio.c (<errno.h>): Include it.
2281         (errno): Declare if not defined.
2282
2283         * localcharset.c: Add Bruno's comment justifying use of volatile.
2284
2285         * config.charset: New version, incorporating remarks from a linux
2286         i18n mailing list.  From Bruno Haible.
2287
2288 2000-03-02  Jim Meyering  <meyering@lucent.com>
2289
2290         * Makefile.am (EXTRA_DIST): Add config.charset.
2291
2292 2000-03-01  Jim Meyering  <meyering@lucent.com>
2293
2294         * localcharset.c: Guard some #includes with `#if HAVE_...'.
2295         * unicodeio.c: Likewise.
2296
2297 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
2298
2299         * config.charset: New file.
2300         * localcharset.c: New file.
2301         * unicodeio.h, unicodeio.c: New files.
2302         * Makefile.am (DEFS): Add -DLIBDIR=...
2303         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
2304         (noinst_HEADERS): Add unicodeio.h.
2305         (all-local, install-exec-local, charset.alias): New targets.
2306
2307 2000-02-28  Paul Eggert  <eggert@twinsun.com>
2308
2309         * quotearg.c (ALERT_CHAR): New macro.
2310         (quotearg_buffer_restyled): Use it.
2311
2312 2000-02-27  Jim Meyering  <meyering@lucent.com>
2313
2314         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
2315         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
2316
2317         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
2318         not `#if STDC_HEADERS'.
2319         Declare malloc if needed.
2320
2321         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
2322         now that autoconf always defines the HAVE_DECL_ symbols.
2323         * human.c: Likewise.
2324         * same.c: Likewise.
2325         * strtoumax.c: Likewise.
2326
2327         * backupfile.c: Arrange for cpp to fail if the configure-time
2328         declaration check was not run.
2329         * hash.c: Likewise.
2330         * human.c: Likewise.
2331         * same.c: Likewise.
2332         * strtoumax.c: Likewise.
2333
2334         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
2335         then first look up the entire `.'-containing string as a login name.
2336
2337 2000-02-18  Paul Eggert  <eggert@twinsun.com>
2338
2339         * getdate.y: Handle two-digit years with leading zeros correctly.
2340         (textint): New typedef.
2341         (parser_control): Member year changed from int to textint.
2342         All uses changed.
2343         (YYSTYPE): Removed; replaced by %union with int and textint members.
2344         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
2345         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
2346         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
2347         (tSNUMBER, tUNUMBER): Now of type <textintval>.
2348         (date, number, to_year): Use width of number in digits, not its value,
2349         to determine whether it's a 2-digit year, or a 2-digit time.
2350         (yylex): Store number of digits of numeric tokens.
2351         Reported by John Kendall.
2352
2353         (parser_control): Changed from struct parser_control to typedef (for
2354         consistency).  All uses changed.
2355
2356         (tID): Removed; not used.
2357         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2358
2359 2000-02-14  Paul Eggert  <eggert@twinsun.com>
2360
2361         * getpagesize.h (getpagesize): Port to VMS for Alpha;
2362         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
2363
2364 2000-02-12  Jim Meyering  <meyering@lucent.com>
2365
2366         * userspec.c (ISDIGIT): Define it.
2367         (isdigit): Remove definition.
2368         (is_number): Use ISDIGIT, not isdigit.
2369         <libintl.h>: Include.
2370         (_ and N_): Define.
2371         (parse_user_spec): Mark translatable strings.
2372
2373 2000-02-10  Jim Meyering  <meyering@lucent.com>
2374
2375         With these changes, nanosleep.[ch] are finally enough like the other
2376         lib/* replacement files to compile on a few more losing systems.
2377
2378         * nanosleep.h: Don't include config.h.
2379         Remove prototype from declaration of nanosleep.
2380         (PARAMS): Remove now-unneeded definition.
2381         * nanosleep.c: #undef nanosleep.
2382         (rpl_nanosleep): Rename from nanosleep.
2383
2384 2000-02-03  Jim Meyering  <meyering@lucent.com>
2385
2386         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
2387         rather than with `#if HAVE_UTMPNAME'.
2388
2389 2000-02-01  Jim Meyering  <meyering@lucent.com>
2390
2391         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
2392
2393 2000-01-31  Jim Meyering  <meyering@lucent.com>
2394
2395         * nanosleep.h (nanosleep): Guard declaration with
2396         `#if ! HAVE_DECL_NANOSLEEP'.
2397         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
2398         the declaration in that vendor's sys/timers.h.
2399         Reported by Christian Krackowizer.
2400
2401         * quotearg.c (ISASCII): Add #undef and move definition to follow
2402         inclusion of wctype.h to work around solaris2.6 namespace pollution.
2403         (ISPRINT): Likewise.
2404         Reported by Tom Tromey.
2405
2406 2000-01-30  Jim Meyering  <meyering@lucent.com>
2407
2408         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
2409         uses of ->ut_name.  The latter doesn't work with new Linux header files
2410         where only utmpx.ut_user is declared.
2411
2412         * readutmp.h (UT_USER): Define.
2413
2414 2000-01-23  Jim Meyering  <meyering@lucent.com>
2415
2416         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
2417         obstack.c.
2418
2419 2000-01-22  Jim Meyering  <meyering@lucent.com>
2420
2421         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
2422         [! HAVE_DECL_STRTOULL]: Declare strtoull.
2423         Required for some AIX systems.  Reported by Christian Krackowizer.
2424         [TESTING] (main): New function.
2425
2426         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
2427         * dirname.c (dir_name): Support for DOS-style file names with drive
2428         letters.
2429
2430         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
2431
2432         * strverscmp.c (ISDIGIT): Define.
2433         (strverscmp): Use ISDIGIT, not isdigit.
2434
2435 2000-01-17  Paul Eggert  <eggert@twinsun.com>
2436
2437         * nanosleep.c (nanosleep):
2438         Don't use SA_INTERRUPT to decide whether to call sigaction, as
2439         POSIX.1 doesn't require SA_INTERRUPT and some systems
2440         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
2441         it's been part of POSIX.1 since day 1 (in 1988).
2442
2443 2000-01-17  Jim Meyering  <meyering@lucent.com>
2444
2445         * interlock: Remove unused file.  Reported by François Pinard.
2446
2447 2000-01-16  Paul Eggert  <eggert@twinsun.com>
2448
2449         * quotearg.c (quotearg_buffer_restyled): Do not quote
2450         alert, backslash, formfeed, and vertical tab unnecessarily in
2451         shell quoting style.
2452
2453 Local Variables:
2454 version-control: never
2455 End: