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