Import userspec from coreutils.
[gnulib.git] / lib / ChangeLog
1 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2
3         Import from coreutils.
4         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5         strings on unbounded length.  alloca's performance benefits aren't
6         that important here.
7         (V_STRDUP): Remove.
8         (parse_with_separator): New function, with most of the internals
9         of the old parse_user_spec.  Allow user to omit both user and group,
10         for compatibility with FreeBSD.
11         Clone only the user name, not the entire spec.
12         Do not set *uid, *gid unless entirely successful.
13         Avoid memory leak in some failing cases.
14         Fix regression for USER.GROUP reported by Dmitry V. Levin in
15         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
16         (parse_user_spec): Rewrite to use parse_with_separator.
17
18 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
19
20         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
21         its complicated substitute.
22         * argp-help.c: Include <errno.h>, for program_invocation_short_name
23         and program_invocation_name.
24         (__argp_basename) [!_LIBC]: Remove; the only use was
25         replaced by its body.
26         (__argp_short_program_name): Change condition from
27         !defined __argp_short_program_name to
28         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
29         to match argp-namefrob.h.
30         (__argp_failure): Don't assume strerror_r returns char *.
31         * argp-parse.c (N_): Define unconditionally.
32         (argp_default_options): Fill out initializers with 0 to avoid
33         gcc warnings.
34         
35 2004-08-12  Simon Josefsson  <jas@extundo.com>
36
37         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
38         * getopt_.h: Renamed from getopt.h.
39         
40 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
41
42         Merge from coreutils.
43         
44         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
45         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
46         for Reliant Unix 5.43.
47
48         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
49         (union fooround): Use uintmax_t, not long int.
50         The rest is a merge from libc:
51         [defined _LIBC]: Include <shlib-compat.h>.
52         (_obstack) [defined _LIBC]: Remove after 2.3.4.
53
54         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
55
56         * strverscmp.c: Convert to UTF-8.
57
58 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
59
60         * obstack.h (obstack_empty_p):
61         Don't assume that chunk->contents is suitably aligned.
62         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
63         Likewise. Problem reported by Benno in
64         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
65
66         * chown.c (rpl_chown): Work even if the file is writeable but not
67         readable.  This could be improved further but it'd take some work.
68
69 2004-08-08  Simon Josefsson  <jas@extundo.com>
70         
71         * xgethostname.c: Don't include error.h (not used).
72
73         * getpass.h: Add.
74         * getpass.c: Include getpass.h first.
75
76 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
77
78         * xalloc-die.c: New files.
79         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
80         All uses removed.
81         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
82         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
83         (_, N_, xalloc_die): Move to xalloc-die.c.
84         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
85         so that we needn't mess with xalloc_msg_memory_exhausted.
86
87         * sha1.h: Renamed from sha.h.
88         (SHA1_H): Renamed from _SHA_H.
89         (sha1_ctx): Renamed from sha_ctx.
90         (sha1_init_ctx): Renamed from sha_init_ctx.
91         (sha1_process_block): Renamed from sha_process_block.
92         (sha1_process_bytes): Renamed from sha_process_bytes.
93         (sha1_finish_ctx): Renamed from sha_finish_ctx.
94         (sha1_read_ctx): Renamed from sha_read_ctx.
95         (sha1_stream): Renamed from sha_stream.
96         (sha1_buffer): Renamed from sha_buffer.
97         * sha1.c: Likewise; renamed from sha.c.
98         Do not include <sys/types.h>.
99         Include <stddef.h> rather than <stdlib.h>.
100
101 2004-08-08  Bruno Haible  <bruno@clisp.org>
102
103         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
104         FILESYSTEM_PREFIX_LEN.
105         * progreloc.c: Likewise.
106         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
107
108 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
109
110         Merge from tar.
111         * argp-help.c (make_hol, hol_append): Don't assume that
112         SIZE_MAX is a valid preprocessor constant.
113         (__argp_basename): Change from "#ifndef _LIBC"
114         to "#ifndef __argp_short_program_name", so that
115         we don't compile these functions for tar.
116
117         More merges from coreutils.
118         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
119         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
120         yesno.h: New files.
121         * addext.c: Remove; no longer needed.
122         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
123         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
124         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
125         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
126         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
127         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
128         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
129         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
130         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
131         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
132         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
133         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
134         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
135         Import changes from coreutils.
136
137 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
138
139         Merge from coreutils.
140
141         * .gdb-history: Remove; this doesn't belong here.
142
143         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
144         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
145         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
146
147         * dirname.h: Include <stdbool.h>.
148         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
149         for consistency with POSIX terminology.  All uses changed.
150         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
151         (strip_trailing_slashes): Use bool for booleans.
152         * stripslash.c (strip_trailing_slashes): Likewise.
153
154         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
155         sometimes returns a positive errno value even when it succeeds.
156         (print_errno_message) [!LIBC]: Fall back on strerror if
157         __strerror_r fails.
158
159         * path-concat.c (mempcpy): Don't define if a system header defines it.
160         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
161         (longest_relative_suffix): New function.
162         (path_concat): Use it.  Assume first argument is not NULL.
163         Port to DOS.  Omit redundant separators.
164         Report an error instead of returning NULL.
165         Use mempcpy instead of memcpy.
166         (xpath_concat): Remove: not declared or used.
167
168         * same.h: Include <stdbool.h>
169         (same_name): Return bool, not int.
170         * same.c (same_name): Likewise.
171         (errno): Don't declare; we assume C89 or better now.
172
173         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
174         if not already defined.
175
176         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
177         * dup-safer.c (errno): Likewise.
178
179 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
180
181         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
182         working.
183
184 2004-08-03  Simon Josefsson  <jas@extundo.com>
185
186         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
187         * progname.h: Don't include stdbool.h.
188
189 2004-08-02  Simon Josefsson  <jas@extundo.com>
190
191         * getsubopt.h: New file, with comments from Bruno Haible.
192         * getsubopt.c: New file, from glibc, but slightly modified based on
193         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
194
195 2004-08-01  Simon Josefsson  <jas@extundo.com>
196
197         * xgetdomainname.c: Include stdlib.h, for free().
198
199 2004-07-16  Simon Josefsson  <jas@extundo.com>
200
201         * dummy.c: New file.
202
203 2004-07-16  Bruno Haible  <bruno@clisp.org>
204
205         * backupfile.h: Add extern "C" for C++.
206         * closeout.h: Likewise.
207         * copy-file.h: Likewise.
208         * findprog.h: Likewise.
209         * full-write.h: Likewise.
210         * pathname.h: Likewise.
211         * progname.h: Likewise.
212         * stpcpy.h: Likewise.
213         * stpncpy.h: Likewise.
214         * strcase.h: Likewise.
215         * strstr.h: Likewise.
216         * xalloc.h: Likewise.
217
218         * mbswidth.h: Add extern "C" for C++.
219         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
220
221 2004-07-09  Simon Josefsson  <jas@extundo.com>
222
223         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
224         failed without this.)
225
226 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
227
228         * fchown-stub.c: New file.
229
230 2004-06-24  Jim Meyering  <jim@meyering.net>
231
232         * obstack.h (obstack_base): Cast to (void *), per documentation.
233
234 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
235
236         * argz.c, argz_.h: New files, which are autoupdated from libtool.
237
238 2004-06-01  Jim Meyering  <jim@meyering.net>
239
240         * calloc.c: New file.
241
242 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
243
244         * getdate.y (yylex): Allow space between sign and number.
245         Problem reported by Dan Jacobson.
246
247 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
248        and  Jim Meyering  <jim@meyering.net>
249
250         Merge from coreutils CVS.
251
252         * stat-macros.h: New file, with contents from file-type.h
253         and coreutils' system.h.
254         * file-type.c: Include "stat-macros.h".
255         * file-type.h (file_type): Move all macro definitions to new file,
256         stat-macros.h.
257
258         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
259         Wrap old code with this conditional.
260         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
261         function that does not dereference symlinks.
262         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
263
264         * xreadlink.c: Include xreadlink.h first, to catch .h file
265         dependency problems.
266         (xreadlink): Accept new arg SIZE, for efficiency.
267         All decls and uses changed.
268         * xreadlink.h: Include <stddef.h>, for size_t.
269
270         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
271         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
272
273         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
274
275 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
276
277         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
278         macros to be defined.
279         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
280         the allocator returns NULL because the requested size is zero.
281
282 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
283
284         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
285         var.  Add comment explaining why libc still defines it.  This
286         merges the following patch from glibc:
287         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
288
289 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
290
291         * obstack.c (_obstack): Remove unused variable.  It hasn't been
292         present in glibc since revision 1.1 of this file.
293         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
294         obstack_alignment_mask, obstack_alloc, obstack_base,
295         obstack_blank, obstack_blank_fast, obstack_chunk_size,
296         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
297         obstack_grow0, obstack_init, obstack_int_grow,
298         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
299         obstack_next_free, obstack_object_size, obstack_ptr_grow,
300         obstack_ptr_grow_fast, obstack_room): Remove declarations of
301         nonexistent functions.
302
303 2004-05-17  Derek R. Price  <derek@ximbiot.com>
304             Paul Eggert  <eggert@cs.ucla.edu>
305
306         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
307
308 2004-05-14  Bruno Haible  <bruno@clisp.org>
309
310         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
311         that consists of a '.' followed by an empty digit string.
312         Patch by Tor Lillqvist <tml@iki.fi>.
313
314 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
315
316         Port obstack to the AS/400, where pointers are 16 bytes wide and
317         you cannot cast an integer to a valid pointer.  This patch is
318         currently waiting to be integrated into glibc; see
319         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
320
321         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
322         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
323         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
324         (struct obstack): temp member is now a union of a pointer and
325         an integer, instead of an integer.  All integer uses changed.
326         This does not affect the physical layout of struct obstack,
327         except on hosts (like the AS/400) where the size or alignment of
328         void * is greater than that of ptrdiff_t.
329         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
330         __STDC__)]: Store temporary in pointer member of union, not
331         integer member.
332         * obstack.c: Include <stddef.h>, for offsetof.
333         (struct fooalign): Remove; it doesn't need a name.
334         (union fooround): Change double to long double, and add void *.
335         (DEFAULT_ALIGNMENT): Use offsetof to compute.
336         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
337         not a macro.  Hence the values are always int; so remove all
338         casts-to-int in uses.
339
340 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
341             Derek Price  <derek@ximbiot.com>
342
343         * alloca.c: Include <alloca.h>, to get our interface.
344         * alloca_.h: Use __alloca on AIX, so that we don't have to
345         include <alloca.h> first.  Use C89 prototype for alloca; this
346         requires including <stddef.h> for size_t.  Use extern "C" if C++.
347         Use #elif for simplicity, since we can assume C89 now.
348         Don't try to source the system alloca.h since it will not be found
349         and to prevent recursively including its replacement.
350         * fnmatch.c: Include <alloca.h> instead of opencoding.
351         * lib/regex.c: Likewise.
352
353 2004-05-16  Derek Price  <derek@ximbiot.com>
354             Paul Eggert  <eggert@cs.ucla.edu>
355
356         getline cleanup.  This changes the getndelim2 API: both order of
357         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
358         no delimiter).
359
360         * getline.c: Don't include stddef.h or stdio.h, since our
361         interface does that.
362         (getline): Always use getdelim, so that we don't have two
363         copies of this code.
364         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
365         if available.
366         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
367         (GETNDELIM2_MAXIMUM): New macro.
368         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
369         instead of the old practice of delim2==0.  All callers changed.
370         Return -1 on overflow, instead of returning junk.
371         Do not set *linesize unless allocation succeeds.
372         * getndelim2.h: Do not include stddef.h; no longer needed, now
373         that we include sys/types.h.
374         * getnline.h: Likewise.
375         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
376         (getndelim2): Reorder arguments.
377         * getnline.c (getnline, getndelim):
378         Don't discard the NMAX argument.
379         (getnline): Invoke getndelim, to avoid code duplication.
380         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
381         of (size_t) -1 by callers of the getnline family.
382
383 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
384
385         * nanosleep.c (suspended): Change its type from int to
386         sig_atomic_t volatile.
387         (first_call): Make it private to rpl_nanosleep, and have it
388         be zero initially as that's a bit faster.
389         (my_usleep): Round up fractional times instead of truncating them,
390         as this is the usual meaning for 'sleep'.
391
392         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
393         doesn't work.
394         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
395         (ENOSYS): Define if not defined.
396         (settime): Fall back on stime if it exists and settimeofday fails.
397         But don't bother with fallbacks if a method fails with errno == EPERM.
398
399 2004-05-11  Jim Meyering  <jim@meyering.net>
400
401         Prior to this change, the save_cwd caller required read access to the
402         current directory on most systems (ones with the fchdir function).
403
404         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
405         fails, try write-only, and finally, resort to using xgetcwd.
406
407 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
408
409         * obstack.c, obstack.h: Import changes from libc.
410
411 2004-04-28  Bruno Haible  <bruno@clisp.org>
412
413         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
414         implicitly appends .exe to executables.
415         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
416         accepts Windows pathnames.
417         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
418         Cygwin like Windows, since it now accepts Windows pathnames.
419         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
420         Cygwin like Windows, since it now accepts Windows pathnames.
421         Reported by Derek Robert Price <derek@ximbiot.com>.
422
423 2004-04-20  Jim Meyering  <jim@meyering.net>
424
425         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
426
427 2004-04-20  Jim Meyering  <jim@meyering.net>
428             Bruno Haible  <bruno@clisp.org>
429
430         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
431         memory when realloc fails.
432
433 2004-04-18  Jim Meyering  <jim@meyering.net>
434
435         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
436         don't leak memory and do call END_UTMP_ENT.
437
438 2004-04-11  Paul Eggert  <eggert@twinsun.com>
439
440         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
441         (CHAR_BIT): Remove, since we assume C89.
442         Include <stdint.h> if available, as per current Autoconf CVS advice.
443
444 2004-03-30  Paul Eggert  <eggert@twinsun.com>
445
446         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
447         not bool, to be more consistent with Unix conventions.
448         Suggested by Bruno Haible.
449
450         Merge from coreutils.
451
452         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
453         New files.
454
455         * getdate.h: Include stdbool.h, and timespec.h instead of
456         the usual <time.h> dance.
457         (get_date): Change signature to support fractional time stamps.
458         All callers changed.
459         * getdate.y: Include "getdate.h" first, as we can now
460         assume C89 and don't need to worry about 'const'.
461         Similarly, include "unlocked-io.h" near start, not in middle.
462         Include <limits.h>.
463         (textint.value): Use long int rather than int.
464         (textint.digits): Use size_t rather than int.
465         (BILLION, LOG10_BILLION): New constants.
466         (parser_control): New member rel_ns.  Members day_ordinal,
467         time_zone, month, day, hour, minutes, rel_year, rel_month,
468         rel_day, rel_hour, rel_minutes, rel_seconds
469         are now long int, not int.  Member seconds is now struct timespec,
470         not int.  New member timespec_seen.  Members dates_seen, days_seen,
471         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
472         not int.
473         (%union.intval): Now long int, not int.
474         New member timespec.
475         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
476         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
477         (spec): Now is a timespec or an item list.
478         (timespec, items): New nonterminals.
479         (time, rel, relunit, number, get_date):
480         Add support for fractional seconds.
481         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
482         (gmtime, localtime, mktime): Remove decls; not needed with C89.
483         (to_hour): First arg is now long int, not int.
484         (to_year): Returns long int, not int.
485         Don't treat year -70 like 70.
486         (tm_diff): Returns long int, not int.
487         (lookup_word): Use bool instead of int when appropriate.
488         (yylex): Use size_t for count, not int.
489         Detect overflow when parsing large integer constants.
490         Add support for fractions.
491         (get_date): Make pointers 'const' if possible.
492         Use more-portable code to detect integer overflow.
493         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
494         Don't use ctime; it's not reliable if the year has >4 digits.
495
496         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
497         This is for compatibility with BSD.
498
499         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
500         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
501         From coreutils' system.h.
502
503         * userspec.c: Don't include "posixver.h".
504         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
505         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
506         compatible extension.  Simplify code by removing a boolean int
507         that was always nonzero if a string was nonnull.
508
509 2004-03-30  Jim Meyering  <jim@meyering.net>
510
511         Merge from coreutils.
512
513         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
514
515         * readtokens.c (readtoken): Don't leak 64 bytes when reading
516         an empty input stream.
517
518         * readtokens.c: Include <stdbool.h>.
519         (readtoken): Use `size_t' rather than int/long.
520         All callers adjusted.
521         Use `bool' rather than `int' where appropriate.
522         Use memset rather than an explicit loop.
523         Use x2nrealloc rather than xrealloc.
524         Allow the use of `\0' as a delimiter.
525         (readtokens): Likewise.
526         * readtokens.h (readtoken, readtokens): Update prototypes.
527
528 2004-03-30  Bruno Haible  <bruno@clisp.org>
529
530         * getloadavg.c (getloadavg): Don't assume setlocale returns
531         nonnull.
532
533 2004-03-29  Paul Eggert  <eggert@twinsun.com>
534
535         Merge changes to getloadavg.c from coreutils and Emacs.
536
537         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
538         Define to an expression, not to the empty string.
539         Include cloexec.h and xalloc.h.
540         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
541         Use set_cloexec_flag rather than rolling our own.
542         * cloexec.c, cloexec.h: New files.
543
544 2004-03-18  Paul Eggert  <eggert@twinsun.com>
545
546         * getopt.h: Sync with libc CVS.
547
548 2004-03-18  Paul Eggert  <eggert@twinsun.com>
549             Bruno Haible  <bruno@clisp.org>
550
551         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
552         not on all platforms that have <wchar.h>.
553         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
554
555 2004-03-09  Paul Eggert  <eggert@twinsun.com>
556
557         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
558         Sync with libc CVS.
559         * getopt_int.h: New file, also synced from libc.
560
561 2004-03-07  Paul Eggert  <eggert@twinsun.com>
562
563         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
564         '#if' expressions.  Unlike the code it replaces, it does not
565         depend on (defined _SC_PAGESIZE).  However, it does depend on
566         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
567         first reported by Jason Andrade in
568         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
569
570 2004-01-18  Simon Josefsson  <jas@extundo.com>
571
572         * strdup.h: New file.
573         * strdup.c: Include it.
574         * path-concat.c: Include strdup.h. Drop strdup declaration.
575         * userspec.c: Include strdup.h. Drop strdup declaration.
576
577 2004-02-06  Karl Berry  <karl@gnu.org>
578
579         * config.charset: update from gettext 0.14.1.
580
581 2004-02-05  Paul Eggert  <eggert@twinsun.com>
582
583         Add comments and code, prompted by suggestions from Bruno Haible
584         for sh-quote.
585         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
586         describing the enum quoting_style values.
587         * quotearg.c (quotearg_alloc): New function.
588         (quotearg_buffer_restyled): Treat lone { and } as special.
589         Treat = as special.  Work around bug with older shells
590         that "see" a '\' that is really the 2nd byte of a multibyte char.
591         Quote empty string with shell_quoting_style.
592
593 2004-02-03  Bruno Haible  <bruno@clisp.org>
594
595         * pipe.h: New file, from GNU gettext.
596         * pipe.c: New file, from GNU gettext.
597
598 2004-01-27  Bruno Haible  <bruno@clisp.org>
599
600         * execute.h: New file, from GNU gettext.
601         * execute.c: New file, from GNU gettext.
602         * w32spawn.h: New file, from GNU gettext.
603
604 2004-01-23  Paul Eggert  <eggert@twinsun.com>
605
606         Exit-status fix from coreutils.
607
608         Use exit_failure consistently in place of EXIT_FAILURE,
609         so that program exit statuses are consistent on failure.
610
611         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
612         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
613         * argmatch.h: Comment fix to match the above.
614         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
615         Now a macro referring to exit_failure, instead of a separate
616         variable.  Include "exitfail.h" to get it.
617         * xstrtol.h: Include "exitfail.h".
618         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
619
620         * long-options.c (parse_long_options): Use prototype
621         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
622         for clarity.
623
624 2004-01-21  Jim Meyering  <jim@meyering.net>
625
626         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
627         so as not to conflict with a different-sized __mktime_internal
628         function in GNU libc.
629         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
630         Problem building statically-linked `ls' reported by Michael Brunnbauer.
631
632 2004-01-18  Paul Eggert  <eggert@twinsun.com>
633
634         Merge from diffutils.
635
636         * file-type.c (file_type): Add typed memory objects.
637         * file-type.h (S_TYPEISTMO): New macro.
638
639         * c-stack.h (c_stack_action): Remove argv argument.
640         * c-stack.c (c_stack_action): Likewise.  All uses changed.
641         (die): Don't calculate message unless segv_action returns.
642         (get_stack_location, min_address_from_argv, max_address_from_argv,
643         volatile stack_base, volatile_stack_size): Remove.
644         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
645         that every segmentation violation is a stack overflow.  (Ouch!)
646         See Debian bug 136249 (still outstanding) for more info about why
647         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
648
649 2003-11-30  Bruno Haible  <bruno@clisp.org>
650
651         Safer stack allocation.
652         * setenv.c: Include allocsa.h.
653         (alloca): Remove fallback definition.
654         (freea): Remove macro.
655         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
656         instead of freea.
657
658 2003-10-17  Bruno Haible  <bruno@clisp.org>
659
660         * binary-io.h: Avoid warnings on Cygwin.
661
662 2003-12-28  Bruno Haible  <bruno@clisp.org>
663
664         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
665         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
666
667 2003-11-28  Bruno Haible  <bruno@clisp.org>
668
669         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
670
671 2003-11-27  Bruno Haible  <bruno@clisp.org>
672
673         * wait-process.c: On Windows, include windows.h. Needed on mingw.
674
675 2003-11-17  Bruno Haible  <bruno@clisp.org>
676
677         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
678
679 2003-11-24  Bruno Haible  <bruno@clisp.org>
680
681         * xallocsa.h: New file, from GNU gettext.
682         * xallocsa.c: New file, from GNU gettext.
683
684 2003-11-24  Bruno Haible  <bruno@clisp.org>
685
686         * allocsa.h: New file, from GNU gettext.
687         * allocsa.c: New file, from GNU gettext.
688
689 2003-11-24  Bruno Haible  <bruno@clisp.org>
690
691         * eealloc.h: New file.
692
693 2004-01-15  Jim Meyering  <jim@meyering.net>
694
695         Merge from coreutils.
696
697         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
698         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
699         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
700
701         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
702         optional configure-time default.
703
704         * version-etc.c (version_etc_copyright): Update copyright date.
705
706         * xreadlink.c (xreadlink): Correct outdated comment.
707
708 2004-01-15  Paul Eggert  <eggert@twinsun.com>
709
710         Merge from coreutils.
711
712         * posixver.c: Include posixver.h.
713
714         * same.c: Include <stdbool.h>, <limits.h>.
715         (_POSIX_NAME_MAX): Define if not defined.
716         (MIN): New macro.
717         (same_name): If file names are silently truncated, report
718         that the file names are the same if they are the same after
719         the silent truncation.
720
721         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
722         conversion function.
723         * xstrtod.c (xstrtod): Likewise.  All callers changed to
724         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
725         longer needed.
726
727 2004-01-14  Paul Eggert  <eggert@twinsun.com>
728
729         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
730         with like-named macro in fnmatch.c.
731         (EXT): Use an internal constant instead.
732
733         Merge fnmatch patches from glibc.
734         * fnmatch.c (mbsinit): Remove define.
735         Add libc_hidden_ver (__fnmatch, fnmatch).
736         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
737         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
738
739 2003-12-14  Karl Berry  <karl@gnu.org>
740
741         * config.charset: update from gettext-runtime.
742
743 2003-12-03  Paul Eggert  <eggert@twinsun.com>
744
745         * getgroups.c (getgroups): xmalloc takes one argument, not two.
746         Bug reported by Alfred M. Szmidt.
747
748 2003-11-29  Karl Berry  <karl@gnu.org>
749
750         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
751
752 2003-11-23  Paul Eggert  <eggert@twinsun.com>
753             Bruno Haible  <bruno@clisp.org>
754
755         * printf-parse.h: Don't include sys/types.h.
756         (ARG_NONE): New macro.
757         (char_directive): Change type of *arg_index fields to size_t.
758         * printf-parse.c: Don't include sys/types.h.
759         (SSIZE_MAX): Remove macro.
760         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
761         Remove unnecessary overflow check.
762         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
763         fields.
764
765 2003-11-24  Paul Eggert  <eggert@twinsun.com>
766
767         * alloca.c: Remove dependency on xalloc module.
768         (xalloc_die): Remove.
769         (memory_full) [!defined emacs]: New macro.
770         [!defined emacs]: Don't include xalloc.h.
771         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
772         address arithmetic overflows.  Change datatypes a bit to avoid
773         unnecessary casts.
774
775 2003-11-22  Jim Meyering  <jim@meyering.net>
776
777         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
778
779 2003-11-17  Bruno Haible  <bruno@clisp.org>
780
781         * vasnprintf.c (alloca): Remove fallback definition.
782         (freea): Remove definition.
783         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
784         Reported by Paul Eggert.
785
786 2003-11-17  Jim Meyering  <jim@meyering.net>
787
788         On systems without utime and without a utimes function capable of
789         dealing with a NULL struct utimbuf* argument, this utime replacement
790         could -- in unusual circumstances -- leak a file descriptor.
791         * utime.c: Include <unistd.h> and <errno.h>.
792         (utime_null): Be sure to close `fd' and to preserve errno.
793         Reported by Geoff Collyer via Arnold Robbins.
794
795 2003-11-16  Paul Eggert  <eggert@twinsun.com>
796             Bruno Haible  <bruno@clisp.org>
797
798         Protect against address arithmetic overflow.
799         * printf-args.h: Include stddef.h.
800         (arguments): Change type of field 'count' to size_t.
801         * printf-args.c (printf_fetchargs): Use size_t instead of
802         'unsigned int' where appropriate.
803         * printf-parse.h: Include sys/types.h.
804         (char_directive): Change type of *arg_index fields to ssize_t.
805         (char_directives): Change type of fields 'count', max_*_length to
806         size_t.
807         * printf-parse.c: Include sys/types.h and xsize.h.
808         (SSIZE_MAX): Define fallback value.
809         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
810         instead of 'int' where appropriate. Check a_allocated, d_allocated
811         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
812         * vasnprintf.c: Include xsize.h.
813         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
814         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
815         overflow. Avoid wraparound when converting a width or precision from
816         decimal to binary.
817
818 2003-11-16  Bruno Haible  <bruno@clisp.org>
819
820         Update from GNU gettext.
821         * printf-parse.c: Generalize to it can be compiled for wide strings.
822         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
823         * vasnprintf.c: Generalize to it can be compiled for wide strings.
824         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
825         SNPRINTF): New macros.
826         Don't include <alloca.h> if the file is used inside libintl.
827         (local_wcslen): New function, for Solaris 2.5.1.
828         (VASNPRINTF): Use it instead of wcslen.
829
830 2003-11-16  Bruno Haible  <bruno@clisp.org>
831
832         * xsize.h (xmax): New function.
833         (xsum, xsum3, xsum4): Declare as "pure" functions.
834
835 2003-11-12  Paul Eggert  <eggert@twinsun.com>
836
837         * xalloc.h: Do not include <limits.h> or <stdint.h>.
838         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
839         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
840         heuristic is just as accurate as far as we know, and it removes a
841         dependency on size_max.m4 and ptrdiff_max.m4.
842
843 2003-11-12  Paul Eggert  <eggert@twinsun.com>
844
845         * xstrtol.c (__xstrtol): Remove "break" immediately after
846         "return", to pacify some unknown compiler.  Problem reported
847         by Joerg Schilling.
848
849 2003-11-11  Bruno Haible  <bruno@clisp.org>
850
851         * xsize.h (SIZE_MAX): Remove fallback definition.
852         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
853         defined.
854
855 2003-11-10  Paul Eggert  <eggert@twinsun.com>
856
857         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
858         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
859         rejected some allocations of exactly SIZE_MAX - 2 bytes.
860         From Bruno Haible.
861         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
862         not (size_t) -1, since it's defined here.
863
864 2003-11-06  Paul Eggert  <eggert@twinsun.com>
865
866         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
867         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
868         Reject sizes of exactly SIZE_MAX bytes.
869         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
870         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
871
872 2003-11-05  Bruno Haible  <bruno@clisp.org>
873
874         * xsize.h: Include limits.h, to avoid a possible collision with
875         SIZE_MAX defined in <limits.h> on Solaris.
876
877 2003-11-04  Bruno Haible  <bruno@clisp.org>
878
879         * xsize.h: New file.
880         * linebreak.c: Include xsize.h.
881         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
882         argument for overflow.
883         Suggested by Paul Eggert.
884
885 2003-10-31  Bruno Haible  <bruno@clisp.org>
886
887         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
888         to avoid (extremely rare) race condition.
889         Suggested by Paul Eggert.
890
891 2003-11-03  Jim Meyering  <jim@meyering.net>
892
893         * userspec.c: Include "userspec.h".
894         * userspec.h: New file.
895
896 2003-10-31  Paul Eggert  <eggert@twinsun.com>
897
898         * mountlist.h (struct mount_entry.me_type_malloced): New member.
899         * mountlist.c (SIZE_MAX): Define if not defined already.
900         (read_filesystem_list): Set and use me_type_malloced.
901         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
902         whatever the type happens to be), for brevity and consistency.
903         Check for size calculation overflow on Alphas running OSF/1.
904
905 2003-10-31  Jim Meyering  <jim@meyering.net>
906
907         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
908
909         * linebuffer.c: Include <string.h> for declaration of memset.
910
911 2003-10-30  Paul Eggert  <eggert@twinsun.com>
912             Bruno Haible  <bruno@clisp.org>
913
914         * vasprintf.c: Include <limits.h>, <stdlib.h>.
915         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
916
917 2003-10-29  Paul Eggert  <eggert@twinsun.com>
918
919         * xalloc.h (xalloc_oversized): Now a macro, not a function,
920         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
921         no longer needed.
922         * quotearg.c (quotearg_n_options): Use it.
923         * group-member.c: Include <stdbool.h>.
924         (free_group_info): Arg is now const *; don't free arg.
925         (get_group_info): Now returns bool and accepts struct group_info *,
926         rather than returning a malloc'ed struct group_info *.
927         All uses changed.  Check for overflow in internal size calculation.
928
929         * getusershell.c (readname): Simplify the code by using x2nrealloc
930         rather than xmalloc/xrealloc.
931         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
932         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
933         conformance bug: the old code used a pointer after freeing the
934         storage that it addressed.
935         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
936         rather than doing it by hand.
937         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
938         the buffer preserved.  Use free and xmalloc instead.
939         * quotearg.c (quotearg_n_options): Likewise.
940         Use a simpler test for size overflow.  Don't use xalloc_oversized
941         because unsigned int might be wider than size_t (!); this suggests
942         that we should switch from unsigned int to size_t for slot numbers.
943
944 2003-10-27  Bruno Haible  <bruno@clisp.org>
945
946         * stdbool_.h: Better support for BeOS.
947
948 2003-10-27  Paul Eggert  <eggert@twinsun.com>
949
950         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
951         to allocate the returned structure.  Do not allocate a subarray,
952         as x2nrealloc will do that.
953         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
954         instead of xnrealloc.
955         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
956
957 2003-10-26  Paul Eggert  <eggert@twinsun.com>
958
959         * xalloc.h (xalloc_oversized): New static inline function, for
960         callers that want to do their own size-overflow checking.  Include
961         <stdbool.h>, since xalloc_oversized returns bool.
962         * xalloc.c (array_size_overflow): Remove.  All callers changed
963         to use xalloc_oversized.
964
965         Add two functions x2realloc, x2nrealloc, for programs that grow
966         arrays dynamically by doubling their sizes.
967         * xalloc.h (x2realloc, x2nrealloc): New decls.
968         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
969         New functions.
970
971         Port to C99 semantics for 'inline' of external functions.
972         Bug reported by Bruno Haible.
973         * xmalloc.c (xnmalloc_inline): New static inline function,
974         with the old contents of xnmalloc.
975         (xnmalloc, xmalloc): Use it.
976         (xnrealloc_inline): New static inline function,
977         with the old contents of xnrealloc.
978         (xnrealloc, xrealloc): Use it.
979
980         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
981
982 2003-10-25  Paul Eggert  <eggert@twinsun.com>
983
984         Fix several address-calculation bugs in the hash modules,
985         plus some minor code cleanup.
986
987         * hash.h: Include <stdbool.h>, for bool.
988         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
989         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
990         hash_get_n_entries, hash_get_max_bucket_length,
991         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
992         hash_rehash): Use size_t rather than unsigned.
993         * hash.c (struct hash_table, hash_get_n_buckets,
994         hash_get_n_buckets_used, hash_get_n_entries,
995         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
996         hash_get_entries, hash_do_for_each, hash_string, is_prime,
997         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
998         Likewise.
999         (SIZE_MAX): Define if not defined.
1000         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
1001         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
1002         hash_print):
1003         Use const * when possible.
1004         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
1005         (check_tuning): Fix bug: if tuning parameters were very close to
1006         0 or 1, rounding errors could have caused subscript violations.
1007         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
1008         (hash_initialize): Add 'fail:' label
1009         to free table and return NULL, and use it to simplify code.
1010         Use calloc rather than clearing the storage ourself.
1011         (hash_initialize, hash_rehash): Check for arithmetic overflow in
1012         buffer size calculations.
1013         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
1014         Include <stddef.h>, for size_t.
1015         * hash-pjw.c (hash_pjw): Likewise.
1016         Switch to method described by Bruno Haible.
1017         Include <limits.h>, for CHAR_BIT.
1018         (SIZE_BITS): New macro.
1019
1020 2003-10-21  Paul Eggert  <eggert@twinsun.com>
1021
1022         * getndelim2.c (getndelim2): When size calculation overflows,
1023         ceiling the allocation at NMAX bytes rather than silently
1024         discarding input bytes before NMAX is reached.  This makes
1025         a difference only if NMAX exceeds SIZE_MAX / 2.
1026
1027         * obstack.c: Merge from glibc.
1028         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
1029         Add libc_hidden_def (_obstack_newchunk).
1030         (_obstack_free) [! defined _LIBC]: Remove.
1031         [defined _LIBC]: Make a strong alias from obstack_free, rather than
1032         a clone of the function body.
1033         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
1034         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
1035
1036         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
1037         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
1038         arg to memcpy.
1039
1040         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
1041         (obstack_ptr_grow_fast, obstack_int_grow_fast):
1042         Don't use lvalue casts, as GCC plans to remove support for them
1043         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
1044         was also present in the non-GCC version, indicating that this
1045         code had always been buggy and had never been widely used.
1046         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
1047         Use the fast variant of each macro, rather than copying the
1048         definiens of the fast variant; that way, we'll be more likely to
1049         catch future bugs in the fast variants.
1050
1051 2003-10-20  Bruno Haible  <bruno@clisp.org>
1052
1053         * wait-process.h: New file, from GNU gettext.
1054         * wait-process.c: New file, from GNU gettext.
1055
1056 2003-10-19  Jim Meyering  <jim@meyering.net>
1057
1058         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
1059
1060 2003-10-16  Paul Eggert  <eggert@twinsun.com>
1061
1062         * getgroups.c: Include <errno.h>, <stdlib.h>.
1063         (getgroups): First arg is int, not size_t.
1064         Don't let 'free' mangle errno.
1065
1066 2003-10-16  Jim Meyering  <jim@meyering.net>
1067
1068         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
1069
1070 2003-10-15  Paul Eggert  <eggert@twinsun.com>
1071
1072         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
1073         (SIZE_MAX): Remove.
1074         (new_exclude, add_exclude_file): Initial size no longer needs to
1075         be a power of 2.
1076         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
1077         our own address arithmetic overflow checking.
1078
1079         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
1080         (fnmatch): Do not alloca more than 2000 wide characters;
1081         instead, use malloc for large buffers.
1082         Check for address arithmetic overflow, and return -1
1083         with errno set to ENOMEM in that case.
1084         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
1085         (NEW_PATTERN): Do not alloca more than 8000 bytes;
1086         instead, return -1.  Check for address arithmetic overflow.
1087
1088 2003-10-14  Paul Eggert  <eggert@twinsun.com>
1089
1090         Handle invalid suffixes and overflow independently, so that
1091         callers can treat them independently as needed.  Fix some bugs in
1092         suffix handling, e.g., "100k@" was not diagnosed as an invalid
1093         suffix for a human-readable blocksize.  The major caller-visible
1094         change is the addition of a new
1095         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
1096         that both overflow and suffix chars were found.
1097
1098         * human.c (humblock): Don't check separately for invalid suffix
1099         char; that is xstrtoumax's job (now that its bug is fixed).
1100         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
1101         INTMAX_MAX]: New macros.
1102         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
1103         TYPE_MAXIMUM): New macros.
1104         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
1105         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
1106         if overflow occurs, as it's what __strtol does and it's more useful
1107         in practice.
1108         (__xstrtol): If __strtol reports some error other than ERANGE,
1109         reflect it to the caller as LONGINT_INVALID.  If it reports
1110         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
1111         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
1112         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
1113         value.
1114         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
1115         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
1116         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
1117         [defined UINTMAX_MAX]: New macros.
1118
1119 2003-10-14  Bruno Haible  <bruno@clisp.org>
1120
1121         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
1122         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
1123         Also use volatile where needed.
1124
1125 2003-10-12  Paul Eggert  <eggert@twinsun.com>
1126
1127         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
1128         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
1129         and define in terms of the other primitives.
1130         * xmalloc.c: Include stdbool.h; do not include exit.h.
1131         (SIZE_MAX): Define if not already defined.
1132         (array_size_overflow): New function.
1133         (xalloc_die): Abort instead of exiting if 'error' returns.
1134         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
1135         (xmalloc, xrealloc): Use them.
1136         (xcalloc): Check for address arithmetic overflow.
1137         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
1138         a bit faster than strcpy.
1139
1140 2003-10-08  Paul Eggert  <eggert@twinsun.com>
1141
1142         Merge getpass from libc, plus a few fixes.
1143
1144         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
1145         Include <stdbool.h>.
1146         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
1147         __fsetlocking to empty.
1148         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
1149         do include <bits/libc-lock.h>.
1150         Do not include <fcntl.h>; not needed.
1151         [_LIBC]: Include <wchar.h>.
1152         (NOTCANCEL_MODE): New macro.
1153         (flockfile, funlockfile) [_LIBC]: New macros.
1154         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
1155         [!_LIBC]: New macros.
1156         (call_fclose): New function.
1157         (getpass): Use it.  Save tty stream separately; this simplifies the
1158         code and makes it more reliable if stdin happens to equal stdout.
1159         Invoke __fsetlocking on tty.
1160         Handle thread cancellation if needed.
1161         Namespace cleanup (use __tcgetattr, __getline).
1162         Use bool for Booleans.
1163         [USE_IN_LIBIO]: Handle wide streams.
1164         [!_LIBC]: Unconditionally do the fseek, since we don't know what
1165         stream might go where.
1166
1167         * unlocked-io.h: Include <stdio.h>, so that the caller
1168         doesn't have to include <stdio.h> before us.
1169         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
1170         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
1171         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
1172         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
1173         if not declared, so that we can use getpass.c code from libc without
1174         rewriting it.
1175         (flockfile, ftrylockfile, funlockfile): New macros.
1176
1177 2003-10-06  Bruno Haible  <bruno@clisp.org>
1178
1179         * version-etc-2.h: Remove file.
1180         * version-etc-2.c: Remove file.
1181
1182 2003-09-25  Jim Meyering  <jim@meyering.net>
1183             Bruno Haible  <bruno@clisp.org>
1184
1185         This lets translators provide better translations for the
1186         "Written by ..." part of --version output.
1187         * version-etc.h: Include stdarg.h.
1188         (version_etc_copyright): Declare as readonly.
1189         (version_etc): Make this function variadic with a NULL-terminated list
1190         of author name strings.
1191         (version_etc_va): New declaration.
1192         * version-etc.c: Include stdarg.h, stdlib.h.
1193         (version_etc_copyright): Declare as readonly.
1194         (version_etc_va): New function. Provide a different translatable string
1195         for each possible number of authors < 10. Abbreviate when there are 10
1196         authors or more.
1197         (version_etc): Make this function variadic. Call version_etc_va.
1198         Suggestion from Gary V. Vaughan.
1199
1200         * long-options.h (parse_long_options): Change prototype: the authors
1201         string is moved to the end and becomes variadic.
1202         * long-options.c: Include stdarg.h.
1203         (parse_long_options): Make this function variadic, too.
1204         Call version_etc_va, not version_etc.
1205
1206 2003-10-06  Bruno Haible  <bruno@clisp.org>
1207
1208         * fatal-signal.h: New file, from GNU gettext.
1209         * fatal-signal.c: New file, from GNU gettext.
1210
1211 2003-10-04  Karl Berry  <karl@gnu.org>
1212
1213         * argp*: update from libc.
1214
1215 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
1216
1217         * getpass.c (getpass): Use a no-op fseek when switching from input to
1218         output mode on the same stream.
1219
1220 2003-09-29  Paul Eggert  <eggert@twinsun.com>
1221
1222         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
1223         Fix arg typo in previous patch.
1224
1225 2003-09-28  Jim Meyering  <jim@meyering.net>
1226
1227         * error.c: Correct cpp indentation.
1228
1229 2003-09-27  Paul Eggert  <eggert@twinsun.com>
1230
1231         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
1232         Omit the special code that used __typeof__, since we worry that
1233         it could be more trouble than it's worth.  See:
1234         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
1235         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
1236
1237         * free.c: New file.
1238
1239 2003-09-26  Jim Meyering  <jim@meyering.net>
1240
1241         * error.c (error_tail): Move some declarations
1242         into inner scope where the local variables are used.
1243
1244 2003-09-26  Bruno Haible  <bruno@clisp.org>
1245
1246         * stpncpy.h (gnu_stpncpy): New declaration.
1247         (stpncpy): Define as alias for gnu_stpncpy.
1248         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
1249
1250 2003-09-26  Paul Eggert  <eggert@twinsun.com>
1251
1252         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
1253         (error_tail): Do not loop, reallocating temporary buffer, since
1254         the output cannot contain more wide characters than the input
1255         contains bytes, the size must be big enough already.  This avoids
1256         one potential size overflow calculation.  Check for size overflow
1257         when calculating temporary buffer size.  Free temporary buffer
1258         when done, if it was allocated with malloc; this plugs a memory
1259         leak.  Remove casts from void * to pointers, that are no longer
1260         needed now that we're assuming C89 or better.
1261
1262         Merge error changes from glibc.
1263
1264         * error.c, error.h: Update copyright notice header to match glibc.
1265         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
1266         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
1267         Disable cancellation while printing error.
1268         * error.h: Prepend __ to parameter names.
1269
1270 2003-09-25  Karl Berry  <karl@gnu.org>
1271
1272         * argp-fmtstream.c, argp-help.c: update from libc.
1273
1274 2003-09-25  Bruno Haible  <bruno@clisp.org>
1275
1276         * version-etc-2.h: New file, from version-etc.h with modifications.
1277         * version-etc-2.c: New file, from version-etc.c with modifications.
1278
1279 2003-09-25  Simon Josefsson  <jas@extundo.com>
1280
1281         * xgetdomainname.h: New file.
1282         * xgetdomainname.c: New file.
1283
1284 2003-09-25  Simon Josefsson  <jas@extundo.com>
1285             Bruno Haible  <bruno@clisp.org>
1286
1287         * getdomainname.h: New file.
1288         * getdomainname.c: New file.
1289
1290 2003-09-24  Paul Eggert  <eggert@twinsun.com>
1291
1292         * linebuffer.c (freebuffer): Don't free the argument, just
1293         the buffer associated with the argument.  Bug reported by
1294         Simon Josefsson.
1295
1296 2003-09-19  Karl Berry  <karl@gnu.org>
1297
1298         * argp.h: update from libc.
1299
1300 2003-09-16  Paul Eggert  <eggert@twinsun.com>
1301
1302         * linebuffer.c (readlinebuffer): Return NULL immediately upon
1303         input error, instead of returning NULL the next time we are called
1304         (and therefore losing track of errno).
1305
1306 2003-09-15  Paul Eggert  <eggert@twinsun.com>
1307
1308         * getndelim2.c (getndelim2): Don't trash errno when a read
1309         fails, so that the caller gets the proper errno.
1310
1311         * readutmp.c (read_utmp): Likewise.
1312         Check for fstat error.  Close stream and free storage
1313         when failing.
1314
1315 2003-09-14  Bruno Haible  <bruno@clisp.org>
1316
1317         * fwriteerror.h: New file.
1318         * fwriteerror.c: New file.
1319
1320 2003-09-14  Jim Meyering  <jim@meyering.net>
1321
1322         * getloadavg.c: Correct cpp indentation.
1323         * strdup.c: Likewise.
1324         * vasnprintf.c: Likewise.
1325
1326 2003-09-12  Paul Eggert  <eggert@twinsun.com>
1327
1328         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
1329         * obstack.c [!defined _LIBC]: Likewise.
1330         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
1331         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
1332         * exitfail.c: Don't include stdlib.h; no longer needed.
1333
1334         More changes to assume C89 or better.
1335
1336         * error.c (error_tail): Assume vprintf.
1337
1338         * argmatch.c (getenv): Remove decl.
1339         * progreloc.c (get_full_program_name): Define via prototype.
1340         * setenv.c (clearenv): Likewise.
1341         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
1342         needed.
1343         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
1344         (malloc, memcpy): Remove decls.
1345         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
1346         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
1347         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1348         (memcpy): Remove macro.
1349         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
1350         (__P): Remove.  All uses removed.
1351         (PTR): Remove.  All uses changed to void *.
1352         (CHAR_BIT, NULL): Remove.
1353         (spaces, zeros, memset_space, memset_zero)
1354         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
1355         Remove.
1356         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
1357         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
1358         Define with prototype.
1359         Remove now-unnecessary prototype decl.
1360         (extra_args_spec): Assume ANSI C.  All uses changed.
1361         (extra_args_spec_iso): Remove.
1362         (my_strftime, emacs_strftimeu): Define via prototype.
1363         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
1364         unconditionally.
1365         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
1366         * strtoimax.c: Include <stdlib.h> unconditionally.
1367         (strtoul, strtol): Remove decls.
1368         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
1369         LONG_MAX): Remove.
1370         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
1371         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
1372         (LOCALE_PARAM_PROTO): New macro.
1373         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
1374         (INTERNAL (strtol), strtol): Define with a prototype.
1375         (PARAMS): Remove.  All uses removed.
1376         * tempname.c: Include <string.h> unconditionally.
1377         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
1378         * xgethostname.c (main): Define with a prototype.
1379         * xmalloc.c: Include "xalloc.h" first, to check interface.
1380         Include <stdlib.h> unconditionally.
1381         (calloc, malloc, realloc, free): Remove decls.
1382         * xstrtod.c: Include "xstrtod.h" first, to check interface.
1383         Include <stdlib.h> unconditionally.  Sort include file names.
1384         (strtod): Remove.
1385         (xstrtod): Define with a prototype.
1386         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
1387         (strtol, strtoul): Remove decls.
1388
1389 2003-09-11  Paul Eggert  <eggert@twinsun.com>
1390
1391         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
1392         Include <stdlib.h>, <string.h> unconditionally.
1393         Remove now-unnecessary cast to char *.
1394         * strnlen.c: Include <string.h> unconditionally.
1395         * yesno.c (yesno): Define with a prototype.
1396
1397 2003-09-10  Bruno Haible  <bruno@clisp.org>
1398
1399         * strcspn.c: Include <string.h> unconditionally.
1400         * strpbrk.c: Include <string.h> unconditionally.
1401         * strstr.c: Include <string.h> unconditionally.
1402         * unicodeio.c: Include <string.h> unconditionally.
1403         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
1404         * unsetenv.c: Likewise.
1405         * xreadlink.c: Include <stdlib.h> unconditionally.
1406         * yesno.c: Include <stdlib.h> unconditionally.
1407         (rpmatch): Add prototype.
1408
1409 2003-09-10  Jim Meyering  <jim@meyering.net>
1410
1411         * error.c: Correct indentation of cpp directives.
1412
1413 2003-09-09  Paul Eggert  <eggert@twinsun.com>
1414
1415         More K&R removal.
1416
1417         * acosl.c (main): Use a prototype.
1418         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
1419         tanl.c: Likewise.
1420
1421         * getloadavg.c (getloadavg, main): Define via prototypes.
1422
1423         * getopt.h (struct option.name): Assume C89, and use 'const'.
1424         (getopt, etopt_long, getopt_long_only, _getopt_internal)
1425         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
1426         with a prototype.
1427         * getopt.c (const): Remove macro.
1428         Include <string.h> unconditionally.
1429         (my_index): Remove; all uses changed to strchr.
1430         (strlen): Remove decl.
1431         (exchange): Remove forward decl; no longer needed.
1432         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
1433         Define with prototype.
1434         * getopt1.c (const): Remove macro.
1435         (getopt_long, getopt_long_only, main): Define with prototype.
1436
1437         * getugroups.c: Include <string.h> unconditionally.
1438
1439         * getusershell.c: Include <stdlib.h> unconditionally.
1440         (getusershell, setusershell, endusershell, readname, main):
1441         Define with prototypes.
1442
1443         * group-member.c: Include group-member.h first.
1444         Include <stdlib.h> unconditionally.
1445
1446         * hard-locale.c: Include hard-locale.h first.
1447         Include <stdlib.h>, <string.h> unconditionally.
1448
1449         * hash.c (free, malloc): Remove decls.
1450         Include <stdlib.h> unconditionally.
1451
1452         * human.c: Include <stdlib.h>, <string.h> unconditionally.
1453         (getenv): Do not declare.
1454
1455         * idcache.c: Include <string.h> unconditionally.
1456
1457         * long-options.c: Include long-options.h first, to test interface.
1458         Include <stdlib.h> unconditionally.
1459
1460         * makepath.c: Include makepath.h first, to test interface.
1461         Include <stdlib.h> and <string.h> unconditionally.
1462
1463         * linebuffer.c: Include <stdlib.h>.
1464         (free): Remove decl.
1465
1466         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
1467         rpl_malloc returns void *, not char *.
1468         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
1469
1470         * md5.h: Include <limits.h> unconditionally.
1471         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
1472         (__P): Remove; all uses removed.
1473         * md5.c: Include "md5.h" first.
1474         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
1475         md5_buffer, md5_process_bytes, md5_process_block):
1476         Define with prototypes.
1477         * sha.h (__P): Remove all uses.  (It wasn't defined??)
1478         * sha.c: Include "sha.h" first.
1479         Include <stdlib.h>, <string.h> unconditionally.
1480
1481         * memchr.c (__ptr_t): Remove; all uses changed to void *.
1482         * memcmp.c (__ptr_t): Likewise.
1483         * memrchr.c (__ptr_t): Likewise.
1484         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
1485         Include <string.h> unconditionally.
1486         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
1487         * memchr.c: Include <stdlib.h> unconditionally.
1488         * memchr.c (LONG_MAX): Remove.
1489         * memrchr.c (LONG_MAX): Likewise.
1490         * memchr.c (__memchr): Define via a prototype.
1491         * memrchr.c (__memrchr): Likewise.
1492         * memcmp.c (__P): Remove, and remove all uses.
1493         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
1494         Remove forward decls; no longer needed.
1495         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
1496         Use types required by C89 in prototype.
1497
1498         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
1499         * savedir.c: Likewise.
1500         * mkdir.c (free): Remove decl.
1501         * rmdir.c (rmdir): Define with a prototype.
1502         * savedir.c: Include savedir.h first, to test interface.
1503
1504         * mktime.c (STDC_HEADERS): Remove.
1505         Include <stdlib.h>, <string.h> unconditionally.
1506
1507         * modechange.c: Include <stdlib.h> unconditionally.
1508         (malloc): Remove decl.
1509
1510         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
1511         (free): Remove decl.
1512
1513         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
1514         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
1515         (This type really should be intptr_t, but that's a C99ism.)
1516         (_obstack_memcpy): Remove: all uses changed to memcpy.
1517         Include <string.h> unconditionally.
1518         (struct obstack): Assume __STDC__ for types of members
1519         chunkfun, freefun, extra_arg.
1520         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
1521         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
1522         obstack_begin, obstack_specify_allocation,
1523         obstack_specify_allocation_with_arg, obstack_chunkfun,
1524         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
1525         Remove unprototyped decls and the macros that use them.
1526         * obstack.c (POINTER): Remove.  All uses changed to void *.
1527         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
1528         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
1529         (defined __STDC__ && __STDC__)]:
1530         Remove nonprototyped code.
1531         Include <stdlib.h> unconditionally.
1532         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
1533         _obstack_allocated_p, _obstack_free, obstack_free,
1534         _obstack_memory_used, print_and_abort):
1535         Define using prototypes.
1536         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
1537         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
1538         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
1539         obstack_next_free, obstack_object_size, obstack_room) [0]:
1540         Remove unused, unprototyped code.
1541
1542         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
1543
1544         * physmem.c (physmem_total, physmem_available, main): Define
1545         with prototypes.
1546
1547         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
1548         (main): Define with a prototype.
1549
1550         * posixver.c (getenv): Remove decl.
1551
1552         * putenv.c (malloc): Returns void *, not char *.
1553         Include <string.h> unconditionally.
1554         (strchr, memcpy, NULL): Do not define.
1555
1556         * readtokens.c: Include readtokens.h first, to test interface.
1557         Include <stdlib.h>, <string.h> unconditionally.
1558         (init_tokenbuffer): Define with a prototype.
1559
1560         * regex.c (PARAMS): Remove.  All uses removed.
1561         All uses of _RE_ARGS removed, too.
1562         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1563         unconditionally.
1564         (bzero): Assume memset exists.
1565         (memcmp, memcpy, NULL): Remove.
1566         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
1567         char, or assignments to local vars of type signed char.
1568         (init_syntax_once, PREFIX(extract_number_and_incr),
1569         PREFIX(print_partial_compiled_pattern),
1570         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
1571         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
1572         PREFIX(regex_grow_registers), PREFIX(regex_compile),
1573         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
1574         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
1575         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
1576         wcs_compile_range, byte_compile_range, truncate_wchar,
1577         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
1578         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
1579         count_mbs_length, wcs_re_match_2_internal,
1580         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
1581         PREFIX(alt_match_null_string_p),
1582         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
1583         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
1584         regfree, PREFIX(extract_number)): Define with prototype.  Remove
1585         now-unnecessary declaration, if any.
1586         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
1587         regcomp, regexec):
1588         Remove now-unnecessary casts among pointer types.
1589         * regex.h (_RE_ARGS): Remove.  All uses removed.
1590
1591         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
1592         (free): Remove decl.
1593
1594         * rpmatch.c: Include <stdlib.h> unconditionally.
1595
1596         * same.c: Include <stdlib.h>, <string.h> unconditionally.
1597         (free): Remove decl.
1598
1599         * save-cwd.c: Include <stdlib.h> unconditionally.
1600         * xgetcwd.c: Likewise.
1601
1602         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
1603         (free): Remove decl.
1604
1605         * strchrnul.c (strchrnul): Define with a prototype.
1606         Fix bug: c_in was not converted to char before searching.
1607
1608         The following changes are not K&R related:
1609
1610         * group-member.h: Include <sys/types.h>, so that this file is
1611         self-contained.
1612         * makepath.h: Likewise.
1613
1614         * getusershell.c (readname, default_index, line_size, readname):
1615         Use size_t, not int, for sizes.
1616         (readname): If the size overflows, report an error instead of
1617         looping forever.
1618
1619 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
1620
1621         * getndelim2.c: Assume stdlib.h per the C89 spec.
1622
1623 2003-09-08  Paul Eggert  <eggert@twinsun.com>
1624
1625         Assume C89 or better; remove K&R cruft.
1626         A few of these changes were first proposed by Derek Robert Price
1627         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
1628
1629         * addext.c: Include <string.h> unconditionally.
1630         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
1631         Don't declare getenv or malloc.
1632
1633         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
1634         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
1635         (NULL): Remove.
1636         (find_stack_direction, alloca): Use prototypes.
1637
1638         * atexit.c (atexit): Define using a prototype.
1639
1640         * basename.c, dirname.c, stripslash.c:
1641         Include <string.h> unconditionally.
1642
1643         * bcopy.c: Include <stddef.h>.
1644         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
1645
1646         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
1647
1648         * error.h (error, error_at_line, error_print_progname)
1649         [! (defined (__STDC__) && __STDC__)]: Remove decls.
1650         * error.c: Include error.h first, to check interface.
1651         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1652         (VA_START): Remove; all uses changeed to va_start.
1653         (exit, strerror): Remove decls.
1654         (error_print_progname): Prototype uncondionally.
1655         Don't include <errno.h>; no longer needed.
1656         (private_strerror): Remove.
1657         (error_tail): Always define.
1658         (error, error_at_line): Assume C89 or better; always use prototypes.
1659         * fatal.c: Include "fatal.h" first, to test interface.
1660         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
1661         (VA_START): Remove; all uses changed to va_start.
1662         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
1663         this case.
1664         (exit): Remove decl.
1665         (fatal): Prototype unconditionally.  Assume va_start works.
1666         Abort at end, to pacify gcc.
1667
1668         * euidaccess.c (main): Define with a prototype.
1669
1670         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
1671
1672         * exitfail.c: Include <stdlib.h> unconditionally.
1673
1674         * fnmatch_.h (__P): Remove.  All uses changed to assume
1675         prototypes.
1676         * fnmatch.c: Include fnmatch.h first, to test interface.
1677         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
1678         (getenv): Remove decl.
1679         (fnmatch): Define using a prototype.
1680         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
1681         (FCT): Define using a prototype.
1682
1683         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
1684
1685         * gethostname.c: Include <stddef.h>.
1686         (gethostname): Define with prototype.  Length is size_t, not int.
1687
1688 2003-09-08  Paul Eggert  <eggert@twinsun.com>
1689
1690         * getversion.c: Remove; was migrated to backupfile.c in 1997.
1691         getversion.c should have been removed then, but was accidentally
1692         preserved.
1693
1694         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
1695         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
1696
1697 2003-09-07  Paul Eggert  <eggert@twinsun.com>
1698
1699         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
1700         copy_tm_result.  Bug reported by Simon Josefsson in
1701         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
1702
1703 2003-09-06  Paul Eggert  <eggert@twinsun.com>
1704
1705         * time_r.c, time_r.h: New files.
1706
1707         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
1708         __localtime_r.
1709         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
1710         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
1711
1712         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
1713         __gmtime_r.
1714         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
1715         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
1716         Include <time_r.h>.
1717
1718         * timegm.c: Switch to glibc implementation, with the following changes:
1719         [defined HAVE_CONFIG_H]: Include <config.h>.
1720         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
1721         (__mktime_internal) [!defined _LIBC]: New decl.
1722         (__gmtime_r) [!defined _LIBC]: New macro and function.
1723         (timegm): Use a prototype, since gnulib assumes C89.
1724         Do not bother declaring tmp to be const, as it's not really usefu.
1725         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
1726         (timegm): Declare only if HAVE_DECL_TIMEGM.
1727
1728 2003-09-03  Paul Eggert  <eggert@twinsun.com>
1729
1730         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
1731         Bug reported by Lute Kamstra in
1732         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
1733
1734         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
1735         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
1736         course with correspondingly smaller numbers for tomorrow and
1737         yesterday.  From Tadayoshi Funaba.  Originally installed into
1738         sh-utils on 1999-08-07, but the patch got lost (I guess during the
1739         coreutils merge?).
1740
1741 2003-08-31  Simon Josefsson  <jas@extundo.com>
1742
1743         * timegm.h: New file.
1744         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
1745
1746 2003-08-31  Karl Berry  <karl@gnu.org>
1747
1748         * argp.h: update from libc.
1749
1750 2003-08-28  Bruno Haible  <bruno@clisp.org>
1751
1752         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
1753         warning on QNX, which defines O_BINARY to 000000.
1754
1755 2003-08-24  Bruno Haible  <bruno@clisp.org>
1756
1757         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
1758         MSVC7 <stdio.h> is included later.
1759
1760 2003-08-20  Bruno Haible  <bruno@clisp.org>
1761
1762         * progname.h: New file, from GNU gettext.
1763         * progname.c: New file, from GNU gettext.
1764         * progreloc.c: New file, from GNU gettext.
1765
1766 2003-08-19  Bruno Haible  <bruno@clisp.org>
1767
1768         * xstrdup.c: Assume <string.h> exists.
1769
1770 2003-08-18  Jim Meyering  <jim@meyering.net>
1771
1772         * setenv.h: Indent nested cpp directive.
1773         * vasnprintf.c: Remove trailing blanks.
1774
1775 2003-08-17  Simon Josefsson  <jas@extundo.com>
1776             Bruno Haible  <bruno@clisp.org>
1777
1778         * xstrndup.h: New file.
1779         * xstrndup.c: New file.
1780
1781 2003-08-17  Bruno Haible  <bruno@clisp.org>
1782
1783         * strndup.h: New file.
1784
1785 2003-08-16  Paul Eggert  <eggert@twinsun.com>
1786
1787         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
1788         space, undoing this 2003-08-12 change:
1789         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
1790
1791 2003-08-16  Jim Meyering  <jim@meyering.net>
1792
1793         Merge from coreutils.
1794         * xstrtoimax.c: #else #if -> #elif.
1795         * xstrtoumax.c: Likewise.
1796
1797 2003-08-15  Paul Eggert  <eggert@twinsun.com>
1798
1799         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
1800         rather than tab, after '#' in shell-script copyright notices.
1801         Suggested by Bruno Haible.
1802
1803 2003-08-15  Jim Meyering  <jim@meyering.net>
1804         and Paul Eggert  <eggert@twinsun.com>
1805
1806         Merge from coreutils.
1807         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
1808         member but strut utmpx does not.  Needed for AIX 4.3.3.
1809         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
1810
1811 2003-08-15  Jim Meyering  <jim@meyering.net>
1812
1813         Merge from coreutils.
1814         * xgethostname.c: Include <stdlib.h>.
1815         (xghostname): Don't exit for anything other than memory-related
1816         failure; just return NULL.
1817         * userspec.c: Include "posixver.h".
1818         (parse_user_spec): Accept `.' as a separator only
1819         in pre-POSIX-200112 mode.
1820         * strtoimax.c: Use #elif rather than #else #if.
1821         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
1822         Remove function, now that we can rely on a working tzset function.
1823         [!_LIBC]: Ensure that the required autoconf test has been run.
1824         [!defined _NL_CURRENT && HAVE_STRFTIME]:
1825         Use underlying_strftime for %r.
1826         * sha.c: Merge in some clean-up and optimization changes from glibc.
1827         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
1828         Ensure that it is a multiple of 64.
1829         Rearrange loop exit tests so as to avoid performing an
1830         additional fread after encountering an error or EOF.
1831         * realloc.c: Update copyright date.
1832
1833 2003-08-14  Jim Meyering  <jim@meyering.net>
1834
1835         Merge from coreutils.
1836         * obstack.h: Whitespace changes.
1837         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
1838         and xcalloc return values.
1839         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
1840         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
1841         hang on OSF/1 5.1 for DIR on both local and remote file systems.
1842         Reported by (and fix confirmed by) Nelson H. F. Beebe.
1843         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1844         error from mntctl.
1845         Use mntctl's return value to drive the entry-processing loop, since
1846         we can't rely on the value of the vmt_length member in the last
1847         entry.  On some systems doing so could result in exhausting
1848         virtual memory.  Based in part on a patch from Mike Jetzer.
1849
1850 2003-08-14  Jim Meyering  <jim@meyering.net>
1851         and Paul Eggert  <eggert@twinsun.com>
1852
1853         Merges from coreutils, plus other fixes.
1854         * physmem.c: Merge in portability changes from gcc/libiberty
1855         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
1856         for credits and details.  Thanks to Kaveh Ghazi for helping
1857         to keep these files in sync.
1858         (ARRAY_SIZE): Define it.
1859         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
1860         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
1861         (memcasecmp): Don't assume size_t fits in unsigned int.
1862         Remove casts and duplicate code.
1863         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
1864         (memcpy): Remove definition.
1865         Merge in some clean-up and optimization changes from glibc.
1866         [BLOCKSIZE]: Move definition to top of file.
1867         Ensure that it is a multiple of 64.
1868         Rearrange loop exit tests so as to avoid performing an
1869         additional fread after encountering an error or EOF.
1870         * md5.h (md5_uintptr): Define.
1871         * makepath.c (CLEANUP_CWD): Report an error if we failed to
1872         return to the initial working directory.  Preserve errno
1873         for caller.
1874         * idcache.c: Include "xalloc.h".
1875         (xmalloc, xrealloc): Remove decls.
1876         (getuser): Remove casts no longer required in C89.
1877         * human.c: Include stdio.h, for sprintf.
1878         * group-member.c: Include "xalloc.h".
1879         (xmalloc, xrealloc): Remove decls.
1880         (get_group_info): Remove casts no longer required in C89.
1881         * getusershell.c (readname): Remove casts no longer required in C89.
1882         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
1883         * getline.c: Whitespace fix, from coreutils.
1884
1885 2003-08-13  Paul Eggert  <eggert@twinsun.com>
1886
1887         * exclude.c: Include <ctype.h>
1888         (IN_CTYPE_DOMAIN): New macro.
1889         (is_space): New fn.
1890         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
1891         and empty lines.
1892
1893         * argp-help.c, argp-parse.c, config.charset, getopt.h:
1894         Undo previous (whitespace-only) change.
1895
1896 2003-08-12  Paul Eggert  <eggert@twinsun.com>
1897
1898         * argp-help.c, argp-parse.c, config.charset, getopt.h:
1899         Normalize leading white space and remove trailing white space.
1900         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
1901         notice, as per ../config/srclist-update.
1902
1903         Merge from coreutils.
1904         * euidaccess.h: New file.
1905         * euidaccess.c: Include it.
1906         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
1907         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
1908         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
1909
1910 2003-08-11  Bruno Haible  <bruno@clisp.org>
1911
1912         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
1913         (vasnprintf): Use it instead of wcslen.
1914
1915 2003-08-11  Bruno Haible  <bruno@clisp.org>
1916
1917         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
1918         value to ensure that _Bool promotes to int. Use #define for _Bool when
1919         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
1920
1921 2003-08-10  Karl Berry  <karl@gnu.org>
1922
1923         * regex.h: update from libc (whitespace fix).
1924
1925 2003-08-09  Paul Eggert  <eggert@twinsun.com>
1926
1927         Merge some files from coreutils.  These changes were
1928         originally made by Jim Meyering.
1929         * acl.c: Include <sys/types.h> before <sys/stat.h>;
1930         many older Unixes require this.
1931         * alloca.c (alloca): Remove cast to argument of free;
1932         no longer needed in C89.
1933         * alloca_.h, regex.h: Fix white space to match
1934         what GNU indent does.
1935
1936 2003-08-05  Paul Eggert  <eggert@twinsun.com>
1937
1938         * bumpalloc.h: Remove.
1939
1940 2003-08-04  Paul Eggert  <eggert@twinsun.com>
1941
1942         * getloadavg.c: Change copyright notice and spacing to conform to
1943         GNU coding style.
1944
1945         Merge from coreutils.
1946         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
1947         From glibc.
1948         * getdate.y (date): Also accept dates like May-23-2003; suggestion
1949         from Karl Berry, implemented by Jim Meyering.
1950         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
1951         from Dmitry V. Levin.
1952         Remove anachronistic cast of xrealloc.
1953         * fnmatch_.h (__const): Remove.  Use 'const'.
1954         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
1955         type. Otherwise, it wouldn't compile with at least /bin/cc on
1956         ymp-cray-unicos9.0.2.X.
1957         Combine two mostly-identical uses of alloca into one.
1958         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
1959
1960 2003-08-04  Dave Love <d.love@dl.ac.uk>
1961
1962         [From Emacs.]
1963
1964         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
1965         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
1966         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
1967         obsolete NLIST_NAME_UNION.
1968         [__GNU__]: Undef BSD and FSCALE.
1969         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
1970
1971 2003-08-03  Paul Eggert  <eggert@twinsun.com>
1972
1973         * stdbool_.h (_Bool): Make it signed char, instead of
1974         an enum type, so that it's guaranteed to promote to int.  See:
1975         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
1976
1977 2003-07-31  Paul Eggert  <eggert@twinsun.com>
1978
1979         * strerror.c: Include config.h, limits.h.  Declare sprintf.
1980         (strerror): Don't assume that a printable int fits in 14 bytes.
1981
1982 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
1983             Bruno Haible  <bruno@clisp.org>
1984
1985         * getline.h (getline, getdelim): Change return type to ssize_t.
1986         * getline.c (getline, getdelim): Likewise.
1987         Remove _GNU_SOURCE define; now it's defined in config.h through
1988         m4/getline.m4.
1989
1990 2003-07-22  Paul Eggert  <eggert@twinsun.com>
1991
1992         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
1993         over-parenthesization in macros.
1994
1995         Sync with coreutils.
1996
1997         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
1998         required by C99.
1999
2000         Use `exit_failure' for xalloc and xmemcoll instead of their own
2001         private exit-failure variables.
2002         * xalloc.h (xalloc_exit_failure): Remove.
2003         * xmalloc.c: Likewise.  Include exitfail.h.
2004         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
2005         * xmemcoll.h (xmemcoll_exit_failure): Remove.
2006         * xmemcoll.c: Likewise.  Include exitfail.h.
2007         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
2008
2009 2003-07-18  Paul Eggert  <eggert@twinsun.com>
2010
2011         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
2012         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
2013         to test that it can stand by itself.  Include "exitfail.h".
2014         Clients should set exit_failure instead.
2015         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
2016
2017 2003-07-18  Andreas Schwab  <schwab@suse.de>
2018
2019         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
2020
2021 2003-07-18  Bruno Haible  <bruno@clisp.org>
2022
2023         * getndelim2.h: New file.
2024         * getndelim2.c: Make into a module of its own. Include config.h,
2025         getndelim2.h.
2026         (getndelim2): Make non-static. Change return type to ssize_t.
2027         * getline.h: Change argument names.
2028         * getline.c: Include getndelim2.h instead of getndelim2.c.
2029         * getnline.c: Include getndelim2.h.
2030
2031 2003-07-17  Bruno Haible  <bruno@clisp.org>
2032
2033         * Makefile.am: Remove file.
2034         * Makefile.in: Remove file.
2035
2036 2003-07-17  Bruno Haible  <bruno@clisp.org>
2037
2038         * getnline.h: New file.
2039         * getnline.c: New file.
2040         * getndelim2.c: New file, extracted from getline.c.
2041         (getndelim2): Renamed from getdelim2, with added nmax argument.
2042         * getline.c: Include getndelim2.c.
2043         (getdelim2): Moved out to getndelim2.c.
2044         (getline, getdelim): Update.
2045
2046 2003-07-15    <karl@gnu.org>
2047
2048         * vasnprintf.c: update from gettext.
2049
2050 2003-07-15  Jim Meyering  <jim@meyering.net>
2051
2052         * makepath.c (make_path): Enclose diagnostic in _(...).
2053
2054 2003-07-14  Paul Eggert  <eggert@twinsun.com>
2055
2056         * asnprintf.c, asprintf.c, config.charset, gettext.h,
2057         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
2058         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
2059         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
2060         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
2061         updated automatically by ../config/srclist-update.  This changes
2062         their license from LPGL to GPL.
2063
2064 2003-07-14  Jim Meyering  <jim@meyering.net>
2065
2066         Don't emit diagnostics.  Let callers do that.
2067         * save-cwd.c: Don't include "error.h".
2068         (save_cwd): Don't call error.  Ensure that errno is valid
2069         when returning nonzero.
2070
2071         * save-cwd.h (restore_cwd): Update prototype.
2072         * save-cwd.c (restore_cwd): Remove two parameters.
2073         Simplify.  Don't call error upon failure.  Let callers do that.
2074         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
2075         when auditing is enabled.  But don't bother updating the #if.
2076
2077 2003-07-14  Simon Josefsson  <jas@extundo.com>
2078
2079         * mempcpy.h: New file.
2080         * mempcpy.c: New file.
2081
2082 2003-07-14  Paul Eggert  <eggert@twinsun.com>
2083
2084         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
2085         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
2086         unicodeio.c, unicodeio.h, unlocked-io.h:
2087         Switch from LGPL to GPL.
2088
2089 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
2090
2091         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
2092         it breaks C++ compilation.
2093         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
2094
2095 2003-07-10  Jim Meyering  <jim@meyering.net>
2096
2097         * vasnprintf.c: Remove trailing blanks.
2098         Make cpp indentation consistent.
2099
2100 2003-07-09  Paul Eggert  <eggert@twinsun.com>
2101
2102         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
2103         posixver.c, strftime.c, strnlen.c, strverscmp.c:
2104         Switch from LGPL to GPL.
2105
2106 2003-07-07  Paul Eggert  <eggert@twinsun.com>
2107
2108         * mktime.c: Fix some boundary cases and remove need for floating point.
2109
2110         Issue a compile-time diagnostic if time_t is floating point, or if
2111         two's complement arithmetic is not in effect, or if arithmetic
2112         right shift does not propagate the sign.  These assumptions were
2113         all in the original code but they weren't checked.
2114
2115         (TIME_T_MIDPOINT, verify): New macros.
2116         (__isleap): Remove; it has integer overflow problems.
2117         (leapyear): New function, without those problems.
2118         (ydhms_tm_diff): Remove; splitting into two parts.
2119         (ydhms_diff): New function, containing the arithmetic part of
2120         the old ydhms_tm_diff function.  Issue a compile-time
2121         diagnostic if we are not using C99 integer division.
2122         Avoid casts when possible.
2123         (guess_time_tm): New function, containing the checking part of
2124         the old ydhms_tm_diff function.  Return the new value, rather than
2125         the difference between it and the old.  Accept a new argument T
2126         so that *T specifies the old value.  Check for overflow in the result.
2127
2128         (__mktime_internal): Use a time_t offset, not a long int offset.
2129         This undoes the 2003-06-04 change, which is no longer needed now
2130         that we have better overflow checking.
2131         (localtime_offset): Likewise.
2132
2133         (__mktime_internal): Avoid harmful overflow on hosts where time_t
2134         and long are 64-bit but int is only 32-bit.
2135         (ydhms_diff): Use long int to store year1 and yday1.
2136         Issue a compile-time diagnostic if long int is not wide enough.
2137
2138         (__mktime_internal): Use long int to store adjusted year and yday.
2139         Use plain C rather than preprocessor commands, if that doesn't
2140         affect efficiency.
2141         Check for overflow (and try to repair) after each probe
2142         rather than checking only at the very end.  This avoids some bugs
2143         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
2144         does not equal GMT offset at maximum time).
2145         Use integer to check for overflow rather than floating point; this
2146         is more portable to non-IEEE hosts, and is a tad faster.
2147         When we detect that we are oscillating between two values,
2148         don't check whether tm_isdst has the requested value, since
2149         we already know the answer.  When tm_isdst has the wrong value,
2150         use a different heuristic to find the right one, based on the
2151         extreme values actually observed in practice in tz2003a,
2152         rather than the (overly optimistic) "previous 3 calendar quarters".
2153
2154         (not_equal_tm, print_tm, check_result): Use "const T" rather than
2155         "T const" to accommodate glibc style.
2156         (check_result): Use less-confusing report format.  "long" -> "long int.
2157         (main): Likewise.
2158         Don't loop if the iteration overflows time_t.
2159         Allow a negative step in the iteration.
2160
2161 2003-07-01  Paul Eggert  <eggert@twinsun.com>
2162
2163         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
2164         having it depend on HAVE_SYS_TYPES_H.
2165
2166 2003-06-25  Bruno Haible  <bruno@clisp.org>
2167
2168         * readlink.c: New file.
2169
2170 2003-06-20  Bruno Haible  <bruno@clisp.org>
2171
2172         Assume C89, so PARAMS isn't needed.
2173         * unicodeio.h (PARAMS): Remove.
2174         * unicodeio.c: Don't use PARAMS.
2175
2176 2003-06-18  Jim Meyering  <jim@meyering.net>
2177
2178         Merge changes from coreutils.
2179         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
2180         Remove explicit declarations of xmalloc and realloc.
2181         Include xalloc.h.
2182         (read_utmp): Remove anachronistic cast of xmalloc.
2183
2184 2003-06-17  Paul Eggert  <eggert@twinsun.com>
2185
2186         Assume C89, so PARAMS isn't needed.
2187         * backupfile.h (PARAMS): Remove.  All uses removed.
2188         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
2189         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
2190         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
2191         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
2192         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
2193         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
2194         xstrtol.h: Likewise.
2195         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
2196         same.h, strverscmp.h: Do not include config.h; no longer needed.
2197         Anyway, config.h should always be included before any other file.
2198
2199 2003-06-11  Simon Josefsson  <jas@extundo.com>
2200
2201         * sysexit_.h: New file.
2202
2203 2003-05-20  Derek Price  <derek@ximbiot.com>
2204
2205         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
2206
2207 2003-06-10  Simon Josefsson  <jas@extundo.com>
2208
2209         * strchrnul.h: New file.
2210         * strchrnul.c: New file.
2211
2212 2003-06-10  Simon Josefsson <jas@extundo.com>
2213
2214         * argp.h: New file, from glibc.
2215         * argp-ba.c: New file, from glibc.
2216         * argp-eexst.c: New file, from glibc.
2217         * argp-fmtstream.c: New file, from glibc.
2218         * argp-fmtstream.h: New file, from glibc.
2219         * argp-fs-xinl.c: New file, from glibc.
2220         * argp-help.c: New file, from glibc.
2221         * argp-namefrob.h: New file, from glibc.
2222         * argp-parse.c: New file, from glibc.
2223         * argp-pv.c: New file, from glibc.
2224         * argp-pvh.c: New file, from glibc.
2225         * argp-xinl.c: New file, from glibc.
2226
2227 2003-06-07  Jim Meyering  <jim@meyering.net>
2228
2229         * readtokens.h: Put `Free Software Foundation, Inc.'
2230         in place of my name in the copyright comment.
2231         Remove definition and uses of __P.
2232
2233         From coreutils.
2234         * stat.c: Don't declare xmalloc explicitly.
2235         Instead, include "xalloc.h".
2236         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
2237         xrealloc, and xcalloc return values.
2238         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
2239         Improve comment.
2240         * xgetcwd.h: Remove definition/uses of PARAMS.
2241
2242 2003-06-06  Jim Meyering  <jim@meyering.net>
2243
2244         * stdbool_.h: Renamed from stdbool.h.in.
2245
2246 2003-06-06  Jim Meyering  <jim@meyering.net>
2247
2248         Merge from coreutils.
2249         * same.c: (same_name): Declare *_basename locals to be `const'.
2250         Consolidate declarations and initializations of *_base* locals.
2251
2252         Merge from coreutils.
2253         This avoids a core dump on systems without GNU putenv,
2254         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
2255         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
2256         (unsetenv): New static function, from GNU libc.
2257         (rpl_putenv): Use it.
2258
2259         * modechange.c: Remove trailing blanks.
2260
2261         Merge from coreutils.
2262         * fsusage.c: Remove declaration of statfs.
2263         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
2264
2265         * posixtm.c: Include <stdbool.h> unconditionally.
2266
2267 2003-06-05  Paul Eggert  <eggert@twinsun.com>
2268
2269         * mktime.c (__mktime_internal): When resolving a tm_isdst
2270         mismatch, look in future quarters as well as past.  This fixes a
2271         bug when processing fall-backwards gaps immediately after a long
2272         period of daylight-saving time.
2273
2274         * mktime.c: Assume freestanding C89 or better.
2275         (HAVE_LIMITS_H): Remove.  Assume it's 1.
2276         (__P): Remove; not used.
2277         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
2278         (mktime, not_equal_tm, print_tm, check_result,
2279         main): Use prototypes.  Use const * where appropriate.
2280         (main): Fix typo in testing code that uncovered by above changes.
2281         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
2282
2283 2003-06-04  Paul Eggert  <eggert@twinsun.com>
2284
2285         * mktime.c: Fix Debian bug 177940
2286         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
2287         (localtime_offset): Now long int, not time_t, because we want it
2288         to be guaranteed to be signed.  All uses changed.
2289         (__mktime_internal): If overflow would occur when adding offset,
2290         don't add it.
2291
2292         Merge 'human' changes from coreutils.  Rewrite to support
2293         locale-specific notations like thousands separators.
2294         * human.c: Simplify authorship notice.
2295         Include human.h immediately after config.h.
2296         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
2297         <limits.h>: Do not include, since human.h does.
2298         (SIZE_MAX, UINTMAX_MAX): New macros.
2299         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
2300         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
2301         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
2302         (power_letter): Renamed from suffixes.
2303         (generate_suffix_backwards): Remove.
2304         (adjust_value): Now takes int style (because of human.h changes)
2305         and long double value (for greater precision on some platforms).
2306         (group_number): New function.
2307         (human_readable): Use it.  Use integer options, not enum.
2308         Put the options before the sizes in the arg list.
2309         Support all the new options.
2310         The old human_readable function has been removed;
2311         use inttostr.h instead.
2312         (human_readable, default_block_size, humblock):
2313         Use uintmax_t, not int, for block sizes.
2314         (human_readable_inexact, block_size_types): Remove.
2315         (block_size_opts): New constant.
2316         (human_options): Renamed from human_block_size, with new signature
2317         that allows block sizes up to UINTMAX_MAX.  All callers changed.
2318         * human.h: Add copyright and authorship notice.
2319         Include <limits.h> and <stdbool.h> unconditionally.
2320         (PARAMS): Remove.  All uses removed.
2321         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
2322         (enum human_inexact_style): Remove tag; now a nameless enum.
2323         (human_floor, human_ceiling, human_round_to_even): Now have
2324         values 2, 0, 1 rather than -1, 1, 0.
2325         (human_group_digits, human_suppress_point_zero, human_autoscale,
2326         human_base_1024, human_SI, human_B): New constants.
2327         (human_readable_inexact, human_block_size): Remove.
2328         (human_readable): Size args are now uintmax_t, not int.
2329         (human_options): New decl.
2330
2331         * exclude.c: (new_exclude, add_exclude): Remove casts that are
2332         unnecessary now that we assume C89 or better.  This change
2333         imported from coreutils.
2334
2335         * mktime.c (__mktime_internal): Do not reject negative timestamps
2336         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
2337         in the 2003-05-30 sync from glibc.
2338
2339         .h files should stand alone, but we shouldn't include <sys/types.h>
2340         if we can get away with just <stddef.h>.
2341
2342         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
2343         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
2344         rather than <sys/types.h>, as we merely need size_t.
2345         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
2346         to get size_t.
2347         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
2348         Include <stdio.h>, to get FILE.
2349         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
2350         memcasecmp.h has included <stddef.h> and all we need is size_t.
2351         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
2352         our interface, instead of including <sys/types.h>
2353
2354 2003-06-02  Paul Eggert  <eggert@twinsun.com>
2355
2356         [from coreutils]
2357         Fix some minor time-related bugs with POSIX time arguments.
2358         Some valid time stamps were being rejected (notably -1, and
2359         time stamps before 1900 on 64-bit hosts).  And some invalid
2360         time stamps were being accepted, e.g. September 31.
2361
2362         * posixtm.h (posixtime): Return bool instead of time_t, so
2363         that we can return (time_t) -1 successfully.
2364         * posixtm.c: Likewise.
2365         [HAVE_STDBOOL_H]: Include <stdbool.h>.
2366         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
2367         (t): Remove static var.
2368         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
2369         of static var.  All uses changed.
2370         (year): Do not reject years before 1900; they can occur with
2371         64-bit time_t.
2372         (posix_time_parse): Do not check for out-of-range components;
2373         that is now the caller's responsibility, since our checks were
2374         only approximations.
2375         (posixtime): Use mktime to check for out-of-range components,
2376         since it knows them exactly.
2377         If mktime returns (time_t) -1, check whether an error actually occurred
2378         by invoking localtime on -1.
2379         (main) [TEST_POSIXTIME]: Check for input data errors, and report
2380         posixtime failures better.
2381         Improve the test data (in comments only).
2382
2383 2003-05-30    <karl@gnu.org>
2384
2385         * mktime.c: update from libc.
2386
2387 2003-05-30  Bruno Haible  <bruno@clisp.org>
2388
2389         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
2390         * localcharset.h: Likewise.
2391         * localcharset.c: Likewise.
2392
2393 2003-05-28  Paul Eggert  <eggert@twinsun.com>
2394
2395         Assume the headers required for C89 freestanding compilers.
2396         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
2397         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
2398         without checking for HAVE_LIMITS_H.
2399         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
2400         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
2401         to do that.
2402         * fatal.c: Include <stdarg.h> without checking for __STDC__.
2403         * exclude.c: Include <stdbool.h> unconditionally.
2404         * tempname.c: Include <stddef.h> unconditionally.
2405         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
2406         * modechange.c, rpmatch.c (NULL): Don't define, since
2407         <stddef.h> does that.
2408         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
2409         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
2410         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
2411         * xstrtol.c: Likewise.
2412         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
2413         * savedir.c: Include <stddef.h> instead of defining NULL.
2414
2415         * addext.c (addext): Use assignment rather than cast, to avoid
2416         warnings on some platforms.
2417
2418         * mktime.c (__mktime_internal): Do not reject negative timestamps
2419         arbitrarily.
2420
2421 2003-05-10  Bruno Haible  <bruno@clisp.org>
2422
2423         * linebreak.c (iconv_string_length): Don't return -1 just because the
2424         string is longer than 4 KB.
2425
2426 2003-05-12  Jim Meyering  <jim@meyering.net>
2427
2428         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
2429         the space-padded-by-default conversion specifiers, %e, %k, %l.
2430
2431 2003-05-03  Bruno Haible  <bruno@clisp.org>
2432
2433         Upgrade to Unicode-4.0.
2434         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
2435         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
2436         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
2437         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
2438         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
2439         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
2440         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
2441         Change width of U+E0100..U+E01EF from 1 to 0.
2442
2443 2003-04-25  Bruno Haible  <bruno@clisp.org>
2444
2445         * copy-file.c: Include <stddef.h>, for size_t.
2446
2447 2003-04-25  Jim Meyering  <jim@meyering.net>
2448
2449         * copy-file.c (copy_file_preserving): Declare buf_size to be
2450         of type size_t, not int.
2451
2452 2003-04-11  Jim Meyering  <jim@meyering.net>
2453
2454         Merge changes from Coreutils.
2455
2456         2003-03-22  Jim Meyering  <jim@meyering.net>
2457
2458         * strftime.c (widen): Cast alloca return value to proper type.
2459
2460         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
2461
2462         From GNU libc.
2463         * strftime.c (my_strftime): Handle very large width
2464         specifications for numeric values correctly.  Improve checks for
2465         overflow.
2466
2467         2003-01-19  Jim Meyering  <jim@meyering.net>
2468
2469         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
2470         (nl_get_alt_digit) [! defined my_strftime]: Define.
2471         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
2472         _nl_get_alt_digit and _nl_get_walt_digit.
2473
2474         * strftime.c (my_strftime): Merge in locale-related changes from libc.
2475         These changes have no effect outside of _LIBC.
2476
2477 2003-04-10  Bruno Haible  <bruno@clisp.org>
2478
2479         * findprog.h: New file, from GNU gettext.
2480         * findprog.c: New file, from GNU gettext.
2481
2482 2003-04-05  Jim Meyering  <jim@meyering.net>
2483
2484         Merge changes from Coreutils.
2485
2486         * exclude.h (PARAMS): Remove definition and uses.
2487         * exclude.c: Remove uses of `PARAMS'.
2488
2489         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
2490         Add test-cases for DOS filenames. Declare program_name.
2491         (main): Set up program_name.  Patch by Rich Dawe.
2492
2493         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2494         error from mntctl.
2495         Use mntctl's return value to drive the entry-processing loop, since
2496         we can't rely on the value of the vmt_length member in the last
2497         entry.  On some systems doing so could result in exhausting
2498         virtual memory.  Based in part on a patch from Mike Jetzer.
2499
2500 2003-04-04  Bruno Haible  <bruno@clisp.org>
2501
2502         * linebreak.h: New file, from GNU gettext.
2503         * linebreak.c: New file, from GNU gettext with slight modifications.
2504         * lbrkprop.h: New file, from GNU gettext.
2505
2506 2003-04-03  Bruno Haible  <bruno@clisp.org>
2507
2508         * utf8-ucs4.h: New file, from GNU gettext.
2509         * utf16-ucs4.h: New file, from GNU gettext.
2510         * ucs4-utf8.h: New file, from GNU gettext.
2511         * ucs4-utf16.h: New file, from GNU gettext.
2512
2513 2003-04-02  Bruno Haible  <bruno@clisp.org>
2514
2515         * binary-io.h: New file, from GNU gettext.
2516
2517 2003-04-01  Bruno Haible  <bruno@clisp.org>
2518
2519         * pathname.h: New file, from GNU gettext.
2520         * concatpath.c: New file, from GNU gettext.
2521
2522 2003-03-30  Bruno Haible  <bruno@clisp.org>
2523
2524         * copy-file.c (copy_file_preserving): Don't set owner if the function
2525         chown() doesn't exist.
2526
2527 2003-03-28  Bruno Haible  <bruno@clisp.org>
2528
2529         * copy-file.h: New file, from GNU gettext.
2530         * copy-file.c: New file, from GNU gettext.
2531
2532 2003-03-18  Jim Meyering  <jim@meyering.net>
2533
2534         * quote.c (quote_n): Fix typo in comment.
2535
2536 2003-03-14  Jim Meyering  <jim@meyering.net>
2537
2538         Merge changes from Coreutils.
2539         * obstack.h (obstack_object_size): Declare temporary, __o,
2540         to be const, in order to avoid warnings.
2541         (obstack_room): Likewise.
2542         (obstack_empty_p): Likewise.
2543
2544 2003-03-13  Paul Eggert  <eggert@twinsun.com>
2545
2546         Merge changes from Bison.
2547         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
2548         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
2549         when compiling Bison 1.875's `bitset bset = obstack_alloc
2550         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
2551         * hash.c: Include <stdbool.h> unconditionally.
2552
2553 2003-03-09  Paul Eggert  <eggert@twinsun.com>
2554
2555         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
2556         Reported by Bruce Becker; see:
2557         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
2558
2559 2003-03-03  Paul Eggert  <eggert@twinsun.com>
2560             Bruno Haible  <bruno@clisp.org>
2561
2562         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
2563         Reported by John Hughes, see
2564         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
2565
2566 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
2567
2568         * poll_.h: New file.
2569         * poll.c: New file.
2570
2571 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
2572
2573         * mathl.h: New file.
2574         * acosl.c: New file.
2575         * asinl.c: New file.
2576         * atanl.c: New file.
2577         * ceill.c: New file.
2578         * cosl.c: New file.
2579         * expl.c: New file.
2580         * floorl.c: New file.
2581         * frexpl.c: New file.
2582         * ldexpl.c: New file.
2583         * logl.c: New file.
2584         * sincosl.c: New file.
2585         * sinl.c: New file.
2586         * sqrtl.c: New file.
2587         * tanl.c: New file.
2588         * trigl.c: New file.
2589         * trigl.h: New file.
2590
2591 2003-02-17  Bruno Haible  <bruno@clisp.org>
2592
2593         * mkdtemp.h: New file, from GNU gettext.
2594         * mkdtemp.c: New file, from GNU gettext.
2595
2596 2003-01-31  Bruno Haible  <bruno@clisp.org>
2597
2598         * rename.c: #undef rename before defining rpl_rename.
2599         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
2600
2601 2003-01-30  Bruno Haible  <bruno@clisp.org>
2602
2603         * printf-args.h: New file, from GNU gettext.
2604         * printf-args.c: New file, from GNU gettext.
2605         * printf-parse.h: New file, from GNU gettext.
2606         * printf-parse.c: New file, from GNU gettext.
2607         * vasnprintf.h: New file, from GNU gettext.
2608         * vasnprintf.c: New file, from GNU gettext.
2609         * asnprintf.c: New file, from GNU gettext.
2610         * vasprintf.h: New file, from GNU gettext with modifications.
2611         * vasprintf.c: New file, from GNU gettext.
2612         * asprintf.c: New file, from GNU gettext.
2613
2614 2003-01-29  Bruno Haible  <bruno@clisp.org>
2615
2616         * stpncpy.h: New file, from GNU gettext with modifications.
2617         * stpncpy.c: New file, from GNU gettext with modifications.
2618
2619 2003-01-28  Bruno Haible  <bruno@clisp.org>
2620
2621         * c-ctype.h: New file, from GNU gettext, with changes suggested by
2622         Paul Eggert.
2623         * c-ctype.c: New file, from GNU gettext, with changes suggested by
2624         Paul Eggert.
2625
2626 2003-01-27  Bruno Haible  <bruno@clisp.org>
2627
2628         * xsetenv.h: New file, from GNU gettext.
2629         * xsetenv.c: New file, from GNU gettext.
2630
2631 2003-01-23  Bruno Haible  <bruno@clisp.org>
2632
2633         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
2634
2635 2003-01-22  Bruno Haible  <bruno@clisp.org>
2636
2637         * exit.h: New file, from GNU gettext.
2638
2639 2003-01-11  Bruno Haible  <bruno@clisp.org>
2640
2641         * stpcpy.h (stpcpy): Use ANSI C function declarations.
2642         * strcase.h (strcasecmp, strncasecmp): Likewise.
2643
2644 2003-01-14  Jim Meyering  <jim@meyering.net>
2645
2646         * same.c (same_name): Tweak a comment.
2647
2648 2003-01-11  Bruno Haible  <bruno@clisp.org>
2649
2650         * same.c (same_name): Reorder tests so as to avoid calling stat()
2651         when a string comparison is sufficient.
2652
2653 2003-01-11  Bruno Haible  <bruno@clisp.org>
2654
2655         * readtokens.c (readtoken): Cast character to 'unsigned char', not
2656         'unsigned int'.
2657
2658 2003-01-11  Bruno Haible  <bruno@clisp.org>
2659
2660         * hash-pjw.c: Add comment about low quality of this function.
2661
2662 2003-01-12  Paul Eggert  <eggert@twinsun.com>
2663
2664         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
2665         to avoid collisions with libcurses and libreadline.
2666
2667         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
2668         * getstr.h, getstr.c: Remove.
2669         * getline.c: Include "getline.h", to check interface.
2670         Move body of old getstr.c here: this defines MIN_CHUNK and
2671         declares getdelim2, which is renamed from getstr.
2672         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
2673
2674         * linebuffer.c (readlinebuffer): Renamed from readline.
2675         All uses changed.
2676         * linebuffer.h: Likewise.
2677         (readline): Remove backward-compatibility macro.
2678
2679 2003-01-12  Jim Meyering  <jim@meyering.net>
2680
2681         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
2682
2683 2003-01-10  Bruno Haible  <bruno@clisp.org>
2684
2685         * alloca_.h: New file.
2686         * getdate.y: Unconditionally include alloca.h.
2687         * makepath.c: Likewise.
2688         * setenv.c: Likewise.
2689         * userspec.c: Likewise.
2690
2691 2003-01-09  Bruno Haible  <bruno@clisp.org>
2692
2693         * stdbool.h.in: New file.
2694
2695 2003-01-08  Bruno Haible  <bruno@clisp.org>
2696
2697         * safe-read.c: Include specification header first, to ensure its
2698         selfcontainedness.
2699         * full-write.c: Likewise.
2700
2701 2003-01-08  Jim Meyering  <jim@meyering.net>
2702
2703         * full-write.c: Undefine and define-away `const' after inclusion
2704         of errno.h, not before.  Suggestion from Bruno Haible.
2705
2706 2003-01-07  Jim Meyering  <jim@meyering.net>
2707
2708         * full-write.c: Rework so that it may serve to define full_read, too.
2709         * full-read.c: Simply #define FULL_READ and include full-write.c.
2710
2711 2003-01-06  Jim Meyering  <jim@meyering.net>
2712
2713         * version-etc.c: Update year in translatable copyright string.
2714
2715 2002-12-25  Bruno Haible  <bruno@clisp.org>
2716
2717         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
2718         * xstrtol.h: Likewise.
2719         * xstrtoimax.c: Likewise.
2720         * xstrtoumax.c: Likewise.
2721         * human.h: Likewise.
2722
2723         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
2724         on systems that have <inttypes.h> but not <stdint.h>.
2725
2726 2002-12-31  Paul Eggert  <eggert@twinsun.com>
2727
2728         * memcoll.c (memcoll): Fall back on a simple algorithm using
2729         memcmp if strcoll doesn't work.
2730
2731 2002-12-23  Bruno Haible  <bruno@clisp.org>
2732
2733         * localcharset.h: New file.
2734         * localcharset.c: Include it.
2735         * unicodeio.c: Likewise.
2736
2737 2002-12-22  Bruno Haible  <bruno@clisp.org>
2738
2739         * utime.c (utime_null): No need to call ftruncate if the file was
2740         nonempty.
2741
2742 2002-12-23  Bruno Haible  <bruno@clisp.org>
2743
2744         * memcoll.c (STRCOLL): New macro.
2745         (memcoll): Use it.
2746
2747 2002-12-22  Bruno Haible  <bruno@clisp.org>
2748
2749         * getstr.h (getstr): Define, to avoid clash with libcurses.
2750         * linebuffer.h (readline): Define, to avoid clash with libreadline.
2751
2752 2002-12-22  Bruno Haible  <bruno@clisp.org>
2753
2754         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
2755
2756 2002-12-23  Bruno Haible  <bruno@clisp.org>
2757
2758         * getline.h: Include <stddef.h>, for size_t.
2759
2760         * unicodeio.h: Include <stddef.h>, for size_t.
2761         * unicodeio.c: Don't include <stddef.h>.
2762
2763 2002-12-17  Bruno Haible  <bruno@clisp.org>
2764
2765         * canon-host.c (strdup): Remove unused declaration.
2766
2767         * fsusage.c: Include full_read.h.
2768         (get_fs_usage): Use full_read instead of safe_read.
2769
2770         * utime.c (utime_null): Use SAFE_READ_ERROR.
2771
2772 2002-12-11  Bruno Haible  <bruno@clisp.org>
2773
2774         * setenv.h: Rewritten to cope with systems that have setenv() but not
2775         unsetenv().
2776         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
2777         modifications:
2778
2779         2002-12-11  Bruno Haible  <bruno@clisp.org>
2780
2781                 * setenv.c (alloca): Fall back to malloc.
2782                 (freea): New macro.
2783                 (setenv): Use freea() to free memory allocated with alloca().
2784
2785         2002-11-13  Bruno Haible  <bruno@clisp.org>
2786
2787                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
2788                 function declarations.
2789                 * unsetenv.c (unsetenv): Likewise.
2790
2791         2002-03-04  Bruno Haible  <bruno@clisp.org>
2792
2793                 Portability to AIX 4.3.3.
2794                 * unsetenv.c: New file, extracted from setenv.c.
2795                 * setenv.c: Move the unsetenv() function to unsetenv.c.
2796
2797         2001-12-20  Bruno Haible  <bruno@clisp.org>
2798
2799                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
2800                 use malloc instead. For SunOS 4.
2801
2802         2001-12-11  Bruno Haible  <bruno@clisp.org>
2803
2804                 * setenv.c: Declare alloca.
2805                 (compar_fn_t): New typedef.
2806                 (KNOWN_VALUE, STORE_VALUE): Use it.
2807
2808         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
2809         setenv.h.
2810
2811 2002-12-10  Paul Eggert  <eggert@twinsun.com>
2812
2813         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
2814         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
2815         Choose values that are less likely to collide with system fnmatch
2816         options.
2817         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
2818         defined (e.g., a pure POSIX system).
2819         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
2820         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
2821
2822 2002-12-06  Jim Meyering  <jim@meyering.net>
2823
2824         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
2825
2826         Merge in changes from libc's misc/error.c, in preparation
2827         for the merge of gnulib's changes back into libc.
2828
2829         * error.c (_): Define only if not already defined.
2830         Move definition to follow all #include directives.
2831         Include unlocked-io.h only if !_LIBC.
2832         [_LIBC]: Include <libio/libioP.h>.
2833         [USE_IN_LIBIO]: Include <libio/iolibio.h>
2834         (fflush): Tweak definition to use INTUSE.
2835         (putc): Define.
2836
2837 2002-12-05  Paul Eggert  <eggert@twinsun.com>
2838
2839         * alloca.c [defined emacs]: Include "lisp.h".
2840         (xalloc_die) [defined emacs]: New macro.
2841         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
2842         [! defined emacs]: Include <xalloc.h>.
2843         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
2844         (pointer): Typedef to POINTER_TYPE *.
2845         (malloc): Remove decl; we now always use xmalloc.
2846         (alloca): Use old-style definition, since Emacs needs this.
2847         Check for arithmetic overflow when computing combined size.
2848
2849 2002-12-04  Paul Eggert  <eggert@twinsun.com>
2850
2851         Do not generate unlocked-io.h automatically, since it's easier to
2852         maintain it by hand.
2853
2854         * unlocked-io.h: New file, from GNU diffutils,
2855         but with proper copyright notice and attribution.
2856         * gen-uio: Remove.
2857         * Makefile.am: Add copyright notice.
2858         (libfetish_a_SOURCES): Add unlocked-io.h.
2859         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
2860         (DISTCLEANFILES, io_functions): Remove macros.
2861         (EXTRA_DIST): Remove gen_uio.
2862         (unlocked-io.h): Remove rule.
2863
2864 2002-12-04  Jim Meyering  <jim@meyering.net>
2865
2866         Reflect the fact that stat.c and lstat.c are no longer generated.
2867         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
2868         (DISTCLEANFILES): Likewise.
2869         (EXTRA_DIST): Likewise.
2870         (all_local): Don't depend on stat.c or lstat.c.
2871         (stat.c, lstat.c): Remove rules.
2872         (EXTRA_DIST): Remove xstat.in.
2873
2874         * xstat.in: Remove file.  Contents moved into stat.c.
2875         * stat.c: New file.  Contents mostly from xstat.in.
2876         * stat.c: Rework so that it may serve to define rpl_lstat, too.
2877         * lstat.c: New file. Simply #define LSTAT and include stat.c.
2878
2879         * safe-read.c: Rework so that it may serve to define safe_write, too.
2880         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
2881
2882 2002-12-03  Jim Meyering  <jim@meyering.net>
2883
2884         * safe-read.c, safe-write.c: Change variable names and comments, but
2885         not semantics, to minimize the differences between these two files.
2886         (safe_read): Change comment to mention SAFE_READ_ERROR.
2887
2888         * safe-read.c (IS_EINTR): Define.
2889         (safe_read): Use IS_EINTR in place of in-function cpp directives.
2890
2891 2002-12-02  Bruno Haible  <bruno@clisp.org>
2892
2893         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
2894         Define, taken from safe-read.c.
2895         (INT_MAX): Provide fallback.
2896         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
2897         * safe-write.h (SAFE_WRITE_ERROR): Define.
2898
2899         * safe-read.c (EINTR): Remove definition.
2900         (safe_read): Don't use EINTR if it is absent.
2901
2902 2002-12-02  Jim Meyering  <jim@meyering.net>
2903
2904         * safe-read.c (EINTR): Define.
2905         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
2906         (INT_MAX): Provide fallback.
2907         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
2908
2909         * safe-read.h (SAFE_READ_ERROR): Define.
2910
2911 2002-12-01  Jim Meyering  <jim@meyering.net>
2912
2913         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
2914         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
2915
2916 2002-11-27  Paul Eggert  <eggert@twinsun.com>
2917
2918         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2919         hash_rehash): Replace `if (limit <= value) abort ();' with
2920         `if (! (value < limit)) abort ();', for readability.
2921
2922 2002-11-26    <karl@gnu.org>
2923
2924         * strdup.c: copy from libc again, with jim's ok.
2925         * .cppi-disable: re-add strdup.c
2926
2927 2002-11-25    <karl@gnu.org>
2928
2929         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
2930         instead of "strtol.c".
2931
2932 2002-11-25  Jim Meyering  <jim@meyering.net>
2933
2934         * mktime.c: Sync from libc, now that it has the latest fix.
2935
2936 2002-11-24    <karl@gnu.org>
2937
2938         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
2939         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
2940
2941 2002-11-24  Jim Meyering  <jim@meyering.net>
2942
2943         Update from coreutils:
2944
2945         * mktime.c: Merge in changes from libc.
2946
2947         Avoid a link-time failure on some Linux systems.
2948         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
2949         (__mon_yday): Declare with the STATIC attribute.
2950         (__mktime_internal): Likewise.
2951         Based on a report from Greg Schafer.
2952
2953 2002-11-23  Jim Meyering  <jim@meyering.net>
2954
2955         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
2956         Use `unsigned', not `int', as type of index.
2957
2958         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
2959
2960         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
2961
2962 2002-11-22  Paul Eggert  <eggert@twinsun.com>
2963
2964         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
2965         hint that one should use `if (! x) abort ();' rather than `assert
2966         (x);', and anyway it's one less thing to worry about configuring.
2967         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2968         hash_rehash, hash_insert): Use abort rather than assert.
2969
2970 2002-11-22  Paul Eggert  <eggert@twinsun.com>
2971
2972         * quotearg.h: Allow multiple inclusion by surrounding with
2973         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
2974         so that we can be included first.
2975         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
2976         * quotearg.c: Include quotearg.h immediately after config.h.
2977         No need to include stddef.h or sys/types.h any more.
2978         Surround local include files with "", not "<>".
2979         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
2980         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
2981         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
2982         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
2983         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
2984         (ISPRINT): Remove; no longer needed now that we assume C89.
2985
2986         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
2987         Preserve errno.
2988
2989         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
2990         quotearg_char): Use SIZE_MAX rather than
2991         (size_t) -1 when we are talking about "infinity".
2992
2993         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
2994
2995 2002-11-22  Bruno Haible  <bruno@clisp.org>
2996
2997         * safe-read.h: Assume C89. Add comments.
2998         (safe_read): Change return type to size_t.
2999         * safe-read.c (safe_read): Change return type to size_t. Handle byte
3000         counts > SSIZE_MAX correctly.
3001         * safe-write.h: New file.
3002         * safe-write.c: New file.
3003         * full-read.h: New file.
3004         * full-read.c: New file.
3005         * full-write.h: Assume C89. Add comments.
3006         * full-write.c: Include safe-write.h.
3007         (full_write): Rewritten to use safe_write.
3008         Suggested by Jim Meyering and Paul Eggert.
3009
3010 2002-11-21  Bruno Haible  <bruno@clisp.org>
3011
3012         Remove case insensitive option matching.
3013         * argmatch.h (argcasematch): Remove declaration.
3014         (ARGCASEMATCH): Remove macro.
3015         (__xargmatch_internal): Remove case_sensitive argument.
3016         (XARGMATCH): Update.
3017         (XARGCASEMATCH): Remove macro.
3018         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
3019         case_sensitive argument.
3020         (argcasematch): Remove function.
3021         (__xargmatch_internal): Remove case_sensitive argument.
3022         (main): Use XARGMATCH instead of XARGCASEMATCH.
3023
3024         * xmalloc.c: Change compile-time error message. Add comment about
3025         required autoconf version.
3026
3027 2002-11-21  Jim Meyering  <jim@meyering.net>
3028
3029         * strdup.c (strdup): Tweak comment and initial #if/#include.
3030
3031         Merge in changes from the coreutils.
3032
3033         2002-09-25  Paul Eggert  <eggert@twinsun.com>
3034         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
3035         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
3036         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
3037         int.  Work more efficiently if X is the same width as uintmax_t.
3038         Do not compare X to -1, to avoid bogus compiler warning.
3039         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
3040         Don't assume that f_frsize and f_bsize are the same type.
3041
3042         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
3043         on FreeBSD.
3044
3045         * makepath.c (make_path): Restore umask *before* creating the final
3046         component.
3047         (make_path): Minor reformatting.
3048
3049         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
3050         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
3051
3052         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
3053         ones.  At least on GNU/Linux systems, `auto' means something else.
3054         From Michael Stone.
3055
3056 2002-11-20  Paul Eggert  <eggert@twinsun.com>
3057
3058         Merge argmatch cleanups from Bison.  Assume C89.
3059
3060         * argmatch.c: Include config.h here, not in argmatch.h.
3061         Include stdlib.h, for EXIT_FAILURE.
3062         Always include <string.h>, since we assume C89.
3063         (EXIT_FAILURE): Remove pre-C89 bug workaround.
3064         * argmatch.h: Do not include <config.h> or <sys/types.h>.
3065         Include <stddef.h> instead, since it's all we need for size_t.
3066         (PARAMS): Remove.  All uses removed.
3067         (ARRAY_CARDINALITY): Do not bother to #undef.
3068         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
3069         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3070         Remove unnecessary parentheses.
3071         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3072         Insert necessary parentheses.
3073         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
3074         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
3075
3076 2002-11-19  Bruno Haible  <bruno@clisp.org>
3077
3078         * mbswidth.c: Include mbswidth.h right at the beginning.
3079         * mbswidth.h: Include <stddef.h>, for size_t.
3080
3081         * mbswidth.h (PARAMS): Remove macro.
3082         (mbswidth, mbsnwidth): Use ANSI C function declarations.
3083         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
3084
3085         * gcd.h (PARAMS): Remove macro.
3086         (gcd): Use ANSI C function declarations.
3087         * gcd.c (gcd): Likewise.
3088
3089 2002-11-15  Bruno Haible  <bruno@clisp.org>
3090
3091         * strcspn.c: Include <stddef.h>.
3092         (strcspn): Use ANSI C function declaration. Change return type to
3093         size_t. Use NULL.
3094         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
3095         (strpbrk): Use NULL.
3096         * strpbrk.h (PARAMS): Remove macro.
3097         (strpbrk): Use ANSI C function declaration.
3098         * strstr.c: Don't include <sys/types.h>.
3099         * strstr.h (PARAMS): Remove macro.
3100         (strstr): Use ANSI C function declarations.
3101
3102 2002-11-06  Bruno Haible  <bruno@clisp.org>
3103
3104         * gcd.h (gcd): Change argument type to 'unsigned long'.
3105         * gcd.c (gcd): Likewise.
3106
3107 2002-11-05  Bruno Haible  <bruno@clisp.org>
3108
3109         * gcd.h: New file, from gettext-0.11.5.
3110         * gcd.c: New file, from gettext-0.11.5.
3111
3112 2002-11-05  Bruno Haible  <bruno@clisp.org>
3113
3114         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3115         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3116         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3117         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3118
3119         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3120         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3121
3122         * closeout.c: Include gettext.h instead of <libintl.h>.
3123         * human.c: Include gettext.h instead of <libintl.h>.
3124         * quotearg.c: Include gettext.h instead of <libintl.h>.
3125         * rpmatch.c: Include gettext.h instead of <libintl.h>.
3126         * unicodeio.c: Include gettext.h instead of <libintl.h>.
3127         * userspec.c: Include gettext.h instead of <libintl.h>.
3128         * version-etc.c: Include gettext.h instead of <libintl.h>.
3129         * xmalloc.c: Include gettext.h instead of <libintl.h>.
3130         (textdomain): Remove definition.
3131         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
3132
3133         * long-options.c: Remove include of <libintl.h> and definition of _.
3134         * same.c: Remove include of <libintl.h> and definition of _.
3135
3136 2002-11-04  Bruno Haible  <bruno@clisp.org>
3137
3138         * stpcpy.h: New file, from GNU gettext-0.11.5.
3139         * strcase.h: New file, from GNU gettext-0.11.5.
3140         * strpbrk.h: New file, from GNU gettext-0.11.5.
3141         * strstr.h: New file, from GNU gettext-0.11.5.
3142         * xgetcwd.h: New file, from GNU gettext-0.11.5.
3143
3144 2002-05-09  Bruno Haible  <bruno@clisp.org>
3145
3146         * config.charset: Update for newest glibc. Add canonical names
3147         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
3148
3149 2002-05-09  Bruno Haible  <bruno@clisp.org>
3150
3151         * localcharset.c (get_charset_aliases): Add more Windows specific
3152         aliases.
3153
3154 2002-05-08  Owen Taylor  <otaylor@redhat.com>
3155
3156         * config.charset: A few additions for Solaris.
3157
3158 2001-12-05  Bruno Haible  <bruno@clisp.org>
3159
3160         * localcharset.c (locale_charset): Don't return an empty string.
3161
3162 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
3163
3164         * config.charset: msdos in uk_UA uses CP1125.
3165
3166 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
3167
3168         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
3169         * localcharset.c (locale_charset): Declare as extern "C".
3170
3171 2002-02-15  Bruno Haible  <bruno@clisp.org>
3172
3173         * config.charset [msdosdjgpp]: For Russian, use CP866.
3174
3175 2002-02-11  Bruno Haible  <bruno@clisp.org>
3176
3177         * config.charset: Add support for NetBSD.
3178
3179 2002-09-25    <karl@gnu.org>
3180
3181         * strdup.c: copy from libc/string (via ../config/srclist*).
3182         * getopt*: copy from libc/posix.
3183         * gettext.h: copy from gettext.
3184         * .cppi-disable: add strdup.c, gettext.h.
3185
3186 2002-07-01  Jim Meyering  <meyering@lucent.com>
3187
3188         * c-stack.c: Include sys/time.h.
3189         From Volker Borchert.
3190
3191 2002-06-11  Paul Eggert  <eggert@twinsun.com>
3192
3193         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
3194         New macro.  Use it uniformly instead of
3195         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
3196         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
3197         reported by Vin Shelton.
3198
3199 2002-06-22  Jim Meyering  <meyering@lucent.com>
3200
3201         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
3202         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
3203
3204 2002-06-22  Paul Eggert  <eggert@twinsun.com>
3205
3206         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
3207         Do not assume SA_SIGINFO behavior.
3208         Bug reported by Jim Meyering on NetBSD 1.5.2.
3209
3210 2002-06-22  Jim Meyering  <meyering@lucent.com>
3211
3212         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
3213
3214         * exitfail.c, exitfail.h: Likewise.
3215         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
3216
3217         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
3218         of fnmatch.h.
3219         (EXTRA_DIST): Add fnmatch_loop.c.
3220         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
3221
3222         * fnmatch_loop.c: New file, from diffutils-2.8.2.
3223         * fnmatch.c: Update from diffutils-2.8.2.
3224         * fnmatch_.h: New file.  From diffutils-2.8.2.
3225         * fnmatch.h: Remove file.
3226
3227 2002-06-18  Paul Eggert  <eggert@twinsun.com>
3228
3229         * file-type.h: Report an error if neither S_ISREG nor
3230         S_IFREG is defined, instead of using a test specific to glibc
3231         2.2.  This should be safe, since POSIX requires S_ISREG and
3232         Unix Version 7 had S_IFREG.  We don't need to check for
3233         <sys/types.h> since we don't use any symbols that it defines.
3234
3235 2002-06-15  Jim Meyering  <meyering@lucent.com>
3236
3237         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
3238         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
3239         have been included before this file.
3240
3241 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
3242
3243         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
3244         so that each temporary file name is unique and valid in the first
3245         8 characters, for operation under DOS.
3246
3247 2002-06-15  Jim Meyering  <meyering@lucent.com>
3248
3249         Work even with DJGPP 2.03, which lacks support for symlinks.
3250         From Richard Dawe.
3251         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
3252         is defined.
3253         * lchown.c (S_ISLNK): Likewise.
3254
3255 2002-06-14  Jim Meyering  <meyering@lucent.com>
3256
3257         * file-type.h: Use the version from diffutils-2.8.2.
3258         * file-type.c: Likewise.
3259
3260 2002-05-27  Jim Meyering  <meyering@lucent.com>
3261
3262         Fix a problem seen only on nonconforming systems whereby ls.c's
3263         use of localtime, and then of gettimeofday would cause trouble:
3264         the localtime call used to initialize rpl_gettimeofday's save
3265         mechanism would clobber ls's current local time information so
3266         that in any long listing the first file would always be listed
3267         with date 1970-01-01.  Analysis by Volker Borchert.
3268
3269         * gettimeofday.c (localtime): Undefine.
3270         (rpl_localtime): New function.
3271
3272 2002-05-22  Jim Meyering  <meyering@lucent.com>
3273
3274         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
3275         * file-type.h: New file.
3276         * file-type.c (file_type): New file/function.  Extracted from diffutils.
3277
3278 2002-04-29  Paul Eggert  <eggert@twinsun.com>
3279
3280         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
3281
3282 2002-04-28  Paul Eggert  <eggert@twinsun.com>
3283
3284         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
3285         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
3286         of 127, since 64 is the largest conceivable number for ancient
3287         nonstandard hosts.
3288         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
3289
3290 2002-04-28  Jim Meyering  <meyering@lucent.com>
3291
3292         * sig2str.c (WTERMSIG): Remove definition (unused).
3293
3294 2002-04-28  Paul Eggert  <eggert@twinsun.com>
3295
3296         * sig2str.h, sig2str.c: New files.
3297         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
3298
3299 2002-04-24  Jim Meyering  <meyering@lucent.com>
3300
3301         * gettext.h: New file, from Gettext.
3302         * Makefile.am (INCLUDES): Remove -I../intl.
3303         (libfetish_a_SOURCES): Add gettext.h.
3304
3305 2002-04-16  Jim Meyering  <meyering@lucent.com>
3306
3307         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
3308         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
3309         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
3310
3311 2002-04-12  Jim Meyering  <meyering@lucent.com>
3312
3313         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
3314
3315 2002-03-10  Jim Meyering  <meyering@lucent.com>
3316
3317         * makepath.c (make_path): Remove a comma from a diagnostic.
3318         Suggestion from Santiago Vila.
3319
3320 2002-03-08  Jim Meyering  <meyering@lucent.com>
3321
3322         * rename.c: Mention that this wrapper is needed also on
3323         mips-dec-ultrix4.4 systems.
3324
3325 2002-03-02  Jim Meyering  <meyering@lucent.com>
3326
3327         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
3328         not HAVE_CLOCK_SETTIME.
3329
3330 2002-02-27  Paul Eggert  <eggert@twinsun.com>
3331
3332         * nanosleep.h: Rename to....
3333         * timespec.h: New name for nanosleep.h.  All uses changed.
3334
3335         * gettime.c: New file.
3336         * settime.c: New file.
3337         * stime.c: Remove.
3338
3339         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
3340         timespec.h.  Remove nanosleep.h.
3341
3342 2002-02-25  Paul Eggert  <eggert@twinsun.com>
3343
3344         * acl.c, acl.h: New files.
3345         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
3346
3347 2002-02-24  Jim Meyering  <meyering@lucent.com>
3348
3349         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
3350         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
3351         cause trouble.  Reported by Nelson Beebe.
3352
3353 2002-02-23  Paul Eggert  <eggert@twinsun.com>
3354
3355         * path-concat.c (xpath_concat): Reorder code to pacify
3356         compilers that don't know that xalloc_die never returns.
3357
3358 2002-02-20  Jim Meyering  <meyering@lucent.com>
3359
3360         * getdate.c: Regenerate using bison-1.33.
3361
3362 2002-02-15  Paul Eggert  <eggert@twinsun.com>
3363
3364         * posixver.c, posixver.h: New files.
3365         * Makefile.am (libfetish_a_SOURCES): Add them.
3366
3367 2002-02-02  Paul Eggert  <eggert@twinsun.com>
3368             Bruno Haible  <bruno@clisp.org>
3369
3370         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
3371         (fwrite_success_callback): New declaration.
3372         * unicodeio.c (unicode_to_mb): New function, extracted from
3373         print_unicode_char. Call failure callback instead of error.
3374         (fwrite_success_callback): New function.
3375         (exit_failure_callback): New function.
3376         (fallback_failure_callback): New function.
3377         (print_unicode_char): Call unicode_to_mb.
3378
3379 2002-01-26  Jim Meyering  <meyering@lucent.com>
3380
3381         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
3382
3383 2002-01-22  Jim Meyering  <meyering@lucent.com>
3384
3385         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
3386         Otherwise, some versions of automake would omit the rule that makes
3387         Makefile from Makefile.in.
3388
3389 2001-01-21  Paul Eggert  <eggert@twinsun.com>
3390
3391         * xmemcoll.h, xmemcoll.c: New files.
3392         * Makefile.am (libfetish_a_SOURCES): Add them.
3393         * memcoll.c: Include errno.h, and declare errno if not defined.
3394         (memcoll): Set errno to zero if there is no error.
3395
3396         * quotearg.c (quotearg_buffer_restyled):
3397         Fix bug with quoting buffers containing NUL when backslashing escapes.
3398         This bug was exposed by the other changes in this patch.
3399         (quotearg_n_options): New arg ARGSIZE.
3400         All callers changed.
3401         (quoting_options_from_style): New function.
3402         (quotearg_n_style): Use it.
3403         (quotearg_n_style_mem): New function.
3404
3405         * quotearg.h (quotearg_n_style_mem): New function.
3406
3407 2002-01-16  Jim Meyering  <meyering@lucent.com>
3408
3409         * getdate.y: Add three semicolons, each just before a closing brace.
3410         Bison (as of version 1.31) no longer papers over that mistake.
3411
3412 2002-02-14  Paul Eggert  <eggert@twinsun.com>
3413
3414         * backupfile.c (ISDIGIT): Comment fix.
3415         * getdate.y (ISDIGIT): Likewise.
3416         * posixtm.c (ISDIGIT, year): Likewise.
3417         * strverscmp.c (ISDIGIT): Likewise.
3418         * userspec.c (ISDIGIT): Likewise.
3419
3420 2002-01-05  Jim Meyering  <meyering@lucent.com>
3421
3422         * version-etc.c (version_etc_copyright): Update copyright year.
3423
3424 2001-01-19  Paul Eggert  <eggert@twinsun.com>
3425
3426         * closeout.c (close_stdout_status): If ferror (stdout), do
3427         not silently exit merely because the output buffer happens to
3428         have nothing pending.
3429
3430 2001-12-18  Paul Eggert  <eggert@twinsun.com>
3431
3432         See the big note in ../ChangeLog.
3433         * human.c (suffixes): Prefer K to k for 1024.
3434         (generate_suffix_backwards): New function.
3435         (human_readable_inexact): Use it.
3436         * xstrtol.c (__xstrtol): If there is no number but there
3437         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
3438         Accept 'K' as well as 'k'.
3439
3440 2001-12-15  Jim Meyering  <meyering@lucent.com>
3441
3442         * regex.h (__restrict_arr): Update from libc.
3443
3444         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
3445         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
3446         (STREQ): Define.
3447
3448 2001-12-10  Jim Meyering  <meyering@lucent.com>
3449
3450         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
3451         Instead, include "xalloc.h".
3452         (initbuffer): Don't cast xmalloc return value to char*.
3453         (readline): Reword comment.
3454         Don't cast xrealloc return value to char*
3455         Return NULL, not 0.
3456
3457 2001-12-09  Jim Meyering  <meyering@lucent.com>
3458
3459         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
3460         `signed and unsigned type in conditional expression'.
3461         * posixtm.c (posix_time_parse): Likewise.
3462
3463         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
3464
3465         * readtokens.c (readtoken): Declare an index to be of type unsigned
3466         to avoid a pedantic warning.
3467
3468         * getstr.c: Don't include assert.h.
3469         (getstr): Remove warning-evoking assertions.
3470         Return -1 if offset parameter is out of bounds.
3471         Change the type of a local from int to size_t.
3472
3473         * strftime.c (my_strftime_localtime_r): Include this function
3474         definition in the `#if ! HAVE_TM_GMTOFF' block.
3475
3476         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
3477         Include xalloc.h instead.
3478
3479 2001-12-02  Jim Meyering  <meyering@lucent.com>
3480
3481         * tempname.c: Don't declare getenv, thus reverting the change of
3482         2001-11-18.  It's no longer necessary, now that stdlib.h is always
3483         included.
3484
3485         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
3486         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
3487
3488 2001-11-30  Akim Demaille  <akim@epita.fr>
3489
3490         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
3491         before being defined.
3492
3493 2001-11-27  Paul Eggert  <eggert@twinsun.com>
3494
3495         * quotearg.h (quotearg_n, quotearg_n_style):
3496         First arg is int, not unsigned.
3497         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
3498         (SIZE_MAX, UINT_MAX): New macros.
3499         (quotearg_n_options): Abort if N is negative.
3500         Avoid overflow check on hosts where size_t is 64 bits and int
3501         is 32 bits, as overflow is impossible there.
3502         Fix off-by-one typo that caused unnecessary reallocation.
3503
3504 2001-11-27  Jim Meyering  <meyering@lucent.com>
3505
3506         * tempname.c: Merge with version from libc.
3507         * regex.c: Likewise.
3508
3509         * tempname.c: Include stdlib.h unconditionally.  On some old systems
3510         for which STDC_HEADERS is 0, it was not included, resulting in a
3511         warning about an integer-to-pointer conversion problem with getenv.
3512         Reported by Volker Borchert.
3513
3514 2001-11-26  Jim Meyering  <meyering@lucent.com>
3515
3516         * gtod.h: Remove file.
3517         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
3518         * gettimeofday.c: Don't include gtod.h.
3519         (GTOD_init): Remove function.
3520         (rpl_gettimeofday): Do its job here instead, rather than aborting.
3521         Suggestion from Volker Borchert.
3522
3523 2001-11-23  Jim Meyering  <meyering@lucent.com>
3524
3525         * hash.h (struct hash_table): Don't define here.  Merely declare it.
3526         * hash.c (struct hash_table): Define it here instead.
3527
3528 2001-11-22  Jim Meyering  <meyering@lucent.com>
3529
3530         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
3531
3532 2001-11-18  Paul Eggert  <eggert@twinsun.com>
3533
3534         * tempname.c (TMP_MAX): Remove; no longer needed.
3535         (TEMPORARIES): New macro.
3536         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
3537         removes an artificial limitation (e.g. HP-UX 10.20, where
3538         TMP_MAX is 17576).
3539
3540 2001-11-18  Jim Meyering  <meyering@lucent.com>
3541
3542         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
3543         on SunOS 4.
3544
3545         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
3546         files will be created before anything else.
3547
3548 2001-11-17  Jim Meyering  <meyering@lucent.com>
3549
3550         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
3551         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
3552         rather than group writable.  Patch by Juan F. Codagnone.
3553
3554         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
3555         Instead, include "xalloc.h".
3556
3557         * mountlist.c: Include unlocked-io.h after all system headers.
3558         Remove explicit declarations of xmalloc, xrealloc,
3559         and xstrdup.  Instead, include "xalloc.h".
3560
3561         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
3562         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
3563         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
3564
3565         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
3566         Reported by Padraig Brady.
3567
3568         * mkstemp.c: #undef mkstemp.
3569         Include config.h.
3570         (rpl_mkstemp): Rename from mkstemp.
3571         Protoize.
3572
3573 2001-11-16  Jim Meyering  <meyering@lucent.com>
3574
3575         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
3576         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
3577         determine the amount of total physical memory, use pstat_getstatic.
3578         HPUX-11 doesn't define _SC_PHYS_PAGES.
3579         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
3580         If sysconf couldn't be used to determine the amount of available
3581         physical memory, use both pstat_getstatic and pstat_getdynamic.
3582         Based on a patch from Bob Proulx.
3583
3584 2001-11-05  Jim Meyering  <meyering@lucent.com>
3585
3586         * xstat.in (slash_aware_lstat): Correct a misleading comment.
3587
3588 2001-11-03  Jim Meyering  <meyering@lucent.com>
3589
3590         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
3591         in argmatch_to_argument call.
3592
3593         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
3594         argument.
3595
3596         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
3597         e.g., a fault due to an attempt to free a NULL pointer.
3598
3599 2001-11-01  Jim Meyering  <meyering@lucent.com>
3600
3601         * dirfd.c, dirfd.h: New files.
3602         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
3603
3604         * hash.c (hash_print) [TESTING]: Clean up.
3605
3606 2001-10-22  Paul Eggert  <eggert@twinsun.com>
3607
3608         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
3609         to avoid a warning if -Wall.
3610
3611 2001-10-21  Paul Eggert  <eggert@twinsun.com>
3612
3613         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
3614
3615 2001-10-21  Jim Meyering  <meyering@lucent.com>
3616
3617         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
3618         this code would end up calling gettext even in packages built
3619         with --disable-nls.
3620         * getopt.c (_): Likewise.
3621         * regex.c (_): Likewise.
3622
3623 2001-10-20  Paul Eggert  <eggert@twinsun.com>
3624
3625         * error.c (strerror_r): Do not declare unless !_LIBC.
3626         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
3627         Use strerror_r that is only a macro, even if it is not a function.
3628         (strerror): Check for HAVE_DECL_STRERROR before declaring.
3629         (private_strerror): Use prototypes, not old-style function definition.
3630         (print_errno_message): New function.
3631         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
3632         char*-flavored one.
3633         (error_tail, error, error_at_line): Use it.
3634
3635 2001-10-11  Jim Meyering  <meyering@lucent.com>
3636
3637         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3638         and quote_n (1, ... to avoid clobbering a buffer.
3639
3640 2001-10-05  Jim Meyering  <meyering@lucent.com>
3641
3642         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
3643         * hash-pjw.c: New file (factored out of fileutils' remove.c).
3644         * hash-pjw.h: New file.
3645
3646 2001-09-30  Jim Meyering  <meyering@lucent.com>
3647
3648         * mountlist.c [MOUNTED_GETFSSTAT]:
3649         Include <sys/ucred.h>, for Apple Darwin.
3650         Include sys/mount.h and sys/fs_types.h only if available.
3651         (FS_TYPE): Define.
3652         (read_filesystem_list): Use FS_TYPE.
3653
3654 2001-09-29  Paul Eggert  <eggert@twinsun.com>
3655
3656         * exclude.c (excluded_filename): 0 -> false, since it's
3657         a boolean context.
3658
3659 2001-09-28  Paul Eggert  <eggert@twinsun.com>
3660
3661         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
3662         #defines strtoimax.  Also treat the other strto* functions
3663         like strtoimax.
3664
3665         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
3666         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
3667         (strtoimax, strtoumax): Do not declare if already defined as a macro.
3668
3669 2001-09-26  Jim Meyering  <meyering@lucent.com>
3670
3671         Most macros in unlocked-io.h had the wrong number of arguments.
3672         * gen-uio: New script.
3673         (USE_UNLOCKED_IO): Define to 1 if not already defined.
3674         * unlocked-io.hin: Remove file.
3675         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
3676         rather than trying to embed it here.
3677         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
3678         Reported by Padraig Brady.
3679
3680 2001-09-25  Volker Borchert  <bt@teknon.de>
3681
3682         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
3683
3684 2001-09-23  Jim Meyering  <meyering@lucent.com>
3685
3686         * mountlist.c: Remove useless parentheses in #if directives.
3687         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
3688         the deprecated MOUNTED symbol is no longer defined in mntent.h.
3689
3690 2001-09-22  Jim Meyering  <meyering@lucent.com>
3691
3692         * localcharset.c: Update from latest gettext.
3693         * config.charset: Likewise.
3694
3695 2001-09-20  Jim Meyering  <meyering@lucent.com>
3696
3697         * xstrtol.c (strtoimax): Guard declaration with
3698         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3699         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3700         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3701         (strtoumax): Likewise, for completeness (it wasn't necessary).
3702
3703 2001-09-06  Paul Eggert  <eggert@twinsun.com>
3704
3705         * strtoimax.c (HAVE_LONG_LONG):
3706         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
3707         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
3708         to work around bug in IBM C compiler.
3709
3710 2001-09-16  Jim Meyering  <meyering@lucent.com>
3711
3712         * mkdir.c: New file.
3713
3714 2001-09-04  Paul Eggert  <eggert@twinsun.com>
3715
3716         * xgetcwd.c: Revert some of the previous change; intead,
3717         fix the HAVE_GETCWD_NULL code to behave more like the
3718         !HAVE_GETCWD_NULL code used to.
3719
3720         Include "xalloc.h".
3721         (xgetcwd): Do not return NULL when memory is exhausted; instead,
3722         invoke xalloc_die.
3723
3724 2001-09-04  Paul Eggert  <eggert@twinsun.com>
3725
3726         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
3727         Use ssize_t, not int, to store result of readlink.
3728         Check for ssize_t overflow as well as size_t overflow,
3729         as POSIX says the result of readlink is implementation-defined
3730         when ssize_t overflows.
3731         Remove unnecessary cast to char*.
3732         Use free+malloc instead of realloc, as the storage doesn't need
3733         to be preserved and it's clearer and can be more efficient that way.
3734         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
3735         * xreadlink.h (xreadlink): Update prototype.
3736
3737 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3738
3739         * exclude.c (fnmatch_no_wildcards): Fix confusion between
3740         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
3741         spotted by Jim Meyering.
3742
3743 2001-09-03  Jim Meyering  <meyering@lucent.com>
3744
3745         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
3746
3747 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3748
3749         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
3750         like the HAVE_GETCWD_NULL code.
3751         Include pathmax.h if not HAVE_GETCWD.
3752         Do not include xalloc.h.
3753         (INITIAL_BUFFER_SIZE): New symbol.
3754         Do not use xmalloc / xrealloc, since the caller is responsible for
3755         handling errors.  Preserve errno around `free' during failure.
3756         Do not overrun buffer when using getwd.
3757
3758 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3759
3760         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
3761         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
3762
3763 2001-09-02  Jim Meyering  <meyering@lucent.com>
3764
3765         * error.c: Update from GNU libc.
3766
3767 2001-09-01  Jim Meyering  <meyering@lucent.com>
3768
3769         * xreadlink.c: New file.
3770         * xreadlink.h: New file.
3771         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
3772
3773         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
3774         doesn't conflict with sparc Solaris 7's definition in
3775         /usr/include/sys/int_types.h.
3776
3777         * exclude.c: Use `""', not `<>' to #include non-system header files.
3778         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3779         and strncasecmp as r-values.  Unixware didn't have declarations.
3780
3781 2001-08-31  Jim Meyering  <meyering@lucent.com>
3782
3783         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3784         Use an initial, malloc'd, buffer of length 128 rather than
3785         a statically allocated one of length 1024.
3786
3787 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3788
3789         * xgetcwd.c: Don't include pathmax.h.
3790         Include stdlib.h and unistd.h if available.
3791         Include xalloc.h.
3792         (xmalloc, xstrdup, free): Remove decls.
3793         (xgetcwd): Don't assume sizes fit in unsigned.
3794         Check for overflow when computing sizes.
3795         Simplify reallocation code.
3796
3797 2001-08-28  Paul Eggert  <eggert@twinsun.com>
3798
3799         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
3800
3801         * strtoimax.c: Renamed from strtoxmax.c, removing the
3802         old strtoimax.c.
3803
3804         Also, make the following further changes to make this file's
3805         configuration more similar to that of strtol.c:
3806         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
3807         (strtoumax, uintmax_t, strtoull, strtol): Remove.
3808         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
3809         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
3810         changed to signed values.
3811
3812         And make the following changes as well:
3813         Fix copyright notice, as 1999 was missing.
3814         (verify): New macro.
3815         (strtoimax): Check sizes at compile-time, not run-time.
3816         Prefer strtol to strtoll if both work.
3817         (main): Remove; it was not that useful and was a pain to maintain.
3818
3819         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
3820
3821 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3822
3823         * savedir.c (savedir): Remove size parameter, as POSIX says that
3824         a directory's st_size can have an arbitrary value, so the old
3825         usage could waste an arbitrary amount of memory.  All uses
3826         changed.
3827         * savedir.h: Update prototype.
3828
3829 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3830
3831         * xstrtol.c (strtoimax): New decl.
3832
3833 2001-08-28  Paul Eggert  <eggert@twinsun.com>
3834
3835         * xstrtol.h: Add copyright notice.
3836         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
3837         LONGINT_INVALID_SUFFIX_CHAR.
3838
3839 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3840
3841         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
3842         tm to be declared.
3843
3844 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3845
3846         * hash.c: Remove '2001' from copyright notice.
3847
3848 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3849
3850         * full-write.h: New file.
3851         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
3852         * full-write.c: Correct credits, as cccp.c no longer
3853         exists and anyway it was so heavily changed from the old cccp
3854         code as to be unrecognizable.  Include full-write.h.
3855         (full_write) Return size_t, with short writes meaning failure.
3856         All callers changed.  This fixes a bug with large buffers
3857         on 64-bit hosts.
3858         * utime.c: Include full-write.h.
3859
3860 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3861
3862         Merge 'exclude' changes from tar 1.13.22.
3863         This fixes one or two unlikely storage allocation overflow bugs,
3864         but doesn't change user-visible behavior otherwise.
3865
3866 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3867
3868         * exclude.c (bool): Declare, perhaps by including stdbool.h.
3869         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
3870         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
3871         Include if available.
3872         (<xalloc.h>): Include
3873         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
3874         (verify): New macro.  Use it to verify that EXCLUDE macros do not
3875         collide with FNM macros.
3876         (struct patopts): New struct.
3877         (struct exclude): Use it, as exclude patterns now come with options.
3878         (new_exclude): Support above changes.
3879         (new_exclude, add_exclude_file):
3880         Initial size must now be a power of two to simplify overflow checking.
3881         (free_exclude, fnmatch_no_wildcards): New function.
3882         (excluded_filename): No longer requires options arg, as the options
3883         are determined by add_exclude.  Now returns bool, not int.
3884         (excluded_filename, add_exclude):
3885         Add support for the fancy new exclusion options.
3886         (add_exclude, add_exclude_file): Now takes int options arg.
3887         Check for arithmetic overflow when computing sizes.
3888         (add_exclude_file): xrealloc might modify errno, so don't
3889         realloc until after errno might be used.
3890
3891         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
3892         New macros.
3893         (free_exclude): New decl.
3894         (add_exclude, add_exclude_file): Now takes int options arg.
3895         (excluded_filename): No longer requires options arg, as the options
3896         are determined by add_exclude.  Now returns bool, not int.
3897
3898 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3899
3900         * alloca.c (alloca): Arg is of type size_t, not unsigned.
3901
3902 2001-08-27  Jim Meyering  <meyering@lucent.com>
3903
3904         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
3905
3906         * version-etc.c (N_): Remove definition.
3907         Revert most of last change.
3908         Instead, simply don't mark the `Copyright...' string for translation.
3909         Based on advice from Paul Eggert.
3910
3911         * strtoxmax.c: Tweak comment.
3912
3913 2001-08-26  Jim Meyering  <meyering@lucent.com>
3914
3915         * version-etc.c (version_etc_copyright_fmt): Replace literal year
3916         of copyright with `%s' so translators don't get an untranslated
3917         message in 2002.
3918         (COPYRIGHT_YEAR): Define.
3919         (version_etc): Use fprintf rather than fputs.
3920         Suggestion from Ulrich Drepper.
3921
3922         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
3923
3924         * strtoll.c: New file, from GNU libc.
3925         * xstrtoimax.c: New file.
3926
3927         * xstrtol.h: Add xstrtoimax.
3928         * strtoumax.c: New file.  Simply include "strtoumax.c".
3929         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
3930
3931         * strtoumax.c: Factor to work both for unsigned and signed types, ...
3932         * strtoxmax.c: ... then renamed to this.
3933
3934 2001-08-13  Paul Eggert  <eggert@twinsun.com>
3935
3936         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
3937         Port to Solaris 8, where 'sed' requires a space after the 'r'
3938         command, and where sh dislikes "$/".  Clean up the spacing a bit.
3939         Redirect output to $tmp just once.
3940
3941 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
3942
3943         * addext.c (<errno.h>): Include.
3944         (errno): Declare if not defined.
3945         (addext): Work correctly when pathconf returns -1 and leaves
3946         errno alone because there is no limit.  Also, work even if
3947         pathconf returns a value greater than SIZE_MAX.
3948
3949 2001-08-12  Jim Meyering  <meyering@lucent.com>
3950
3951         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
3952         Simply `return getcwd (NULL, 0);'.
3953         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
3954         Use 1300 as initial value for length, not PATH_MAX.
3955
3956         * pathmax.h: Clean up cpp syntax.
3957
3958 2001-08-12  Jim Meyering  <meyering@lucent.com>
3959
3960         * gettimeofday.c: New file.
3961         * gtod.h: New file.
3962         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
3963
3964 2001-08-04  Jim Meyering  <meyering@lucent.com>
3965
3966         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
3967         to get in sync with glibc.
3968
3969 2001-08-03  Paul Eggert  <eggert@twinsun.com>
3970
3971         The following changes are from gettext 0.10.39 as maintained by
3972         Bruno Haible.
3973
3974         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
3975         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
3976         with inverted sense.  All uses changed.
3977
3978         * mbswidth.c: Don't include <limits.h>.
3979         Include <stdlib.h> and <string.h> unconditionally.
3980         (iswcntrl, mbsinit, ISCNTRL): New macros.
3981         (mbsnwidth): Use K&R style function declarations.
3982         Don't bother checking for MB_LEN_MAX == 1, since the compiler
3983         can optimize it when MB_CUR_MAX == 1.
3984         The width of control characters is zero, not 1.
3985
3986 2001-07-15  Jim Meyering  <meyering@lucent.com>
3987
3988         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
3989         (BUILT_SOURCES): Add unlocked-io.h.
3990         (io_functions): Define.
3991         (unlocked-io.h): New rule.
3992         (DISTCLEANFILES): Add unlocked-io.h.
3993         (all-local): Depend on unlocked-io.h, to ensure it is created.
3994
3995         * unlocked-io.hin: New file
3996
3997         * regex.c: Update from glibc.
3998
3999 2001-07-05  Jim Meyering  <meyering@lucent.com>
4000
4001         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
4002         recommendation.
4003         (libfetish_a_SOURCES): Put all .h files here instead.
4004         Remove a thus-exposed (better checks in automake) duplicate and
4005         two unnecessary .h files.
4006
4007 2001-06-11  Jim Meyering  <meyering@lucent.com>
4008
4009         * regex.c: Update from GNU libc.
4010
4011 2001-05-27  Jim Meyering  <meyering@lucent.com>
4012
4013         * readutmp.h (UT_TYPE): Define.
4014
4015 2001-05-24  Jim Meyering  <meyering@lucent.com>
4016
4017         * argmatch.c: Include "quote.h".
4018         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
4019         quote function.  Reported by Göran Uddeborg.
4020
4021 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
4022
4023         * dirname.c (dir_name): Compute append_dot using path, not newpath
4024         which is not yet declared.
4025
4026 2001-05-11  Paul Eggert  <eggert@twinsun.com>
4027
4028         * Makefile.am (libfetish_a_SOURCES):
4029         Add strftime.c, since we now compile it on all hosts.
4030
4031         * strftime.c (my_strftime):
4032         Define to nstrftime if emacs, but only if my_strftime is not defined.
4033         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
4034         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
4035         Add one more extra argument: a nanoseconds value.
4036         All uses changed.
4037         (ns): New macro.
4038         (my_strftime function): Add %N format.
4039         (emacs_strftimeu): Renamed from emacs_strftime,
4040         with extra ut argument.
4041
4042 2001-05-11  Paul Eggert  <eggert@twinsun.com>
4043
4044         dirname code cleanup.  base_name now behaves more compatibly
4045         with POSIX basename when given file names that have trailing
4046         slashes, and similarly for dir_name.  Add new primitives
4047         base_len and dir_len.  Put the directory-name-related decls
4048         into dirname.h.
4049
4050         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
4051         * backupfile.c (base_name): Likewise.
4052         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
4053         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
4054         * makepath.c (strip_trailing_slashes): Likewise.
4055         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
4056         Likewise.
4057         * rename.c (strip_trailing_slashes): Likewise.
4058         * same.c (base_name): Likewise.
4059         * stripslash.c (ISSLASH): Likewise.
4060
4061         * addext.c: Include <dirname.h> after size_t is defined.
4062         * backupfile.c: Likewise.
4063
4064         * addext.c (addext): Use base_len to trim redundant
4065         trailing slashes instead of doing it ourselves.
4066         But do not trim the last slash if it is not redundant.
4067
4068         * backupfile.c (find_backup_file_name,
4069         max_backup_version): Use base_len instead of rolling it ourselves.
4070         Handle the case of "" and (on DOS) "C:" correctly.
4071
4072         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
4073         Include <string.h>, <dirname.h>.
4074         (base_name): Allow file names ending in slashes, other than names
4075         that are all slashes.  In this case, return the basename followed
4076         by the slashes.  This is more general, and can be used in places
4077         where the original base_name purposely had an assertion failure.
4078         (base_len): New function.
4079
4080         * dirname.c: Include <string.h> instead of <stdlib.h>.
4081         Do not include <assert.h>; no longer needed.
4082         Include xalloc.h.
4083         (memrchr): Remove decl.
4084         (dir_name_r): Remove.
4085         (dir_len): Renamed from dirlen.  All callers changed.
4086         Rewrite in terms of base_name, for simplicity and consistency.
4087         (dir_name): Never return NULL.  All callers changed.
4088         Do not include <stdlib.h> in test program; no longer needed.
4089         return 0; is fine for test program.
4090
4091         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
4092         New macros.
4093         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
4094
4095         * path-concat.c (path_concat): Use base_len to compute
4096         base length, not strlen; this means we cannot rely on memcpy
4097         to null-terminate.
4098
4099         * same.c (STREQ): Remove.
4100         (same_name): Handle the case where the basename ends in trailing '/'.
4101
4102         * stripslash.c (strip_trailing_slashes): Return nonzero if
4103         a slash was stripped.  Do not strip the last slash after a
4104         file system prefix.
4105
4106 2001-04-08  Jim Meyering  <meyering@lucent.com>
4107
4108         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
4109         recomputed; that's necessary when the offset spans a DST transition.
4110         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
4111
4112 2001-04-02  Jim Meyering  <meyering@lucent.com>
4113
4114         * regex.h, regex.c: Update from GNU libc.
4115
4116 2001-03-19  Paul Eggert  <eggert@twinsun.com>
4117
4118         * version-etc.c (version_etc_copyright): Update to 2001.
4119
4120 2001-03-16  Paul Eggert  <eggert@twinsun.com>
4121
4122         * tempname.c (uint64_t): Define to uintmax_t if
4123         not defined, and if UINT64_MAX is not defined.
4124         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
4125         Reported by John David Anglin.
4126
4127 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
4128
4129         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
4130         alias if codeset is empty.
4131         * config.charset (BeOS): Use wildcard syntax.
4132
4133 2001-03-13  Jim Meyering  <meyering@lucent.com>
4134
4135         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
4136         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
4137         From Bruno Haible.
4138
4139 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
4140
4141         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
4142         Don't return NULL.
4143         * unicodeio.c (print_unicode_char): Simplify accordingly.
4144
4145 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
4146
4147         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
4148         support for DOS/DJGPP.
4149
4150 2001-02-28  Paul Eggert  <eggert@twinsun.com>
4151
4152         * Makefile.am (libfetish_a_SOURCES):
4153         Add dup-safer.c, fopen-safer.c.
4154         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
4155
4156         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
4157
4158 2001-02-25  Paul Eggert  <eggert@twinsun.com>
4159
4160         The mkstemp replacement is taken from glibc 2.2.2, with some
4161         portability fixes for use outside glibc, as follows:
4162
4163         * tempname.c (struct_stat64): New macro.
4164         (direxists, __gen_tempname): Use it.
4165         This avoids a portability problem with Solaris 8.
4166
4167         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
4168         (<stddef.h>, <stdint.h>, <string.h>):
4169         Include only if STDC_HEADERS || _LIBC.
4170         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
4171         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
4172         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
4173         (__set_errno): Define this macro if <errno.h> doesn't.
4174         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
4175         Define these macros if <stdio.h> doesn't.
4176         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
4177         Define these macros if <sys/stat.h>
4178         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
4179         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
4180         __xstat64): Define if not _LIBC.
4181         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
4182         (__gen_tempname): Invoke gettimeofday only if
4183         HAVE_GETTIMEOFDAY || _LIBC;
4184         otherwise, fall back on plain "time".
4185         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
4186
4187         * mkstemp.c (__GT_FILE): Define to zero if not defined.
4188
4189         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
4190
4191 2001-02-17  Jim Meyering  <meyering@lucent.com>
4192
4193         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
4194         around included file name.
4195
4196         * strnlen.c (__strnlen): Merge in a change from GNU libc.
4197
4198         * strftime.c: Update from GNU libc (the only changes were to comments).
4199
4200 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
4201
4202         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
4203
4204 2001-02-17  Paul Eggert  <eggert@twinsun.com>
4205
4206         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
4207         Remove workaround macros for hosts that have mbrtowc but not
4208         mbstate_t, as we now insist on proper declarations for both
4209         before using mbrtowc.
4210
4211 2001-02-17  Jim Meyering  <meyering@lucent.com>
4212
4213         * regex.c: Update from libc.
4214
4215 2001-02-16  Paul Eggert  <eggert@twinsun.com>
4216
4217         * alloca.c (malloc): Undef before defining, since stdlib.h
4218         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
4219         Reported by Mark Hounschell via Paul Eggert.
4220
4221 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
4222
4223         * config.charset: Update for FreeBSD 4.2.
4224
4225 2001-01-26  Jim Meyering  <meyering@lucent.com>
4226
4227         * quotearg.c: Include stddef.h.
4228         * quote.c: Include stddef.h.
4229         Reported by Axel Kittenberger.
4230
4231         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
4232         line in double quotes so that it evokes a better diagnostic.
4233         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
4234         Reported by Axel Kittenberger.
4235
4236 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
4237
4238         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
4239         to avoid a warning.  Add back 'const' to inptr.
4240
4241 2001-01-16  Jim Meyering  <meyering@lucent.com>
4242
4243         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
4244         From Bruno Haible.
4245
4246 2001-01-14  Jim Meyering  <meyering@lucent.com>
4247
4248         * rename.c: New file.  From Volker Borchert.
4249         Include stdlib.h, string.h or strings.h, and xalloc.h.
4250         Use strip_trailing_slashes rather than open-coding it.
4251
4252 2001-01-03  Paul Eggert  <eggert@twinsun.com>
4253
4254         * strftime.c: Sync with glibc time/strftime.c 1.81.
4255
4256 2001-01-03  Jim Meyering  <meyering@lucent.com>
4257
4258         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
4259         local `inptr' to avoid warning with some system declarations of iconv.
4260
4261 2000-12-29  Paul Eggert  <eggert@twinsun.com>
4262
4263         * modechange.c: Do not assume that mode_t uses the
4264         traditional octal encoding.  E.g. "chmod 1 FOO" should set
4265         the other-execute bit of FOO even if S_IXOTH != 1.
4266
4267         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
4268         WOTH, XOTH, ALLM): New macros.
4269         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
4270          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
4271         Use them.
4272         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
4273         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
4274         (mode_compile):
4275         No need to use uintmax_t; unsigned long is long enough.
4276         Don't bother to get suffix since we don't use it.
4277
4278 2000-12-24  Jim Meyering  <meyering@lucent.com>
4279
4280         * hash.c (is_prime): Return explicit boolean values.
4281         (hash_get_first): Return NULL to appease Irix5.6's 89.
4282         Reported by Nelson Beebe.
4283
4284 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
4285
4286         * localcharset.c (locale_charset): Add support for Win32.
4287
4288 2000-12-18  Paul Eggert  <eggert@twinsun.com>
4289
4290         * physmem.h, physmem.c: New files.
4291
4292         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
4293         (noinst_HEADERS): Add physmem.h.
4294
4295         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
4296         't' for compatibility with Solaris 8 sort.
4297
4298 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
4299
4300         * config.charset: Add support for BeOS.
4301
4302 2000-12-16  Jim Meyering  <meyering@lucent.com>
4303
4304         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
4305         SHELLS_FILE to a file name that's useful on djgpp systems.
4306         Include stdlib.h.
4307         (ADDITIONAL_DEFAULT_SHELLS): Define.
4308         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
4309         Based mostly on a patch from Prashant TR.
4310
4311 2000-12-16  Jim Meyering  <meyering@lucent.com>
4312
4313         This bug had a serious impact on chown: `chown N:M FILE' (for integer
4314         N and M) would have treated it like `chown N:N FILE'.
4315
4316         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
4317
4318 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
4319
4320         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
4321         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
4322         to the list of canonical encodings. Rename EUC-CN to GB2312.
4323
4324 2000-12-08  Andreas Schwab  <schwab@suse.de>
4325
4326         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
4327         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
4328
4329 2000-12-07  Jim Meyering  <meyering@lucent.com>
4330
4331         * stripslash.c (ISSLASH): Define.
4332         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
4333         From Prashant TR.
4334
4335         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
4336         (dir_name_r): Declare this function as static.
4337         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
4338         manifest itself on a name containing a mix of slashes and
4339         backslashes.
4340         Make this function work with names starting with a DOS-style
4341         drive letter and colon prefix.
4342         (dir_name): Append `.' if necessary.
4343         Based mostly on patches from Prashant TR and Eli Zaretskii.
4344
4345         * dirname.h (dir_name_r): Remove prototype.
4346
4347 2000-12-05  Jim Meyering  <meyering@lucent.com>
4348
4349         * dirname.c (dir_name_r): Add `const' in a few local declarations.
4350
4351 2000-12-04  Jim Meyering  <meyering@lucent.com>
4352
4353         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
4354         Also include memory.h, stdlib.h, unistd.h if appropriate.
4355         Reported by Andreas Jaeger (conflicting declaration of malloc).
4356
4357 2000-12-02  Jim Meyering  <meyering@lucent.com>
4358
4359         * closeout.h: Make idempotent, to avoid some obscure warnings.
4360
4361 2000-12-01  Paul Eggert  <eggert@twinsun.com>
4362
4363         * memrchr.c: Include <config.h> before any system include file.
4364
4365 2000-11-29  Paul Eggert  <eggert@twinsun.com>
4366
4367         * dirname.c (dir_name_r): Fix typo: int -> size_t.
4368
4369 2000-11-26  Jim Meyering  <meyering@lucent.com>
4370
4371         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
4372
4373 2000-11-22  Paul Eggert  <eggert@twinsun.com>
4374
4375         * strftime.c (my_strftime): Do not invoke mbrlen with a
4376         size of (size_t) -1; it's not portable.
4377
4378 2000-11-17  Akim Demaille  <akim@epita.fr>
4379
4380         * obstack.h: Formatting changes.
4381         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
4382         prevent type checking.
4383         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
4384         cast the value to (void *): assigning a `foo *' to a `void *'
4385         variable is valid.
4386         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
4387
4388 2000-11-17  Jim Meyering  <meyering@lucent.com>
4389
4390         * strstr.c: Update from GNU libc.
4391
4392 2000-11-16  Jim Meyering  <meyering@lucent.com>
4393
4394         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
4395
4396 2000-11-11  Jim Meyering  <meyering@lucent.com>
4397
4398         * error.c: Add a couple #includes, merging from GNU libc version.
4399
4400 2000-11-10  Jim Meyering  <meyering@lucent.com>
4401
4402         * obstack.h: Update from GNU libc.
4403         * obstack.c: Likewise.
4404
4405 2000-11-06  Paul Eggert  <eggert@twinsun.com>
4406
4407         * getusershell.c (setusershell): Use rewind rather than
4408         fseek/fseeko, to avoid configuration hassles with fseeko.
4409         Don't bother opening SHELLS_FILE if shellstream is NULL;
4410         it's not necessary.
4411
4412 2000-11-05  Jim Meyering  <meyering@lucent.com>
4413
4414         * makepath.h (make_dir): Declare.
4415         * makepath.c (make_dir): Remove `static' attribute.
4416         Tweak a comment.
4417
4418 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
4419
4420         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
4421         last one in a bucket, advance to the next bucket.
4422
4423 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
4424
4425         * fnmatch.c: Do not comment out all the code if we are using
4426         the GNU C library, because in some cases we are replacing buggy
4427         code in the GNU C library itself.
4428
4429 2000-10-30  Paul Eggert  <eggert@twinsun.com>
4430
4431         * error.h, getline.h, modechange.h:
4432         Remove "2000" from Copyright line, as the file hasn't been
4433         changed this year other than in the copyright notice.
4434
4435         * xalloc.h: Add "2000" to Copyright line, as this file
4436         was changed this year.
4437
4438 2000-10-30  Paul Eggert  <eggert@twinsun.com>
4439
4440         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
4441         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4442         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4443
4444 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
4445
4446         * regex.h (__restrict_arr): Move definition out of #ifndef block.
4447         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
4448         doesn't define __restrict_arr.
4449
4450 2000-10-29  Jim Meyering  <meyering@lucent.com>
4451
4452         * xstat.in: Fix grammar in comment.
4453
4454 2000-10-28  Jim Meyering  <meyering@lucent.com>
4455
4456         * memchr.c: Update from libc.
4457         Adjust for portability:
4458         [HAVE_STDLIB_H]: Include stdlib.h.
4459         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
4460         Undef __memchr, too.
4461         [!weak_alias]: Define __memchr to memchr.
4462
4463         * regex.c: Update from libc.
4464         * regex.h: Likewise.
4465         * getopt1.c: Likewise.
4466         * memcmp.c: Likewise.
4467
4468         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
4469         Avoid using fseek, when possible -- it's broken by design.
4470         Patch by Ulrich Drepper.
4471
4472 2000-10-26  Jim Meyering  <meyering@lucent.com>
4473
4474         * strftime.c: Update from libc.
4475
4476 2000-10-25  Jim Meyering  <meyering@lucent.com>
4477
4478         * obstack.c: Update from libc.
4479
4480 2000-10-23  Jim Meyering  <meyering@lucent.com>
4481
4482         * hard-locale.c (hard_locale): Revert last change -- it was simply
4483         wrong.  That set_locale call must not have any side effects.
4484         From Paul Eggert.
4485
4486 2000-10-22  Jim Meyering  <meyering@lucent.com>
4487
4488         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
4489         [CYCLIC]: Remove now-unused definition.
4490
4491         * save-cwd.c (O_DIRECTORY): Define, if needed.
4492         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
4493         Suggestion from Ulrich Drepper.
4494
4495 2000-10-21  Jim Meyering  <meyering@lucent.com>
4496
4497         * dirname.c (dir_name_r): New function, factored out of dir_name.
4498         (dir_name): Use dir_name_r.
4499         * dirname.h (dir_name_r): Declare it.
4500
4501 2000-10-21  Jim Meyering  <meyering@lucent.com>
4502
4503         * dirname.c (memrchr): Declare if necessary.
4504         (dir_name): Remove the restriction that there be no
4505         trailing slashes.  Now, this code skips past them, effectively
4506         ignoring them.
4507         [TEST_DIRNAME] (main): New unit tests.
4508
4509         * memrchr.c: New file from GNU libc.
4510         Undef __memrchr, too.
4511         [!weak_alias]: Define __memrchr to memrchr.
4512         Guard weak_alias use with `#ifdef weak_alias'.
4513
4514 2000-10-17  Jim Meyering  <meyering@lucent.com>
4515
4516         * quote.h (PARAMS): Define and use.
4517         Reported by Akim Demaille.
4518
4519         * getopt.c: Update from libc.
4520
4521 2000-10-16  Jim Meyering  <meyering@lucent.com>
4522
4523         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
4524         From Jan Fedak.
4525
4526 2000-09-25  Jim Meyering  <meyering@lucent.com>
4527
4528         * md5.h (rol): Define (from GnuPG).
4529
4530         * sha.c: Give credit (GnuPG) where due.
4531         (M): Use rol rather than open-coding it.
4532         Add a FIXME comment.
4533
4534 2000-09-21  Jim Meyering  <meyering@lucent.com>
4535
4536         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
4537         Reported by Michael Stone.
4538
4539 2000-09-20  Jim Meyering  <meyering@lucent.com>
4540
4541         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
4542         (noinst_HEADERS): Add sha.h.
4543         Based on code from Scott G. Miller and from GnuPG.
4544
4545 2000-09-15  Jim Meyering  <meyering@lucent.com>
4546
4547         * regex.c: Update from libc.
4548
4549 2000-09-10  Jim Meyering  <meyering@lucent.com>
4550
4551         * getopt.c (_getopt_internal): Update from glibc.
4552
4553 2000-09-09  Jim Meyering  <meyering@lucent.com>
4554
4555         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
4556         think it should be used as a general replacement for isascii.
4557         * fnmatch.c: Likewise.
4558         * mbswidth.c: Likewise
4559         * regex.c: Likewise.
4560
4561         Don't use atoi.
4562         * userspec.c: Include sys/param.h and limits.h.
4563         Include xstrtol.h.
4564         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4565         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
4566         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
4567         UID, GID.  Check range.
4568
4569 2000-09-06  Jim Meyering  <meyering@lucent.com>
4570
4571         * getopt.c (_getopt_internal): Update from glibc.
4572
4573 2000-08-30  Jim Meyering  <meyering@lucent.com>
4574
4575         * strftime.c: Merge in changes from GNU libc.
4576
4577 2000-08-26  Jim Meyering  <meyering@lucent.com>
4578
4579         * closeout.c: Include "__fpending.h".
4580         (close_stdout_status): Return right away if there's nothing to flush.
4581
4582         * Makefile.am (noinst_HEADERS): Add __fpending.h.
4583         * __fpending.c: New file.
4584         * __fpending.h: New file.
4585
4586 2000-08-07  Paul Eggert  <eggert@twinsun.com>
4587
4588         Standardize on "memory exhausted" instead of "Memory exhausted"
4589         or "virtual memory exhausted".
4590         * obstack.c (print_and_abort): Use "memory exhausted", not
4591         "virtual memory exhausted".
4592         * same.c (same_name): Invoke xalloc_die instead of printing
4593         our own message.
4594         * userspec.c (parse_user_spec): Likewise.
4595         * bumpalloc.h: comment fix
4596         * same.c, userspec.c: Include xalloc.h.
4597
4598         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
4599         not char *const and pointing to a constant array.
4600         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
4601         (xrealloc): Comment fix.
4602
4603         * userspec.c (parse_user_spec):
4604         Don't translate a message until just before returning,
4605         to avoid unnecessary translation.
4606
4607 2000-08-07  Jim Meyering  <meyering@lucent.com>
4608
4609         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
4610         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
4611         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
4612         getgroups.c, gethostname.c, getopt.h, group-member.c,
4613         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
4614         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
4615         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
4616         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
4617         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
4618         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
4619         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
4620         yesno.c: Back out Copyright date changes for each file with no change
4621         this year.  This eases coordination with other programs using the same
4622         source code modules.  From Paul Eggert.
4623
4624 2000-08-03  Greg McGary  <greg@mcgary.org>
4625
4626         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
4627         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
4628         (EXTEND_BUFFER): Use them.
4629
4630 2000-08-01  Jim Meyering  <meyering@lucent.com>
4631
4632         * dirname.c (ISSLASH): Define.
4633         (BACKSLASH_IS_PATH_SEPARATOR): Define.
4634         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
4635         both `\' and `/' may be use as path separators.
4636         Based on a patch from Prashant TR.
4637
4638 2000-07-31  Paul Eggert  <eggert@twinsun.com>
4639
4640         * quotearg.c (quotearg_n_options): Don't make the initial
4641         slot vector a constant, since it might get modified.
4642
4643 2000-07-31  Jim Meyering  <meyering@lucent.com>
4644
4645         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
4646         * obstack.c (print_and_abort): Likewise.
4647
4648 2000-07-30  Paul Eggert  <eggert@twinsun.com>
4649
4650         * quotearg.c (quotearg_n_options): Preallocate a slot 0
4651         buffer, so that the caller can always quote one small
4652         component of a "memory exhausted" message in slot 0.
4653         From a suggestion by Jim Meyering.
4654
4655 2000-07-30  Jim Meyering  <meyering@lucent.com>
4656
4657         * makepath.c (make_path): Quote the other instance, too.
4658
4659         * quotearg.c (N_STATIC_SLOTVECS): Define.
4660         (STATIC_BUF_SIZE): Define.
4661         (quotearg_n_options): Use only statically allocated storage when
4662         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
4663         than STATIC_BUF_SIZE.
4664
4665 2000-07-29  Jim Meyering  <meyering@lucent.com>
4666
4667         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
4668         * dirname.c (dir_name): Likewise.
4669
4670         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
4671
4672         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
4673         (dir_name): Assert that there are no trailing slashes.
4674
4675 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
4676
4677         * mbswidth.h (mbswidth): Add a flags argument.
4678         (mbswidth): New declaration.
4679         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
4680         * mbswidth.c (mbswidth): Add a flags argument.
4681         (mbsnwidth): New function.
4682
4683 2000-07-24  Jim Meyering  <meyering@lucent.com>
4684
4685         * mbswidth.c: Remove useless #else.  From Bruno Haible.
4686
4687 2000-07-23  Paul Eggert  <eggert@twinsun.com>
4688
4689         * mbswidth.c (_XOPEN_SOURCE):
4690         Don't define; this causes problems on Solaris 7.
4691         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
4692
4693 2000-07-23  Paul Eggert  <eggert@twinsun.com>
4694
4695         * quotearg.c:
4696         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4697         so that mbstate_t is always defined.
4698
4699         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
4700         be 1 in at least one GCC installation, and this configuration
4701         error is likely to be common.  Ignoring MB_LEN_MAX hurts
4702         performance on hosts that have mbrtowc but have only unibyte
4703         locales, but I assume these hosts are rare.
4704
4705 2000-07-23  Paul Eggert  <eggert@twinsun.com>
4706
4707         * quotearg.c: Streamline by invoking multibyte code only if needed.
4708         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
4709         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
4710         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
4711         invoke multibyte primitives.
4712
4713 2000-07-23  Jim Meyering  <meyering@lucent.com>
4714
4715         * basename.c (base_name): Add an assertion.
4716
4717 2000-07-15  Bruno Haible  <clisp.cons.org>
4718
4719         * quotearg.c: When the system forces us to redefine mbstate_t,
4720         shadow its mbsinit function.
4721
4722 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
4723
4724         * mbswidth.h: New file.
4725         * mbswidth.c: New file.
4726         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
4727         (noinst_HEADERS): Add mbswidth.h.
4728
4729 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
4730
4731         * config.charset: Add support for FreeBSD. Improve support for HP-UX
4732         and IRIX 6.
4733
4734 2000-07-15  Jim Meyering  <meyering@lucent.com>
4735
4736         * makepath.c: Include quote.h.
4737         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
4738         corresponding argument in a `quote (...)' call.
4739         Give better diagnostics.
4740
4741         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
4742         (noinst_HEADERS): Add quote.h.
4743
4744         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
4745         from tar's src/misc.c.
4746         * quote.h: New file.  Prototypes for same.
4747
4748 2000-07-10  Paul Eggert  <eggert@twinsun.com>
4749
4750         From a suggestion by Bruno Haible.
4751         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4752         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4753         to decide whether to define the BeOS workaround macro;
4754         this adjusts to the change to AC_MBSTATE_T.
4755
4756 2000-07-13  Paul Eggert  <eggert@twinsun.com>
4757
4758         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
4759
4760         * quotearg.c (quoting_style_args, quoting_style_vals,
4761         quotearg_buffer_restyled): Add support for
4762         clocale_quoting_style.  Undo previous change to
4763         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
4764         and "{RIGHT QUOTATION MARK}" msgids.
4765
4766 2000-07-05  Paul Eggert  <eggert@twinsun.com>
4767
4768         The old behavior of quoting `like this' doesn't look good with
4769         newer, ISO-style fonts.  See:
4770         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
4771
4772         Instead, quote "like this" by default.  Let the translator
4773         tailor the locale-specific quoting behavior by providing
4774         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
4775
4776         * quotearg.c (N_): New macro.
4777         (gettext_default): New function.
4778         (quotearg_buffer_restyled): Use
4779         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
4780         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
4781
4782 2000-07-09  Jim Meyering  <meyering@lucent.com>
4783
4784         * Most files: Update copyright dates to include 2000.
4785
4786 2000-07-08  Jim Meyering  <meyering@lucent.com>
4787
4788         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
4789         if not defined.
4790         (xgethostname): Remove now-unnecessary #ifdef.
4791         Move declaration of `err' into loop where it's used.
4792
4793 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
4794
4795         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
4796         by allocating a larger buffer. Test the gethostname return value for
4797         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
4798         returns an error and ENAMETOOLONG isn't defined.
4799
4800 2000-07-05  Paul Eggert  <eggert@twinsun.com>
4801         and Bruno Haible  <haible@clisp.cons.org>
4802
4803         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
4804
4805 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
4806
4807         * quotearg.c (struct quoting_options): Simplify quote_these_too
4808         dimension.
4809
4810 2000-07-03  Jim Meyering  <meyering@lucent.com>
4811
4812         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
4813         Reported by Bruno Haible.
4814
4815 2000-07-04  Jim Meyering  <meyering@lucent.com>
4816
4817         * quotearg.c: Make inclusion of <wchar.h> independent of whether
4818         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
4819         lacks mbrtowc.
4820
4821 2000-07-03  Paul Eggert  <eggert@twinsun.com>
4822         and Bruno Haible  <haible@clisp.cons.org>
4823
4824         * quotearg.c (mbrtowc):
4825         Assign to *pwc, and return 1 only if result is nonzero.
4826         (iswprint): Use ISPRINT when substituting our own mbrtowc.
4827
4828 2000-07-03  Jim Meyering  <meyering@lucent.com>
4829
4830         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
4831         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
4832         From Bob Proulx.
4833
4834 2000-07-02  Jim Meyering  <meyering@lucent.com>
4835
4836         * quotearg.c (mbstate_t): Don't define here.
4837
4838 2000-07-02  Jim Meyering  <meyering@lucent.com>
4839
4840         * nanosleep.c (SIGCONT): Define if not already defined.
4841
4842 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4843
4844         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
4845         per change in ../m4/ls-mntd-fs.m4.
4846         (read_filesystem_list): Ignore symbolic links.
4847
4848 2000-06-29  Jim Meyering  <meyering@lucent.com>
4849
4850         * same.c: Include <string.h> or <strings.h>, as appropriate,
4851         for declaration of strcmp.
4852
4853         * long-options.c: Include <stdlib.h>, for declaration of exit.
4854
4855         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
4856         Avoid warning by casting result to `char *' to remove `const'.
4857
4858 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4859
4860         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
4861
4862 2000-06-26  Paul Eggert  <eggert@twinsun.com>
4863
4864         savedir now sets errno on failure and invokes xmalloc to get memory.
4865         Fix a couple of other minor bugs while we're at it.
4866
4867         * savedir.c (<unistd.h>): Do not include; there's no need.
4868         (NAMLEN): Remove macro.
4869         (malloc, realloc): Remove decls.
4870         (stpcpy): Likewise.
4871         ("xalloc.h"): Include.
4872         (NAME_SIZE_DEFAULT): New macro.
4873         (savedir): Use xmalloc / xrealloc to allocate memory.
4874         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
4875         Skip "" directory entries.
4876         Use strlen to calculate directory entry length, since the old method
4877         is rarely used these days and isn't worth supporting.
4878         Don't use a pointer after freeing it.
4879         Check for integer overflow when calculating allocation size.
4880         Use memcpy to copy entries, instead of stpcpy.
4881         Set errno properly when returning NULL.
4882         Check for readdir error.
4883
4884 2000-06-26  Jim Meyering  <meyering@lucent.com>
4885
4886         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
4887
4888 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4889
4890         * getusershell.c (xmalloc, xrealloc): Remove functions.
4891         Include xalloc.h.
4892         Don't include <stdlib.h>.  Don't declare malloc, realloc.
4893
4894 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
4895
4896         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
4897
4898 2000-06-24  Jim Meyering  <meyering@lucent.com>
4899
4900         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
4901
4902 2000-06-21  Jim Meyering  <meyering@lucent.com>
4903
4904         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
4905
4906 2000-06-19  Paul Eggert  <eggert@twinsun.com>
4907
4908         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
4909         (mbrtowc, mbstate_t): Define substitutes if
4910         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
4911         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
4912         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4913
4914 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4915
4916         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
4917         than 1024, return a memory chunk of least possible size, instead
4918         of size PATH_MAX + 2. In the loop, increment the size proportionally.
4919         Use free/xmalloc instead of xrealloc to avoid copying for very long
4920         paths.
4921
4922 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4923
4924         * canon-host.c (canon_host): Use malloc and memcpy to copy an
4925         address, not strdup.  Include <stdlib.h> and don't declare free().
4926
4927 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4928
4929         * path-concat.c (path_concat): Don't access dir[-1] if dir is
4930         the empty string.
4931
4932 2000-06-21  Jim Meyering  <meyering@lucent.com>
4933
4934         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
4935         (noinst_HEADERS): Add getstr.h.
4936
4937         * getline.c (getstr): Move into a separate file.
4938         * getstr.c (getstr): New file, extracted from getline.c, with
4939         the following changes: new parameter, delim2; both delim[12]
4940         parameters have type `int', not `char'.  The latter would lose
4941         with 8-bit delimiters.
4942         * getstr.h: New file.
4943
4944 2000-06-19  Jim Meyering  <meyering@lucent.com>
4945
4946         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
4947
4948 2000-06-18  Jim Meyering  <meyering@lucent.com>
4949
4950         * mkdir.c: Remove file, due mainly to copyright incompatibility.
4951         Besides, these days every porting target provides a mkdir function.
4952
4953         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
4954         (this snippet comes from src/system.h).
4955
4956 2000-06-15  Paul Eggert  <eggert@twinsun.com>
4957
4958         * human.c (adjust_value): New function.
4959         (human_readable_inexact): Apply rounding style even when
4960         printing approximate values.
4961
4962 2000-06-14  Paul Eggert  <eggert@twinsun.com>
4963
4964         * human.c (human_readable_inexact): Allow an input block
4965         size that is not a multiple of the output block size, and vice versa.
4966         Reported by Piergiorgio Sartor.
4967
4968 2000-06-14  Paul Eggert  <eggert@twinsun.com>
4969
4970         * getdate.y (get_date): Apply relative times after time
4971         zone indicator, not before.  Reported by Todd A. Jacobs.
4972
4973 2000-06-13  Jim Meyering  <meyering@lucent.com>
4974
4975         * Makefile.am (all-local): Depend on lstat.c and stat.c.
4976
4977         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
4978
4979 2000-06-12  Paul Eggert  <eggert@twinsun.com>
4980
4981         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
4982
4983 2000-06-04  Paul Eggert  <eggert@twinsun.com>
4984
4985         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
4986
4987 2000-06-04  Jim Meyering  <meyering@lucent.com>
4988
4989         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
4990         SunOS 4.1.4 for which gid_t is an unsigned type.
4991
4992 2000-06-03  Jim Meyering  <meyering@lucent.com>
4993
4994         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
4995
4996 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
4997
4998         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
4999         newer, don't install charset.alias.
5000         * config.charset: Change the Linux/glibc rules so they become empty
5001         on glibc-2.1 or newer.
5002
5003 2000-06-02  Jim Meyering  <meyering@lucent.com>
5004
5005         * mountlist.c: Back out last change.  Instead, do this...
5006         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
5007         member using the same `ignore'-testing code.
5008         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
5009         fs_type strings.
5010         From Mark D. Roth.
5011
5012 2000-05-29  Jim Meyering  <meyering@lucent.com>
5013
5014         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
5015         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
5016
5017 2000-05-22  Jim Meyering  <meyering@lucent.com>
5018
5019         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
5020
5021 2000-05-18  Jim Meyering  <meyering@lucent.com>
5022
5023         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
5024         back, too, since it may have been modified by allocate_entry.
5025         (hash_delete): Rewrite to use neither the assignment operator
5026         nor the comma operator in an if-expression.
5027
5028 2000-05-15  Paul Eggert  <eggert@twinsun.com>
5029
5030         * closeout.c:
5031         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
5032         Remove; no longer needed.
5033         "quotearg.h": Add include.
5034         (file_name): Do not bother to explicitly initialize to NULL; it's less
5035         efficient on some hosts.
5036         (close_stdout_status): Remove test as to whether stdout was already
5037         closed; it breaks for the case "echo x | sort >&-".
5038         Quote file name colons.
5039         Do not assume that _("write error") lacks format strings.
5040
5041 2000-05-15  Jim Meyering  <meyering@lucent.com>
5042
5043         * version-etc.c (version_etc_copyright): Update the copyright string
5044         used in all --version output.
5045
5046 2000-05-14  Jim Meyering  <meyering@lucent.com>
5047
5048         * closeout.c (close_stdout_set_file_name): New function.
5049         (close_stdout_status): Use new file-scoped global.
5050         Return right away if fstat says the stdout file descriptor is invalid.
5051         * closeout.h (close_stdout_set_file_name): Declare.
5052
5053 2000-05-10  Jim Meyering  <meyering@lucent.com>
5054
5055         * closeout.c [default_exit_status]: New file-scoped variable.
5056         (close_stdout_set_status): New function.
5057         * closeout.h (close_stdout_set_status): Declare.
5058
5059 2000-05-08  Jim Meyering  <meyering@lucent.com>
5060
5061         * long-options.c: Don't include closeout.h.
5062         (parse_long_options): Don't call close_stdout for --version.
5063
5064 2000-05-06  Jim Meyering  <meyering@lucent.com>
5065
5066         * strnlen.c: Undefine __strnlen and strnlen.
5067         [!weak_alias]: Define __strnlen to strnlen.
5068
5069         * atexit.c: New file, from libiberty.
5070
5071 2000-05-06  Jim Meyering  <meyering@lucent.com>
5072
5073         * closeout.c (close_stdout_status): Also check for errors on the
5074         stderr stream.
5075
5076 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
5077
5078         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
5079         instead of xmalloc, xrealloc, path_concat.
5080         (locale_charset): Treat empty environment variables as absent.
5081         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
5082
5083 2000-05-04  Jim Meyering  <meyering@lucent.com>
5084
5085         * getopt.c: Update from glibc.
5086         * obstack.c: Likewise.
5087         * obstack.h: Likewise.
5088         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
5089
5090         * regex.h: Likewise.
5091         * strndup.c: Likewise.
5092         * strnlen.c: New file, from glibc.
5093
5094 2000-05-01  Jim Meyering  <meyering@lucent.com>
5095
5096         * full-write.c (full_write): Remove `FIXME' part of comment.
5097
5098 2000-04-29  Jim Meyering  <meyering@lucent.com>
5099
5100         * path-concat.c: Declare strdup only if it's not defined.
5101         * canon-host.c: Likewise.
5102
5103 2000-04-28  Jim Meyering  <meyering@lucent.com>
5104
5105         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
5106         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
5107         included first, then limits.h is included by locale.h by libintl.h.
5108         From John David Anglin.
5109
5110 2000-04-25  Jim Meyering  <meyering@lucent.com>
5111
5112         * makepath.c (S_IRWXUGO): Define.
5113         (make_path): Always perform explicit chmod if MODE specifies any
5114         of the `special' permission bits.  Prompted by a bug report against
5115         install from Mate Wierdl and Joost van Baal.
5116
5117 2000-04-18  Jim Meyering  <meyering@lucent.com>
5118
5119         * README: New file.
5120
5121         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
5122         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
5123
5124 2000-04-17  Jim Meyering  <meyering@lucent.com>
5125
5126         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
5127         the definition of it to rpl_strftime also defined-away the system's
5128         declaration.
5129
5130 2000-04-15  Jim Meyering  <meyering@lucent.com>
5131
5132         Use `C' to denote so-called `contiguous' files, the same way
5133         that tar does.
5134         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
5135         (ftypelet): Use S_ISCTG.
5136         From Michael Deutschmann.
5137
5138 2000-04-14  Jim Meyering  <meyering@lucent.com>
5139
5140         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
5141
5142 2000-04-08  Jim Meyering  <meyering@lucent.com>
5143
5144         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
5145         names don't conflict.  Reported by Eli Zaretskii.
5146
5147 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
5148
5149         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
5150         bug.  Deal with the different error behavior of Irix iconv.
5151
5152 2000-04-07  Jim Meyering  <meyering@lucent.com>
5153
5154         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
5155         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
5156
5157 2000-04-05  Jim Meyering  <meyering@lucent.com>
5158
5159         Portability tweaks required for ultrix4.3.
5160         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
5161         * readutmp.c: Include sys/types.h before sys/stat.h.
5162         * canon-host.c: Declare strdup.
5163         * path-concat.c: Likewise.
5164         From John David Anglin.
5165
5166 2000-04-04  Jim Meyering  <meyering@lucent.com>
5167
5168         Be more DOS 8.3-friendly.
5169         * ref-add.sin: Renamed from ref-add.sed.in.
5170         * ref-del.sin: Renamed from ref-del.sed.in.
5171         * Makefile.am: Reflect renaming.
5172         Reported by Eli Zaretskii.
5173
5174         Use a temporary file name that won't clash with `charset.alias'
5175         in the DOS 8.3 name space.
5176         * Makefile.am (charset_tmp): Define.
5177         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
5178         (uninstall-local): Likewise.
5179         Reported by Eli Zaretskii.
5180
5181 2000-03-29  Paul Eggert  <eggert@twinsun.com>
5182
5183         * time/strftime.c (my_strftime): Make sure we call the system
5184         strftime, not ourselves, when invoking the underlying strftime.
5185
5186 2000-03-24  Jim Meyering  <meyering@lucent.com>
5187
5188         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
5189         (charset_alias): Define.
5190         (install-exec-local): Factor out common code.
5191         (uninstall-local): Split lines longer than 80.
5192         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
5193         (SUFFIXES): Define.
5194         (.sed.in.sed): New rule.  Don't redirect directly to $@.
5195         (CLEANFILES): Add ref-add.sed and ref-del.sed.
5196
5197 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
5198
5199         * config.charset: Output a line containing "Packages using this file".
5200         * ref-add.sed.in, ref-del.sed.in: New files.
5201         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
5202         ref-del.sed): New rules.
5203
5204 2000-03-17  Jim Meyering  <meyering@lucent.com>
5205
5206         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
5207         Otherwise, include <strings.h>
5208
5209 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
5210
5211         * unicodeio.c (utf8_wctomb): New function.
5212         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
5213         format instead of in UCS-4 with platform dependent endianness.
5214
5215 2000-03-07  Paul Eggert  <eggert@twinsun.com>
5216
5217         * savedir.c (savedir): Work even if directory size is
5218         negative; this can happen with some screwy NFS configurations.
5219
5220 2000-03-06  Jim Meyering  <meyering@lucent.com>
5221
5222         * localcharset.c (get_charset_aliases): Don't try to free file_name
5223         if it's NULL (because we ran out of memory).  From Bruno Haible.
5224
5225 2000-03-05  Jim Meyering  <meyering@lucent.com>
5226
5227         * localcharset.c ("path-concat.h"): Include.
5228         (get_charset_aliases): Use path_concat instead of ANSI string
5229         concatenation.
5230
5231         * unicodeio.h (PARAMS): Define.
5232         Use it to guard prototype.
5233
5234 2000-03-04  Jim Meyering  <meyering@lucent.com>
5235
5236         * Makefile.am (install-exec-local): Create $(libdir) before installing
5237         into it.
5238         (uninstall-local): Uncomment this rule so `make distcheck' works
5239         once again.
5240
5241         * unicodeio.c (<errno.h>): Include it.
5242         (errno): Declare if not defined.
5243
5244         * localcharset.c: Add Bruno's comment justifying use of volatile.
5245
5246         * config.charset: New version, incorporating remarks from a linux
5247         i18n mailing list.  From Bruno Haible.
5248
5249 2000-03-02  Jim Meyering  <meyering@lucent.com>
5250
5251         * Makefile.am (EXTRA_DIST): Add config.charset.
5252
5253 2000-03-01  Jim Meyering  <meyering@lucent.com>
5254
5255         * localcharset.c: Guard some #includes with `#if HAVE_...'.
5256         * unicodeio.c: Likewise.
5257
5258 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
5259
5260         * config.charset: New file.
5261         * localcharset.c: New file.
5262         * unicodeio.h, unicodeio.c: New files.
5263         * Makefile.am (DEFS): Add -DLIBDIR=...
5264         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
5265         (noinst_HEADERS): Add unicodeio.h.
5266         (all-local, install-exec-local, charset.alias): New targets.
5267
5268 2000-02-28  Paul Eggert  <eggert@twinsun.com>
5269
5270         * quotearg.c (ALERT_CHAR): New macro.
5271         (quotearg_buffer_restyled): Use it.
5272
5273 2000-02-27  Jim Meyering  <meyering@lucent.com>
5274
5275         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
5276         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
5277
5278         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
5279         not `#if STDC_HEADERS'.
5280         Declare malloc if needed.
5281
5282         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
5283         now that autoconf always defines the HAVE_DECL_ symbols.
5284         * human.c: Likewise.
5285         * same.c: Likewise.
5286         * strtoumax.c: Likewise.
5287
5288         * backupfile.c: Arrange for cpp to fail if the configure-time
5289         declaration check was not run.
5290         * hash.c: Likewise.
5291         * human.c: Likewise.
5292         * same.c: Likewise.
5293         * strtoumax.c: Likewise.
5294
5295         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
5296         then first look up the entire `.'-containing string as a login name.
5297
5298 2000-02-18  Paul Eggert  <eggert@twinsun.com>
5299
5300         * getdate.y: Handle two-digit years with leading zeros correctly.
5301         (textint): New typedef.
5302         (parser_control): Member year changed from int to textint.
5303         All uses changed.
5304         (YYSTYPE): Removed; replaced by %union with int and textint members.
5305         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
5306         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
5307         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
5308         (tSNUMBER, tUNUMBER): Now of type <textintval>.
5309         (date, number, to_year): Use width of number in digits, not its value,
5310         to determine whether it's a 2-digit year, or a 2-digit time.
5311         (yylex): Store number of digits of numeric tokens.
5312         Reported by John Kendall.
5313
5314         (parser_control): Changed from struct parser_control to typedef (for
5315         consistency).  All uses changed.
5316
5317         (tID): Removed; not used.
5318         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
5319
5320 2000-02-14  Paul Eggert  <eggert@twinsun.com>
5321
5322         * getpagesize.h (getpagesize): Port to VMS for Alpha;
5323         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
5324
5325 2000-02-12  Jim Meyering  <meyering@lucent.com>
5326
5327         * userspec.c (ISDIGIT): Define it.
5328         (isdigit): Remove definition.
5329         (is_number): Use ISDIGIT, not isdigit.
5330         <libintl.h>: Include.
5331         (_ and N_): Define.
5332         (parse_user_spec): Mark translatable strings.
5333
5334 2000-02-10  Jim Meyering  <meyering@lucent.com>
5335
5336         With these changes, nanosleep.[ch] are finally enough like the other
5337         lib/* replacement files to compile on a few more losing systems.
5338
5339         * nanosleep.h: Don't include config.h.
5340         Remove prototype from declaration of nanosleep.
5341         (PARAMS): Remove now-unneeded definition.
5342         * nanosleep.c: #undef nanosleep.
5343         (rpl_nanosleep): Rename from nanosleep.
5344
5345 2000-02-03  Jim Meyering  <meyering@lucent.com>
5346
5347         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
5348         rather than with `#if HAVE_UTMPNAME'.
5349
5350 2000-02-01  Jim Meyering  <meyering@lucent.com>
5351
5352         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
5353
5354 2000-01-31  Jim Meyering  <meyering@lucent.com>
5355
5356         * nanosleep.h (nanosleep): Guard declaration with
5357         `#if ! HAVE_DECL_NANOSLEEP'.
5358         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
5359         the declaration in that vendor's sys/timers.h.
5360         Reported by Christian Krackowizer.
5361
5362         * quotearg.c (ISASCII): Add #undef and move definition to follow
5363         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
5364         (ISPRINT): Likewise.
5365         Reported by Tom Tromey.
5366
5367 2000-01-30  Jim Meyering  <meyering@lucent.com>
5368
5369         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
5370         uses of ->ut_name.  The latter doesn't work with new Linux header files
5371         where only utmpx.ut_user is declared.
5372
5373         * readutmp.h (UT_USER): Define.
5374
5375 2000-01-23  Jim Meyering  <meyering@lucent.com>
5376
5377         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
5378         obstack.c.
5379
5380 2000-01-22  Jim Meyering  <meyering@lucent.com>
5381
5382         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
5383         [! HAVE_DECL_STRTOULL]: Declare strtoull.
5384         Required for some AIX systems.  Reported by Christian Krackowizer.
5385         [TESTING] (main): New function.
5386
5387         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
5388         * dirname.c (dir_name): Support for DOS-style file names with drive
5389         letters.
5390
5391         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
5392
5393         * strverscmp.c (ISDIGIT): Define.
5394         (strverscmp): Use ISDIGIT, not isdigit.
5395
5396 2000-01-17  Paul Eggert  <eggert@twinsun.com>
5397
5398         * nanosleep.c (nanosleep):
5399         Don't use SA_INTERRUPT to decide whether to call sigaction, as
5400         POSIX.1 doesn't require SA_INTERRUPT and some systems
5401         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
5402         it's been part of POSIX.1 since day 1 (in 1988).
5403
5404 2000-01-17  Jim Meyering  <meyering@lucent.com>
5405
5406         * interlock: Remove unused file.  Reported by François Pinard.
5407
5408 2000-01-16  Paul Eggert  <eggert@twinsun.com>
5409
5410         * quotearg.c (quotearg_buffer_restyled): Do not quote
5411         alert, backslash, formfeed, and vertical tab unnecessarily in
5412         shell quoting style.
5413
5414
5415 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
5416   Free Software Foundation, Inc.
5417 Copying and distribution of this file, with or without modification,
5418 are permitted provided the copyright notice and this notice are preserved.