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