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