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