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