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