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