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