df2b3ab4cb8b0759e2587f99090402af79ce486e
[gnulib.git] / lib / ChangeLog
1 2005-10-11  Simon Josefsson  <jas@extundo.com>
2
3         * crc.h, crc.c: New files.
4
5         * gc.h (gc_hash_buffer): Add doc.
6
7 2005-10-08  Simon Josefsson  <jas@extundo.com>
8
9         * gc.h: Add gc_hash and gc_hash_buffer.
10
11         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
12
13         * gc-libgcrypt.c (gc_hash_buffer): Add.
14
15 2005-10-11  Bruno Haible  <bruno@clisp.org>
16
17         * strcasecmp.c: Include limits.h.
18         (strcasecmp): Avoid integer overflow on exotic platforms.
19         * strncasecmp.c: Include limits.h.
20         (strncasecmp): Avoid integer overflow on exotic platforms.
21         Reported by Paul Eggert.
22
23 2005-10-06  Simon Josefsson  <jas@extundo.com>
24
25         * hmac-md5.c: New file.
26
27         * hmac.h: New file.
28
29 2005-10-06  Simon Josefsson  <jas@extundo.com>
30
31         * memxor.c (memxor): Avoid casts and warnings.
32
33 2005-10-05  Derek Price  <derek@ximbiot.com>
34
35         * getdelim.c (SIZE_MAX): New macro, if not already defined.
36
37 2005-10-05  Simon Josefsson  <jas@extundo.com>
38
39         * memxor.c (memxor): Fix compiler error.
40
41         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
42         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
43
44         * memxor.h, memxor.c: New files.
45
46         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
47         we assume all systems have it, suggested by Jim Meyering
48         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
49         any systems lack sys/socket.h; mingw32 is known to lack it, but we
50         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
51         same reasons.
52
53 2005-10-04  Bruno Haible  <bruno@clisp.org>
54
55         * verify.h (verify_true): Provide alternative definition for C++.
56
57 2005-10-04  Simon Josefsson  <jas@extundo.com>
58
59         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
60         D. Baushke" <mdb@gnu.org>.
61
62 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
63
64         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
65         (SSIZE_MAX): New macro, if not already defined.
66         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
67         than 2 GiB.
68
69 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
70
71         * exclude.c: Include verify.h.
72         (verify): Remove.  All callers changed to use verify.h's version.
73         * strtoimax.c: Likewise.
74         * utimecmp.c: Likewis.e
75
76         Sync from coreutils.
77         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
78         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
79         * .cvsignore: Add fts.h, search.h, t-fpending.
80         * settime.c (settime): Fix { typo in previous patch.  Also, don't
81         bother returning ENOSYS if settimeofday or stime fails; just let
82         them return whatever errno they want to return.
83         * utimens.c: Include unistd.h, for dup2.
84         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
85         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
86
87 2005-10-02  Jim Meyering  <jim@meyering.net>
88
89         Sync from coreutils.
90         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
91         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
92         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
93         Remove AT_FDCWD test.
94         Do not consume the fd unless successful.
95         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
96         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
97         block, so that we don't even try to compile it if settimeofday is
98         available.  This works around a compilation failure on OSF1 V5.1,
99         due to stime requiring a `long int*' while tv_sec is `int'.
100
101 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
102
103         * getdelim.c (getdelim): Remove unused variables.
104
105 2005-10-01  Simon Josefsson  <jas@extundo.com>
106
107         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
108         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
109         AI_* and EAI_* definitions.  Protect function declarations.
110
111 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
112
113         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
114         so that the code works even with ancient cpp.  Portability problem
115         with GCC 2.7.2.1 reported by Thomas M.Ott.
116
117 2005-09-27  Jim Meyering  <jim@meyering.net>
118
119         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
120
121         * intprops.h (signed_type_or_expr__): Define.
122         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
123         for unsigned types.
124
125 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
126
127         * verify.h (verify_expr): Remove, replacing with:
128         (verify_true): New macro that returns true instead of void.
129         (verify_type__): Remove.
130         (verify): Use verify_true rather than verify_type__.
131
132 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
133
134         * utimens.c (ENOSYS): Define if not already defined.
135         (futimens): Support having a null PATH if the file descriptor
136         is nonnegative.
137
138         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
139         Remove.
140         (__attribute): Define to empty unless GCC 3.1 or later.
141         This works around a core dump on OpenBSD 3.4, which has GCC
142         2.95.3, which dumps core when given __attribute__(()).  It also
143         simplifies other tests, since we really don't want to bother with
144         worrying about which ancient version of GCC supported what.
145         Original problem reported by Yoann Vandoorselaere, with part of
146         the fix suggested by Derek Price.
147
148 2005-09-24  Jim Meyering  <jim@meyering.net>
149
150         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
151         so we can once again use a positive bitfield width of 1 -- now we
152         don't have to explain why we were using a bitfield width of 2.
153
154 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
155
156         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
157         Problem reported by Eric Blake.
158         (getaddrinfo): Initialize se so that it's not garbage.
159         Redo internal storage allocation so that it doesn't make unportable
160         assumptions about alignment.
161         Fix a memory leak.
162
163         * utimens.c (futimens): Use futimesat if available.
164         Prefer it to futimes since it doesn't have the futimes bug.
165
166         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
167         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
168         Instead, declare a function that returns a pointer to an array,
169         and use verify_type__ to declare the size of the array.
170         Problem and germ of a solution reported by Bruno Haible.
171         (verify_type__): Use 2, not 1, for bitfield size, to avoid
172         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
173
174 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
175
176         Sync from coreutils.
177
178         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
179         stat-time.h.
180         * argmatch.h: Include verify.h
181         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
182         (ARGMATCH_ASSERT): Remove; unused.
183         * canonicalize.c: Assume STDC_HEADERS.
184         * exclude.c: Include "strcase.h".
185         * regex_internal.h [!defined _LIBC]: Likewise.
186         * getusershell.c: Include stdio--.h rather than stdio.h
187         and stdio-safer.h.
188         (getusershell): Call fopen, not fopen_safer.
189         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
190         Do not include unistd-safer.h.
191         (save_cwd): Don't call fd_safer; no longer needed
192         now that we include fcntl--.h.
193
194         * getdate.y (relative_time): New type.
195         (RELATIVE_TIME_0): New constant.
196         (parser_control): Use relative_time instead of doing it ourselves.
197         (%union): Add new relative_time rel member.
198         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
199         Now typeless.
200         (relunit, relunit_snumber): Now of type rel.
201         (zone, rel, relunit, get_date): Adjust to above changes.
202
203         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
204         Do not include unistd-safer.h.
205         (getloadavg): Don't call fd_safer; no longer needed
206         now that we include fcntl--.h.
207
208         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
209         (make_dir_parents): Treat ENOSYS like EEXIST.
210
211         Improve quality of diagnostics on restore_cwd failure.
212         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
213         (make_dir_parents): Last arg is now int * (for errno), not bool *.
214         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
215         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
216         each time through the loop.  Do not diagnose restore_cwd failure;
217         that is the caller's job (and perhaps the caller does not care).
218
219         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
220         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
221         If the file already exists but is not a directory, don't bother
222         to try to make its parents.
223         Close potential file descriptor leak if we can't chdir("/") (!).
224         Don't always return true if chdir($PWD) fails; return true only
225         if the requested action was done successfully (except for the
226         chdir($PWD)).
227         Don't log final directory unless we actually made it.
228         Refactor to avoid duplicate code to fix up permissions.
229         Don't attempt to fix up parent permissions if chdir($PWD) fails.
230
231         * strftime.c (my_strftime): Rewrite the previous change slightly,
232         to make it a bit faster and (I hope) clearer.
233         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
234         Fix bug in formats like %2N.
235
236         * verify.h: New file.
237
238 2005-09-22  Jim Meyering  <jim@meyering.net>
239
240         Sync from coreutils.
241
242         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
243
244         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
245         the .tm_year member, since otherwise gcc-4.0 would now warn about
246         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
247
248         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
249         order to avoid an unsuppressible warning from gcc on 64-bit systems.
250
251         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
252         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
253         when run in a time zone for which daylight savings time is in effect
254         for the starting date.
255
256         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
257         stop us from restricting permissions of just-created absolute-named
258         directories.
259         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
260         to restore initial working directory.
261         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
262         to tell caller if/when we change the working directory and are
263         unable to return to the initial one.
264         * mkdir-p.h (make_dir_parents): Update prototype.
265         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
266         `return false'.  This fixes a bug introduced on 2004-07-30.
267
268         * openat.c (fdopendir): Be sure to close the supplied
269         file descriptor before returning.  This makes our replacement
270         implementation a little closer to Solaris's, where fdopendir
271         ties the file descriptor to the returned DIR* pointer.
272         * openat.c (unlinkat): New function.
273         * openat.h (unlinkat): Add prototype.
274         * openat-die.c (openat_save_fail): Rename from openat_save_die.
275         (openat_restore_fail): Rename from openat_restore_die.
276         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
277
278         Provide an alternative to exiting immediately upon save_cwd or
279         restore_cwd failure.  Now, an application can arrange e.g.,
280         to perform a longjump in that case.
281         * openat.c: Include dirname.h.
282         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
283         (rpl_openat, fdopendir, fstatat): Call openat_save_die
284         and openat_restore_die rather than calling error directly.
285         Don't include "error.h" or "exitfail.h"; they're no longer needed.
286
287         * openat-die.c (openat_save_die, openat_restore_die): New file.
288         * openat.h (openat_save_die, openat_restore_die): Declare and define.
289
290         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
291         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
292                             int utc, int nanoseconds);
293         Background:
294         date should not have to allocate a megabyte of virtual memory to
295         handle a format argument like +%1048575T.  When implemented with
296         strftime, it must allocate such a buffer, use strftime to fill it
297         in, print it, then free it.
298         With fprintftime, it simply prints everything and exits.
299         With no need for memory allocation, that's one fewer way to fail.
300         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
301         optional field width, not before, so we accept %9:z, not %:9z.
302         (my_strftime): Be sure to use L_('x') for literals.
303
304         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
305         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
306         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
307         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
308         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
309         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
310         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
311         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
312         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
313
314         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
315         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
316         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
317         and don't include <sys/file.h>).
318
319 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
320
321         Sync from coreutils.
322
323         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
324         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
325         [!LDAV_DONE]: Avoid unused variable warning.
326
327 2005-09-21  Bruno Haible  <bruno@clisp.org>
328
329         * unicodeio.h (unicode_to_mb): New declaration.
330
331 2005-09-20  Derek Price  <derek@ximbiot.com>
332
333         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
334
335 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
336
337         Use a consistent style for including <config.h>.
338         * __fpending.c, acl.c, argmatch.c,
339         argp-help.c, argp-parse.c,
340         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
341         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
342         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
343         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
344         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
345         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
346         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
347         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
348         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
349         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
350         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
351         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
352         modechange.c, mountlist.c, open-safer.c, physmem.c,
353         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
354         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
355         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
356         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
357         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
358         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
359         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
360         userspec.c, utimecmp.c, version-etc-fsf.c,
361         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
362         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
363         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
364         Standardize inclusion of config.h.
365         * __fpending.h, dirfd.h, getdate.h, human.h,
366         inttostr.h:  Removed inclusion of config.h from header files.
367         * inttostr.c:  Adjusted in-tree users.
368         * timespec.h: Remove superfluous warning to include config.h.
369         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
370         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
371         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
372         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
373
374 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
375
376         * stat-time.h: New file.
377         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
378         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
379         in a different way.
380         (timespec_cmp): New function.
381         * utimecmp.c: Include stat-time.h.
382         (SYSCALL_RESOLUTION): Depend on whether various struct stat
383         members exist, not on the obsolescent ST_MTIM_NSEC.
384         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
385
386 2005-09-15  Derek Price  <derek@ximbiot.com>
387             Paul Eggert  <eggert@cs.ucla.edu>
388
389         * regcomp.c, regexec.c, regex_internal.c: Back out previous
390         changes, consolidating in...
391         * regex_internal.h: ...this file.
392
393 2005-09-15  Derek Price  <derek@ximbiot.com>
394
395         * regex_internal.h: Blank `pure' for GNUC < 3.
396         * regex_internal.c: Ditto, using this...
397         (__GNUC_PREREQ): ...new macro.
398         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
399         (__GNUC_PREREQ): ...this new macro.
400
401         * strstr.h: Include string.h. Define strstr as a macro here.
402
403 2005-09-13  Derek Price  <derek@ximbiot.com>
404
405         * canon-host.c (canon_host_r): Set *cherror on memory allocation
406         failure.
407         Reported by Jim Meyering  <jim@meyering.net>.
408
409 2005-09-13  Jim Meyering  <jim@meyering.net>
410
411         * canon-host.c: Filter through gnu indent and reword comments slightly.
412         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
413
414 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
415
416         * lib/base64.c: Typo.
417         (base64_encode): Put b64str in initialized data section.
418
419 2005-09-12  Derek Price  <derek@ximbiot.com>
420
421         Return usable errors from canon-host.
422         * canon-host.h: New file.
423         * canon-host.c (canon_host): Wrap...
424         (canon_host_r): ...this new function, which now relies exclusively on
425         getaddrinfo.
426         (ch_strerror): New function.
427         (last_cherror): New global.
428         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
429         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
430         void *.
431         (freeaddrinfo): Free ai->ai_canonname when set.
432
433 2005-09-12  Derek Price  <derek@ximbiot.com>
434             Paul Eggert  <eggert@cs.ucla.edu>
435
436         * glob-libc.h: Renamed from glob_.h.  The new version is
437         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
438         protecting things that should be done only in gnulib contexts.
439         * glob_.h: New file, containing only the glob things needed for
440         gnulib.
441         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
442         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
443         (glob, globfree, glob_pattern_p): Now defined simply in terms of
444         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
445         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
446         and to respect the namespace rules better.
447
448 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
449
450         Merge glibc and coreutils changes into gnulib, plus a few
451         extra fixes.
452         * md5.c: Use #error rather than a string.
453         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
454         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
455         (__attribute__): Define to empty for non recent-GCC.
456         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
457         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
458         Renamed from their non-__ counterparts, with new macros replacing
459         them if not _LIBC.  Add __THROW attribute.
460         (rol): Remove.
461         (struct md5_ctx): Align buffer if using GCC.
462         * sha1.h (struct sha1_ctx): Likewise.
463         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
464         The old name was backwards.
465         (NOTSWAP): Remove; not used.
466         (rol): New macro, moved here from md5.h.
467         (sha1_process_block): Remove a FIXME that doesn't make sense.
468
469 2005-09-12  Derek Price  <derek@ximbiot.com>
470
471         * gai_strerror.c: Include config.h when available.  Include
472         getaddrinfo.h before other headers to test interface.
473         Reported by Larry Jones <lawrence.jones@ugs.com>.
474
475 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
476
477         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
478         definitions, since that's the preferred style in glibc.
479         Fix a minor spacing issue, and update copyright notice to match glibc's.
480
481 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
482
483         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
484
485 2005-09-06  Simon Josefsson  <jas@extundo.com>
486
487         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
488         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
489
490 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
491
492         Change bitset word type from unsigned int to unsigned long int,
493         as this has better performance on typical 64-bit hosts.
494         Port bitset code to hosts with unusual word sizes.
495         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
496         (build_collating_symbol):
497         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
498         argument is a bitset.  This is merely a style issue, but it makes
499         it clearer that an entire array is expected.
500         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
501         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
502         Port to the case where bitset_word is not the same as unsigned int.
503         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
504         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
505         Likewise.
506         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
507         (build_trtable, group_nodes_into_DFAstates):
508         Likewise.
509         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
510         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
511         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
512         * regexec.c (group_nodes_into_DFAstates): Likewise.
513         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
514         * regcomp.c (optimize_subexps, lower_subexp):
515         Work even if bitset_word has holes in its bitwise representation.
516         * regex_internal.h (BITSET_WORD_BITS): Likewise.
517         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
518         Likewise.
519         * regex_internal.c (re_string_reconstruct):
520         Don't assume UCHAR_MAX == 255.
521         * regex_internal.h (bitset_set_all): Likewise.
522         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
523         All uses changed.
524         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
525         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
526         All uses changed.
527         (BITSET_WORD_MAX): New macro.
528         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
529         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
530         (bitset_empty, bitset_copy):
531         Prefer sizeof (bitset) to multiplying it out ourselves.
532         (bitset_not_merge): Remove; unused.
533         (bitset_contain): Return bool, not unsigned int with one bit on.
534         All callers changed.
535         * regexec.c (build_trtable): Don't assume bitset has no stricter
536         alignment than re_node_set; do this by defining a new internal
537         type struct dests_alloc and using it to allocate memory.
538
539 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
540
541         Check for arithmetic overflow when calculating sizes, to prevent
542         some buffer-overflow issues.  These patches are conservative, in the
543         sense that when I couldn't determine whether an overflow was possible,
544         I inserted a run-time check.
545         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
546         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
547         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
548         (re_xnrealloc, re_x2nrealloc): New inline functions.
549         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
550         (build_equiv_class, build_charclass): Check for arithmetic overflow
551         in size expression calculations.
552         * lib/regex_internal.c (re_string_realloc_buffers):
553         (build_wcs_upper_buffer, re_node_set_add_intersect):
554         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
555         (re_dfa_add_node, register_state): Likewise.
556         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
557         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
558         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
559         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
560
561 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
562
563         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
564         to avoid a collision with bits/local_lim.h in glibc.
565         All uses changed.  Problem reported by Dmitry V. Levin in
566         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
567
568         * regex_internal.c (build_wcs_upper_buffer): Fix portability
569         bugs in int versus size_t comparisons.
570         (re_string_context_at): Fix bug where the code assumed that
571         Idx is signed.
572
573         Use bool where appropriate.
574         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
575         All callers changed.
576         (calc_eclosure_iter): Likewise, for ROOT arg.
577         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
578         (build_charclass_op): Likewise, for NON_MATCH arg.
579         * regex_internal.c (re_string_allocate, re_string_construct):
580         (re_string_construct_common): Likewise, for ICASE arg.
581         * regexec.c (re_search_2_stub, re_search_stub):
582         Likewise, for RET_LEN arg.
583         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
584         (set_regs): Likewise, for FL_BACKTRACK arg.
585         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
586         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
587         (calc_eclosure_iter, parse_bracket_exp):
588         Use bool for internal variables that are booleans.
589         * regexec.c (re_search_internal, check_matching, proceed_next_node):
590         (set_regs, build_sifted_states, sift_states_bkref):
591         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
592         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
593         (find_collation_sequence_value):
594         Likewise.
595         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
596         (re_node_set_compare):
597         Return bool, not int. All callers changed.
598         * regexec.c (check_halt_node_context, check_dst_limits):
599         (build_trtable, check_node_accept): Likewise.
600         * regex_internal.h: Include stdbool.h.
601
602         Fix bugs uncovered when converting to bool.
603         * regcomp.c (calc_eclosure_iter): Check for storage allocation
604         failure instead of charging ahead blindly.
605         * regex_internal.c (register_state): Likewise.
606         * regexec.c (re_search_2_stub): Use simpler method than boolean
607         for freeing internal storage.
608         (group_nodes_into_DFA_states): Use unsigned int, not int, for
609         bitset pieces used as boolean, to avoid undefined behavior
610         on hosts that do int overflow checking.
611
612 2005-08-31  Derek Price  <derek@ximbiot.com>
613
614         * getdelim.c (getdelim): Return EOF on EOF.
615         Reported by Larry Jones <lawrence.jones@ugs.com>.
616
617 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
618
619         * regex_internal.c (re_string_reconstruct): Don't assume buffer
620         lengths fit in regoff_t; this isn't true if regoff_t is the same
621         width as size_t.
622         * regex.c (re_search_internal): 5th arg is LAST_START
623         (= START + RANGE) instead of RANGE.  This avoids overflow
624         problems when regoff_t is the same width as size_t.
625         All callers changed.
626         (re_search_2_stub): Check for overflow when adding the
627         sizes of the two strings.
628         (re_search_stub): Check for overflow when adding START
629         to RANGE; if it occurs, substitute the extreme value.
630
631 2005-08-31  Jim Meyering  <jim@meyering.net>
632
633         * regcomp.c (search_duplicated_node): Make first pointer arg
634         a pointer-to-const.
635         * regex_internal.c (create_ci_newstate, create_cd_newstate):
636         (register_state): Likewise.
637         * regexec.c (search_cur_bkref_entry, check_dst_limits):
638         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
639         (group_nodes_into_DFAstates): Likewise.
640
641 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
642
643         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
644         old glibc regex code mishandles strings longer than 2**31 bytes.
645         This patch fixes this when the regex code is used in gnulib
646         (i.e., outside glibc).
647
648         This patch should not affect the use of the regex code inside
649         glibc.  No doubt this problem also needs to be handled for glibc
650         as well, but the result will be an incompatible change to the
651         glibc ABI, and the old ABI will have to be supported too.  That
652         can be the the subject for another patch.
653
654         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
655         governing whether the rest of this patch is active.  By default,
656         the macro is disabled and the patch has no effect.
657         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
658         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
659         (struct re_pattern_buffer, re_search, re_search_2, re_match):
660         (re_match_2, re_set_registers): Use the new types.
661         * regex_internal.h (Idx, re_hashval_t): New types.
662         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
663         New macros.
664         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
665         (re_string_context_at, bin_tree_t, re_dfastate_t):
666         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
667         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
668         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
669         (re_string_char_size_at, re_string_wchar_at):
670         (re_string_elem_size_at):
671         Use the new types and macros to port to 64-bit hosts.
672         Use unsigned types for internal values, so that the code
673         mostly works even for arrays larger than SSIZE_MAX.
674         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
675         (search_duplicated_node, calc_eclosure_iter, fetch_number):
676         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
677         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
678         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
679         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
680         (calc_inveclosure, parse_dup_op, build_range_exp):
681         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
682         (fetch_number, create_token_tree, mark_opt_subexp):
683         Likewise.
684         * regex_internal.c (re_string_construct_common, create_ci_newstate):
685         (create_cd_newstate, re_string_allocate, re_string_construct):
686         (re_string_realloc_buffers, build_wcs_upper_buffer):
687         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
688         (re_string_reconstruct, re_string_peek_byte_case):
689         (re_string_fetch_byte_case, re_string_context_at):
690         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
691         (re_node_set_init_copy, re_node_set_add_intersect):
692         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
693         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
694         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
695         (re_acquire_state, re_acquire_state_context, register_state):
696         Likewise.
697         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
698         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
699         (re_search_internal, re_search_2_stub, re_search_stub)
700         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
701         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
702         (update_cur_sifted_state, check_dst_limits):
703         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
704         (check_subexp_limits, sift_states_bkref, merge_state_array):
705         (check_subexp_matching_top, get_subexp, get_subexp_sub):
706         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
707         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
708         (expand_bkref_cache, check_node_accept_bytes):
709         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
710         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
711         (acquire_init_state_context, check_halt_node_context):
712         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
713         (sift_states_backward, clean_state_log_if_needed):
714         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
715         (find_recover_state, transit_state_sb, transit_state_mb):
716         (transit_state_bkref, build_trtable, match_ctx_clean):
717         Likewise.
718         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
719         to work around an assumption that REG_MISSING is negative.
720
721         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
722         (seek_collating_symbol_entry) [defined _LIBC]:
723         (lookup_collation_sequence_value) [defined _LIBC]:
724         (build_range_exp, build_collating_symbol) [defined _LIBC]:
725         Use prototypes rather than old-style function definitions.
726         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
727         (transit_state_sb) [0]:
728         (find_collation_sequence_value) [defined _LIBC]: Likewise.
729
730         * regexec.c (re_search_internal): Simplify update of rm_so and
731         rm_eo.
732
733         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
734         (optimize_subexps, lower_subexp):
735         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
736         since the signed shift might overflow.  Use 1u<<31 instead.
737         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
738         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
739         Likewise.
740
741         * regcomp.c (optimize_subexps, lower_subexp):
742         Use CHAR_BIT rather than 8, for clarity.
743         * regexec.c (check_dst_limits_calc_pos_1):
744         (check_subexp_matching_top): Likewise.
745         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
746         have to worry about portability issues when shifting it left.
747         Remove no-longer-needed test for table_size > 0.
748         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
749         in a word, as the resulting behavior is undefined.
750         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
751         in one case, a <= should have been an <, and in another case the
752         whole test was missing.
753         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
754         the standard name CHAR_BIT.
755         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
756         this is not true on one's complement and signed-magnitude hosts.
757
758         * regex_internal.h (re_sub_match_top_t): Remove unused member
759         next_last_offset.
760         (struct re_dfa_t): Remove unused member states_alloc.
761         * regcomp.c (init_dfa): Don't initialize unused members.
762
763 2005-08-31  Bruno Haible  <bruno@clisp.org>
764
765         * strstr.c: Include <stddef.h>, for NULL.
766         * strcasestr.c: Likewise.
767         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
768
769 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
770
771         * iconvme.h: Add prototype for iconv_alloc.
772
773 2005-08-29  Simon Josefsson  <jas@extundo.com>
774
775         * iconvme.c: Fix errno.
776
777 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
778
779         * iconvme.c: Split iconv_string into iconv_alloc.
780
781 2005-08-27  Jim Meyering  <jim@meyering.net>
782
783         * fopen-safer.c: Merge minor changes from coreutils.
784         * dup-safer.c: Likewise.
785         * fd-safer.c: Likewise.
786
787         Merge from coreutils.
788         * stdio--.h: New file.
789         * stdlib--.h: New file.
790         * mkstemp-safer.c: New file.
791
792         GNU tar needs these.
793         * pipe-safer.c: New file.
794         * creat-safer.c: New file.
795         * fcntl--.h (creat): Define to creat_safer.
796         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
797         * unistd--.h (pipe): Define to pipe_safer.
798         * unistd-safer.h: Declare pipe_safer.
799
800 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
801
802         * regex_internal.h: Remove all references to
803         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
804         or better.
805         (bitset_not, bitset_merge, bitset_not_merge):
806         (bitset_mask, re_string_allocate, re_string_construct):
807         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
808         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
809         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
810         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
811         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
812         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
813         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
814         (re_acquire_state_context):
815         Remove unnecessary forward decls.
816         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
817         Put __attribute at function definition,
818         now that the function decl has been removed.
819         * lib/regex_internal.c (re_string_peek_byte_case):
820         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
821         Likewise.
822
823 2005-08-26  Simon Josefsson  <jas@extundo.com>
824
825         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
826         Haible <bruno@clisp.org>.
827
828 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
829
830         * regexec.c (set_regs): Don't alloca with an unbounded size.
831
832         alloca modernization/simplification for regex.
833         * regex.c: Remove portability cruft for alloca.  This no longer
834         needs to be at the start of the file, and can be moved into
835         regex_internal.h and simplified.
836         * regex_internal.h: Include <alloca.h>.
837         (__libc_use_alloca) [!defined _LIBC]: New macro.
838         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
839         now works outside glibc.
840
841 2005-08-24  Simon Josefsson  <jas@extundo.com>
842
843         * getpass.c: Add WIN32 implementation.  Conditionalize use of
844         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
845         GLIBC specific code.
846
847 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
848
849         Make regex safe for g++.  This fixes one real bug (an "err"
850         that should have been "*err").  g++ problem reported by
851         Sam Steingold.
852         * regex_internal.h (re_calloc): New macro, consistent with
853         re_malloc etc.  All callers of calloc changed to use re_calloc.
854         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
855         not int.  All callers changed.
856         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
857         just use an array of size MB_LEN_MAX.
858         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
859         (find_recover_state): Change "err" to "*err"; this fixes what
860         appears to be a real bug.
861         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
862         versus int.
863
864 2005-08-25  Jim Meyering  <jim@meyering.net>
865
866         * open-safer.c: Include <config.h>.
867         Otherwise, we'd lose LARGEFILE support in any file using
868         e.g. "fcntl--.h"
869
870 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
871
872         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
873         * regex.h (regerror): Likewise.
874
875         * regex.c: Do not include <sys/types.h>, as POSIX no longer
876         requires this.  (The code never needed it.)
877
878         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
879         All uses of recently-renamed identifiers changed to use the new,
880         POSIX-compliant names.  The code will build and run just fine
881         without these changes, but it's better to eat our own dog food
882         and use the standard-conforming names.
883
884         * regex.h: Fix a multitude of POSIX name space violations.
885         These changes have an effect only for programs that define
886         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
887         do not change anything for programs compiled in the normal way.
888         Also, there is no effect on the ABI.
889
890         (_REGEX_SOURCE): New macro.
891         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
892         defined and _GNU_SOURCE is not; this fixes a name space violation.
893
894         Rename the following macros to obey POSIX requirements.
895         The old names are still visible as macros if _REGEX_SOURCE is defined.
896         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
897         RE_BACKSLASH_ESCAPE_IN_LISTS.
898         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
899         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
900         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
901         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
902         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
903         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
904         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
905         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
906         (REG_INTERVALS): renamed from RE_INTERVALS.
907         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
908         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
909         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
910         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
911         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
912         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
913         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
914         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
915         RE_UNMATCHED_RIGHT_PAREN_ORD.
916         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
917         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
918         (REG_DEBUG): renamed from RE_DEBUG.
919         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
920         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
921         unusual, since we can't clash with the POSIX REG_ICASE.
922         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
923         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
924         (REG_NO_SUB): renamed from RE_NO_SUB.
925         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
926         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
927         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
928         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
929         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
930         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
931         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
932         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
933         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
934         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
935         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
936         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
937         RE_SYNTAX_POSIX_MINIMAL_BASIC.
938         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
939         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
940         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
941         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
942         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
943         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
944         (REG_FIXED): Renamed from REGS_FIXED.
945         (REG_NREGS): Renamed from RE_NREGS.
946
947         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
948         of other REG_* macros, since POSIX says the user is allowed to
949         #undef these macros selectively.
950
951         (reg_errcode_t): Update comment stating what other tables need
952         to be consistent.
953
954         Rename the following enum values to obey POSIX requirements.
955         The old names are still visible as macros.
956         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
957         is not defined, since GNU is supposed to be a superset of POSIX as
958         much as possible, and since we want reg_errcode_t to be a signed
959         type for implementation consistency.
960         (_REG_NOERROR): Renamed from REG_NOERROR.
961         (_REG_NOMATCH): Renamed from REG_NOMATCH.
962         (_REG_BADPAT): Renamed from REG_BADPAT.
963         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
964         (_REG_ECTYPE): Renamed from REG_ECTYPE.
965         (_REG_EESCAPE): Renamed from REG_EESCAPE.
966         (_REG_ESUBREG): Renamed from REG_ESUBREG.
967         (_REG_EBRACK): Renamed from REG_EBRACK.
968         (_REG_EPAREN): Renamed from REG_EPAREN.
969         (_REG_EBRACE): Renamed from REG_EBRACE.
970         (_REG_BADBR): Renamed from REG_BADBR.
971         (_REG_ERANGE): Renamed from REG_ERANGE.
972         (_REG_ESPACE): Renamed from REG_ESPACE.
973         (_REG_BADRPT): Renamed from REG_BADRPT.
974         (_REG_EEND): Renamed from REG_EEND.
975         (_REG_ESIZE): Renamed from REG_ESIZE.
976         (_REG_ERPAREN): Renamed from REG_ERPAREN.
977         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
978         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
979         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
980         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
981
982         (_REG_RE_NAME, _REG_RM_NAME): New macros.
983         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
984         changed.  But support the old name if the new one is not defined
985         and if _REGEX_SOURCE.
986
987         Change the following member names in struct re_pattern_buffer.
988         The old names are still supported if !_REGEX_SOURCE.
989         The new names are always supported, regardless of _REGEX_SOURCE.
990         (re_buffer): Renamed from buffer.
991         (re_allocated): Renamed from allocated.
992         (re_used): Renamed from used.
993         (re_syntax): Renamed from syntax.
994         (re_fastmap): Renamed from fastmap.
995         (re_translate): Renamed from translate.
996         (re_can_be_null): Renamed from can_be_null.
997         (re_regs_allocated): Renamed from regs_allocated.
998         (re_fastmap_accurate): Renamed from fastmap_accurate.
999         (re_no_sub): Renamed from no_sub.
1000         (re_not_bol): Renamed from not_bol.
1001         (re_not_eol): Renamed from not_eol.
1002         (re_newline_anchor): Renamed from newline_anchor.
1003
1004         Change the following member names in struct re_registers.
1005         The old names are still supported if !_REGEX_SOURCE.
1006         The new names are always supported, regardless of _REGEX_SOURCE.
1007         (rm_num_regs): Renamed from num_regs.
1008         (rm_start): Renamed from start.
1009         (rm_end): Renamed from end.
1010
1011         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1012         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1013         Prepend __ to parameter names.
1014
1015         Undo yesterday's changes.
1016
1017 2005-08-24  Jim Meyering  <jim@meyering.net>
1018
1019         Sync from coreutils.
1020         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1021
1022 2005-08-21  Bruno Haible  <bruno@clisp.org>
1023
1024         * lock.h: Add multiple inclusion guard.
1025         * tls.h: Add multiple inclusion guard.
1026
1027 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
1028
1029         * regex.h (REG_NOSYS)
1030         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1031         Define, since POSIX requires it as of 2001.
1032         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1033         New private symbol, used to keep the enum signed in all cases.
1034         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1035         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1036
1037         * regex_internal.c (re_string_skip_chars, register_state):
1038         (calc_state_hash):
1039         Remove forward decls; no longer needed now that we use prototypes.
1040         * regexec.c (acquire_init_state_context, check_halt_node_context):
1041         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1042         (clean_state_log_if_needed): Likewise.
1043
1044 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
1045
1046         Fix problems reported by Sam Steingold in
1047         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1048         * regexec.c (sift_states_bkref): Fix portability bug: the code
1049         assumed that reg_errcode_t is a signed type, which is not
1050         necessarily true if _XOPEN_SOURCE is not defined.
1051         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1052         some compilers warn about it otherwise.
1053
1054 2005-08-20  Jim Meyering  <jim@meyering.net>
1055
1056         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1057         of unused local, dfa.
1058
1059 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
1060
1061         * regcomp.c (create_initial_state): Remove duplicate decl.
1062         (init_word_char, create_initial_state, duplicate_node_closure):
1063         (fetch_token, peek_token_bracket, build_range_exp):
1064         (build_collating_symbol): Remove forward decls; no longer needed
1065         now that we use prototypes.
1066
1067         * regcomp.c:
1068         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1069         (re_compile_fastmap_iter, regcomp, regerror, regfree):
1070         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1071         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1072         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1073         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1074         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1075         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1076         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1077         (build_range_exp, build_collating_symbol, parse_bracket_exp):
1078         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1079         (build_charclass, build_charclass_op, fetch_number, create_tree):
1080         (create_token_tree, mark_opt_subexp, duplicate_tree):
1081         Use prototypes rather than old-style definitions.
1082
1083         * regex_internal.c:
1084         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1085         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1086         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1087         (re_string_reconstruct, re_string_peek_byte_case):
1088         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1089         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1090         (re_node_set_init_copy, re_node_set_add_intersect):
1091         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1092         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1093         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1094         (re_acquire_state, re_acquire_state_context, register_state):
1095         (create_ci_newstate, create_cd_newstate, free_state):
1096         Likewise.
1097         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1098         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1099         (re_search_internal, prune_impossible_nodes):
1100         (acquire_init_state_context, check_matching, static):
1101         (check_halt_node_context, check_halt_state_context, proceed_next_node):
1102         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1103         (update_regs, sift_states_backward, build_sifted_states):
1104         (clean_state_log_if_needed, merge_state_array):
1105         (update_cur_sifted_state, add_epsilon_src_nodes):
1106         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1107         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1108         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1109         (find_recover_state, check_subexp_matching_top, transit_state_mb):
1110         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1111         (check_arrival, check_arrival_add_next_nodes):
1112         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1113         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1114         (check_node_accept_bytes, check_node_accept, extend_buffers):
1115         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1116         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1117         (sift_ctx_init):
1118         Likewise.
1119
1120         * regex_internal.h:
1121         (re_string_allocate, re_string_construct, re_string_reconstruct):
1122         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1123         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1124         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1125         (re_string_context_at, re_string_peek_byte_case):
1126         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1127         is defined, since we now use prototypes always.
1128
1129         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
1130         C89 or better.  All uses removed.
1131
1132 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
1133
1134         * regex_internal.c (re_acquire_state, re_acquire_state_context)
1135         [defined lint]: Suppress bogus uninitialized-variable warnings.
1136
1137         * regcomp.c (duplicate_node): Return new index, not an error code,
1138         and let the caller return REG_ESPACE if out of space.  This
1139         removes an uninitialied-variable warning with GCC 4.0.1, and also
1140         avoids taking the address of a local variable.  All callers
1141         changed.
1142
1143 2005-08-19  Jim Meyering  <jim@meyering.net>
1144
1145         * regexec.c (proceed_next_node): Redo local variables to
1146         avoid GCC shadowing warnings.
1147
1148 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
1149
1150         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1151         (re_node_set_insert_last, re_dfa_add_node):
1152         Rename local variables to avoid GCC shadowing warnings.
1153
1154 2005-08-18  Bruno Haible  <bruno@clisp.org>
1155
1156         * strstr.c (strstr): Fix return value in multibyte case.
1157         * strcasestr.c (strcasestr): Likewise.
1158
1159 2005-08-17  Jim Meyering  <jim@meyering.net>
1160
1161         Make the %s format (seconds since the epoch) work for a negative
1162         number and when used with a zero-padded field width, e.g. %015s.
1163
1164         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1165         label so that it precedes the code to set `digits'.  Otherwise,
1166         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
1167         print `00-22'.  Now, it prints `-0022', as it should.
1168
1169 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
1170
1171         * regex.h: Remove useless space-before-tab.  From coreutils.
1172
1173 2005-08-17  Bruno Haible  <bruno@clisp.org>
1174
1175         * strcasestr.h: New file.
1176         * strcasestr.c: New file.
1177
1178 2005-08-17  Bruno Haible  <bruno@clisp.org>
1179
1180         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1181         * strstr.c: Completely rewritten, with multibyte locale support.
1182
1183 2005-08-17  Bruno Haible  <bruno@clisp.org>
1184
1185         * strcasecmp.c: Use mbuiter.h.
1186
1187 2005-08-17  Bruno Haible  <bruno@clisp.org>
1188
1189         * mbuiter.h: New file.
1190
1191 2005-08-16  Bruno Haible  <bruno@clisp.org>
1192
1193         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1194         (mbi_init): Update.
1195         (mbi_avail, mbi_advance): Let the iteration end before the terminating
1196         NUL byte, not after it.
1197
1198 2005-08-16  Bruno Haible  <bruno@clisp.org>
1199
1200         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1201         the valid ones. Makes the comparison operations transitive:
1202         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1203         * strcasecmp.c (strcasecmp): Use mb_casecmp.
1204
1205 2005-08-16  Bruno Haible  <bruno@clisp.org>
1206
1207         * strcase.h (strcasecmp): Add note in comments.
1208         * strncasecmp.c: Use code from strcasecmp.c.
1209         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1210         (strcasecmp): Work correctly in multibyte locales.
1211
1212 2005-08-16  Bruno Haible  <bruno@clisp.org>
1213
1214         * strnlen1.h: New file.
1215         * strnlen1.c: New file.
1216
1217 2005-08-16  Bruno Haible  <bruno@clisp.org>
1218
1219         * mbfile.h: New file.
1220
1221 2005-08-16  Bruno Haible  <bruno@clisp.org>
1222
1223         * mbiter.h: New file.
1224
1225 2005-08-16  Bruno Haible  <bruno@clisp.org>
1226
1227         * mbchar.h: New file.
1228         * mbchar.c: New file.
1229
1230 2005-08-16  Bruno Haible  <bruno@clisp.org>
1231
1232         * tls.h: New file, from GNU gettext.
1233         * tls.c: New file, from GNU gettext.
1234
1235 2005-08-15  Bruno Haible  <bruno@clisp.org>
1236
1237         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1238         is defined.
1239
1240 2005-08-14  Jim Meyering  <jim@meyering.net>
1241
1242         Sync from coreutils.
1243
1244         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1245         Use the hash-table-based cycle-detection code not just when
1246         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1247         Reported by James Youngman in
1248         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1249         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1250         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1251         This lets us compile with -DFTS_DEBUG, once again.
1252         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1253         * fts.c (fd_safer): Remove decl.
1254         Include fcntl--.h rather than unistd-safer.h
1255         (fts_safe_changedir): Don't call fd_safer; no longer needed
1256         now that we include fcntl--.h.
1257
1258 2005-08-11  Simon Josefsson  <jas@extundo.com>
1259
1260         * readline.h, readline.c: New file.
1261
1262 2005-08-11  Bruno Haible  <bruno@clisp.org>
1263
1264         * strnlen.h (strnlen): Change parameter name to match comment.
1265
1266 2005-08-10  Simon Josefsson  <jas@extundo.com>
1267
1268         * strndup.c: Use strnlen.h.
1269
1270         * strnlen.h: New file.
1271
1272 2005-08-02  Simon Josefsson  <jas@extundo.com>
1273
1274         * getline.h, getline.c: Rewrite.
1275
1276         * getdelim.h, getdelim.c: New files, ported from glibc.
1277
1278 2005-07-31  Bruno Haible  <bruno@clisp.org>
1279
1280         * lock.h (gl_lock_initializer): New macro.
1281         (gl_lock_define_initialized): Use it.
1282         (gl_rwlock_initializer): New macro.
1283         (gl_rwlock_define_initialized): Use it.
1284         (gl_recursive_lock_initializer): New macro.
1285         (gl_recursive_lock_define_initialized): Use it.
1286
1287 2005-07-26  Bruno Haible  <bruno@clisp.org>
1288
1289         * lock.h: Update from GNU gettext.
1290         * lock.c: Update from GNU gettext.
1291
1292 2005-07-18  Bruno Haible  <bruno@clisp.org>
1293
1294         * lock.h (gl_once_t): New type.
1295         (gl_once_define, gl_once): New macros.
1296         * lock.c (fresh_once): New variable.
1297         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1298         functions.
1299
1300 2005-07-18  Simon Josefsson  <jas@extundo.com>
1301
1302         * check-version.c (check_version): Accept identical versions too.
1303
1304 2005-07-18  Bruno Haible  <bruno@clisp.org>
1305
1306         * lock.h: New file, from GNU gettext.
1307         * lock.c: New file, from GNU gettext.
1308
1309 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
1310
1311         * quotearg.c: Add translator comment suggested by Bruno Haible,
1312         with a minor change.
1313
1314 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
1315
1316         * version-etc-fsf.c (version_etc_copyright): Parameterize the
1317         copyright symbol and the year.
1318         * version-etc.c (COPYRIGHT_YEAR): New constant.
1319         (version_etc_va): Use parameterized copyright notice.
1320         Reword to conform to the current GNU coding standards.
1321
1322 2005-07-11  Simon Josefsson  <jas@extundo.com>
1323
1324         * size_max.h: New file.
1325
1326 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1327
1328         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1329         block of defines.
1330
1331 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
1332        and  Paul Eggert  <eggert@cs.ucla.edu>
1333
1334         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1335         in wint_t, not wchar_t.  Remove now-unnecessary cast.
1336
1337 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
1338
1339         * regex.c, regex.h: Sync from libc.
1340         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1341         New files, synced from libc, except that regex_internal.h
1342         currently has a small porting fix.
1343
1344 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
1345
1346         Remove the dependency of the strftime module on the tzset module.
1347         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1348         Copy the input structure, to work around some of the bug with
1349         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
1350         Solaris releases, you should also use the tzset module, but we won't
1351         require it as a dependency any more since we don't want LGPLed code
1352         to depend on GPLed code.
1353
1354 2005-07-02  Jim Meyering  <jim@meyering.net>
1355
1356         * backupfile.c (backup_args): Change a `0' to NULL.
1357
1358 2005-07-01  Jim Meyering  <jim@meyering.net>
1359
1360         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1361         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1362         * save-cwd.c, tempname.c:
1363         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1364         and don't include <sys/file.h>).
1365
1366 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
1367
1368         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1369         declares only 'struct timespec;' (!).
1370
1371 2005-06-29  Jim Meyering  <jim@meyering.net>
1372
1373         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1374         type name.  Use the variable name instead.
1375         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1376
1377 2005-06-28  Simon Josefsson  <jas@extundo.com>
1378
1379         * check-version.h, check-version.c: New files.
1380
1381 2005-06-28  Simon Josefsson  <jas@extundo.com>
1382
1383         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
1384         collision with global variable.  Better indentation.  Don't
1385         increment buffer pointer beyond buffer end.  Based on comments
1386         from Paul Eggert <eggert@cs.ucla.edu>.
1387
1388         * base64.h: Indent.
1389
1390 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
1391
1392         * canon-host.c (canon-host): Append trailing "," to 0 in
1393         initializer of struct addrinfo, as an indication that we don't
1394         care how many members the structure has.
1395
1396 2005-06-24  Derek Price  <derek@ximbiot.com>
1397         and Bruno Haible  <bruno@clisp.org>
1398
1399         Remove stat module & update lstat.
1400         * stat.c: Remove this file...
1401         (slash_aware_lstat): ...moving this content and its support...
1402         * lstat.c (rpl_lstat): ...into here.
1403         * lstat.h: New file.
1404
1405 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
1406
1407         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
1408         (ranged_convert): Don't save conversion in a temporary struct.
1409         This causes a warning with GCC 4.0.0, and anyway in the typical
1410         case it's not worth the extra 100 bytes or so of code.
1411         (ranged_convert, __mktime_internal): When calling a function via a
1412         pointer P, use P () rather than (*P) (), as we now assume C89 or
1413         better.
1414
1415 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1416
1417         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
1418         "who -r" failed to give output.  Problem reported by Tim Waugh.
1419
1420         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
1421         (xcalloc): Use it to avoid needless tests.
1422         Problem reported by Jim Meyering.
1423
1424 2005-06-16  Jim Meyering  <jim@meyering.net>
1425
1426         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
1427         when either N or S is zero.
1428
1429 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1430
1431         * argp.h (__option_is_short): Check upper limit of
1432         __key. Isprint() requires its argument to have the value
1433         of an unsigned char or EOF.
1434
1435 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
1436
1437         * fnmatch.c (fnmatch): If there is an encoding error in a
1438         multibyte string or pattern, fall back on unibyte matching.
1439         Problem reported by James Youngman.
1440
1441 2005-06-08  Bruno Haible  <bruno@clisp.org>
1442
1443         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
1444         warning on mingw.
1445
1446 2005-06-08  Bruno Haible  <bruno@clisp.org>
1447
1448         * csharpcomp.h: New file, from GNU gettext.
1449         * csharpcomp.c: New file, from GNU gettext.
1450         * csharpcomp.sh.in: New file, from GNU gettext.
1451
1452 2005-06-07  Derek Price  <derek@ximbiot.com>
1453
1454         Sync from CVS.
1455         * glob_.h: Indent nested #ifdef.
1456
1457 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
1458
1459         Sync from coreutils.
1460         Use "file name" when talking about file names, instead of "filename"
1461         or "path", as per the GNU coding standards.
1462         * mkdir-p.c: Renamed from makepath.c.
1463         (make_dir_parents): Renamed from make_path.  All callers changed.
1464         * mkdir-p.h: Likewise.  All includers changed.
1465         * filenamecat.c: Renamed from path-concat.c.
1466         (file_name_concat): Renamed from path_concat.  All callers changed.
1467         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
1468         * filenamecat.h: Likewise.  All includers changed.
1469         * acl.c: Don't use "path" or "filename" to mean "file name"
1470         in comments or local variable names.
1471         * basename.c: Likewise.
1472         * canonicalize.c, canonicalize.h: Likewise.
1473         * dirname.c, dirname.h: Likewise.
1474         * euidaccess.c: Likewise.
1475         * exclude.c: Likewise
1476         * fnmatch_.h, fnmatch_loop.c: Likewise.
1477         * fsusage.c, fsuage.h: Likewise.
1478         * fts.c, fts_.h: Likewise.
1479         * getcwd.c: Likewise.
1480         * getloadavg.c: Likewise.
1481         * mkstemp.c: Likewise.
1482         * mountlist.c, mountlist.h: Likewise.
1483         * openat.c, openat.h: Likewise.
1484         * readlink-stub.c: Likewise.
1485         * readutmp.c, readutmp.h: Likewise.
1486         * rename.c: Likewise.
1487         * rmdir.c: Likewise.
1488         * same.c: Likewise.
1489         * savedir.c: Likewise.
1490         * stripslash.c: Likewise.
1491         * tempname.c: Likewise.
1492         * xreadlink.c: Likewise.
1493         * exclude.c (excluded_file_name): Renamed from excluded_filename.
1494         All uses changed.
1495         * exclude.h: Likewise.
1496
1497         * euidaccess.c (getuid, getgid, getuid, getegid)
1498         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1499         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
1500         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1501         * pathmax.h: Include <limits.h> unconditionally, since other
1502         files have been getting away with it for years (MORE/BSD 4.3
1503         is extinct now).
1504         * userspec.c (getpwnam, getgrnam, getgrgid)
1505         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1506
1507         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1508         Define to 256, not 255, as per modern POSIX.
1509
1510 2005-06-01  Bruno Haible  <bruno@clisp.org>
1511
1512         * csharpexec.h: New file, from GNU gettext.
1513         * csharpexec.c: New file, from GNU gettext.
1514         * csharpexec.sh.in: New file, from GNU gettext.
1515
1516 2005-05-31  Derek Price  <derek@ximbiot.com>
1517             Paul Eggert  <eggert@cs.ucla.edu>
1518
1519         Sync from cvs.
1520         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
1521
1522 2005-05-29  Derek Price  <derek@ximbiot.com>
1523             Paul Eggert  <eggert@cs.ucla.edu>
1524
1525         * glob_.h, glob.c: New files.
1526
1527 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
1528
1529         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
1530
1531         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
1532         the configuration hassle isn't worth it.
1533         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
1534         (LONGEST_MODIFIER, PRIuMAX): Remove.
1535
1536 2005-05-27  Bruno Haible  <bruno@clisp.org>
1537
1538         * getlogin_r.h: Remove second include of <stddef.h>.
1539
1540 2005-05-25  Bruno Haible  <bruno@clisp.org>
1541             Derek Price  <derek@ximbiot.com>
1542
1543         * getlogin_r.h: Simplify API documentation.
1544
1545 2005-05-25  Derek Price  <derek@ximbiot.com>
1546             Paul Eggert  <eggert@cs.ucla.edu>
1547
1548         * getlogin_r.c, getlogin_r.h: New files.
1549
1550 2005-05-22  Bruno Haible  <bruno@clisp.org>
1551
1552         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
1553         Also include <sys/param.h> if it defines MIN, MAX.
1554         Based on a patch by Derek Price <derek@ximbiot.com>.
1555
1556 2005-05-22  Bruno Haible  <bruno@clisp.org>
1557
1558         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
1559         (INT64_MIN): Fix definition.
1560         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1561
1562         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
1563         NEED_SIGNED_INT_TYPES.
1564
1565         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
1566         HAVE_SYSTEM_INTTYPES.
1567
1568 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
1569
1570         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
1571         so that unistd-safer.h (GPL'ed code) need not be included.
1572
1573 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
1574
1575         New fts module.
1576         * fts.c: Don't include "cycle-check.h" or "hash.h".
1577         (setup_dir, free_dir): New functions.
1578         (enter_dir, leave_dir): Define trivial
1579         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
1580         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
1581         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
1582         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
1583         Move to fts-cycle.c.
1584         (fts_open): Use setup_dir.
1585         (fts_close): Use free_dir.
1586         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
1587         This adds a label and some gotos, but the alternatives were messier.
1588         Check for memory allocation failure when entering a dir.
1589         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
1590         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
1591         (FTS): New member fts_cycle, that is a union that contains the
1592         old active_dir_ht and cycle_state.  All uses changed to mention
1593         fts_cycle.ht and fts_cycle.state.
1594         * fts-cycle.c: New file, containing GPL'ed code migrated out of
1595         fts.c, with the following changes:
1596         (setup_dir, free_dir): New functions.
1597         (enter_dir): Now returns bool.  Return true if successful, false
1598         if memory exhausted.  All callers changed.
1599         Do not bother partly cleaning up on
1600         memory allocation failure; that is free_dir's job.
1601         However, free ad if hash_insert fails, to avoid memory leak.
1602         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
1603         fts->fts_options to see which union member to use.
1604
1605 2005-05-20  Jim Meyering  <jim@meyering.net>
1606
1607         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
1608         Now a macro, to pacify GCC.
1609
1610 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
1611
1612         * chown.c (rpl_chown): Return -1 on failure.
1613
1614 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
1615
1616         * canonicalize.c: Include canonicalize.h first, to test interface.
1617         Include <stddef.h> unconditionally, since we assume C89 now.
1618         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
1619         * fts.c: Include fts_.h first, to check interface.
1620         Do not include intprops.h; no longer needed.
1621         Include cycle-check.h and hash.h, since fts_.h no longer does.
1622         Remove unnecessary casts of closedir to void.
1623         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
1624         decide whether to decrement nlinks.
1625         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
1626         (FTS): Use struct hash_table * instead of Hash_table, so that
1627         we no longer need to include hash.h here.
1628
1629 2005-05-17  Jim Meyering  <jim@meyering.net>
1630
1631         * fts.c, fts_.h: New files, from coreutils.
1632
1633 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
1634
1635         Sync from coreutils.
1636         * unlinkdir.c, unlinkdir.h: New files.
1637         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
1638         regex.h, unlocked-io.h, xtime.h:
1639         White space changes only.
1640         * makepath.c (make_path): Port to hosts where leading "//" is special.
1641         * yesno.c: Include getline.h, not ctype.h.
1642         (yesno): Don't remove leading white space; POSIX doesn't allow it.
1643         Use getline to remove arbitrary restriction on response length.
1644
1645 2005-05-13  Bruno Haible  <bruno@clisp.org>
1646
1647         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
1648         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
1649         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
1650         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
1651         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
1652         Add support for 64-bit integers in the MSVC compiler.
1653
1654 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
1655
1656         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
1657         Change the initial comment to refer to GPL, not LGPL.
1658         gnulib-tool will change it to LGPL as needed.
1659
1660         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
1661         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
1662         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
1663         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
1664         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
1665         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
1666         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
1667         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
1668         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
1669         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
1670         concatpath.c, config.charset, copy-file.c, copy-file.h,
1671         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
1672         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
1673         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
1674         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
1675         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
1676         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
1677         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
1678         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
1679         full-read.c, full-read.h, full-write.c, full-write.h,
1680         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
1681         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
1682         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
1683         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
1684         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
1685         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
1686         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
1687         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
1688         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
1689         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
1690         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
1691         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
1692         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
1693         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
1694         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
1695         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
1696         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
1697         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
1698         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
1699         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
1700         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
1701         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
1702         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
1703         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
1704         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
1705         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
1706         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
1707         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
1708         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
1709         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
1710         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
1711         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
1712         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
1713         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
1714         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
1715         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
1716         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
1717         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
1718         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
1719         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
1720         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
1721         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
1722         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
1723         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
1724         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
1725         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
1726         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
1727         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
1728         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
1729         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
1730         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
1731         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
1732         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
1733         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
1734         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
1735         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
1736         Update FSF postal mail address.
1737
1738 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1739
1740         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
1741         specified in ai_socktype. Fix invalid ai_protocol
1742         check. ai_protocol is usually set to 0 or depending on
1743         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
1744         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
1745         ai_socktype / ai_protocol in the returned addrinfo structure.
1746
1747 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1748             Bruno Haible  <bruno@clisp.org>
1749
1750         * inet_ntop.h: New file.
1751         * inet_ntop.c: New file, from glibc with modifications.
1752
1753 2005-05-08  Jim Meyering  <jim@meyering.net>
1754
1755         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
1756
1757 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
1758
1759         Merge from coreutils.  Among other things,
1760         add bulletproofing for cases where stdin, stdout, or stderr are closed.
1761         * fd-safer.c: New file.
1762         * fcntl-safer.h, open-safer.c: Remove.
1763         * chdir-long.c: Fix comment "fetish" -> "coreutils".
1764         * dup-safer.c: Include unistd-safer.h first.
1765         Don't include errno.h.
1766         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
1767         * file-type.h: Don't assume invoker included sys/stat.h first.
1768         * file-type.c: Rely on file-type.h change.
1769         * getloadavg.c: Include unistd-safer.h.
1770         (getloadavg): Use safer open.
1771         * getusershell.c: Include "stdio-safer.h".
1772         (getusershell): Use safer fopen.
1773         * long-options.c (long_options): Use NULL rather than 0.
1774         * modechange.h (mode_free): Remove; all callers changed to invoke
1775         'free'.
1776         * modechange.c: Likewise.
1777         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
1778         (MODE_DONE): New constant.
1779         (struct mode_change): Remove 'next' member.
1780         (make_node_op_equals): New function; like the old one of the
1781         same name, except it allocates an array.
1782         (mode_compile, mode_create_from_ref): Use it.
1783         (mode_compile): Allocate result as an array, not a linked list.
1784         Parse octal string ourself, so that we catch mistakes like "+0".
1785         (mode_adjust): Arg is an array, not a linked list.
1786         * modechange.c: Include stat-macros.h, xalloc.h.
1787         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
1788         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
1789         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
1790         Remove.  This is now stat-macros.h's job.
1791         (talloc): Remove.  All callers replaced by xalloc, so that
1792         our invokers don't have to worry about reporting memory failures.
1793         (make_node_op_equals): Remove.
1794         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1795         New constants.
1796         (struct mode_change): Moved here from modechange.h.
1797         (mode_append_entry): Remove.
1798         (mode_compile): Remove MASKED_OPS arg, since it encouraged
1799         apps to have incorrect behavior.  Use simpler algorithm for head
1800         and tail.  Don't futz with umask; that's now the job of mode_adjust.
1801         Detect more invalid usages rather than having somewhat-random behavior.
1802         Don't insert an "a=" action, as that leads to incorrect behavior.
1803         (mode_compile, mode_create_from_ref): Return NULL on error instead
1804         of an enum, since now there's only one way to have an error.  All
1805         callers changed.
1806         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
1807         at the correct time.  Simplify calculation of "+u" and its ilk.
1808         Don't mishandle "+X".
1809         (mode_free): Remove "register" and localize decls.
1810         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1811         (struct mode_change): Move to modechange.c; callers don't
1812         need to see this stuff.
1813         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
1814         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
1815         (mode_change, mode_adjust): Reflect the new signatures noted above.
1816         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
1817         that might redefine system include files.
1818         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
1819         (my_usleep): Use NULL rather than (void *) 0.
1820         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
1821         Use siginterrupt to specify that system calls should be interrupted.
1822         (rpl_nanosleep): Move initialization of suspended closer to call of
1823         my_usleep.
1824         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
1825         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
1826         (desirable_utmp_entry): New function.
1827         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
1828         using x2nrealloc, to simplify logic.
1829         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
1830         size calculation.  Do not assume utmp file is a regular file.
1831         * readutmp.h (UT_PID): Moved here from ../src/who.c.
1832         (READ_UTMP_CHECK_PIDS): New constant.
1833         * save-cwd.c: Include unistd-safer.h.
1834         (save_cwd): Use fd_safer.
1835         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
1836         [!_LIBC] Include "stat-macros.h" instead.
1837         * unistd-safer.h (fd_safer): New decl.
1838
1839 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
1840
1841         * byteswap_.h: New file.
1842
1843 2005-04-25  Albert Chin  <china@thewrittenword.com>
1844
1845         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
1846         Toolkit C bug.
1847
1848 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1849
1850         * getdate.y (zone): Allow relunit_snumber after tZONE, so
1851         that "UTC +1 second" continues to work.  Problem reported
1852         by Dmitry V. Levin.
1853         (relunit_snumber): New rule.
1854         (relunit): Use it.
1855
1856 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1857
1858         * getdate.y (universal_time_zone_table): New constant.
1859         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
1860         universal_time_zone_table.
1861         (lookup_zone): Prefer universal_time_zone_table to
1862         local_time_zone_table, so that "GMT" time stamps are allowed in
1863         London during the summer.  Problem reported by Ian Abbott.
1864
1865 2005-04-12  Jim Meyering  <jim@meyering.net>
1866
1867         * human.c (humblock): Set *options even when returning due to
1868         xstrtoumax conversion failure.  Thanks to a used-uninitialized
1869         warning from gcc-4.
1870
1871 2005-04-09  Jim Meyering  <jim@meyering.net>
1872
1873         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
1874         -Wuninitialized: initialize tm0.tm_year.
1875
1876 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
1877
1878         * getdate.y (parser_control): rels_seen is now a boolean, not a
1879         count, since there's no maximum.  All uses changed.
1880         Add member dsts_seen.
1881         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
1882         not being INT_MAX.
1883         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
1884         Use pc_rels_seen to decide whther a date is absolute.
1885
1886         * getdate.y (number): Don't overwrite year.
1887         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
1888         check.
1889
1890 2005-04-02  Simon Josefsson  <jas@extundo.com>
1891
1892         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
1893         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
1894
1895 2005-03-27  Jim Meyering  <jim@meyering.net>
1896
1897         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
1898
1899 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
1900
1901         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
1902         "one's complement" -> "ones' complement" in comment, as per Knuth.
1903         "value of type" -> "type or expression" in comment.
1904         * mktime.c, strftime.c: Propagate intprops.h comment nits.
1905
1906 2005-03-26  Jim Meyering  <jim@meyering.net>
1907
1908         Comment nits.
1909         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
1910         Correct typos: s/or/of/.
1911
1912 2005-03-23  Jim Meyering  <jim@meyering.net>
1913
1914         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
1915
1916 2005-03-21  Jim Meyering  <jim@meyering.net>
1917
1918         Changes imported from coreutils.
1919
1920         * cycle-check.c: Don't include xalloc.h.
1921
1922         * path-concat.c: Don't include assert.h.
1923         (path_concat): Remove assertion that would have triggered
1924         for ABASE starting with more than one slash.
1925         Reported by Andreas Schwab.
1926
1927         * path-concat.c (path_concat): Set *BASE_IN_RESULT
1928         properly when ABASE is an absolute file name.
1929         Correct the description of this function.
1930         Include <assert.h>.
1931         Add an assertion and a test driver.
1932         This fixes a bug introduced on 2004-07-02.
1933         Andreas Schwab reported the resulting failure of cp --parents:
1934         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
1935
1936 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
1937
1938         * strftime.c (my_strftime): If the underlying strftime returns 0
1939         (which shouldn't happen), generate nothing instead of returning 0
1940         immediately, so that nstrftime (NULL, ...) doesn't return 0.
1941
1942 2005-03-16  Bruno Haible  <bruno@clisp.org>
1943
1944         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
1945
1946 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
1947
1948         * strftime.c (my_strftime): Prepend space to format so that we can
1949         reliably distinguish strftime failure from empty output on POSIX
1950         hosts.
1951
1952 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
1953
1954         * iconvme.c (SIZE_MAX): New macro, if not already defined.
1955         (iconv_string): Don't guess a size-zero buffer, as that might cause
1956         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
1957         result would be 'too large', where 'too large' is (heuristically)
1958         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
1959         overflow concerns.  This will prevent some unwanted malloc failures
1960         when the inputs are very large.
1961
1962 2005-03-15  Bruno Haible  <bruno@clisp.org>
1963
1964         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
1965         'negate'.
1966
1967         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
1968         variable.
1969
1970         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
1971
1972 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
1973
1974         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
1975         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
1976         intprops.h.
1977         * strtol.c: Likewise.
1978
1979 2005-03-14  Simon Josefsson  <jas@extundo.com>
1980
1981         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
1982         <fx@gnu.org>.
1983
1984 2005-03-14  Jim Meyering  <jim@meyering.net>
1985
1986         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
1987         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
1988         to be nonzero so that we (and caller) can detect the difference
1989         between a valid zero-length expansion and an error return, even
1990         when the underlying strftime fails before writing anything into
1991         that location.
1992
1993 2005-03-10  Jim Meyering  <jim@meyering.net>
1994
1995         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
1996         so that this module works on systems without fchdir.
1997
1998 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
1999
2000         Factor int-properties macros into a single file, except for
2001         glibc-related files.
2002         * intprops.h: New file.
2003         * getloadavg.c: Include it instead of limits.h.
2004         (INT_STRLEN_BOUND): Remove.
2005         * human.c: Include intprops.h.
2006         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2007         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2008         * inttostr.h: Include intprops.h instead of limits.h.
2009         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2010         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2011         for consistency with intprops.h.
2012         (time_t_is_integer, twos_complement_arithmetic): Use them.
2013         * sig2str.h: Include <signal.h>, intprops.h.
2014         (INT_STRLEN_BOUND): Remove.
2015         * strftime.c (TYPE_SIGNED): Remove.
2016         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2017         * strtol.c: Adjust comments to match intprops.h.
2018         * userspec.c: Include intprops.h.
2019         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2020         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2021         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2022         instead of rolling our own expressions.
2023         * xstrtol.c: Include xstrtol.h first, to test interface.
2024
2025         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
2026         instead of int.
2027         (my_strftime): Do not mishandle years close to INT_MAX, by doing
2028         the right thing even if adding 1900 would overflow.  Similarly
2029         for tm_mon + 1 and tm_yday + 1.
2030         Make %Y always equivalent to %C%y, and similarly for %G and %g.
2031         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2032         (DO_SIGNED_NUMBER): New macro.
2033         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2034
2035 2005-03-07  Bruno Haible  <bruno@clisp.org>
2036
2037         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2038
2039 2005-03-03  Derek R. Price  <derek@ximbiot.com>
2040             Bruno Haible  <bruno@clisp.org>
2041
2042         * pagealign_alloc.h: New file.
2043         * pagealign_alloc.c: New file.
2044
2045 2005-01-28  Bruno Haible  <bruno@clisp.org>
2046
2047         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2048         stpncpy.c uses it.
2049
2050 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
2051
2052         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2053         The workaround isn't strictly needed for POSIX conformance, and
2054         it's too much of a pain to configure and maintain.  We'll ask
2055         people to fix their kernels instead.
2056         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2057         (NANOSLEEP_BUG_WORKAROUND): Remove.
2058         (xnanosleep): Remove the workaround.
2059
2060 2005-02-12  Bruno Haible  <bruno@clisp.org>
2061
2062         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2063
2064 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
2065
2066         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2067         * timespec.h (gettime): Return void, since it always
2068         succeeds now.  All uses changed.
2069         * gettime.c (gettime) Likewise.
2070         [HAVE_NANOTIME]: Prefer nanotime.
2071         Assume gettimeofday succeeds, as POSIX requires.
2072         Assime time () succeeds, since other code already does.
2073         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2074         (timespec_subtract): Remove.
2075         (NANOSLEEP_BUG_WORKAROUND): New constant.
2076         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2077         things considerably.  Use it only on GNU/Linux hosts, since the
2078         workaround shouldn't be needed elsewhere.
2079
2080 2005-02-24  Bruno Haible  <bruno@clisp.org>
2081
2082         * gettext.h: Update from GNU gettext 0.14.2.
2083
2084 2005-02-24  Bruno Haible  <bruno@clisp.org>
2085
2086         * localcharset.c: Update from GNU gettext 0.14.2.
2087         * config.charset: Update from GNU gettext 0.14.2.
2088
2089 2005-02-22  Simon Josefsson  <jas@extundo.com>
2090
2091         * iconvme.h, iconvme.c: New files, from libc.
2092
2093 2005-02-20  Neil Conway  <neilc@samurai.com>
2094
2095         * xgethostname.c (xgethostname): Check for ENOMEM, which is
2096         returned by OSX/Darwin if the specified buffer is not large
2097         enough for the hostname.
2098
2099 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
2100
2101         * memrchr.h: New file.
2102         * chdir-long.c: Include it.
2103         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2104         Don't bother including stddef.h.
2105
2106 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2107
2108         * argp-help.c (__argp_help): Create a fake struct argp_state and
2109         pass it to _help, otherwise the latter coredumps trying to
2110         dereference state.root_argp.
2111
2112 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
2113
2114         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2115         inclusion.
2116         Include <sys/types.h>, for dev_t.
2117         (ME_DUMMY, ME_REMOTE): Move from here....
2118         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2119         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
2120         Dmitry V. Levin.
2121         Include mountlist.h first, to test the interface.
2122
2123 2005-01-29  Bruno Haible  <bruno@clisp.org>
2124
2125         * progname.c (program_name): Initialize.
2126         Needed when linking statically on MacOS X.
2127
2128 2005-01-28  Bruno Haible  <bruno@clisp.org>
2129
2130         * javacomp.sh.in: New file, from GNU gettext.
2131         * javacomp.h: New file, from GNU gettext.
2132         * javacomp.c: New file, from GNU gettext.
2133
2134 2005-01-26  Bruno Haible  <bruno@clisp.org>
2135
2136         * javaexec.sh.in: New file, from GNU gettext.
2137         * javaexec.h: New file, from GNU gettext.
2138         * javaexec.c: New file, from GNU gettext.
2139
2140 2005-01-26  Simon Josefsson  <jas@extundo.com>
2141
2142         * gai_strerror.c: Use GPL in header.
2143
2144 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2145
2146         * argp-help.c (hol_entry_help): Avoid using non-constant
2147         initializers for struct pentry_state.
2148         (__argp_error): Check return value of __asprintf
2149         (__argp_failure): Translate error message
2150
2151         * argp-parse.c: Removed braces around the expansion of N_()
2152
2153 2005-01-21  Jim Meyering  <jim@meyering.net>
2154
2155         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2156         same value as for Solaris 9.
2157
2158         * chdir-long.c (chdir_long): Rewrite to remove limitation on
2159         component length.  This included changing the parameter to be
2160         of type `char *' rather than `char const *'.
2161         * chdir-long.h (chdir_long): Update prototype.
2162
2163         * openat.c (fdopendir, fstatat): New functions.
2164         * openat.h: Include headers required for use of DIR and struct stat.
2165         [AT_SYMLINK_NOFOLLOW]: Define.
2166         (fdopendir, fstatat): Add prototypes.
2167
2168 2005-01-21  Bruno Haible  <bruno@clisp.org>
2169
2170         * classpath.h: New file, from GNU gettext.
2171         * classpath.c: New file, from GNU gettext.
2172
2173 2005-01-20  Simon Josefsson  <jas@extundo.com>
2174
2175         * version-etc-fsf.c: New file, with version_etc_copyright.
2176         * version-etc.c: Remove version_etc_copyright.
2177         * version-etc.h (version_etc_copyright): Use [] instead of * in
2178         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2179
2180 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
2181
2182         * save-cwd.c (save_cwd): Remove code to support the case
2183         where fchdir is missing or flaky.
2184
2185 2005-01-20  Simon Josefsson  <jas@extundo.com>
2186
2187         * base64.h (isbase64): Add.
2188
2189         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2190         using a unsigned prototype, don't inline.
2191         (base64_decode): Use it.
2192
2193 2005-01-19  Bruno Haible  <bruno@clisp.org>
2194
2195         * sh-quote.h: New file, from GNU gettext.
2196         * sh-quote.c: New file, from GNU gettext.
2197
2198 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
2199
2200         Merge changes from coreutils, as described below in several
2201         changelogs dated today.
2202
2203         * save-cwd.c: Include "save-cwd.h" before other include files.
2204         (O_DIRECTORY): Remove; not needed here, since "." must be
2205         a directory.  All uses removed.
2206         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
2207         universal on Suns, and we also need to test for IRIX.
2208         Revamp code to use 'if' rather than '#if'.
2209         Avoid unnecessary comparison of cwd->desc to 0.
2210
2211         * utimens.c (futimens): Robustify the previous patch, by checking
2212         for known valid error numbers rather than observed invalid ones.
2213
2214 2005-01-18  Jim Meyering  <jim@meyering.net>
2215
2216         * version-etc.c (version_etc_copyright): Update copyright date.
2217
2218         * utimens.c (futimens): Account for the fact that futimes
2219         can also fail with errno == ENOSYS or errno == ENOENT.
2220         Patch from Dmitry V. Levin.
2221
2222         Change the name of the robust chdir function from chdir to chdir_long.
2223         * save-cwd.c: Include chdir-long.h rather than chdir.h.
2224         (restore_cwd): Use chdir_long, not chdir.
2225         * chdir-long.c: Renamed from chdir.c.
2226         * chdir-long.h: Renamed from chdir.h.
2227         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2228         Hurd.
2229
2230 2005-01-18  Bob Proulx  <bob@proulx.com>
2231
2232         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2233         offsetof() macro construct to avoid compile failure with native HP-UX
2234         11.0 ANSI C compiler.
2235
2236 2005-01-06  Bruno Haible  <bruno@clisp.org>
2237
2238         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2239         because stpncpy.m4 takes care of it.
2240
2241 2004-01-24  Bruno Haible  <bruno@clisp.org>
2242
2243         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2244
2245 2003-10-09  Bruno Haible  <bruno@clisp.org>
2246
2247         * progreloc.c: Include xalloc.h instead of xmalloc.h.
2248
2249 2005-01-06  Bruno Haible  <bruno@clisp.org>
2250
2251         * fwriteerror.h (fwriteerror): Change specification to include fclose.
2252         * fwriteerror.c: Include <stdbool.h>.
2253         (fwriteerror): At the end, close the file stream. Record whether
2254         stdout was already closed.
2255
2256 2004-05-27  Bruno Haible  <bruno@clisp.org>
2257
2258         * execute.c (environ): Declare if needed.
2259         * pipe.c (environ): Likewise.
2260         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2261
2262 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
2263
2264         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2265         definitions to be after all include files, to avoid collisions.
2266         Problem reported by Bob Proulx.
2267
2268 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
2269
2270         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2271         not needed.  This removes a dependency on the gettext module.
2272         [defined _LIBC]: Do not include <libintl.h>; not needed.
2273
2274 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
2275
2276         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2277         HAVE_DECL_STRTOLD.
2278
2279 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
2280
2281         * argp-parse.c: Include <stddef.h>.
2282         (alignof, alignto): New macros.
2283         (parser_init): Don't assume that void * is aligned sufficiently
2284         for struct option.
2285
2286         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2287         need to extend the stack.
2288         (YYINITDEPTH): New macro, so that the initial stack isn't overly
2289         large.
2290
2291 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2292
2293         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2294
2295 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
2296
2297         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2298         Remove now-obsolete comment about AIX.
2299         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2300         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2301         (YYMAXDEPTH): New macro.
2302
2303 2004-12-18  Bruno Haible  <bruno@clisp.org>
2304
2305         * fatal-signal.c (fatal_signals): Make non-const.
2306         (init_fatal_signals): New function.
2307         (uninstall_handlers, install_handlers): Ignore signals that were set to
2308         SIG_IGN.
2309         (at_fatal_signal): Call init_fatal_signals.
2310         (init_fatal_signal_set): Likewise. Ignore signals that were set to
2311         SIG_IGN.
2312         Reported by Paul Eggert.
2313
2314 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
2315
2316         * getdate.y (textint): New member "negative".
2317         (time_zone_hhmm): New function.
2318         Expect 14 shift-reduce conflicts, not 13.
2319         (o_colon_minutes): New rule.
2320         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2321         (yylex): Set the "negative" member of signed numbers.
2322
2323 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
2324
2325         Changes imported from coreutils.
2326         * hard-locale.c: Assume <locale.h> exists.
2327         Include "strdup.h".
2328         (GLIBC_VERSION): New macro.
2329         (hard_locale): Assume setlocale exists.
2330         Rewrite to avoid #ifdef.
2331         Use strdup rather than malloc + strcpy.
2332         * human.c: Assume <locale.h> exists.
2333         (human_readable): Assume localeconv exists.
2334
2335 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
2336
2337         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2338         convert T2, not T.  (Imported from libc.)
2339
2340 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
2341
2342         * getcwd.c (is_ENAMETOOLONG): New macro.
2343         (__getcwd.c): Don't restore errno; glibc doesn't.
2344         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2345         first, falling back to our code only if its results look suspicious.
2346         Ensure that the resulting buffer is only as large as necessary.
2347
2348         * readutmp.c: Include readutmp.h first.
2349         Include <errno.h>, since readutmp.h no longer does that.
2350         * readutmp.h: Don't include <errno.h>,
2351         <sys/param.h>, <time.h>; not needed to establish interface.
2352         (errno): Remove decl.
2353         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2354         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2355         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2356
2357 2004-11-28  Simon Josefsson  <jas@extundo.com>
2358
2359         * base64.h, base64.c: New file.
2360
2361 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
2362
2363         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2364
2365 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
2366
2367         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2368         HP's ANSI C compiler.
2369         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2370         Declaring int functions causes warnings on some modern systems and
2371         shouldn't be needed to compile on ancient ones.
2372         * same.c (MIN) [defined MIN]: Don't define, since it's already
2373         defined.
2374
2375         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2376         with the following changes.
2377         (__set_errno): Parenthesize properly.
2378         Include <stdbool.h>.
2379         (MIN, MAX, MATCHING_INO): New macros.
2380         (__getcwd): Define with prototype, not K&R form.
2381         Use heuristics to allocate default buffer on stack if possible.
2382         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2383         behavior, and to avoid the PATH_MAX limit when computing
2384         ../../../../...
2385         Use MATCHING_INO to compare inode number to file.
2386         Check for arithmetic overflow in size calculations.
2387         Fix bug in reallocation of dot array that caused getcwd to fail
2388         on directories nested deeper than 75.
2389         Be more careful about saving errno on error.
2390         Do not use realloc; use only free+malloc, as this is a bit
2391         more flexible and avoids a needless copy operation.
2392         Do not inspect st_dev and st_ino for symbolic links; POSIX
2393         doesn't specify the latter.
2394         Check for closedir errors.
2395         Avoid needless casts.
2396         Use "#ifdef weak_alias" around weak_alias, to be like other
2397         glibc code.
2398         The following changes to getcwd.c have effect only when used in
2399         gnulib; they have no effect inside glibc proper.
2400         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
2401         as alloca isn't used.
2402         (alloca, __alloca): Likewise.
2403         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
2404         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2405         unconditionally, as gnulib assumes C89 or better.
2406         Do not include <sys/param.h>.
2407         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
2408         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
2409         better.
2410         (NULL) [!defined NULL]: Remove; we assume C89 or better.
2411         Include <dirent.h> in a way that is compatible with modern Autoconf.
2412         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
2413         New macros, if not already defined.
2414         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
2415         Use "_LIBC", not "defined _LIBC", for consistency.
2416         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
2417         a mempcpy module.
2418         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
2419         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
2420         * xgetcwd.c: David MacKenzie's old code was removed, so give
2421         credit only to Jim Meyering and adjust the copyright dates.
2422         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
2423         <stdlib.h>, <unistd.h>, "pathmax.h".
2424         Instead, include "xgetcwd.h" (first) and "getcwd.h".
2425         (INITIAL_BUFFER_SIZE): Remove.
2426         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2427
2428 2004-11-23  Jim Meyering  <jim@meyering.net>
2429
2430         * getopt_.h: Remove trailing blanks.
2431
2432 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
2433
2434         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
2435         (futimens): New function, which uses futimes if available.
2436         (futimens, utimens): Support timespec==NULL, with same semantics
2437         as utime and utimens.
2438         * utimens.h (futimens): New decl.
2439
2440 2004-11-23  Jim Meyering  <jim@meyering.net>
2441
2442         * __fpending.c: Add comment.
2443
2444 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2445
2446         * getopt_.h: Re-addition of __getopt_argv_const caused
2447         redefinition warnings. To avoid them, include the defines
2448         in `#if !defined __need_getopt ... #endif'. The only place
2449         where __getopt_argv_const is used is in definitions
2450         of getopt_long and getopt_long_only below, which are as well
2451         protected by `#ifndef __need_getopt'.
2452         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
2453         __need_getopt after including <stdio.h> and <unistd.h> These
2454         headers might have defined it.
2455
2456 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
2457
2458         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
2459         New macros.
2460         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
2461         optopt): Use them instead of invoking ## directly; otherwise, the
2462         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
2463
2464 2004-11-19  Bruno Haible  <bruno@clisp.org>
2465
2466         * strtok_r.c: Move comments from here...
2467         * strtok_r.h: ... to here.
2468
2469 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
2470
2471         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
2472         might fail.  Problem reported by Yoann Vandoorselaere.
2473         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
2474         that mishandle size_t overflow.
2475
2476 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
2477
2478         * canon-host.c: Include "strdup.h".
2479         (canon_host): Use getaddrinfo if available, so that IPv6 works.
2480         Use strdup instead of malloc/strcpy to duplicate strings.
2481
2482         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
2483         (human_space_before_unit): New constant.
2484         * human.c (human_readable): Support it.
2485
2486         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
2487         (xgetcwd): Set errno correctly when failing.
2488         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
2489         the failure is actually due to a PATH_MAX problem.
2490
2491         Further getopt changes to make it more likely that glibc will
2492         buy the changes back.
2493         * getopt.c (POSIXLY_CORRECT): New constant.
2494         (getopt): Use it, so to preserve glibc semantic
2495         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
2496         when compiling for libc.
2497         * getopt_.h (__getopt_argv_const): Bring it back.
2498         (getopt_long, getopt_long_only): Use it.
2499
2500         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
2501         New arg POSIXLY_CORRECT.  All callers changed.
2502         (getopt): Argv is now char * const *, as per standard.
2503         (_getopt_internal_r, _getopt_internal): Argv is now char **,
2504         not char *__getopt_argv_const *.
2505         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2506         _getopt_long_only_r): Likewise.
2507         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
2508         * getopt_int.h (_getopt_internal, _getopt_internal_r,
2509         _getopt_long_r, _getopt_long_only_r): Likewise.
2510         * getopt_.h (__getopt_argv_const): Remove.
2511         (getopt): Argv is now char * const *, as per standard.
2512
2513         * getdate.y (tORDINAL): New token.
2514         (day, relunit): Allow it for relative times.
2515         (relative_time_table): Use tORDINAL for ordinals.
2516
2517 2004-11-15  Jim Meyering  <jim@meyering.net>
2518
2519         * closeout.c: Include "__fpending.h" once again.
2520         Include <stdbool.h>.
2521         (close_stdout): Don't fail just because stdout was closed initially,
2522         since some programs don't write to stdout in the normal course of
2523         operation (other than --version and --help), and we don't want this
2524         function to make e.g. `touch file >&-' fail.
2525         But do fail if it was closed and someone has tried to write to it.
2526         E.g., `printf foo >&-' must fail.
2527
2528 2004-11-11  Simon Josefsson  <jas@extundo.com>
2529
2530         * strtok_r.h, strtok_r.c: New file.
2531
2532 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
2533
2534         * getopt_.h (__getopt_argv_const): New macro, to be used so that
2535         we can stop lying to compilers about the constness of argv when we
2536         are compiled outside glibc.
2537         (getopt, getopt_long, getopt_long_only): Use it.
2538         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
2539         getopt): Likewise.
2540         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2541         _getopt_long_only_r): Likewise.
2542         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
2543         _getopt_long_only_r): Likewise.
2544
2545         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
2546         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
2547         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
2548         the other external symbols.
2549         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
2550         declaration, since the above renaming now works around collisions.
2551
2552 2004-11-11  Jim Meyering  <jim@meyering.net>
2553
2554         * linebreak.c: Remove trailing blanks.
2555         * alloca_.h: Likewise.
2556         * acosl.c: Likewise.
2557         * euidaccess.c: Likewise.
2558         * allocsa.h: Likewise.
2559
2560 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2561
2562         * mktime.c (SHR): New macro, which is a portable
2563         substitute for >> that should work even on Crays.
2564         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
2565         Problem reported by Mark D. Baushke in
2566         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
2567         * getdate.y (SHR): Likewise.
2568         (tm_diff): Use it.
2569         * strftime.c (SHR): Likewise.
2570         (tm_diff): Use it.
2571         * quotearg.c (struct quoting_options): Use unsigned int for
2572         quote_these_too, so that right shifts are well defined.  All uses
2573         changed.
2574
2575 2004-11-10  Simon Josefsson  <jas@extundo.com>
2576
2577         * getaddrinfo.h, getaddrinfo.c: New files.
2578
2579 2004-11-10  Jim Meyering  <jim@meyering.net>
2580
2581         Ensure that no close failure goes unreported.
2582         * closeout.c (close_stdout): Always close stdout.  I.e., don't
2583         return early when it seems there's nothing to flush.
2584         Don't include __fpending.h.
2585
2586 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
2587
2588         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
2589
2590 2004-11-05  Bruno Haible  <bruno@clisp.org>
2591
2592         * readlink.c: Include stddef.h, needed for size_t on Woe32.
2593         Reported by Mark D. Baushke <mdb@cvshome.org>.
2594
2595 2004-11-04  Bruno Haible  <bruno@clisp.org>
2596
2597         2004-09-11  Bruno Haible  <bruno@clisp.org>
2598                 * allocsa.valgrind: New file.
2599         2004-02-06  Bruno Haible  <bruno@clisp.org>
2600                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
2601                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
2602                 Reported by Christopher Seip <chris.seip@hp.com>.
2603
2604 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
2605
2606         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
2607         with errno == ERANGE if the buffer is too small.
2608         Problem reported by Mark D. Baushke.
2609
2610 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
2611
2612         * xreadlink.c (MAXSIZE): New macro.
2613         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
2614         size does not exceed MAXSIZE.  Avoid cast.
2615         As suggested by Mark D. Baushke in
2616         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
2617         if readlink fails with buffer size just under MAXSIZE, try again
2618         with MAXSIZE.
2619
2620 2004-11-02  Derek R. Price  <derek@ximbiot.com>
2621         and  Paul Eggert  <eggert@cs.ucla.edu>
2622
2623         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
2624         (get_date): Overparenthesize to avoid GCC warning.
2625
2626 2004-11-02  Bruno Haible  <bruno@clisp.org>
2627
2628         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
2629         function returns void.
2630
2631 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
2632
2633         * getpass.c (fflush_unlocked, flockfile, funlockfile)
2634         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
2635         already declared.
2636
2637 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2638
2639         * getdate.y: Add support for TZ="foo" within a date string.
2640         Fix some bugs near time_t boundaries.  Reject dates with
2641         out-of-range components, e.g., "Sept 31".
2642         Include <stdlib.h>, "setenv.h", "xalloc.h".
2643         (ISDIGIT_LOCALE): Remove; unused.
2644         Note that the TZ and time functions used here are not reentrant.
2645         (mktime_ok, get_tz): New functions.
2646         (TZBUFSIZE): New constant.
2647         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
2648         This requires that we sometimes generate our own TZ="XXX..." setting.
2649
2650 2004-10-27  Derek R. Price  <derek@ximbiot.com>
2651
2652         * mktime.c (not_equal_tm): Remove redundant check.
2653
2654 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
2655
2656         * getdate.y: Use Bison 1.875 features, and some minor
2657         code cleanups.  This change does not affect semantics.
2658         Don't include <stdlib.h>; no longer needed.
2659         Don't include unlocked-io.h; only the "#if TEST" code uses
2660         stdio, and performance isn't crucial there.
2661         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
2662         Bison 1.875 features as described below.
2663         All uses of "PC." replaced by "pc->".
2664         (YYSTYPE): Add a forward declaration.
2665         (yylex, yyerror): Use full prototypes in forward decls.
2666         Use "%pure-parser" rather than obsolescent "%pure_parser".
2667         Use %parse-param and %lex-param instead of obsolescent
2668         YYPARSE_PARAM and YYLEX_PARAM.
2669         (meridian_table, month_and_day_table, time_units_table,
2670         relative_time_table, time_zone_table, military_table,
2671         lookup_zone, lookup_word, get_date):
2672         Use NULL instead of 0 where appropriate.
2673         (to_hour): Avoid abort (), to avoid a dependency on
2674         stdlib.h.
2675         (yyerror, yylex): Now accepts parser_control * arg.
2676         (main) [TEST]: Use '\0' rather than 0 for char.
2677
2678 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
2679
2680         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
2681         It's now the caller's responsibility to handle the case where
2682         !HAVE_GETPAGESIZE && !defined getpagesize.
2683
2684         * mktime.c (leapyear): Arg is long int, not int.
2685
2686 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
2687
2688         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
2689
2690 2004-10-12  Simon Josefsson  <jas@extundo.com>
2691
2692         * getpass.c (fflush_unlocked, flockfile, funlockfile)
2693         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
2694         to real functions.
2695
2696 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
2697
2698         * vsnprintf.h: New file.
2699         * vsnprintf.c: New file.
2700
2701 2004-10-07  Bruno Haible  <bruno@clisp.org>
2702
2703         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
2704         into the provided buffer.
2705
2706 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
2707
2708         * diacrit.c, diacrit.h: Add GPL notice.
2709
2710         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
2711         * atanl.c (atanl): Keep the code as similar to glibc as possible.
2712         * logl.c (logl): Keep the code as similar to glibc as possible.
2713         This avoids a potential constant-folding bug.
2714
2715 2004-10-05  Bruno Haible  <bruno@clisp.org>
2716
2717         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
2718
2719 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
2720
2721         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
2722         * xmalloc.c (xmemdup): Likewise.
2723         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
2724         XFREE): Remove these long-obsolescent macros.
2725         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
2726         * xstrdup.c: Remove.
2727
2728         * regex.c (re_comp): Cast gettext return value to char *,
2729         Problem reported by Martin Neitzel via Mark D. Baushke.
2730
2731 2004-10-04  Simon Josefsson  <jas@extundo.com>
2732
2733         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
2734         '#ifdef USE_UNLOCKED_IO'.
2735
2736 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
2737
2738         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
2739         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
2740         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
2741         regex.c, sha1.c, version-etc.c, yesno.c:
2742         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
2743         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
2744         the includer's responsibility.
2745
2746         Sync from coreutils.
2747
2748         * modechange.c (mode_compile): Don't decrement a pointer that
2749         points to the start of a string, as the C Standard says the
2750         resulting behavior is undefined.
2751
2752         * backupfile.h (enum backuptype): Rename none -> no_backups,
2753         simple -> simple_backups, numbered_existing ->
2754         numbered_existing_backups, numbered -> numbered_backups
2755         to avoid shadowing problems.  All uses changed.
2756         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
2757         * backupfile.c (check_extension, numbered_backup):
2758         Rename locals to avoid shadowing 'basename'.
2759         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
2760         once.
2761
2762         * .cppi-disable: Add getopt_.h, getopt_int.h.
2763         * .cvsignore: Add getopt.h.
2764
2765 2004-10-04  Simon Josefsson  <jas@extundo.com>
2766
2767         * memmem.h: New file.
2768         * memmem.c: New file, taken from glibc.
2769
2770 2004-10-02  Jim Meyering  <jim@meyering.net>
2771
2772         * dirfd.h, getpagesize.h: Add copyright notice.
2773
2774 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
2775
2776         * snprintf.c: Remove comments as to why each header is needed.
2777
2778 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
2779
2780         * strsep.h: New file.
2781         * strsep.c: New file.
2782
2783 2004-10-01  Simon Josefsson  <jas@extundo.com>
2784
2785         * snprintf.c (snprintf): Handle size==0.
2786
2787 2004-10-01  Simon Josefsson  <jas@extundo.com>
2788             Bruno Haible  <bruno@clisp.org>
2789
2790         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
2791         (snprintf): Declare 'args'.
2792
2793 2004-09-30  Simon Josefsson  <jas@extundo.com>
2794
2795         * snprintf.h, snprintf.c: New files.
2796
2797 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2798
2799         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
2800         (hol_entry_help): Never translate an empty string.
2801         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
2802         * argp.h (OPTION_NO_TRANS): New option.
2803
2804 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
2805
2806         * xvasprintf.c: Include xalloc.h.
2807         (xvasprintf): Use xalloc_die, not xmalloc_die.
2808
2809 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
2810
2811         * dummy.c: Change copyright notice to FSF, and license to GPL.
2812
2813 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
2814
2815         * argp-pvh.c (argp_program_version_hook): Provide initial value.
2816         Problem reported by Bruno Haible in:
2817         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
2818
2819 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
2820
2821         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
2822         in case some system header has #define'd it.  Problem reported by
2823         Soeren D. Schulze in
2824         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
2825
2826 2004-09-08  Bruno Haible  <bruno@clisp.org>
2827
2828         * stdint_.h: New file, taken from GNU clisp.
2829
2830 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
2831
2832         * xvasprintf.h: New file.
2833         * xvasprintf.c: New file.
2834         * xasprintf.c: New file.
2835
2836 2004-09-08  Bruno Haible  <bruno@clisp.org>
2837
2838         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
2839         is > INT_MAX.
2840         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
2841
2842 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2843
2844         Import from coreutils.
2845         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
2846         strings on unbounded length.  alloca's performance benefits aren't
2847         that important here.
2848         (V_STRDUP): Remove.
2849         (parse_with_separator): New function, with most of the internals
2850         of the old parse_user_spec.  Allow user to omit both user and group,
2851         for compatibility with FreeBSD.
2852         Clone only the user name, not the entire spec.
2853         Do not set *uid, *gid unless entirely successful.
2854         Avoid memory leak in some failing cases.
2855         Fix regression for USER.GROUP reported by Dmitry V. Levin in
2856         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
2857         (parse_user_spec): Rewrite to use parse_with_separator.
2858
2859 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
2860
2861         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
2862         its complicated substitute.
2863         * argp-help.c: Include <errno.h>, for program_invocation_short_name
2864         and program_invocation_name.
2865         (__argp_basename) [!_LIBC]: Remove; the only use was
2866         replaced by its body.
2867         (__argp_short_program_name): Change condition from
2868         !defined __argp_short_program_name to
2869         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
2870         to match argp-namefrob.h.
2871         (__argp_failure): Don't assume strerror_r returns char *.
2872         * argp-parse.c (N_): Define unconditionally.
2873         (argp_default_options): Fill out initializers with 0 to avoid
2874         gcc warnings.
2875
2876 2004-08-12  Simon Josefsson  <jas@extundo.com>
2877
2878         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
2879         * getopt_.h: Renamed from getopt.h.
2880
2881 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
2882
2883         Merge from coreutils.
2884
2885         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
2886         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
2887         for Reliant Unix 5.43.
2888
2889         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
2890         (union fooround): Use uintmax_t, not long int.
2891         The rest is a merge from libc:
2892         [defined _LIBC]: Include <shlib-compat.h>.
2893         (_obstack) [defined _LIBC]: Remove after 2.3.4.
2894
2895         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
2896
2897         * strverscmp.c: Convert to UTF-8.
2898
2899 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
2900
2901         * obstack.h (obstack_empty_p):
2902         Don't assume that chunk->contents is suitably aligned.
2903         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
2904         Likewise. Problem reported by Benno in
2905         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
2906
2907         * chown.c (rpl_chown): Work even if the file is writeable but not
2908         readable.  This could be improved further but it'd take some work.
2909
2910 2004-08-08  Simon Josefsson  <jas@extundo.com>
2911
2912         * xgethostname.c: Don't include error.h (not used).
2913
2914         * getpass.h: Add.
2915         * getpass.c: Include getpass.h first.
2916
2917 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
2918
2919         * xalloc-die.c: New files.
2920         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
2921         All uses removed.
2922         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
2923         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
2924         (_, N_, xalloc_die): Move to xalloc-die.c.
2925         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
2926         so that we needn't mess with xalloc_msg_memory_exhausted.
2927
2928         * sha1.h: Renamed from sha.h.
2929         (SHA1_H): Renamed from _SHA_H.
2930         (sha1_ctx): Renamed from sha_ctx.
2931         (sha1_init_ctx): Renamed from sha_init_ctx.
2932         (sha1_process_block): Renamed from sha_process_block.
2933         (sha1_process_bytes): Renamed from sha_process_bytes.
2934         (sha1_finish_ctx): Renamed from sha_finish_ctx.
2935         (sha1_read_ctx): Renamed from sha_read_ctx.
2936         (sha1_stream): Renamed from sha_stream.
2937         (sha1_buffer): Renamed from sha_buffer.
2938         * sha1.c: Likewise; renamed from sha.c.
2939         Do not include <sys/types.h>.
2940         Include <stddef.h> rather than <stdlib.h>.
2941
2942 2004-08-08  Bruno Haible  <bruno@clisp.org>
2943
2944         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
2945         FILESYSTEM_PREFIX_LEN.
2946         * progreloc.c: Likewise.
2947         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
2948
2949 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
2950
2951         Merge from tar.
2952         * argp-help.c (make_hol, hol_append): Don't assume that
2953         SIZE_MAX is a valid preprocessor constant.
2954         (__argp_basename): Change from "#ifndef _LIBC"
2955         to "#ifndef __argp_short_program_name", so that
2956         we don't compile these functions for tar.
2957
2958         More merges from coreutils.
2959         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
2960         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
2961         yesno.h: New files.
2962         * addext.c: Remove; no longer needed.
2963         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
2964         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
2965         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
2966         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
2967         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
2968         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
2969         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
2970         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
2971         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
2972         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
2973         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
2974         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
2975         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
2976         Import changes from coreutils.
2977
2978 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
2979
2980         Merge from coreutils.
2981
2982         * .gdb-history: Remove; this doesn't belong here.
2983
2984         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
2985         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
2986         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
2987
2988         * dirname.h: Include <stdbool.h>.
2989         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
2990         for consistency with POSIX terminology.  All uses changed.
2991         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
2992         (strip_trailing_slashes): Use bool for booleans.
2993         * stripslash.c (strip_trailing_slashes): Likewise.
2994
2995         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
2996         sometimes returns a positive errno value even when it succeeds.
2997         (print_errno_message) [!LIBC]: Fall back on strerror if
2998         __strerror_r fails.
2999
3000         * path-concat.c (mempcpy): Don't define if a system header defines it.
3001         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3002         (longest_relative_suffix): New function.
3003         (path_concat): Use it.  Assume first argument is not NULL.
3004         Port to DOS.  Omit redundant separators.
3005         Report an error instead of returning NULL.
3006         Use mempcpy instead of memcpy.
3007         (xpath_concat): Remove: not declared or used.
3008
3009         * same.h: Include <stdbool.h>
3010         (same_name): Return bool, not int.
3011         * same.c (same_name): Likewise.
3012         (errno): Don't declare; we assume C89 or better now.
3013
3014         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3015         if not already defined.
3016
3017         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3018         * dup-safer.c (errno): Likewise.
3019
3020 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
3021
3022         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3023         working.
3024
3025 2004-08-03  Simon Josefsson  <jas@extundo.com>
3026
3027         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3028         * progname.h: Don't include stdbool.h.
3029
3030 2004-08-02  Simon Josefsson  <jas@extundo.com>
3031
3032         * getsubopt.h: New file, with comments from Bruno Haible.
3033         * getsubopt.c: New file, from glibc, but slightly modified based on
3034         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3035
3036 2004-08-01  Simon Josefsson  <jas@extundo.com>
3037
3038         * xgetdomainname.c: Include stdlib.h, for free().
3039
3040 2004-07-16  Simon Josefsson  <jas@extundo.com>
3041
3042         * dummy.c: New file.
3043
3044 2004-07-16  Bruno Haible  <bruno@clisp.org>
3045
3046         * backupfile.h: Add extern "C" for C++.
3047         * closeout.h: Likewise.
3048         * copy-file.h: Likewise.
3049         * findprog.h: Likewise.
3050         * full-write.h: Likewise.
3051         * pathname.h: Likewise.
3052         * progname.h: Likewise.
3053         * stpcpy.h: Likewise.
3054         * stpncpy.h: Likewise.
3055         * strcase.h: Likewise.
3056         * strstr.h: Likewise.
3057         * xalloc.h: Likewise.
3058
3059         * mbswidth.h: Add extern "C" for C++.
3060         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3061
3062 2004-07-09  Simon Josefsson  <jas@extundo.com>
3063
3064         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
3065         failed without this.)
3066
3067 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
3068
3069         * fchown-stub.c: New file.
3070
3071 2004-06-24  Jim Meyering  <jim@meyering.net>
3072
3073         * obstack.h (obstack_base): Cast to (void *), per documentation.
3074
3075 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3076
3077         * argz.c, argz_.h: New files, which are autoupdated from libtool.
3078
3079 2004-06-01  Jim Meyering  <jim@meyering.net>
3080
3081         * calloc.c: New file.
3082
3083 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
3084
3085         * getdate.y (yylex): Allow space between sign and number.
3086         Problem reported by Dan Jacobson.
3087
3088 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
3089         and  Jim Meyering  <jim@meyering.net>
3090
3091         Merge from coreutils CVS.
3092
3093         * stat-macros.h: New file, with contents from file-type.h
3094         and coreutils' system.h.
3095         * file-type.c: Include "stat-macros.h".
3096         * file-type.h (file_type): Move all macro definitions to new file,
3097         stat-macros.h.
3098
3099         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3100         Wrap old code with this conditional.
3101         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3102         function that does not dereference symlinks.
3103         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3104
3105         * xreadlink.c: Include xreadlink.h first, to catch .h file
3106         dependency problems.
3107         (xreadlink): Accept new arg SIZE, for efficiency.
3108         All decls and uses changed.
3109         * xreadlink.h: Include <stddef.h>, for size_t.
3110
3111         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3112         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3113
3114         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3115
3116 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
3117
3118         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3119         macros to be defined.
3120         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3121         the allocator returns NULL because the requested size is zero.
3122
3123 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3124
3125         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3126         var.  Add comment explaining why libc still defines it.  This
3127         merges the following patch from glibc:
3128         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3129
3130 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
3131
3132         * obstack.c (_obstack): Remove unused variable.  It hasn't been
3133         present in glibc since revision 1.1 of this file.
3134         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3135         obstack_alignment_mask, obstack_alloc, obstack_base,
3136         obstack_blank, obstack_blank_fast, obstack_chunk_size,
3137         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3138         obstack_grow0, obstack_init, obstack_int_grow,
3139         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3140         obstack_next_free, obstack_object_size, obstack_ptr_grow,
3141         obstack_ptr_grow_fast, obstack_room): Remove declarations of
3142         nonexistent functions.
3143
3144 2004-05-17  Derek R. Price  <derek@ximbiot.com>
3145             Paul Eggert  <eggert@cs.ucla.edu>
3146
3147         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3148
3149 2004-05-14  Bruno Haible  <bruno@clisp.org>
3150
3151         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3152         that consists of a '.' followed by an empty digit string.
3153         Patch by Tor Lillqvist <tml@iki.fi>.
3154
3155 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
3156
3157         Port obstack to the AS/400, where pointers are 16 bytes wide and
3158         you cannot cast an integer to a valid pointer.  This patch is
3159         currently waiting to be integrated into glibc; see
3160         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3161
3162         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3163         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3164         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3165         (struct obstack): temp member is now a union of a pointer and
3166         an integer, instead of an integer.  All integer uses changed.
3167         This does not affect the physical layout of struct obstack,
3168         except on hosts (like the AS/400) where the size or alignment of
3169         void * is greater than that of ptrdiff_t.
3170         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3171         __STDC__)]: Store temporary in pointer member of union, not
3172         integer member.
3173         * obstack.c: Include <stddef.h>, for offsetof.
3174         (struct fooalign): Remove; it doesn't need a name.
3175         (union fooround): Change double to long double, and add void *.
3176         (DEFAULT_ALIGNMENT): Use offsetof to compute.
3177         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3178         not a macro.  Hence the values are always int; so remove all
3179         casts-to-int in uses.
3180
3181 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
3182             Derek Price  <derek@ximbiot.com>
3183
3184         * alloca.c: Include <alloca.h>, to get our interface.
3185         * alloca_.h: Use __alloca on AIX, so that we don't have to
3186         include <alloca.h> first.  Use C89 prototype for alloca; this
3187         requires including <stddef.h> for size_t.  Use extern "C" if C++.
3188         Use #elif for simplicity, since we can assume C89 now.
3189         Don't try to source the system alloca.h since it will not be found
3190         and to prevent recursively including its replacement.
3191         * fnmatch.c: Include <alloca.h> instead of opencoding.
3192         * regex.c: Likewise.
3193
3194 2004-05-16  Derek Price  <derek@ximbiot.com>
3195             Paul Eggert  <eggert@cs.ucla.edu>
3196
3197         getline cleanup.  This changes the getndelim2 API: both order of
3198         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3199         no delimiter).
3200
3201         * getline.c: Don't include stddef.h or stdio.h, since our
3202         interface does that.
3203         (getline): Always use getdelim, so that we don't have two
3204         copies of this code.
3205         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3206         if available.
3207         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3208         (GETNDELIM2_MAXIMUM): New macro.
3209         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
3210         instead of the old practice of delim2==0.  All callers changed.
3211         Return -1 on overflow, instead of returning junk.
3212         Do not set *linesize unless allocation succeeds.
3213         * getndelim2.h: Do not include stddef.h; no longer needed, now
3214         that we include sys/types.h.
3215         * getnline.h: Likewise.
3216         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3217         (getndelim2): Reorder arguments.
3218         * getnline.c (getnline, getndelim):
3219         Don't discard the NMAX argument.
3220         (getnline): Invoke getndelim, to avoid code duplication.
3221         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3222         of (size_t) -1 by callers of the getnline family.
3223
3224 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3225
3226         * nanosleep.c (suspended): Change its type from int to
3227         sig_atomic_t volatile.
3228         (first_call): Make it private to rpl_nanosleep, and have it
3229         be zero initially as that's a bit faster.
3230         (my_usleep): Round up fractional times instead of truncating them,
3231         as this is the usual meaning for 'sleep'.
3232
3233         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3234         doesn't work.
3235         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3236         (ENOSYS): Define if not defined.
3237         (settime): Fall back on stime if it exists and settimeofday fails.
3238         But don't bother with fallbacks if a method fails with errno == EPERM.
3239
3240 2004-05-11  Jim Meyering  <jim@meyering.net>
3241
3242         Prior to this change, the save_cwd caller required read access to the
3243         current directory on most systems (ones with the fchdir function).
3244
3245         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3246         fails, try write-only, and finally, resort to using xgetcwd.
3247
3248 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
3249
3250         * obstack.c, obstack.h: Import changes from libc.
3251
3252 2004-04-28  Bruno Haible  <bruno@clisp.org>
3253
3254         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3255         implicitly appends .exe to executables.
3256         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3257         accepts Windows pathnames.
3258         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3259         Cygwin like Windows, since it now accepts Windows pathnames.
3260         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3261         Cygwin like Windows, since it now accepts Windows pathnames.
3262         Reported by Derek Robert Price <derek@ximbiot.com>.
3263
3264 2004-04-20  Jim Meyering  <jim@meyering.net>
3265
3266         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3267
3268 2004-04-20  Jim Meyering  <jim@meyering.net>
3269             Bruno Haible  <bruno@clisp.org>
3270
3271         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3272         memory when realloc fails.
3273
3274 2004-04-18  Jim Meyering  <jim@meyering.net>
3275
3276         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3277         don't leak memory and do call END_UTMP_ENT.
3278
3279 2004-04-11  Paul Eggert  <eggert@twinsun.com>
3280
3281         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3282         (CHAR_BIT): Remove, since we assume C89.
3283         Include <stdint.h> if available, as per current Autoconf CVS advice.
3284
3285 2004-03-30  Paul Eggert  <eggert@twinsun.com>
3286
3287         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3288         not bool, to be more consistent with Unix conventions.
3289         Suggested by Bruno Haible.
3290
3291         Merge from coreutils.
3292
3293         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3294         New files.
3295
3296         * getdate.h: Include stdbool.h, and timespec.h instead of
3297         the usual <time.h> dance.
3298         (get_date): Change signature to support fractional time stamps.
3299         All callers changed.
3300         * getdate.y: Include "getdate.h" first, as we can now
3301         assume C89 and don't need to worry about 'const'.
3302         Similarly, include "unlocked-io.h" near start, not in middle.
3303         Include <limits.h>.
3304         (textint.value): Use long int rather than int.
3305         (textint.digits): Use size_t rather than int.
3306         (BILLION, LOG10_BILLION): New constants.
3307         (parser_control): New member rel_ns.  Members day_ordinal,
3308         time_zone, month, day, hour, minutes, rel_year, rel_month,
3309         rel_day, rel_hour, rel_minutes, rel_seconds
3310         are now long int, not int.  Member seconds is now struct timespec,
3311         not int.  New member timespec_seen.  Members dates_seen, days_seen,
3312         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3313         not int.
3314         (%union.intval): Now long int, not int.
3315         New member timespec.
3316         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3317         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3318         (spec): Now is a timespec or an item list.
3319         (timespec, items): New nonterminals.
3320         (time, rel, relunit, number, get_date):
3321         Add support for fractional seconds.
3322         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3323         (gmtime, localtime, mktime): Remove decls; not needed with C89.
3324         (to_hour): First arg is now long int, not int.
3325         (to_year): Returns long int, not int.
3326         Don't treat year -70 like 70.
3327         (tm_diff): Returns long int, not int.
3328         (lookup_word): Use bool instead of int when appropriate.
3329         (yylex): Use size_t for count, not int.
3330         Detect overflow when parsing large integer constants.
3331         Add support for fractions.
3332         (get_date): Make pointers 'const' if possible.
3333         Use more-portable code to detect integer overflow.
3334         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
3335         Don't use ctime; it's not reliable if the year has >4 digits.
3336
3337         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3338         This is for compatibility with BSD.
3339
3340         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3341         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3342         From coreutils' system.h.
3343
3344         * userspec.c: Don't include "posixver.h".
3345         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3346         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3347         compatible extension.  Simplify code by removing a boolean int
3348         that was always nonzero if a string was nonnull.
3349
3350 2004-03-30  Jim Meyering  <jim@meyering.net>
3351
3352         Merge from coreutils.
3353
3354         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3355
3356         * readtokens.c (readtoken): Don't leak 64 bytes when reading
3357         an empty input stream.
3358
3359         * readtokens.c: Include <stdbool.h>.
3360         (readtoken): Use `size_t' rather than int/long.
3361         All callers adjusted.
3362         Use `bool' rather than `int' where appropriate.
3363         Use memset rather than an explicit loop.
3364         Use x2nrealloc rather than xrealloc.
3365         Allow the use of `\0' as a delimiter.
3366         (readtokens): Likewise.
3367         * readtokens.h (readtoken, readtokens): Update prototypes.
3368
3369 2004-03-30  Bruno Haible  <bruno@clisp.org>
3370
3371         * getloadavg.c (getloadavg): Don't assume setlocale returns
3372         nonnull.
3373
3374 2004-03-29  Paul Eggert  <eggert@twinsun.com>
3375
3376         Merge changes to getloadavg.c from coreutils and Emacs.
3377
3378         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3379         Define to an expression, not to the empty string.
3380         Include cloexec.h and xalloc.h.
3381         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3382         Use set_cloexec_flag rather than rolling our own.
3383         * cloexec.c, cloexec.h: New files.
3384
3385 2004-03-18  Paul Eggert  <eggert@twinsun.com>
3386
3387         * getopt.h: Sync with libc CVS.
3388
3389 2004-03-18  Paul Eggert  <eggert@twinsun.com>
3390             Bruno Haible  <bruno@clisp.org>
3391
3392         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
3393         not on all platforms that have <wchar.h>.
3394         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
3395
3396 2004-03-09  Paul Eggert  <eggert@twinsun.com>
3397
3398         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
3399         Sync with libc CVS.
3400         * getopt_int.h: New file, also synced from libc.
3401
3402 2004-03-07  Paul Eggert  <eggert@twinsun.com>
3403
3404         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
3405         '#if' expressions.  Unlike the code it replaces, it does not
3406         depend on (defined _SC_PAGESIZE).  However, it does depend on
3407         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
3408         first reported by Jason Andrade in
3409         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
3410
3411 2004-01-18  Simon Josefsson  <jas@extundo.com>
3412
3413         * strdup.h: New file.
3414         * strdup.c: Include it.
3415         * path-concat.c: Include strdup.h. Drop strdup declaration.
3416         * userspec.c: Include strdup.h. Drop strdup declaration.
3417
3418 2004-02-06  Karl Berry  <karl@gnu.org>
3419
3420         * config.charset: update from gettext 0.14.1.
3421
3422 2004-02-05  Paul Eggert  <eggert@twinsun.com>
3423
3424         Add comments and code, prompted by suggestions from Bruno Haible
3425         for sh-quote.
3426         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
3427         describing the enum quoting_style values.
3428         * quotearg.c (quotearg_alloc): New function.
3429         (quotearg_buffer_restyled): Treat lone { and } as special.
3430         Treat = as special.  Work around bug with older shells
3431         that "see" a '\' that is really the 2nd byte of a multibyte char.
3432         Quote empty string with shell_quoting_style.
3433
3434 2004-02-03  Bruno Haible  <bruno@clisp.org>
3435
3436         * pipe.h: New file, from GNU gettext.
3437         * pipe.c: New file, from GNU gettext.
3438
3439 2004-01-27  Bruno Haible  <bruno@clisp.org>
3440
3441         * execute.h: New file, from GNU gettext.
3442         * execute.c: New file, from GNU gettext.
3443         * w32spawn.h: New file, from GNU gettext.
3444
3445 2004-01-23  Paul Eggert  <eggert@twinsun.com>
3446
3447         Exit-status fix from coreutils.
3448
3449         Use exit_failure consistently in place of EXIT_FAILURE,
3450         so that program exit statuses are consistent on failure.
3451
3452         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
3453         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
3454         * argmatch.h: Comment fix to match the above.
3455         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
3456         Now a macro referring to exit_failure, instead of a separate
3457         variable.  Include "exitfail.h" to get it.
3458         * xstrtol.h: Include "exitfail.h".
3459         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
3460
3461         * long-options.c (parse_long_options): Use prototype
3462         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
3463         for clarity.
3464
3465 2004-01-21  Jim Meyering  <jim@meyering.net>
3466
3467         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
3468         so as not to conflict with a different-sized __mktime_internal
3469         function in GNU libc.
3470         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
3471         Problem building statically-linked `ls' reported by Michael Brunnbauer.
3472
3473 2004-01-18  Paul Eggert  <eggert@twinsun.com>
3474
3475         Merge from diffutils.
3476
3477         * file-type.c (file_type): Add typed memory objects.
3478         * file-type.h (S_TYPEISTMO): New macro.
3479
3480         * c-stack.h (c_stack_action): Remove argv argument.
3481         * c-stack.c (c_stack_action): Likewise.  All uses changed.
3482         (die): Don't calculate message unless segv_action returns.
3483         (get_stack_location, min_address_from_argv, max_address_from_argv,
3484         volatile stack_base, volatile_stack_size): Remove.
3485         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
3486         that every segmentation violation is a stack overflow.  (Ouch!)
3487         See Debian bug 136249 (still outstanding) for more info about why
3488         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
3489
3490 2003-11-30  Bruno Haible  <bruno@clisp.org>
3491
3492         Safer stack allocation.
3493         * setenv.c: Include allocsa.h.
3494         (alloca): Remove fallback definition.
3495         (freea): Remove macro.
3496         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
3497         instead of freea.
3498
3499 2003-10-17  Bruno Haible  <bruno@clisp.org>
3500
3501         * binary-io.h: Avoid warnings on Cygwin.
3502
3503 2003-12-28  Bruno Haible  <bruno@clisp.org>
3504
3505         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
3506         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
3507
3508 2003-11-28  Bruno Haible  <bruno@clisp.org>
3509
3510         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
3511
3512 2003-11-27  Bruno Haible  <bruno@clisp.org>
3513
3514         * wait-process.c: On Windows, include windows.h. Needed on mingw.
3515
3516 2003-11-17  Bruno Haible  <bruno@clisp.org>
3517
3518         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
3519
3520 2003-11-24  Bruno Haible  <bruno@clisp.org>
3521
3522         * xallocsa.h: New file, from GNU gettext.
3523         * xallocsa.c: New file, from GNU gettext.
3524
3525 2003-11-24  Bruno Haible  <bruno@clisp.org>
3526
3527         * allocsa.h: New file, from GNU gettext.
3528         * allocsa.c: New file, from GNU gettext.
3529
3530 2003-11-24  Bruno Haible  <bruno@clisp.org>
3531
3532         * eealloc.h: New file.
3533
3534 2004-01-15  Jim Meyering  <jim@meyering.net>
3535
3536         Merge from coreutils.
3537
3538         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
3539         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
3540         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
3541
3542         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
3543         optional configure-time default.
3544
3545         * version-etc.c (version_etc_copyright): Update copyright date.
3546
3547         * xreadlink.c (xreadlink): Correct outdated comment.
3548
3549 2004-01-15  Paul Eggert  <eggert@twinsun.com>
3550
3551         Merge from coreutils.
3552
3553         * posixver.c: Include posixver.h.
3554
3555         * same.c: Include <stdbool.h>, <limits.h>.
3556         (_POSIX_NAME_MAX): Define if not defined.
3557         (MIN): New macro.
3558         (same_name): If file names are silently truncated, report
3559         that the file names are the same if they are the same after
3560         the silent truncation.
3561
3562         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
3563         conversion function.
3564         * xstrtod.c (xstrtod): Likewise.  All callers changed to
3565         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
3566         longer needed.
3567
3568 2004-01-14  Paul Eggert  <eggert@twinsun.com>
3569
3570         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
3571         with like-named macro in fnmatch.c.
3572         (EXT): Use an internal constant instead.
3573
3574         Merge fnmatch patches from glibc.
3575         * fnmatch.c (mbsinit): Remove define.
3576         Add libc_hidden_ver (__fnmatch, fnmatch).
3577         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
3578         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
3579
3580 2003-12-14  Karl Berry  <karl@gnu.org>
3581
3582         * config.charset: update from gettext-runtime.
3583
3584 2003-12-03  Paul Eggert  <eggert@twinsun.com>
3585
3586         * getgroups.c (getgroups): xmalloc takes one argument, not two.
3587         Bug reported by Alfred M. Szmidt.
3588
3589 2003-11-29  Karl Berry  <karl@gnu.org>
3590
3591         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
3592
3593 2003-11-23  Paul Eggert  <eggert@twinsun.com>
3594             Bruno Haible  <bruno@clisp.org>
3595
3596         * printf-parse.h: Don't include sys/types.h.
3597         (ARG_NONE): New macro.
3598         (char_directive): Change type of *arg_index fields to size_t.
3599         * printf-parse.c: Don't include sys/types.h.
3600         (SSIZE_MAX): Remove macro.
3601         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
3602         Remove unnecessary overflow check.
3603         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
3604         fields.
3605
3606 2003-11-24  Paul Eggert  <eggert@twinsun.com>
3607
3608         * alloca.c: Remove dependency on xalloc module.
3609         (xalloc_die): Remove.
3610         (memory_full) [!defined emacs]: New macro.
3611         [!defined emacs]: Don't include xalloc.h.
3612         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
3613         address arithmetic overflows.  Change datatypes a bit to avoid
3614         unnecessary casts.
3615
3616 2003-11-22  Jim Meyering  <jim@meyering.net>
3617
3618         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
3619
3620 2003-11-17  Bruno Haible  <bruno@clisp.org>
3621
3622         * vasnprintf.c (alloca): Remove fallback definition.
3623         (freea): Remove definition.
3624         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
3625         Reported by Paul Eggert.
3626
3627 2003-11-17  Jim Meyering  <jim@meyering.net>
3628
3629         On systems without utime and without a utimes function capable of
3630         dealing with a NULL struct utimbuf* argument, this utime replacement
3631         could -- in unusual circumstances -- leak a file descriptor.
3632         * utime.c: Include <unistd.h> and <errno.h>.
3633         (utime_null): Be sure to close `fd' and to preserve errno.
3634         Reported by Geoff Collyer via Arnold Robbins.
3635
3636 2003-11-16  Paul Eggert  <eggert@twinsun.com>
3637             Bruno Haible  <bruno@clisp.org>
3638
3639         Protect against address arithmetic overflow.
3640         * printf-args.h: Include stddef.h.
3641         (arguments): Change type of field 'count' to size_t.
3642         * printf-args.c (printf_fetchargs): Use size_t instead of
3643         'unsigned int' where appropriate.
3644         * printf-parse.h: Include sys/types.h.
3645         (char_directive): Change type of *arg_index fields to ssize_t.
3646         (char_directives): Change type of fields 'count', max_*_length to
3647         size_t.
3648         * printf-parse.c: Include sys/types.h and xsize.h.
3649         (SSIZE_MAX): Define fallback value.
3650         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
3651         instead of 'int' where appropriate. Check a_allocated, d_allocated
3652         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
3653         * vasnprintf.c: Include xsize.h.
3654         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
3655         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
3656         overflow. Avoid wraparound when converting a width or precision from
3657         decimal to binary.
3658
3659 2003-11-16  Bruno Haible  <bruno@clisp.org>
3660
3661         Update from GNU gettext.
3662         * printf-parse.c: Generalize to it can be compiled for wide strings.
3663         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
3664         * vasnprintf.c: Generalize to it can be compiled for wide strings.
3665         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
3666         SNPRINTF): New macros.
3667         Don't include <alloca.h> if the file is used inside libintl.
3668         (local_wcslen): New function, for Solaris 2.5.1.
3669         (VASNPRINTF): Use it instead of wcslen.
3670
3671 2003-11-16  Bruno Haible  <bruno@clisp.org>
3672
3673         * xsize.h (xmax): New function.
3674         (xsum, xsum3, xsum4): Declare as "pure" functions.
3675
3676 2003-11-12  Paul Eggert  <eggert@twinsun.com>
3677
3678         * xalloc.h: Do not include <limits.h> or <stdint.h>.
3679         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
3680         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
3681         heuristic is just as accurate as far as we know, and it removes a
3682         dependency on size_max.m4 and ptrdiff_max.m4.
3683
3684 2003-11-12  Paul Eggert  <eggert@twinsun.com>
3685
3686         * xstrtol.c (__xstrtol): Remove "break" immediately after
3687         "return", to pacify some unknown compiler.  Problem reported
3688         by Joerg Schilling.
3689
3690 2003-11-11  Bruno Haible  <bruno@clisp.org>
3691
3692         * xsize.h (SIZE_MAX): Remove fallback definition.
3693         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
3694         defined.
3695
3696 2003-11-10  Paul Eggert  <eggert@twinsun.com>
3697
3698         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
3699         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
3700         rejected some allocations of exactly SIZE_MAX - 2 bytes.
3701         From Bruno Haible.
3702         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
3703         not (size_t) -1, since it's defined here.
3704
3705 2003-11-06  Paul Eggert  <eggert@twinsun.com>
3706
3707         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
3708         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
3709         Reject sizes of exactly SIZE_MAX bytes.
3710         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
3711         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
3712
3713 2003-11-05  Bruno Haible  <bruno@clisp.org>
3714
3715         * xsize.h: Include limits.h, to avoid a possible collision with
3716         SIZE_MAX defined in <limits.h> on Solaris.
3717
3718 2003-11-04  Bruno Haible  <bruno@clisp.org>
3719
3720         * xsize.h: New file.
3721         * linebreak.c: Include xsize.h.
3722         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
3723         argument for overflow.
3724         Suggested by Paul Eggert.
3725
3726 2003-10-31  Bruno Haible  <bruno@clisp.org>
3727
3728         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
3729         to avoid (extremely rare) race condition.
3730         Suggested by Paul Eggert.
3731
3732 2003-11-03  Jim Meyering  <jim@meyering.net>
3733
3734         * userspec.c: Include "userspec.h".
3735         * userspec.h: New file.
3736
3737 2003-10-31  Paul Eggert  <eggert@twinsun.com>
3738
3739         * mountlist.h (struct mount_entry.me_type_malloced): New member.
3740         * mountlist.c (SIZE_MAX): Define if not defined already.
3741         (read_filesystem_list): Set and use me_type_malloced.
3742         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
3743         whatever the type happens to be), for brevity and consistency.
3744         Check for size calculation overflow on Alphas running OSF/1.
3745
3746 2003-10-31  Jim Meyering  <jim@meyering.net>
3747
3748         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
3749
3750         * linebuffer.c: Include <string.h> for declaration of memset.
3751
3752 2003-10-30  Paul Eggert  <eggert@twinsun.com>
3753             Bruno Haible  <bruno@clisp.org>
3754
3755         * vasprintf.c: Include <limits.h>, <stdlib.h>.
3756         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
3757
3758 2003-10-29  Paul Eggert  <eggert@twinsun.com>
3759
3760         * xalloc.h (xalloc_oversized): Now a macro, not a function,
3761         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
3762         no longer needed.
3763         * quotearg.c (quotearg_n_options): Use it.
3764         * group-member.c: Include <stdbool.h>.
3765         (free_group_info): Arg is now const *; don't free arg.
3766         (get_group_info): Now returns bool and accepts struct group_info *,
3767         rather than returning a malloc'ed struct group_info *.
3768         All uses changed.  Check for overflow in internal size calculation.
3769
3770         * getusershell.c (readname): Simplify the code by using x2nrealloc
3771         rather than xmalloc/xrealloc.
3772         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
3773         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
3774         conformance bug: the old code used a pointer after freeing the
3775         storage that it addressed.
3776         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
3777         rather than doing it by hand.
3778         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
3779         the buffer preserved.  Use free and xmalloc instead.
3780         * quotearg.c (quotearg_n_options): Likewise.
3781         Use a simpler test for size overflow.  Don't use xalloc_oversized
3782         because unsigned int might be wider than size_t (!); this suggests
3783         that we should switch from unsigned int to size_t for slot numbers.
3784
3785 2003-10-27  Bruno Haible  <bruno@clisp.org>
3786
3787         * stdbool_.h: Better support for BeOS.
3788
3789 2003-10-27  Paul Eggert  <eggert@twinsun.com>
3790
3791         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
3792         to allocate the returned structure.  Do not allocate a subarray,
3793         as x2nrealloc will do that.
3794         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
3795         instead of xnrealloc.
3796         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
3797
3798 2003-10-26  Paul Eggert  <eggert@twinsun.com>
3799
3800         * xalloc.h (xalloc_oversized): New static inline function, for
3801         callers that want to do their own size-overflow checking.  Include
3802         <stdbool.h>, since xalloc_oversized returns bool.
3803         * xalloc.c (array_size_overflow): Remove.  All callers changed
3804         to use xalloc_oversized.
3805
3806         Add two functions x2realloc, x2nrealloc, for programs that grow
3807         arrays dynamically by doubling their sizes.
3808         * xalloc.h (x2realloc, x2nrealloc): New decls.
3809         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
3810         New functions.
3811
3812         Port to C99 semantics for 'inline' of external functions.
3813         Bug reported by Bruno Haible.
3814         * xmalloc.c (xnmalloc_inline): New static inline function,
3815         with the old contents of xnmalloc.
3816         (xnmalloc, xmalloc): Use it.
3817         (xnrealloc_inline): New static inline function,
3818         with the old contents of xnrealloc.
3819         (xnrealloc, xrealloc): Use it.
3820
3821         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
3822
3823 2003-10-25  Paul Eggert  <eggert@twinsun.com>
3824
3825         Fix several address-calculation bugs in the hash modules,
3826         plus some minor code cleanup.
3827
3828         * hash.h: Include <stdbool.h>, for bool.
3829         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
3830         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
3831         hash_get_n_entries, hash_get_max_bucket_length,
3832         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
3833         hash_rehash): Use size_t rather than unsigned.
3834         * hash.c (struct hash_table, hash_get_n_buckets,
3835         hash_get_n_buckets_used, hash_get_n_entries,
3836         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
3837         hash_get_entries, hash_do_for_each, hash_string, is_prime,
3838         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
3839         Likewise.
3840         (SIZE_MAX): Define if not defined.
3841         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
3842         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
3843         hash_print):
3844         Use const * when possible.
3845         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
3846         (check_tuning): Fix bug: if tuning parameters were very close to
3847         0 or 1, rounding errors could have caused subscript violations.
3848         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
3849         (hash_initialize): Add 'fail:' label
3850         to free table and return NULL, and use it to simplify code.
3851         Use calloc rather than clearing the storage ourself.
3852         (hash_initialize, hash_rehash): Check for arithmetic overflow in
3853         buffer size calculations.
3854         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
3855         Include <stddef.h>, for size_t.
3856         * hash-pjw.c (hash_pjw): Likewise.
3857         Switch to method described by Bruno Haible.
3858         Include <limits.h>, for CHAR_BIT.
3859         (SIZE_BITS): New macro.
3860
3861 2003-10-21  Paul Eggert  <eggert@twinsun.com>
3862
3863         * getndelim2.c (getndelim2): When size calculation overflows,
3864         ceiling the allocation at NMAX bytes rather than silently
3865         discarding input bytes before NMAX is reached.  This makes
3866         a difference only if NMAX exceeds SIZE_MAX / 2.
3867
3868         * obstack.c: Merge from glibc.
3869         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
3870         Add libc_hidden_def (_obstack_newchunk).
3871         (_obstack_free) [! defined _LIBC]: Remove.
3872         [defined _LIBC]: Make a strong alias from obstack_free, rather than
3873         a clone of the function body.
3874         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
3875         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
3876
3877         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
3878         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
3879         arg to memcpy.
3880
3881         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
3882         (obstack_ptr_grow_fast, obstack_int_grow_fast):
3883         Don't use lvalue casts, as GCC plans to remove support for them
3884         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
3885         was also present in the non-GCC version, indicating that this
3886         code had always been buggy and had never been widely used.
3887         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
3888         Use the fast variant of each macro, rather than copying the
3889         definiens of the fast variant; that way, we'll be more likely to
3890         catch future bugs in the fast variants.
3891
3892 2003-10-20  Bruno Haible  <bruno@clisp.org>
3893
3894         * wait-process.h: New file, from GNU gettext.
3895         * wait-process.c: New file, from GNU gettext.
3896
3897 2003-10-19  Jim Meyering  <jim@meyering.net>
3898
3899         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
3900
3901 2003-10-16  Paul Eggert  <eggert@twinsun.com>
3902
3903         * getgroups.c: Include <errno.h>, <stdlib.h>.
3904         (getgroups): First arg is int, not size_t.
3905         Don't let 'free' mangle errno.
3906
3907 2003-10-16  Jim Meyering  <jim@meyering.net>
3908
3909         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
3910
3911 2003-10-15  Paul Eggert  <eggert@twinsun.com>
3912
3913         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
3914         (SIZE_MAX): Remove.
3915         (new_exclude, add_exclude_file): Initial size no longer needs to
3916         be a power of 2.
3917         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
3918         our own address arithmetic overflow checking.
3919
3920         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
3921         (fnmatch): Do not alloca more than 2000 wide characters;
3922         instead, use malloc for large buffers.
3923         Check for address arithmetic overflow, and return -1
3924         with errno set to ENOMEM in that case.
3925         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
3926         (NEW_PATTERN): Do not alloca more than 8000 bytes;
3927         instead, return -1.  Check for address arithmetic overflow.
3928
3929 2003-10-14  Paul Eggert  <eggert@twinsun.com>
3930
3931         Handle invalid suffixes and overflow independently, so that
3932         callers can treat them independently as needed.  Fix some bugs in
3933         suffix handling, e.g., "100k@" was not diagnosed as an invalid
3934         suffix for a human-readable blocksize.  The major caller-visible
3935         change is the addition of a new
3936         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
3937         that both overflow and suffix chars were found.
3938
3939         * human.c (humblock): Don't check separately for invalid suffix
3940         char; that is xstrtoumax's job (now that its bug is fixed).
3941         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
3942         INTMAX_MAX]: New macros.
3943         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
3944         TYPE_MAXIMUM): New macros.
3945         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
3946         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
3947         if overflow occurs, as it's what __strtol does and it's more useful
3948         in practice.
3949         (__xstrtol): If __strtol reports some error other than ERANGE,
3950         reflect it to the caller as LONGINT_INVALID.  If it reports
3951         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
3952         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
3953         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
3954         value.
3955         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
3956         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
3957         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
3958         [defined UINTMAX_MAX]: New macros.
3959
3960 2003-10-14  Bruno Haible  <bruno@clisp.org>
3961
3962         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
3963         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
3964         Also use volatile where needed.
3965
3966 2003-10-12  Paul Eggert  <eggert@twinsun.com>
3967
3968         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
3969         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
3970         and define in terms of the other primitives.
3971         * xmalloc.c: Include stdbool.h; do not include exit.h.
3972         (SIZE_MAX): Define if not already defined.
3973         (array_size_overflow): New function.
3974         (xalloc_die): Abort instead of exiting if 'error' returns.
3975         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
3976         (xmalloc, xrealloc): Use them.
3977         (xcalloc): Check for address arithmetic overflow.
3978         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
3979         a bit faster than strcpy.
3980
3981 2003-10-08  Paul Eggert  <eggert@twinsun.com>
3982
3983         Merge getpass from libc, plus a few fixes.
3984
3985         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
3986         Include <stdbool.h>.
3987         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
3988         __fsetlocking to empty.
3989         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
3990         do include <bits/libc-lock.h>.
3991         Do not include <fcntl.h>; not needed.
3992         [_LIBC]: Include <wchar.h>.
3993         (NOTCANCEL_MODE): New macro.
3994         (flockfile, funlockfile) [_LIBC]: New macros.
3995         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
3996         [!_LIBC]: New macros.
3997         (call_fclose): New function.
3998         (getpass): Use it.  Save tty stream separately; this simplifies the
3999         code and makes it more reliable if stdin happens to equal stdout.
4000         Invoke __fsetlocking on tty.
4001         Handle thread cancellation if needed.
4002         Namespace cleanup (use __tcgetattr, __getline).
4003         Use bool for Booleans.
4004         [USE_IN_LIBIO]: Handle wide streams.
4005         [!_LIBC]: Unconditionally do the fseek, since we don't know what
4006         stream might go where.
4007
4008         * unlocked-io.h: Include <stdio.h>, so that the caller
4009         doesn't have to include <stdio.h> before us.
4010         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4011         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4012         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4013         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4014         if not declared, so that we can use getpass.c code from libc without
4015         rewriting it.
4016         (flockfile, ftrylockfile, funlockfile): New macros.
4017
4018 2003-10-06  Bruno Haible  <bruno@clisp.org>
4019
4020         * version-etc-2.h: Remove file.
4021         * version-etc-2.c: Remove file.
4022
4023 2003-09-25  Jim Meyering  <jim@meyering.net>
4024             Bruno Haible  <bruno@clisp.org>
4025
4026         This lets translators provide better translations for the
4027         "Written by ..." part of --version output.
4028         * version-etc.h: Include stdarg.h.
4029         (version_etc_copyright): Declare as readonly.
4030         (version_etc): Make this function variadic with a NULL-terminated list
4031         of author name strings.
4032         (version_etc_va): New declaration.
4033         * version-etc.c: Include stdarg.h, stdlib.h.
4034         (version_etc_copyright): Declare as readonly.
4035         (version_etc_va): New function. Provide a different translatable string
4036         for each possible number of authors < 10. Abbreviate when there are 10
4037         authors or more.
4038         (version_etc): Make this function variadic. Call version_etc_va.
4039         Suggestion from Gary V. Vaughan.
4040
4041         * long-options.h (parse_long_options): Change prototype: the authors
4042         string is moved to the end and becomes variadic.
4043         * long-options.c: Include stdarg.h.
4044         (parse_long_options): Make this function variadic, too.
4045         Call version_etc_va, not version_etc.
4046
4047 2003-10-06  Bruno Haible  <bruno@clisp.org>
4048
4049         * fatal-signal.h: New file, from GNU gettext.
4050         * fatal-signal.c: New file, from GNU gettext.
4051
4052 2003-10-04  Karl Berry  <karl@gnu.org>
4053
4054         * argp*: update from libc.
4055
4056 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
4057
4058         * getpass.c (getpass): Use a no-op fseek when switching from input to
4059         output mode on the same stream.
4060
4061 2003-09-29  Paul Eggert  <eggert@twinsun.com>
4062
4063         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4064         Fix arg typo in previous patch.
4065
4066 2003-09-28  Jim Meyering  <jim@meyering.net>
4067
4068         * error.c: Correct cpp indentation.
4069
4070 2003-09-27  Paul Eggert  <eggert@twinsun.com>
4071
4072         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4073         Omit the special code that used __typeof__, since we worry that
4074         it could be more trouble than it's worth.  See:
4075         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4076         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4077
4078         * free.c: New file.
4079
4080 2003-09-26  Jim Meyering  <jim@meyering.net>
4081
4082         * error.c (error_tail): Move some declarations
4083         into inner scope where the local variables are used.
4084
4085 2003-09-26  Bruno Haible  <bruno@clisp.org>
4086
4087         * stpncpy.h (gnu_stpncpy): New declaration.
4088         (stpncpy): Define as alias for gnu_stpncpy.
4089         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4090
4091 2003-09-26  Paul Eggert  <eggert@twinsun.com>
4092
4093         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4094         (error_tail): Do not loop, reallocating temporary buffer, since
4095         the output cannot contain more wide characters than the input
4096         contains bytes, the size must be big enough already.  This avoids
4097         one potential size overflow calculation.  Check for size overflow
4098         when calculating temporary buffer size.  Free temporary buffer
4099         when done, if it was allocated with malloc; this plugs a memory
4100         leak.  Remove casts from void * to pointers, that are no longer
4101         needed now that we're assuming C89 or better.
4102
4103         Merge error changes from glibc.
4104
4105         * error.c, error.h: Update copyright notice header to match glibc.
4106         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4107         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4108         Disable cancellation while printing error.
4109         * error.h: Prepend __ to parameter names.
4110
4111 2003-09-25  Karl Berry  <karl@gnu.org>
4112
4113         * argp-fmtstream.c, argp-help.c: update from libc.
4114
4115 2003-09-25  Bruno Haible  <bruno@clisp.org>
4116
4117         * version-etc-2.h: New file, from version-etc.h with modifications.
4118         * version-etc-2.c: New file, from version-etc.c with modifications.
4119
4120 2003-09-25  Simon Josefsson  <jas@extundo.com>
4121
4122         * xgetdomainname.h: New file.
4123         * xgetdomainname.c: New file.
4124
4125 2003-09-25  Simon Josefsson  <jas@extundo.com>
4126             Bruno Haible  <bruno@clisp.org>
4127
4128         * getdomainname.h: New file.
4129         * getdomainname.c: New file.
4130
4131 2003-09-24  Paul Eggert  <eggert@twinsun.com>
4132
4133         * linebuffer.c (freebuffer): Don't free the argument, just
4134         the buffer associated with the argument.  Bug reported by
4135         Simon Josefsson.
4136
4137 2003-09-19  Karl Berry  <karl@gnu.org>
4138
4139         * argp.h: update from libc.
4140
4141 2003-09-16  Paul Eggert  <eggert@twinsun.com>
4142
4143         * linebuffer.c (readlinebuffer): Return NULL immediately upon
4144         input error, instead of returning NULL the next time we are called
4145         (and therefore losing track of errno).
4146
4147 2003-09-15  Paul Eggert  <eggert@twinsun.com>
4148
4149         * getndelim2.c (getndelim2): Don't trash errno when a read
4150         fails, so that the caller gets the proper errno.
4151
4152         * readutmp.c (read_utmp): Likewise.
4153         Check for fstat error.  Close stream and free storage
4154         when failing.
4155
4156 2003-09-14  Bruno Haible  <bruno@clisp.org>
4157
4158         * fwriteerror.h: New file.
4159         * fwriteerror.c: New file.
4160
4161 2003-09-14  Jim Meyering  <jim@meyering.net>
4162
4163         * getloadavg.c: Correct cpp indentation.
4164         * strdup.c: Likewise.
4165         * vasnprintf.c: Likewise.
4166
4167 2003-09-12  Paul Eggert  <eggert@twinsun.com>
4168
4169         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4170         * obstack.c [!defined _LIBC]: Likewise.
4171         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4172         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4173         * exitfail.c: Don't include stdlib.h; no longer needed.
4174
4175         More changes to assume C89 or better.
4176
4177         * error.c (error_tail): Assume vprintf.
4178
4179         * argmatch.c (getenv): Remove decl.
4180         * progreloc.c (get_full_program_name): Define via prototype.
4181         * setenv.c (clearenv): Likewise.
4182         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4183         needed.
4184         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4185         (malloc, memcpy): Remove decls.
4186         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4187         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4188         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4189         (memcpy): Remove macro.
4190         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4191         (__P): Remove.  All uses removed.
4192         (PTR): Remove.  All uses changed to void *.
4193         (CHAR_BIT, NULL): Remove.
4194         (spaces, zeros, memset_space, memset_zero)
4195         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4196         Remove.
4197         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4198         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4199         Define with prototype.
4200         Remove now-unnecessary prototype decl.
4201         (extra_args_spec): Assume ANSI C.  All uses changed.
4202         (extra_args_spec_iso): Remove.
4203         (my_strftime, emacs_strftimeu): Define via prototype.
4204         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4205         unconditionally.
4206         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4207         * strtoimax.c: Include <stdlib.h> unconditionally.
4208         (strtoul, strtol): Remove decls.
4209         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4210         LONG_MAX): Remove.
4211         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4212         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
4213         (LOCALE_PARAM_PROTO): New macro.
4214         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4215         (INTERNAL (strtol), strtol): Define with a prototype.
4216         (PARAMS): Remove.  All uses removed.
4217         * tempname.c: Include <string.h> unconditionally.
4218         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4219         * xgethostname.c (main): Define with a prototype.
4220         * xmalloc.c: Include "xalloc.h" first, to check interface.
4221         Include <stdlib.h> unconditionally.
4222         (calloc, malloc, realloc, free): Remove decls.
4223         * xstrtod.c: Include "xstrtod.h" first, to check interface.
4224         Include <stdlib.h> unconditionally.  Sort include file names.
4225         (strtod): Remove.
4226         (xstrtod): Define with a prototype.
4227         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4228         (strtol, strtoul): Remove decls.
4229
4230 2003-09-11  Paul Eggert  <eggert@twinsun.com>
4231
4232         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4233         Include <stdlib.h>, <string.h> unconditionally.
4234         Remove now-unnecessary cast to char *.
4235         * strnlen.c: Include <string.h> unconditionally.
4236         * yesno.c (yesno): Define with a prototype.
4237
4238 2003-09-10  Bruno Haible  <bruno@clisp.org>
4239
4240         * strcspn.c: Include <string.h> unconditionally.
4241         * strpbrk.c: Include <string.h> unconditionally.
4242         * strstr.c: Include <string.h> unconditionally.
4243         * unicodeio.c: Include <string.h> unconditionally.
4244         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4245         * unsetenv.c: Likewise.
4246         * xreadlink.c: Include <stdlib.h> unconditionally.
4247         * yesno.c: Include <stdlib.h> unconditionally.
4248         (rpmatch): Add prototype.
4249
4250 2003-09-10  Jim Meyering  <jim@meyering.net>
4251
4252         * error.c: Correct indentation of cpp directives.
4253
4254 2003-09-09  Paul Eggert  <eggert@twinsun.com>
4255
4256         More K&R removal.
4257
4258         * acosl.c (main): Use a prototype.
4259         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4260         tanl.c: Likewise.
4261
4262         * getloadavg.c (getloadavg, main): Define via prototypes.
4263
4264         * getopt.h (struct option.name): Assume C89, and use 'const'.
4265         (getopt, etopt_long, getopt_long_only, _getopt_internal)
4266         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4267         with a prototype.
4268         * getopt.c (const): Remove macro.
4269         Include <string.h> unconditionally.
4270         (my_index): Remove; all uses changed to strchr.
4271         (strlen): Remove decl.
4272         (exchange): Remove forward decl; no longer needed.
4273         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4274         Define with prototype.
4275         * getopt1.c (const): Remove macro.
4276         (getopt_long, getopt_long_only, main): Define with prototype.
4277
4278         * getugroups.c: Include <string.h> unconditionally.
4279
4280         * getusershell.c: Include <stdlib.h> unconditionally.
4281         (getusershell, setusershell, endusershell, readname, main):
4282         Define with prototypes.
4283
4284         * group-member.c: Include group-member.h first.
4285         Include <stdlib.h> unconditionally.
4286
4287         * hard-locale.c: Include hard-locale.h first.
4288         Include <stdlib.h>, <string.h> unconditionally.
4289
4290         * hash.c (free, malloc): Remove decls.
4291         Include <stdlib.h> unconditionally.
4292
4293         * human.c: Include <stdlib.h>, <string.h> unconditionally.
4294         (getenv): Do not declare.
4295
4296         * idcache.c: Include <string.h> unconditionally.
4297
4298         * long-options.c: Include long-options.h first, to test interface.
4299         Include <stdlib.h> unconditionally.
4300
4301         * makepath.c: Include makepath.h first, to test interface.
4302         Include <stdlib.h> and <string.h> unconditionally.
4303
4304         * linebuffer.c: Include <stdlib.h>.
4305         (free): Remove decl.
4306
4307         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4308         rpl_malloc returns void *, not char *.
4309         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
4310
4311         * md5.h: Include <limits.h> unconditionally.
4312         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4313         (__P): Remove; all uses removed.
4314         * md5.c: Include "md5.h" first.
4315         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4316         md5_buffer, md5_process_bytes, md5_process_block):
4317         Define with prototypes.
4318         * sha.h (__P): Remove all uses.  (It wasn't defined??)
4319         * sha.c: Include "sha.h" first.
4320         Include <stdlib.h>, <string.h> unconditionally.
4321
4322         * memchr.c (__ptr_t): Remove; all uses changed to void *.
4323         * memcmp.c (__ptr_t): Likewise.
4324         * memrchr.c (__ptr_t): Likewise.
4325         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4326         Include <string.h> unconditionally.
4327         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4328         * memchr.c: Include <stdlib.h> unconditionally.
4329         * memchr.c (LONG_MAX): Remove.
4330         * memrchr.c (LONG_MAX): Likewise.
4331         * memchr.c (__memchr): Define via a prototype.
4332         * memrchr.c (__memrchr): Likewise.
4333         * memcmp.c (__P): Remove, and remove all uses.
4334         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4335         Remove forward decls; no longer needed.
4336         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4337         Use types required by C89 in prototype.
4338
4339         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4340         * savedir.c: Likewise.
4341         * mkdir.c (free): Remove decl.
4342         * rmdir.c (rmdir): Define with a prototype.
4343         * savedir.c: Include savedir.h first, to test interface.
4344
4345         * mktime.c (STDC_HEADERS): Remove.
4346         Include <stdlib.h>, <string.h> unconditionally.
4347
4348         * modechange.c: Include <stdlib.h> unconditionally.
4349         (malloc): Remove decl.
4350
4351         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4352         (free): Remove decl.
4353
4354         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4355         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4356         (This type really should be intptr_t, but that's a C99ism.)
4357         (_obstack_memcpy): Remove: all uses changed to memcpy.
4358         Include <string.h> unconditionally.
4359         (struct obstack): Assume __STDC__ for types of members
4360         chunkfun, freefun, extra_arg.
4361         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4362         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4363         obstack_begin, obstack_specify_allocation,
4364         obstack_specify_allocation_with_arg, obstack_chunkfun,
4365         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4366         Remove unprototyped decls and the macros that use them.
4367         * obstack.c (POINTER): Remove.  All uses changed to void *.
4368         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4369         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4370         (defined __STDC__ && __STDC__)]:
4371         Remove nonprototyped code.
4372         Include <stdlib.h> unconditionally.
4373         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4374         _obstack_allocated_p, _obstack_free, obstack_free,
4375         _obstack_memory_used, print_and_abort):
4376         Define using prototypes.
4377         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4378         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4379         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4380         obstack_next_free, obstack_object_size, obstack_room) [0]:
4381         Remove unused, unprototyped code.
4382
4383         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4384
4385         * physmem.c (physmem_total, physmem_available, main): Define
4386         with prototypes.
4387
4388         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4389         (main): Define with a prototype.
4390
4391         * posixver.c (getenv): Remove decl.
4392
4393         * putenv.c (malloc): Returns void *, not char *.
4394         Include <string.h> unconditionally.
4395         (strchr, memcpy, NULL): Do not define.
4396
4397         * readtokens.c: Include readtokens.h first, to test interface.
4398         Include <stdlib.h>, <string.h> unconditionally.
4399         (init_tokenbuffer): Define with a prototype.
4400
4401         * regex.c (PARAMS): Remove.  All uses removed.
4402         All uses of _RE_ARGS removed, too.
4403         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4404         unconditionally.
4405         (bzero): Assume memset exists.
4406         (memcmp, memcpy, NULL): Remove.
4407         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4408         char, or assignments to local vars of type signed char.
4409         (init_syntax_once, PREFIX(extract_number_and_incr),
4410         PREFIX(print_partial_compiled_pattern),
4411         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4412         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4413         PREFIX(regex_grow_registers), PREFIX(regex_compile),
4414         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4415         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4416         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4417         wcs_compile_range, byte_compile_range, truncate_wchar,
4418         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4419         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4420         count_mbs_length, wcs_re_match_2_internal,
4421         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4422         PREFIX(alt_match_null_string_p),
4423         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4424         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4425         regfree, PREFIX(extract_number)): Define with prototype.  Remove
4426         now-unnecessary declaration, if any.
4427         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4428         regcomp, regexec):
4429         Remove now-unnecessary casts among pointer types.
4430         * regex.h (_RE_ARGS): Remove.  All uses removed.
4431
4432         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4433         (free): Remove decl.
4434
4435         * rpmatch.c: Include <stdlib.h> unconditionally.
4436
4437         * same.c: Include <stdlib.h>, <string.h> unconditionally.
4438         (free): Remove decl.
4439
4440         * save-cwd.c: Include <stdlib.h> unconditionally.
4441         * xgetcwd.c: Likewise.
4442
4443         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4444         (free): Remove decl.
4445
4446         * strchrnul.c (strchrnul): Define with a prototype.
4447         Fix bug: c_in was not converted to char before searching.
4448
4449         The following changes are not K&R related:
4450
4451         * group-member.h: Include <sys/types.h>, so that this file is
4452         self-contained.
4453         * makepath.h: Likewise.
4454
4455         * getusershell.c (readname, default_index, line_size, readname):
4456         Use size_t, not int, for sizes.
4457         (readname): If the size overflows, report an error instead of
4458         looping forever.
4459
4460 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
4461
4462         * getndelim2.c: Assume stdlib.h per the C89 spec.
4463
4464 2003-09-08  Paul Eggert  <eggert@twinsun.com>
4465
4466         Assume C89 or better; remove K&R cruft.
4467         A few of these changes were first proposed by Derek Robert Price
4468         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4469
4470         * addext.c: Include <string.h> unconditionally.
4471         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4472         Don't declare getenv or malloc.
4473
4474         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4475         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4476         (NULL): Remove.
4477         (find_stack_direction, alloca): Use prototypes.
4478
4479         * atexit.c (atexit): Define using a prototype.
4480
4481         * basename.c, dirname.c, stripslash.c:
4482         Include <string.h> unconditionally.
4483
4484         * bcopy.c: Include <stddef.h>.
4485         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4486
4487         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4488
4489         * error.h (error, error_at_line, error_print_progname)
4490         [! (defined (__STDC__) && __STDC__)]: Remove decls.
4491         * error.c: Include error.h first, to check interface.
4492         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4493         (VA_START): Remove; all uses changeed to va_start.
4494         (exit, strerror): Remove decls.
4495         (error_print_progname): Prototype uncondionally.
4496         Don't include <errno.h>; no longer needed.
4497         (private_strerror): Remove.
4498         (error_tail): Always define.
4499         (error, error_at_line): Assume C89 or better; always use prototypes.
4500         * fatal.c: Include "fatal.h" first, to test interface.
4501         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4502         (VA_START): Remove; all uses changed to va_start.
4503         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
4504         this case.
4505         (exit): Remove decl.
4506         (fatal): Prototype unconditionally.  Assume va_start works.
4507         Abort at end, to pacify gcc.
4508
4509         * euidaccess.c (main): Define with a prototype.
4510
4511         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4512
4513         * exitfail.c: Include <stdlib.h> unconditionally.
4514
4515         * fnmatch_.h (__P): Remove.  All uses changed to assume
4516         prototypes.
4517         * fnmatch.c: Include fnmatch.h first, to test interface.
4518         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4519         (getenv): Remove decl.
4520         (fnmatch): Define using a prototype.
4521         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4522         (FCT): Define using a prototype.
4523
4524         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4525
4526         * gethostname.c: Include <stddef.h>.
4527         (gethostname): Define with prototype.  Length is size_t, not int.
4528
4529 2003-09-08  Paul Eggert  <eggert@twinsun.com>
4530
4531         * getversion.c: Remove; was migrated to backupfile.c in 1997.
4532         getversion.c should have been removed then, but was accidentally
4533         preserved.
4534
4535         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4536         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4537
4538 2003-09-07  Paul Eggert  <eggert@twinsun.com>
4539
4540         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
4541         copy_tm_result.  Bug reported by Simon Josefsson in
4542         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
4543
4544 2003-09-06  Paul Eggert  <eggert@twinsun.com>
4545
4546         * time_r.c, time_r.h: New files.
4547
4548         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4549         __localtime_r.
4550         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
4551         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4552
4553         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4554         __gmtime_r.
4555         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4556         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4557         Include <time_r.h>.
4558
4559         * timegm.c: Switch to glibc implementation, with the following changes:
4560         [defined HAVE_CONFIG_H]: Include <config.h>.
4561         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
4562         (__mktime_internal) [!defined _LIBC]: New decl.
4563         (__gmtime_r) [!defined _LIBC]: New macro and function.
4564         (timegm): Use a prototype, since gnulib assumes C89.
4565         Do not bother declaring tmp to be const, as it's not really usefu.
4566         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
4567         (timegm): Declare only if HAVE_DECL_TIMEGM.
4568
4569 2003-09-03  Paul Eggert  <eggert@twinsun.com>
4570
4571         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4572         Bug reported by Lute Kamstra in
4573         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4574
4575         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4576         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
4577         course with correspondingly smaller numbers for tomorrow and
4578         yesterday.  From Tadayoshi Funaba.  Originally installed into
4579         sh-utils on 1999-08-07, but the patch got lost (I guess during the
4580         coreutils merge?).
4581
4582 2003-08-31  Simon Josefsson  <jas@extundo.com>
4583
4584         * timegm.h: New file.
4585         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
4586
4587 2003-08-31  Karl Berry  <karl@gnu.org>
4588
4589         * argp.h: update from libc.
4590
4591 2003-08-28  Bruno Haible  <bruno@clisp.org>
4592
4593         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
4594         warning on QNX, which defines O_BINARY to 000000.
4595
4596 2003-08-24  Bruno Haible  <bruno@clisp.org>
4597
4598         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
4599         MSVC7 <stdio.h> is included later.
4600
4601 2003-08-20  Bruno Haible  <bruno@clisp.org>
4602
4603         * progname.h: New file, from GNU gettext.
4604         * progname.c: New file, from GNU gettext.
4605         * progreloc.c: New file, from GNU gettext.
4606
4607 2003-08-19  Bruno Haible  <bruno@clisp.org>
4608
4609         * xstrdup.c: Assume <string.h> exists.
4610
4611 2003-08-18  Jim Meyering  <jim@meyering.net>
4612
4613         * setenv.h: Indent nested cpp directive.
4614         * vasnprintf.c: Remove trailing blanks.
4615
4616 2003-08-17  Simon Josefsson  <jas@extundo.com>
4617             Bruno Haible  <bruno@clisp.org>
4618
4619         * xstrndup.h: New file.
4620         * xstrndup.c: New file.
4621
4622 2003-08-17  Bruno Haible  <bruno@clisp.org>
4623
4624         * strndup.h: New file.
4625
4626 2003-08-16  Paul Eggert  <eggert@twinsun.com>
4627
4628         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
4629         space, undoing this 2003-08-12 change:
4630         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
4631
4632 2003-08-16  Jim Meyering  <jim@meyering.net>
4633
4634         Merge from coreutils.
4635         * xstrtoimax.c: #else #if -> #elif.
4636         * xstrtoumax.c: Likewise.
4637
4638 2003-08-15  Paul Eggert  <eggert@twinsun.com>
4639
4640         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
4641         rather than tab, after '#' in shell-script copyright notices.
4642         Suggested by Bruno Haible.
4643
4644 2003-08-15  Jim Meyering  <jim@meyering.net>
4645         and Paul Eggert  <eggert@twinsun.com>
4646
4647         Merge from coreutils.
4648         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
4649         member but strut utmpx does not.  Needed for AIX 4.3.3.
4650         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4651
4652 2003-08-15  Jim Meyering  <jim@meyering.net>
4653
4654         Merge from coreutils.
4655         * xgethostname.c: Include <stdlib.h>.
4656         (xghostname): Don't exit for anything other than memory-related
4657         failure; just return NULL.
4658         * userspec.c: Include "posixver.h".
4659         (parse_user_spec): Accept `.' as a separator only
4660         in pre-POSIX-200112 mode.
4661         * strtoimax.c: Use #elif rather than #else #if.
4662         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
4663         Remove function, now that we can rely on a working tzset function.
4664         [!_LIBC]: Ensure that the required autoconf test has been run.
4665         [!defined _NL_CURRENT && HAVE_STRFTIME]:
4666         Use underlying_strftime for %r.
4667         * sha.c: Merge in some clean-up and optimization changes from glibc.
4668         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
4669         Ensure that it is a multiple of 64.
4670         Rearrange loop exit tests so as to avoid performing an
4671         additional fread after encountering an error or EOF.
4672         * realloc.c: Update copyright date.
4673
4674 2003-08-14  Jim Meyering  <jim@meyering.net>
4675
4676         Merge from coreutils.
4677         * obstack.h: Whitespace changes.
4678         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
4679         and xcalloc return values.
4680         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
4681         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
4682         hang on OSF/1 5.1 for DIR on both local and remote file systems.
4683         Reported by (and fix confirmed by) Nelson H. F. Beebe.
4684         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4685         error from mntctl.
4686         Use mntctl's return value to drive the entry-processing loop, since
4687         we can't rely on the value of the vmt_length member in the last
4688         entry.  On some systems doing so could result in exhausting
4689         virtual memory.  Based in part on a patch from Mike Jetzer.
4690
4691 2003-08-14  Jim Meyering  <jim@meyering.net>
4692         and Paul Eggert  <eggert@twinsun.com>
4693
4694         Merges from coreutils, plus other fixes.
4695         * physmem.c: Merge in portability changes from gcc/libiberty
4696         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
4697         for credits and details.  Thanks to Kaveh Ghazi for helping
4698         to keep these files in sync.
4699         (ARRAY_SIZE): Define it.
4700         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
4701         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
4702         (memcasecmp): Don't assume size_t fits in unsigned int.
4703         Remove casts and duplicate code.
4704         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
4705         (memcpy): Remove definition.
4706         Merge in some clean-up and optimization changes from glibc.
4707         [BLOCKSIZE]: Move definition to top of file.
4708         Ensure that it is a multiple of 64.
4709         Rearrange loop exit tests so as to avoid performing an
4710         additional fread after encountering an error or EOF.
4711         * md5.h (md5_uintptr): Define.
4712         * makepath.c (CLEANUP_CWD): Report an error if we failed to
4713         return to the initial working directory.  Preserve errno
4714         for caller.
4715         * idcache.c: Include "xalloc.h".
4716         (xmalloc, xrealloc): Remove decls.
4717         (getuser): Remove casts no longer required in C89.
4718         * human.c: Include stdio.h, for sprintf.
4719         * group-member.c: Include "xalloc.h".
4720         (xmalloc, xrealloc): Remove decls.
4721         (get_group_info): Remove casts no longer required in C89.
4722         * getusershell.c (readname): Remove casts no longer required in C89.
4723         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
4724         * getline.c: Whitespace fix, from coreutils.
4725
4726 2003-08-13  Paul Eggert  <eggert@twinsun.com>
4727
4728         * exclude.c: Include <ctype.h>
4729         (IN_CTYPE_DOMAIN): New macro.
4730         (is_space): New fn.
4731         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
4732         and empty lines.
4733
4734         * argp-help.c, argp-parse.c, config.charset, getopt.h:
4735         Undo previous (whitespace-only) change.
4736
4737 2003-08-12  Paul Eggert  <eggert@twinsun.com>
4738
4739         * argp-help.c, argp-parse.c, config.charset, getopt.h:
4740         Normalize leading white space and remove trailing white space.
4741         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
4742         notice, as per ../config/srclist-update.
4743
4744         Merge from coreutils.
4745         * euidaccess.h: New file.
4746         * euidaccess.c: Include it.
4747         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
4748         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
4749         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
4750
4751 2003-08-11  Bruno Haible  <bruno@clisp.org>
4752
4753         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
4754         (vasnprintf): Use it instead of wcslen.
4755
4756 2003-08-11  Bruno Haible  <bruno@clisp.org>
4757
4758         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
4759         value to ensure that _Bool promotes to int. Use #define for _Bool when
4760         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
4761
4762 2003-08-10  Karl Berry  <karl@gnu.org>
4763
4764         * regex.h: update from libc (whitespace fix).
4765
4766 2003-08-09  Paul Eggert  <eggert@twinsun.com>
4767
4768         Merge some files from coreutils.  These changes were
4769         originally made by Jim Meyering.
4770         * acl.c: Include <sys/types.h> before <sys/stat.h>;
4771         many older Unixes require this.
4772         * alloca.c (alloca): Remove cast to argument of free;
4773         no longer needed in C89.
4774         * alloca_.h, regex.h: Fix white space to match
4775         what GNU indent does.
4776
4777 2003-08-05  Paul Eggert  <eggert@twinsun.com>
4778
4779         * bumpalloc.h: Remove.
4780
4781 2003-08-04  Paul Eggert  <eggert@twinsun.com>
4782
4783         * getloadavg.c: Change copyright notice and spacing to conform to
4784         GNU coding style.
4785
4786         Merge from coreutils.
4787         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
4788         From glibc.
4789         * getdate.y (date): Also accept dates like May-23-2003; suggestion
4790         from Karl Berry, implemented by Jim Meyering.
4791         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
4792         from Dmitry V. Levin.
4793         Remove anachronistic cast of xrealloc.
4794         * fnmatch_.h (__const): Remove.  Use 'const'.
4795         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
4796         type. Otherwise, it wouldn't compile with at least /bin/cc on
4797         ymp-cray-unicos9.0.2.X.
4798         Combine two mostly-identical uses of alloca into one.
4799         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
4800
4801 2003-08-04  Dave Love <d.love@dl.ac.uk>
4802
4803         [From Emacs.]
4804
4805         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
4806         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
4807         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
4808         obsolete NLIST_NAME_UNION.
4809         [__GNU__]: Undef BSD and FSCALE.
4810         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
4811
4812 2003-08-03  Paul Eggert  <eggert@twinsun.com>
4813
4814         * stdbool_.h (_Bool): Make it signed char, instead of
4815         an enum type, so that it's guaranteed to promote to int.  See:
4816         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
4817
4818 2003-07-31  Paul Eggert  <eggert@twinsun.com>
4819
4820         * strerror.c: Include config.h, limits.h.  Declare sprintf.
4821         (strerror): Don't assume that a printable int fits in 14 bytes.
4822
4823 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
4824             Bruno Haible  <bruno@clisp.org>
4825
4826         * getline.h (getline, getdelim): Change return type to ssize_t.
4827         * getline.c (getline, getdelim): Likewise.
4828         Remove _GNU_SOURCE define; now it's defined in config.h through
4829         m4/getline.m4.
4830
4831 2003-07-22  Paul Eggert  <eggert@twinsun.com>
4832
4833         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
4834         over-parenthesization in macros.
4835
4836         Sync with coreutils.
4837
4838         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
4839         required by C99.
4840
4841         Use `exit_failure' for xalloc and xmemcoll instead of their own
4842         private exit-failure variables.
4843         * xalloc.h (xalloc_exit_failure): Remove.
4844         * xmalloc.c: Likewise.  Include exitfail.h.
4845         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
4846         * xmemcoll.h (xmemcoll_exit_failure): Remove.
4847         * xmemcoll.c: Likewise.  Include exitfail.h.
4848         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
4849
4850 2003-07-18  Paul Eggert  <eggert@twinsun.com>
4851
4852         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
4853         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
4854         to test that it can stand by itself.  Include "exitfail.h".
4855         Clients should set exit_failure instead.
4856         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
4857
4858 2003-07-18  Andreas Schwab  <schwab@suse.de>
4859
4860         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
4861
4862 2003-07-18  Bruno Haible  <bruno@clisp.org>
4863
4864         * getndelim2.h: New file.
4865         * getndelim2.c: Make into a module of its own. Include config.h,
4866         getndelim2.h.
4867         (getndelim2): Make non-static. Change return type to ssize_t.
4868         * getline.h: Change argument names.
4869         * getline.c: Include getndelim2.h instead of getndelim2.c.
4870         * getnline.c: Include getndelim2.h.
4871
4872 2003-07-17  Bruno Haible  <bruno@clisp.org>
4873
4874         * Makefile.am: Remove file.
4875         * Makefile.in: Remove file.
4876
4877 2003-07-17  Bruno Haible  <bruno@clisp.org>
4878
4879         * getnline.h: New file.
4880         * getnline.c: New file.
4881         * getndelim2.c: New file, extracted from getline.c.
4882         (getndelim2): Renamed from getdelim2, with added nmax argument.
4883         * getline.c: Include getndelim2.c.
4884         (getdelim2): Moved out to getndelim2.c.
4885         (getline, getdelim): Update.
4886
4887 2003-07-15    <karl@gnu.org>
4888
4889         * vasnprintf.c: update from gettext.
4890
4891 2003-07-15  Jim Meyering  <jim@meyering.net>
4892
4893         * makepath.c (make_path): Enclose diagnostic in _(...).
4894
4895 2003-07-14  Paul Eggert  <eggert@twinsun.com>
4896
4897         * asnprintf.c, asprintf.c, config.charset, gettext.h,
4898         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
4899         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
4900         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
4901         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
4902         updated automatically by ../config/srclist-update.  This changes
4903         their license from LPGL to GPL.
4904
4905 2003-07-14  Jim Meyering  <jim@meyering.net>
4906
4907         Don't emit diagnostics.  Let callers do that.
4908         * save-cwd.c: Don't include "error.h".
4909         (save_cwd): Don't call error.  Ensure that errno is valid
4910         when returning nonzero.
4911
4912         * save-cwd.h (restore_cwd): Update prototype.
4913         * save-cwd.c (restore_cwd): Remove two parameters.
4914         Simplify.  Don't call error upon failure.  Let callers do that.
4915         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
4916         when auditing is enabled.  But don't bother updating the #if.
4917
4918 2003-07-14  Simon Josefsson  <jas@extundo.com>
4919
4920         * mempcpy.h: New file.
4921         * mempcpy.c: New file.
4922
4923 2003-07-14  Paul Eggert  <eggert@twinsun.com>
4924
4925         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
4926         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
4927         unicodeio.c, unicodeio.h, unlocked-io.h:
4928         Switch from LGPL to GPL.
4929
4930 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
4931
4932         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
4933         it breaks C++ compilation.
4934         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
4935
4936 2003-07-10  Jim Meyering  <jim@meyering.net>
4937
4938         * vasnprintf.c: Remove trailing blanks.
4939         Make cpp indentation consistent.
4940
4941 2003-07-09  Paul Eggert  <eggert@twinsun.com>
4942
4943         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
4944         posixver.c, strftime.c, strnlen.c, strverscmp.c:
4945         Switch from LGPL to GPL.
4946
4947 2003-07-07  Paul Eggert  <eggert@twinsun.com>
4948
4949         * mktime.c: Fix some boundary cases and remove need for floating point.
4950
4951         Issue a compile-time diagnostic if time_t is floating point, or if
4952         two's complement arithmetic is not in effect, or if arithmetic
4953         right shift does not propagate the sign.  These assumptions were
4954         all in the original code but they weren't checked.
4955
4956         (TIME_T_MIDPOINT, verify): New macros.
4957         (__isleap): Remove; it has integer overflow problems.
4958         (leapyear): New function, without those problems.
4959         (ydhms_tm_diff): Remove; splitting into two parts.
4960         (ydhms_diff): New function, containing the arithmetic part of
4961         the old ydhms_tm_diff function.  Issue a compile-time
4962         diagnostic if we are not using C99 integer division.
4963         Avoid casts when possible.
4964         (guess_time_tm): New function, containing the checking part of
4965         the old ydhms_tm_diff function.  Return the new value, rather than
4966         the difference between it and the old.  Accept a new argument T
4967         so that *T specifies the old value.  Check for overflow in the result.
4968
4969         (__mktime_internal): Use a time_t offset, not a long int offset.
4970         This undoes the 2003-06-04 change, which is no longer needed now
4971         that we have better overflow checking.
4972         (localtime_offset): Likewise.
4973
4974         (__mktime_internal): Avoid harmful overflow on hosts where time_t
4975         and long are 64-bit but int is only 32-bit.
4976         (ydhms_diff): Use long int to store year1 and yday1.
4977         Issue a compile-time diagnostic if long int is not wide enough.
4978
4979         (__mktime_internal): Use long int to store adjusted year and yday.
4980         Use plain C rather than preprocessor commands, if that doesn't
4981         affect efficiency.
4982         Check for overflow (and try to repair) after each probe
4983         rather than checking only at the very end.  This avoids some bugs
4984         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
4985         does not equal GMT offset at maximum time).
4986         Use integer to check for overflow rather than floating point; this
4987         is more portable to non-IEEE hosts, and is a tad faster.
4988         When we detect that we are oscillating between two values,
4989         don't check whether tm_isdst has the requested value, since
4990         we already know the answer.  When tm_isdst has the wrong value,
4991         use a different heuristic to find the right one, based on the
4992         extreme values actually observed in practice in tz2003a,
4993         rather than the (overly optimistic) "previous 3 calendar quarters".
4994
4995         (not_equal_tm, print_tm, check_result): Use "const T" rather than
4996         "T const" to accommodate glibc style.
4997         (check_result): Use less-confusing report format.  "long" -> "long int.
4998         (main): Likewise.
4999         Don't loop if the iteration overflows time_t.
5000         Allow a negative step in the iteration.
5001
5002 2003-07-01  Paul Eggert  <eggert@twinsun.com>
5003
5004         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5005         having it depend on HAVE_SYS_TYPES_H.
5006
5007 2003-06-25  Bruno Haible  <bruno@clisp.org>
5008
5009         * readlink.c: New file.
5010
5011 2003-06-20  Bruno Haible  <bruno@clisp.org>
5012
5013         Assume C89, so PARAMS isn't needed.
5014         * unicodeio.h (PARAMS): Remove.
5015         * unicodeio.c: Don't use PARAMS.
5016
5017 2003-06-18  Jim Meyering  <jim@meyering.net>
5018
5019         Merge changes from coreutils.
5020         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5021         Remove explicit declarations of xmalloc and realloc.
5022         Include xalloc.h.
5023         (read_utmp): Remove anachronistic cast of xmalloc.
5024
5025 2003-06-17  Paul Eggert  <eggert@twinsun.com>
5026
5027         Assume C89, so PARAMS isn't needed.
5028         * backupfile.h (PARAMS): Remove.  All uses removed.
5029         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5030         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5031         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5032         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5033         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5034         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5035         xstrtol.h: Likewise.
5036         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5037         same.h, strverscmp.h: Do not include config.h; no longer needed.
5038         Anyway, config.h should always be included before any other file.
5039
5040 2003-06-11  Simon Josefsson  <jas@extundo.com>
5041
5042         * sysexit_.h: New file.
5043
5044 2003-05-20  Derek Price  <derek@ximbiot.com>
5045
5046         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5047
5048 2003-06-10  Simon Josefsson  <jas@extundo.com>
5049
5050         * strchrnul.h: New file.
5051         * strchrnul.c: New file.
5052
5053 2003-06-10  Simon Josefsson <jas@extundo.com>
5054
5055         * argp.h: New file, from glibc.
5056         * argp-ba.c: New file, from glibc.
5057         * argp-eexst.c: New file, from glibc.
5058         * argp-fmtstream.c: New file, from glibc.
5059         * argp-fmtstream.h: New file, from glibc.
5060         * argp-fs-xinl.c: New file, from glibc.
5061         * argp-help.c: New file, from glibc.
5062         * argp-namefrob.h: New file, from glibc.
5063         * argp-parse.c: New file, from glibc.
5064         * argp-pv.c: New file, from glibc.
5065         * argp-pvh.c: New file, from glibc.
5066         * argp-xinl.c: New file, from glibc.
5067
5068 2003-06-07  Jim Meyering  <jim@meyering.net>
5069
5070         * readtokens.h: Put `Free Software Foundation, Inc.'
5071         in place of my name in the copyright comment.
5072         Remove definition and uses of __P.
5073
5074         From coreutils.
5075         * stat.c: Don't declare xmalloc explicitly.
5076         Instead, include "xalloc.h".
5077         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5078         xrealloc, and xcalloc return values.
5079         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5080         Improve comment.
5081         * xgetcwd.h: Remove definition/uses of PARAMS.
5082
5083 2003-06-06  Jim Meyering  <jim@meyering.net>
5084
5085         * stdbool_.h: Renamed from stdbool.h.in.
5086
5087 2003-06-06  Jim Meyering  <jim@meyering.net>
5088
5089         Merge from coreutils.
5090         * same.c: (same_name): Declare *_basename locals to be `const'.
5091         Consolidate declarations and initializations of *_base* locals.
5092
5093         Merge from coreutils.
5094         This avoids a core dump on systems without GNU putenv,
5095         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5096         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5097         (unsetenv): New static function, from GNU libc.
5098         (rpl_putenv): Use it.
5099
5100         * modechange.c: Remove trailing blanks.
5101
5102         Merge from coreutils.
5103         * fsusage.c: Remove declaration of statfs.
5104         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5105
5106         * posixtm.c: Include <stdbool.h> unconditionally.
5107
5108 2003-06-05  Paul Eggert  <eggert@twinsun.com>
5109
5110         * mktime.c (__mktime_internal): When resolving a tm_isdst
5111         mismatch, look in future quarters as well as past.  This fixes a
5112         bug when processing fall-backwards gaps immediately after a long
5113         period of daylight-saving time.
5114
5115         * mktime.c: Assume freestanding C89 or better.
5116         (HAVE_LIMITS_H): Remove.  Assume it's 1.
5117         (__P): Remove; not used.
5118         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5119         (mktime, not_equal_tm, print_tm, check_result,
5120         main): Use prototypes.  Use const * where appropriate.
5121         (main): Fix typo in testing code that uncovered by above changes.
5122         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5123
5124 2003-06-04  Paul Eggert  <eggert@twinsun.com>
5125
5126         * mktime.c: Fix Debian bug 177940
5127         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5128         (localtime_offset): Now long int, not time_t, because we want it
5129         to be guaranteed to be signed.  All uses changed.
5130         (__mktime_internal): If overflow would occur when adding offset,
5131         don't add it.
5132
5133         Merge 'human' changes from coreutils.  Rewrite to support
5134         locale-specific notations like thousands separators.
5135         * human.c: Simplify authorship notice.
5136         Include human.h immediately after config.h.
5137         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5138         <limits.h>: Do not include, since human.h does.
5139         (SIZE_MAX, UINTMAX_MAX): New macros.
5140         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5141         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5142         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5143         (power_letter): Renamed from suffixes.
5144         (generate_suffix_backwards): Remove.
5145         (adjust_value): Now takes int style (because of human.h changes)
5146         and long double value (for greater precision on some platforms).
5147         (group_number): New function.
5148         (human_readable): Use it.  Use integer options, not enum.
5149         Put the options before the sizes in the arg list.
5150         Support all the new options.
5151         The old human_readable function has been removed;
5152         use inttostr.h instead.
5153         (human_readable, default_block_size, humblock):
5154         Use uintmax_t, not int, for block sizes.
5155         (human_readable_inexact, block_size_types): Remove.
5156         (block_size_opts): New constant.
5157         (human_options): Renamed from human_block_size, with new signature
5158         that allows block sizes up to UINTMAX_MAX.  All callers changed.
5159         * human.h: Add copyright and authorship notice.
5160         Include <limits.h> and <stdbool.h> unconditionally.
5161         (PARAMS): Remove.  All uses removed.
5162         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5163         (enum human_inexact_style): Remove tag; now a nameless enum.
5164         (human_floor, human_ceiling, human_round_to_even): Now have
5165         values 2, 0, 1 rather than -1, 1, 0.
5166         (human_group_digits, human_suppress_point_zero, human_autoscale,
5167         human_base_1024, human_SI, human_B): New constants.
5168         (human_readable_inexact, human_block_size): Remove.
5169         (human_readable): Size args are now uintmax_t, not int.
5170         (human_options): New decl.
5171
5172         * exclude.c: (new_exclude, add_exclude): Remove casts that are
5173         unnecessary now that we assume C89 or better.  This change
5174         imported from coreutils.
5175
5176         * mktime.c (__mktime_internal): Do not reject negative timestamps
5177         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
5178         in the 2003-05-30 sync from glibc.
5179
5180         .h files should stand alone, but we shouldn't include <sys/types.h>
5181         if we can get away with just <stddef.h>.
5182
5183         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5184         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5185         rather than <sys/types.h>, as we merely need size_t.
5186         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5187         to get size_t.
5188         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5189         Include <stdio.h>, to get FILE.
5190         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5191         memcasecmp.h has included <stddef.h> and all we need is size_t.
5192         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5193         our interface, instead of including <sys/types.h>
5194
5195 2003-06-02  Paul Eggert  <eggert@twinsun.com>
5196
5197         [from coreutils]
5198         Fix some minor time-related bugs with POSIX time arguments.
5199         Some valid time stamps were being rejected (notably -1, and
5200         time stamps before 1900 on 64-bit hosts).  And some invalid
5201         time stamps were being accepted, e.g. September 31.
5202
5203         * posixtm.h (posixtime): Return bool instead of time_t, so
5204         that we can return (time_t) -1 successfully.
5205         * posixtm.c: Likewise.
5206         [HAVE_STDBOOL_H]: Include <stdbool.h>.
5207         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5208         (t): Remove static var.
5209         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5210         of static var.  All uses changed.
5211         (year): Do not reject years before 1900; they can occur with
5212         64-bit time_t.
5213         (posix_time_parse): Do not check for out-of-range components;
5214         that is now the caller's responsibility, since our checks were
5215         only approximations.
5216         (posixtime): Use mktime to check for out-of-range components,
5217         since it knows them exactly.
5218         If mktime returns (time_t) -1, check whether an error actually occurred
5219         by invoking localtime on -1.
5220         (main) [TEST_POSIXTIME]: Check for input data errors, and report
5221         posixtime failures better.
5222         Improve the test data (in comments only).
5223
5224 2003-05-30    <karl@gnu.org>
5225
5226         * mktime.c: update from libc.
5227
5228 2003-05-30  Bruno Haible  <bruno@clisp.org>
5229
5230         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5231         * localcharset.h: Likewise.
5232         * localcharset.c: Likewise.
5233
5234 2003-05-28  Paul Eggert  <eggert@twinsun.com>
5235
5236         Assume the headers required for C89 freestanding compilers.
5237         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5238         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5239         without checking for HAVE_LIMITS_H.
5240         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5241         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5242         to do that.
5243         * fatal.c: Include <stdarg.h> without checking for __STDC__.
5244         * exclude.c: Include <stdbool.h> unconditionally.
5245         * tempname.c: Include <stddef.h> unconditionally.
5246         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5247         * modechange.c, rpmatch.c (NULL): Don't define, since
5248         <stddef.h> does that.
5249         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5250         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5251         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5252         * xstrtol.c: Likewise.
5253         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5254         * savedir.c: Include <stddef.h> instead of defining NULL.
5255
5256         * addext.c (addext): Use assignment rather than cast, to avoid
5257         warnings on some platforms.
5258
5259         * mktime.c (__mktime_internal): Do not reject negative timestamps
5260         arbitrarily.
5261
5262 2003-05-10  Bruno Haible  <bruno@clisp.org>
5263
5264         * linebreak.c (iconv_string_length): Don't return -1 just because the
5265         string is longer than 4 KB.
5266
5267 2003-05-12  Jim Meyering  <jim@meyering.net>
5268
5269         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5270         the space-padded-by-default conversion specifiers, %e, %k, %l.
5271
5272 2003-05-03  Bruno Haible  <bruno@clisp.org>
5273
5274         Upgrade to Unicode-4.0.
5275         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5276         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5277         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5278         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5279         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5280         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5281         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5282         Change width of U+E0100..U+E01EF from 1 to 0.
5283
5284 2003-04-25  Bruno Haible  <bruno@clisp.org>
5285
5286         * copy-file.c: Include <stddef.h>, for size_t.
5287
5288 2003-04-25  Jim Meyering  <jim@meyering.net>
5289
5290         * copy-file.c (copy_file_preserving): Declare buf_size to be
5291         of type size_t, not int.
5292
5293 2003-04-11  Jim Meyering  <jim@meyering.net>
5294
5295         Merge changes from Coreutils.
5296
5297         2003-03-22  Jim Meyering  <jim@meyering.net>
5298
5299         * strftime.c (widen): Cast alloca return value to proper type.
5300
5301         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
5302
5303         From GNU libc.
5304         * strftime.c (my_strftime): Handle very large width
5305         specifications for numeric values correctly.  Improve checks for
5306         overflow.
5307
5308         2003-01-19  Jim Meyering  <jim@meyering.net>
5309
5310         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5311         (nl_get_alt_digit) [! defined my_strftime]: Define.
5312         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5313         _nl_get_alt_digit and _nl_get_walt_digit.
5314
5315         * strftime.c (my_strftime): Merge in locale-related changes from libc.
5316         These changes have no effect outside of _LIBC.
5317
5318 2003-04-10  Bruno Haible  <bruno@clisp.org>
5319
5320         * findprog.h: New file, from GNU gettext.
5321         * findprog.c: New file, from GNU gettext.
5322
5323 2003-04-05  Jim Meyering  <jim@meyering.net>
5324
5325         Merge changes from Coreutils.
5326
5327         * exclude.h (PARAMS): Remove definition and uses.
5328         * exclude.c: Remove uses of `PARAMS'.
5329
5330         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5331         Add test-cases for DOS filenames. Declare program_name.
5332         (main): Set up program_name.  Patch by Rich Dawe.
5333
5334         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5335         error from mntctl.
5336         Use mntctl's return value to drive the entry-processing loop, since
5337         we can't rely on the value of the vmt_length member in the last
5338         entry.  On some systems doing so could result in exhausting
5339         virtual memory.  Based in part on a patch from Mike Jetzer.
5340
5341 2003-04-04  Bruno Haible  <bruno@clisp.org>
5342
5343         * linebreak.h: New file, from GNU gettext.
5344         * linebreak.c: New file, from GNU gettext with slight modifications.
5345         * lbrkprop.h: New file, from GNU gettext.
5346
5347 2003-04-03  Bruno Haible  <bruno@clisp.org>
5348
5349         * utf8-ucs4.h: New file, from GNU gettext.
5350         * utf16-ucs4.h: New file, from GNU gettext.
5351         * ucs4-utf8.h: New file, from GNU gettext.
5352         * ucs4-utf16.h: New file, from GNU gettext.
5353
5354 2003-04-02  Bruno Haible  <bruno@clisp.org>
5355
5356         * binary-io.h: New file, from GNU gettext.
5357
5358 2003-04-01  Bruno Haible  <bruno@clisp.org>
5359
5360         * pathname.h: New file, from GNU gettext.
5361         * concatpath.c: New file, from GNU gettext.
5362
5363 2003-03-30  Bruno Haible  <bruno@clisp.org>
5364
5365         * copy-file.c (copy_file_preserving): Don't set owner if the function
5366         chown() doesn't exist.
5367
5368 2003-03-28  Bruno Haible  <bruno@clisp.org>
5369
5370         * copy-file.h: New file, from GNU gettext.
5371         * copy-file.c: New file, from GNU gettext.
5372
5373 2003-03-18  Jim Meyering  <jim@meyering.net>
5374
5375         * quote.c (quote_n): Fix typo in comment.
5376
5377 2003-03-14  Jim Meyering  <jim@meyering.net>
5378
5379         Merge changes from Coreutils.
5380         * obstack.h (obstack_object_size): Declare temporary, __o,
5381         to be const, in order to avoid warnings.
5382         (obstack_room): Likewise.
5383         (obstack_empty_p): Likewise.
5384
5385 2003-03-13  Paul Eggert  <eggert@twinsun.com>
5386
5387         Merge changes from Bison.
5388         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5389         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5390         when compiling Bison 1.875's `bitset bset = obstack_alloc
5391         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
5392         * hash.c: Include <stdbool.h> unconditionally.
5393
5394 2003-03-09  Paul Eggert  <eggert@twinsun.com>
5395
5396         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5397         Reported by Bruce Becker; see:
5398         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5399
5400 2003-03-03  Paul Eggert  <eggert@twinsun.com>
5401             Bruno Haible  <bruno@clisp.org>
5402
5403         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5404         Reported by John Hughes, see
5405         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5406
5407 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
5408
5409         * poll_.h: New file.
5410         * poll.c: New file.
5411
5412 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
5413
5414         * mathl.h: New file.
5415         * acosl.c: New file.
5416         * asinl.c: New file.
5417         * atanl.c: New file.
5418         * ceill.c: New file.
5419         * cosl.c: New file.
5420         * expl.c: New file.
5421         * floorl.c: New file.
5422         * frexpl.c: New file.
5423         * ldexpl.c: New file.
5424         * logl.c: New file.
5425         * sincosl.c: New file.
5426         * sinl.c: New file.
5427         * sqrtl.c: New file.
5428         * tanl.c: New file.
5429         * trigl.c: New file.
5430         * trigl.h: New file.
5431
5432 2003-02-17  Bruno Haible  <bruno@clisp.org>
5433
5434         * mkdtemp.h: New file, from GNU gettext.
5435         * mkdtemp.c: New file, from GNU gettext.
5436
5437 2003-01-31  Bruno Haible  <bruno@clisp.org>
5438
5439         * rename.c: #undef rename before defining rpl_rename.
5440         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
5441
5442 2003-01-30  Bruno Haible  <bruno@clisp.org>
5443
5444         * printf-args.h: New file, from GNU gettext.
5445         * printf-args.c: New file, from GNU gettext.
5446         * printf-parse.h: New file, from GNU gettext.
5447         * printf-parse.c: New file, from GNU gettext.
5448         * vasnprintf.h: New file, from GNU gettext.
5449         * vasnprintf.c: New file, from GNU gettext.
5450         * asnprintf.c: New file, from GNU gettext.
5451         * vasprintf.h: New file, from GNU gettext with modifications.
5452         * vasprintf.c: New file, from GNU gettext.
5453         * asprintf.c: New file, from GNU gettext.
5454
5455 2003-01-29  Bruno Haible  <bruno@clisp.org>
5456
5457         * stpncpy.h: New file, from GNU gettext with modifications.
5458         * stpncpy.c: New file, from GNU gettext with modifications.
5459
5460 2003-01-28  Bruno Haible  <bruno@clisp.org>
5461
5462         * c-ctype.h: New file, from GNU gettext, with changes suggested by
5463         Paul Eggert.
5464         * c-ctype.c: New file, from GNU gettext, with changes suggested by
5465         Paul Eggert.
5466
5467 2003-01-27  Bruno Haible  <bruno@clisp.org>
5468
5469         * xsetenv.h: New file, from GNU gettext.
5470         * xsetenv.c: New file, from GNU gettext.
5471
5472 2003-01-23  Bruno Haible  <bruno@clisp.org>
5473
5474         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
5475
5476 2003-01-22  Bruno Haible  <bruno@clisp.org>
5477
5478         * exit.h: New file, from GNU gettext.
5479
5480 2003-01-11  Bruno Haible  <bruno@clisp.org>
5481
5482         * stpcpy.h (stpcpy): Use ANSI C function declarations.
5483         * strcase.h (strcasecmp, strncasecmp): Likewise.
5484
5485 2003-01-14  Jim Meyering  <jim@meyering.net>
5486
5487         * same.c (same_name): Tweak a comment.
5488
5489 2003-01-11  Bruno Haible  <bruno@clisp.org>
5490
5491         * same.c (same_name): Reorder tests so as to avoid calling stat()
5492         when a string comparison is sufficient.
5493
5494 2003-01-11  Bruno Haible  <bruno@clisp.org>
5495
5496         * readtokens.c (readtoken): Cast character to 'unsigned char', not
5497         'unsigned int'.
5498
5499 2003-01-11  Bruno Haible  <bruno@clisp.org>
5500
5501         * hash-pjw.c: Add comment about low quality of this function.
5502
5503 2003-01-12  Paul Eggert  <eggert@twinsun.com>
5504
5505         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
5506         to avoid collisions with libcurses and libreadline.
5507
5508         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
5509         * getstr.h, getstr.c: Remove.
5510         * getline.c: Include "getline.h", to check interface.
5511         Move body of old getstr.c here: this defines MIN_CHUNK and
5512         declares getdelim2, which is renamed from getstr.
5513         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
5514
5515         * linebuffer.c (readlinebuffer): Renamed from readline.
5516         All uses changed.
5517         * linebuffer.h: Likewise.
5518         (readline): Remove backward-compatibility macro.
5519
5520 2003-01-12  Jim Meyering  <jim@meyering.net>
5521
5522         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
5523
5524 2003-01-10  Bruno Haible  <bruno@clisp.org>
5525
5526         * alloca_.h: New file.
5527         * getdate.y: Unconditionally include alloca.h.
5528         * makepath.c: Likewise.
5529         * setenv.c: Likewise.
5530         * userspec.c: Likewise.
5531
5532 2003-01-09  Bruno Haible  <bruno@clisp.org>
5533
5534         * stdbool.h.in: New file.
5535
5536 2003-01-08  Bruno Haible  <bruno@clisp.org>
5537
5538         * safe-read.c: Include specification header first, to ensure its
5539         selfcontainedness.
5540         * full-write.c: Likewise.
5541
5542 2003-01-08  Jim Meyering  <jim@meyering.net>
5543
5544         * full-write.c: Undefine and define-away `const' after inclusion
5545         of errno.h, not before.  Suggestion from Bruno Haible.
5546
5547 2003-01-07  Jim Meyering  <jim@meyering.net>
5548
5549         * full-write.c: Rework so that it may serve to define full_read, too.
5550         * full-read.c: Simply #define FULL_READ and include full-write.c.
5551
5552 2003-01-06  Jim Meyering  <jim@meyering.net>
5553
5554         * version-etc.c: Update year in translatable copyright string.
5555
5556 2002-12-25  Bruno Haible  <bruno@clisp.org>
5557
5558         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5559         * xstrtol.h: Likewise.
5560         * xstrtoimax.c: Likewise.
5561         * xstrtoumax.c: Likewise.
5562         * human.h: Likewise.
5563
5564         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
5565         on systems that have <inttypes.h> but not <stdint.h>.
5566
5567 2002-12-31  Paul Eggert  <eggert@twinsun.com>
5568
5569         * memcoll.c (memcoll): Fall back on a simple algorithm using
5570         memcmp if strcoll doesn't work.
5571
5572 2002-12-23  Bruno Haible  <bruno@clisp.org>
5573
5574         * localcharset.h: New file.
5575         * localcharset.c: Include it.
5576         * unicodeio.c: Likewise.
5577
5578 2002-12-22  Bruno Haible  <bruno@clisp.org>
5579
5580         * utime.c (utime_null): No need to call ftruncate if the file was
5581         nonempty.
5582
5583 2002-12-23  Bruno Haible  <bruno@clisp.org>
5584
5585         * memcoll.c (STRCOLL): New macro.
5586         (memcoll): Use it.
5587
5588 2002-12-22  Bruno Haible  <bruno@clisp.org>
5589
5590         * getstr.h (getstr): Define, to avoid clash with libcurses.
5591         * linebuffer.h (readline): Define, to avoid clash with libreadline.
5592
5593 2002-12-22  Bruno Haible  <bruno@clisp.org>
5594
5595         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
5596
5597 2002-12-23  Bruno Haible  <bruno@clisp.org>
5598
5599         * getline.h: Include <stddef.h>, for size_t.
5600
5601         * unicodeio.h: Include <stddef.h>, for size_t.
5602         * unicodeio.c: Don't include <stddef.h>.
5603
5604 2002-12-17  Bruno Haible  <bruno@clisp.org>
5605
5606         * canon-host.c (strdup): Remove unused declaration.
5607
5608         * fsusage.c: Include full_read.h.
5609         (get_fs_usage): Use full_read instead of safe_read.
5610
5611         * utime.c (utime_null): Use SAFE_READ_ERROR.
5612
5613 2002-12-11  Bruno Haible  <bruno@clisp.org>
5614
5615         * setenv.h: Rewritten to cope with systems that have setenv() but not
5616         unsetenv().
5617         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
5618         modifications:
5619
5620         2002-12-11  Bruno Haible  <bruno@clisp.org>
5621
5622                 * setenv.c (alloca): Fall back to malloc.
5623                 (freea): New macro.
5624                 (setenv): Use freea() to free memory allocated with alloca().
5625
5626         2002-11-13  Bruno Haible  <bruno@clisp.org>
5627
5628                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
5629                 function declarations.
5630                 * unsetenv.c (unsetenv): Likewise.
5631
5632         2002-03-04  Bruno Haible  <bruno@clisp.org>
5633
5634                 Portability to AIX 4.3.3.
5635                 * unsetenv.c: New file, extracted from setenv.c.
5636                 * setenv.c: Move the unsetenv() function to unsetenv.c.
5637
5638         2001-12-20  Bruno Haible  <bruno@clisp.org>
5639
5640                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
5641                 use malloc instead. For SunOS 4.
5642
5643         2001-12-11  Bruno Haible  <bruno@clisp.org>
5644
5645                 * setenv.c: Declare alloca.
5646                 (compar_fn_t): New typedef.
5647                 (KNOWN_VALUE, STORE_VALUE): Use it.
5648
5649         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
5650         setenv.h.
5651
5652 2002-12-10  Paul Eggert  <eggert@twinsun.com>
5653
5654         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
5655         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
5656         Choose values that are less likely to collide with system fnmatch
5657         options.
5658         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
5659         defined (e.g., a pure POSIX system).
5660         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
5661         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
5662
5663 2002-12-06  Jim Meyering  <jim@meyering.net>
5664
5665         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
5666
5667         Merge in changes from libc's misc/error.c, in preparation
5668         for the merge of gnulib's changes back into libc.
5669
5670         * error.c (_): Define only if not already defined.
5671         Move definition to follow all #include directives.
5672         Include unlocked-io.h only if !_LIBC.
5673         [_LIBC]: Include <libio/libioP.h>.
5674         [USE_IN_LIBIO]: Include <libio/iolibio.h>
5675         (fflush): Tweak definition to use INTUSE.
5676         (putc): Define.
5677
5678 2002-12-05  Paul Eggert  <eggert@twinsun.com>
5679
5680         * alloca.c [defined emacs]: Include "lisp.h".
5681         (xalloc_die) [defined emacs]: New macro.
5682         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
5683         [! defined emacs]: Include <xalloc.h>.
5684         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
5685         (pointer): Typedef to POINTER_TYPE *.
5686         (malloc): Remove decl; we now always use xmalloc.
5687         (alloca): Use old-style definition, since Emacs needs this.
5688         Check for arithmetic overflow when computing combined size.
5689
5690 2002-12-04  Paul Eggert  <eggert@twinsun.com>
5691
5692         Do not generate unlocked-io.h automatically, since it's easier to
5693         maintain it by hand.
5694
5695         * unlocked-io.h: New file, from GNU diffutils,
5696         but with proper copyright notice and attribution.
5697         * gen-uio: Remove.
5698         * Makefile.am: Add copyright notice.
5699         (libfetish_a_SOURCES): Add unlocked-io.h.
5700         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
5701         (DISTCLEANFILES, io_functions): Remove macros.
5702         (EXTRA_DIST): Remove gen_uio.
5703         (unlocked-io.h): Remove rule.
5704
5705 2002-12-04  Jim Meyering  <jim@meyering.net>
5706
5707         Reflect the fact that stat.c and lstat.c are no longer generated.
5708         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
5709         (DISTCLEANFILES): Likewise.
5710         (EXTRA_DIST): Likewise.
5711         (all_local): Don't depend on stat.c or lstat.c.
5712         (stat.c, lstat.c): Remove rules.
5713         (EXTRA_DIST): Remove xstat.in.
5714
5715         * xstat.in: Remove file.  Contents moved into stat.c.
5716         * stat.c: New file.  Contents mostly from xstat.in.
5717         * stat.c: Rework so that it may serve to define rpl_lstat, too.
5718         * lstat.c: New file. Simply #define LSTAT and include stat.c.
5719
5720         * safe-read.c: Rework so that it may serve to define safe_write, too.
5721         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
5722
5723 2002-12-03  Jim Meyering  <jim@meyering.net>
5724
5725         * safe-read.c, safe-write.c: Change variable names and comments, but
5726         not semantics, to minimize the differences between these two files.
5727         (safe_read): Change comment to mention SAFE_READ_ERROR.
5728
5729         * safe-read.c (IS_EINTR): Define.
5730         (safe_read): Use IS_EINTR in place of in-function cpp directives.
5731
5732 2002-12-02  Bruno Haible  <bruno@clisp.org>
5733
5734         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
5735         Define, taken from safe-read.c.
5736         (INT_MAX): Provide fallback.
5737         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
5738         * safe-write.h (SAFE_WRITE_ERROR): Define.
5739
5740         * safe-read.c (EINTR): Remove definition.
5741         (safe_read): Don't use EINTR if it is absent.
5742
5743 2002-12-02  Jim Meyering  <jim@meyering.net>
5744
5745         * safe-read.c (EINTR): Define.
5746         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5747         (INT_MAX): Provide fallback.
5748         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
5749
5750         * safe-read.h (SAFE_READ_ERROR): Define.
5751
5752 2002-12-01  Jim Meyering  <jim@meyering.net>
5753
5754         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
5755         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
5756
5757 2002-11-27  Paul Eggert  <eggert@twinsun.com>
5758
5759         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5760         hash_rehash): Replace `if (limit <= value) abort ();' with
5761         `if (! (value < limit)) abort ();', for readability.
5762
5763 2002-11-26    <karl@gnu.org>
5764
5765         * strdup.c: copy from libc again, with jim's ok.
5766         * .cppi-disable: re-add strdup.c
5767
5768 2002-11-25    <karl@gnu.org>
5769
5770         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
5771         instead of "strtol.c".
5772
5773 2002-11-25  Jim Meyering  <jim@meyering.net>
5774
5775         * mktime.c: Sync from libc, now that it has the latest fix.
5776
5777 2002-11-24    <karl@gnu.org>
5778
5779         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
5780         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
5781
5782 2002-11-24  Jim Meyering  <jim@meyering.net>
5783
5784         Update from coreutils:
5785
5786         * mktime.c: Merge in changes from libc.
5787
5788         Avoid a link-time failure on some Linux systems.
5789         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
5790         (__mon_yday): Declare with the STATIC attribute.
5791         (__mktime_internal): Likewise.
5792         Based on a report from Greg Schafer.
5793
5794 2002-11-23  Jim Meyering  <jim@meyering.net>
5795
5796         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
5797         Use `unsigned', not `int', as type of index.
5798
5799         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
5800
5801         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
5802
5803 2002-11-22  Paul Eggert  <eggert@twinsun.com>
5804
5805         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
5806         hint that one should use `if (! x) abort ();' rather than `assert
5807         (x);', and anyway it's one less thing to worry about configuring.
5808         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5809         hash_rehash, hash_insert): Use abort rather than assert.
5810
5811 2002-11-22  Paul Eggert  <eggert@twinsun.com>
5812
5813         * quotearg.h: Allow multiple inclusion by surrounding with
5814         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
5815         so that we can be included first.
5816         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
5817         * quotearg.c: Include quotearg.h immediately after config.h.
5818         No need to include stddef.h or sys/types.h any more.
5819         Surround local include files with "", not "<>".
5820         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
5821         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
5822         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
5823         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
5824         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
5825         (ISPRINT): Remove; no longer needed now that we assume C89.
5826
5827         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
5828         Preserve errno.
5829
5830         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
5831         quotearg_char): Use SIZE_MAX rather than
5832         (size_t) -1 when we are talking about "infinity".
5833
5834         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
5835
5836 2002-11-22  Bruno Haible  <bruno@clisp.org>
5837
5838         * safe-read.h: Assume C89. Add comments.
5839         (safe_read): Change return type to size_t.
5840         * safe-read.c (safe_read): Change return type to size_t. Handle byte
5841         counts > SSIZE_MAX correctly.
5842         * safe-write.h: New file.
5843         * safe-write.c: New file.
5844         * full-read.h: New file.
5845         * full-read.c: New file.
5846         * full-write.h: Assume C89. Add comments.
5847         * full-write.c: Include safe-write.h.
5848         (full_write): Rewritten to use safe_write.
5849         Suggested by Jim Meyering and Paul Eggert.
5850
5851 2002-11-21  Bruno Haible  <bruno@clisp.org>
5852
5853         Remove case insensitive option matching.
5854         * argmatch.h (argcasematch): Remove declaration.
5855         (ARGCASEMATCH): Remove macro.
5856         (__xargmatch_internal): Remove case_sensitive argument.
5857         (XARGMATCH): Update.
5858         (XARGCASEMATCH): Remove macro.
5859         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
5860         case_sensitive argument.
5861         (argcasematch): Remove function.
5862         (__xargmatch_internal): Remove case_sensitive argument.
5863         (main): Use XARGMATCH instead of XARGCASEMATCH.
5864
5865         * xmalloc.c: Change compile-time error message. Add comment about
5866         required autoconf version.
5867
5868 2002-11-21  Jim Meyering  <jim@meyering.net>
5869
5870         * strdup.c (strdup): Tweak comment and initial #if/#include.
5871
5872         Merge in changes from the coreutils.
5873
5874         2002-09-25  Paul Eggert  <eggert@twinsun.com>
5875         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
5876         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
5877         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
5878         int.  Work more efficiently if X is the same width as uintmax_t.
5879         Do not compare X to -1, to avoid bogus compiler warning.
5880         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
5881         Don't assume that f_frsize and f_bsize are the same type.
5882
5883         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
5884         on FreeBSD.
5885
5886         * makepath.c (make_path): Restore umask *before* creating the final
5887         component.
5888         (make_path): Minor reformatting.
5889
5890         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
5891         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
5892
5893         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
5894         ones.  At least on GNU/Linux systems, `auto' means something else.
5895         From Michael Stone.
5896
5897 2002-11-20  Paul Eggert  <eggert@twinsun.com>
5898
5899         Merge argmatch cleanups from Bison.  Assume C89.
5900
5901         * argmatch.c: Include config.h here, not in argmatch.h.
5902         Include stdlib.h, for EXIT_FAILURE.
5903         Always include <string.h>, since we assume C89.
5904         (EXIT_FAILURE): Remove pre-C89 bug workaround.
5905         * argmatch.h: Do not include <config.h> or <sys/types.h>.
5906         Include <stddef.h> instead, since it's all we need for size_t.
5907         (PARAMS): Remove.  All uses removed.
5908         (ARRAY_CARDINALITY): Do not bother to #undef.
5909         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
5910         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
5911         Remove unnecessary parentheses.
5912         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
5913         Insert necessary parentheses.
5914         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
5915         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
5916
5917 2002-11-19  Bruno Haible  <bruno@clisp.org>
5918
5919         * mbswidth.c: Include mbswidth.h right at the beginning.
5920         * mbswidth.h: Include <stddef.h>, for size_t.
5921
5922         * mbswidth.h (PARAMS): Remove macro.
5923         (mbswidth, mbsnwidth): Use ANSI C function declarations.
5924         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
5925
5926         * gcd.h (PARAMS): Remove macro.
5927         (gcd): Use ANSI C function declarations.
5928         * gcd.c (gcd): Likewise.
5929
5930 2002-11-15  Bruno Haible  <bruno@clisp.org>
5931
5932         * strcspn.c: Include <stddef.h>.
5933         (strcspn): Use ANSI C function declaration. Change return type to
5934         size_t. Use NULL.
5935         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
5936         (strpbrk): Use NULL.
5937         * strpbrk.h (PARAMS): Remove macro.
5938         (strpbrk): Use ANSI C function declaration.
5939         * strstr.c: Don't include <sys/types.h>.
5940         * strstr.h (PARAMS): Remove macro.
5941         (strstr): Use ANSI C function declarations.
5942
5943 2002-11-06  Bruno Haible  <bruno@clisp.org>
5944
5945         * gcd.h (gcd): Change argument type to 'unsigned long'.
5946         * gcd.c (gcd): Likewise.
5947
5948 2002-11-05  Bruno Haible  <bruno@clisp.org>
5949
5950         * gcd.h: New file, from gettext-0.11.5.
5951         * gcd.c: New file, from gettext-0.11.5.
5952
5953 2002-11-05  Bruno Haible  <bruno@clisp.org>
5954
5955         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5956         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5957         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5958         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5959
5960         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
5961         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
5962
5963         * closeout.c: Include gettext.h instead of <libintl.h>.
5964         * human.c: Include gettext.h instead of <libintl.h>.
5965         * quotearg.c: Include gettext.h instead of <libintl.h>.
5966         * rpmatch.c: Include gettext.h instead of <libintl.h>.
5967         * unicodeio.c: Include gettext.h instead of <libintl.h>.
5968         * userspec.c: Include gettext.h instead of <libintl.h>.
5969         * version-etc.c: Include gettext.h instead of <libintl.h>.
5970         * xmalloc.c: Include gettext.h instead of <libintl.h>.
5971         (textdomain): Remove definition.
5972         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
5973
5974         * long-options.c: Remove include of <libintl.h> and definition of _.
5975         * same.c: Remove include of <libintl.h> and definition of _.
5976
5977 2002-11-04  Bruno Haible  <bruno@clisp.org>
5978
5979         * stpcpy.h: New file, from GNU gettext-0.11.5.
5980         * strcase.h: New file, from GNU gettext-0.11.5.
5981         * strpbrk.h: New file, from GNU gettext-0.11.5.
5982         * strstr.h: New file, from GNU gettext-0.11.5.
5983         * xgetcwd.h: New file, from GNU gettext-0.11.5.
5984
5985 2002-05-09  Bruno Haible  <bruno@clisp.org>
5986
5987         * config.charset: Update for newest glibc. Add canonical names
5988         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
5989
5990 2002-05-09  Bruno Haible  <bruno@clisp.org>
5991
5992         * localcharset.c (get_charset_aliases): Add more Windows specific
5993         aliases.
5994
5995 2002-05-08  Owen Taylor  <otaylor@redhat.com>
5996
5997         * config.charset: A few additions for Solaris.
5998
5999 2001-12-05  Bruno Haible  <bruno@clisp.org>
6000
6001         * localcharset.c (locale_charset): Don't return an empty string.
6002
6003 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
6004
6005         * config.charset: msdos in uk_UA uses CP1125.
6006
6007 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
6008
6009         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6010         * localcharset.c (locale_charset): Declare as extern "C".
6011
6012 2002-02-15  Bruno Haible  <bruno@clisp.org>
6013
6014         * config.charset [msdosdjgpp]: For Russian, use CP866.
6015
6016 2002-02-11  Bruno Haible  <bruno@clisp.org>
6017
6018         * config.charset: Add support for NetBSD.
6019
6020 2002-09-25    <karl@gnu.org>
6021
6022         * strdup.c: copy from libc/string (via ../config/srclist*).
6023         * getopt*: copy from libc/posix.
6024         * gettext.h: copy from gettext.
6025         * .cppi-disable: add strdup.c, gettext.h.
6026
6027 2002-07-01  Jim Meyering  <meyering@lucent.com>
6028
6029         * c-stack.c: Include sys/time.h.
6030         From Volker Borchert.
6031
6032 2002-06-11  Paul Eggert  <eggert@twinsun.com>
6033
6034         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6035         New macro.  Use it uniformly instead of
6036         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6037         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6038         reported by Vin Shelton.
6039
6040 2002-06-22  Jim Meyering  <meyering@lucent.com>
6041
6042         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6043         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6044
6045 2002-06-22  Paul Eggert  <eggert@twinsun.com>
6046
6047         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6048         Do not assume SA_SIGINFO behavior.
6049         Bug reported by Jim Meyering on NetBSD 1.5.2.
6050
6051 2002-06-22  Jim Meyering  <meyering@lucent.com>
6052
6053         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6054
6055         * exitfail.c, exitfail.h: Likewise.
6056         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6057
6058         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6059         of fnmatch.h.
6060         (EXTRA_DIST): Add fnmatch_loop.c.
6061         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6062
6063         * fnmatch_loop.c: New file, from diffutils-2.8.2.
6064         * fnmatch.c: Update from diffutils-2.8.2.
6065         * fnmatch_.h: New file.  From diffutils-2.8.2.
6066         * fnmatch.h: Remove file.
6067
6068 2002-06-18  Paul Eggert  <eggert@twinsun.com>
6069
6070         * file-type.h: Report an error if neither S_ISREG nor
6071         S_IFREG is defined, instead of using a test specific to glibc
6072         2.2.  This should be safe, since POSIX requires S_ISREG and
6073         Unix Version 7 had S_IFREG.  We don't need to check for
6074         <sys/types.h> since we don't use any symbols that it defines.
6075
6076 2002-06-15  Jim Meyering  <meyering@lucent.com>
6077
6078         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6079         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6080         have been included before this file.
6081
6082 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
6083
6084         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6085         so that each temporary file name is unique and valid in the first
6086         8 characters, for operation under DOS.
6087
6088 2002-06-15  Jim Meyering  <meyering@lucent.com>
6089
6090         Work even with DJGPP 2.03, which lacks support for symlinks.
6091         From Richard Dawe.
6092         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6093         is defined.
6094         * lchown.c (S_ISLNK): Likewise.
6095
6096 2002-06-14  Jim Meyering  <meyering@lucent.com>
6097
6098         * file-type.h: Use the version from diffutils-2.8.2.
6099         * file-type.c: Likewise.
6100
6101 2002-05-27  Jim Meyering  <meyering@lucent.com>
6102
6103         Fix a problem seen only on nonconforming systems whereby ls.c's
6104         use of localtime, and then of gettimeofday would cause trouble:
6105         the localtime call used to initialize rpl_gettimeofday's save
6106         mechanism would clobber ls's current local time information so
6107         that in any long listing the first file would always be listed
6108         with date 1970-01-01.  Analysis by Volker Borchert.
6109
6110         * gettimeofday.c (localtime): Undefine.
6111         (rpl_localtime): New function.
6112
6113 2002-05-22  Jim Meyering  <meyering@lucent.com>
6114
6115         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6116         * file-type.h: New file.
6117         * file-type.c (file_type): New file/function.  Extracted from diffutils.
6118
6119 2002-04-29  Paul Eggert  <eggert@twinsun.com>
6120
6121         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6122
6123 2002-04-28  Paul Eggert  <eggert@twinsun.com>
6124
6125         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6126         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
6127         of 127, since 64 is the largest conceivable number for ancient
6128         nonstandard hosts.
6129         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6130
6131 2002-04-28  Jim Meyering  <meyering@lucent.com>
6132
6133         * sig2str.c (WTERMSIG): Remove definition (unused).
6134
6135 2002-04-28  Paul Eggert  <eggert@twinsun.com>
6136
6137         * sig2str.h, sig2str.c: New files.
6138         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6139
6140 2002-04-24  Jim Meyering  <meyering@lucent.com>
6141
6142         * gettext.h: New file, from Gettext.
6143         * Makefile.am (INCLUDES): Remove -I../intl.
6144         (libfetish_a_SOURCES): Add gettext.h.
6145
6146 2002-04-16  Jim Meyering  <meyering@lucent.com>
6147
6148         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6149         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6150         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6151
6152 2002-04-12  Jim Meyering  <meyering@lucent.com>
6153
6154         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6155
6156 2002-03-10  Jim Meyering  <meyering@lucent.com>
6157
6158         * makepath.c (make_path): Remove a comma from a diagnostic.
6159         Suggestion from Santiago Vila.
6160
6161 2002-03-08  Jim Meyering  <meyering@lucent.com>
6162
6163         * rename.c: Mention that this wrapper is needed also on
6164         mips-dec-ultrix4.4 systems.
6165
6166 2002-03-02  Jim Meyering  <meyering@lucent.com>
6167
6168         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6169         not HAVE_CLOCK_SETTIME.
6170
6171 2002-02-27  Paul Eggert  <eggert@twinsun.com>
6172
6173         * nanosleep.h: Rename to....
6174         * timespec.h: New name for nanosleep.h.  All uses changed.
6175
6176         * gettime.c: New file.
6177         * settime.c: New file.
6178         * stime.c: Remove.
6179
6180         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6181         timespec.h.  Remove nanosleep.h.
6182
6183 2002-02-25  Paul Eggert  <eggert@twinsun.com>
6184
6185         * acl.c, acl.h: New files.
6186         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6187
6188 2002-02-24  Jim Meyering  <meyering@lucent.com>
6189
6190         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6191         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6192         cause trouble.  Reported by Nelson Beebe.
6193
6194 2002-02-23  Paul Eggert  <eggert@twinsun.com>
6195
6196         * path-concat.c (xpath_concat): Reorder code to pacify
6197         compilers that don't know that xalloc_die never returns.
6198
6199 2002-02-20  Jim Meyering  <meyering@lucent.com>
6200
6201         * getdate.c: Regenerate using bison-1.33.
6202
6203 2002-02-15  Paul Eggert  <eggert@twinsun.com>
6204
6205         * posixver.c, posixver.h: New files.
6206         * Makefile.am (libfetish_a_SOURCES): Add them.
6207
6208 2002-02-02  Paul Eggert  <eggert@twinsun.com>
6209             Bruno Haible  <bruno@clisp.org>
6210
6211         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6212         (fwrite_success_callback): New declaration.
6213         * unicodeio.c (unicode_to_mb): New function, extracted from
6214         print_unicode_char. Call failure callback instead of error.
6215         (fwrite_success_callback): New function.
6216         (exit_failure_callback): New function.
6217         (fallback_failure_callback): New function.
6218         (print_unicode_char): Call unicode_to_mb.
6219
6220 2002-01-26  Jim Meyering  <meyering@lucent.com>
6221
6222         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6223
6224 2002-01-22  Jim Meyering  <meyering@lucent.com>
6225
6226         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6227         Otherwise, some versions of automake would omit the rule that makes
6228         Makefile from Makefile.in.
6229
6230 2001-01-21  Paul Eggert  <eggert@twinsun.com>
6231
6232         * xmemcoll.h, xmemcoll.c: New files.
6233         * Makefile.am (libfetish_a_SOURCES): Add them.
6234         * memcoll.c: Include errno.h, and declare errno if not defined.
6235         (memcoll): Set errno to zero if there is no error.
6236
6237         * quotearg.c (quotearg_buffer_restyled):
6238         Fix bug with quoting buffers containing NUL when backslashing escapes.
6239         This bug was exposed by the other changes in this patch.
6240         (quotearg_n_options): New arg ARGSIZE.
6241         All callers changed.
6242         (quoting_options_from_style): New function.
6243         (quotearg_n_style): Use it.
6244         (quotearg_n_style_mem): New function.
6245
6246         * quotearg.h (quotearg_n_style_mem): New function.
6247
6248 2002-01-16  Jim Meyering  <meyering@lucent.com>
6249
6250         * getdate.y: Add three semicolons, each just before a closing brace.
6251         Bison (as of version 1.31) no longer papers over that mistake.
6252
6253 2002-02-14  Paul Eggert  <eggert@twinsun.com>
6254
6255         * backupfile.c (ISDIGIT): Comment fix.
6256         * getdate.y (ISDIGIT): Likewise.
6257         * posixtm.c (ISDIGIT, year): Likewise.
6258         * strverscmp.c (ISDIGIT): Likewise.
6259         * userspec.c (ISDIGIT): Likewise.
6260
6261 2002-01-05  Jim Meyering  <meyering@lucent.com>
6262
6263         * version-etc.c (version_etc_copyright): Update copyright year.
6264
6265 2001-01-19  Paul Eggert  <eggert@twinsun.com>
6266
6267         * closeout.c (close_stdout_status): If ferror (stdout), do
6268         not silently exit merely because the output buffer happens to
6269         have nothing pending.
6270
6271 2001-12-18  Paul Eggert  <eggert@twinsun.com>
6272
6273         See the big note in ../ChangeLog.
6274         * human.c (suffixes): Prefer K to k for 1024.
6275         (generate_suffix_backwards): New function.
6276         (human_readable_inexact): Use it.
6277         * xstrtol.c (__xstrtol): If there is no number but there
6278         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
6279         Accept 'K' as well as 'k'.
6280
6281 2001-12-15  Jim Meyering  <meyering@lucent.com>
6282
6283         * regex.h (__restrict_arr): Update from libc.
6284
6285         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6286         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
6287         (STREQ): Define.
6288
6289 2001-12-10  Jim Meyering  <meyering@lucent.com>
6290
6291         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6292         Instead, include "xalloc.h".
6293         (initbuffer): Don't cast xmalloc return value to char*.
6294         (readline): Reword comment.
6295         Don't cast xrealloc return value to char*
6296         Return NULL, not 0.
6297
6298 2001-12-09  Jim Meyering  <meyering@lucent.com>
6299
6300         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6301         `signed and unsigned type in conditional expression'.
6302         * posixtm.c (posix_time_parse): Likewise.
6303
6304         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6305
6306         * readtokens.c (readtoken): Declare an index to be of type unsigned
6307         to avoid a pedantic warning.
6308
6309         * getstr.c: Don't include assert.h.
6310         (getstr): Remove warning-evoking assertions.
6311         Return -1 if offset parameter is out of bounds.
6312         Change the type of a local from int to size_t.
6313
6314         * strftime.c (my_strftime_localtime_r): Include this function
6315         definition in the `#if ! HAVE_TM_GMTOFF' block.
6316
6317         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6318         Include xalloc.h instead.
6319
6320 2001-12-02  Jim Meyering  <meyering@lucent.com>
6321
6322         * tempname.c: Don't declare getenv, thus reverting the change of
6323         2001-11-18.  It's no longer necessary, now that stdlib.h is always
6324         included.
6325
6326         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6327         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
6328
6329 2001-11-30  Akim Demaille  <akim@epita.fr>
6330
6331         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6332         before being defined.
6333
6334 2001-11-27  Paul Eggert  <eggert@twinsun.com>
6335
6336         * quotearg.h (quotearg_n, quotearg_n_style):
6337         First arg is int, not unsigned.
6338         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6339         (SIZE_MAX, UINT_MAX): New macros.
6340         (quotearg_n_options): Abort if N is negative.
6341         Avoid overflow check on hosts where size_t is 64 bits and int
6342         is 32 bits, as overflow is impossible there.
6343         Fix off-by-one typo that caused unnecessary reallocation.
6344
6345 2001-11-27  Jim Meyering  <meyering@lucent.com>
6346
6347         * tempname.c: Merge with version from libc.
6348         * regex.c: Likewise.
6349
6350         * tempname.c: Include stdlib.h unconditionally.  On some old systems
6351         for which STDC_HEADERS is 0, it was not included, resulting in a
6352         warning about an integer-to-pointer conversion problem with getenv.
6353         Reported by Volker Borchert.
6354
6355 2001-11-26  Jim Meyering  <meyering@lucent.com>
6356
6357         * gtod.h: Remove file.
6358         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6359         * gettimeofday.c: Don't include gtod.h.
6360         (GTOD_init): Remove function.
6361         (rpl_gettimeofday): Do its job here instead, rather than aborting.
6362         Suggestion from Volker Borchert.
6363
6364 2001-11-23  Jim Meyering  <meyering@lucent.com>
6365
6366         * hash.h (struct hash_table): Don't define here.  Merely declare it.
6367         * hash.c (struct hash_table): Define it here instead.
6368
6369 2001-11-22  Jim Meyering  <meyering@lucent.com>
6370
6371         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6372
6373 2001-11-18  Paul Eggert  <eggert@twinsun.com>
6374
6375         * tempname.c (TMP_MAX): Remove; no longer needed.
6376         (TEMPORARIES): New macro.
6377         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
6378         removes an artificial limitation (e.g. HP-UX 10.20, where
6379         TMP_MAX is 17576).
6380
6381 2001-11-18  Jim Meyering  <meyering@lucent.com>
6382
6383         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6384         on SunOS 4.
6385
6386         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6387         files will be created before anything else.
6388
6389 2001-11-17  Jim Meyering  <meyering@lucent.com>
6390
6391         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6392         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6393         rather than group writable.  Patch by Juan F. Codagnone.
6394
6395         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6396         Instead, include "xalloc.h".
6397
6398         * mountlist.c: Include unlocked-io.h after all system headers.
6399         Remove explicit declarations of xmalloc, xrealloc,
6400         and xstrdup.  Instead, include "xalloc.h".
6401
6402         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6403         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6404         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6405
6406         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6407         Reported by Padraig Brady.
6408
6409         * mkstemp.c: #undef mkstemp.
6410         Include config.h.
6411         (rpl_mkstemp): Rename from mkstemp.
6412         Protoize.
6413
6414 2001-11-16  Jim Meyering  <meyering@lucent.com>
6415
6416         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6417         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6418         determine the amount of total physical memory, use pstat_getstatic.
6419         HPUX-11 doesn't define _SC_PHYS_PAGES.
6420         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6421         If sysconf couldn't be used to determine the amount of available
6422         physical memory, use both pstat_getstatic and pstat_getdynamic.
6423         Based on a patch from Bob Proulx.
6424
6425 2001-11-05  Jim Meyering  <meyering@lucent.com>
6426
6427         * xstat.in (slash_aware_lstat): Correct a misleading comment.
6428
6429 2001-11-03  Jim Meyering  <meyering@lucent.com>
6430
6431         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6432         in argmatch_to_argument call.
6433
6434         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6435         argument.
6436
6437         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6438         e.g., a fault due to an attempt to free a NULL pointer.
6439
6440 2001-11-01  Jim Meyering  <meyering@lucent.com>
6441
6442         * dirfd.c, dirfd.h: New files.
6443         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6444
6445         * hash.c (hash_print) [TESTING]: Clean up.
6446
6447 2001-10-22  Paul Eggert  <eggert@twinsun.com>
6448
6449         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6450         to avoid a warning if -Wall.
6451
6452 2001-10-21  Paul Eggert  <eggert@twinsun.com>
6453
6454         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6455
6456 2001-10-21  Jim Meyering  <meyering@lucent.com>
6457
6458         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
6459         this code would end up calling gettext even in packages built
6460         with --disable-nls.
6461         * getopt.c (_): Likewise.
6462         * regex.c (_): Likewise.
6463
6464 2001-10-20  Paul Eggert  <eggert@twinsun.com>
6465
6466         * error.c (strerror_r): Do not declare unless !_LIBC.
6467         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6468         Use strerror_r that is only a macro, even if it is not a function.
6469         (strerror): Check for HAVE_DECL_STRERROR before declaring.
6470         (private_strerror): Use prototypes, not old-style function definition.
6471         (print_errno_message): New function.
6472         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6473         char*-flavored one.
6474         (error_tail, error, error_at_line): Use it.
6475
6476 2001-10-11  Jim Meyering  <meyering@lucent.com>
6477
6478         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6479         and quote_n (1, ... to avoid clobbering a buffer.
6480
6481 2001-10-05  Jim Meyering  <meyering@lucent.com>
6482
6483         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6484         * hash-pjw.c: New file (factored out of fileutils' remove.c).
6485         * hash-pjw.h: New file.
6486
6487 2001-09-30  Jim Meyering  <meyering@lucent.com>
6488
6489         * mountlist.c [MOUNTED_GETFSSTAT]:
6490         Include <sys/ucred.h>, for Apple Darwin.
6491         Include sys/mount.h and sys/fs_types.h only if available.
6492         (FS_TYPE): Define.
6493         (read_filesystem_list): Use FS_TYPE.
6494
6495 2001-09-29  Paul Eggert  <eggert@twinsun.com>
6496
6497         * exclude.c (excluded_filename): 0 -> false, since it's
6498         a boolean context.
6499
6500 2001-09-28  Paul Eggert  <eggert@twinsun.com>
6501
6502         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6503         #defines strtoimax.  Also treat the other strto* functions
6504         like strtoimax.
6505
6506         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6507         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6508         (strtoimax, strtoumax): Do not declare if already defined as a macro.
6509
6510 2001-09-26  Jim Meyering  <meyering@lucent.com>
6511
6512         Most macros in unlocked-io.h had the wrong number of arguments.
6513         * gen-uio: New script.
6514         (USE_UNLOCKED_IO): Define to 1 if not already defined.
6515         * unlocked-io.hin: Remove file.
6516         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6517         rather than trying to embed it here.
6518         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
6519         Reported by Padraig Brady.
6520
6521 2001-09-25  Volker Borchert  <bt@teknon.de>
6522
6523         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6524
6525 2001-09-23  Jim Meyering  <meyering@lucent.com>
6526
6527         * mountlist.c: Remove useless parentheses in #if directives.
6528         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6529         the deprecated MOUNTED symbol is no longer defined in mntent.h.
6530
6531 2001-09-22  Jim Meyering  <meyering@lucent.com>
6532
6533         * localcharset.c: Update from latest gettext.
6534         * config.charset: Likewise.
6535
6536 2001-09-20  Jim Meyering  <meyering@lucent.com>
6537
6538         * xstrtol.c (strtoimax): Guard declaration with
6539         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6540         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6541         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6542         (strtoumax): Likewise, for completeness (it wasn't necessary).
6543
6544 2001-09-06  Paul Eggert  <eggert@twinsun.com>
6545
6546         * strtoimax.c (HAVE_LONG_LONG):
6547         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6548         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6549         to work around bug in IBM C compiler.
6550
6551 2001-09-16  Jim Meyering  <meyering@lucent.com>
6552
6553         * mkdir.c: New file.
6554
6555 2001-09-04  Paul Eggert  <eggert@twinsun.com>
6556
6557         * xgetcwd.c: Revert some of the previous change; intead,
6558         fix the HAVE_GETCWD_NULL code to behave more like the
6559         !HAVE_GETCWD_NULL code used to.
6560
6561         Include "xalloc.h".
6562         (xgetcwd): Do not return NULL when memory is exhausted; instead,
6563         invoke xalloc_die.
6564
6565 2001-09-04  Paul Eggert  <eggert@twinsun.com>
6566
6567         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
6568         Use ssize_t, not int, to store result of readlink.
6569         Check for ssize_t overflow as well as size_t overflow,
6570         as POSIX says the result of readlink is implementation-defined
6571         when ssize_t overflows.
6572         Remove unnecessary cast to char*.
6573         Use free+malloc instead of realloc, as the storage doesn't need
6574         to be preserved and it's clearer and can be more efficient that way.
6575         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6576         * xreadlink.h (xreadlink): Update prototype.
6577
6578 2001-09-03  Paul Eggert  <eggert@twinsun.com>
6579
6580         * exclude.c (fnmatch_no_wildcards): Fix confusion between
6581         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
6582         spotted by Jim Meyering.
6583
6584 2001-09-03  Jim Meyering  <meyering@lucent.com>
6585
6586         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6587
6588 2001-09-03  Paul Eggert  <eggert@twinsun.com>
6589
6590         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6591         like the HAVE_GETCWD_NULL code.
6592         Include pathmax.h if not HAVE_GETCWD.
6593         Do not include xalloc.h.
6594         (INITIAL_BUFFER_SIZE): New symbol.
6595         Do not use xmalloc / xrealloc, since the caller is responsible for
6596         handling errors.  Preserve errno around `free' during failure.
6597         Do not overrun buffer when using getwd.
6598
6599 2001-09-03  Paul Eggert  <eggert@twinsun.com>
6600
6601         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
6602         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
6603
6604 2001-09-02  Jim Meyering  <meyering@lucent.com>
6605
6606         * error.c: Update from GNU libc.
6607
6608 2001-09-01  Jim Meyering  <meyering@lucent.com>
6609
6610         * xreadlink.c: New file.
6611         * xreadlink.h: New file.
6612         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
6613
6614         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
6615         doesn't conflict with sparc Solaris 7's definition in
6616         /usr/include/sys/int_types.h.
6617
6618         * exclude.c: Use `""', not `<>' to #include non-system header files.
6619         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6620         and strncasecmp as r-values.  Unixware didn't have declarations.
6621
6622 2001-08-31  Jim Meyering  <meyering@lucent.com>
6623
6624         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6625         Use an initial, malloc'd, buffer of length 128 rather than
6626         a statically allocated one of length 1024.
6627
6628 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6629
6630         * xgetcwd.c: Don't include pathmax.h.
6631         Include stdlib.h and unistd.h if available.
6632         Include xalloc.h.
6633         (xmalloc, xstrdup, free): Remove decls.
6634         (xgetcwd): Don't assume sizes fit in unsigned.
6635         Check for overflow when computing sizes.
6636         Simplify reallocation code.
6637
6638 2001-08-28  Paul Eggert  <eggert@twinsun.com>
6639
6640         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
6641
6642         * strtoimax.c: Renamed from strtoxmax.c, removing the
6643         old strtoimax.c.
6644
6645         Also, make the following further changes to make this file's
6646         configuration more similar to that of strtol.c:
6647         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
6648         (strtoumax, uintmax_t, strtoull, strtol): Remove.
6649         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6650         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
6651         changed to signed values.
6652
6653         And make the following changes as well:
6654         Fix copyright notice, as 1999 was missing.
6655         (verify): New macro.
6656         (strtoimax): Check sizes at compile-time, not run-time.
6657         Prefer strtol to strtoll if both work.
6658         (main): Remove; it was not that useful and was a pain to maintain.
6659
6660         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
6661
6662 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6663
6664         * savedir.c (savedir): Remove size parameter, as POSIX says that
6665         a directory's st_size can have an arbitrary value, so the old
6666         usage could waste an arbitrary amount of memory.  All uses
6667         changed.
6668         * savedir.h: Update prototype.
6669
6670 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6671
6672         * xstrtol.c (strtoimax): New decl.
6673
6674 2001-08-28  Paul Eggert  <eggert@twinsun.com>
6675
6676         * xstrtol.h: Add copyright notice.
6677         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
6678         LONGINT_INVALID_SUFFIX_CHAR.
6679
6680 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6681
6682         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
6683         tm to be declared.
6684
6685 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6686
6687         * hash.c: Remove '2001' from copyright notice.
6688
6689 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6690
6691         * full-write.h: New file.
6692         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
6693         * full-write.c: Correct credits, as cccp.c no longer
6694         exists and anyway it was so heavily changed from the old cccp
6695         code as to be unrecognizable.  Include full-write.h.
6696         (full_write) Return size_t, with short writes meaning failure.
6697         All callers changed.  This fixes a bug with large buffers
6698         on 64-bit hosts.
6699         * utime.c: Include full-write.h.
6700
6701 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6702
6703         Merge 'exclude' changes from tar 1.13.22.
6704         This fixes one or two unlikely storage allocation overflow bugs,
6705         but doesn't change user-visible behavior otherwise.
6706
6707 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6708
6709         * exclude.c (bool): Declare, perhaps by including stdbool.h.
6710         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6711         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6712         Include if available.
6713         (<xalloc.h>): Include
6714         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6715         (verify): New macro.  Use it to verify that EXCLUDE macros do not
6716         collide with FNM macros.
6717         (struct patopts): New struct.
6718         (struct exclude): Use it, as exclude patterns now come with options.
6719         (new_exclude): Support above changes.
6720         (new_exclude, add_exclude_file):
6721         Initial size must now be a power of two to simplify overflow checking.
6722         (free_exclude, fnmatch_no_wildcards): New function.
6723         (excluded_filename): No longer requires options arg, as the options
6724         are determined by add_exclude.  Now returns bool, not int.
6725         (excluded_filename, add_exclude):
6726         Add support for the fancy new exclusion options.
6727         (add_exclude, add_exclude_file): Now takes int options arg.
6728         Check for arithmetic overflow when computing sizes.
6729         (add_exclude_file): xrealloc might modify errno, so don't
6730         realloc until after errno might be used.
6731
6732         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
6733         New macros.
6734         (free_exclude): New decl.
6735         (add_exclude, add_exclude_file): Now takes int options arg.
6736         (excluded_filename): No longer requires options arg, as the options
6737         are determined by add_exclude.  Now returns bool, not int.
6738
6739 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6740
6741         * alloca.c (alloca): Arg is of type size_t, not unsigned.
6742
6743 2001-08-27  Jim Meyering  <meyering@lucent.com>
6744
6745         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
6746
6747         * version-etc.c (N_): Remove definition.
6748         Revert most of last change.
6749         Instead, simply don't mark the `Copyright...' string for translation.
6750         Based on advice from Paul Eggert.
6751
6752         * strtoxmax.c: Tweak comment.
6753
6754 2001-08-26  Jim Meyering  <meyering@lucent.com>
6755
6756         * version-etc.c (version_etc_copyright_fmt): Replace literal year
6757         of copyright with `%s' so translators don't get an untranslated
6758         message in 2002.
6759         (COPYRIGHT_YEAR): Define.
6760         (version_etc): Use fprintf rather than fputs.
6761         Suggestion from Ulrich Drepper.
6762
6763         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
6764
6765         * strtoll.c: New file, from GNU libc.
6766         * xstrtoimax.c: New file.
6767
6768         * xstrtol.h: Add xstrtoimax.
6769         * strtoumax.c: New file.  Simply include "strtoumax.c".
6770         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
6771
6772         * strtoumax.c: Factor to work both for unsigned and signed types, ...
6773         * strtoxmax.c: ... then renamed to this.
6774
6775 2001-08-13  Paul Eggert  <eggert@twinsun.com>
6776
6777         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
6778         Port to Solaris 8, where 'sed' requires a space after the 'r'
6779         command, and where sh dislikes "$/".  Clean up the spacing a bit.
6780         Redirect output to $tmp just once.
6781
6782 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
6783
6784         * addext.c (<errno.h>): Include.
6785         (errno): Declare if not defined.
6786         (addext): Work correctly when pathconf returns -1 and leaves
6787         errno alone because there is no limit.  Also, work even if
6788         pathconf returns a value greater than SIZE_MAX.
6789
6790 2001-08-12  Jim Meyering  <meyering@lucent.com>
6791
6792         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
6793         Simply `return getcwd (NULL, 0);'.
6794         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
6795         Use 1300 as initial value for length, not PATH_MAX.
6796
6797         * pathmax.h: Clean up cpp syntax.
6798
6799 2001-08-12  Jim Meyering  <meyering@lucent.com>
6800
6801         * gettimeofday.c: New file.
6802         * gtod.h: New file.
6803         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
6804
6805 2001-08-04  Jim Meyering  <meyering@lucent.com>
6806
6807         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
6808         to get in sync with glibc.
6809
6810 2001-08-03  Paul Eggert  <eggert@twinsun.com>
6811
6812         The following changes are from gettext 0.10.39 as maintained by
6813         Bruno Haible.
6814
6815         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
6816         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
6817         with inverted sense.  All uses changed.
6818
6819         * mbswidth.c: Don't include <limits.h>.
6820         Include <stdlib.h> and <string.h> unconditionally.
6821         (iswcntrl, mbsinit, ISCNTRL): New macros.
6822         (mbsnwidth): Use K&R style function declarations.
6823         Don't bother checking for MB_LEN_MAX == 1, since the compiler
6824         can optimize it when MB_CUR_MAX == 1.
6825         The width of control characters is zero, not 1.
6826
6827 2001-07-15  Jim Meyering  <meyering@lucent.com>
6828
6829         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
6830         (BUILT_SOURCES): Add unlocked-io.h.
6831         (io_functions): Define.
6832         (unlocked-io.h): New rule.
6833         (DISTCLEANFILES): Add unlocked-io.h.
6834         (all-local): Depend on unlocked-io.h, to ensure it is created.
6835
6836         * unlocked-io.hin: New file
6837
6838         * regex.c: Update from glibc.
6839
6840 2001-07-05  Jim Meyering  <meyering@lucent.com>
6841
6842         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
6843         recommendation.
6844         (libfetish_a_SOURCES): Put all .h files here instead.
6845         Remove a thus-exposed (better checks in automake) duplicate and
6846         two unnecessary .h files.
6847
6848 2001-06-11  Jim Meyering  <meyering@lucent.com>
6849
6850         * regex.c: Update from GNU libc.
6851
6852 2001-05-27  Jim Meyering  <meyering@lucent.com>
6853
6854         * readutmp.h (UT_TYPE): Define.
6855
6856 2001-05-24  Jim Meyering  <meyering@lucent.com>
6857
6858         * argmatch.c: Include "quote.h".
6859         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
6860         quote function.  Reported by Göran Uddeborg.
6861
6862 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
6863
6864         * dirname.c (dir_name): Compute append_dot using path, not newpath
6865         which is not yet declared.
6866
6867 2001-05-11  Paul Eggert  <eggert@twinsun.com>
6868
6869         * Makefile.am (libfetish_a_SOURCES):
6870         Add strftime.c, since we now compile it on all hosts.
6871
6872         * strftime.c (my_strftime):
6873         Define to nstrftime if emacs, but only if my_strftime is not defined.
6874         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
6875         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
6876         Add one more extra argument: a nanoseconds value.
6877         All uses changed.
6878         (ns): New macro.
6879         (my_strftime function): Add %N format.
6880         (emacs_strftimeu): Renamed from emacs_strftime,
6881         with extra ut argument.
6882
6883 2001-05-11  Paul Eggert  <eggert@twinsun.com>
6884
6885         dirname code cleanup.  base_name now behaves more compatibly
6886         with POSIX basename when given file names that have trailing
6887         slashes, and similarly for dir_name.  Add new primitives
6888         base_len and dir_len.  Put the directory-name-related decls
6889         into dirname.h.
6890
6891         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
6892         * backupfile.c (base_name): Likewise.
6893         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
6894         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
6895         * makepath.c (strip_trailing_slashes): Likewise.
6896         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
6897         Likewise.
6898         * rename.c (strip_trailing_slashes): Likewise.
6899         * same.c (base_name): Likewise.
6900         * stripslash.c (ISSLASH): Likewise.
6901
6902         * addext.c: Include <dirname.h> after size_t is defined.
6903         * backupfile.c: Likewise.
6904
6905         * addext.c (addext): Use base_len to trim redundant
6906         trailing slashes instead of doing it ourselves.
6907         But do not trim the last slash if it is not redundant.
6908
6909         * backupfile.c (find_backup_file_name,
6910         max_backup_version): Use base_len instead of rolling it ourselves.
6911         Handle the case of "" and (on DOS) "C:" correctly.
6912
6913         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
6914         Include <string.h>, <dirname.h>.
6915         (base_name): Allow file names ending in slashes, other than names
6916         that are all slashes.  In this case, return the basename followed
6917         by the slashes.  This is more general, and can be used in places
6918         where the original base_name purposely had an assertion failure.
6919         (base_len): New function.
6920
6921         * dirname.c: Include <string.h> instead of <stdlib.h>.
6922         Do not include <assert.h>; no longer needed.
6923         Include xalloc.h.
6924         (memrchr): Remove decl.
6925         (dir_name_r): Remove.
6926         (dir_len): Renamed from dirlen.  All callers changed.
6927         Rewrite in terms of base_name, for simplicity and consistency.
6928         (dir_name): Never return NULL.  All callers changed.
6929         Do not include <stdlib.h> in test program; no longer needed.
6930         return 0; is fine for test program.
6931
6932         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
6933         New macros.
6934         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
6935
6936         * path-concat.c (path_concat): Use base_len to compute
6937         base length, not strlen; this means we cannot rely on memcpy
6938         to null-terminate.
6939
6940         * same.c (STREQ): Remove.
6941         (same_name): Handle the case where the basename ends in trailing '/'.
6942
6943         * stripslash.c (strip_trailing_slashes): Return nonzero if
6944         a slash was stripped.  Do not strip the last slash after a
6945         file system prefix.
6946
6947 2001-04-08  Jim Meyering  <meyering@lucent.com>
6948
6949         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
6950         recomputed; that's necessary when the offset spans a DST transition.
6951         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
6952
6953 2001-04-02  Jim Meyering  <meyering@lucent.com>
6954
6955         * regex.h, regex.c: Update from GNU libc.
6956
6957 2001-03-19  Paul Eggert  <eggert@twinsun.com>
6958
6959         * version-etc.c (version_etc_copyright): Update to 2001.
6960
6961 2001-03-16  Paul Eggert  <eggert@twinsun.com>
6962
6963         * tempname.c (uint64_t): Define to uintmax_t if
6964         not defined, and if UINT64_MAX is not defined.
6965         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
6966         Reported by John David Anglin.
6967
6968 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
6969
6970         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
6971         alias if codeset is empty.
6972         * config.charset (BeOS): Use wildcard syntax.
6973
6974 2001-03-13  Jim Meyering  <meyering@lucent.com>
6975
6976         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
6977         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
6978         From Bruno Haible.
6979
6980 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
6981
6982         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
6983         Don't return NULL.
6984         * unicodeio.c (print_unicode_char): Simplify accordingly.
6985
6986 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
6987
6988         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
6989         support for DOS/DJGPP.
6990
6991 2001-02-28  Paul Eggert  <eggert@twinsun.com>
6992
6993         * Makefile.am (libfetish_a_SOURCES):
6994         Add dup-safer.c, fopen-safer.c.
6995         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
6996
6997         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
6998
6999 2001-02-25  Paul Eggert  <eggert@twinsun.com>
7000
7001         The mkstemp replacement is taken from glibc 2.2.2, with some
7002         portability fixes for use outside glibc, as follows:
7003
7004         * tempname.c (struct_stat64): New macro.
7005         (direxists, __gen_tempname): Use it.
7006         This avoids a portability problem with Solaris 8.
7007
7008         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7009         (<stddef.h>, <stdint.h>, <string.h>):
7010         Include only if STDC_HEADERS || _LIBC.
7011         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7012         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7013         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7014         (__set_errno): Define this macro if <errno.h> doesn't.
7015         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7016         Define these macros if <stdio.h> doesn't.
7017         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7018         Define these macros if <sys/stat.h>
7019         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7020         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7021         __xstat64): Define if not _LIBC.
7022         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7023         (__gen_tempname): Invoke gettimeofday only if
7024         HAVE_GETTIMEOFDAY || _LIBC;
7025         otherwise, fall back on plain "time".
7026         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7027
7028         * mkstemp.c (__GT_FILE): Define to zero if not defined.
7029
7030         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7031
7032 2001-02-17  Jim Meyering  <meyering@lucent.com>
7033
7034         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
7035         around included file name.
7036
7037         * strnlen.c (__strnlen): Merge in a change from GNU libc.
7038
7039         * strftime.c: Update from GNU libc (the only changes were to comments).
7040
7041 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
7042
7043         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7044
7045 2001-02-17  Paul Eggert  <eggert@twinsun.com>
7046
7047         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7048         Remove workaround macros for hosts that have mbrtowc but not
7049         mbstate_t, as we now insist on proper declarations for both
7050         before using mbrtowc.
7051
7052 2001-02-17  Jim Meyering  <meyering@lucent.com>
7053
7054         * regex.c: Update from libc.
7055
7056 2001-02-16  Paul Eggert  <eggert@twinsun.com>
7057
7058         * alloca.c (malloc): Undef before defining, since stdlib.h
7059         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
7060         Reported by Mark Hounschell via Paul Eggert.
7061
7062 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
7063
7064         * config.charset: Update for FreeBSD 4.2.
7065
7066 2001-01-26  Jim Meyering  <meyering@lucent.com>
7067
7068         * quotearg.c: Include stddef.h.
7069         * quote.c: Include stddef.h.
7070         Reported by Axel Kittenberger.
7071
7072         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7073         line in double quotes so that it evokes a better diagnostic.
7074         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7075         Reported by Axel Kittenberger.
7076
7077 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
7078
7079         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7080         to avoid a warning.  Add back 'const' to inptr.
7081
7082 2001-01-16  Jim Meyering  <meyering@lucent.com>
7083
7084         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7085         From Bruno Haible.
7086
7087 2001-01-14  Jim Meyering  <meyering@lucent.com>
7088
7089         * rename.c: New file.  From Volker Borchert.
7090         Include stdlib.h, string.h or strings.h, and xalloc.h.
7091         Use strip_trailing_slashes rather than open-coding it.
7092
7093 2001-01-03  Paul Eggert  <eggert@twinsun.com>
7094
7095         * strftime.c: Sync with glibc time/strftime.c 1.81.
7096
7097 2001-01-03  Jim Meyering  <meyering@lucent.com>
7098
7099         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7100         local `inptr' to avoid warning with some system declarations of iconv.
7101
7102 2000-12-29  Paul Eggert  <eggert@twinsun.com>
7103
7104         * modechange.c: Do not assume that mode_t uses the
7105         traditional octal encoding.  E.g. "chmod 1 FOO" should set
7106         the other-execute bit of FOO even if S_IXOTH != 1.
7107
7108         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7109         WOTH, XOTH, ALLM): New macros.
7110         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7111          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7112         Use them.
7113         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7114         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7115         (mode_compile):
7116         No need to use uintmax_t; unsigned long is long enough.
7117         Don't bother to get suffix since we don't use it.
7118
7119 2000-12-24  Jim Meyering  <meyering@lucent.com>
7120
7121         * hash.c (is_prime): Return explicit boolean values.
7122         (hash_get_first): Return NULL to appease Irix5.6's 89.
7123         Reported by Nelson Beebe.
7124
7125 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
7126
7127         * localcharset.c (locale_charset): Add support for Win32.
7128
7129 2000-12-18  Paul Eggert  <eggert@twinsun.com>
7130
7131         * physmem.h, physmem.c: New files.
7132
7133         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7134         (noinst_HEADERS): Add physmem.h.
7135
7136         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7137         't' for compatibility with Solaris 8 sort.
7138
7139 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
7140
7141         * config.charset: Add support for BeOS.
7142
7143 2000-12-16  Jim Meyering  <meyering@lucent.com>
7144
7145         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7146         SHELLS_FILE to a file name that's useful on djgpp systems.
7147         Include stdlib.h.
7148         (ADDITIONAL_DEFAULT_SHELLS): Define.
7149         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7150         Based mostly on a patch from Prashant TR.
7151
7152 2000-12-16  Jim Meyering  <meyering@lucent.com>
7153
7154         This bug had a serious impact on chown: `chown N:M FILE' (for integer
7155         N and M) would have treated it like `chown N:N FILE'.
7156
7157         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7158
7159 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
7160
7161         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7162         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7163         to the list of canonical encodings. Rename EUC-CN to GB2312.
7164
7165 2000-12-08  Andreas Schwab  <schwab@suse.de>
7166
7167         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7168         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7169
7170 2000-12-07  Jim Meyering  <meyering@lucent.com>
7171
7172         * stripslash.c (ISSLASH): Define.
7173         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7174         From Prashant TR.
7175
7176         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7177         (dir_name_r): Declare this function as static.
7178         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7179         manifest itself on a name containing a mix of slashes and
7180         backslashes.
7181         Make this function work with names starting with a DOS-style
7182         drive letter and colon prefix.
7183         (dir_name): Append `.' if necessary.
7184         Based mostly on patches from Prashant TR and Eli Zaretskii.
7185
7186         * dirname.h (dir_name_r): Remove prototype.
7187
7188 2000-12-05  Jim Meyering  <meyering@lucent.com>
7189
7190         * dirname.c (dir_name_r): Add `const' in a few local declarations.
7191
7192 2000-12-04  Jim Meyering  <meyering@lucent.com>
7193
7194         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7195         Also include memory.h, stdlib.h, unistd.h if appropriate.
7196         Reported by Andreas Jaeger (conflicting declaration of malloc).
7197
7198 2000-12-02  Jim Meyering  <meyering@lucent.com>
7199
7200         * closeout.h: Make idempotent, to avoid some obscure warnings.
7201
7202 2000-12-01  Paul Eggert  <eggert@twinsun.com>
7203
7204         * memrchr.c: Include <config.h> before any system include file.
7205
7206 2000-11-29  Paul Eggert  <eggert@twinsun.com>
7207
7208         * dirname.c (dir_name_r): Fix typo: int -> size_t.
7209
7210 2000-11-26  Jim Meyering  <meyering@lucent.com>
7211
7212         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
7213
7214 2000-11-22  Paul Eggert  <eggert@twinsun.com>
7215
7216         * strftime.c (my_strftime): Do not invoke mbrlen with a
7217         size of (size_t) -1; it's not portable.
7218
7219 2000-11-17  Akim Demaille  <akim@epita.fr>
7220
7221         * obstack.h: Formatting changes.
7222         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7223         prevent type checking.
7224         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7225         cast the value to (void *): assigning a `foo *' to a `void *'
7226         variable is valid.
7227         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7228
7229 2000-11-17  Jim Meyering  <meyering@lucent.com>
7230
7231         * strstr.c: Update from GNU libc.
7232
7233 2000-11-16  Jim Meyering  <meyering@lucent.com>
7234
7235         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7236
7237 2000-11-11  Jim Meyering  <meyering@lucent.com>
7238
7239         * error.c: Add a couple #includes, merging from GNU libc version.
7240
7241 2000-11-10  Jim Meyering  <meyering@lucent.com>
7242
7243         * obstack.h: Update from GNU libc.
7244         * obstack.c: Likewise.
7245
7246 2000-11-06  Paul Eggert  <eggert@twinsun.com>
7247
7248         * getusershell.c (setusershell): Use rewind rather than
7249         fseek/fseeko, to avoid configuration hassles with fseeko.
7250         Don't bother opening SHELLS_FILE if shellstream is NULL;
7251         it's not necessary.
7252
7253 2000-11-05  Jim Meyering  <meyering@lucent.com>
7254
7255         * makepath.h (make_dir): Declare.
7256         * makepath.c (make_dir): Remove `static' attribute.
7257         Tweak a comment.
7258
7259 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
7260
7261         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
7262         last one in a bucket, advance to the next bucket.
7263
7264 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
7265
7266         * fnmatch.c: Do not comment out all the code if we are using
7267         the GNU C library, because in some cases we are replacing buggy
7268         code in the GNU C library itself.
7269
7270 2000-10-30  Paul Eggert  <eggert@twinsun.com>
7271
7272         * error.h, getline.h, modechange.h:
7273         Remove "2000" from Copyright line, as the file hasn't been
7274         changed this year other than in the copyright notice.
7275
7276         * xalloc.h: Add "2000" to Copyright line, as this file
7277         was changed this year.
7278
7279 2000-10-30  Paul Eggert  <eggert@twinsun.com>
7280
7281         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7282         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7283         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7284
7285 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
7286
7287         * regex.h (__restrict_arr): Move definition out of #ifndef block.
7288         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7289         doesn't define __restrict_arr.
7290
7291 2000-10-29  Jim Meyering  <meyering@lucent.com>
7292
7293         * xstat.in: Fix grammar in comment.
7294
7295 2000-10-28  Jim Meyering  <meyering@lucent.com>
7296
7297         * memchr.c: Update from libc.
7298         Adjust for portability:
7299         [HAVE_STDLIB_H]: Include stdlib.h.
7300         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7301         Undef __memchr, too.
7302         [!weak_alias]: Define __memchr to memchr.
7303
7304         * regex.c: Update from libc.
7305         * regex.h: Likewise.
7306         * getopt1.c: Likewise.
7307         * memcmp.c: Likewise.
7308
7309         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7310         Avoid using fseek, when possible -- it's broken by design.
7311         Patch by Ulrich Drepper.
7312
7313 2000-10-26  Jim Meyering  <meyering@lucent.com>
7314
7315         * strftime.c: Update from libc.
7316
7317 2000-10-25  Jim Meyering  <meyering@lucent.com>
7318
7319         * obstack.c: Update from libc.
7320
7321 2000-10-23  Jim Meyering  <meyering@lucent.com>
7322
7323         * hard-locale.c (hard_locale): Revert last change -- it was simply
7324         wrong.  That set_locale call must not have any side effects.
7325         From Paul Eggert.
7326
7327 2000-10-22  Jim Meyering  <meyering@lucent.com>
7328
7329         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7330         [CYCLIC]: Remove now-unused definition.
7331
7332         * save-cwd.c (O_DIRECTORY): Define, if needed.
7333         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7334         Suggestion from Ulrich Drepper.
7335
7336 2000-10-21  Jim Meyering  <meyering@lucent.com>
7337
7338         * dirname.c (dir_name_r): New function, factored out of dir_name.
7339         (dir_name): Use dir_name_r.
7340         * dirname.h (dir_name_r): Declare it.
7341
7342 2000-10-21  Jim Meyering  <meyering@lucent.com>
7343
7344         * dirname.c (memrchr): Declare if necessary.
7345         (dir_name): Remove the restriction that there be no
7346         trailing slashes.  Now, this code skips past them, effectively
7347         ignoring them.
7348         [TEST_DIRNAME] (main): New unit tests.
7349
7350         * memrchr.c: New file from GNU libc.
7351         Undef __memrchr, too.
7352         [!weak_alias]: Define __memrchr to memrchr.
7353         Guard weak_alias use with `#ifdef weak_alias'.
7354
7355 2000-10-17  Jim Meyering  <meyering@lucent.com>
7356
7357         * quote.h (PARAMS): Define and use.
7358         Reported by Akim Demaille.
7359
7360         * getopt.c: Update from libc.
7361
7362 2000-10-16  Jim Meyering  <meyering@lucent.com>
7363
7364         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7365         From Jan Fedak.
7366
7367 2000-09-25  Jim Meyering  <meyering@lucent.com>
7368
7369         * md5.h (rol): Define (from GnuPG).
7370
7371         * sha.c: Give credit (GnuPG) where due.
7372         (M): Use rol rather than open-coding it.
7373         Add a FIXME comment.
7374
7375 2000-09-21  Jim Meyering  <meyering@lucent.com>
7376
7377         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7378         Reported by Michael Stone.
7379
7380 2000-09-20  Jim Meyering  <meyering@lucent.com>
7381
7382         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7383         (noinst_HEADERS): Add sha.h.
7384         Based on code from Scott G. Miller and from GnuPG.
7385
7386 2000-09-15  Jim Meyering  <meyering@lucent.com>
7387
7388         * regex.c: Update from libc.
7389
7390 2000-09-10  Jim Meyering  <meyering@lucent.com>
7391
7392         * getopt.c (_getopt_internal): Update from glibc.
7393
7394 2000-09-09  Jim Meyering  <meyering@lucent.com>
7395
7396         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7397         think it should be used as a general replacement for isascii.
7398         * fnmatch.c: Likewise.
7399         * mbswidth.c: Likewise
7400         * regex.c: Likewise.
7401
7402         Don't use atoi.
7403         * userspec.c: Include sys/param.h and limits.h.
7404         Include xstrtol.h.
7405         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7406         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7407         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7408         UID, GID.  Check range.
7409
7410 2000-09-06  Jim Meyering  <meyering@lucent.com>
7411
7412         * getopt.c (_getopt_internal): Update from glibc.
7413
7414 2000-08-30  Jim Meyering  <meyering@lucent.com>
7415
7416         * strftime.c: Merge in changes from GNU libc.
7417
7418 2000-08-26  Jim Meyering  <meyering@lucent.com>
7419
7420         * closeout.c: Include "__fpending.h".
7421         (close_stdout_status): Return right away if there's nothing to flush.
7422
7423         * Makefile.am (noinst_HEADERS): Add __fpending.h.
7424         * __fpending.c: New file.
7425         * __fpending.h: New file.
7426
7427 2000-08-07  Paul Eggert  <eggert@twinsun.com>
7428
7429         Standardize on "memory exhausted" instead of "Memory exhausted"
7430         or "virtual memory exhausted".
7431         * obstack.c (print_and_abort): Use "memory exhausted", not
7432         "virtual memory exhausted".
7433         * same.c (same_name): Invoke xalloc_die instead of printing
7434         our own message.
7435         * userspec.c (parse_user_spec): Likewise.
7436         * bumpalloc.h: comment fix
7437         * same.c, userspec.c: Include xalloc.h.
7438
7439         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7440         not char *const and pointing to a constant array.
7441         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7442         (xrealloc): Comment fix.
7443
7444         * userspec.c (parse_user_spec):
7445         Don't translate a message until just before returning,
7446         to avoid unnecessary translation.
7447
7448 2000-08-07  Jim Meyering  <meyering@lucent.com>
7449
7450         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7451         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7452         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7453         getgroups.c, gethostname.c, getopt.h, group-member.c,
7454         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7455         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7456         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7457         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7458         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7459         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7460         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7461         yesno.c: Back out Copyright date changes for each file with no change
7462         this year.  This eases coordination with other programs using the same
7463         source code modules.  From Paul Eggert.
7464
7465 2000-08-03  Greg McGary  <greg@mcgary.org>
7466
7467         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7468         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7469         (EXTEND_BUFFER): Use them.
7470
7471 2000-08-01  Jim Meyering  <meyering@lucent.com>
7472
7473         * dirname.c (ISSLASH): Define.
7474         (BACKSLASH_IS_PATH_SEPARATOR): Define.
7475         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7476         both `\' and `/' may be use as path separators.
7477         Based on a patch from Prashant TR.
7478
7479 2000-07-31  Paul Eggert  <eggert@twinsun.com>
7480
7481         * quotearg.c (quotearg_n_options): Don't make the initial
7482         slot vector a constant, since it might get modified.
7483
7484 2000-07-31  Jim Meyering  <meyering@lucent.com>
7485
7486         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7487         * obstack.c (print_and_abort): Likewise.
7488
7489 2000-07-30  Paul Eggert  <eggert@twinsun.com>
7490
7491         * quotearg.c (quotearg_n_options): Preallocate a slot 0
7492         buffer, so that the caller can always quote one small
7493         component of a "memory exhausted" message in slot 0.
7494         From a suggestion by Jim Meyering.
7495
7496 2000-07-30  Jim Meyering  <meyering@lucent.com>
7497
7498         * makepath.c (make_path): Quote the other instance, too.
7499
7500         * quotearg.c (N_STATIC_SLOTVECS): Define.
7501         (STATIC_BUF_SIZE): Define.
7502         (quotearg_n_options): Use only statically allocated storage when
7503         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7504         than STATIC_BUF_SIZE.
7505
7506 2000-07-29  Jim Meyering  <meyering@lucent.com>
7507
7508         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7509         * dirname.c (dir_name): Likewise.
7510
7511         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7512
7513         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7514         (dir_name): Assert that there are no trailing slashes.
7515
7516 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
7517
7518         * mbswidth.h (mbswidth): Add a flags argument.
7519         (mbswidth): New declaration.
7520         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7521         * mbswidth.c (mbswidth): Add a flags argument.
7522         (mbsnwidth): New function.
7523
7524 2000-07-24  Jim Meyering  <meyering@lucent.com>
7525
7526         * mbswidth.c: Remove useless #else.  From Bruno Haible.
7527
7528 2000-07-23  Paul Eggert  <eggert@twinsun.com>
7529
7530         * mbswidth.c (_XOPEN_SOURCE):
7531         Don't define; this causes problems on Solaris 7.
7532         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7533
7534 2000-07-23  Paul Eggert  <eggert@twinsun.com>
7535
7536         * quotearg.c:
7537         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7538         so that mbstate_t is always defined.
7539
7540         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7541         be 1 in at least one GCC installation, and this configuration
7542         error is likely to be common.  Ignoring MB_LEN_MAX hurts
7543         performance on hosts that have mbrtowc but have only unibyte
7544         locales, but I assume these hosts are rare.
7545
7546 2000-07-23  Paul Eggert  <eggert@twinsun.com>
7547
7548         * quotearg.c: Streamline by invoking multibyte code only if needed.
7549         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7550         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7551         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7552         invoke multibyte primitives.
7553
7554 2000-07-23  Jim Meyering  <meyering@lucent.com>
7555
7556         * basename.c (base_name): Add an assertion.
7557
7558 2000-07-15  Bruno Haible  <clisp.cons.org>
7559
7560         * quotearg.c: When the system forces us to redefine mbstate_t,
7561         shadow its mbsinit function.
7562
7563 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
7564
7565         * mbswidth.h: New file.
7566         * mbswidth.c: New file.
7567         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7568         (noinst_HEADERS): Add mbswidth.h.
7569
7570 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
7571
7572         * config.charset: Add support for FreeBSD. Improve support for HP-UX
7573         and IRIX 6.
7574
7575 2000-07-15  Jim Meyering  <meyering@lucent.com>
7576
7577         * makepath.c: Include quote.h.
7578         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7579         corresponding argument in a `quote (...)' call.
7580         Give better diagnostics.
7581
7582         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7583         (noinst_HEADERS): Add quote.h.
7584
7585         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
7586         from tar's src/misc.c.
7587         * quote.h: New file.  Prototypes for same.
7588
7589 2000-07-10  Paul Eggert  <eggert@twinsun.com>
7590
7591         From a suggestion by Bruno Haible.
7592         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7593         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7594         to decide whether to define the BeOS workaround macro;
7595         this adjusts to the change to AC_MBSTATE_T.
7596
7597 2000-07-13  Paul Eggert  <eggert@twinsun.com>
7598
7599         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
7600
7601         * quotearg.c (quoting_style_args, quoting_style_vals,
7602         quotearg_buffer_restyled): Add support for
7603         clocale_quoting_style.  Undo previous change to
7604         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
7605         and "{RIGHT QUOTATION MARK}" msgids.
7606
7607 2000-07-05  Paul Eggert  <eggert@twinsun.com>
7608
7609         The old behavior of quoting `like this' doesn't look good with
7610         newer, ISO-style fonts.  See:
7611         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
7612
7613         Instead, quote "like this" by default.  Let the translator
7614         tailor the locale-specific quoting behavior by providing
7615         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
7616
7617         * quotearg.c (N_): New macro.
7618         (gettext_default): New function.
7619         (quotearg_buffer_restyled): Use
7620         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
7621         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
7622
7623 2000-07-09  Jim Meyering  <meyering@lucent.com>
7624
7625         * Most files: Update copyright dates to include 2000.
7626
7627 2000-07-08  Jim Meyering  <meyering@lucent.com>
7628
7629         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
7630         if not defined.
7631         (xgethostname): Remove now-unnecessary #ifdef.
7632         Move declaration of `err' into loop where it's used.
7633
7634 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
7635
7636         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
7637         by allocating a larger buffer. Test the gethostname return value for
7638         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
7639         returns an error and ENAMETOOLONG isn't defined.
7640
7641 2000-07-05  Paul Eggert  <eggert@twinsun.com>
7642         and Bruno Haible  <haible@clisp.cons.org>
7643
7644         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7645
7646 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
7647
7648         * quotearg.c (struct quoting_options): Simplify quote_these_too
7649         dimension.
7650
7651 2000-07-03  Jim Meyering  <meyering@lucent.com>
7652
7653         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
7654         Reported by Bruno Haible.
7655
7656 2000-07-04  Jim Meyering  <meyering@lucent.com>
7657
7658         * quotearg.c: Make inclusion of <wchar.h> independent of whether
7659         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
7660         lacks mbrtowc.
7661
7662 2000-07-03  Paul Eggert  <eggert@twinsun.com>
7663         and Bruno Haible  <haible@clisp.cons.org>
7664
7665         * quotearg.c (mbrtowc):
7666         Assign to *pwc, and return 1 only if result is nonzero.
7667         (iswprint): Use ISPRINT when substituting our own mbrtowc.
7668
7669 2000-07-03  Jim Meyering  <meyering@lucent.com>
7670
7671         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
7672         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
7673         From Bob Proulx.
7674
7675 2000-07-02  Jim Meyering  <meyering@lucent.com>
7676
7677         * quotearg.c (mbstate_t): Don't define here.
7678
7679 2000-07-02  Jim Meyering  <meyering@lucent.com>
7680
7681         * nanosleep.c (SIGCONT): Define if not already defined.
7682
7683 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
7684
7685         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
7686         per change in ../m4/ls-mntd-fs.m4.
7687         (read_filesystem_list): Ignore symbolic links.
7688
7689 2000-06-29  Jim Meyering  <meyering@lucent.com>
7690
7691         * same.c: Include <string.h> or <strings.h>, as appropriate,
7692         for declaration of strcmp.
7693
7694         * long-options.c: Include <stdlib.h>, for declaration of exit.
7695
7696         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
7697         Avoid warning by casting result to `char *' to remove `const'.
7698
7699 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
7700
7701         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
7702
7703 2000-06-26  Paul Eggert  <eggert@twinsun.com>
7704
7705         savedir now sets errno on failure and invokes xmalloc to get memory.
7706         Fix a couple of other minor bugs while we're at it.
7707
7708         * savedir.c (<unistd.h>): Do not include; there's no need.
7709         (NAMLEN): Remove macro.
7710         (malloc, realloc): Remove decls.
7711         (stpcpy): Likewise.
7712         ("xalloc.h"): Include.
7713         (NAME_SIZE_DEFAULT): New macro.
7714         (savedir): Use xmalloc / xrealloc to allocate memory.
7715         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
7716         Skip "" directory entries.
7717         Use strlen to calculate directory entry length, since the old method
7718         is rarely used these days and isn't worth supporting.
7719         Don't use a pointer after freeing it.
7720         Check for integer overflow when calculating allocation size.
7721         Use memcpy to copy entries, instead of stpcpy.
7722         Set errno properly when returning NULL.
7723         Check for readdir error.
7724
7725 2000-06-26  Jim Meyering  <meyering@lucent.com>
7726
7727         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
7728
7729 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
7730
7731         * getusershell.c (xmalloc, xrealloc): Remove functions.
7732         Include xalloc.h.
7733         Don't include <stdlib.h>.  Don't declare malloc, realloc.
7734
7735 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
7736
7737         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
7738
7739 2000-06-24  Jim Meyering  <meyering@lucent.com>
7740
7741         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
7742
7743 2000-06-21  Jim Meyering  <meyering@lucent.com>
7744
7745         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
7746
7747 2000-06-19  Paul Eggert  <eggert@twinsun.com>
7748
7749         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
7750         (mbrtowc, mbstate_t): Define substitutes if
7751         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
7752         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
7753         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
7754
7755 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
7756
7757         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
7758         than 1024, return a memory chunk of least possible size, instead
7759         of size PATH_MAX + 2. In the loop, increment the size proportionally.
7760         Use free/xmalloc instead of xrealloc to avoid copying for very long
7761         paths.
7762
7763 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
7764
7765         * canon-host.c (canon_host): Use malloc and memcpy to copy an
7766         address, not strdup.  Include <stdlib.h> and don't declare free().
7767
7768 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
7769
7770         * path-concat.c (path_concat): Don't access dir[-1] if dir is
7771         the empty string.
7772
7773 2000-06-21  Jim Meyering  <meyering@lucent.com>
7774
7775         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
7776         (noinst_HEADERS): Add getstr.h.
7777
7778         * getline.c (getstr): Move into a separate file.
7779         * getstr.c (getstr): New file, extracted from getline.c, with
7780         the following changes: new parameter, delim2; both delim[12]
7781         parameters have type `int', not `char'.  The latter would lose
7782         with 8-bit delimiters.
7783         * getstr.h: New file.
7784
7785 2000-06-19  Jim Meyering  <meyering@lucent.com>
7786
7787         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
7788
7789 2000-06-18  Jim Meyering  <meyering@lucent.com>
7790
7791         * mkdir.c: Remove file, due mainly to copyright incompatibility.
7792         Besides, these days every porting target provides a mkdir function.
7793
7794         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
7795         (this snippet comes from src/system.h).
7796
7797 2000-06-15  Paul Eggert  <eggert@twinsun.com>
7798
7799         * human.c (adjust_value): New function.
7800         (human_readable_inexact): Apply rounding style even when
7801         printing approximate values.
7802
7803 2000-06-14  Paul Eggert  <eggert@twinsun.com>
7804
7805         * human.c (human_readable_inexact): Allow an input block
7806         size that is not a multiple of the output block size, and vice versa.
7807         Reported by Piergiorgio Sartor.
7808
7809 2000-06-14  Paul Eggert  <eggert@twinsun.com>
7810
7811         * getdate.y (get_date): Apply relative times after time
7812         zone indicator, not before.  Reported by Todd A. Jacobs.
7813
7814 2000-06-13  Jim Meyering  <meyering@lucent.com>
7815
7816         * Makefile.am (all-local): Depend on lstat.c and stat.c.
7817
7818         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
7819
7820 2000-06-12  Paul Eggert  <eggert@twinsun.com>
7821
7822         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
7823
7824 2000-06-04  Paul Eggert  <eggert@twinsun.com>
7825
7826         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
7827
7828 2000-06-04  Jim Meyering  <meyering@lucent.com>
7829
7830         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
7831         SunOS 4.1.4 for which gid_t is an unsigned type.
7832
7833 2000-06-03  Jim Meyering  <meyering@lucent.com>
7834
7835         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
7836
7837 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
7838
7839         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
7840         newer, don't install charset.alias.
7841         * config.charset: Change the Linux/glibc rules so they become empty
7842         on glibc-2.1 or newer.
7843
7844 2000-06-02  Jim Meyering  <meyering@lucent.com>
7845
7846         * mountlist.c: Back out last change.  Instead, do this...
7847         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
7848         member using the same `ignore'-testing code.
7849         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
7850         fs_type strings.
7851         From Mark D. Roth.
7852
7853 2000-05-29  Jim Meyering  <meyering@lucent.com>
7854
7855         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
7856         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
7857
7858 2000-05-22  Jim Meyering  <meyering@lucent.com>
7859
7860         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
7861
7862 2000-05-18  Jim Meyering  <meyering@lucent.com>
7863
7864         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
7865         back, too, since it may have been modified by allocate_entry.
7866         (hash_delete): Rewrite to use neither the assignment operator
7867         nor the comma operator in an if-expression.
7868
7869 2000-05-15  Paul Eggert  <eggert@twinsun.com>
7870
7871         * closeout.c:
7872         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
7873         Remove; no longer needed.
7874         "quotearg.h": Add include.
7875         (file_name): Do not bother to explicitly initialize to NULL; it's less
7876         efficient on some hosts.
7877         (close_stdout_status): Remove test as to whether stdout was already
7878         closed; it breaks for the case "echo x | sort >&-".
7879         Quote file name colons.
7880         Do not assume that _("write error") lacks format strings.
7881
7882 2000-05-15  Jim Meyering  <meyering@lucent.com>
7883
7884         * version-etc.c (version_etc_copyright): Update the copyright string
7885         used in all --version output.
7886
7887 2000-05-14  Jim Meyering  <meyering@lucent.com>
7888
7889         * closeout.c (close_stdout_set_file_name): New function.
7890         (close_stdout_status): Use new file-scoped global.
7891         Return right away if fstat says the stdout file descriptor is invalid.
7892         * closeout.h (close_stdout_set_file_name): Declare.
7893
7894 2000-05-10  Jim Meyering  <meyering@lucent.com>
7895
7896         * closeout.c [default_exit_status]: New file-scoped variable.
7897         (close_stdout_set_status): New function.
7898         * closeout.h (close_stdout_set_status): Declare.
7899
7900 2000-05-08  Jim Meyering  <meyering@lucent.com>
7901
7902         * long-options.c: Don't include closeout.h.
7903         (parse_long_options): Don't call close_stdout for --version.
7904
7905 2000-05-06  Jim Meyering  <meyering@lucent.com>
7906
7907         * strnlen.c: Undefine __strnlen and strnlen.
7908         [!weak_alias]: Define __strnlen to strnlen.
7909
7910         * atexit.c: New file, from libiberty.
7911
7912 2000-05-06  Jim Meyering  <meyering@lucent.com>
7913
7914         * closeout.c (close_stdout_status): Also check for errors on the
7915         stderr stream.
7916
7917 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
7918
7919         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
7920         instead of xmalloc, xrealloc, path_concat.
7921         (locale_charset): Treat empty environment variables as absent.
7922         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
7923
7924 2000-05-04  Jim Meyering  <meyering@lucent.com>
7925
7926         * getopt.c: Update from glibc.
7927         * obstack.c: Likewise.
7928         * obstack.h: Likewise.
7929         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
7930
7931         * regex.h: Likewise.
7932         * strndup.c: Likewise.
7933         * strnlen.c: New file, from glibc.
7934
7935 2000-05-01  Jim Meyering  <meyering@lucent.com>
7936
7937         * full-write.c (full_write): Remove `FIXME' part of comment.
7938
7939 2000-04-29  Jim Meyering  <meyering@lucent.com>
7940
7941         * path-concat.c: Declare strdup only if it's not defined.
7942         * canon-host.c: Likewise.
7943
7944 2000-04-28  Jim Meyering  <meyering@lucent.com>
7945
7946         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
7947         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
7948         included first, then limits.h is included by locale.h by libintl.h.
7949         From John David Anglin.
7950
7951 2000-04-25  Jim Meyering  <meyering@lucent.com>
7952
7953         * makepath.c (S_IRWXUGO): Define.
7954         (make_path): Always perform explicit chmod if MODE specifies any
7955         of the `special' permission bits.  Prompted by a bug report against
7956         install from Mate Wierdl and Joost van Baal.
7957
7958 2000-04-18  Jim Meyering  <meyering@lucent.com>
7959
7960         * README: New file.
7961
7962         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
7963         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
7964
7965 2000-04-17  Jim Meyering  <meyering@lucent.com>
7966
7967         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
7968         the definition of it to rpl_strftime also defined-away the system's
7969         declaration.
7970
7971 2000-04-15  Jim Meyering  <meyering@lucent.com>
7972
7973         Use `C' to denote so-called `contiguous' files, the same way
7974         that tar does.
7975         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
7976         (ftypelet): Use S_ISCTG.
7977         From Michael Deutschmann.
7978
7979 2000-04-14  Jim Meyering  <meyering@lucent.com>
7980
7981         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
7982
7983 2000-04-08  Jim Meyering  <meyering@lucent.com>
7984
7985         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
7986         names don't conflict.  Reported by Eli Zaretskii.
7987
7988 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
7989
7990         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
7991         bug.  Deal with the different error behavior of Irix iconv.
7992
7993 2000-04-07  Jim Meyering  <meyering@lucent.com>
7994
7995         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
7996         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
7997
7998 2000-04-05  Jim Meyering  <meyering@lucent.com>
7999
8000         Portability tweaks required for ultrix4.3.
8001         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8002         * readutmp.c: Include sys/types.h before sys/stat.h.
8003         * canon-host.c: Declare strdup.
8004         * path-concat.c: Likewise.
8005         From John David Anglin.
8006
8007 2000-04-04  Jim Meyering  <meyering@lucent.com>
8008
8009         Be more DOS 8.3-friendly.
8010         * ref-add.sin: Renamed from ref-add.sed.in.
8011         * ref-del.sin: Renamed from ref-del.sed.in.
8012         * Makefile.am: Reflect renaming.
8013         Reported by Eli Zaretskii.
8014
8015         Use a temporary file name that won't clash with `charset.alias'
8016         in the DOS 8.3 name space.
8017         * Makefile.am (charset_tmp): Define.
8018         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8019         (uninstall-local): Likewise.
8020         Reported by Eli Zaretskii.
8021
8022 2000-03-29  Paul Eggert  <eggert@twinsun.com>
8023
8024         * time/strftime.c (my_strftime): Make sure we call the system
8025         strftime, not ourselves, when invoking the underlying strftime.
8026
8027 2000-03-24  Jim Meyering  <meyering@lucent.com>
8028
8029         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8030         (charset_alias): Define.
8031         (install-exec-local): Factor out common code.
8032         (uninstall-local): Split lines longer than 80.
8033         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8034         (SUFFIXES): Define.
8035         (.sed.in.sed): New rule.  Don't redirect directly to $@.
8036         (CLEANFILES): Add ref-add.sed and ref-del.sed.
8037
8038 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
8039
8040         * config.charset: Output a line containing "Packages using this file".
8041         * ref-add.sed.in, ref-del.sed.in: New files.
8042         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8043         ref-del.sed): New rules.
8044
8045 2000-03-17  Jim Meyering  <meyering@lucent.com>
8046
8047         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8048         Otherwise, include <strings.h>
8049
8050 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
8051
8052         * unicodeio.c (utf8_wctomb): New function.
8053         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8054         format instead of in UCS-4 with platform dependent endianness.
8055
8056 2000-03-07  Paul Eggert  <eggert@twinsun.com>
8057
8058         * savedir.c (savedir): Work even if directory size is
8059         negative; this can happen with some screwy NFS configurations.
8060
8061 2000-03-06  Jim Meyering  <meyering@lucent.com>
8062
8063         * localcharset.c (get_charset_aliases): Don't try to free file_name
8064         if it's NULL (because we ran out of memory).  From Bruno Haible.
8065
8066 2000-03-05  Jim Meyering  <meyering@lucent.com>
8067
8068         * localcharset.c ("path-concat.h"): Include.
8069         (get_charset_aliases): Use path_concat instead of ANSI string
8070         concatenation.
8071
8072         * unicodeio.h (PARAMS): Define.
8073         Use it to guard prototype.
8074
8075 2000-03-04  Jim Meyering  <meyering@lucent.com>
8076
8077         * Makefile.am (install-exec-local): Create $(libdir) before installing
8078         into it.
8079         (uninstall-local): Uncomment this rule so `make distcheck' works
8080         once again.
8081
8082         * unicodeio.c (<errno.h>): Include it.
8083         (errno): Declare if not defined.
8084
8085         * localcharset.c: Add Bruno's comment justifying use of volatile.
8086
8087         * config.charset: New version, incorporating remarks from a linux
8088         i18n mailing list.  From Bruno Haible.
8089
8090 2000-03-02  Jim Meyering  <meyering@lucent.com>
8091
8092         * Makefile.am (EXTRA_DIST): Add config.charset.
8093
8094 2000-03-01  Jim Meyering  <meyering@lucent.com>
8095
8096         * localcharset.c: Guard some #includes with `#if HAVE_...'.
8097         * unicodeio.c: Likewise.
8098
8099 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
8100
8101         * config.charset: New file.
8102         * localcharset.c: New file.
8103         * unicodeio.h, unicodeio.c: New files.
8104         * Makefile.am (DEFS): Add -DLIBDIR=...
8105         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8106         (noinst_HEADERS): Add unicodeio.h.
8107         (all-local, install-exec-local, charset.alias): New targets.
8108
8109 2000-02-28  Paul Eggert  <eggert@twinsun.com>
8110
8111         * quotearg.c (ALERT_CHAR): New macro.
8112         (quotearg_buffer_restyled): Use it.
8113
8114 2000-02-27  Jim Meyering  <meyering@lucent.com>
8115
8116         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8117         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8118
8119         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8120         not `#if STDC_HEADERS'.
8121         Declare malloc if needed.
8122
8123         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8124         now that autoconf always defines the HAVE_DECL_ symbols.
8125         * human.c: Likewise.
8126         * same.c: Likewise.
8127         * strtoumax.c: Likewise.
8128
8129         * backupfile.c: Arrange for cpp to fail if the configure-time
8130         declaration check was not run.
8131         * hash.c: Likewise.
8132         * human.c: Likewise.
8133         * same.c: Likewise.
8134         * strtoumax.c: Likewise.
8135
8136         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8137         then first look up the entire `.'-containing string as a login name.
8138
8139 2000-02-18  Paul Eggert  <eggert@twinsun.com>
8140
8141         * getdate.y: Handle two-digit years with leading zeros correctly.
8142         (textint): New typedef.
8143         (parser_control): Member year changed from int to textint.
8144         All uses changed.
8145         (YYSTYPE): Removed; replaced by %union with int and textint members.
8146         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8147         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8148         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8149         (tSNUMBER, tUNUMBER): Now of type <textintval>.
8150         (date, number, to_year): Use width of number in digits, not its value,
8151         to determine whether it's a 2-digit year, or a 2-digit time.
8152         (yylex): Store number of digits of numeric tokens.
8153         Reported by John Kendall.
8154
8155         (parser_control): Changed from struct parser_control to typedef (for
8156         consistency).  All uses changed.
8157
8158         (tID): Removed; not used.
8159         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8160
8161 2000-02-14  Paul Eggert  <eggert@twinsun.com>
8162
8163         * getpagesize.h (getpagesize): Port to VMS for Alpha;
8164         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8165
8166 2000-02-12  Jim Meyering  <meyering@lucent.com>
8167
8168         * userspec.c (ISDIGIT): Define it.
8169         (isdigit): Remove definition.
8170         (is_number): Use ISDIGIT, not isdigit.
8171         <libintl.h>: Include.
8172         (_ and N_): Define.
8173         (parse_user_spec): Mark translatable strings.
8174
8175 2000-02-10  Jim Meyering  <meyering@lucent.com>
8176
8177         With these changes, nanosleep.[ch] are finally enough like the other
8178         lib/* replacement files to compile on a few more losing systems.
8179
8180         * nanosleep.h: Don't include config.h.
8181         Remove prototype from declaration of nanosleep.
8182         (PARAMS): Remove now-unneeded definition.
8183         * nanosleep.c: #undef nanosleep.
8184         (rpl_nanosleep): Rename from nanosleep.
8185
8186 2000-02-03  Jim Meyering  <meyering@lucent.com>
8187
8188         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8189         rather than with `#if HAVE_UTMPNAME'.
8190
8191 2000-02-01  Jim Meyering  <meyering@lucent.com>
8192
8193         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
8194
8195 2000-01-31  Jim Meyering  <meyering@lucent.com>
8196
8197         * nanosleep.h (nanosleep): Guard declaration with
8198         `#if ! HAVE_DECL_NANOSLEEP'.
8199         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8200         the declaration in that vendor's sys/timers.h.
8201         Reported by Christian Krackowizer.
8202
8203         * quotearg.c (ISASCII): Add #undef and move definition to follow
8204         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8205         (ISPRINT): Likewise.
8206         Reported by Tom Tromey.
8207
8208 2000-01-30  Jim Meyering  <meyering@lucent.com>
8209
8210         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8211         uses of ->ut_name.  The latter doesn't work with new Linux header files
8212         where only utmpx.ut_user is declared.
8213
8214         * readutmp.h (UT_USER): Define.
8215
8216 2000-01-23  Jim Meyering  <meyering@lucent.com>
8217
8218         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8219         obstack.c.
8220
8221 2000-01-22  Jim Meyering  <meyering@lucent.com>
8222
8223         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8224         [! HAVE_DECL_STRTOULL]: Declare strtoull.
8225         Required for some AIX systems.  Reported by Christian Krackowizer.
8226         [TESTING] (main): New function.
8227
8228         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
8229         * dirname.c (dir_name): Support for DOS-style file names with drive
8230         letters.
8231
8232         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8233
8234         * strverscmp.c (ISDIGIT): Define.
8235         (strverscmp): Use ISDIGIT, not isdigit.
8236
8237 2000-01-17  Paul Eggert  <eggert@twinsun.com>
8238
8239         * nanosleep.c (nanosleep):
8240         Don't use SA_INTERRUPT to decide whether to call sigaction, as
8241         POSIX.1 doesn't require SA_INTERRUPT and some systems
8242         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
8243         it's been part of POSIX.1 since day 1 (in 1988).
8244
8245 2000-01-17  Jim Meyering  <meyering@lucent.com>
8246
8247         * interlock: Remove unused file.  Reported by François Pinard.
8248
8249 2000-01-16  Paul Eggert  <eggert@twinsun.com>
8250
8251         * quotearg.c (quotearg_buffer_restyled): Do not quote
8252         alert, backslash, formfeed, and vertical tab unnecessarily in
8253         shell quoting style.
8254
8255
8256 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8257 Free Software Foundation, Inc.
8258 Copying and distribution of this file, with or without modification,
8259 are permitted provided the copyright notice and this notice are preserved.