6750a050b2b890135d6f8368319e080135e2027e
[pspp] / lib / ChangeLog
1 2006-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2
3         * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
4         and translate the two parts separately, instead of feeding
5         the whole string to gettext.  This allows to exclude
6         '\v' from the strings visible to the translator by writing doc
7         strings as N_("..") "\v" N_("..").  
8
9 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
10
11         * mktime.c (guess_time_tm): Fix bug where mktime
12         returned the maximum time_t value rather than (time_t) -1.
13         Problem originally reported by William Bardwell
14         <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
15
16         * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
17         Moved to here ...
18         * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
19         ... from here.
20
21 2006-09-06  Bruno Haible  <bruno@clisp.org>
22
23         * striconv.h: New file.
24         * striconv.c: New file, merging iconvme.c with GNU gettext's
25         iconvstring.c.
26         * xstriconv.h: New file.
27         * xstriconv.c: New file.
28
29 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
30
31         * argz_.h: Sync from Libtool.
32
33         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
34                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
35
36         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
37
38 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
39
40         * trim.h: New file.
41         * trim.c: New file.
42
43 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
44
45         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
46         Problem reported by Ralf Wildenhues in
47         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
48
49         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
50         HAVE_STRUCT_STATFS_F_FSTYPENAME.
51
52 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
53
54         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
55         or stdbool.h, because they might not exist while configuring.
56
57         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
58         Don't include unistd.h or limits.h; not needed, since chdir-long.h
59         does that for us.
60         (O_DIRECTORY): Remove.
61
62 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
63
64         Work around a bug in both the Linux and SunOS 64-bit kernels:
65         nanosleep mishandles sleeps for longer than 2**31 seconds.
66         Problem reported by Frank v Waveren in
67         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
68         * nanosleep.c (BILLION): New constant.
69         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
70         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
71
72 2006-08-30  Jim Meyering  <jim@meyering.net>
73
74         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
75         the parameter.
76
77 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
78
79         * isapipe.c, isapipe.h: New files.
80
81 2006-08-29  Eric Blake  <ebb9@byu.net>
82
83         * error.c (error_at_line, print_errno_message): Match libc, after
84         resolution of upstream bug 3044.
85
86 2006-08-29  Bruno Haible  <bruno@clisp.org>
87
88         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
89
90 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
91
92         Sync from Libtool:
93
94         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
95
96         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
97         sharing with gnulib.  Report by Eric Blake.
98
99 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
100
101         * fcntl_.h: New file.
102         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
103         the fcntl module.
104         * dirchownmod.c: Likewise.
105         * fts.c: Likewise.
106
107         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
108         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
109         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
110         just before including <inttypes.h>, to avoid circular inclusion.
111
112 2006-08-28  Bruno Haible  <bruno@clisp.org>
113
114         * inttypes_.h (SCNX*): Remove definitions.
115         Reported by Eric Blake.
116
117 2006-08-26  Bruno Haible  <bruno@clisp.org>
118
119         * vasnprintf.c (EOVERFLOW): Remove definition.
120         (VASNPRINTF): Return a string of length > INT_MAX without failing.
121         * vasprintf.c: Include errno.h, limits.h.
122         (EOVERFLOW): New fallback definition.
123         (vasprintf): Test here whether the string length is > INT_MAX.
124         * vsnprintf.c: Include errno.h, limits.h.
125         (EOVERFLOW): New fallback definition.
126         (vsnprintf): Fix bug when generated string was too long for the buffer.
127         Test here whether the string length is > INT_MAX.
128
129 2006-08-26  Bruno Haible  <bruno@clisp.org>
130             Simon Josefsson  <jas@extundo.com>
131
132         BeOS portability.
133         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
134
135 2006-08-28  Bruno Haible  <bruno@clisp.org>
136
137         * c-strstr.h: New file, from GNU gettext.
138         * c-strstr.c: New file, from GNU gettext.
139
140 2006-08-26  Bruno Haible  <bruno@clisp.org>
141
142         * inttypes_.h: New file.
143         * inttypes.h: Remove file.
144         * stdint_.h: Include <inttypes.h> through its absolute filename.
145
146         * imaxabs.c: New file.
147
148         * imaxdiv.c: New file.
149
150 2006-08-22  Bruno Haible  <bruno@clisp.org>
151
152         * readutmp.h: Skip most definitions if neither <utmp.h> nor
153         <utmpx.h> exists.
154
155 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
156
157         BeOS portability.
158         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
159         Problem reported by Bruno Haible.
160
161 2006-08-21  Bruno Haible  <bruno@clisp.org>
162
163         BeOS portability.
164         * mbchar.h: Include <wctype.h> only if it exists.
165
166 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
167
168         * cycle-check.h: Include <stdint.h> unconditionally, since we
169         now assume the stdint module.  Do not include inttypes.h.
170         * fsusage.h: Likewise.
171         * getndelim2.c: Likewise.
172         * human.h: Likewise.
173         * inttostr.h: Likewise.
174         * obstack.c: Likewise.
175         * regex_internal.h: Likewise.
176         * tempname.c: Likewise.
177         * utimecmp.c: Likewise.
178         * xstrtol.h: Likewise.
179
180         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
181
182         * strtoimax.c: Adjust to macro name changes in Autoconf,
183         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
184         * xtime.h: Likewise.
185
186 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
187
188         * fchmodat.c: New file, from coreutils.  This was inadvertently
189         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
190
191 2006-08-18  Bruno Haible  <bruno@clisp.org>
192
193         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
194         (ME_DUMMY): Treat "kernfs" as a dummy.
195         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
196
197 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
198
199         Update from coreutils.
200
201         * __fpending.h: Add copyright notice.
202         * fprintftime.h: Likewise.
203         * savedir.c: Use (C) in copyright notice.
204         * savedir.h: Likewise.
205
206         2006-08-15  Jim Meyering  <jim@meyering.net>
207
208         * at-func.c: New file, with the logic of all emulated at-functions.
209         * openat-priv.h: Include <errno.h> and define ENOSYS,
210         in support of the EXPECTED_ERRNO macro.
211         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
212         Instead, define the appropriate symbols and include "at-func.c".
213         * mkdirat.c (mkdirat): Likewise.
214         * fchmodat.c (fchmodat): Likewise.
215         (ENOSYS): Remove definition.
216         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
217         Don't include "unistd--.h" -- it wasn't ever used.
218
219         2006-01-17  Jim Meyering  <jim@meyering.net>
220
221         Rewrite fts.c not to change the current working directory,
222         by using openat, fstatat, fdopendir, etc..
223
224         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
225         (HAVE_OPENAT_SUPPORT): Define.
226         [_LIBC] (fchdir): Don't undef or define; no longer used.
227         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
228         Now, this `function' always succeeds, and consumes its file descriptor
229         parameter -- so callers must not close such FDs.  Update callers.
230         (diropen_fd, opendirat, cwd_advance_fd): New functions.
231         (diropen): Add parameter, SP.  Adjust all callers.
232         Implement using diropen_fd, rather than open.
233         (fts_open): Initialize new member, fts_cwd_fd.
234         Remove fts_rft-setting code.
235         (fts_close): Close fts_cwd_fd, if necessary.
236         (__opendir2): Define in terms of opendir or opendirat,
237         depending on whether the FST_NOCHDIR flag is set.
238         (fts_build): Since fts_safe_changedir consumes its FD, and since
239         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
240         and close the dup'd file descriptor upon failure.
241         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
242         (fts_safe_changedir): Tweak semantics to reflect that this function
243         now calls cwd_advance_fd and hence consumes its FD argument.
244         * fts_.h [struct FTS] (fts_cwd_fd): New member.
245         [struct FTS] (fts_rft): Remove now-unused member.
246         [struct FTS] (fts_cycle.state): Improve comment.
247
248         * openat.c (openat_needs_fchdir): New function.
249         * openat.h (openat_needs_fchdir): Declare it.
250
251 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
252
253         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
254         Problem and fix reported by Pádraig Brady in
255         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
256
257 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
258
259         * memcoll.c (memcoll): Optimize for the common case where the
260         arguments are bytewise equal.
261
262 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
263
264         Change copyright notice from LGPL 2 to GPL 2, since that's the
265         standard form used in the gnulib repository.
266         * lock.c: LGPL -> GPL.
267         * lock.h: Likewise.
268         * strnlen1.c: Likewise.
269         * strnlen1.h: Likewise.
270         * tls.c: Likewise.
271         * tls.h: Likewise.
272         * tmpdir.c: Likewise.
273
274         * TODO: Remove; this belongs only in coreutils.
275
276 2006-08-14  Eric Blake  <ebb9@byu.net>
277
278         Import the following change from libc:
279
280         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
281
282         Upstream bug 2997.
283         * misc/error.c: Add space between program name and message if file
284         name is missing.
285
286 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
287
288         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
289         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
290
291         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
292         in wchar_t.  Problem reported by Eric Blake.
293
294         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
295         LEN is smaller than SIZE.  Suggested by Bruno Haible.
296         Also, help the compiler to keep LEN in a register.
297
298 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
299
300         * .cppi-disable: Add snprintf.h, socket_.h.
301         * snprintf.c: Include <errno.h> and <limits.h>.
302         (EOVERFLOW): Define if the system does not.
303         Do not include "minmax.h"; it wasn't used.
304         (snprintf): Don't assume size_t promotes to an unsigned type.
305         Fix bug when generated string was too long for the buffer: the
306         buffer's contents are supposed to be the initial prefix of the
307         output.  Don't assume vasnprintf returns EOVERFLOW if the size
308         exceeds INT_MAX; do the check ourselves.
309
310         Import the following changes from libc:
311
312         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
313
314         * posix/regex_internal.c (re_string_skip_chars): If no character has
315         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
316         to the byte which couldn't be converted.
317         (re_string_reconstruct): Don't clear valid_raw_len before calling
318         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
319         tip_context using re_string_context_at.
320
321         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
322
323         * posix/regex.h: g++ still cannot handled [restrict].
324
325         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
326
327         * posix/regex.h: Remove special handling for VMS.
328
329 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
330
331         Sync from coreutils.
332
333         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
334
335         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
336         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
337
338 2006-08-08  Eric Blake  <ebb9@byu.net>
339
340         * verror.c (verror_at_line): Work around glibc bug 2997, so that
341         verror_at_line output complies with GNU Coding Standards even when
342         file is NULL.
343
344 2006-08-08  Eric Blake  <ebb9@byu.net>
345
346         * verror.h, verror.c: New files.
347
348 2006-08-07  Bruno Haible  <bruno@clisp.org>
349
350         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
351         versions of AIX.
352         Reported by Ralf Wildenhues.
353
354 2006-08-06  Eric Blake  <ebb9@byu.net>
355
356         * error.h: Fold in some upstream changes from glibc.
357         * error.c: Likewise.
358
359 2006-07-29  Bruno Haible  <bruno@clisp.org>
360
361         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
362
363 2006-07-29  Bruno Haible  <bruno@clisp.org>
364
365         * setenv.c: Undo unintended modification done on 2006-02-27.
366
367 2006-07-28  Eric Blake  <ebb9@byu.net>
368
369         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
370         macro expansion.
371
372 2006-07-28  Simon Josefsson  <jas@extundo.com>
373
374         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
375         #include's.
376
377 2006-07-28  Simon Josefsson  <jas@extundo.com>
378
379         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
380         #include's.
381
382 2006-07-28  Bruno Haible <bruno@clisp.org>
383
384         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
385
386 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
387
388         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
389         arpa/inet.h.
390
391 2006-07-28  Bruno Haible  <bruno@clisp.org>
392
393         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
394         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
395         fallbacks.
396         Avoids link error on FreeBSD 4.x.
397         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
398
399         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
400         encoding.
401         * mbswidth.c (iswcntrl): Likewise.
402
403 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
404
405         * modechange.c (mode_compile): Numeric modes now affect setuid and
406         setgid on directories only if they set these bits.
407         * modechange.h: Remove obsolete comment about masks.
408
409 2006-07-27  Bruno Haible  <bruno@clisp.org>
410
411         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
412         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
413         defined.
414
415 2006-07-26  Eric Blake  <ebb9@byu.net>
416
417         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
418         like mingw that lack mkstemp.
419         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
420         avoid compilation warning on mingw.
421
422 2006-07-25  Bruno Haible  <bruno@clisp.org>
423
424         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
425         <stdarg.h> or config.h.
426
427 2006-07-24  Bruno Haible  <bruno@clisp.org>
428
429         * clean-temp.h: New file, from GNU gettext.
430         * clean-temp.c: New file, from GNU gettext.
431
432 2006-07-24  Bruno Haible  <bruno@clisp.org>
433
434         * tmpdir.h: New file, from GNU gettext.
435         * tmpdir.c: New file, from GNU gettext.
436
437 2006-07-23  Bruno Haible  <bruno@clisp.org>
438
439         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
440         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
441         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
442         gl_linked_remove_at): Use it.
443
444 2006-07-23  Eric Blake  <ebb9@byu.net>
445
446         * tmpfile-safer.c: New file.
447         * stdio-safer.h (fopen_safer): Add prototype.
448         * stdio--.h (tmpfile): Make safer.
449
450 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
451
452         * close-stream.c, close-stream.h: New files.
453
454 2006-07-22  Bruno Haible  <bruno@clisp.org>
455
456         Merge from GNU gettext 0.15.
457
458         2005-07-05  Bruno Haible  <bruno@clisp.org>
459
460                 * printf-args.c (printf_fetchargs): Work around broken
461                 definition of wint_t on mingw.
462
463         2005-02-12  Bruno Haible  <bruno@clisp.org>
464
465                 * xallocsa.h: Add extern "C" for C++.
466
467         2006-05-17  Bruno Haible  <bruno@clisp.org>
468
469                 Cygwin portability.
470                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
471
472         2006-04-30  Bruno Haible  <bruno@clisp.org>
473
474                 * progreloc.c: Include <mach-o/dyld.h> if available.
475                 (find_executable): Use _NSGetExecutablePath when possible.
476
477         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
478
479                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
480                 function.
481
482         2005-12-29  Bruno Haible  <bruno@clisp.org>
483
484                 * progreloc.c (set_program_name_and_installdir): Fix
485                 compilation error.
486
487         2005-12-04  Bruno Haible  <bruno@clisp.org>
488
489                 Cygwin portability.
490                 * progreloc.c: Include <windows.h> also on Cygwin.
491                 (find_executable): Add support for Cygwin.
492                 (set_program_name_and_installdir): Handle also platforms with
493                 nonempty EXEEXT.
494
495         2006-07-11  Bruno Haible  <bruno@clisp.org>
496
497                 * javacomp.c: Fix a comment.
498                 Reported by Jim Meyering.
499
500         2006-04-30  Bruno Haible  <bruno@clisp.org>
501
502                 * javacomp.h (compile_java_class): Add source_version,
503                 target_version arguments.
504                 * javacomp.c: Rewritten to choose only a compiler that
505                 respects the specified source_version and target_version.
506
507         2006-06-27  Bruno Haible  <bruno@clisp.org>
508
509                 Assume correct S_ISDIR macro.
510                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
511
512         2006-07-22  Bruno Haible  <bruno@clisp.org>
513
514                 * javaversion.h: New file, from GNU gettext.
515                 * javaversion.c: New file, from GNU gettext.
516                 * javaversion.java: New file, from GNU gettext.
517                 * javaversion.class: New file, from GNU gettext.
518
519         2006-05-17  Bruno Haible  <bruno@clisp.org>
520
521                 Cygwin portability.
522                 * javaexec.c (execute_java_class): Test for jview program
523                 also on Cygwin.
524
525         2006-04-09  Bruno Haible  <bruno@clisp.org>
526
527                 * fatal-signal.c: Don't include string.h.
528                 (at_fatal_signal): Use a copying loop instead of memcpy.
529
530         2005-12-04  Bruno Haible  <bruno@clisp.org>
531
532                 * csharpexec.c: Add support for 'clix' launcher (untested).
533                 (execute_csharp_using_sscli): New function.
534                 (execute_csharp_program): Call it.
535
536         2006-06-21  Bruno Haible  <bruno@clisp.org>
537
538                 Avoid warnings from recent versions of mcs.
539                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
540                 -o, -L, -r any more. Use options documented since mcs-1.0
541                 instead. Similarly for -g.
542
543         2005-07-09  Bruno Haible  <bruno@clisp.org>
544
545                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
546                 add a .dll suffix.
547                 Reported by Mark Junker <mjscod@gmx.de>.
548
549         2006-06-17  Bruno Haible  <bruno@clisp.org>
550
551                 * config.charset: Update for NetBSD 3.0.
552
553         2006-05-17  Bruno Haible  <bruno@clisp.org>
554
555                 Cygwin portability.
556                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
557
558         2006-05-16  Bruno Haible  <bruno@clisp.org>
559
560                 * localcharset.c [CYGWIN]: Include <windows.h>.
561                 (get_charset_aliases): For Cygwin, return the same CPxxx
562                 aliases list as under WIN32.
563                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
564                 the environment variables. Fall back to GetACP().
565
566         2006-04-05  Bruno Haible  <bruno@clisp.org>
567
568                 * config.charset: Update Juan Manuel Guerrero's address.
569
570         2005-02-12  Bruno Haible  <bruno@clisp.org>
571
572                 * allocsa.h: Add extern "C" for C++.
573
574         2005-02-10  Bruno Haible  <bruno@clisp.org>
575
576                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
577                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
578
579         2006-07-22  Bruno Haible  <bruno@clisp.org>
580
581                 * gettext.h: Update to GNU gettext-0.15.
582
583 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
584         and Simon Josefsson <jas@extundo.com>
585
586         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
587
588         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
589
590 2006-07-21  Eric Blake  <ebb9@byu.net>
591
592         * stdlib-safer.h: New file from coreutils, required by
593         stdlib--.h.
594
595 2006-07-19  Derek R. Price  <derek@ximbiot.com>
596
597         * getaddrinfo.h: Don't define unimplemented AI_* flags.
598         Reindent and repaginate.
599
600 2006-07-17  Bruno Haible  <bruno@clisp.org>
601
602         * gl_list.h: New file.
603         * gl_list.c: New file.
604         * gl_array_list.h: New file.
605         * gl_array_list.c: New file.
606         * gl_carray_list.h: New file.
607         * gl_carray_list.c: New file.
608         * gl_linked_list.h: New file.
609         * gl_linked_list.c: New file.
610         * gl_anylinked_list1.h: New file.
611         * gl_anylinked_list2.h: New file.
612         * gl_avltree_list.h: New file.
613         * gl_avltree_list.c: New file.
614         * gl_anyavltree_list1.h: New file.
615         * gl_anyavltree_list2.h: New file.
616         * gl_rbtree_list.h: New file.
617         * gl_rbtree_list.c: New file.
618         * gl_anyrbtree_list1.h: New file.
619         * gl_anyrbtree_list2.h: New file.
620         * gl_anytree_list1.h: New file.
621         * gl_anytree_list2.h: New file.
622         * gl_linkedhash_list.h: New file.
623         * gl_linkedhash_list.c: New file.
624         * gl_anyhash_list1.h: New file.
625         * gl_anyhash_list2.h: New file.
626         * gl_avltreehash_list.h: New file.
627         * gl_avltreehash_list.c: New file.
628         * gl_rbtreehash_list.h: New file.
629         * gl_rbtreehash_list.c: New file.
630         * gl_anytreehash_list1.h: New file.
631         * gl_anytreehash_list2.h: New file.
632
633         * gl_oset.h: New file.
634         * gl_oset.c: New file.
635         * gl_array_oset.h: New file.
636         * gl_array_oset.c: New file.
637         * gl_avltree_oset.h: New file.
638         * gl_avltree_oset.c: New file.
639         * gl_rbtree_oset.h: New file.
640         * gl_rbtree_oset.c: New file.
641         * gl_anytree_oset.h: New file.
642
643 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
644
645         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
646         New files.
647         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
648         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
649         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
650         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
651         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
652         callers changed.  Revamp internals significantly, by not
653         attempting to create directories that are temporarily more
654         permissive than the final results.  Do not attempt to use
655         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
656         This removes some race conditions, fixes some bugs, and simplifies
657         things.  Use new dirchownmod function to do owner and mode changes.
658         * mkdir-p.h: Likewise.
659         * modechange.c (octal_to_mode): New function.
660         (struct mode_change): New member mentioned.
661         (make_node_op_equals): New arg mentioned.  All callers changed.
662         (mode_compile): Keep track of which mode bits the user has explicitly
663         mentioned.
664         (mode_adjust): New arg DIR, so that we implement the X op correctly.
665         New arg PMODE_BITS, to keep track of which mode bits the user
666         mentioned; it treats S_ISUID and S_ISGID speciall.
667         All callers changed.
668         * modechange.h: Likewise.
669
670 2006-07-11  Derek R. Price  <derek@ximbiot.com>
671
672         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
673
674 2006-07-10  Derek R. Price  <derek@ximbiot.com>
675
676         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
677         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
678         macros into the GNU _D_EXACT_NAMLEN.
679         * savedir.c:  Likewise.
680         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
681
682 2006-07-09  Jim Meyering  <jim@meyering.net>
683
684         * argp-pv.c: Remove a doubled word in a comment.
685         * check-version.c (check_version): Likewise.
686         * javacomp.c (compile_java_class): Likewise.
687
688 2006-07-08  Jim Meyering  <jim@meyering.net>
689
690         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
691
692 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
693
694         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
695         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
696         brackets.  Other minor changes to suppress some compiler
697         warnings.
698
699 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
700
701         * getloadavg.c: Use __VMS, not VMS.
702         * getopt.c: Likewise.
703         * getpagesize.h: Likewise.
704         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
705         probably does not work.
706
707 2006-07-06  Derek R. Price  <derek@ximbiot.com>
708         and Paul Eggert  <eggert@cs.ucla.edu>
709
710         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
711         Don't worry about this obsolete case any more.
712         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
713         directories.
714         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
715         worry about this obsolete case any more.
716         * fts.c: Likewise.
717         * getcwd.c: Likewise.
718         * glob.h: Likewise.
719         * savedir.c: Likewise.
720
721 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
722
723         * .cppi-disable: Add wcwidth.
724         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
725         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
726         (ISGRAPH): Remove.  All uses changed to isgraph.
727         (FOLD) [!defined _LIBC]: Remove special case.
728         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
729         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
730         HAVE_ISBLANK.
731         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
732
733 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
734
735         * strtod.c (strtod): cast the argument of tolower to unsigned char.
736
737 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
738
739         * memcasecmp.c: Include <limits.h>.
740         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
741         * strtod.c (strtod): Don't assume isspace works on negative chars.
742         Don't assume isdigit succeeds only on '0' through '9'.
743
744 2006-07-05  Derek R. Price  <derek@ximbiot.com>
745
746         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
747         All uses of is_space replaced by isspace.
748         * exit.h: Don't talk about STDC_HEADERS.
749         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
750         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
751         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
752         replaced by isprint etc.
753         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
754         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
755         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
756         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
757         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
758         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
759
760 2006-07-05  Eric Blake  <ebb9@byu.net>
761
762         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
763         missing from netdb.h.
764         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
765
766 2006-06-27  Bruno Haible  <bruno@clisp.org>
767
768         Assume ANSI C header files and <ctype.h> functions.
769         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
770         (mbsnwidth): Use isprint, iscntrl instead.
771
772 2006-07-03  Jim Meyering  <jim@meyering.net>
773
774         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
775         macro is used before the first cycle_check call.
776
777 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
778
779         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
780         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
781         reported by Mark D. Baushke, one in
782         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
783
784         Merge from coreutils.
785
786         * .cppi-disable: Add stdint_.h.
787         * .cvsignore: Add stdint.h.
788
789         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
790
791         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
792         both double and long double versions.
793         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
794         * xstrtold.c: New file.
795         * xstrtod.h (xstrtold): New decl.
796
797         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
798
799         * filemode.c (setst): Remove.
800         (strmode): Rewrite to avoid setst.  This makes the code shorter,
801         (arguably) clearer, and the generated code is a bit smaller on my
802         Debian GNU/Linux stable x86 host.
803
804         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
805
806         * filemode.c: Include "filemode.h" first, to test the interface.
807         Assume that filemode.h includes sys/types.h and sys/stat.h.
808         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
809         (ftypelet): Reorder to put common cases first, for efficiency.
810         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
811         to do 'M'.
812         (strmode): Renamed from mode_string, and now stores 12 bytes instead
813         of 10, for compatibility with FreeBSD.  All callers changed.
814         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
815         that can't be deduced solely from st_mode.  First arg is now a const
816         pointer.
817         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
818         (strmode): Renamed from mode_string.
819         (filemodestring): New decl.
820         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
821         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
822         (S_ISPORT, S_ISWHT): New macros, if not already defined.
823
824         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
825
826         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
827         fsusage.h now does that.  Include fsusage.h first, to test interface.
828         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
829         at most one method (the old code could have generated decls that
830         didn't conform to C89, not that this was ever exercised).
831         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
832
833         2006-03-19  Jim Meyering  <jim@meyering.net>
834
835         Work even in a chroot where d_ino values for entries in "/"
836         don't match the stat.st_ino values for the same names.
837         * getcwd.c (__getcwd): When no d_ino value matches the target inode
838         number, iterate through all entries again, using lstat instead.
839         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
840         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
841
842         * getcwd.c (__getcwd): Clarify a comment.
843         Use memcpy in place of a call to strcpy.
844
845         2006-03-12  Jim Meyering  <jim@meyering.net>
846
847         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
848         that of the current directory (which we're about to chdir ".." out of),
849         then save the dev-ino of the parent, instead.
850
851         * same-inode.h (SAME_INODE): New file/macro.
852         * chdir-safer.c (SAME_INODE): Remove definition.
853         Include "same-inode.h", instead.
854         * same.c: Likewise.
855         * cycle-check.h: Include "same-inode.h".
856         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
857         * cycle-check.c (SAME_INODE): Remove definition.
858         * root-dev-ino.h: Include "same-inode.h".
859
860         2006-03-11  Eric Blake  <ebb9@byu.net>
861
862         * same.c (same_name): s/base_name/last_component/
863         * backupfile.c (check_extension, numbered_backup): Likewise.
864         * filenamecat.c (file_name_concat): Likewise.
865
866         2006-03-11  Eric Blake  <ebb9@byu.net>,
867                     Paul Eggert  <eggert@cs.ucla.edu>
868
869         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
870         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
871         drive prefix.
872         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
873         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
874         (last_component): New method.
875         * dirname.c (dir_len): Determine when drive letters need a
876         subsequent slash.  Preserve // when it is special.
877         (dir_name): Don't append dot when drive letter is absolute.
878         [TEST_DIRNAME]: Move into a full-blown gnulib test.
879         * basename.c (base_name): New semantics - malloc the result.
880         Preserve // when it is special.  Preserve relative files that look
881         like drive letters.
882         (base_len): Preserve // when it is special.
883         (last_component): New method, similar to old base_name semantics.
884         * stripslash.c (strip_trailing_slashes): Use last_component, not
885         base_name.  Strip redundant slashes from ///.
886
887 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
888
889         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
890         both are 64 bits, since this seems to be the tradition, and this
891         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
892         we ever run into a host that prefers long long to long in this
893         case, we'll need another configure-time test.  Problem reported by
894         Jim Meyering.
895
896 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
897
898         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
899         possible collision with system files.
900         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
901         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
902         WCHAR_MIN and WCHAR_MAX in this case.
903         (<stddef.h>): Do not include; no longer needed.
904         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
905         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
906         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
907         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
908         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
909         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
910         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
911         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
912         !defined(__c99))]: Include in this case too, since it's harmless
913         now.
914         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
915         dangerous to do so.
916         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
917         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
918         (_STDINT_MIN, _STDINT_MAX): New macros.
919         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
920         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
921         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
922         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
923         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
924         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
925         macros, not typedefs; this simplifies things quite a bit.
926         Use long int for all types narrower than int64_t.
927         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
928         Define in terms of long long int or int64_t or long int,
929         not int64_t or int32_t.  This saves some compile-time testing.
930         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
931         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
932         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
933         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
934         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
935         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
936         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
937         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
938         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
939         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
940         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
941         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
942         undef any previous version and define our own version, for
943         simplicity and consistency with the new macros for types.
944         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
945         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
946         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
947         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
948         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
949         @WINT_T_SUFFIX@ to keep things simple here.
950         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
951         Simplify by assuming typical 8/16/32/64 host, since we're
952         already doing that elsewhere anyway.
953         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
954         and assume long long int is 64 bits if available.  This
955         speeds up 'configure'.
956
957 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
958
959         * getaddrinfo.c: fixed typo
960
961 2006-06-29  Eric Blake  <ebb9@byu.net>
962
963         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
964         unused static function.
965
966 2006-06-29  Eric Blake  <ebb9@byu.net>
967
968         * stat_.h: New file.
969
970 2006-06-29  Derek R. Price  <derek@ximbiot.com>
971
972         * strftime.c: Assume strftime() exists.
973
974 2006-06-28  Bruno Haible  <bruno@clisp.org>
975
976         * getaddrinfo.h: Fix POSIX URL.
977         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
978         (use_win32_p): Make static.
979         (getaddrinfo): Reject service name if it is empty or does not consist
980         solely of decimal digits, or if its value is > 65535.
981         (getnameinfo): Remove useless casts.
982
983 2006-06-28  Derek R. Price  <derek@ximbiot.com>
984
985         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
986         Autoconf 2.60 says this stuff was obsolete.
987
988 2006-05-12  Bruno Haible  <bruno@clisp.org>
989
990         * mkdtemp.c [MINGW]: Include <io.h>.
991         (mkdir): Define using _mkdir.
992
993 2006-06-28  Bruno Haible  <bruno@clisp.org>
994
995         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
996         declaration for wcwidth.
997         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
998
999 2006-06-28  Eric Blake  <ebb9@byu.net>
1000
1001         * xvasprintf.h: Fix comments.
1002
1003 2006-06-28  Eric Blake  <ebb9@byu.net>
1004
1005         * mbchar.h (wcwidth): Include wcwidth.h.
1006         * mbswidth.c (wcwidth): Move from here...
1007         * wcwidth.h: ...to this new file.
1008
1009 2006-06-28  Simon Josefsson  <jas@extundo.com>
1010
1011         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1012         functions there.  It will succeed on Windows XP, but on Windows
1013         2000 and (presumably) earlier, it will fail, and use the internal
1014         re-implementation.
1015         (use_win32_p): New function.
1016         (getaddrinfo): Use strtoul on servname, to support numeric ports.
1017         Support AI_NUMERICSERV to disable getservbyname.
1018         (getnameinfo): New function, only supports
1019         NI_NUMERICHOST|NI_NUMERICSERV for now.
1020
1021         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1022         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
1023         getnameinfo.
1024
1025 2006-06-27  Bruno Haible  <bruno@clisp.org>
1026
1027         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1028
1029 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1030
1031         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1032         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1033         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1034
1035 2006-06-26  Bruno Haible  <bruno@clisp.org>
1036
1037         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1038         WCHAR_MAX.
1039         Reported by Mark D. Baushke and Larry Jones.
1040
1041 2006-06-26  Bruno Haible  <bruno@clisp.org>
1042
1043         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1044         in pre-C99 mode.
1045         Suggested by Mark D. Baushke and Larry Jones.
1046
1047 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1048
1049         * stdint_.h: Treat BSD/OS like OpenBSD.
1050
1051 2006-06-23  Bruno Haible  <bruno@clisp.org>
1052
1053         * stdint_.h: Treat IRIX like OpenBSD.
1054
1055 2006-06-23  Bruno Haible  <bruno@clisp.org>
1056
1057         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1058         ISO C 99 Technical Corrigendum 1.
1059
1060 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1061
1062         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1063         Some compiler complained about some of them.  Problem reported by
1064         Larry Jones in
1065         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1066
1067 2006-06-21  Simon Josefsson  <jas@extundo.com>
1068
1069         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1070         variable.
1071
1072         * socket_.h: Don't define WINVER.
1073
1074         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1075         slightly modified to work in gnulib.
1076
1077 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1078
1079         * read-file.c (fread_file): Start with buffer allocation of
1080         0 bytes rather than 1 byte; this simplifies the code.
1081         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1082         code to free buffer and save/restore errno.
1083         (internal_read_file): Remove unused local.
1084
1085 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1086
1087         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1088         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1089         Problem reported by Denis Excoffier in
1090         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1091
1092 2006-06-19  Simon Josefsson  <jas@extundo.com>
1093
1094         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1095
1096 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1097
1098         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1099
1100 2006-06-17  Bruno Haible  <bruno@clisp.org>
1101
1102         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1103
1104 2006-06-17  Bruno Haible  <bruno@clisp.org>
1105
1106         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1107         problem on Solaris 2.5.1.
1108
1109 2006-06-16  Eric Blake  <ebb9@byu.net>
1110
1111         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1112         * unicodeio.c [!defined errno]: Likewise.
1113         * strtol.c [!defined errno]: Likewise.
1114         * strtod.c [!defined errno]: Likewise.
1115
1116 2006-06-15  Bruno Haible  <bruno@clisp.org>
1117
1118         * stdint_.h: Rewritten to be fully auto-configured.
1119         Fixes bug on HP-UX/IA64.
1120
1121 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1122
1123         * getdate.y (__attribute__): Don't define if already defined.
1124         Problem reported by Larry Jones.
1125         * utimens.c (__attribute__): Likewise.
1126
1127 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1128
1129         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1130         reported by Andreas Schwab.
1131
1132 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1133             Bruno Haible  <bruno@clisp.org>
1134
1135         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1136
1137 2006-05-26  Martin Lambers  <marlam@marlam.de>
1138
1139         * getpass.c: Updates the test for the native W32 API, and adds
1140         missing includes, thus fixing compilation warnings.
1141
1142 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1143
1144         * tempname.c (small_open, large_open): New macros.
1145         (__open, __open64) [!_LIBC]: Remove.
1146         (__gen_tempname): Use small_open and large_open instead of __open
1147         and __open64.  This fixes a portability bug on HP-UX 11.11i
1148         reported by Simon Wing-Tang in
1149         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1150
1151 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1152
1153         * exclude.c (exclude_fnmatch): New function.
1154         (excluded_file_name): Call exclude_fnmatch.
1155         * exclude.h (excluded_file_name): New prototype
1156
1157 2006-05-24  Bruno Haible  <bruno@clisp.org>
1158
1159         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1160         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1161         Reported by Thorsten Maerz <torte@netztorte.de> via
1162         Aaron Stone <aaron@serendipity.cx>.
1163
1164 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1165
1166         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1167         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1168         (my_usleep): Don't mishandle maximum value.
1169
1170 2006-05-19  Jim Meyering  <jim@meyering.net>
1171
1172         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1173
1174 2006-05-17  Bruno Haible  <bruno@clisp.org>
1175
1176         Cygwin portability.
1177         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1178
1179 2006-05-17  Bruno Haible  <bruno@clisp.org>
1180
1181         * stdint_.h: Fix recognition of Cygwin.
1182
1183 2006-05-11  Jim Meyering  <jim@meyering.net>
1184
1185         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1186
1187 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1188
1189         * crc.c (crc32_update): Remove unnecessary L suffix.
1190         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1191         unwanted sign propagation, e.g., on hosts with 64-bit int.
1192         There still are some problems with reeelly weird theoretical hosts
1193         (e.g., 33-bit int) but it's not worth worrying about now.
1194         * sha1.c (rol): Likewise.
1195         (K1, K2, K3, K4): Remove unnecessary L suffix.
1196
1197 2006-05-10  Bruno Haible  <bruno@clisp.org>
1198
1199         * des.c: Cast to avoid warnings.
1200
1201 2006-05-10  Simon Josefsson  <jas@extundo.com>
1202
1203         * md4.c: Typo fix, update copyright years.
1204         (K1, K2): Don't use L because it turn computations into 64-bit on
1205         64-bit platforms.
1206
1207 2006-05-09  Bruno Haible  <bruno@clisp.org>
1208
1209         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1210         (EOVERFLOW): Define fallback value.
1211         (xstrcat): New function.
1212         (xvasprintf): Recognize the special case of a string concatenation.
1213
1214 2006-05-01  Bruno Haible  <bruno@clisp.org>
1215
1216         * stdint_.h: Shorter URL.
1217         * inttypes.h: Likewise.
1218
1219 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1220
1221         * verify.h: Document the internals better.  Most of this change
1222         was written by Bruno Haible.
1223
1224 2006-04-29  Bruno Haible  <bruno@clisp.org>
1225
1226         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1227         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1228
1229 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1230
1231         * getdate.y (get_date): When adding relative date, start with the
1232         initial time, not with the result of the first mktime call.
1233
1234 2006-04-23  Bruno Haible  <bruno@clisp.org>
1235
1236         * copy-file.c: Include <unistd.h> unconditionally.
1237         * execute.c: Likewise.
1238         * fatal-signal.c: Likewise.
1239         * findprog.c: Likewise.
1240         * mkdtemp.c: Likewise.
1241         * pipe.h: Likewise.
1242         * pipe.c: Likewise.
1243         * wait-process.h: Likewise.
1244
1245 2006-04-23  Bruno Haible  <bruno@clisp.org>
1246
1247         * fwriteerror.c (fwriteerror): Call fclose also when an error
1248         condition was already detected.
1249         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1250
1251 2006-04-19  Derek Price  <derek@ximbiot.com>
1252             Eric Blake  <ebb9@byu.net>
1253
1254         * inttypes.h: Correct grammar in comment.
1255
1256 2006-04-18  Derek Price  <derek@ximbiot.com>
1257             Paul Eggert  <eggert@cs.ucla.edu>
1258
1259         * inttypes.h: New file.
1260         * strtoimax.c: Assume <inttypes.h>.
1261
1262 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1263
1264         * utimens.c (futimens): glibc futimesat messes up if /proc
1265         isn't mounted.  Problem reported by Kir Kolyshkin.
1266
1267 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1268
1269         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1270         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1271         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1272
1273 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1274
1275         Merge regex changes from libc, removing some of our
1276         POSIX-conformance changes that were rejected and redoing them in a
1277         less-intrusive way.
1278
1279         * regcomp.c (re_compile_internal, init_dfa):
1280         Length arg is now size_t, not Idx.  All uses changed.
1281         (peek_token): Forward decl now says internal_function.
1282         (__re_error_msgid, __re_error_msgid_idx):
1283         Now static rather than extern with attribute_hidden.
1284         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1285         For some reason libc prefers K&R style defns for external functions.
1286         (regerror) [!defined _LIBC]: Likewise.
1287         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1288         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1289         (build_range_exp, build_collating_symbol):
1290         Use K&R-style defn.
1291         (re_compile_fastmap): Use '\0' to memset, not 0.
1292         (utf8_sb_map): Make the calculations more obvious.
1293         (init_dfa, parse_bracket_exp, build_charclass_op):
1294         Call calloc and cast result, as glibc does.
1295         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1296         (build_range_exp, build_collating_symbol):
1297         Now internal functions.
1298
1299         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1300
1301         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1302         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1303         Don't depend on VMS; depend on __VMS instead, for POSIX
1304         namespace cleanness.
1305         (regoff_t): Define to ssize_t, not long int.
1306
1307         Remove the REG_ macros named below.  Instead, make the old names
1308         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1309         __USE_GNU_REGEX.
1310         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1311         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1312         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1313         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1314         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1315         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1316         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1317         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1318         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1319         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1320         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1321         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1322         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1323         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1324         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1325         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1326         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1327         (REG_NREGS):
1328         Remove.  All uses replaced by the old RE_* names.
1329         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1330         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1331         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1332         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1333         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1334         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1335         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1336         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1337         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1338         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1339         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1340         Don't bother having these macros be independent of each others'
1341         values, since they no longer exist in the POSIX name space.
1342
1343         Rename the following member names back to their old names,
1344         unless !__USE_GNU_REGEX.  All uses changed back.
1345         (buffer): Renamed from re_buffer.
1346         (allocated): Renamed from re_allocated.
1347         (used): Renamed from re_used.
1348         (syntax): Renamed from re_syntax.
1349         (fastmap): Renamed from re_fastmap.
1350         (translate): Renamed from re_translate.
1351         (can_be_null): Renamed from re_can_be_null.
1352         (regs_allocated): Renamed from re_regs_allocated.
1353         (fastmap_accurate): Renamed from re_fastmap_accurate.
1354         (no_sub): Renamed from re_no_sub.
1355         (not_bol): Renamed from re_not_bol.
1356         (not_eol): Renamed from re_not_eol.
1357         (newline_anchor): Renamed from re_newline_anchor.
1358         (num_regs): Renamed from rm_num_regs.
1359         (start): Renamed from rm_start.
1360         (end): Renamed from rm_end.
1361
1362         (free_state): Move up a bit.
1363
1364         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1365         #define to be empty.
1366         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1367         when that is what is intended.
1368         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1369         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1370         (MAX): New macro.
1371         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1372         All uses changed back to re_malloc, etc.  It's now the caller's
1373         responsibility to check for overflow; all callers changed.
1374         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1375         (re_x2nrealloc): Remove.
1376         (free_state): Remove decl.
1377
1378         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1379         (re_set_registers, re_exec):
1380         Use K&R-style defn.
1381
1382         2006-01-31  Roland McGrath  <roland@redhat.com>
1383
1384         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1385         Reported by Mike Frysinger <vapier@gentoo.org>.
1386
1387         2006-01-15  Andreas Jaeger  <aj@suse.de>
1388
1389         [BZ #1950]
1390         * regex_internal.c (re_string_reconstruct): Adjust for
1391         build_wcs_upper_buffer change.
1392         (build_wcs_upper_buffer): Change return type.
1393
1394         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1395
1396         * regex_internal.h: Include <stdint.h> if available.
1397
1398         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1399
1400         * regex_internal.h (SIZE_MAX): Provide a default definition.
1401
1402         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1403
1404         * regcomp.c: Adjust for changed secondary hash function.
1405
1406         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1407
1408         * regex.h: Pretty printing.
1409         Clean up namespace a bit.
1410
1411         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1412
1413         * regexec.c (update_cur_sifted_state, check_arrival,
1414         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1415
1416         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1417                     Ulrich Drepper  <drepper@redhat.com>
1418
1419         [BZ #1302]
1420         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1421         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1422
1423         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1424
1425         [BZ #281]
1426         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1427         * regcomp.c: Remove unnecessary uses of
1428         unsigned RE_TRANSLATE_TYPE.
1429         * regex_internal.h: Likewise.
1430         * regex_internal.c: Likewise.
1431         * regexec.c: Likewise.
1432         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1433
1434         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1435
1436         * regexec.c (find_recover_state): Remove unnecessary
1437         initialization.
1438         (transit_state_bkref): Make DFA a const pointer.
1439         (get_subexp): Likewise.
1440         (check_arrival): Likewise.
1441         (update_cur_sifted_state): Likewise.
1442         (re_search_internal): Likewise.
1443         (prune_impossible_nodes): Likewise.
1444         (acquire_init_state_context): Likewise.
1445         (proceed_next_node): Likewise.
1446         (set_regs): Likewise.
1447         (free_fail_stack_return): Likewise.
1448         (check_arrival_expand_ecl): Mark DFA parameter as const.
1449         (check_arrival_expand_ecl_sub): Likewise.
1450         (check_subexp_limits): Likewise.
1451         (sub_epsilon_src_nodes):  Likewise.
1452         (add_epsilon_src_nodes):  Likewise.
1453         (merge_state_array): Likewise.
1454         (update_regs): Likewise.
1455         (build_trtable): Likewise.
1456         (sift_states_backward): Mark MCTX parameter as const.
1457         (build_sifted_states): Likewise.
1458         (update_cur_sifted_state): Likewise.
1459         (sift_states_mkref): Likewise.
1460         (check_arrival_expand_ecl): Mark eclosure as const.
1461         (check_dst_limits_calc_pos_1): Likewise.
1462         * regex_internal.h (re_match_context_t): Make dfa a const
1463         pointer.
1464
1465         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1466
1467         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1468         (transit_state_sb): Likewise.
1469         (transit_state_mb): Likewise.
1470         (sift_states_iter_mb): Likewise.
1471         (check_arrival_add_next_nodes): Likewise.
1472         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1473         [_LIBC] (re_search_2_stub): Use mempcpy.
1474
1475         * regex_internal.c (re_string_reconstruct): Avoid calling
1476         mbrtowc for very simple UTF-8 case.
1477
1478         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1479         a pointer-to-const.
1480         (re_acquire_state_context): Likewise.
1481         * regex_internal.h: Adjust prototypes.
1482
1483         * regex.c: Prevent using C++ compilers.
1484
1485         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1486         (re_acquire_state_context): Likewise.
1487
1488 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1489             Bruno Haible  <bruno@clisp.org>
1490
1491         * stdint_.h: On OpenBSD, don't redefine types already included in
1492         <sys/types.h> and <inttypes.h>.
1493
1494 2006-03-24  Eric Blake  <ebb9@byu.net>
1495
1496         * time_r.c (copy_string_result): Remove, as it is no longer used.
1497
1498 2006-03-24  Simon Josefsson  <jas@extundo.com>
1499
1500         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1501         including some doc fixes.
1502         (base64_encode_alloc): Fix +1 bug on allocation failures.
1503
1504 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1505
1506         * base64.c (base64_encode): Do not read past end of array with
1507         unsanitized input on systems with CHAR_BIT > 8.
1508
1509 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1510
1511         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1512         Typedef to long int, not to off_, as POSIX will likely change
1513         in that direction.
1514
1515 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1516
1517         * argp-help.c (validate_uparams): Fix typo
1518         * argp-parse.c (argp_default_options): Consistently begin help
1519         messages with a lowercase letter.
1520
1521 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1522
1523         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1524         overrun buffers and shouldn't be used (much as gets shouldn't be
1525         used).
1526         * time_r.c (asctime_r, ctime_r): Likewise.
1527
1528 2006-03-08  Simon Josefsson  <jas@extundo.com>
1529
1530         * gc-gnulib.c (randomize): Don't open files called 'no', they
1531         signal that configure disabled the device.
1532
1533 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1534
1535         * c-stack.c: Include unistd.h unconditionally, since we now assume
1536         the unistd module.
1537         * getlogin_r.c: Likewise.
1538         * getlogin_r.h: Likewise.
1539         * glob.c: Likewise.
1540         * pagealign_alloc.c: Likewise.
1541         * unistd_.h: Remove; no longer needed.
1542
1543 2006-03-07  Simon Josefsson  <jas@extundo.com>
1544
1545         * unistd_.h: New file.
1546
1547 2006-03-07  Simon Josefsson  <jas@extundo.com>
1548
1549         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1550
1551 2006-03-01  Simon Josefsson  <jas@extundo.com>
1552
1553         * readline.c: Fix typo, tiny patch from Stepan Kasal
1554         <kasal@ucw.cz>.
1555
1556 2006-02-28  Simon Josefsson  <jas@extundo.com>
1557
1558         * getopt.c: Protect #include of unistd.h, for MSVS.
1559
1560 2006-02-27  Simon Josefsson  <jas@extundo.com>
1561
1562         * base64.h: Indent #define's.  From Jim Meyering
1563         <jim@meyering.net>.
1564
1565 2006-02-27  Jim Meyering  <jim@meyering.net>
1566
1567         Revert the change of 2006-02-24, so these files can continue
1568         to be sync'd from gettext.
1569         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1570         of `config.h'.
1571
1572 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1573
1574         * glob.c: Say "invalid" rather than "illegal" in comments.
1575
1576 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1577
1578         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1579
1580 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1581
1582         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1583         AT_FDCWD exceeds INT_MAX.
1584         * openat.h (AT_FDCWD): Likewise.
1585
1586 2006-02-14  Jim Meyering  <jim@meyering.net>
1587
1588         Sync from coreutils.
1589
1590         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1591         failure on deficient systems, and simplify gnulib lgpl dependencies.
1592         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1593         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1594
1595         * xalloc-die.c: Remove unused definition of N_.
1596
1597 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1598
1599         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1600
1601 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1602
1603         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1604         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1605
1606 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1607
1608         * argp-namefrob.h: Restore changes accidentally lost during the
1609         "autoupdate" on 2005-12-12.
1610
1611 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1612
1613         * fnmatch.c (L_): Renamed from L, to work around a bug in
1614         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1615         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1616         All uses changed.
1617
1618 2006-01-26  Simon Josefsson  <jas@extundo.com>
1619
1620         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1621         prototype is visible on mingw32.
1622
1623         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1624         for mingw32.
1625
1626         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1627         mingw32).
1628
1629 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1630
1631         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1632         attempt to open for write; this always fails, at least on POSIX
1633         hosts.  This reinstates the 2006-01-09 change, which was
1634         inadvertently removed.
1635
1636 2006-01-26  Bruno Haible  <bruno@clisp.org>
1637             Paul Eggert  <eggert@cs.ucla.edu>
1638
1639         * stdbool_.h (_Bool)
1640         [(! (defined __cplusplus || defined __BEOS__)
1641           && !defined __GNUC__
1642           && !(defined __HP_cc || defined __xlc__
1643                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1644                || defined __sgi))]:
1645         #define to signed char in these cases too; this simplifies
1646         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1647         etc., separately) and makes it more conservative.
1648
1649 2006-01-21  Jim Meyering  <jim@meyering.net>
1650
1651         Sync from the stable (b5) branch of coreutils:
1652
1653         * fts.c (fts_children): Don't let close() clobber errno from
1654         failed fchdir().
1655
1656         * fts.c (fts_stat): When following a symlink-to-directory,
1657         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1658         a dangling symlink.  That can also happen at least for ELOOP.
1659         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1660         FYI, this bug predates the inclusion of fts.c in coreutils.
1661
1662         * fts.c (fts_open): Put new maxarglen declaration and uses
1663         in their own block, so pre-c99 compilers don't object.
1664
1665         Avoid the double-free (first in fts_read, second in fts_close) that
1666         would occur when an `active' directory is made inaccessible (e.g.,
1667         via chmod a-x) during a traversal.
1668         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1669         before returning.  Reproduce this failure by
1670         mkdir -p a/b; cd a; chmod a-x . b
1671         Reported by Stavros Passas.
1672
1673 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1674
1675         * argp-namefrob.h: Bugfix. Remove stray #
1676
1677 2006-01-25  Bruno Haible  <bruno@clisp.org>
1678
1679         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1680         warnings.
1681         Reported by Paul Eggert.
1682
1683 2006-01-25  Jim Meyering  <jim@meyering.net>
1684
1685         * fileblocks.c: Remove more useless parentheses.
1686         * readutmp.h: Likewise.
1687
1688 2006-01-24  Bruno Haible  <bruno@clisp.org>
1689
1690         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1691         has it.
1692         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1693         2005-11-26.
1694
1695         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1696         to avoid problems with the built-in _Bool type.
1697         Reported by Paul Eggert on 2005-11-26.
1698
1699 2006-01-24  Jim Meyering  <jim@meyering.net>
1700
1701         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1702
1703 2006-01-24  Simon Josefsson  <jas@extundo.com>
1704
1705         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1706         Bruno.
1707
1708 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1709
1710         Work around porting bugs reported by Dieter in
1711         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1712         * getopt.c (_NOPROTO): Remove; no longer needed.
1713         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1714         Include "getopt.h" first, to check interface.
1715         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1716         !HAVE_DECL_GETENV.
1717         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1718         (__strndup): Revert to K&R-style function dfns, the glibc style.
1719         * strnlen.c: Don't claim it's taken from glibc; it's not.
1720         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1721         Include strnlen.h first, to get prototype properly.
1722         (strnlen): Renamed from __strnlen.
1723         Remove weak alias.
1724
1725 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1726
1727         These changes imported from libc.
1728         * getopt.c: Use __fxprintf instead of inline stream orientation
1729         test and two separate function calls.
1730         * strndup.c (__strndup): Add libc_hidden_def.
1731
1732 2006-01-22  Bruno Haible  <bruno@clisp.org>
1733
1734         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1735         temporary buffer for sprintf, take into account the precision also
1736         for 'd', 'i', 'u', 'o', 'x', 'X'.
1737
1738 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1739
1740         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1741         to pacify gcc -Wswitch-default.
1742
1743 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1744
1745         * argp-help.c (usage_long_opt): Do not print DOC options.
1746         (__argp_base_name): Removed
1747         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1748         typo.
1749         (__argp_base_name): Provide macro definition or extern declaration
1750         depending on the configuration
1751
1752 2006-01-20  Simon Josefsson  <jas@extundo.com>
1753
1754         * inet_ntop.h: Unconditionally include sys/socket.h.
1755
1756 2006-01-19  Simon Josefsson  <jas@extundo.com>
1757
1758         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1759
1760 2006-01-12  Simon Josefsson  <jas@extundo.com>
1761
1762         * base64.c: Fix warning, reported by Bruno Haible
1763         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1764
1765 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1766
1767         Sync from coreutils.
1768         * md5.c: Fix commentary typos.
1769         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1770         * md5.h (__attribute__): Remove; unused.
1771         * sha1.c: Fix commentary to match md5 better.
1772         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1773         so that we don't need to worry about alignment.  All uses changed.
1774         This merges the 2005-10-28 md5 change into sha1.
1775
1776 2006-01-11  Jim Meyering  <jim@meyering.net>
1777
1778         Sync from coreutils.
1779         * md5.c (OP): Fix spacing.
1780
1781 2006-01-11  Simon Josefsson  <jas@extundo.com>
1782
1783         * stdint_.h (SIZE_MAX): Add missing (.
1784
1785 2006-01-10  Bruno Haible  <bruno@clisp.org>
1786
1787         * argp.h (__const): Remove macro. Use const instead.
1788         * argp-fmtstream.h (__const): Likewise.
1789         * glob_.h (__const): Remove macro.
1790         * glob-libc.h: Use const instead of __const.
1791
1792 2006-01-10  Jim Meyering  <jim@meyering.net>
1793
1794         Avoid the double-free (first in fts_read, second in fts_close) that
1795         would occur when an `active' directory is made inaccessible (e.g.,
1796         via chmod a-x) during a traversal.
1797         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1798         before returning.  Reproduce this failure by
1799         mkdir -p a/b; cd a; chmod a-x . b
1800         Reported by Stavros Passas.
1801
1802         Sync from coreutils.
1803         * sha1.c: Tweak grammar in a comment.
1804
1805 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1806
1807         * regex_internal.h (BITSET_WORD_BITS):
1808         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1809         preprocessor mishandles large unsigned values as if they were signed.
1810         Problem reported by Claudio Fontana in
1811         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1812
1813 2006-01-10  Simon Josefsson  <jas@extundo.com>
1814
1815         * socket_.h: New file.
1816
1817 2006-01-10  Bruno Haible  <bruno@clisp.org>
1818
1819         * localcharset.c: Update from GNU gettext.
1820
1821 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1822
1823         Sync from coreutils.
1824         * chdir-long.c (cdb_free): Don't bother trying to open directory
1825         for write access: POSIX says that must fail.
1826         * fts.c (diropen): Likewise.
1827         * save-cwd.c (save_cwd): Likewise.
1828         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1829         well, for minor improvements on hosts that lack O_DIRECTORY.
1830         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1831         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1832         Fall back on chown if open failed with EACCES.
1833
1834         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1835         Report an error at compile-time if only a 1-second nominal clock
1836         resolution is found.
1837
1838         * lchmod.h: New file.
1839         * mkdir-p.c: Include lchmod.h, lchown.h.
1840         (make_dir_parents): Use lchown rather than chown, and
1841         lchmod rather than chmod.
1842
1843         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1844         too.  Problem with "none" reported by Bob Proulx.  Problem with
1845         "proc" reported by n0dalus.
1846
1847         * mountlist.c: Include <limits.h>.
1848         (dev_from_mount_options)
1849         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1850         New function.  It no longer assumes "dev=" has the System V meaning
1851         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1852         (read_file_system_list)
1853         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1854         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1855         dev= in that case.
1856
1857         * posixtm.h (PDS_PRE_2000): New macro.
1858         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1859         All usages changed.  Reject dates outside the range 1969-1999 if
1860         PDS_PRE_2000 is used.
1861
1862 2006-01-09  Jim Meyering  <jim@meyering.net>
1863
1864         Sync from coreutils.
1865
1866         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1867
1868         * chdir-safer.h, chdir-safer.c: New files.
1869
1870         * modechange.c (mode_compile): Reject an invalid mode string
1871         that starts with an octal digit.  From Andreas Gruenbacher.
1872
1873         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1874         and dup to open_safer and dup_safer, respectively.
1875         (openat_permissive): Fix typo in comment.
1876
1877         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1878         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1879         (_): Remove; no longer needed.
1880         (openat): Renamed from rpl_openat; no need for rpl_openat
1881         since openat.h renames openat for us.
1882         Replace most of the body with a call to openat_permissive,
1883         to avoid duplicate code.
1884         Port to (probably hypothetical) environments were mode_t is
1885         wider than int.
1886         (openat_permissive): Require mode arg, so that we can check
1887         types better.  Put it just after flags.  Change cwd failure
1888         indicator from pointer-to-bool to pointer-to-errno-value.
1889         All callers changed.
1890         Invoke openat_save_fail and/or openat_restore_fail if
1891         cwd_errno is null, so that openat can call us.
1892         (openat_permissive, fdopendir, fstatat, unlinkat):
1893         Simplify errno handling to avoid some duplicate code,
1894         as it's OK to set errno on success.
1895         * openat.h: Revamp code so that function macros depend on
1896         __OPENAT_PREFIX only, not also on AT_FDCWD.
1897         (openat_ro): Remove.  Caller changed to use openat_permissive.
1898         (openat_permissive): Now a macro, if not a function.
1899         (openat_restore_fail, openat_save_fail): Now always functions,
1900         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1901
1902         * openat-priv.h: New file, defining macros used by mkdirat.c
1903         and openat.c.
1904         * mkdirat.c: Include openat-priv.h.
1905         Remove definitions of macros defined therein.
1906         * openat.c: Likewise.
1907
1908         * mkdirat.c (mkdirat): New file and function.
1909         * openat.h (mkdirat): Declare.
1910
1911         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1912
1913         * openat.h (openat_permissive): Declare.
1914         (openat_ro): Define.
1915
1916         * openat.c (EXPECTED_ERRNO): New macro.
1917         (openat_permissive): New function -- used in remove.c rewrite.
1918         (all functions): Set errno just before returning, only if there
1919         was an actual failure.
1920         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1921
1922         Emulate openat-family functions using Linux's procfs, if possible.
1923         Idea and some code based on Ulrich Drepper's glibc changes.
1924
1925         * openat.c: (BUILD_PROC_NAME): New macro.
1926         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1927         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1928         before falling back on save_cwd and restore_cwd.
1929         (fdopendir, fstatat, unlinkat): Likewise.
1930
1931         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1932         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1933
1934         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1935         as second argument to va_arg.  Otherwise, some versions of gcc
1936         warn that `if this code is reached, the program will abort'.
1937
1938 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1939
1940         Sync from coreutils.
1941
1942         Add POSIX ACL support
1943         * acl.h (copy_acl, set_acl): Add declarations.
1944         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1945         systems other than Linux.
1946         (chmod_or_fchmod): New function: use fchmod when possible,
1947         and chmod otherwise.
1948         (file_has_acl): Add a POSIX ACL implementation, with a
1949         Linux-specific subcase.
1950         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1951         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1952         acls are unsupported.
1953         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1954         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1955         are unsupported.
1956
1957 2006-01-09  Bruno Haible  <bruno@clisp.org>
1958
1959         * sysexit_.h (EX_OK): New macro.
1960         Suggested by Martin Lambers <marlam@marlam.de>.
1961
1962 2006-01-09  Bruno Haible  <bruno@clisp.org>
1963
1964         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1965         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1966         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1967         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1968
1969 2006-01-09  Bruno Haible  <bruno@clisp.org>
1970
1971         * stdint_.h (SIZE_MAX): Write the value without involving negative
1972         numbers.
1973
1974 2005-10-16  Bruno Haible  <bruno@clisp.org>
1975
1976         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1977         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1978
1979 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1980
1981         * strftime.c (tzname): Don't declare if it is already #defined.
1982         Problem reported for Mingw by Mark Junker.
1983
1984 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1985
1986         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1987         long int, not int, for nanosecond counts, so that people who are
1988         used to POSIX struct timespec won't be surprised.  Reported by Jim
1989         Meyering.
1990
1991 2005-12-16  Jim Meyering  <jim@meyering.net>
1992
1993         * fprintftime.c, fprintftime.h: New files.
1994
1995 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1996
1997         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1998         * argp-help.c (fill_in_uparams): Check if the constructed
1999         struct uparams is valid. Fall back to the default values if it is
2000         not.
2001
2002 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2003
2004         * argp-help.c (__argp_base_name): New function
2005         (__argp_short_program_name): Rewrite using __argp_base_name
2006         * argp-namefrob.h: Define program_invocation_name and
2007         program_invocation_short_name if requested
2008         (__argp_base_name): Add prototype
2009         * argp-parse.c (argp_def): Use gettext wrappers
2010         (argp_default_parser): Use __argp_base_name
2011         * argp-pin.c: New file. Defines program_invocation_name and
2012         program_invocation_short_name on systems that lack them.
2013
2014 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2015
2016         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2017         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2018         porting problem reported by Georg Schwarz in
2019         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2020
2021 2005-07-09  Bruno Haible  <bruno@clisp.org>
2022
2023         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2024         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2025         Reported by Mark Junker <mjscod@gmx.de>.
2026
2027 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2028
2029         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2030         (uintmax_t) [defined uintmax_t]: Do not declare.
2031         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2032         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2033         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2034         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2035         sake of portability to weird hosts that C allows (though we don't
2036         know of any practical examples).
2037
2038         * savedir.h (fdsavedir): New decl.
2039         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2040         contains most of the former guts of savedir.
2041         (savedir): Use savedirstream.
2042         Include "openat.h".
2043
2044 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2045
2046         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2047         coreutils no longer futzes with rounding modes.
2048
2049 2005-11-14  Jim Meyering  <jim@meyering.net>
2050
2051         * mkstemp-safer.c: Include <config.h>, required for possible
2052         replacement of mkstemp.
2053
2054 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2055
2056         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2057         business.
2058         (gethrxtime) [! (HAVE_NANOUPTIME
2059         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2060         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2061         our own approximation.
2062
2063 2005-11-10  Simon Josefsson  <jas@extundo.com>
2064
2065         * readline.c: Remove EOL.
2066
2067 2005-11-08  Eric Blake  <ebb9@byu.net>
2068
2069         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2070
2071 2005-11-08  Eric Blake  <ebb9@byu.net>
2072
2073         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2074
2075 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2076
2077         Fix porting problem reported by Theodoros V. Kalamatianos.
2078         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2079         Don't assume that futimes failing means we must fail.
2080
2081 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2082
2083         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2084         leave errno alone.  Problem reported by Dmitry V. Levin.
2085
2086 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2087
2088         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2089         errno alone.  Problem reported by Frederic Jolliton.
2090
2091 2005-10-28  Simon Josefsson  <jas@extundo.com>
2092
2093         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2094         "restrict" keywords, as per POSIX.  Protect the function
2095         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2096         Don't use K&R prototypes.  Check the sprintf return values.
2097         Re-define EAFNOSUPPORT if not present.  Indent.
2098
2099         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2100         suggested by Bruno Haible <bruno@clisp.org>.
2101
2102         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2103
2104         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2105
2106         * gc-libgcrypt.c: Add MD2 (which is not available through
2107         libgcrypt).
2108
2109         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2110
2111         * md2.h, md2.c: New files.
2112
2113 2005-10-24  Simon Josefsson  <jas@extundo.com>
2114
2115         * md4.h: Shrink buffer size, now that we changed the type.
2116
2117 2005-10-22  Simon Josefsson  <jas@extundo.com>
2118
2119         * arcfour.h, arcfour.c: Use fixed size indices in the
2120         arcfour_context struct (simplify test vector testing in GNU
2121         Shishi).
2122
2123 2005-10-22  Simon Josefsson  <jas@extundo.com>
2124
2125         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2126         suggested by Bruno Haible <bruno@clisp.org>.
2127
2128 2005-10-22  Simon Josefsson  <jas@extundo.com>
2129
2130         * crc.h: Include stddef.h, for size_t.
2131
2132 2005-10-21  Simon Josefsson  <jas@extundo.com>
2133
2134         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2135         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2136
2137 2005-10-21  Simon Josefsson  <jas@extundo.com>
2138
2139         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2140         block.
2141
2142 2005-10-21  Simon Josefsson  <jas@extundo.com>
2143
2144         * gc-gnulib.c: Support ARCTWO in CBC mode.
2145
2146 2005-10-21  Simon Josefsson  <jas@extundo.com>
2147
2148         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2149         <bruno@clisp.org>.
2150
2151         * hmac-sha1.c (hmac_sha1): Likewise.
2152
2153         * crc.c (crc32_update): Actually use crc parameter, suggested by
2154         Bruno Haible <bruno@clisp.org>.
2155
2156         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2157         <bruno@clisp.org>.
2158
2159 2005-10-21  Simon Josefsson  <jas@extundo.com>
2160
2161         * des.h, des.c: New files.
2162
2163         * gc-gnulib.c: Support DES.c
2164
2165 2005-10-21  Simon Josefsson  <jas@extundo.com>
2166
2167         * arctwo.h, arctwo.c: New files.
2168
2169         * gc-gnulib.c: Support ARCTWO.
2170
2171 2005-10-21  Simon Josefsson  <jas@extundo.com>
2172
2173         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2174
2175 2005-10-19  Simon Josefsson  <jas@extundo.com>
2176
2177         * gc-gnulib.c: Support ARCFOUR.
2178
2179 2005-10-19  Simon Josefsson  <jas@extundo.com>
2180
2181         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2182         support.
2183
2184         * gc.h: Add ECB enum type.
2185
2186         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2187
2188 2005-10-19  Simon Josefsson  <jas@extundo.com>
2189
2190         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2191
2192 2005-10-18  Simon Josefsson  <jas@extundo.com>
2193
2194         * md4.h, md4.c: New files, based on md5.?.
2195
2196 2005-10-17  Simon Josefsson  <jas@extundo.com>
2197
2198         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2199
2200         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2201
2202 2005-10-17  Simon Josefsson  <jas@extundo.com>
2203
2204         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2205
2206 2005-10-17  Simon Josefsson  <jas@extundo.com>
2207
2208         * gc.h, gc-libgcrypt.c: Add ciphers.
2209
2210 2005-10-17  Simon Josefsson  <jas@extundo.com>
2211
2212         * sha1.c: Use uint32_t instead of md5_uint32.t
2213
2214         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2215         md5.h.
2216
2217         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2218
2219         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2220
2221 2005-10-15  Simon Josefsson  <jas@extundo.com>
2222
2223         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2224
2225         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2226
2227 2005-10-14  Simon Josefsson  <jas@extundo.com>
2228
2229         * arcfour.h, arcfour.c: New files.
2230
2231 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2232
2233         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2234         include <wchar.h>; no longer needed.
2235
2236 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2237         and  Ulrich Drepper  <drepper@redhat.com>
2238
2239         Import from libc.
2240         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2241         instead of inline stream orientation test and two separate
2242         function calls.  Pay no attention to USE_IN_LIBIO.
2243
2244 2005-10-14  Roland McGrath  <roland@redhat.com>
2245
2246         Import from libc.  [BZ #1331]
2247         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2248         macro argument.
2249         Reported by Matej Vela <vela@debian.org>.
2250
2251 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2252
2253         * mkdir-p.c (make_dir_parents): Don't report an error if an
2254         intermediate directory is in a read-only file system.  Problem
2255         reported by Eric Blake.
2256
2257 2005-10-13  Simon Josefsson  <jas@extundo.com>
2258
2259         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2260         Move memory allocation outside of loop.
2261
2262 2005-10-12  Simon Josefsson  <jas@extundo.com>
2263
2264         * gc-pbkdf2-sha1.c: New file.
2265
2266         * gc.h: Add gc_pbkdf2_sha1 prototype.
2267
2268 2005-10-12  Simon Josefsson  <jas@extundo.com>
2269
2270         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2271         suggested by Bruno Haible <bruno@clisp.org>.
2272
2273 2005-10-12  Simon Josefsson  <jas@extundo.com>
2274
2275         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2276
2277         * gc-gnulib.c (gc_hmac_sha1): New function.
2278
2279 2005-10-12  Simon Josefsson  <jas@extundo.com>
2280
2281         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2282
2283 2005-10-12  Simon Josefsson  <jas@extundo.com>
2284
2285         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2286         GC_USE_HMAC_MD5, respectively.
2287
2288         * gc-libgcrypt.c (gc_md5): Fix assert call.
2289         (gc_md5): Fix typo.
2290
2291         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2292
2293         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2294
2295         * gc-gnulib.c (gc_hash_buffer): Ditto.
2296
2297 2005-10-11  Bruno Haible  <bruno@clisp.org>
2298
2299         * c-strcasestr.h: New file, from GNU gettext.
2300         * c-strcasestr.c: New file, from GNU gettext.
2301
2302 2005-10-11  Bruno Haible  <bruno@clisp.org>
2303
2304         * c-strcase.h: New file, from GNU gettext.
2305         * c-strcasecmp.c: New file, from GNU gettext.
2306         * c-strncasecmp.c: New file, from GNU gettext.
2307
2308 2005-10-11  Simon Josefsson  <jas@extundo.com>
2309
2310         * crc.h, crc.c: New files.
2311
2312         * gc.h (gc_hash_buffer): Add doc.
2313
2314 2005-10-08  Simon Josefsson  <jas@extundo.com>
2315
2316         * gc.h: Add gc_hash and gc_hash_buffer.
2317
2318         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2319
2320         * gc-libgcrypt.c (gc_hash_buffer): Add.
2321
2322 2005-10-11  Bruno Haible  <bruno@clisp.org>
2323
2324         * strcasecmp.c: Include limits.h.
2325         (strcasecmp): Avoid integer overflow on exotic platforms.
2326         * strncasecmp.c: Include limits.h.
2327         (strncasecmp): Avoid integer overflow on exotic platforms.
2328         Reported by Paul Eggert.
2329
2330 2005-10-06  Simon Josefsson  <jas@extundo.com>
2331
2332         * hmac-md5.c: New file.
2333
2334         * hmac.h: New file.
2335
2336 2005-10-06  Simon Josefsson  <jas@extundo.com>
2337
2338         * memxor.c (memxor): Avoid casts and warnings.
2339
2340 2005-10-05  Derek Price  <derek@ximbiot.com>
2341
2342         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2343
2344 2005-10-05  Simon Josefsson  <jas@extundo.com>
2345
2346         * memxor.c (memxor): Fix compiler error.
2347
2348         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2349         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2350
2351         * memxor.h, memxor.c: New files.
2352
2353         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2354         we assume all systems have it, suggested by Jim Meyering
2355         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2356         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2357         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2358         same reasons.
2359
2360 2005-10-04  Bruno Haible  <bruno@clisp.org>
2361
2362         * verify.h (verify_true): Provide alternative definition for C++.
2363
2364 2005-10-04  Simon Josefsson  <jas@extundo.com>
2365
2366         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2367         D. Baushke" <mdb@gnu.org>.
2368
2369 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2370
2371         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2372         (SSIZE_MAX): New macro, if not already defined.
2373         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2374         than 2 GiB.
2375
2376 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2377
2378         * exclude.c: Include verify.h.
2379         (verify): Remove.  All callers changed to use verify.h's version.
2380         * strtoimax.c: Likewise.
2381         * utimecmp.c: Likewis.e
2382
2383         Sync from coreutils.
2384         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2385         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2386         * .cvsignore: Add fts.h, search.h, t-fpending.
2387         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2388         bother returning ENOSYS if settimeofday or stime fails; just let
2389         them return whatever errno they want to return.
2390         * utimens.c: Include unistd.h, for dup2.
2391         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2392         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2393
2394 2005-10-02  Jim Meyering  <jim@meyering.net>
2395
2396         Sync from coreutils.
2397         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2398         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2399         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2400         Remove AT_FDCWD test.
2401         Do not consume the fd unless successful.
2402         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2403         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2404         block, so that we don't even try to compile it if settimeofday is
2405         available.  This works around a compilation failure on OSF1 V5.1,
2406         due to stime requiring a `long int*' while tv_sec is `int'.
2407
2408 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2409
2410         * getdelim.c (getdelim): Remove unused variables.
2411
2412 2005-10-01  Simon Josefsson  <jas@extundo.com>
2413
2414         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2415         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2416         AI_* and EAI_* definitions.  Protect function declarations.
2417
2418 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2419
2420         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2421         so that the code works even with ancient cpp.  Portability problem
2422         with GCC 2.7.2.1 reported by Thomas M.Ott.
2423
2424 2005-09-27  Jim Meyering  <jim@meyering.net>
2425
2426         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2427
2428         * intprops.h (signed_type_or_expr__): Define.
2429         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2430         for unsigned types.
2431
2432 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2433
2434         * verify.h (verify_expr): Remove, replacing with:
2435         (verify_true): New macro that returns true instead of void.
2436         (verify_type__): Remove.
2437         (verify): Use verify_true rather than verify_type__.
2438
2439 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2440
2441         * utimens.c (ENOSYS): Define if not already defined.
2442         (futimens): Support having a null PATH if the file descriptor
2443         is nonnegative.
2444
2445         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2446         Remove.
2447         (__attribute): Define to empty unless GCC 3.1 or later.
2448         This works around a core dump on OpenBSD 3.4, which has GCC
2449         2.95.3, which dumps core when given __attribute__(()).  It also
2450         simplifies other tests, since we really don't want to bother with
2451         worrying about which ancient version of GCC supported what.
2452         Original problem reported by Yoann Vandoorselaere, with part of
2453         the fix suggested by Derek Price.
2454
2455 2005-09-24  Jim Meyering  <jim@meyering.net>
2456
2457         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2458         so we can once again use a positive bitfield width of 1 -- now we
2459         don't have to explain why we were using a bitfield width of 2.
2460
2461 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2462
2463         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2464         Problem reported by Eric Blake.
2465         (getaddrinfo): Initialize se so that it's not garbage.
2466         Redo internal storage allocation so that it doesn't make unportable
2467         assumptions about alignment.
2468         Fix a memory leak.
2469
2470         * utimens.c (futimens): Use futimesat if available.
2471         Prefer it to futimes since it doesn't have the futimes bug.
2472
2473         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2474         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2475         Instead, declare a function that returns a pointer to an array,
2476         and use verify_type__ to declare the size of the array.
2477         Problem and germ of a solution reported by Bruno Haible.
2478         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2479         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2480
2481 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2482
2483         Sync from coreutils.
2484
2485         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2486         stat-time.h.
2487         * argmatch.h: Include verify.h
2488         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2489         (ARGMATCH_ASSERT): Remove; unused.
2490         * canonicalize.c: Assume STDC_HEADERS.
2491         * exclude.c: Include "strcase.h".
2492         * regex_internal.h [!defined _LIBC]: Likewise.
2493         * getusershell.c: Include stdio--.h rather than stdio.h
2494         and stdio-safer.h.
2495         (getusershell): Call fopen, not fopen_safer.
2496         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2497         Do not include unistd-safer.h.
2498         (save_cwd): Don't call fd_safer; no longer needed
2499         now that we include fcntl--.h.
2500
2501         * getdate.y (relative_time): New type.
2502         (RELATIVE_TIME_0): New constant.
2503         (parser_control): Use relative_time instead of doing it ourselves.
2504         (%union): Add new relative_time rel member.
2505         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2506         Now typeless.
2507         (relunit, relunit_snumber): Now of type rel.
2508         (zone, rel, relunit, get_date): Adjust to above changes.
2509
2510         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2511         Do not include unistd-safer.h.
2512         (getloadavg): Don't call fd_safer; no longer needed
2513         now that we include fcntl--.h.
2514
2515         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2516         (make_dir_parents): Treat ENOSYS like EEXIST.
2517
2518         Improve quality of diagnostics on restore_cwd failure.
2519         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2520         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2521         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2522         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2523         each time through the loop.  Do not diagnose restore_cwd failure;
2524         that is the caller's job (and perhaps the caller does not care).
2525
2526         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2527         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2528         If the file already exists but is not a directory, don't bother
2529         to try to make its parents.
2530         Close potential file descriptor leak if we can't chdir("/") (!).
2531         Don't always return true if chdir($PWD) fails; return true only
2532         if the requested action was done successfully (except for the
2533         chdir($PWD)).
2534         Don't log final directory unless we actually made it.
2535         Refactor to avoid duplicate code to fix up permissions.
2536         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2537
2538         * strftime.c (my_strftime): Rewrite the previous change slightly,
2539         to make it a bit faster and (I hope) clearer.
2540         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2541         Fix bug in formats like %2N.
2542
2543         * verify.h: New file.
2544
2545 2005-09-22  Jim Meyering  <jim@meyering.net>
2546
2547         Sync from coreutils.
2548
2549         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2550
2551         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2552         the .tm_year member, since otherwise gcc-4.0 would now warn about
2553         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2554
2555         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2556         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2557
2558         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2559         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2560         when run in a time zone for which daylight savings time is in effect
2561         for the starting date.
2562
2563         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2564         stop us from restricting permissions of just-created absolute-named
2565         directories.
2566         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2567         to restore initial working directory.
2568         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2569         to tell caller if/when we change the working directory and are
2570         unable to return to the initial one.
2571         * mkdir-p.h (make_dir_parents): Update prototype.
2572         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2573         `return false'.  This fixes a bug introduced on 2004-07-30.
2574
2575         * openat.c (fdopendir): Be sure to close the supplied
2576         file descriptor before returning.  This makes our replacement
2577         implementation a little closer to Solaris's, where fdopendir
2578         ties the file descriptor to the returned DIR* pointer.
2579         * openat.c (unlinkat): New function.
2580         * openat.h (unlinkat): Add prototype.
2581         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2582         (openat_restore_fail): Rename from openat_restore_die.
2583         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2584
2585         Provide an alternative to exiting immediately upon save_cwd or
2586         restore_cwd failure.  Now, an application can arrange e.g.,
2587         to perform a longjump in that case.
2588         * openat.c: Include dirname.h.
2589         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2590         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2591         and openat_restore_die rather than calling error directly.
2592         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2593
2594         * openat-die.c (openat_save_die, openat_restore_die): New file.
2595         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2596
2597         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2598         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2599                             int utc, int nanoseconds);
2600         Background:
2601         date should not have to allocate a megabyte of virtual memory to
2602         handle a format argument like +%1048575T.  When implemented with
2603         strftime, it must allocate such a buffer, use strftime to fill it
2604         in, print it, then free it.
2605         With fprintftime, it simply prints everything and exits.
2606         With no need for memory allocation, that's one fewer way to fail.
2607         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2608         optional field width, not before, so we accept %9:z, not %:9z.
2609         (my_strftime): Be sure to use L_('x') for literals.
2610
2611         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2612         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2613         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2614         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2615         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2616         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2617         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2618         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2619         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2620
2621         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2622         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2623         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2624         and don't include <sys/file.h>).
2625
2626 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2627
2628         Sync from coreutils.
2629
2630         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2631         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2632         [!LDAV_DONE]: Avoid unused variable warning.
2633
2634 2005-09-21  Bruno Haible  <bruno@clisp.org>
2635
2636         * unicodeio.h (unicode_to_mb): New declaration.
2637
2638 2005-09-20  Derek Price  <derek@ximbiot.com>
2639
2640         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2641
2642 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2643
2644         Use a consistent style for including <config.h>.
2645         * __fpending.c, acl.c, argmatch.c,
2646         argp-help.c, argp-parse.c,
2647         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2648         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2649         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2650         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2651         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2652         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2653         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2654         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2655         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2656         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2657         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2658         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2659         modechange.c, mountlist.c, open-safer.c, physmem.c,
2660         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2661         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2662         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2663         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2664         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2665         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2666         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2667         userspec.c, utimecmp.c, version-etc-fsf.c,
2668         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2669         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2670         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2671         Standardize inclusion of config.h.
2672         * __fpending.h, dirfd.h, getdate.h, human.h,
2673         inttostr.h:  Removed inclusion of config.h from header files.
2674         * inttostr.c:  Adjusted in-tree users.
2675         * timespec.h: Remove superfluous warning to include config.h.
2676         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2677         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2678         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2679         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2680
2681 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2682
2683         * stat-time.h: New file.
2684         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2685         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2686         in a different way.
2687         (timespec_cmp): New function.
2688         * utimecmp.c: Include stat-time.h.
2689         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2690         members exist, not on the obsolescent ST_MTIM_NSEC.
2691         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2692
2693 2005-09-15  Derek Price  <derek@ximbiot.com>
2694             Paul Eggert  <eggert@cs.ucla.edu>
2695
2696         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2697         changes, consolidating in...
2698         * regex_internal.h: ...this file.
2699
2700 2005-09-15  Derek Price  <derek@ximbiot.com>
2701
2702         * regex_internal.h: Blank `pure' for GNUC < 3.
2703         * regex_internal.c: Ditto, using this...
2704         (__GNUC_PREREQ): ...new macro.
2705         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2706         (__GNUC_PREREQ): ...this new macro.
2707
2708         * strstr.h: Include string.h. Define strstr as a macro here.
2709
2710 2005-09-13  Derek Price  <derek@ximbiot.com>
2711
2712         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2713         failure.
2714         Reported by Jim Meyering  <jim@meyering.net>.
2715
2716 2005-09-13  Jim Meyering  <jim@meyering.net>
2717
2718         * canon-host.c: Filter through gnu indent and reword comments slightly.
2719         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2720
2721 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2722
2723         * lib/base64.c: Typo.
2724         (base64_encode): Put b64str in initialized data section.
2725
2726 2005-09-12  Derek Price  <derek@ximbiot.com>
2727
2728         Return usable errors from canon-host.
2729         * canon-host.h: New file.
2730         * canon-host.c (canon_host): Wrap...
2731         (canon_host_r): ...this new function, which now relies exclusively on
2732         getaddrinfo.
2733         (ch_strerror): New function.
2734         (last_cherror): New global.
2735         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2736         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2737         void *.
2738         (freeaddrinfo): Free ai->ai_canonname when set.
2739
2740 2005-09-12  Derek Price  <derek@ximbiot.com>
2741             Paul Eggert  <eggert@cs.ucla.edu>
2742
2743         * glob-libc.h: Renamed from glob_.h.  The new version is
2744         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2745         protecting things that should be done only in gnulib contexts.
2746         * glob_.h: New file, containing only the glob things needed for
2747         gnulib.
2748         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2749         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2750         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2751         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2752         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2753         and to respect the namespace rules better.
2754
2755 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2756
2757         Merge glibc and coreutils changes into gnulib, plus a few
2758         extra fixes.
2759         * md5.c: Use #error rather than a string.
2760         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2761         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2762         (__attribute__): Define to empty for non recent-GCC.
2763         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2764         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2765         Renamed from their non-__ counterparts, with new macros replacing
2766         them if not _LIBC.  Add __THROW attribute.
2767         (rol): Remove.
2768         (struct md5_ctx): Align buffer if using GCC.
2769         * sha1.h (struct sha1_ctx): Likewise.
2770         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2771         The old name was backwards.
2772         (NOTSWAP): Remove; not used.
2773         (rol): New macro, moved here from md5.h.
2774         (sha1_process_block): Remove a FIXME that doesn't make sense.
2775
2776 2005-09-12  Derek Price  <derek@ximbiot.com>
2777
2778         * gai_strerror.c: Include config.h when available.  Include
2779         getaddrinfo.h before other headers to test interface.
2780         Reported by Larry Jones <lawrence.jones@ugs.com>.
2781
2782 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2783
2784         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2785         definitions, since that's the preferred style in glibc.
2786         Fix a minor spacing issue, and update copyright notice to match glibc's.
2787
2788 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2789
2790         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2791
2792 2005-09-06  Simon Josefsson  <jas@extundo.com>
2793
2794         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2795         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2796
2797 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2798
2799         Change bitset word type from unsigned int to unsigned long int,
2800         as this has better performance on typical 64-bit hosts.
2801         Port bitset code to hosts with unusual word sizes.
2802         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2803         (build_collating_symbol):
2804         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2805         argument is a bitset.  This is merely a style issue, but it makes
2806         it clearer that an entire array is expected.
2807         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2808         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2809         Port to the case where bitset_word is not the same as unsigned int.
2810         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2811         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2812         Likewise.
2813         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2814         (build_trtable, group_nodes_into_DFAstates):
2815         Likewise.
2816         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2817         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2818         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2819         * regexec.c (group_nodes_into_DFAstates): Likewise.
2820         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2821         * regcomp.c (optimize_subexps, lower_subexp):
2822         Work even if bitset_word has holes in its bitwise representation.
2823         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2824         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2825         Likewise.
2826         * regex_internal.c (re_string_reconstruct):
2827         Don't assume UCHAR_MAX == 255.
2828         * regex_internal.h (bitset_set_all): Likewise.
2829         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2830         All uses changed.
2831         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2832         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2833         All uses changed.
2834         (BITSET_WORD_MAX): New macro.
2835         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2836         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2837         (bitset_empty, bitset_copy):
2838         Prefer sizeof (bitset) to multiplying it out ourselves.
2839         (bitset_not_merge): Remove; unused.
2840         (bitset_contain): Return bool, not unsigned int with one bit on.
2841         All callers changed.
2842         * regexec.c (build_trtable): Don't assume bitset has no stricter
2843         alignment than re_node_set; do this by defining a new internal
2844         type struct dests_alloc and using it to allocate memory.
2845
2846 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2847
2848         Check for arithmetic overflow when calculating sizes, to prevent
2849         some buffer-overflow issues.  These patches are conservative, in the
2850         sense that when I couldn't determine whether an overflow was possible,
2851         I inserted a run-time check.
2852         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2853         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2854         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2855         (re_xnrealloc, re_x2nrealloc): New inline functions.
2856         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2857         (build_equiv_class, build_charclass): Check for arithmetic overflow
2858         in size expression calculations.
2859         * lib/regex_internal.c (re_string_realloc_buffers):
2860         (build_wcs_upper_buffer, re_node_set_add_intersect):
2861         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2862         (re_dfa_add_node, register_state): Likewise.
2863         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2864         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2865         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2866         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2867
2868 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2869
2870         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2871         to avoid a collision with bits/local_lim.h in glibc.
2872         All uses changed.  Problem reported by Dmitry V. Levin in
2873         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2874
2875         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2876         bugs in int versus size_t comparisons.
2877         (re_string_context_at): Fix bug where the code assumed that
2878         Idx is signed.
2879
2880         Use bool where appropriate.
2881         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2882         All callers changed.
2883         (calc_eclosure_iter): Likewise, for ROOT arg.
2884         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2885         (build_charclass_op): Likewise, for NON_MATCH arg.
2886         * regex_internal.c (re_string_allocate, re_string_construct):
2887         (re_string_construct_common): Likewise, for ICASE arg.
2888         * regexec.c (re_search_2_stub, re_search_stub):
2889         Likewise, for RET_LEN arg.
2890         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2891         (set_regs): Likewise, for FL_BACKTRACK arg.
2892         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2893         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2894         (calc_eclosure_iter, parse_bracket_exp):
2895         Use bool for internal variables that are booleans.
2896         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2897         (set_regs, build_sifted_states, sift_states_bkref):
2898         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2899         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2900         (find_collation_sequence_value):
2901         Likewise.
2902         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2903         (re_node_set_compare):
2904         Return bool, not int. All callers changed.
2905         * regexec.c (check_halt_node_context, check_dst_limits):
2906         (build_trtable, check_node_accept): Likewise.
2907         * regex_internal.h: Include stdbool.h.
2908
2909         Fix bugs uncovered when converting to bool.
2910         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2911         failure instead of charging ahead blindly.
2912         * regex_internal.c (register_state): Likewise.
2913         * regexec.c (re_search_2_stub): Use simpler method than boolean
2914         for freeing internal storage.
2915         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2916         bitset pieces used as boolean, to avoid undefined behavior
2917         on hosts that do int overflow checking.
2918
2919 2005-08-31  Derek Price  <derek@ximbiot.com>
2920
2921         * getdelim.c (getdelim): Return EOF on EOF.
2922         Reported by Larry Jones <lawrence.jones@ugs.com>.
2923
2924 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2925
2926         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2927         lengths fit in regoff_t; this isn't true if regoff_t is the same
2928         width as size_t.
2929         * regex.c (re_search_internal): 5th arg is LAST_START
2930         (= START + RANGE) instead of RANGE.  This avoids overflow
2931         problems when regoff_t is the same width as size_t.
2932         All callers changed.
2933         (re_search_2_stub): Check for overflow when adding the
2934         sizes of the two strings.
2935         (re_search_stub): Check for overflow when adding START
2936         to RANGE; if it occurs, substitute the extreme value.
2937
2938 2005-08-31  Jim Meyering  <jim@meyering.net>
2939
2940         * regcomp.c (search_duplicated_node): Make first pointer arg
2941         a pointer-to-const.
2942         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2943         (register_state): Likewise.
2944         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2945         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2946         (group_nodes_into_DFAstates): Likewise.
2947
2948 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2949
2950         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2951         old glibc regex code mishandles strings longer than 2**31 bytes.
2952         This patch fixes this when the regex code is used in gnulib
2953         (i.e., outside glibc).
2954
2955         This patch should not affect the use of the regex code inside
2956         glibc.  No doubt this problem also needs to be handled for glibc
2957         as well, but the result will be an incompatible change to the
2958         glibc ABI, and the old ABI will have to be supported too.  That
2959         can be the the subject for another patch.
2960
2961         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2962         governing whether the rest of this patch is active.  By default,
2963         the macro is disabled and the patch has no effect.
2964         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2965         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2966         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2967         (re_match_2, re_set_registers): Use the new types.
2968         * regex_internal.h (Idx, re_hashval_t): New types.
2969         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2970         New macros.
2971         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2972         (re_string_context_at, bin_tree_t, re_dfastate_t):
2973         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2974         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2975         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2976         (re_string_char_size_at, re_string_wchar_at):
2977         (re_string_elem_size_at):
2978         Use the new types and macros to port to 64-bit hosts.
2979         Use unsigned types for internal values, so that the code
2980         mostly works even for arrays larger than SSIZE_MAX.
2981         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2982         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2983         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2984         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2985         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2986         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2987         (calc_inveclosure, parse_dup_op, build_range_exp):
2988         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2989         (fetch_number, create_token_tree, mark_opt_subexp):
2990         Likewise.
2991         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2992         (create_cd_newstate, re_string_allocate, re_string_construct):
2993         (re_string_realloc_buffers, build_wcs_upper_buffer):
2994         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2995         (re_string_reconstruct, re_string_peek_byte_case):
2996         (re_string_fetch_byte_case, re_string_context_at):
2997         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2998         (re_node_set_init_copy, re_node_set_add_intersect):
2999         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3000         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3001         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3002         (re_acquire_state, re_acquire_state_context, register_state):
3003         Likewise.
3004         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3005         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3006         (re_search_internal, re_search_2_stub, re_search_stub)
3007         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3008         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3009         (update_cur_sifted_state, check_dst_limits):
3010         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3011         (check_subexp_limits, sift_states_bkref, merge_state_array):
3012         (check_subexp_matching_top, get_subexp, get_subexp_sub):
3013         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3014         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3015         (expand_bkref_cache, check_node_accept_bytes):
3016         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3017         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3018         (acquire_init_state_context, check_halt_node_context):
3019         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3020         (sift_states_backward, clean_state_log_if_needed):
3021         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3022         (find_recover_state, transit_state_sb, transit_state_mb):
3023         (transit_state_bkref, build_trtable, match_ctx_clean):
3024         Likewise.
3025         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3026         to work around an assumption that REG_MISSING is negative.
3027
3028         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3029         (seek_collating_symbol_entry) [defined _LIBC]:
3030         (lookup_collation_sequence_value) [defined _LIBC]:
3031         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3032         Use prototypes rather than old-style function definitions.
3033         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3034         (transit_state_sb) [0]:
3035         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3036
3037         * regexec.c (re_search_internal): Simplify update of rm_so and
3038         rm_eo.
3039
3040         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3041         (optimize_subexps, lower_subexp):
3042         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3043         since the signed shift might overflow.  Use 1u<<31 instead.
3044         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3045         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3046         Likewise.
3047
3048         * regcomp.c (optimize_subexps, lower_subexp):
3049         Use CHAR_BIT rather than 8, for clarity.
3050         * regexec.c (check_dst_limits_calc_pos_1):
3051         (check_subexp_matching_top): Likewise.
3052         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3053         have to worry about portability issues when shifting it left.
3054         Remove no-longer-needed test for table_size > 0.
3055         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3056         in a word, as the resulting behavior is undefined.
3057         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3058         in one case, a <= should have been an <, and in another case the
3059         whole test was missing.
3060         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3061         the standard name CHAR_BIT.
3062         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3063         this is not true on one's complement and signed-magnitude hosts.
3064
3065         * regex_internal.h (re_sub_match_top_t): Remove unused member
3066         next_last_offset.
3067         (struct re_dfa_t): Remove unused member states_alloc.
3068         * regcomp.c (init_dfa): Don't initialize unused members.
3069
3070 2005-08-31  Bruno Haible  <bruno@clisp.org>
3071
3072         * strstr.c: Include <stddef.h>, for NULL.
3073         * strcasestr.c: Likewise.
3074         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3075
3076 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3077
3078         * iconvme.h: Add prototype for iconv_alloc.
3079
3080 2005-08-29  Simon Josefsson  <jas@extundo.com>
3081
3082         * iconvme.c: Fix errno.
3083
3084 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3085
3086         * iconvme.c: Split iconv_string into iconv_alloc.
3087
3088 2005-08-27  Jim Meyering  <jim@meyering.net>
3089
3090         * fopen-safer.c: Merge minor changes from coreutils.
3091         * dup-safer.c: Likewise.
3092         * fd-safer.c: Likewise.
3093
3094         Merge from coreutils.
3095         * stdio--.h: New file.
3096         * stdlib--.h: New file.
3097         * mkstemp-safer.c: New file.
3098
3099         GNU tar needs these.
3100         * pipe-safer.c: New file.
3101         * creat-safer.c: New file.
3102         * fcntl--.h (creat): Define to creat_safer.
3103         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3104         * unistd--.h (pipe): Define to pipe_safer.
3105         * unistd-safer.h: Declare pipe_safer.
3106
3107 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3108
3109         * regex_internal.h: Remove all references to
3110         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3111         or better.
3112         (bitset_not, bitset_merge, bitset_not_merge):
3113         (bitset_mask, re_string_allocate, re_string_construct):
3114         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3115         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3116         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3117         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3118         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3119         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3120         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3121         (re_acquire_state_context):
3122         Remove unnecessary forward decls.
3123         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3124         Put __attribute at function definition,
3125         now that the function decl has been removed.
3126         * lib/regex_internal.c (re_string_peek_byte_case):
3127         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3128         Likewise.
3129
3130 2005-08-26  Simon Josefsson  <jas@extundo.com>
3131
3132         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3133         Haible <bruno@clisp.org>.
3134
3135 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3136
3137         * regexec.c (set_regs): Don't alloca with an unbounded size.
3138
3139         alloca modernization/simplification for regex.
3140         * regex.c: Remove portability cruft for alloca.  This no longer
3141         needs to be at the start of the file, and can be moved into
3142         regex_internal.h and simplified.
3143         * regex_internal.h: Include <alloca.h>.
3144         (__libc_use_alloca) [!defined _LIBC]: New macro.
3145         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3146         now works outside glibc.
3147
3148 2005-08-24  Simon Josefsson  <jas@extundo.com>
3149
3150         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3151         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3152         GLIBC specific code.
3153
3154 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3155
3156         Make regex safe for g++.  This fixes one real bug (an "err"
3157         that should have been "*err").  g++ problem reported by
3158         Sam Steingold.
3159         * regex_internal.h (re_calloc): New macro, consistent with
3160         re_malloc etc.  All callers of calloc changed to use re_calloc.
3161         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3162         not int.  All callers changed.
3163         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3164         just use an array of size MB_LEN_MAX.
3165         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3166         (find_recover_state): Change "err" to "*err"; this fixes what
3167         appears to be a real bug.
3168         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3169         versus int.
3170
3171 2005-08-25  Jim Meyering  <jim@meyering.net>
3172
3173         * open-safer.c: Include <config.h>.
3174         Otherwise, we'd lose LARGEFILE support in any file using
3175         e.g. "fcntl--.h"
3176
3177 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3178
3179         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3180         * regex.h (regerror): Likewise.
3181
3182         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3183         requires this.  (The code never needed it.)
3184
3185         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3186         All uses of recently-renamed identifiers changed to use the new,
3187         POSIX-compliant names.  The code will build and run just fine
3188         without these changes, but it's better to eat our own dog food
3189         and use the standard-conforming names.
3190
3191         * regex.h: Fix a multitude of POSIX name space violations.
3192         These changes have an effect only for programs that define
3193         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3194         do not change anything for programs compiled in the normal way.
3195         Also, there is no effect on the ABI.
3196
3197         (_REGEX_SOURCE): New macro.
3198         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3199         defined and _GNU_SOURCE is not; this fixes a name space violation.
3200
3201         Rename the following macros to obey POSIX requirements.
3202         The old names are still visible as macros if _REGEX_SOURCE is defined.
3203         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3204         RE_BACKSLASH_ESCAPE_IN_LISTS.
3205         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3206         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3207         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3208         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3209         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3210         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3211         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3212         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3213         (REG_INTERVALS): renamed from RE_INTERVALS.
3214         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3215         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3216         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3217         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3218         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3219         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3220         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3221         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3222         RE_UNMATCHED_RIGHT_PAREN_ORD.
3223         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3224         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3225         (REG_DEBUG): renamed from RE_DEBUG.
3226         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3227         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3228         unusual, since we can't clash with the POSIX REG_ICASE.
3229         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3230         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3231         (REG_NO_SUB): renamed from RE_NO_SUB.
3232         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3233         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3234         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3235         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3236         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3237         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3238         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3239         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3240         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3241         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3242         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3243         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3244         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3245         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3246         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3247         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3248         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3249         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3250         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3251         (REG_FIXED): Renamed from REGS_FIXED.
3252         (REG_NREGS): Renamed from RE_NREGS.
3253
3254         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3255         of other REG_* macros, since POSIX says the user is allowed to
3256         #undef these macros selectively.
3257
3258         (reg_errcode_t): Update comment stating what other tables need
3259         to be consistent.
3260
3261         Rename the following enum values to obey POSIX requirements.
3262         The old names are still visible as macros.
3263         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3264         is not defined, since GNU is supposed to be a superset of POSIX as
3265         much as possible, and since we want reg_errcode_t to be a signed
3266         type for implementation consistency.
3267         (_REG_NOERROR): Renamed from REG_NOERROR.
3268         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3269         (_REG_BADPAT): Renamed from REG_BADPAT.
3270         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3271         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3272         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3273         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3274         (_REG_EBRACK): Renamed from REG_EBRACK.
3275         (_REG_EPAREN): Renamed from REG_EPAREN.
3276         (_REG_EBRACE): Renamed from REG_EBRACE.
3277         (_REG_BADBR): Renamed from REG_BADBR.
3278         (_REG_ERANGE): Renamed from REG_ERANGE.
3279         (_REG_ESPACE): Renamed from REG_ESPACE.
3280         (_REG_BADRPT): Renamed from REG_BADRPT.
3281         (_REG_EEND): Renamed from REG_EEND.
3282         (_REG_ESIZE): Renamed from REG_ESIZE.
3283         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3284         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3285         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3286         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3287         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3288
3289         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3290         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3291         changed.  But support the old name if the new one is not defined
3292         and if _REGEX_SOURCE.
3293
3294         Change the following member names in struct re_pattern_buffer.
3295         The old names are still supported if !_REGEX_SOURCE.
3296         The new names are always supported, regardless of _REGEX_SOURCE.
3297         (re_buffer): Renamed from buffer.
3298         (re_allocated): Renamed from allocated.
3299         (re_used): Renamed from used.
3300         (re_syntax): Renamed from syntax.
3301         (re_fastmap): Renamed from fastmap.
3302         (re_translate): Renamed from translate.
3303         (re_can_be_null): Renamed from can_be_null.
3304         (re_regs_allocated): Renamed from regs_allocated.
3305         (re_fastmap_accurate): Renamed from fastmap_accurate.
3306         (re_no_sub): Renamed from no_sub.
3307         (re_not_bol): Renamed from not_bol.
3308         (re_not_eol): Renamed from not_eol.
3309         (re_newline_anchor): Renamed from newline_anchor.
3310
3311         Change the following member names in struct re_registers.
3312         The old names are still supported if !_REGEX_SOURCE.
3313         The new names are always supported, regardless of _REGEX_SOURCE.
3314         (rm_num_regs): Renamed from num_regs.
3315         (rm_start): Renamed from start.
3316         (rm_end): Renamed from end.
3317
3318         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3319         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3320         Prepend __ to parameter names.
3321
3322         Undo yesterday's changes.
3323
3324 2005-08-24  Jim Meyering  <jim@meyering.net>
3325
3326         Sync from coreutils.
3327         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3328
3329 2005-08-21  Bruno Haible  <bruno@clisp.org>
3330
3331         * lock.h: Add multiple inclusion guard.
3332         * tls.h: Add multiple inclusion guard.
3333
3334 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3335
3336         * regex.h (REG_NOSYS)
3337         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3338         Define, since POSIX requires it as of 2001.
3339         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3340         New private symbol, used to keep the enum signed in all cases.
3341         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3342         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3343
3344         * regex_internal.c (re_string_skip_chars, register_state):
3345         (calc_state_hash):
3346         Remove forward decls; no longer needed now that we use prototypes.
3347         * regexec.c (acquire_init_state_context, check_halt_node_context):
3348         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3349         (clean_state_log_if_needed): Likewise.
3350
3351 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3352
3353         Fix problems reported by Sam Steingold in
3354         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3355         * regexec.c (sift_states_bkref): Fix portability bug: the code
3356         assumed that reg_errcode_t is a signed type, which is not
3357         necessarily true if _XOPEN_SOURCE is not defined.
3358         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3359         some compilers warn about it otherwise.
3360
3361 2005-08-20  Jim Meyering  <jim@meyering.net>
3362
3363         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3364         of unused local, dfa.
3365
3366 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3367
3368         * regcomp.c (create_initial_state): Remove duplicate decl.
3369         (init_word_char, create_initial_state, duplicate_node_closure):
3370         (fetch_token, peek_token_bracket, build_range_exp):
3371         (build_collating_symbol): Remove forward decls; no longer needed
3372         now that we use prototypes.
3373
3374         * regcomp.c:
3375         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3376         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3377         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3378         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3379         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3380         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3381         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3382         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3383         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3384         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3385         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3386         (build_charclass, build_charclass_op, fetch_number, create_tree):
3387         (create_token_tree, mark_opt_subexp, duplicate_tree):
3388         Use prototypes rather than old-style definitions.
3389
3390         * regex_internal.c:
3391         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3392         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3393         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3394         (re_string_reconstruct, re_string_peek_byte_case):
3395         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3396         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3397         (re_node_set_init_copy, re_node_set_add_intersect):
3398         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3399         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3400         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3401         (re_acquire_state, re_acquire_state_context, register_state):
3402         (create_ci_newstate, create_cd_newstate, free_state):
3403         Likewise.
3404         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3405         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3406         (re_search_internal, prune_impossible_nodes):
3407         (acquire_init_state_context, check_matching, static):
3408         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3409         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3410         (update_regs, sift_states_backward, build_sifted_states):
3411         (clean_state_log_if_needed, merge_state_array):
3412         (update_cur_sifted_state, add_epsilon_src_nodes):
3413         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3414         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3415         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3416         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3417         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3418         (check_arrival, check_arrival_add_next_nodes):
3419         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3420         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3421         (check_node_accept_bytes, check_node_accept, extend_buffers):
3422         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3423         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3424         (sift_ctx_init):
3425         Likewise.
3426
3427         * regex_internal.h:
3428         (re_string_allocate, re_string_construct, re_string_reconstruct):
3429         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3430         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3431         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3432         (re_string_context_at, re_string_peek_byte_case):
3433         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3434         is defined, since we now use prototypes always.
3435
3436         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3437         C89 or better.  All uses removed.
3438
3439 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3440
3441         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3442         [defined lint]: Suppress bogus uninitialized-variable warnings.
3443
3444         * regcomp.c (duplicate_node): Return new index, not an error code,
3445         and let the caller return REG_ESPACE if out of space.  This
3446         removes an uninitialied-variable warning with GCC 4.0.1, and also
3447         avoids taking the address of a local variable.  All callers
3448         changed.
3449
3450 2005-08-19  Jim Meyering  <jim@meyering.net>
3451
3452         * regexec.c (proceed_next_node): Redo local variables to
3453         avoid GCC shadowing warnings.
3454
3455 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3456
3457         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3458         (re_node_set_insert_last, re_dfa_add_node):
3459         Rename local variables to avoid GCC shadowing warnings.
3460
3461 2005-08-18  Bruno Haible  <bruno@clisp.org>
3462
3463         * strstr.c (strstr): Fix return value in multibyte case.
3464         * strcasestr.c (strcasestr): Likewise.
3465
3466 2005-08-17  Jim Meyering  <jim@meyering.net>
3467
3468         Make the %s format (seconds since the epoch) work for a negative
3469         number and when used with a zero-padded field width, e.g. %015s.
3470
3471         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3472         label so that it precedes the code to set `digits'.  Otherwise,
3473         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3474         print `00-22'.  Now, it prints `-0022', as it should.
3475
3476 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3477
3478         * regex.h: Remove useless space-before-tab.  From coreutils.
3479
3480 2005-08-17  Bruno Haible  <bruno@clisp.org>
3481
3482         * strcasestr.h: New file.
3483         * strcasestr.c: New file.
3484
3485 2005-08-17  Bruno Haible  <bruno@clisp.org>
3486
3487         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3488         * strstr.c: Completely rewritten, with multibyte locale support.
3489
3490 2005-08-17  Bruno Haible  <bruno@clisp.org>
3491
3492         * strcasecmp.c: Use mbuiter.h.
3493
3494 2005-08-17  Bruno Haible  <bruno@clisp.org>
3495
3496         * mbuiter.h: New file.
3497
3498 2005-08-16  Bruno Haible  <bruno@clisp.org>
3499
3500         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3501         (mbi_init): Update.
3502         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3503         NUL byte, not after it.
3504
3505 2005-08-16  Bruno Haible  <bruno@clisp.org>
3506
3507         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3508         the valid ones. Makes the comparison operations transitive:
3509         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3510         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3511
3512 2005-08-16  Bruno Haible  <bruno@clisp.org>
3513
3514         * strcase.h (strcasecmp): Add note in comments.
3515         * strncasecmp.c: Use code from strcasecmp.c.
3516         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3517         (strcasecmp): Work correctly in multibyte locales.
3518
3519 2005-08-16  Bruno Haible  <bruno@clisp.org>
3520
3521         * strnlen1.h: New file.
3522         * strnlen1.c: New file.
3523
3524 2005-08-16  Bruno Haible  <bruno@clisp.org>
3525
3526         * mbfile.h: New file.
3527
3528 2005-08-16  Bruno Haible  <bruno@clisp.org>
3529
3530         * mbiter.h: New file.
3531
3532 2005-08-16  Bruno Haible  <bruno@clisp.org>
3533
3534         * mbchar.h: New file.
3535         * mbchar.c: New file.
3536
3537 2005-08-16  Bruno Haible  <bruno@clisp.org>
3538
3539         * tls.h: New file, from GNU gettext.
3540         * tls.c: New file, from GNU gettext.
3541
3542 2005-08-15  Bruno Haible  <bruno@clisp.org>
3543
3544         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3545         is defined.
3546
3547 2005-08-14  Jim Meyering  <jim@meyering.net>
3548
3549         Sync from coreutils.
3550
3551         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3552         Use the hash-table-based cycle-detection code not just when
3553         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3554         Reported by James Youngman in
3555         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3556         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3557         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3558         This lets us compile with -DFTS_DEBUG, once again.
3559         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3560         * fts.c (fd_safer): Remove decl.
3561         Include fcntl--.h rather than unistd-safer.h
3562         (fts_safe_changedir): Don't call fd_safer; no longer needed
3563         now that we include fcntl--.h.
3564
3565 2005-08-11  Simon Josefsson  <jas@extundo.com>
3566
3567         * readline.h, readline.c: New file.
3568
3569 2005-08-11  Bruno Haible  <bruno@clisp.org>
3570
3571         * strnlen.h (strnlen): Change parameter name to match comment.
3572
3573 2005-08-10  Simon Josefsson  <jas@extundo.com>
3574
3575         * strndup.c: Use strnlen.h.
3576
3577         * strnlen.h: New file.
3578
3579 2005-08-02  Simon Josefsson  <jas@extundo.com>
3580
3581         * getline.h, getline.c: Rewrite.
3582
3583         * getdelim.h, getdelim.c: New files, ported from glibc.
3584
3585 2005-07-31  Bruno Haible  <bruno@clisp.org>
3586
3587         * lock.h (gl_lock_initializer): New macro.
3588         (gl_lock_define_initialized): Use it.
3589         (gl_rwlock_initializer): New macro.
3590         (gl_rwlock_define_initialized): Use it.
3591         (gl_recursive_lock_initializer): New macro.
3592         (gl_recursive_lock_define_initialized): Use it.
3593
3594 2005-07-26  Bruno Haible  <bruno@clisp.org>
3595
3596         * lock.h: Update from GNU gettext.
3597         * lock.c: Update from GNU gettext.
3598
3599 2005-07-18  Bruno Haible  <bruno@clisp.org>
3600
3601         * lock.h (gl_once_t): New type.
3602         (gl_once_define, gl_once): New macros.
3603         * lock.c (fresh_once): New variable.
3604         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3605         functions.
3606
3607 2005-07-18  Simon Josefsson  <jas@extundo.com>
3608
3609         * check-version.c (check_version): Accept identical versions too.
3610
3611 2005-07-18  Bruno Haible  <bruno@clisp.org>
3612
3613         * lock.h: New file, from GNU gettext.
3614         * lock.c: New file, from GNU gettext.
3615
3616 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3617
3618         * quotearg.c: Add translator comment suggested by Bruno Haible,
3619         with a minor change.
3620
3621 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3622
3623         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3624         copyright symbol and the year.
3625         * version-etc.c (COPYRIGHT_YEAR): New constant.
3626         (version_etc_va): Use parameterized copyright notice.
3627         Reword to conform to the current GNU coding standards.
3628
3629 2005-07-11  Simon Josefsson  <jas@extundo.com>
3630
3631         * size_max.h: New file.
3632
3633 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3634
3635         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3636         block of defines.
3637
3638 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3639        and  Paul Eggert  <eggert@cs.ucla.edu>
3640
3641         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3642         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3643
3644 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3645
3646         * regex.c, regex.h: Sync from libc.
3647         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3648         New files, synced from libc, except that regex_internal.h
3649         currently has a small porting fix.
3650
3651 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3652
3653         Remove the dependency of the strftime module on the tzset module.
3654         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3655         Copy the input structure, to work around some of the bug with
3656         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3657         Solaris releases, you should also use the tzset module, but we won't
3658         require it as a dependency any more since we don't want LGPLed code
3659         to depend on GPLed code.
3660
3661 2005-07-02  Jim Meyering  <jim@meyering.net>
3662
3663         * backupfile.c (backup_args): Change a `0' to NULL.
3664
3665 2005-07-01  Jim Meyering  <jim@meyering.net>
3666
3667         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3668         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3669         * save-cwd.c, tempname.c:
3670         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3671         and don't include <sys/file.h>).
3672
3673 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3674
3675         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3676         declares only 'struct timespec;' (!).
3677
3678 2005-06-29  Jim Meyering  <jim@meyering.net>
3679
3680         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3681         type name.  Use the variable name instead.
3682         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3683
3684 2005-06-28  Simon Josefsson  <jas@extundo.com>
3685
3686         * check-version.h, check-version.c: New files.
3687
3688 2005-06-28  Simon Josefsson  <jas@extundo.com>
3689
3690         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3691         collision with global variable.  Better indentation.  Don't
3692         increment buffer pointer beyond buffer end.  Based on comments
3693         from Paul Eggert <eggert@cs.ucla.edu>.
3694
3695         * base64.h: Indent.
3696
3697 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3698
3699         * canon-host.c (canon-host): Append trailing "," to 0 in
3700         initializer of struct addrinfo, as an indication that we don't
3701         care how many members the structure has.
3702
3703 2005-06-24  Derek Price  <derek@ximbiot.com>
3704         and Bruno Haible  <bruno@clisp.org>
3705
3706         Remove stat module & update lstat.
3707         * stat.c: Remove this file...
3708         (slash_aware_lstat): ...moving this content and its support...
3709         * lstat.c (rpl_lstat): ...into here.
3710         * lstat.h: New file.
3711
3712 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3713
3714         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3715         (ranged_convert): Don't save conversion in a temporary struct.
3716         This causes a warning with GCC 4.0.0, and anyway in the typical
3717         case it's not worth the extra 100 bytes or so of code.
3718         (ranged_convert, __mktime_internal): When calling a function via a
3719         pointer P, use P () rather than (*P) (), as we now assume C89 or
3720         better.
3721
3722 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3723
3724         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3725         "who -r" failed to give output.  Problem reported by Tim Waugh.
3726
3727         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3728         (xcalloc): Use it to avoid needless tests.
3729         Problem reported by Jim Meyering.
3730
3731 2005-06-16  Jim Meyering  <jim@meyering.net>
3732
3733         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3734         when either N or S is zero.
3735
3736 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3737
3738         * argp.h (__option_is_short): Check upper limit of
3739         __key. Isprint() requires its argument to have the value
3740         of an unsigned char or EOF.
3741
3742 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3743
3744         * fnmatch.c (fnmatch): If there is an encoding error in a
3745         multibyte string or pattern, fall back on unibyte matching.
3746         Problem reported by James Youngman.
3747
3748 2005-06-08  Bruno Haible  <bruno@clisp.org>
3749
3750         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3751         warning on mingw.
3752
3753 2005-06-08  Bruno Haible  <bruno@clisp.org>
3754
3755         * csharpcomp.h: New file, from GNU gettext.
3756         * csharpcomp.c: New file, from GNU gettext.
3757         * csharpcomp.sh.in: New file, from GNU gettext.
3758
3759 2005-06-07  Derek Price  <derek@ximbiot.com>
3760
3761         Sync from CVS.
3762         * glob_.h: Indent nested #ifdef.
3763
3764 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3765
3766         Sync from coreutils.
3767         Use "file name" when talking about file names, instead of "filename"
3768         or "path", as per the GNU coding standards.
3769         * mkdir-p.c: Renamed from makepath.c.
3770         (make_dir_parents): Renamed from make_path.  All callers changed.
3771         * mkdir-p.h: Likewise.  All includers changed.
3772         * filenamecat.c: Renamed from path-concat.c.
3773         (file_name_concat): Renamed from path_concat.  All callers changed.
3774         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3775         * filenamecat.h: Likewise.  All includers changed.
3776         * acl.c: Don't use "path" or "filename" to mean "file name"
3777         in comments or local variable names.
3778         * basename.c: Likewise.
3779         * canonicalize.c, canonicalize.h: Likewise.
3780         * dirname.c, dirname.h: Likewise.
3781         * euidaccess.c: Likewise.
3782         * exclude.c: Likewise
3783         * fnmatch_.h, fnmatch_loop.c: Likewise.
3784         * fsusage.c, fsuage.h: Likewise.
3785         * fts.c, fts_.h: Likewise.
3786         * getcwd.c: Likewise.
3787         * getloadavg.c: Likewise.
3788         * mkstemp.c: Likewise.
3789         * mountlist.c, mountlist.h: Likewise.
3790         * openat.c, openat.h: Likewise.
3791         * readlink-stub.c: Likewise.
3792         * readutmp.c, readutmp.h: Likewise.
3793         * rename.c: Likewise.
3794         * rmdir.c: Likewise.
3795         * same.c: Likewise.
3796         * savedir.c: Likewise.
3797         * stripslash.c: Likewise.
3798         * tempname.c: Likewise.
3799         * xreadlink.c: Likewise.
3800         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3801         All uses changed.
3802         * exclude.h: Likewise.
3803
3804         * euidaccess.c (getuid, getgid, getuid, getegid)
3805         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3806         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3807         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3808         * pathmax.h: Include <limits.h> unconditionally, since other
3809         files have been getting away with it for years (MORE/BSD 4.3
3810         is extinct now).
3811         * userspec.c (getpwnam, getgrnam, getgrgid)
3812         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3813
3814         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3815         Define to 256, not 255, as per modern POSIX.
3816
3817 2005-06-01  Bruno Haible  <bruno@clisp.org>
3818
3819         * csharpexec.h: New file, from GNU gettext.
3820         * csharpexec.c: New file, from GNU gettext.
3821         * csharpexec.sh.in: New file, from GNU gettext.
3822
3823 2005-05-31  Derek Price  <derek@ximbiot.com>
3824             Paul Eggert  <eggert@cs.ucla.edu>
3825
3826         Sync from cvs.
3827         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3828
3829 2005-05-29  Derek Price  <derek@ximbiot.com>
3830             Paul Eggert  <eggert@cs.ucla.edu>
3831
3832         * glob_.h, glob.c: New files.
3833
3834 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3835
3836         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3837
3838         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3839         the configuration hassle isn't worth it.
3840         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3841         (LONGEST_MODIFIER, PRIuMAX): Remove.
3842
3843 2005-05-27  Bruno Haible  <bruno@clisp.org>
3844
3845         * getlogin_r.h: Remove second include of <stddef.h>.
3846
3847 2005-05-25  Bruno Haible  <bruno@clisp.org>
3848             Derek Price  <derek@ximbiot.com>
3849
3850         * getlogin_r.h: Simplify API documentation.
3851
3852 2005-05-25  Derek Price  <derek@ximbiot.com>
3853             Paul Eggert  <eggert@cs.ucla.edu>
3854
3855         * getlogin_r.c, getlogin_r.h: New files.
3856
3857 2005-05-22  Bruno Haible  <bruno@clisp.org>
3858
3859         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3860         Also include <sys/param.h> if it defines MIN, MAX.
3861         Based on a patch by Derek Price <derek@ximbiot.com>.
3862
3863 2005-05-22  Bruno Haible  <bruno@clisp.org>
3864
3865         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3866         (INT64_MIN): Fix definition.
3867         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3868
3869         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3870         NEED_SIGNED_INT_TYPES.
3871
3872         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3873         HAVE_SYSTEM_INTTYPES.
3874
3875 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3876
3877         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3878         so that unistd-safer.h (GPL'ed code) need not be included.
3879
3880 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3881
3882         New fts module.
3883         * fts.c: Don't include "cycle-check.h" or "hash.h".
3884         (setup_dir, free_dir): New functions.
3885         (enter_dir, leave_dir): Define trivial
3886         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3887         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3888         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3889         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3890         Move to fts-cycle.c.
3891         (fts_open): Use setup_dir.
3892         (fts_close): Use free_dir.
3893         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3894         This adds a label and some gotos, but the alternatives were messier.
3895         Check for memory allocation failure when entering a dir.
3896         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3897         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3898         (FTS): New member fts_cycle, that is a union that contains the
3899         old active_dir_ht and cycle_state.  All uses changed to mention
3900         fts_cycle.ht and fts_cycle.state.
3901         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3902         fts.c, with the following changes:
3903         (setup_dir, free_dir): New functions.
3904         (enter_dir): Now returns bool.  Return true if successful, false
3905         if memory exhausted.  All callers changed.
3906         Do not bother partly cleaning up on
3907         memory allocation failure; that is free_dir's job.
3908         However, free ad if hash_insert fails, to avoid memory leak.
3909         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3910         fts->fts_options to see which union member to use.
3911
3912 2005-05-20  Jim Meyering  <jim@meyering.net>
3913
3914         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3915         Now a macro, to pacify GCC.
3916
3917 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3918
3919         * chown.c (rpl_chown): Return -1 on failure.
3920
3921 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3922
3923         * canonicalize.c: Include canonicalize.h first, to test interface.
3924         Include <stddef.h> unconditionally, since we assume C89 now.
3925         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3926         * fts.c: Include fts_.h first, to check interface.
3927         Do not include intprops.h; no longer needed.
3928         Include cycle-check.h and hash.h, since fts_.h no longer does.
3929         Remove unnecessary casts of closedir to void.
3930         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3931         decide whether to decrement nlinks.
3932         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3933         (FTS): Use struct hash_table * instead of Hash_table, so that
3934         we no longer need to include hash.h here.
3935
3936 2005-05-17  Jim Meyering  <jim@meyering.net>
3937
3938         * fts.c, fts_.h: New files, from coreutils.
3939
3940 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3941
3942         Sync from coreutils.
3943         * unlinkdir.c, unlinkdir.h: New files.
3944         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3945         regex.h, unlocked-io.h, xtime.h:
3946         White space changes only.
3947         * makepath.c (make_path): Port to hosts where leading "//" is special.
3948         * yesno.c: Include getline.h, not ctype.h.
3949         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3950         Use getline to remove arbitrary restriction on response length.
3951
3952 2005-05-13  Bruno Haible  <bruno@clisp.org>
3953
3954         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3955         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3956         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3957         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3958         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3959         Add support for 64-bit integers in the MSVC compiler.
3960
3961 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3962
3963         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3964         Change the initial comment to refer to GPL, not LGPL.
3965         gnulib-tool will change it to LGPL as needed.
3966
3967         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3968         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3969         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3970         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3971         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3972         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3973         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3974         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3975         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3976         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3977         concatpath.c, config.charset, copy-file.c, copy-file.h,
3978         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3979         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3980         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3981         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3982         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3983         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3984         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3985         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3986         full-read.c, full-read.h, full-write.c, full-write.h,
3987         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3988         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3989         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3990         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3991         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3992         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3993         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3994         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3995         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3996         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3997         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3998         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3999         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4000         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4001         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4002         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4003         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4004         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4005         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4006         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4007         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4008         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4009         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4010         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4011         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4012         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4013         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4014         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4015         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4016         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4017         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4018         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4019         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4020         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4021         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4022         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4023         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4024         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4025         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4026         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4027         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4028         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4029         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4030         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4031         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4032         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4033         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4034         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4035         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4036         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4037         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4038         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4039         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4040         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4041         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4042         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4043         Update FSF postal mail address.
4044
4045 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4046
4047         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4048         specified in ai_socktype. Fix invalid ai_protocol
4049         check. ai_protocol is usually set to 0 or depending on
4050         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4051         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4052         ai_socktype / ai_protocol in the returned addrinfo structure.
4053
4054 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4055             Bruno Haible  <bruno@clisp.org>
4056
4057         * inet_ntop.h: New file.
4058         * inet_ntop.c: New file, from glibc with modifications.
4059
4060 2005-05-08  Jim Meyering  <jim@meyering.net>
4061
4062         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4063
4064 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4065
4066         Merge from coreutils.  Among other things,
4067         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4068         * fd-safer.c: New file.
4069         * fcntl-safer.h, open-safer.c: Remove.
4070         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4071         * dup-safer.c: Include unistd-safer.h first.
4072         Don't include errno.h.
4073         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4074         * file-type.h: Don't assume invoker included sys/stat.h first.
4075         * file-type.c: Rely on file-type.h change.
4076         * getloadavg.c: Include unistd-safer.h.
4077         (getloadavg): Use safer open.
4078         * getusershell.c: Include "stdio-safer.h".
4079         (getusershell): Use safer fopen.
4080         * long-options.c (long_options): Use NULL rather than 0.
4081         * modechange.h (mode_free): Remove; all callers changed to invoke
4082         'free'.
4083         * modechange.c: Likewise.
4084         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4085         (MODE_DONE): New constant.
4086         (struct mode_change): Remove 'next' member.
4087         (make_node_op_equals): New function; like the old one of the
4088         same name, except it allocates an array.
4089         (mode_compile, mode_create_from_ref): Use it.
4090         (mode_compile): Allocate result as an array, not a linked list.
4091         Parse octal string ourself, so that we catch mistakes like "+0".
4092         (mode_adjust): Arg is an array, not a linked list.
4093         * modechange.c: Include stat-macros.h, xalloc.h.
4094         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4095         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4096         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4097         Remove.  This is now stat-macros.h's job.
4098         (talloc): Remove.  All callers replaced by xalloc, so that
4099         our invokers don't have to worry about reporting memory failures.
4100         (make_node_op_equals): Remove.
4101         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4102         New constants.
4103         (struct mode_change): Moved here from modechange.h.
4104         (mode_append_entry): Remove.
4105         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4106         apps to have incorrect behavior.  Use simpler algorithm for head
4107         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4108         Detect more invalid usages rather than having somewhat-random behavior.
4109         Don't insert an "a=" action, as that leads to incorrect behavior.
4110         (mode_compile, mode_create_from_ref): Return NULL on error instead
4111         of an enum, since now there's only one way to have an error.  All
4112         callers changed.
4113         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4114         at the correct time.  Simplify calculation of "+u" and its ilk.
4115         Don't mishandle "+X".
4116         (mode_free): Remove "register" and localize decls.
4117         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4118         (struct mode_change): Move to modechange.c; callers don't
4119         need to see this stuff.
4120         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4121         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4122         (mode_change, mode_adjust): Reflect the new signatures noted above.
4123         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4124         that might redefine system include files.
4125         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4126         (my_usleep): Use NULL rather than (void *) 0.
4127         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4128         Use siginterrupt to specify that system calls should be interrupted.
4129         (rpl_nanosleep): Move initialization of suspended closer to call of
4130         my_usleep.
4131         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4132         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4133         (desirable_utmp_entry): New function.
4134         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4135         using x2nrealloc, to simplify logic.
4136         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4137         size calculation.  Do not assume utmp file is a regular file.
4138         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4139         (READ_UTMP_CHECK_PIDS): New constant.
4140         * save-cwd.c: Include unistd-safer.h.
4141         (save_cwd): Use fd_safer.
4142         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4143         [!_LIBC] Include "stat-macros.h" instead.
4144         * unistd-safer.h (fd_safer): New decl.
4145
4146 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4147
4148         * byteswap_.h: New file.
4149
4150 2005-04-25  Albert Chin  <china@thewrittenword.com>
4151
4152         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4153         Toolkit C bug.
4154
4155 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4156
4157         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4158         that "UTC +1 second" continues to work.  Problem reported
4159         by Dmitry V. Levin.
4160         (relunit_snumber): New rule.
4161         (relunit): Use it.
4162
4163 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4164
4165         * getdate.y (universal_time_zone_table): New constant.
4166         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4167         universal_time_zone_table.
4168         (lookup_zone): Prefer universal_time_zone_table to
4169         local_time_zone_table, so that "GMT" time stamps are allowed in
4170         London during the summer.  Problem reported by Ian Abbott.
4171
4172 2005-04-12  Jim Meyering  <jim@meyering.net>
4173
4174         * human.c (humblock): Set *options even when returning due to
4175         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4176         warning from gcc-4.
4177
4178 2005-04-09  Jim Meyering  <jim@meyering.net>
4179
4180         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4181         -Wuninitialized: initialize tm0.tm_year.
4182
4183 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4184
4185         * getdate.y (parser_control): rels_seen is now a boolean, not a
4186         count, since there's no maximum.  All uses changed.
4187         Add member dsts_seen.
4188         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4189         not being INT_MAX.
4190         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4191         Use pc_rels_seen to decide whther a date is absolute.
4192
4193         * getdate.y (number): Don't overwrite year.
4194         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4195         check.
4196
4197 2005-04-02  Simon Josefsson  <jas@extundo.com>
4198
4199         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4200         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4201
4202 2005-03-27  Jim Meyering  <jim@meyering.net>
4203
4204         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4205
4206 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4207
4208         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4209         "one's complement" -> "ones' complement" in comment, as per Knuth.
4210         "value of type" -> "type or expression" in comment.
4211         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4212
4213 2005-03-26  Jim Meyering  <jim@meyering.net>
4214
4215         Comment nits.
4216         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4217         Correct typos: s/or/of/.
4218
4219 2005-03-23  Jim Meyering  <jim@meyering.net>
4220
4221         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4222
4223 2005-03-21  Jim Meyering  <jim@meyering.net>
4224
4225         Changes imported from coreutils.
4226
4227         * cycle-check.c: Don't include xalloc.h.
4228
4229         * path-concat.c: Don't include assert.h.
4230         (path_concat): Remove assertion that would have triggered
4231         for ABASE starting with more than one slash.
4232         Reported by Andreas Schwab.
4233
4234         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4235         properly when ABASE is an absolute file name.
4236         Correct the description of this function.
4237         Include <assert.h>.
4238         Add an assertion and a test driver.
4239         This fixes a bug introduced on 2004-07-02.
4240         Andreas Schwab reported the resulting failure of cp --parents:
4241         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4242
4243 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4244
4245         * strftime.c (my_strftime): If the underlying strftime returns 0
4246         (which shouldn't happen), generate nothing instead of returning 0
4247         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4248
4249 2005-03-16  Bruno Haible  <bruno@clisp.org>
4250
4251         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4252
4253 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4254
4255         * strftime.c (my_strftime): Prepend space to format so that we can
4256         reliably distinguish strftime failure from empty output on POSIX
4257         hosts.
4258
4259 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4260
4261         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4262         (iconv_string): Don't guess a size-zero buffer, as that might cause
4263         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4264         result would be 'too large', where 'too large' is (heuristically)
4265         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4266         overflow concerns.  This will prevent some unwanted malloc failures
4267         when the inputs are very large.
4268
4269 2005-03-15  Bruno Haible  <bruno@clisp.org>
4270
4271         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4272         'negate'.
4273
4274         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4275         variable.
4276
4277         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4278
4279 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4280
4281         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4282         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4283         intprops.h.
4284         * strtol.c: Likewise.
4285
4286 2005-03-14  Simon Josefsson  <jas@extundo.com>
4287
4288         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4289         <fx@gnu.org>.
4290
4291 2005-03-14  Jim Meyering  <jim@meyering.net>
4292
4293         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4294         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4295         to be nonzero so that we (and caller) can detect the difference
4296         between a valid zero-length expansion and an error return, even
4297         when the underlying strftime fails before writing anything into
4298         that location.
4299
4300 2005-03-10  Jim Meyering  <jim@meyering.net>
4301
4302         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4303         so that this module works on systems without fchdir.
4304
4305 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4306
4307         Factor int-properties macros into a single file, except for
4308         glibc-related files.
4309         * intprops.h: New file.
4310         * getloadavg.c: Include it instead of limits.h.
4311         (INT_STRLEN_BOUND): Remove.
4312         * human.c: Include intprops.h.
4313         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4314         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4315         * inttostr.h: Include intprops.h instead of limits.h.
4316         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4317         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4318         for consistency with intprops.h.
4319         (time_t_is_integer, twos_complement_arithmetic): Use them.
4320         * sig2str.h: Include <signal.h>, intprops.h.
4321         (INT_STRLEN_BOUND): Remove.
4322         * strftime.c (TYPE_SIGNED): Remove.
4323         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4324         * strtol.c: Adjust comments to match intprops.h.
4325         * userspec.c: Include intprops.h.
4326         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4327         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4328         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4329         instead of rolling our own expressions.
4330         * xstrtol.c: Include xstrtol.h first, to test interface.
4331
4332         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4333         instead of int.
4334         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4335         the right thing even if adding 1900 would overflow.  Similarly
4336         for tm_mon + 1 and tm_yday + 1.
4337         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4338         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4339         (DO_SIGNED_NUMBER): New macro.
4340         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4341
4342 2005-03-07  Bruno Haible  <bruno@clisp.org>
4343
4344         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4345
4346 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4347             Bruno Haible  <bruno@clisp.org>
4348
4349         * pagealign_alloc.h: New file.
4350         * pagealign_alloc.c: New file.
4351
4352 2005-01-28  Bruno Haible  <bruno@clisp.org>
4353
4354         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4355         stpncpy.c uses it.
4356
4357 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4358
4359         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4360         The workaround isn't strictly needed for POSIX conformance, and
4361         it's too much of a pain to configure and maintain.  We'll ask
4362         people to fix their kernels instead.
4363         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4364         (NANOSLEEP_BUG_WORKAROUND): Remove.
4365         (xnanosleep): Remove the workaround.
4366
4367 2005-02-12  Bruno Haible  <bruno@clisp.org>
4368
4369         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4370
4371 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4372
4373         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4374         * timespec.h (gettime): Return void, since it always
4375         succeeds now.  All uses changed.
4376         * gettime.c (gettime) Likewise.
4377         [HAVE_NANOTIME]: Prefer nanotime.
4378         Assume gettimeofday succeeds, as POSIX requires.
4379         Assime time () succeeds, since other code already does.
4380         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4381         (timespec_subtract): Remove.
4382         (NANOSLEEP_BUG_WORKAROUND): New constant.
4383         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4384         things considerably.  Use it only on GNU/Linux hosts, since the
4385         workaround shouldn't be needed elsewhere.
4386
4387 2005-02-24  Bruno Haible  <bruno@clisp.org>
4388
4389         * gettext.h: Update from GNU gettext 0.14.2.
4390
4391 2005-02-24  Bruno Haible  <bruno@clisp.org>
4392
4393         * localcharset.c: Update from GNU gettext 0.14.2.
4394         * config.charset: Update from GNU gettext 0.14.2.
4395
4396 2005-02-22  Simon Josefsson  <jas@extundo.com>
4397
4398         * iconvme.h, iconvme.c: New files, from libc.
4399
4400 2005-02-20  Neil Conway  <neilc@samurai.com>
4401
4402         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4403         returned by OSX/Darwin if the specified buffer is not large
4404         enough for the hostname.
4405
4406 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4407
4408         * memrchr.h: New file.
4409         * chdir-long.c: Include it.
4410         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4411         Don't bother including stddef.h.
4412
4413 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4414
4415         * argp-help.c (__argp_help): Create a fake struct argp_state and
4416         pass it to _help, otherwise the latter coredumps trying to
4417         dereference state.root_argp.
4418
4419 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4420
4421         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4422         inclusion.
4423         Include <sys/types.h>, for dev_t.
4424         (ME_DUMMY, ME_REMOTE): Move from here....
4425         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4426         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4427         Dmitry V. Levin.
4428         Include mountlist.h first, to test the interface.
4429
4430 2005-01-29  Bruno Haible  <bruno@clisp.org>
4431
4432         * progname.c (program_name): Initialize.
4433         Needed when linking statically on MacOS X.
4434
4435 2005-01-28  Bruno Haible  <bruno@clisp.org>
4436
4437         * javacomp.sh.in: New file, from GNU gettext.
4438         * javacomp.h: New file, from GNU gettext.
4439         * javacomp.c: New file, from GNU gettext.
4440
4441 2005-01-26  Bruno Haible  <bruno@clisp.org>
4442
4443         * javaexec.sh.in: New file, from GNU gettext.
4444         * javaexec.h: New file, from GNU gettext.
4445         * javaexec.c: New file, from GNU gettext.
4446
4447 2005-01-26  Simon Josefsson  <jas@extundo.com>
4448
4449         * gai_strerror.c: Use GPL in header.
4450
4451 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4452
4453         * argp-help.c (hol_entry_help): Avoid using non-constant
4454         initializers for struct pentry_state.
4455         (__argp_error): Check return value of __asprintf
4456         (__argp_failure): Translate error message
4457
4458         * argp-parse.c: Removed braces around the expansion of N_()
4459
4460 2005-01-21  Jim Meyering  <jim@meyering.net>
4461
4462         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4463         same value as for Solaris 9.
4464
4465         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4466         component length.  This included changing the parameter to be
4467         of type `char *' rather than `char const *'.
4468         * chdir-long.h (chdir_long): Update prototype.
4469
4470         * openat.c (fdopendir, fstatat): New functions.
4471         * openat.h: Include headers required for use of DIR and struct stat.
4472         [AT_SYMLINK_NOFOLLOW]: Define.
4473         (fdopendir, fstatat): Add prototypes.
4474
4475 2005-01-21  Bruno Haible  <bruno@clisp.org>
4476
4477         * classpath.h: New file, from GNU gettext.
4478         * classpath.c: New file, from GNU gettext.
4479
4480 2005-01-20  Simon Josefsson  <jas@extundo.com>
4481
4482         * version-etc-fsf.c: New file, with version_etc_copyright.
4483         * version-etc.c: Remove version_etc_copyright.
4484         * version-etc.h (version_etc_copyright): Use [] instead of * in
4485         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4486
4487 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4488
4489         * save-cwd.c (save_cwd): Remove code to support the case
4490         where fchdir is missing or flaky.
4491
4492 2005-01-20  Simon Josefsson  <jas@extundo.com>
4493
4494         * base64.h (isbase64): Add.
4495
4496         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4497         using a unsigned prototype, don't inline.
4498         (base64_decode): Use it.
4499
4500 2005-01-19  Bruno Haible  <bruno@clisp.org>
4501
4502         * sh-quote.h: New file, from GNU gettext.
4503         * sh-quote.c: New file, from GNU gettext.
4504
4505 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4506
4507         Merge changes from coreutils, as described below in several
4508         changelogs dated today.
4509
4510         * save-cwd.c: Include "save-cwd.h" before other include files.
4511         (O_DIRECTORY): Remove; not needed here, since "." must be
4512         a directory.  All uses removed.
4513         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4514         universal on Suns, and we also need to test for IRIX.
4515         Revamp code to use 'if' rather than '#if'.
4516         Avoid unnecessary comparison of cwd->desc to 0.
4517
4518         * utimens.c (futimens): Robustify the previous patch, by checking
4519         for known valid error numbers rather than observed invalid ones.
4520
4521 2005-01-18  Jim Meyering  <jim@meyering.net>
4522
4523         * version-etc.c (version_etc_copyright): Update copyright date.
4524
4525         * utimens.c (futimens): Account for the fact that futimes
4526         can also fail with errno == ENOSYS or errno == ENOENT.
4527         Patch from Dmitry V. Levin.
4528
4529         Change the name of the robust chdir function from chdir to chdir_long.
4530         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4531         (restore_cwd): Use chdir_long, not chdir.
4532         * chdir-long.c: Renamed from chdir.c.
4533         * chdir-long.h: Renamed from chdir.h.
4534         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4535         Hurd.
4536
4537 2005-01-18  Bob Proulx  <bob@proulx.com>
4538
4539         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4540         offsetof() macro construct to avoid compile failure with native HP-UX
4541         11.0 ANSI C compiler.
4542
4543 2005-01-06  Bruno Haible  <bruno@clisp.org>
4544
4545         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4546         because stpncpy.m4 takes care of it.
4547
4548 2004-01-24  Bruno Haible  <bruno@clisp.org>
4549
4550         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4551
4552 2003-10-09  Bruno Haible  <bruno@clisp.org>
4553
4554         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4555
4556 2005-01-06  Bruno Haible  <bruno@clisp.org>
4557
4558         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4559         * fwriteerror.c: Include <stdbool.h>.
4560         (fwriteerror): At the end, close the file stream. Record whether
4561         stdout was already closed.
4562
4563 2004-05-27  Bruno Haible  <bruno@clisp.org>
4564
4565         * execute.c (environ): Declare if needed.
4566         * pipe.c (environ): Likewise.
4567         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4568
4569 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4570
4571         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4572         definitions to be after all include files, to avoid collisions.
4573         Problem reported by Bob Proulx.
4574
4575 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4576
4577         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4578         not needed.  This removes a dependency on the gettext module.
4579         [defined _LIBC]: Do not include <libintl.h>; not needed.
4580
4581 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4582
4583         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4584         HAVE_DECL_STRTOLD.
4585
4586 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4587
4588         * argp-parse.c: Include <stddef.h>.
4589         (alignof, alignto): New macros.
4590         (parser_init): Don't assume that void * is aligned sufficiently
4591         for struct option.
4592
4593         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4594         need to extend the stack.
4595         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4596         large.
4597
4598 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4599
4600         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4601
4602 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4603
4604         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4605         Remove now-obsolete comment about AIX.
4606         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4607         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4608         (YYMAXDEPTH): New macro.
4609
4610 2004-12-18  Bruno Haible  <bruno@clisp.org>
4611
4612         * fatal-signal.c (fatal_signals): Make non-const.
4613         (init_fatal_signals): New function.
4614         (uninstall_handlers, install_handlers): Ignore signals that were set to
4615         SIG_IGN.
4616         (at_fatal_signal): Call init_fatal_signals.
4617         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4618         SIG_IGN.
4619         Reported by Paul Eggert.
4620
4621 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4622
4623         * getdate.y (textint): New member "negative".
4624         (time_zone_hhmm): New function.
4625         Expect 14 shift-reduce conflicts, not 13.
4626         (o_colon_minutes): New rule.
4627         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4628         (yylex): Set the "negative" member of signed numbers.
4629
4630 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4631
4632         Changes imported from coreutils.
4633         * hard-locale.c: Assume <locale.h> exists.
4634         Include "strdup.h".
4635         (GLIBC_VERSION): New macro.
4636         (hard_locale): Assume setlocale exists.
4637         Rewrite to avoid #ifdef.
4638         Use strdup rather than malloc + strcpy.
4639         * human.c: Assume <locale.h> exists.
4640         (human_readable): Assume localeconv exists.
4641
4642 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4643
4644         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4645         convert T2, not T.  (Imported from libc.)
4646
4647 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4648
4649         * getcwd.c (is_ENAMETOOLONG): New macro.
4650         (__getcwd.c): Don't restore errno; glibc doesn't.
4651         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4652         first, falling back to our code only if its results look suspicious.
4653         Ensure that the resulting buffer is only as large as necessary.
4654
4655         * readutmp.c: Include readutmp.h first.
4656         Include <errno.h>, since readutmp.h no longer does that.
4657         * readutmp.h: Don't include <errno.h>,
4658         <sys/param.h>, <time.h>; not needed to establish interface.
4659         (errno): Remove decl.
4660         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4661         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4662         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4663
4664 2004-11-28  Simon Josefsson  <jas@extundo.com>
4665
4666         * base64.h, base64.c: New file.
4667
4668 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4669
4670         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4671
4672 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4673
4674         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4675         HP's ANSI C compiler.
4676         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4677         Declaring int functions causes warnings on some modern systems and
4678         shouldn't be needed to compile on ancient ones.
4679         * same.c (MIN) [defined MIN]: Don't define, since it's already
4680         defined.
4681
4682         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4683         with the following changes.
4684         (__set_errno): Parenthesize properly.
4685         Include <stdbool.h>.
4686         (MIN, MAX, MATCHING_INO): New macros.
4687         (__getcwd): Define with prototype, not K&R form.
4688         Use heuristics to allocate default buffer on stack if possible.
4689         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4690         behavior, and to avoid the PATH_MAX limit when computing
4691         ../../../../...
4692         Use MATCHING_INO to compare inode number to file.
4693         Check for arithmetic overflow in size calculations.
4694         Fix bug in reallocation of dot array that caused getcwd to fail
4695         on directories nested deeper than 75.
4696         Be more careful about saving errno on error.
4697         Do not use realloc; use only free+malloc, as this is a bit
4698         more flexible and avoids a needless copy operation.
4699         Do not inspect st_dev and st_ino for symbolic links; POSIX
4700         doesn't specify the latter.
4701         Check for closedir errors.
4702         Avoid needless casts.
4703         Use "#ifdef weak_alias" around weak_alias, to be like other
4704         glibc code.
4705         The following changes to getcwd.c have effect only when used in
4706         gnulib; they have no effect inside glibc proper.
4707         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4708         as alloca isn't used.
4709         (alloca, __alloca): Likewise.
4710         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4711         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4712         unconditionally, as gnulib assumes C89 or better.
4713         Do not include <sys/param.h>.
4714         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4715         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4716         better.
4717         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4718         Include <dirent.h> in a way that is compatible with modern Autoconf.
4719         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4720         New macros, if not already defined.
4721         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4722         Use "_LIBC", not "defined _LIBC", for consistency.
4723         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4724         a mempcpy module.
4725         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4726         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4727         * xgetcwd.c: David MacKenzie's old code was removed, so give
4728         credit only to Jim Meyering and adjust the copyright dates.
4729         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4730         <stdlib.h>, <unistd.h>, "pathmax.h".
4731         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4732         (INITIAL_BUFFER_SIZE): Remove.
4733         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4734
4735 2004-11-23  Jim Meyering  <jim@meyering.net>
4736
4737         * getopt_.h: Remove trailing blanks.
4738
4739 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4740
4741         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4742         (futimens): New function, which uses futimes if available.
4743         (futimens, utimens): Support timespec==NULL, with same semantics
4744         as utime and utimens.
4745         * utimens.h (futimens): New decl.
4746
4747 2004-11-23  Jim Meyering  <jim@meyering.net>
4748
4749         * __fpending.c: Add comment.
4750
4751 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4752
4753         * getopt_.h: Re-addition of __getopt_argv_const caused
4754         redefinition warnings. To avoid them, include the defines
4755         in `#if !defined __need_getopt ... #endif'. The only place
4756         where __getopt_argv_const is used is in definitions
4757         of getopt_long and getopt_long_only below, which are as well
4758         protected by `#ifndef __need_getopt'.
4759         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4760         __need_getopt after including <stdio.h> and <unistd.h> These
4761         headers might have defined it.
4762
4763 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4764
4765         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4766         New macros.
4767         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4768         optopt): Use them instead of invoking ## directly; otherwise, the
4769         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4770
4771 2004-11-19  Bruno Haible  <bruno@clisp.org>
4772
4773         * strtok_r.c: Move comments from here...
4774         * strtok_r.h: ... to here.
4775
4776 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4777
4778         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4779         might fail.  Problem reported by Yoann Vandoorselaere.
4780         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4781         that mishandle size_t overflow.
4782
4783 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4784
4785         * canon-host.c: Include "strdup.h".
4786         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4787         Use strdup instead of malloc/strcpy to duplicate strings.
4788
4789         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4790         (human_space_before_unit): New constant.
4791         * human.c (human_readable): Support it.
4792
4793         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4794         (xgetcwd): Set errno correctly when failing.
4795         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4796         the failure is actually due to a PATH_MAX problem.
4797
4798         Further getopt changes to make it more likely that glibc will
4799         buy the changes back.
4800         * getopt.c (POSIXLY_CORRECT): New constant.
4801         (getopt): Use it, so to preserve glibc semantic
4802         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4803         when compiling for libc.
4804         * getopt_.h (__getopt_argv_const): Bring it back.
4805         (getopt_long, getopt_long_only): Use it.
4806
4807         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4808         New arg POSIXLY_CORRECT.  All callers changed.
4809         (getopt): Argv is now char * const *, as per standard.
4810         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4811         not char *__getopt_argv_const *.
4812         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4813         _getopt_long_only_r): Likewise.
4814         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4815         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4816         _getopt_long_r, _getopt_long_only_r): Likewise.
4817         * getopt_.h (__getopt_argv_const): Remove.
4818         (getopt): Argv is now char * const *, as per standard.
4819
4820         * getdate.y (tORDINAL): New token.
4821         (day, relunit): Allow it for relative times.
4822         (relative_time_table): Use tORDINAL for ordinals.
4823
4824 2004-11-15  Jim Meyering  <jim@meyering.net>
4825
4826         * closeout.c: Include "__fpending.h" once again.
4827         Include <stdbool.h>.
4828         (close_stdout): Don't fail just because stdout was closed initially,
4829         since some programs don't write to stdout in the normal course of
4830         operation (other than --version and --help), and we don't want this
4831         function to make e.g. `touch file >&-' fail.
4832         But do fail if it was closed and someone has tried to write to it.
4833         E.g., `printf foo >&-' must fail.
4834
4835 2004-11-11  Simon Josefsson  <jas@extundo.com>
4836
4837         * strtok_r.h, strtok_r.c: New file.
4838
4839 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4840
4841         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4842         we can stop lying to compilers about the constness of argv when we
4843         are compiled outside glibc.
4844         (getopt, getopt_long, getopt_long_only): Use it.
4845         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4846         getopt): Likewise.
4847         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4848         _getopt_long_only_r): Likewise.
4849         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4850         _getopt_long_only_r): Likewise.
4851
4852         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4853         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4854         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4855         the other external symbols.
4856         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4857         declaration, since the above renaming now works around collisions.
4858
4859 2004-11-11  Jim Meyering  <jim@meyering.net>
4860
4861         * linebreak.c: Remove trailing blanks.
4862         * alloca_.h: Likewise.
4863         * acosl.c: Likewise.
4864         * euidaccess.c: Likewise.
4865         * allocsa.h: Likewise.
4866
4867 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4868
4869         * mktime.c (SHR): New macro, which is a portable
4870         substitute for >> that should work even on Crays.
4871         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4872         Problem reported by Mark D. Baushke in
4873         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4874         * getdate.y (SHR): Likewise.
4875         (tm_diff): Use it.
4876         * strftime.c (SHR): Likewise.
4877         (tm_diff): Use it.
4878         * quotearg.c (struct quoting_options): Use unsigned int for
4879         quote_these_too, so that right shifts are well defined.  All uses
4880         changed.
4881
4882 2004-11-10  Simon Josefsson  <jas@extundo.com>
4883
4884         * getaddrinfo.h, getaddrinfo.c: New files.
4885
4886 2004-11-10  Jim Meyering  <jim@meyering.net>
4887
4888         Ensure that no close failure goes unreported.
4889         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4890         return early when it seems there's nothing to flush.
4891         Don't include __fpending.h.
4892
4893 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4894
4895         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4896
4897 2004-11-05  Bruno Haible  <bruno@clisp.org>
4898
4899         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4900         Reported by Mark D. Baushke <mdb@cvshome.org>.
4901
4902 2004-11-04  Bruno Haible  <bruno@clisp.org>
4903
4904         2004-09-11  Bruno Haible  <bruno@clisp.org>
4905                 * allocsa.valgrind: New file.
4906         2004-02-06  Bruno Haible  <bruno@clisp.org>
4907                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4908                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4909                 Reported by Christopher Seip <chris.seip@hp.com>.
4910
4911 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4912
4913         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4914         with errno == ERANGE if the buffer is too small.
4915         Problem reported by Mark D. Baushke.
4916
4917 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4918
4919         * xreadlink.c (MAXSIZE): New macro.
4920         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4921         size does not exceed MAXSIZE.  Avoid cast.
4922         As suggested by Mark D. Baushke in
4923         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4924         if readlink fails with buffer size just under MAXSIZE, try again
4925         with MAXSIZE.
4926
4927 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4928         and  Paul Eggert  <eggert@cs.ucla.edu>
4929
4930         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4931         (get_date): Overparenthesize to avoid GCC warning.
4932
4933 2004-11-02  Bruno Haible  <bruno@clisp.org>
4934
4935         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4936         function returns void.
4937
4938 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4939
4940         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4941         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4942         already declared.
4943
4944 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4945
4946         * getdate.y: Add support for TZ="foo" within a date string.
4947         Fix some bugs near time_t boundaries.  Reject dates with
4948         out-of-range components, e.g., "Sept 31".
4949         Include <stdlib.h>, "setenv.h", "xalloc.h".
4950         (ISDIGIT_LOCALE): Remove; unused.
4951         Note that the TZ and time functions used here are not reentrant.
4952         (mktime_ok, get_tz): New functions.
4953         (TZBUFSIZE): New constant.
4954         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4955         This requires that we sometimes generate our own TZ="XXX..." setting.
4956
4957 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4958
4959         * mktime.c (not_equal_tm): Remove redundant check.
4960
4961 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4962
4963         * getdate.y: Use Bison 1.875 features, and some minor
4964         code cleanups.  This change does not affect semantics.
4965         Don't include <stdlib.h>; no longer needed.
4966         Don't include unlocked-io.h; only the "#if TEST" code uses
4967         stdio, and performance isn't crucial there.
4968         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4969         Bison 1.875 features as described below.
4970         All uses of "PC." replaced by "pc->".
4971         (YYSTYPE): Add a forward declaration.
4972         (yylex, yyerror): Use full prototypes in forward decls.
4973         Use "%pure-parser" rather than obsolescent "%pure_parser".
4974         Use %parse-param and %lex-param instead of obsolescent
4975         YYPARSE_PARAM and YYLEX_PARAM.
4976         (meridian_table, month_and_day_table, time_units_table,
4977         relative_time_table, time_zone_table, military_table,
4978         lookup_zone, lookup_word, get_date):
4979         Use NULL instead of 0 where appropriate.
4980         (to_hour): Avoid abort (), to avoid a dependency on
4981         stdlib.h.
4982         (yyerror, yylex): Now accepts parser_control * arg.
4983         (main) [TEST]: Use '\0' rather than 0 for char.
4984
4985 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4986
4987         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4988         It's now the caller's responsibility to handle the case where
4989         !HAVE_GETPAGESIZE && !defined getpagesize.
4990
4991         * mktime.c (leapyear): Arg is long int, not int.
4992
4993 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4994
4995         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4996
4997 2004-10-12  Simon Josefsson  <jas@extundo.com>
4998
4999         * getpass.c (fflush_unlocked, flockfile, funlockfile)
5000         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5001         to real functions.
5002
5003 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
5004
5005         * vsnprintf.h: New file.
5006         * vsnprintf.c: New file.
5007
5008 2004-10-07  Bruno Haible  <bruno@clisp.org>
5009
5010         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5011         into the provided buffer.
5012
5013 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5014
5015         * diacrit.c, diacrit.h: Add GPL notice.
5016
5017         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5018         * atanl.c (atanl): Keep the code as similar to glibc as possible.
5019         * logl.c (logl): Keep the code as similar to glibc as possible.
5020         This avoids a potential constant-folding bug.
5021
5022 2004-10-05  Bruno Haible  <bruno@clisp.org>
5023
5024         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5025
5026 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5027
5028         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5029         * xmalloc.c (xmemdup): Likewise.
5030         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5031         XFREE): Remove these long-obsolescent macros.
5032         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5033         * xstrdup.c: Remove.
5034
5035         * regex.c (re_comp): Cast gettext return value to char *,
5036         Problem reported by Martin Neitzel via Mark D. Baushke.
5037
5038 2004-10-04  Simon Josefsson  <jas@extundo.com>
5039
5040         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5041         '#ifdef USE_UNLOCKED_IO'.
5042
5043 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5044
5045         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5046         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5047         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5048         regex.c, sha1.c, version-etc.c, yesno.c:
5049         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5050         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5051         the includer's responsibility.
5052
5053         Sync from coreutils.
5054
5055         * modechange.c (mode_compile): Don't decrement a pointer that
5056         points to the start of a string, as the C Standard says the
5057         resulting behavior is undefined.
5058
5059         * backupfile.h (enum backuptype): Rename none -> no_backups,
5060         simple -> simple_backups, numbered_existing ->
5061         numbered_existing_backups, numbered -> numbered_backups
5062         to avoid shadowing problems.  All uses changed.
5063         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5064         * backupfile.c (check_extension, numbered_backup):
5065         Rename locals to avoid shadowing 'basename'.
5066         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5067         once.
5068
5069         * .cppi-disable: Add getopt_.h, getopt_int.h.
5070         * .cvsignore: Add getopt.h.
5071
5072 2004-10-04  Simon Josefsson  <jas@extundo.com>
5073
5074         * memmem.h: New file.
5075         * memmem.c: New file, taken from glibc.
5076
5077 2004-10-02  Jim Meyering  <jim@meyering.net>
5078
5079         * dirfd.h, getpagesize.h: Add copyright notice.
5080
5081 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5082
5083         * snprintf.c: Remove comments as to why each header is needed.
5084
5085 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5086
5087         * strsep.h: New file.
5088         * strsep.c: New file.
5089
5090 2004-10-01  Simon Josefsson  <jas@extundo.com>
5091
5092         * snprintf.c (snprintf): Handle size==0.
5093
5094 2004-10-01  Simon Josefsson  <jas@extundo.com>
5095             Bruno Haible  <bruno@clisp.org>
5096
5097         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5098         (snprintf): Declare 'args'.
5099
5100 2004-09-30  Simon Josefsson  <jas@extundo.com>
5101
5102         * snprintf.h, snprintf.c: New files.
5103
5104 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5105
5106         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5107         (hol_entry_help): Never translate an empty string.
5108         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5109         * argp.h (OPTION_NO_TRANS): New option.
5110
5111 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5112
5113         * xvasprintf.c: Include xalloc.h.
5114         (xvasprintf): Use xalloc_die, not xmalloc_die.
5115
5116 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5117
5118         * dummy.c: Change copyright notice to FSF, and license to GPL.
5119
5120 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5121
5122         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5123         Problem reported by Bruno Haible in:
5124         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5125
5126 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5127
5128         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5129         in case some system header has #define'd it.  Problem reported by
5130         Soeren D. Schulze in
5131         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5132
5133 2004-09-08  Bruno Haible  <bruno@clisp.org>
5134
5135         * stdint_.h: New file, taken from GNU clisp.
5136
5137 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5138
5139         * xvasprintf.h: New file.
5140         * xvasprintf.c: New file.
5141         * xasprintf.c: New file.
5142
5143 2004-09-08  Bruno Haible  <bruno@clisp.org>
5144
5145         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5146         is > INT_MAX.
5147         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5148
5149 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5150
5151         Import from coreutils.
5152         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5153         strings on unbounded length.  alloca's performance benefits aren't
5154         that important here.
5155         (V_STRDUP): Remove.
5156         (parse_with_separator): New function, with most of the internals
5157         of the old parse_user_spec.  Allow user to omit both user and group,
5158         for compatibility with FreeBSD.
5159         Clone only the user name, not the entire spec.
5160         Do not set *uid, *gid unless entirely successful.
5161         Avoid memory leak in some failing cases.
5162         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5163         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5164         (parse_user_spec): Rewrite to use parse_with_separator.
5165
5166 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5167
5168         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5169         its complicated substitute.
5170         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5171         and program_invocation_name.
5172         (__argp_basename) [!_LIBC]: Remove; the only use was
5173         replaced by its body.
5174         (__argp_short_program_name): Change condition from
5175         !defined __argp_short_program_name to
5176         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5177         to match argp-namefrob.h.
5178         (__argp_failure): Don't assume strerror_r returns char *.
5179         * argp-parse.c (N_): Define unconditionally.
5180         (argp_default_options): Fill out initializers with 0 to avoid
5181         gcc warnings.
5182
5183 2004-08-12  Simon Josefsson  <jas@extundo.com>
5184
5185         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5186         * getopt_.h: Renamed from getopt.h.
5187
5188 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5189
5190         Merge from coreutils.
5191
5192         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5193         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5194         for Reliant Unix 5.43.
5195
5196         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5197         (union fooround): Use uintmax_t, not long int.
5198         The rest is a merge from libc:
5199         [defined _LIBC]: Include <shlib-compat.h>.
5200         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5201
5202         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5203
5204         * strverscmp.c: Convert to UTF-8.
5205
5206 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5207
5208         * obstack.h (obstack_empty_p):
5209         Don't assume that chunk->contents is suitably aligned.
5210         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5211         Likewise. Problem reported by Benno in
5212         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5213
5214         * chown.c (rpl_chown): Work even if the file is writeable but not
5215         readable.  This could be improved further but it'd take some work.
5216
5217 2004-08-08  Simon Josefsson  <jas@extundo.com>
5218
5219         * xgethostname.c: Don't include error.h (not used).
5220
5221         * getpass.h: Add.
5222         * getpass.c: Include getpass.h first.
5223
5224 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5225
5226         * xalloc-die.c: New files.
5227         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5228         All uses removed.
5229         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5230         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5231         (_, N_, xalloc_die): Move to xalloc-die.c.
5232         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5233         so that we needn't mess with xalloc_msg_memory_exhausted.
5234
5235         * sha1.h: Renamed from sha.h.
5236         (SHA1_H): Renamed from _SHA_H.
5237         (sha1_ctx): Renamed from sha_ctx.
5238         (sha1_init_ctx): Renamed from sha_init_ctx.
5239         (sha1_process_block): Renamed from sha_process_block.
5240         (sha1_process_bytes): Renamed from sha_process_bytes.
5241         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5242         (sha1_read_ctx): Renamed from sha_read_ctx.
5243         (sha1_stream): Renamed from sha_stream.
5244         (sha1_buffer): Renamed from sha_buffer.
5245         * sha1.c: Likewise; renamed from sha.c.
5246         Do not include <sys/types.h>.
5247         Include <stddef.h> rather than <stdlib.h>.
5248
5249 2004-08-08  Bruno Haible  <bruno@clisp.org>
5250
5251         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5252         FILESYSTEM_PREFIX_LEN.
5253         * progreloc.c: Likewise.
5254         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5255
5256 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5257
5258         Merge from tar.
5259         * argp-help.c (make_hol, hol_append): Don't assume that
5260         SIZE_MAX is a valid preprocessor constant.
5261         (__argp_basename): Change from "#ifndef _LIBC"
5262         to "#ifndef __argp_short_program_name", so that
5263         we don't compile these functions for tar.
5264
5265         More merges from coreutils.
5266         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5267         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5268         yesno.h: New files.
5269         * addext.c: Remove; no longer needed.
5270         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5271         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5272         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5273         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5274         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5275         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5276         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5277         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5278         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5279         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5280         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5281         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5282         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5283         Import changes from coreutils.
5284
5285 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5286
5287         Merge from coreutils.
5288
5289         * .gdb-history: Remove; this doesn't belong here.
5290
5291         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5292         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5293         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5294
5295         * dirname.h: Include <stdbool.h>.
5296         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5297         for consistency with POSIX terminology.  All uses changed.
5298         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5299         (strip_trailing_slashes): Use bool for booleans.
5300         * stripslash.c (strip_trailing_slashes): Likewise.
5301
5302         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5303         sometimes returns a positive errno value even when it succeeds.
5304         (print_errno_message) [!LIBC]: Fall back on strerror if
5305         __strerror_r fails.
5306
5307         * path-concat.c (mempcpy): Don't define if a system header defines it.
5308         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5309         (longest_relative_suffix): New function.
5310         (path_concat): Use it.  Assume first argument is not NULL.
5311         Port to DOS.  Omit redundant separators.
5312         Report an error instead of returning NULL.
5313         Use mempcpy instead of memcpy.
5314         (xpath_concat): Remove: not declared or used.
5315
5316         * same.h: Include <stdbool.h>
5317         (same_name): Return bool, not int.
5318         * same.c (same_name): Likewise.
5319         (errno): Don't declare; we assume C89 or better now.
5320
5321         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5322         if not already defined.
5323
5324         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5325         * dup-safer.c (errno): Likewise.
5326
5327 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5328
5329         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5330         working.
5331
5332 2004-08-03  Simon Josefsson  <jas@extundo.com>
5333
5334         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5335         * progname.h: Don't include stdbool.h.
5336
5337 2004-08-02  Simon Josefsson  <jas@extundo.com>
5338
5339         * getsubopt.h: New file, with comments from Bruno Haible.
5340         * getsubopt.c: New file, from glibc, but slightly modified based on
5341         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5342
5343 2004-08-01  Simon Josefsson  <jas@extundo.com>
5344
5345         * xgetdomainname.c: Include stdlib.h, for free().
5346
5347 2004-07-16  Simon Josefsson  <jas@extundo.com>
5348
5349         * dummy.c: New file.
5350
5351 2004-07-16  Bruno Haible  <bruno@clisp.org>
5352
5353         * backupfile.h: Add extern "C" for C++.
5354         * closeout.h: Likewise.
5355         * copy-file.h: Likewise.
5356         * findprog.h: Likewise.
5357         * full-write.h: Likewise.
5358         * pathname.h: Likewise.
5359         * progname.h: Likewise.
5360         * stpcpy.h: Likewise.
5361         * stpncpy.h: Likewise.
5362         * strcase.h: Likewise.
5363         * strstr.h: Likewise.
5364         * xalloc.h: Likewise.
5365
5366         * mbswidth.h: Add extern "C" for C++.
5367         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5368
5369 2004-07-09  Simon Josefsson  <jas@extundo.com>
5370
5371         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5372         failed without this.)
5373
5374 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5375
5376         * fchown-stub.c: New file.
5377
5378 2004-06-24  Jim Meyering  <jim@meyering.net>
5379
5380         * obstack.h (obstack_base): Cast to (void *), per documentation.
5381
5382 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5383
5384         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5385
5386 2004-06-01  Jim Meyering  <jim@meyering.net>
5387
5388         * calloc.c: New file.
5389
5390 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5391
5392         * getdate.y (yylex): Allow space between sign and number.
5393         Problem reported by Dan Jacobson.
5394
5395 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5396         and  Jim Meyering  <jim@meyering.net>
5397
5398         Merge from coreutils CVS.
5399
5400         * stat-macros.h: New file, with contents from file-type.h
5401         and coreutils' system.h.
5402         * file-type.c: Include "stat-macros.h".
5403         * file-type.h (file_type): Move all macro definitions to new file,
5404         stat-macros.h.
5405
5406         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5407         Wrap old code with this conditional.
5408         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5409         function that does not dereference symlinks.
5410         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5411
5412         * xreadlink.c: Include xreadlink.h first, to catch .h file
5413         dependency problems.
5414         (xreadlink): Accept new arg SIZE, for efficiency.
5415         All decls and uses changed.
5416         * xreadlink.h: Include <stddef.h>, for size_t.
5417
5418         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5419         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5420
5421         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5422
5423 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5424
5425         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5426         macros to be defined.
5427         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5428         the allocator returns NULL because the requested size is zero.
5429
5430 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5431
5432         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5433         var.  Add comment explaining why libc still defines it.  This
5434         merges the following patch from glibc:
5435         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5436
5437 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5438
5439         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5440         present in glibc since revision 1.1 of this file.
5441         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5442         obstack_alignment_mask, obstack_alloc, obstack_base,
5443         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5444         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5445         obstack_grow0, obstack_init, obstack_int_grow,
5446         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5447         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5448         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5449         nonexistent functions.
5450
5451 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5452             Paul Eggert  <eggert@cs.ucla.edu>
5453
5454         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5455
5456 2004-05-14  Bruno Haible  <bruno@clisp.org>
5457
5458         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5459         that consists of a '.' followed by an empty digit string.
5460         Patch by Tor Lillqvist <tml@iki.fi>.
5461
5462 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5463
5464         Port obstack to the AS/400, where pointers are 16 bytes wide and
5465         you cannot cast an integer to a valid pointer.  This patch is
5466         currently waiting to be integrated into glibc; see
5467         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5468
5469         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5470         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5471         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5472         (struct obstack): temp member is now a union of a pointer and
5473         an integer, instead of an integer.  All integer uses changed.
5474         This does not affect the physical layout of struct obstack,
5475         except on hosts (like the AS/400) where the size or alignment of
5476         void * is greater than that of ptrdiff_t.
5477         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5478         __STDC__)]: Store temporary in pointer member of union, not
5479         integer member.
5480         * obstack.c: Include <stddef.h>, for offsetof.
5481         (struct fooalign): Remove; it doesn't need a name.
5482         (union fooround): Change double to long double, and add void *.
5483         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5484         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5485         not a macro.  Hence the values are always int; so remove all
5486         casts-to-int in uses.
5487
5488 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5489             Derek Price  <derek@ximbiot.com>
5490
5491         * alloca.c: Include <alloca.h>, to get our interface.
5492         * alloca_.h: Use __alloca on AIX, so that we don't have to
5493         include <alloca.h> first.  Use C89 prototype for alloca; this
5494         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5495         Use #elif for simplicity, since we can assume C89 now.
5496         Don't try to source the system alloca.h since it will not be found
5497         and to prevent recursively including its replacement.
5498         * fnmatch.c: Include <alloca.h> instead of opencoding.
5499         * regex.c: Likewise.
5500
5501 2004-05-16  Derek Price  <derek@ximbiot.com>
5502             Paul Eggert  <eggert@cs.ucla.edu>
5503
5504         getline cleanup.  This changes the getndelim2 API: both order of
5505         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5506         no delimiter).
5507
5508         * getline.c: Don't include stddef.h or stdio.h, since our
5509         interface does that.
5510         (getline): Always use getdelim, so that we don't have two
5511         copies of this code.
5512         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5513         if available.
5514         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5515         (GETNDELIM2_MAXIMUM): New macro.
5516         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5517         instead of the old practice of delim2==0.  All callers changed.
5518         Return -1 on overflow, instead of returning junk.
5519         Do not set *linesize unless allocation succeeds.
5520         * getndelim2.h: Do not include stddef.h; no longer needed, now
5521         that we include sys/types.h.
5522         * getnline.h: Likewise.
5523         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5524         (getndelim2): Reorder arguments.
5525         * getnline.c (getnline, getndelim):
5526         Don't discard the NMAX argument.
5527         (getnline): Invoke getndelim, to avoid code duplication.
5528         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5529         of (size_t) -1 by callers of the getnline family.
5530
5531 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5532
5533         * nanosleep.c (suspended): Change its type from int to
5534         sig_atomic_t volatile.
5535         (first_call): Make it private to rpl_nanosleep, and have it
5536         be zero initially as that's a bit faster.
5537         (my_usleep): Round up fractional times instead of truncating them,
5538         as this is the usual meaning for 'sleep'.
5539
5540         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5541         doesn't work.
5542         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5543         (ENOSYS): Define if not defined.
5544         (settime): Fall back on stime if it exists and settimeofday fails.
5545         But don't bother with fallbacks if a method fails with errno == EPERM.
5546
5547 2004-05-11  Jim Meyering  <jim@meyering.net>
5548
5549         Prior to this change, the save_cwd caller required read access to the
5550         current directory on most systems (ones with the fchdir function).
5551
5552         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5553         fails, try write-only, and finally, resort to using xgetcwd.
5554
5555 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5556
5557         * obstack.c, obstack.h: Import changes from libc.
5558
5559 2004-04-28  Bruno Haible  <bruno@clisp.org>
5560
5561         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5562         implicitly appends .exe to executables.
5563         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5564         accepts Windows pathnames.
5565         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5566         Cygwin like Windows, since it now accepts Windows pathnames.
5567         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5568         Cygwin like Windows, since it now accepts Windows pathnames.
5569         Reported by Derek Robert Price <derek@ximbiot.com>.
5570
5571 2004-04-20  Jim Meyering  <jim@meyering.net>
5572
5573         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5574
5575 2004-04-20  Jim Meyering  <jim@meyering.net>
5576             Bruno Haible  <bruno@clisp.org>
5577
5578         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5579         memory when realloc fails.
5580
5581 2004-04-18  Jim Meyering  <jim@meyering.net>
5582
5583         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5584         don't leak memory and do call END_UTMP_ENT.
5585
5586 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5587
5588         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5589         (CHAR_BIT): Remove, since we assume C89.
5590         Include <stdint.h> if available, as per current Autoconf CVS advice.
5591
5592 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5593
5594         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5595         not bool, to be more consistent with Unix conventions.
5596         Suggested by Bruno Haible.
5597
5598         Merge from coreutils.
5599
5600         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5601         New files.
5602
5603         * getdate.h: Include stdbool.h, and timespec.h instead of
5604         the usual <time.h> dance.
5605         (get_date): Change signature to support fractional time stamps.
5606         All callers changed.
5607         * getdate.y: Include "getdate.h" first, as we can now
5608         assume C89 and don't need to worry about 'const'.
5609         Similarly, include "unlocked-io.h" near start, not in middle.
5610         Include <limits.h>.
5611         (textint.value): Use long int rather than int.
5612         (textint.digits): Use size_t rather than int.
5613         (BILLION, LOG10_BILLION): New constants.
5614         (parser_control): New member rel_ns.  Members day_ordinal,
5615         time_zone, month, day, hour, minutes, rel_year, rel_month,
5616         rel_day, rel_hour, rel_minutes, rel_seconds
5617         are now long int, not int.  Member seconds is now struct timespec,
5618         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5619         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5620         not int.
5621         (%union.intval): Now long int, not int.
5622         New member timespec.
5623         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5624         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5625         (spec): Now is a timespec or an item list.
5626         (timespec, items): New nonterminals.
5627         (time, rel, relunit, number, get_date):
5628         Add support for fractional seconds.
5629         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5630         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5631         (to_hour): First arg is now long int, not int.
5632         (to_year): Returns long int, not int.
5633         Don't treat year -70 like 70.
5634         (tm_diff): Returns long int, not int.
5635         (lookup_word): Use bool instead of int when appropriate.
5636         (yylex): Use size_t for count, not int.
5637         Detect overflow when parsing large integer constants.
5638         Add support for fractions.
5639         (get_date): Make pointers 'const' if possible.
5640         Use more-portable code to detect integer overflow.
5641         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5642         Don't use ctime; it's not reliable if the year has >4 digits.
5643
5644         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5645         This is for compatibility with BSD.
5646
5647         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5648         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5649         From coreutils' system.h.
5650
5651         * userspec.c: Don't include "posixver.h".
5652         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5653         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5654         compatible extension.  Simplify code by removing a boolean int
5655         that was always nonzero if a string was nonnull.
5656
5657 2004-03-30  Jim Meyering  <jim@meyering.net>
5658
5659         Merge from coreutils.
5660
5661         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5662
5663         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5664         an empty input stream.
5665
5666         * readtokens.c: Include <stdbool.h>.
5667         (readtoken): Use `size_t' rather than int/long.
5668         All callers adjusted.
5669         Use `bool' rather than `int' where appropriate.
5670         Use memset rather than an explicit loop.
5671         Use x2nrealloc rather than xrealloc.
5672         Allow the use of `\0' as a delimiter.
5673         (readtokens): Likewise.
5674         * readtokens.h (readtoken, readtokens): Update prototypes.
5675
5676 2004-03-30  Bruno Haible  <bruno@clisp.org>
5677
5678         * getloadavg.c (getloadavg): Don't assume setlocale returns
5679         nonnull.
5680
5681 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5682
5683         Merge changes to getloadavg.c from coreutils and Emacs.
5684
5685         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5686         Define to an expression, not to the empty string.
5687         Include cloexec.h and xalloc.h.
5688         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5689         Use set_cloexec_flag rather than rolling our own.
5690         * cloexec.c, cloexec.h: New files.
5691
5692 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5693
5694         * getopt.h: Sync with libc CVS.
5695
5696 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5697             Bruno Haible  <bruno@clisp.org>
5698
5699         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5700         not on all platforms that have <wchar.h>.
5701         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5702
5703 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5704
5705         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5706         Sync with libc CVS.
5707         * getopt_int.h: New file, also synced from libc.
5708
5709 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5710
5711         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5712         '#if' expressions.  Unlike the code it replaces, it does not
5713         depend on (defined _SC_PAGESIZE).  However, it does depend on
5714         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5715         first reported by Jason Andrade in
5716         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5717
5718 2004-01-18  Simon Josefsson  <jas@extundo.com>
5719
5720         * strdup.h: New file.
5721         * strdup.c: Include it.
5722         * path-concat.c: Include strdup.h. Drop strdup declaration.
5723         * userspec.c: Include strdup.h. Drop strdup declaration.
5724
5725 2004-02-06  Karl Berry  <karl@gnu.org>
5726
5727         * config.charset: update from gettext 0.14.1.
5728
5729 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5730
5731         Add comments and code, prompted by suggestions from Bruno Haible
5732         for sh-quote.
5733         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5734         describing the enum quoting_style values.
5735         * quotearg.c (quotearg_alloc): New function.
5736         (quotearg_buffer_restyled): Treat lone { and } as special.
5737         Treat = as special.  Work around bug with older shells
5738         that "see" a '\' that is really the 2nd byte of a multibyte char.
5739         Quote empty string with shell_quoting_style.
5740
5741 2004-02-03  Bruno Haible  <bruno@clisp.org>
5742
5743         * pipe.h: New file, from GNU gettext.
5744         * pipe.c: New file, from GNU gettext.
5745
5746 2004-01-27  Bruno Haible  <bruno@clisp.org>
5747
5748         * execute.h: New file, from GNU gettext.
5749         * execute.c: New file, from GNU gettext.
5750         * w32spawn.h: New file, from GNU gettext.
5751
5752 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5753
5754         Exit-status fix from coreutils.
5755
5756         Use exit_failure consistently in place of EXIT_FAILURE,
5757         so that program exit statuses are consistent on failure.
5758
5759         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5760         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5761         * argmatch.h: Comment fix to match the above.
5762         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5763         Now a macro referring to exit_failure, instead of a separate
5764         variable.  Include "exitfail.h" to get it.
5765         * xstrtol.h: Include "exitfail.h".
5766         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5767
5768         * long-options.c (parse_long_options): Use prototype
5769         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5770         for clarity.
5771
5772 2004-01-21  Jim Meyering  <jim@meyering.net>
5773
5774         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5775         so as not to conflict with a different-sized __mktime_internal
5776         function in GNU libc.
5777         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5778         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5779
5780 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5781
5782         Merge from diffutils.
5783
5784         * file-type.c (file_type): Add typed memory objects.
5785         * file-type.h (S_TYPEISTMO): New macro.
5786
5787         * c-stack.h (c_stack_action): Remove argv argument.
5788         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5789         (die): Don't calculate message unless segv_action returns.
5790         (get_stack_location, min_address_from_argv, max_address_from_argv,
5791         volatile stack_base, volatile_stack_size): Remove.
5792         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5793         that every segmentation violation is a stack overflow.  (Ouch!)
5794         See Debian bug 136249 (still outstanding) for more info about why
5795         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5796
5797 2003-11-30  Bruno Haible  <bruno@clisp.org>
5798
5799         Safer stack allocation.
5800         * setenv.c: Include allocsa.h.
5801         (alloca): Remove fallback definition.
5802         (freea): Remove macro.
5803         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5804         instead of freea.
5805
5806 2003-10-17  Bruno Haible  <bruno@clisp.org>
5807
5808         * binary-io.h: Avoid warnings on Cygwin.
5809
5810 2003-12-28  Bruno Haible  <bruno@clisp.org>
5811
5812         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5813         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5814
5815 2003-11-28  Bruno Haible  <bruno@clisp.org>
5816
5817         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5818
5819 2003-11-27  Bruno Haible  <bruno@clisp.org>
5820
5821         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5822
5823 2003-11-17  Bruno Haible  <bruno@clisp.org>
5824
5825         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5826
5827 2003-11-24  Bruno Haible  <bruno@clisp.org>
5828
5829         * xallocsa.h: New file, from GNU gettext.
5830         * xallocsa.c: New file, from GNU gettext.
5831
5832 2003-11-24  Bruno Haible  <bruno@clisp.org>
5833
5834         * allocsa.h: New file, from GNU gettext.
5835         * allocsa.c: New file, from GNU gettext.
5836
5837 2003-11-24  Bruno Haible  <bruno@clisp.org>
5838
5839         * eealloc.h: New file.
5840
5841 2004-01-15  Jim Meyering  <jim@meyering.net>
5842
5843         Merge from coreutils.
5844
5845         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5846         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5847         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5848
5849         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5850         optional configure-time default.
5851
5852         * version-etc.c (version_etc_copyright): Update copyright date.
5853
5854         * xreadlink.c (xreadlink): Correct outdated comment.
5855
5856 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5857
5858         Merge from coreutils.
5859
5860         * posixver.c: Include posixver.h.
5861
5862         * same.c: Include <stdbool.h>, <limits.h>.
5863         (_POSIX_NAME_MAX): Define if not defined.
5864         (MIN): New macro.
5865         (same_name): If file names are silently truncated, report
5866         that the file names are the same if they are the same after
5867         the silent truncation.
5868
5869         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5870         conversion function.
5871         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5872         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5873         longer needed.
5874
5875 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5876
5877         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5878         with like-named macro in fnmatch.c.
5879         (EXT): Use an internal constant instead.
5880
5881         Merge fnmatch patches from glibc.
5882         * fnmatch.c (mbsinit): Remove define.
5883         Add libc_hidden_ver (__fnmatch, fnmatch).
5884         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5885         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5886
5887 2003-12-14  Karl Berry  <karl@gnu.org>
5888
5889         * config.charset: update from gettext-runtime.
5890
5891 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5892
5893         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5894         Bug reported by Alfred M. Szmidt.
5895
5896 2003-11-29  Karl Berry  <karl@gnu.org>
5897
5898         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5899
5900 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5901             Bruno Haible  <bruno@clisp.org>
5902
5903         * printf-parse.h: Don't include sys/types.h.
5904         (ARG_NONE): New macro.
5905         (char_directive): Change type of *arg_index fields to size_t.
5906         * printf-parse.c: Don't include sys/types.h.
5907         (SSIZE_MAX): Remove macro.
5908         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5909         Remove unnecessary overflow check.
5910         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5911         fields.
5912
5913 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5914
5915         * alloca.c: Remove dependency on xalloc module.
5916         (xalloc_die): Remove.
5917         (memory_full) [!defined emacs]: New macro.
5918         [!defined emacs]: Don't include xalloc.h.
5919         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5920         address arithmetic overflows.  Change datatypes a bit to avoid
5921         unnecessary casts.
5922
5923 2003-11-22  Jim Meyering  <jim@meyering.net>
5924
5925         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5926
5927 2003-11-17  Bruno Haible  <bruno@clisp.org>
5928
5929         * vasnprintf.c (alloca): Remove fallback definition.
5930         (freea): Remove definition.
5931         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5932         Reported by Paul Eggert.
5933
5934 2003-11-17  Jim Meyering  <jim@meyering.net>
5935
5936         On systems without utime and without a utimes function capable of
5937         dealing with a NULL struct utimbuf* argument, this utime replacement
5938         could -- in unusual circumstances -- leak a file descriptor.
5939         * utime.c: Include <unistd.h> and <errno.h>.
5940         (utime_null): Be sure to close `fd' and to preserve errno.
5941         Reported by Geoff Collyer via Arnold Robbins.
5942
5943 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5944             Bruno Haible  <bruno@clisp.org>
5945
5946         Protect against address arithmetic overflow.
5947         * printf-args.h: Include stddef.h.
5948         (arguments): Change type of field 'count' to size_t.
5949         * printf-args.c (printf_fetchargs): Use size_t instead of
5950         'unsigned int' where appropriate.
5951         * printf-parse.h: Include sys/types.h.
5952         (char_directive): Change type of *arg_index fields to ssize_t.
5953         (char_directives): Change type of fields 'count', max_*_length to
5954         size_t.
5955         * printf-parse.c: Include sys/types.h and xsize.h.
5956         (SSIZE_MAX): Define fallback value.
5957         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5958         instead of 'int' where appropriate. Check a_allocated, d_allocated
5959         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5960         * vasnprintf.c: Include xsize.h.
5961         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5962         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5963         overflow. Avoid wraparound when converting a width or precision from
5964         decimal to binary.
5965
5966 2003-11-16  Bruno Haible  <bruno@clisp.org>
5967
5968         Update from GNU gettext.
5969         * printf-parse.c: Generalize to it can be compiled for wide strings.
5970         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5971         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5972         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5973         SNPRINTF): New macros.
5974         Don't include <alloca.h> if the file is used inside libintl.
5975         (local_wcslen): New function, for Solaris 2.5.1.
5976         (VASNPRINTF): Use it instead of wcslen.
5977
5978 2003-11-16  Bruno Haible  <bruno@clisp.org>
5979
5980         * xsize.h (xmax): New function.
5981         (xsum, xsum3, xsum4): Declare as "pure" functions.
5982
5983 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5984
5985         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5986         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5987         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5988         heuristic is just as accurate as far as we know, and it removes a
5989         dependency on size_max.m4 and ptrdiff_max.m4.
5990
5991 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5992
5993         * xstrtol.c (__xstrtol): Remove "break" immediately after
5994         "return", to pacify some unknown compiler.  Problem reported
5995         by Joerg Schilling.
5996
5997 2003-11-11  Bruno Haible  <bruno@clisp.org>
5998
5999         * xsize.h (SIZE_MAX): Remove fallback definition.
6000         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6001         defined.
6002
6003 2003-11-10  Paul Eggert  <eggert@twinsun.com>
6004
6005         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6006         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6007         rejected some allocations of exactly SIZE_MAX - 2 bytes.
6008         From Bruno Haible.
6009         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6010         not (size_t) -1, since it's defined here.
6011
6012 2003-11-06  Paul Eggert  <eggert@twinsun.com>
6013
6014         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6015         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6016         Reject sizes of exactly SIZE_MAX bytes.
6017         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6018         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6019
6020 2003-11-05  Bruno Haible  <bruno@clisp.org>
6021
6022         * xsize.h: Include limits.h, to avoid a possible collision with
6023         SIZE_MAX defined in <limits.h> on Solaris.
6024
6025 2003-11-04  Bruno Haible  <bruno@clisp.org>
6026
6027         * xsize.h: New file.
6028         * linebreak.c: Include xsize.h.
6029         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6030         argument for overflow.
6031         Suggested by Paul Eggert.
6032
6033 2003-10-31  Bruno Haible  <bruno@clisp.org>
6034
6035         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6036         to avoid (extremely rare) race condition.
6037         Suggested by Paul Eggert.
6038
6039 2003-11-03  Jim Meyering  <jim@meyering.net>
6040
6041         * userspec.c: Include "userspec.h".
6042         * userspec.h: New file.
6043
6044 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6045
6046         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6047         * mountlist.c (SIZE_MAX): Define if not defined already.
6048         (read_filesystem_list): Set and use me_type_malloced.
6049         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6050         whatever the type happens to be), for brevity and consistency.
6051         Check for size calculation overflow on Alphas running OSF/1.
6052
6053 2003-10-31  Jim Meyering  <jim@meyering.net>
6054
6055         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6056
6057         * linebuffer.c: Include <string.h> for declaration of memset.
6058
6059 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6060             Bruno Haible  <bruno@clisp.org>
6061
6062         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6063         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6064
6065 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6066
6067         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6068         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6069         no longer needed.
6070         * quotearg.c (quotearg_n_options): Use it.
6071         * group-member.c: Include <stdbool.h>.
6072         (free_group_info): Arg is now const *; don't free arg.
6073         (get_group_info): Now returns bool and accepts struct group_info *,
6074         rather than returning a malloc'ed struct group_info *.
6075         All uses changed.  Check for overflow in internal size calculation.
6076
6077         * getusershell.c (readname): Simplify the code by using x2nrealloc
6078         rather than xmalloc/xrealloc.
6079         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6080         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6081         conformance bug: the old code used a pointer after freeing the
6082         storage that it addressed.
6083         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6084         rather than doing it by hand.
6085         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6086         the buffer preserved.  Use free and xmalloc instead.
6087         * quotearg.c (quotearg_n_options): Likewise.
6088         Use a simpler test for size overflow.  Don't use xalloc_oversized
6089         because unsigned int might be wider than size_t (!); this suggests
6090         that we should switch from unsigned int to size_t for slot numbers.
6091
6092 2003-10-27  Bruno Haible  <bruno@clisp.org>
6093
6094         * stdbool_.h: Better support for BeOS.
6095
6096 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6097
6098         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6099         to allocate the returned structure.  Do not allocate a subarray,
6100         as x2nrealloc will do that.
6101         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6102         instead of xnrealloc.
6103         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6104
6105 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6106
6107         * xalloc.h (xalloc_oversized): New static inline function, for
6108         callers that want to do their own size-overflow checking.  Include
6109         <stdbool.h>, since xalloc_oversized returns bool.
6110         * xalloc.c (array_size_overflow): Remove.  All callers changed
6111         to use xalloc_oversized.
6112
6113         Add two functions x2realloc, x2nrealloc, for programs that grow
6114         arrays dynamically by doubling their sizes.
6115         * xalloc.h (x2realloc, x2nrealloc): New decls.
6116         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6117         New functions.
6118
6119         Port to C99 semantics for 'inline' of external functions.
6120         Bug reported by Bruno Haible.
6121         * xmalloc.c (xnmalloc_inline): New static inline function,
6122         with the old contents of xnmalloc.
6123         (xnmalloc, xmalloc): Use it.
6124         (xnrealloc_inline): New static inline function,
6125         with the old contents of xnrealloc.
6126         (xnrealloc, xrealloc): Use it.
6127
6128         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6129
6130 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6131
6132         Fix several address-calculation bugs in the hash modules,
6133         plus some minor code cleanup.
6134
6135         * hash.h: Include <stdbool.h>, for bool.
6136         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6137         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6138         hash_get_n_entries, hash_get_max_bucket_length,
6139         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6140         hash_rehash): Use size_t rather than unsigned.
6141         * hash.c (struct hash_table, hash_get_n_buckets,
6142         hash_get_n_buckets_used, hash_get_n_entries,
6143         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6144         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6145         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6146         Likewise.
6147         (SIZE_MAX): Define if not defined.
6148         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6149         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6150         hash_print):
6151         Use const * when possible.
6152         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6153         (check_tuning): Fix bug: if tuning parameters were very close to
6154         0 or 1, rounding errors could have caused subscript violations.
6155         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6156         (hash_initialize): Add 'fail:' label
6157         to free table and return NULL, and use it to simplify code.
6158         Use calloc rather than clearing the storage ourself.
6159         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6160         buffer size calculations.
6161         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6162         Include <stddef.h>, for size_t.
6163         * hash-pjw.c (hash_pjw): Likewise.
6164         Switch to method described by Bruno Haible.
6165         Include <limits.h>, for CHAR_BIT.
6166         (SIZE_BITS): New macro.
6167
6168 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6169
6170         * getndelim2.c (getndelim2): When size calculation overflows,
6171         ceiling the allocation at NMAX bytes rather than silently
6172         discarding input bytes before NMAX is reached.  This makes
6173         a difference only if NMAX exceeds SIZE_MAX / 2.
6174
6175         * obstack.c: Merge from glibc.
6176         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6177         Add libc_hidden_def (_obstack_newchunk).
6178         (_obstack_free) [! defined _LIBC]: Remove.
6179         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6180         a clone of the function body.
6181         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6182         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6183
6184         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6185         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6186         arg to memcpy.
6187
6188         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6189         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6190         Don't use lvalue casts, as GCC plans to remove support for them
6191         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6192         was also present in the non-GCC version, indicating that this
6193         code had always been buggy and had never been widely used.
6194         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6195         Use the fast variant of each macro, rather than copying the
6196         definiens of the fast variant; that way, we'll be more likely to
6197         catch future bugs in the fast variants.
6198
6199 2003-10-20  Bruno Haible  <bruno@clisp.org>
6200
6201         * wait-process.h: New file, from GNU gettext.
6202         * wait-process.c: New file, from GNU gettext.
6203
6204 2003-10-19  Jim Meyering  <jim@meyering.net>
6205
6206         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6207
6208 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6209
6210         * getgroups.c: Include <errno.h>, <stdlib.h>.
6211         (getgroups): First arg is int, not size_t.
6212         Don't let 'free' mangle errno.
6213
6214 2003-10-16  Jim Meyering  <jim@meyering.net>
6215
6216         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6217
6218 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6219
6220         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6221         (SIZE_MAX): Remove.
6222         (new_exclude, add_exclude_file): Initial size no longer needs to
6223         be a power of 2.
6224         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6225         our own address arithmetic overflow checking.
6226
6227         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6228         (fnmatch): Do not alloca more than 2000 wide characters;
6229         instead, use malloc for large buffers.
6230         Check for address arithmetic overflow, and return -1
6231         with errno set to ENOMEM in that case.
6232         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6233         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6234         instead, return -1.  Check for address arithmetic overflow.
6235
6236 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6237
6238         Handle invalid suffixes and overflow independently, so that
6239         callers can treat them independently as needed.  Fix some bugs in
6240         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6241         suffix for a human-readable blocksize.  The major caller-visible
6242         change is the addition of a new
6243         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6244         that both overflow and suffix chars were found.
6245
6246         * human.c (humblock): Don't check separately for invalid suffix
6247         char; that is xstrtoumax's job (now that its bug is fixed).
6248         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6249         INTMAX_MAX]: New macros.
6250         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6251         TYPE_MAXIMUM): New macros.
6252         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6253         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6254         if overflow occurs, as it's what __strtol does and it's more useful
6255         in practice.
6256         (__xstrtol): If __strtol reports some error other than ERANGE,
6257         reflect it to the caller as LONGINT_INVALID.  If it reports
6258         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6259         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6260         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6261         value.
6262         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6263         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6264         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6265         [defined UINTMAX_MAX]: New macros.
6266
6267 2003-10-14  Bruno Haible  <bruno@clisp.org>
6268
6269         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6270         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6271         Also use volatile where needed.
6272
6273 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6274
6275         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6276         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6277         and define in terms of the other primitives.
6278         * xmalloc.c: Include stdbool.h; do not include exit.h.
6279         (SIZE_MAX): Define if not already defined.
6280         (array_size_overflow): New function.
6281         (xalloc_die): Abort instead of exiting if 'error' returns.
6282         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6283         (xmalloc, xrealloc): Use them.
6284         (xcalloc): Check for address arithmetic overflow.
6285         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6286         a bit faster than strcpy.
6287
6288 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6289
6290         Merge getpass from libc, plus a few fixes.
6291
6292         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6293         Include <stdbool.h>.
6294         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6295         __fsetlocking to empty.
6296         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6297         do include <bits/libc-lock.h>.
6298         Do not include <fcntl.h>; not needed.
6299         [_LIBC]: Include <wchar.h>.
6300         (NOTCANCEL_MODE): New macro.
6301         (flockfile, funlockfile) [_LIBC]: New macros.
6302         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6303         [!_LIBC]: New macros.
6304         (call_fclose): New function.
6305         (getpass): Use it.  Save tty stream separately; this simplifies the
6306         code and makes it more reliable if stdin happens to equal stdout.
6307         Invoke __fsetlocking on tty.
6308         Handle thread cancellation if needed.
6309         Namespace cleanup (use __tcgetattr, __getline).
6310         Use bool for Booleans.
6311         [USE_IN_LIBIO]: Handle wide streams.
6312         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6313         stream might go where.
6314
6315         * unlocked-io.h: Include <stdio.h>, so that the caller
6316         doesn't have to include <stdio.h> before us.
6317         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6318         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6319         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6320         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6321         if not declared, so that we can use getpass.c code from libc without
6322         rewriting it.
6323         (flockfile, ftrylockfile, funlockfile): New macros.
6324
6325 2003-10-06  Bruno Haible  <bruno@clisp.org>
6326
6327         * version-etc-2.h: Remove file.
6328         * version-etc-2.c: Remove file.
6329
6330 2003-09-25  Jim Meyering  <jim@meyering.net>
6331             Bruno Haible  <bruno@clisp.org>
6332
6333         This lets translators provide better translations for the
6334         "Written by ..." part of --version output.
6335         * version-etc.h: Include stdarg.h.
6336         (version_etc_copyright): Declare as readonly.
6337         (version_etc): Make this function variadic with a NULL-terminated list
6338         of author name strings.
6339         (version_etc_va): New declaration.
6340         * version-etc.c: Include stdarg.h, stdlib.h.
6341         (version_etc_copyright): Declare as readonly.
6342         (version_etc_va): New function. Provide a different translatable string
6343         for each possible number of authors < 10. Abbreviate when there are 10
6344         authors or more.
6345         (version_etc): Make this function variadic. Call version_etc_va.
6346         Suggestion from Gary V. Vaughan.
6347
6348         * long-options.h (parse_long_options): Change prototype: the authors
6349         string is moved to the end and becomes variadic.
6350         * long-options.c: Include stdarg.h.
6351         (parse_long_options): Make this function variadic, too.
6352         Call version_etc_va, not version_etc.
6353
6354 2003-10-06  Bruno Haible  <bruno@clisp.org>
6355
6356         * fatal-signal.h: New file, from GNU gettext.
6357         * fatal-signal.c: New file, from GNU gettext.
6358
6359 2003-10-04  Karl Berry  <karl@gnu.org>
6360
6361         * argp*: update from libc.
6362
6363 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6364
6365         * getpass.c (getpass): Use a no-op fseek when switching from input to
6366         output mode on the same stream.
6367
6368 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6369
6370         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6371         Fix arg typo in previous patch.
6372
6373 2003-09-28  Jim Meyering  <jim@meyering.net>
6374
6375         * error.c: Correct cpp indentation.
6376
6377 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6378
6379         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6380         Omit the special code that used __typeof__, since we worry that
6381         it could be more trouble than it's worth.  See:
6382         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6383         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6384
6385         * free.c: New file.
6386
6387 2003-09-26  Jim Meyering  <jim@meyering.net>
6388
6389         * error.c (error_tail): Move some declarations
6390         into inner scope where the local variables are used.
6391
6392 2003-09-26  Bruno Haible  <bruno@clisp.org>
6393
6394         * stpncpy.h (gnu_stpncpy): New declaration.
6395         (stpncpy): Define as alias for gnu_stpncpy.
6396         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6397
6398 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6399
6400         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6401         (error_tail): Do not loop, reallocating temporary buffer, since
6402         the output cannot contain more wide characters than the input
6403         contains bytes, the size must be big enough already.  This avoids
6404         one potential size overflow calculation.  Check for size overflow
6405         when calculating temporary buffer size.  Free temporary buffer
6406         when done, if it was allocated with malloc; this plugs a memory
6407         leak.  Remove casts from void * to pointers, that are no longer
6408         needed now that we're assuming C89 or better.
6409
6410         Merge error changes from glibc.
6411
6412         * error.c, error.h: Update copyright notice header to match glibc.
6413         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6414         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6415         Disable cancellation while printing error.
6416         * error.h: Prepend __ to parameter names.
6417
6418 2003-09-25  Karl Berry  <karl@gnu.org>
6419
6420         * argp-fmtstream.c, argp-help.c: update from libc.
6421
6422 2003-09-25  Bruno Haible  <bruno@clisp.org>
6423
6424         * version-etc-2.h: New file, from version-etc.h with modifications.
6425         * version-etc-2.c: New file, from version-etc.c with modifications.
6426
6427 2003-09-25  Simon Josefsson  <jas@extundo.com>
6428
6429         * xgetdomainname.h: New file.
6430         * xgetdomainname.c: New file.
6431
6432 2003-09-25  Simon Josefsson  <jas@extundo.com>
6433             Bruno Haible  <bruno@clisp.org>
6434
6435         * getdomainname.h: New file.
6436         * getdomainname.c: New file.
6437
6438 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6439
6440         * linebuffer.c (freebuffer): Don't free the argument, just
6441         the buffer associated with the argument.  Bug reported by
6442         Simon Josefsson.
6443
6444 2003-09-19  Karl Berry  <karl@gnu.org>
6445
6446         * argp.h: update from libc.
6447
6448 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6449
6450         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6451         input error, instead of returning NULL the next time we are called
6452         (and therefore losing track of errno).
6453
6454 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6455
6456         * getndelim2.c (getndelim2): Don't trash errno when a read
6457         fails, so that the caller gets the proper errno.
6458
6459         * readutmp.c (read_utmp): Likewise.
6460         Check for fstat error.  Close stream and free storage
6461         when failing.
6462
6463 2003-09-14  Bruno Haible  <bruno@clisp.org>
6464
6465         * fwriteerror.h: New file.
6466         * fwriteerror.c: New file.
6467
6468 2003-09-14  Jim Meyering  <jim@meyering.net>
6469
6470         * getloadavg.c: Correct cpp indentation.
6471         * strdup.c: Likewise.
6472         * vasnprintf.c: Likewise.
6473
6474 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6475
6476         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6477         * obstack.c [!defined _LIBC]: Likewise.
6478         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6479         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6480         * exitfail.c: Don't include stdlib.h; no longer needed.
6481
6482         More changes to assume C89 or better.
6483
6484         * error.c (error_tail): Assume vprintf.
6485
6486         * argmatch.c (getenv): Remove decl.
6487         * progreloc.c (get_full_program_name): Define via prototype.
6488         * setenv.c (clearenv): Likewise.
6489         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6490         needed.
6491         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6492         (malloc, memcpy): Remove decls.
6493         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6494         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6495         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6496         (memcpy): Remove macro.
6497         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6498         (__P): Remove.  All uses removed.
6499         (PTR): Remove.  All uses changed to void *.
6500         (CHAR_BIT, NULL): Remove.
6501         (spaces, zeros, memset_space, memset_zero)
6502         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6503         Remove.
6504         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6505         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6506         Define with prototype.
6507         Remove now-unnecessary prototype decl.
6508         (extra_args_spec): Assume ANSI C.  All uses changed.
6509         (extra_args_spec_iso): Remove.
6510         (my_strftime, emacs_strftimeu): Define via prototype.
6511         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6512         unconditionally.
6513         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6514         * strtoimax.c: Include <stdlib.h> unconditionally.
6515         (strtoul, strtol): Remove decls.
6516         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6517         LONG_MAX): Remove.
6518         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6519         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6520         (LOCALE_PARAM_PROTO): New macro.
6521         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6522         (INTERNAL (strtol), strtol): Define with a prototype.
6523         (PARAMS): Remove.  All uses removed.
6524         * tempname.c: Include <string.h> unconditionally.
6525         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6526         * xgethostname.c (main): Define with a prototype.
6527         * xmalloc.c: Include "xalloc.h" first, to check interface.
6528         Include <stdlib.h> unconditionally.
6529         (calloc, malloc, realloc, free): Remove decls.
6530         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6531         Include <stdlib.h> unconditionally.  Sort include file names.
6532         (strtod): Remove.
6533         (xstrtod): Define with a prototype.
6534         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6535         (strtol, strtoul): Remove decls.
6536
6537 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6538
6539         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6540         Include <stdlib.h>, <string.h> unconditionally.
6541         Remove now-unnecessary cast to char *.
6542         * strnlen.c: Include <string.h> unconditionally.
6543         * yesno.c (yesno): Define with a prototype.
6544
6545 2003-09-10  Bruno Haible  <bruno@clisp.org>
6546
6547         * strcspn.c: Include <string.h> unconditionally.
6548         * strpbrk.c: Include <string.h> unconditionally.
6549         * strstr.c: Include <string.h> unconditionally.
6550         * unicodeio.c: Include <string.h> unconditionally.
6551         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6552         * unsetenv.c: Likewise.
6553         * xreadlink.c: Include <stdlib.h> unconditionally.
6554         * yesno.c: Include <stdlib.h> unconditionally.
6555         (rpmatch): Add prototype.
6556
6557 2003-09-10  Jim Meyering  <jim@meyering.net>
6558
6559         * error.c: Correct indentation of cpp directives.
6560
6561 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6562
6563         More K&R removal.
6564
6565         * acosl.c (main): Use a prototype.
6566         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6567         tanl.c: Likewise.
6568
6569         * getloadavg.c (getloadavg, main): Define via prototypes.
6570
6571         * getopt.h (struct option.name): Assume C89, and use 'const'.
6572         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6573         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6574         with a prototype.
6575         * getopt.c (const): Remove macro.
6576         Include <string.h> unconditionally.
6577         (my_index): Remove; all uses changed to strchr.
6578         (strlen): Remove decl.
6579         (exchange): Remove forward decl; no longer needed.
6580         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6581         Define with prototype.
6582         * getopt1.c (const): Remove macro.
6583         (getopt_long, getopt_long_only, main): Define with prototype.
6584
6585         * getugroups.c: Include <string.h> unconditionally.
6586
6587         * getusershell.c: Include <stdlib.h> unconditionally.
6588         (getusershell, setusershell, endusershell, readname, main):
6589         Define with prototypes.
6590
6591         * group-member.c: Include group-member.h first.
6592         Include <stdlib.h> unconditionally.
6593
6594         * hard-locale.c: Include hard-locale.h first.
6595         Include <stdlib.h>, <string.h> unconditionally.
6596
6597         * hash.c (free, malloc): Remove decls.
6598         Include <stdlib.h> unconditionally.
6599
6600         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6601         (getenv): Do not declare.
6602
6603         * idcache.c: Include <string.h> unconditionally.
6604
6605         * long-options.c: Include long-options.h first, to test interface.
6606         Include <stdlib.h> unconditionally.
6607
6608         * makepath.c: Include makepath.h first, to test interface.
6609         Include <stdlib.h> and <string.h> unconditionally.
6610
6611         * linebuffer.c: Include <stdlib.h>.
6612         (free): Remove decl.
6613
6614         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6615         rpl_malloc returns void *, not char *.
6616         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6617
6618         * md5.h: Include <limits.h> unconditionally.
6619         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6620         (__P): Remove; all uses removed.
6621         * md5.c: Include "md5.h" first.
6622         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6623         md5_buffer, md5_process_bytes, md5_process_block):
6624         Define with prototypes.
6625         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6626         * sha.c: Include "sha.h" first.
6627         Include <stdlib.h>, <string.h> unconditionally.
6628
6629         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6630         * memcmp.c (__ptr_t): Likewise.
6631         * memrchr.c (__ptr_t): Likewise.
6632         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6633         Include <string.h> unconditionally.
6634         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6635         * memchr.c: Include <stdlib.h> unconditionally.
6636         * memchr.c (LONG_MAX): Remove.
6637         * memrchr.c (LONG_MAX): Likewise.
6638         * memchr.c (__memchr): Define via a prototype.
6639         * memrchr.c (__memrchr): Likewise.
6640         * memcmp.c (__P): Remove, and remove all uses.
6641         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6642         Remove forward decls; no longer needed.
6643         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6644         Use types required by C89 in prototype.
6645
6646         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6647         * savedir.c: Likewise.
6648         * mkdir.c (free): Remove decl.
6649         * rmdir.c (rmdir): Define with a prototype.
6650         * savedir.c: Include savedir.h first, to test interface.
6651
6652         * mktime.c (STDC_HEADERS): Remove.
6653         Include <stdlib.h>, <string.h> unconditionally.
6654
6655         * modechange.c: Include <stdlib.h> unconditionally.
6656         (malloc): Remove decl.
6657
6658         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6659         (free): Remove decl.
6660
6661         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6662         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6663         (This type really should be intptr_t, but that's a C99ism.)
6664         (_obstack_memcpy): Remove: all uses changed to memcpy.
6665         Include <string.h> unconditionally.
6666         (struct obstack): Assume __STDC__ for types of members
6667         chunkfun, freefun, extra_arg.
6668         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6669         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6670         obstack_begin, obstack_specify_allocation,
6671         obstack_specify_allocation_with_arg, obstack_chunkfun,
6672         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6673         Remove unprototyped decls and the macros that use them.
6674         * obstack.c (POINTER): Remove.  All uses changed to void *.
6675         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6676         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6677         (defined __STDC__ && __STDC__)]:
6678         Remove nonprototyped code.
6679         Include <stdlib.h> unconditionally.
6680         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6681         _obstack_allocated_p, _obstack_free, obstack_free,
6682         _obstack_memory_used, print_and_abort):
6683         Define using prototypes.
6684         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6685         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6686         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6687         obstack_next_free, obstack_object_size, obstack_room) [0]:
6688         Remove unused, unprototyped code.
6689
6690         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6691
6692         * physmem.c (physmem_total, physmem_available, main): Define
6693         with prototypes.
6694
6695         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6696         (main): Define with a prototype.
6697
6698         * posixver.c (getenv): Remove decl.
6699
6700         * putenv.c (malloc): Returns void *, not char *.
6701         Include <string.h> unconditionally.
6702         (strchr, memcpy, NULL): Do not define.
6703
6704         * readtokens.c: Include readtokens.h first, to test interface.
6705         Include <stdlib.h>, <string.h> unconditionally.
6706         (init_tokenbuffer): Define with a prototype.
6707
6708         * regex.c (PARAMS): Remove.  All uses removed.
6709         All uses of _RE_ARGS removed, too.
6710         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6711         unconditionally.
6712         (bzero): Assume memset exists.
6713         (memcmp, memcpy, NULL): Remove.
6714         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6715         char, or assignments to local vars of type signed char.
6716         (init_syntax_once, PREFIX(extract_number_and_incr),
6717         PREFIX(print_partial_compiled_pattern),
6718         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6719         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6720         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6721         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6722         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6723         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6724         wcs_compile_range, byte_compile_range, truncate_wchar,
6725         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6726         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6727         count_mbs_length, wcs_re_match_2_internal,
6728         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6729         PREFIX(alt_match_null_string_p),
6730         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6731         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6732         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6733         now-unnecessary declaration, if any.
6734         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6735         regcomp, regexec):
6736         Remove now-unnecessary casts among pointer types.
6737         * regex.h (_RE_ARGS): Remove.  All uses removed.
6738
6739         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6740         (free): Remove decl.
6741
6742         * rpmatch.c: Include <stdlib.h> unconditionally.
6743
6744         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6745         (free): Remove decl.
6746
6747         * save-cwd.c: Include <stdlib.h> unconditionally.
6748         * xgetcwd.c: Likewise.
6749
6750         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6751         (free): Remove decl.
6752
6753         * strchrnul.c (strchrnul): Define with a prototype.
6754         Fix bug: c_in was not converted to char before searching.
6755
6756         The following changes are not K&R related:
6757
6758         * group-member.h: Include <sys/types.h>, so that this file is
6759         self-contained.
6760         * makepath.h: Likewise.
6761
6762         * getusershell.c (readname, default_index, line_size, readname):
6763         Use size_t, not int, for sizes.
6764         (readname): If the size overflows, report an error instead of
6765         looping forever.
6766
6767 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6768
6769         * getndelim2.c: Assume stdlib.h per the C89 spec.
6770
6771 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6772
6773         Assume C89 or better; remove K&R cruft.
6774         A few of these changes were first proposed by Derek Robert Price
6775         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6776
6777         * addext.c: Include <string.h> unconditionally.
6778         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6779         Don't declare getenv or malloc.
6780
6781         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6782         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6783         (NULL): Remove.
6784         (find_stack_direction, alloca): Use prototypes.
6785
6786         * atexit.c (atexit): Define using a prototype.
6787
6788         * basename.c, dirname.c, stripslash.c:
6789         Include <string.h> unconditionally.
6790
6791         * bcopy.c: Include <stddef.h>.
6792         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6793
6794         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6795
6796         * error.h (error, error_at_line, error_print_progname)
6797         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6798         * error.c: Include error.h first, to check interface.
6799         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6800         (VA_START): Remove; all uses changeed to va_start.
6801         (exit, strerror): Remove decls.
6802         (error_print_progname): Prototype uncondionally.
6803         Don't include <errno.h>; no longer needed.
6804         (private_strerror): Remove.
6805         (error_tail): Always define.
6806         (error, error_at_line): Assume C89 or better; always use prototypes.
6807         * fatal.c: Include "fatal.h" first, to test interface.
6808         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6809         (VA_START): Remove; all uses changed to va_start.
6810         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6811         this case.
6812         (exit): Remove decl.
6813         (fatal): Prototype unconditionally.  Assume va_start works.
6814         Abort at end, to pacify gcc.
6815
6816         * euidaccess.c (main): Define with a prototype.
6817
6818         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6819
6820         * exitfail.c: Include <stdlib.h> unconditionally.
6821
6822         * fnmatch_.h (__P): Remove.  All uses changed to assume
6823         prototypes.
6824         * fnmatch.c: Include fnmatch.h first, to test interface.
6825         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6826         (getenv): Remove decl.
6827         (fnmatch): Define using a prototype.
6828         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6829         (FCT): Define using a prototype.
6830
6831         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6832
6833         * gethostname.c: Include <stddef.h>.
6834         (gethostname): Define with prototype.  Length is size_t, not int.
6835
6836 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6837
6838         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6839         getversion.c should have been removed then, but was accidentally
6840         preserved.
6841
6842         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6843         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6844
6845 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6846
6847         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6848         copy_tm_result.  Bug reported by Simon Josefsson in
6849         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6850
6851 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6852
6853         * time_r.c, time_r.h: New files.
6854
6855         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6856         __localtime_r.
6857         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6858         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6859
6860         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6861         __gmtime_r.
6862         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6863         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6864         Include <time_r.h>.
6865
6866         * timegm.c: Switch to glibc implementation, with the following changes:
6867         [defined HAVE_CONFIG_H]: Include <config.h>.
6868         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6869         (__mktime_internal) [!defined _LIBC]: New decl.
6870         (__gmtime_r) [!defined _LIBC]: New macro and function.
6871         (timegm): Use a prototype, since gnulib assumes C89.
6872         Do not bother declaring tmp to be const, as it's not really usefu.
6873         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6874         (timegm): Declare only if HAVE_DECL_TIMEGM.
6875
6876 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6877
6878         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6879         Bug reported by Lute Kamstra in
6880         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6881
6882         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6883         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6884         course with correspondingly smaller numbers for tomorrow and
6885         yesterday.  From Tadayoshi Funaba.  Originally installed into
6886         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6887         coreutils merge?).
6888
6889 2003-08-31  Simon Josefsson  <jas@extundo.com>
6890
6891         * timegm.h: New file.
6892         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6893
6894 2003-08-31  Karl Berry  <karl@gnu.org>
6895
6896         * argp.h: update from libc.
6897
6898 2003-08-28  Bruno Haible  <bruno@clisp.org>
6899
6900         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6901         warning on QNX, which defines O_BINARY to 000000.
6902
6903 2003-08-24  Bruno Haible  <bruno@clisp.org>
6904
6905         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6906         MSVC7 <stdio.h> is included later.
6907
6908 2003-08-20  Bruno Haible  <bruno@clisp.org>
6909
6910         * progname.h: New file, from GNU gettext.
6911         * progname.c: New file, from GNU gettext.
6912         * progreloc.c: New file, from GNU gettext.
6913
6914 2003-08-19  Bruno Haible  <bruno@clisp.org>
6915
6916         * xstrdup.c: Assume <string.h> exists.
6917
6918 2003-08-18  Jim Meyering  <jim@meyering.net>
6919
6920         * setenv.h: Indent nested cpp directive.
6921         * vasnprintf.c: Remove trailing blanks.
6922
6923 2003-08-17  Simon Josefsson  <jas@extundo.com>
6924             Bruno Haible  <bruno@clisp.org>
6925
6926         * xstrndup.h: New file.
6927         * xstrndup.c: New file.
6928
6929 2003-08-17  Bruno Haible  <bruno@clisp.org>
6930
6931         * strndup.h: New file.
6932
6933 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6934
6935         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6936         space, undoing this 2003-08-12 change:
6937         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6938
6939 2003-08-16  Jim Meyering  <jim@meyering.net>
6940
6941         Merge from coreutils.
6942         * xstrtoimax.c: #else #if -> #elif.
6943         * xstrtoumax.c: Likewise.
6944
6945 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6946
6947         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6948         rather than tab, after '#' in shell-script copyright notices.
6949         Suggested by Bruno Haible.
6950
6951 2003-08-15  Jim Meyering  <jim@meyering.net>
6952         and Paul Eggert  <eggert@twinsun.com>
6953
6954         Merge from coreutils.
6955         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6956         member but strut utmpx does not.  Needed for AIX 4.3.3.
6957         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6958
6959 2003-08-15  Jim Meyering  <jim@meyering.net>
6960
6961         Merge from coreutils.
6962         * xgethostname.c: Include <stdlib.h>.
6963         (xghostname): Don't exit for anything other than memory-related
6964         failure; just return NULL.
6965         * userspec.c: Include "posixver.h".
6966         (parse_user_spec): Accept `.' as a separator only
6967         in pre-POSIX-200112 mode.
6968         * strtoimax.c: Use #elif rather than #else #if.
6969         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6970         Remove function, now that we can rely on a working tzset function.
6971         [!_LIBC]: Ensure that the required autoconf test has been run.
6972         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6973         Use underlying_strftime for %r.
6974         * sha.c: Merge in some clean-up and optimization changes from glibc.
6975         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6976         Ensure that it is a multiple of 64.
6977         Rearrange loop exit tests so as to avoid performing an
6978         additional fread after encountering an error or EOF.
6979         * realloc.c: Update copyright date.
6980
6981 2003-08-14  Jim Meyering  <jim@meyering.net>
6982
6983         Merge from coreutils.
6984         * obstack.h: Whitespace changes.
6985         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6986         and xcalloc return values.
6987         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6988         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6989         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6990         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6991         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6992         error from mntctl.
6993         Use mntctl's return value to drive the entry-processing loop, since
6994         we can't rely on the value of the vmt_length member in the last
6995         entry.  On some systems doing so could result in exhausting
6996         virtual memory.  Based in part on a patch from Mike Jetzer.
6997
6998 2003-08-14  Jim Meyering  <jim@meyering.net>
6999         and Paul Eggert  <eggert@twinsun.com>
7000
7001         Merges from coreutils, plus other fixes.
7002         * physmem.c: Merge in portability changes from gcc/libiberty
7003         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
7004         for credits and details.  Thanks to Kaveh Ghazi for helping
7005         to keep these files in sync.
7006         (ARRAY_SIZE): Define it.
7007         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7008         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7009         (memcasecmp): Don't assume size_t fits in unsigned int.
7010         Remove casts and duplicate code.
7011         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7012         (memcpy): Remove definition.
7013         Merge in some clean-up and optimization changes from glibc.
7014         [BLOCKSIZE]: Move definition to top of file.
7015         Ensure that it is a multiple of 64.
7016         Rearrange loop exit tests so as to avoid performing an
7017         additional fread after encountering an error or EOF.
7018         * md5.h (md5_uintptr): Define.
7019         * makepath.c (CLEANUP_CWD): Report an error if we failed to
7020         return to the initial working directory.  Preserve errno
7021         for caller.
7022         * idcache.c: Include "xalloc.h".
7023         (xmalloc, xrealloc): Remove decls.
7024         (getuser): Remove casts no longer required in C89.
7025         * human.c: Include stdio.h, for sprintf.
7026         * group-member.c: Include "xalloc.h".
7027         (xmalloc, xrealloc): Remove decls.
7028         (get_group_info): Remove casts no longer required in C89.
7029         * getusershell.c (readname): Remove casts no longer required in C89.
7030         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7031         * getline.c: Whitespace fix, from coreutils.
7032
7033 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7034
7035         * exclude.c: Include <ctype.h>
7036         (IN_CTYPE_DOMAIN): New macro.
7037         (is_space): New fn.
7038         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7039         and empty lines.
7040
7041         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7042         Undo previous (whitespace-only) change.
7043
7044 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7045
7046         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7047         Normalize leading white space and remove trailing white space.
7048         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7049         notice, as per ../config/srclist-update.
7050
7051         Merge from coreutils.
7052         * euidaccess.h: New file.
7053         * euidaccess.c: Include it.
7054         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7055         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7056         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7057
7058 2003-08-11  Bruno Haible  <bruno@clisp.org>
7059
7060         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7061         (vasnprintf): Use it instead of wcslen.
7062
7063 2003-08-11  Bruno Haible  <bruno@clisp.org>
7064
7065         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7066         value to ensure that _Bool promotes to int. Use #define for _Bool when
7067         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7068
7069 2003-08-10  Karl Berry  <karl@gnu.org>
7070
7071         * regex.h: update from libc (whitespace fix).
7072
7073 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7074
7075         Merge some files from coreutils.  These changes were
7076         originally made by Jim Meyering.
7077         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7078         many older Unixes require this.
7079         * alloca.c (alloca): Remove cast to argument of free;
7080         no longer needed in C89.
7081         * alloca_.h, regex.h: Fix white space to match
7082         what GNU indent does.
7083
7084 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7085
7086         * bumpalloc.h: Remove.
7087
7088 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7089
7090         * getloadavg.c: Change copyright notice and spacing to conform to
7091         GNU coding style.
7092
7093         Merge from coreutils.
7094         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7095         From glibc.
7096         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7097         from Karl Berry, implemented by Jim Meyering.
7098         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7099         from Dmitry V. Levin.
7100         Remove anachronistic cast of xrealloc.
7101         * fnmatch_.h (__const): Remove.  Use 'const'.
7102         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7103         type. Otherwise, it wouldn't compile with at least /bin/cc on
7104         ymp-cray-unicos9.0.2.X.
7105         Combine two mostly-identical uses of alloca into one.
7106         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7107
7108 2003-08-04  Dave Love <d.love@dl.ac.uk>
7109
7110         [From Emacs.]
7111
7112         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7113         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7114         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7115         obsolete NLIST_NAME_UNION.
7116         [__GNU__]: Undef BSD and FSCALE.
7117         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7118
7119 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7120
7121         * stdbool_.h (_Bool): Make it signed char, instead of
7122         an enum type, so that it's guaranteed to promote to int.  See:
7123         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7124
7125 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7126
7127         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7128         (strerror): Don't assume that a printable int fits in 14 bytes.
7129
7130 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7131             Bruno Haible  <bruno@clisp.org>
7132
7133         * getline.h (getline, getdelim): Change return type to ssize_t.
7134         * getline.c (getline, getdelim): Likewise.
7135         Remove _GNU_SOURCE define; now it's defined in config.h through
7136         m4/getline.m4.
7137
7138 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7139
7140         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7141         over-parenthesization in macros.
7142
7143         Sync with coreutils.
7144
7145         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7146         required by C99.
7147
7148         Use `exit_failure' for xalloc and xmemcoll instead of their own
7149         private exit-failure variables.
7150         * xalloc.h (xalloc_exit_failure): Remove.
7151         * xmalloc.c: Likewise.  Include exitfail.h.
7152         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7153         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7154         * xmemcoll.c: Likewise.  Include exitfail.h.
7155         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7156
7157 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7158
7159         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7160         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7161         to test that it can stand by itself.  Include "exitfail.h".
7162         Clients should set exit_failure instead.
7163         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7164
7165 2003-07-18  Andreas Schwab  <schwab@suse.de>
7166
7167         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7168
7169 2003-07-18  Bruno Haible  <bruno@clisp.org>
7170
7171         * getndelim2.h: New file.
7172         * getndelim2.c: Make into a module of its own. Include config.h,
7173         getndelim2.h.
7174         (getndelim2): Make non-static. Change return type to ssize_t.
7175         * getline.h: Change argument names.
7176         * getline.c: Include getndelim2.h instead of getndelim2.c.
7177         * getnline.c: Include getndelim2.h.
7178
7179 2003-07-17  Bruno Haible  <bruno@clisp.org>
7180
7181         * Makefile.am: Remove file.
7182         * Makefile.in: Remove file.
7183
7184 2003-07-17  Bruno Haible  <bruno@clisp.org>
7185
7186         * getnline.h: New file.
7187         * getnline.c: New file.
7188         * getndelim2.c: New file, extracted from getline.c.
7189         (getndelim2): Renamed from getdelim2, with added nmax argument.
7190         * getline.c: Include getndelim2.c.
7191         (getdelim2): Moved out to getndelim2.c.
7192         (getline, getdelim): Update.
7193
7194 2003-07-15    <karl@gnu.org>
7195
7196         * vasnprintf.c: update from gettext.
7197
7198 2003-07-15  Jim Meyering  <jim@meyering.net>
7199
7200         * makepath.c (make_path): Enclose diagnostic in _(...).
7201
7202 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7203
7204         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7205         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7206         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7207         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7208         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7209         updated automatically by ../config/srclist-update.  This changes
7210         their license from LPGL to GPL.
7211
7212 2003-07-14  Jim Meyering  <jim@meyering.net>
7213
7214         Don't emit diagnostics.  Let callers do that.
7215         * save-cwd.c: Don't include "error.h".
7216         (save_cwd): Don't call error.  Ensure that errno is valid
7217         when returning nonzero.
7218
7219         * save-cwd.h (restore_cwd): Update prototype.
7220         * save-cwd.c (restore_cwd): Remove two parameters.
7221         Simplify.  Don't call error upon failure.  Let callers do that.
7222         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7223         when auditing is enabled.  But don't bother updating the #if.
7224
7225 2003-07-14  Simon Josefsson  <jas@extundo.com>
7226
7227         * mempcpy.h: New file.
7228         * mempcpy.c: New file.
7229
7230 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7231
7232         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7233         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7234         unicodeio.c, unicodeio.h, unlocked-io.h:
7235         Switch from LGPL to GPL.
7236
7237 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7238
7239         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7240         it breaks C++ compilation.
7241         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7242
7243 2003-07-10  Jim Meyering  <jim@meyering.net>
7244
7245         * vasnprintf.c: Remove trailing blanks.
7246         Make cpp indentation consistent.
7247
7248 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7249
7250         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7251         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7252         Switch from LGPL to GPL.
7253
7254 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7255
7256         * mktime.c: Fix some boundary cases and remove need for floating point.
7257
7258         Issue a compile-time diagnostic if time_t is floating point, or if
7259         two's complement arithmetic is not in effect, or if arithmetic
7260         right shift does not propagate the sign.  These assumptions were
7261         all in the original code but they weren't checked.
7262
7263         (TIME_T_MIDPOINT, verify): New macros.
7264         (__isleap): Remove; it has integer overflow problems.
7265         (leapyear): New function, without those problems.
7266         (ydhms_tm_diff): Remove; splitting into two parts.
7267         (ydhms_diff): New function, containing the arithmetic part of
7268         the old ydhms_tm_diff function.  Issue a compile-time
7269         diagnostic if we are not using C99 integer division.
7270         Avoid casts when possible.
7271         (guess_time_tm): New function, containing the checking part of
7272         the old ydhms_tm_diff function.  Return the new value, rather than
7273         the difference between it and the old.  Accept a new argument T
7274         so that *T specifies the old value.  Check for overflow in the result.
7275
7276         (__mktime_internal): Use a time_t offset, not a long int offset.
7277         This undoes the 2003-06-04 change, which is no longer needed now
7278         that we have better overflow checking.
7279         (localtime_offset): Likewise.
7280
7281         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7282         and long are 64-bit but int is only 32-bit.
7283         (ydhms_diff): Use long int to store year1 and yday1.
7284         Issue a compile-time diagnostic if long int is not wide enough.
7285
7286         (__mktime_internal): Use long int to store adjusted year and yday.
7287         Use plain C rather than preprocessor commands, if that doesn't
7288         affect efficiency.
7289         Check for overflow (and try to repair) after each probe
7290         rather than checking only at the very end.  This avoids some bugs
7291         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7292         does not equal GMT offset at maximum time).
7293         Use integer to check for overflow rather than floating point; this
7294         is more portable to non-IEEE hosts, and is a tad faster.
7295         When we detect that we are oscillating between two values,
7296         don't check whether tm_isdst has the requested value, since
7297         we already know the answer.  When tm_isdst has the wrong value,
7298         use a different heuristic to find the right one, based on the
7299         extreme values actually observed in practice in tz2003a,
7300         rather than the (overly optimistic) "previous 3 calendar quarters".
7301
7302         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7303         "T const" to accommodate glibc style.
7304         (check_result): Use less-confusing report format.  "long" -> "long int.
7305         (main): Likewise.
7306         Don't loop if the iteration overflows time_t.
7307         Allow a negative step in the iteration.
7308
7309 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7310
7311         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7312         having it depend on HAVE_SYS_TYPES_H.
7313
7314 2003-06-25  Bruno Haible  <bruno@clisp.org>
7315
7316         * readlink.c: New file.
7317
7318 2003-06-20  Bruno Haible  <bruno@clisp.org>
7319
7320         Assume C89, so PARAMS isn't needed.
7321         * unicodeio.h (PARAMS): Remove.
7322         * unicodeio.c: Don't use PARAMS.
7323
7324 2003-06-18  Jim Meyering  <jim@meyering.net>
7325
7326         Merge changes from coreutils.
7327         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7328         Remove explicit declarations of xmalloc and realloc.
7329         Include xalloc.h.
7330         (read_utmp): Remove anachronistic cast of xmalloc.
7331
7332 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7333
7334         Assume C89, so PARAMS isn't needed.
7335         * backupfile.h (PARAMS): Remove.  All uses removed.
7336         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7337         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7338         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7339         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7340         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7341         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7342         xstrtol.h: Likewise.
7343         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7344         same.h, strverscmp.h: Do not include config.h; no longer needed.
7345         Anyway, config.h should always be included before any other file.
7346
7347 2003-06-11  Simon Josefsson  <jas@extundo.com>
7348
7349         * sysexit_.h: New file.
7350
7351 2003-05-20  Derek Price  <derek@ximbiot.com>
7352
7353         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7354
7355 2003-06-10  Simon Josefsson  <jas@extundo.com>
7356
7357         * strchrnul.h: New file.
7358         * strchrnul.c: New file.
7359
7360 2003-06-10  Simon Josefsson <jas@extundo.com>
7361
7362         * argp.h: New file, from glibc.
7363         * argp-ba.c: New file, from glibc.
7364         * argp-eexst.c: New file, from glibc.
7365         * argp-fmtstream.c: New file, from glibc.
7366         * argp-fmtstream.h: New file, from glibc.
7367         * argp-fs-xinl.c: New file, from glibc.
7368         * argp-help.c: New file, from glibc.
7369         * argp-namefrob.h: New file, from glibc.
7370         * argp-parse.c: New file, from glibc.
7371         * argp-pv.c: New file, from glibc.
7372         * argp-pvh.c: New file, from glibc.
7373         * argp-xinl.c: New file, from glibc.
7374
7375 2003-06-07  Jim Meyering  <jim@meyering.net>
7376
7377         * readtokens.h: Put `Free Software Foundation, Inc.'
7378         in place of my name in the copyright comment.
7379         Remove definition and uses of __P.
7380
7381         From coreutils.
7382         * stat.c: Don't declare xmalloc explicitly.
7383         Instead, include "xalloc.h".
7384         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7385         xrealloc, and xcalloc return values.
7386         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7387         Improve comment.
7388         * xgetcwd.h: Remove definition/uses of PARAMS.
7389
7390 2003-06-06  Jim Meyering  <jim@meyering.net>
7391
7392         * stdbool_.h: Renamed from stdbool.h.in.
7393
7394 2003-06-06  Jim Meyering  <jim@meyering.net>
7395
7396         Merge from coreutils.
7397         * same.c: (same_name): Declare *_basename locals to be `const'.
7398         Consolidate declarations and initializations of *_base* locals.
7399
7400         Merge from coreutils.
7401         This avoids a core dump on systems without GNU putenv,
7402         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7403         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7404         (unsetenv): New static function, from GNU libc.
7405         (rpl_putenv): Use it.
7406
7407         * modechange.c: Remove trailing blanks.
7408
7409         Merge from coreutils.
7410         * fsusage.c: Remove declaration of statfs.
7411         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7412
7413         * posixtm.c: Include <stdbool.h> unconditionally.
7414
7415 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7416
7417         * mktime.c (__mktime_internal): When resolving a tm_isdst
7418         mismatch, look in future quarters as well as past.  This fixes a
7419         bug when processing fall-backwards gaps immediately after a long
7420         period of daylight-saving time.
7421
7422         * mktime.c: Assume freestanding C89 or better.
7423         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7424         (__P): Remove; not used.
7425         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7426         (mktime, not_equal_tm, print_tm, check_result,
7427         main): Use prototypes.  Use const * where appropriate.
7428         (main): Fix typo in testing code that uncovered by above changes.
7429         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7430
7431 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7432
7433         * mktime.c: Fix Debian bug 177940
7434         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7435         (localtime_offset): Now long int, not time_t, because we want it
7436         to be guaranteed to be signed.  All uses changed.
7437         (__mktime_internal): If overflow would occur when adding offset,
7438         don't add it.
7439
7440         Merge 'human' changes from coreutils.  Rewrite to support
7441         locale-specific notations like thousands separators.
7442         * human.c: Simplify authorship notice.
7443         Include human.h immediately after config.h.
7444         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7445         <limits.h>: Do not include, since human.h does.
7446         (SIZE_MAX, UINTMAX_MAX): New macros.
7447         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7448         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7449         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7450         (power_letter): Renamed from suffixes.
7451         (generate_suffix_backwards): Remove.
7452         (adjust_value): Now takes int style (because of human.h changes)
7453         and long double value (for greater precision on some platforms).
7454         (group_number): New function.
7455         (human_readable): Use it.  Use integer options, not enum.
7456         Put the options before the sizes in the arg list.
7457         Support all the new options.
7458         The old human_readable function has been removed;
7459         use inttostr.h instead.
7460         (human_readable, default_block_size, humblock):
7461         Use uintmax_t, not int, for block sizes.
7462         (human_readable_inexact, block_size_types): Remove.
7463         (block_size_opts): New constant.
7464         (human_options): Renamed from human_block_size, with new signature
7465         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7466         * human.h: Add copyright and authorship notice.
7467         Include <limits.h> and <stdbool.h> unconditionally.
7468         (PARAMS): Remove.  All uses removed.
7469         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7470         (enum human_inexact_style): Remove tag; now a nameless enum.
7471         (human_floor, human_ceiling, human_round_to_even): Now have
7472         values 2, 0, 1 rather than -1, 1, 0.
7473         (human_group_digits, human_suppress_point_zero, human_autoscale,
7474         human_base_1024, human_SI, human_B): New constants.
7475         (human_readable_inexact, human_block_size): Remove.
7476         (human_readable): Size args are now uintmax_t, not int.
7477         (human_options): New decl.
7478
7479         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7480         unnecessary now that we assume C89 or better.  This change
7481         imported from coreutils.
7482
7483         * mktime.c (__mktime_internal): Do not reject negative timestamps
7484         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7485         in the 2003-05-30 sync from glibc.
7486
7487         .h files should stand alone, but we shouldn't include <sys/types.h>
7488         if we can get away with just <stddef.h>.
7489
7490         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7491         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7492         rather than <sys/types.h>, as we merely need size_t.
7493         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7494         to get size_t.
7495         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7496         Include <stdio.h>, to get FILE.
7497         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7498         memcasecmp.h has included <stddef.h> and all we need is size_t.
7499         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7500         our interface, instead of including <sys/types.h>
7501
7502 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7503
7504         [from coreutils]
7505         Fix some minor time-related bugs with POSIX time arguments.
7506         Some valid time stamps were being rejected (notably -1, and
7507         time stamps before 1900 on 64-bit hosts).  And some invalid
7508         time stamps were being accepted, e.g. September 31.
7509
7510         * posixtm.h (posixtime): Return bool instead of time_t, so
7511         that we can return (time_t) -1 successfully.
7512         * posixtm.c: Likewise.
7513         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7514         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7515         (t): Remove static var.
7516         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7517         of static var.  All uses changed.
7518         (year): Do not reject years before 1900; they can occur with
7519         64-bit time_t.
7520         (posix_time_parse): Do not check for out-of-range components;
7521         that is now the caller's responsibility, since our checks were
7522         only approximations.
7523         (posixtime): Use mktime to check for out-of-range components,
7524         since it knows them exactly.
7525         If mktime returns (time_t) -1, check whether an error actually occurred
7526         by invoking localtime on -1.
7527         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7528         posixtime failures better.
7529         Improve the test data (in comments only).
7530
7531 2003-05-30    <karl@gnu.org>
7532
7533         * mktime.c: update from libc.
7534
7535 2003-05-30  Bruno Haible  <bruno@clisp.org>
7536
7537         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7538         * localcharset.h: Likewise.
7539         * localcharset.c: Likewise.
7540
7541 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7542
7543         Assume the headers required for C89 freestanding compilers.
7544         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7545         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7546         without checking for HAVE_LIMITS_H.
7547         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7548         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7549         to do that.
7550         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7551         * exclude.c: Include <stdbool.h> unconditionally.
7552         * tempname.c: Include <stddef.h> unconditionally.
7553         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7554         * modechange.c, rpmatch.c (NULL): Don't define, since
7555         <stddef.h> does that.
7556         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7557         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7558         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7559         * xstrtol.c: Likewise.
7560         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7561         * savedir.c: Include <stddef.h> instead of defining NULL.
7562
7563         * addext.c (addext): Use assignment rather than cast, to avoid
7564         warnings on some platforms.
7565
7566         * mktime.c (__mktime_internal): Do not reject negative timestamps
7567         arbitrarily.
7568
7569 2003-05-10  Bruno Haible  <bruno@clisp.org>
7570
7571         * linebreak.c (iconv_string_length): Don't return -1 just because the
7572         string is longer than 4 KB.
7573
7574 2003-05-12  Jim Meyering  <jim@meyering.net>
7575
7576         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7577         the space-padded-by-default conversion specifiers, %e, %k, %l.
7578
7579 2003-05-03  Bruno Haible  <bruno@clisp.org>
7580
7581         Upgrade to Unicode-4.0.
7582         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7583         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7584         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7585         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7586         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7587         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7588         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7589         Change width of U+E0100..U+E01EF from 1 to 0.
7590
7591 2003-04-25  Bruno Haible  <bruno@clisp.org>
7592
7593         * copy-file.c: Include <stddef.h>, for size_t.
7594
7595 2003-04-25  Jim Meyering  <jim@meyering.net>
7596
7597         * copy-file.c (copy_file_preserving): Declare buf_size to be
7598         of type size_t, not int.
7599
7600 2003-04-11  Jim Meyering  <jim@meyering.net>
7601
7602         Merge changes from Coreutils.
7603
7604         2003-03-22  Jim Meyering  <jim@meyering.net>
7605
7606         * strftime.c (widen): Cast alloca return value to proper type.
7607
7608         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7609
7610         From GNU libc.
7611         * strftime.c (my_strftime): Handle very large width
7612         specifications for numeric values correctly.  Improve checks for
7613         overflow.
7614
7615         2003-01-19  Jim Meyering  <jim@meyering.net>
7616
7617         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7618         (nl_get_alt_digit) [! defined my_strftime]: Define.
7619         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7620         _nl_get_alt_digit and _nl_get_walt_digit.
7621
7622         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7623         These changes have no effect outside of _LIBC.
7624
7625 2003-04-10  Bruno Haible  <bruno@clisp.org>
7626
7627         * findprog.h: New file, from GNU gettext.
7628         * findprog.c: New file, from GNU gettext.
7629
7630 2003-04-05  Jim Meyering  <jim@meyering.net>
7631
7632         Merge changes from Coreutils.
7633
7634         * exclude.h (PARAMS): Remove definition and uses.
7635         * exclude.c: Remove uses of `PARAMS'.
7636
7637         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7638         Add test-cases for DOS filenames. Declare program_name.
7639         (main): Set up program_name.  Patch by Rich Dawe.
7640
7641         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7642         error from mntctl.
7643         Use mntctl's return value to drive the entry-processing loop, since
7644         we can't rely on the value of the vmt_length member in the last
7645         entry.  On some systems doing so could result in exhausting
7646         virtual memory.  Based in part on a patch from Mike Jetzer.
7647
7648 2003-04-04  Bruno Haible  <bruno@clisp.org>
7649
7650         * linebreak.h: New file, from GNU gettext.
7651         * linebreak.c: New file, from GNU gettext with slight modifications.
7652         * lbrkprop.h: New file, from GNU gettext.
7653
7654 2003-04-03  Bruno Haible  <bruno@clisp.org>
7655
7656         * utf8-ucs4.h: New file, from GNU gettext.
7657         * utf16-ucs4.h: New file, from GNU gettext.
7658         * ucs4-utf8.h: New file, from GNU gettext.
7659         * ucs4-utf16.h: New file, from GNU gettext.
7660
7661 2003-04-02  Bruno Haible  <bruno@clisp.org>
7662
7663         * binary-io.h: New file, from GNU gettext.
7664
7665 2003-04-01  Bruno Haible  <bruno@clisp.org>
7666
7667         * pathname.h: New file, from GNU gettext.
7668         * concatpath.c: New file, from GNU gettext.
7669
7670 2003-03-30  Bruno Haible  <bruno@clisp.org>
7671
7672         * copy-file.c (copy_file_preserving): Don't set owner if the function
7673         chown() doesn't exist.
7674
7675 2003-03-28  Bruno Haible  <bruno@clisp.org>
7676
7677         * copy-file.h: New file, from GNU gettext.
7678         * copy-file.c: New file, from GNU gettext.
7679
7680 2003-03-18  Jim Meyering  <jim@meyering.net>
7681
7682         * quote.c (quote_n): Fix typo in comment.
7683
7684 2003-03-14  Jim Meyering  <jim@meyering.net>
7685
7686         Merge changes from Coreutils.
7687         * obstack.h (obstack_object_size): Declare temporary, __o,
7688         to be const, in order to avoid warnings.
7689         (obstack_room): Likewise.
7690         (obstack_empty_p): Likewise.
7691
7692 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7693
7694         Merge changes from Bison.
7695         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7696         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7697         when compiling Bison 1.875's `bitset bset = obstack_alloc
7698         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7699         * hash.c: Include <stdbool.h> unconditionally.
7700
7701 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7702
7703         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7704         Reported by Bruce Becker; see:
7705         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7706
7707 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7708             Bruno Haible  <bruno@clisp.org>
7709
7710         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7711         Reported by John Hughes, see
7712         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7713
7714 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7715
7716         * poll_.h: New file.
7717         * poll.c: New file.
7718
7719 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7720
7721         * mathl.h: New file.
7722         * acosl.c: New file.
7723         * asinl.c: New file.
7724         * atanl.c: New file.
7725         * ceill.c: New file.
7726         * cosl.c: New file.
7727         * expl.c: New file.
7728         * floorl.c: New file.
7729         * frexpl.c: New file.
7730         * ldexpl.c: New file.
7731         * logl.c: New file.
7732         * sincosl.c: New file.
7733         * sinl.c: New file.
7734         * sqrtl.c: New file.
7735         * tanl.c: New file.
7736         * trigl.c: New file.
7737         * trigl.h: New file.
7738
7739 2003-02-17  Bruno Haible  <bruno@clisp.org>
7740
7741         * mkdtemp.h: New file, from GNU gettext.
7742         * mkdtemp.c: New file, from GNU gettext.
7743
7744 2003-01-31  Bruno Haible  <bruno@clisp.org>
7745
7746         * rename.c: #undef rename before defining rpl_rename.
7747         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7748
7749 2003-01-30  Bruno Haible  <bruno@clisp.org>
7750
7751         * printf-args.h: New file, from GNU gettext.
7752         * printf-args.c: New file, from GNU gettext.
7753         * printf-parse.h: New file, from GNU gettext.
7754         * printf-parse.c: New file, from GNU gettext.
7755         * vasnprintf.h: New file, from GNU gettext.
7756         * vasnprintf.c: New file, from GNU gettext.
7757         * asnprintf.c: New file, from GNU gettext.
7758         * vasprintf.h: New file, from GNU gettext with modifications.
7759         * vasprintf.c: New file, from GNU gettext.
7760         * asprintf.c: New file, from GNU gettext.
7761
7762 2003-01-29  Bruno Haible  <bruno@clisp.org>
7763
7764         * stpncpy.h: New file, from GNU gettext with modifications.
7765         * stpncpy.c: New file, from GNU gettext with modifications.
7766
7767 2003-01-28  Bruno Haible  <bruno@clisp.org>
7768
7769         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7770         Paul Eggert.
7771         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7772         Paul Eggert.
7773
7774 2003-01-27  Bruno Haible  <bruno@clisp.org>
7775
7776         * xsetenv.h: New file, from GNU gettext.
7777         * xsetenv.c: New file, from GNU gettext.
7778
7779 2003-01-23  Bruno Haible  <bruno@clisp.org>
7780
7781         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7782
7783 2003-01-22  Bruno Haible  <bruno@clisp.org>
7784
7785         * exit.h: New file, from GNU gettext.
7786
7787 2003-01-11  Bruno Haible  <bruno@clisp.org>
7788
7789         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7790         * strcase.h (strcasecmp, strncasecmp): Likewise.
7791
7792 2003-01-14  Jim Meyering  <jim@meyering.net>
7793
7794         * same.c (same_name): Tweak a comment.
7795
7796 2003-01-11  Bruno Haible  <bruno@clisp.org>
7797
7798         * same.c (same_name): Reorder tests so as to avoid calling stat()
7799         when a string comparison is sufficient.
7800
7801 2003-01-11  Bruno Haible  <bruno@clisp.org>
7802
7803         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7804         'unsigned int'.
7805
7806 2003-01-11  Bruno Haible  <bruno@clisp.org>
7807
7808         * hash-pjw.c: Add comment about low quality of this function.
7809
7810 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7811
7812         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7813         to avoid collisions with libcurses and libreadline.
7814
7815         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7816         * getstr.h, getstr.c: Remove.
7817         * getline.c: Include "getline.h", to check interface.
7818         Move body of old getstr.c here: this defines MIN_CHUNK and
7819         declares getdelim2, which is renamed from getstr.
7820         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7821
7822         * linebuffer.c (readlinebuffer): Renamed from readline.
7823         All uses changed.
7824         * linebuffer.h: Likewise.
7825         (readline): Remove backward-compatibility macro.
7826
7827 2003-01-12  Jim Meyering  <jim@meyering.net>
7828
7829         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7830
7831 2003-01-10  Bruno Haible  <bruno@clisp.org>
7832
7833         * alloca_.h: New file.
7834         * getdate.y: Unconditionally include alloca.h.
7835         * makepath.c: Likewise.
7836         * setenv.c: Likewise.
7837         * userspec.c: Likewise.
7838
7839 2003-01-09  Bruno Haible  <bruno@clisp.org>
7840
7841         * stdbool.h.in: New file.
7842
7843 2003-01-08  Bruno Haible  <bruno@clisp.org>
7844
7845         * safe-read.c: Include specification header first, to ensure its
7846         selfcontainedness.
7847         * full-write.c: Likewise.
7848
7849 2003-01-08  Jim Meyering  <jim@meyering.net>
7850
7851         * full-write.c: Undefine and define-away `const' after inclusion
7852         of errno.h, not before.  Suggestion from Bruno Haible.
7853
7854 2003-01-07  Jim Meyering  <jim@meyering.net>
7855
7856         * full-write.c: Rework so that it may serve to define full_read, too.
7857         * full-read.c: Simply #define FULL_READ and include full-write.c.
7858
7859 2003-01-06  Jim Meyering  <jim@meyering.net>
7860
7861         * version-etc.c: Update year in translatable copyright string.
7862
7863 2002-12-25  Bruno Haible  <bruno@clisp.org>
7864
7865         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7866         * xstrtol.h: Likewise.
7867         * xstrtoimax.c: Likewise.
7868         * xstrtoumax.c: Likewise.
7869         * human.h: Likewise.
7870
7871         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7872         on systems that have <inttypes.h> but not <stdint.h>.
7873
7874 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7875
7876         * memcoll.c (memcoll): Fall back on a simple algorithm using
7877         memcmp if strcoll doesn't work.
7878
7879 2002-12-23  Bruno Haible  <bruno@clisp.org>
7880
7881         * localcharset.h: New file.
7882         * localcharset.c: Include it.
7883         * unicodeio.c: Likewise.
7884
7885 2002-12-22  Bruno Haible  <bruno@clisp.org>
7886
7887         * utime.c (utime_null): No need to call ftruncate if the file was
7888         nonempty.
7889
7890 2002-12-23  Bruno Haible  <bruno@clisp.org>
7891
7892         * memcoll.c (STRCOLL): New macro.
7893         (memcoll): Use it.
7894
7895 2002-12-22  Bruno Haible  <bruno@clisp.org>
7896
7897         * getstr.h (getstr): Define, to avoid clash with libcurses.
7898         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7899
7900 2002-12-22  Bruno Haible  <bruno@clisp.org>
7901
7902         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7903
7904 2002-12-23  Bruno Haible  <bruno@clisp.org>
7905
7906         * getline.h: Include <stddef.h>, for size_t.
7907
7908         * unicodeio.h: Include <stddef.h>, for size_t.
7909         * unicodeio.c: Don't include <stddef.h>.
7910
7911 2002-12-17  Bruno Haible  <bruno@clisp.org>
7912
7913         * canon-host.c (strdup): Remove unused declaration.
7914
7915         * fsusage.c: Include full_read.h.
7916         (get_fs_usage): Use full_read instead of safe_read.
7917
7918         * utime.c (utime_null): Use SAFE_READ_ERROR.
7919
7920 2002-12-11  Bruno Haible  <bruno@clisp.org>
7921
7922         * setenv.h: Rewritten to cope with systems that have setenv() but not
7923         unsetenv().
7924         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7925         modifications:
7926
7927         2002-12-11  Bruno Haible  <bruno@clisp.org>
7928
7929                 * setenv.c (alloca): Fall back to malloc.
7930                 (freea): New macro.
7931                 (setenv): Use freea() to free memory allocated with alloca().
7932
7933         2002-11-13  Bruno Haible  <bruno@clisp.org>
7934
7935                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7936                 function declarations.
7937                 * unsetenv.c (unsetenv): Likewise.
7938
7939         2002-03-04  Bruno Haible  <bruno@clisp.org>
7940
7941                 Portability to AIX 4.3.3.
7942                 * unsetenv.c: New file, extracted from setenv.c.
7943                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7944
7945         2001-12-20  Bruno Haible  <bruno@clisp.org>
7946
7947                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7948                 use malloc instead. For SunOS 4.
7949
7950         2001-12-11  Bruno Haible  <bruno@clisp.org>
7951
7952                 * setenv.c: Declare alloca.
7953                 (compar_fn_t): New typedef.
7954                 (KNOWN_VALUE, STORE_VALUE): Use it.
7955
7956         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7957         setenv.h.
7958
7959 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7960
7961         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7962         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7963         Choose values that are less likely to collide with system fnmatch
7964         options.
7965         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7966         defined (e.g., a pure POSIX system).
7967         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7968         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7969
7970 2002-12-06  Jim Meyering  <jim@meyering.net>
7971
7972         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7973
7974         Merge in changes from libc's misc/error.c, in preparation
7975         for the merge of gnulib's changes back into libc.
7976
7977         * error.c (_): Define only if not already defined.
7978         Move definition to follow all #include directives.
7979         Include unlocked-io.h only if !_LIBC.
7980         [_LIBC]: Include <libio/libioP.h>.
7981         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7982         (fflush): Tweak definition to use INTUSE.
7983         (putc): Define.
7984
7985 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7986
7987         * alloca.c [defined emacs]: Include "lisp.h".
7988         (xalloc_die) [defined emacs]: New macro.
7989         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7990         [! defined emacs]: Include <xalloc.h>.
7991         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7992         (pointer): Typedef to POINTER_TYPE *.
7993         (malloc): Remove decl; we now always use xmalloc.
7994         (alloca): Use old-style definition, since Emacs needs this.
7995         Check for arithmetic overflow when computing combined size.
7996
7997 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7998
7999         Do not generate unlocked-io.h automatically, since it's easier to
8000         maintain it by hand.
8001
8002         * unlocked-io.h: New file, from GNU diffutils,
8003         but with proper copyright notice and attribution.
8004         * gen-uio: Remove.
8005         * Makefile.am: Add copyright notice.
8006         (libfetish_a_SOURCES): Add unlocked-io.h.
8007         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8008         (DISTCLEANFILES, io_functions): Remove macros.
8009         (EXTRA_DIST): Remove gen_uio.
8010         (unlocked-io.h): Remove rule.
8011
8012 2002-12-04  Jim Meyering  <jim@meyering.net>
8013
8014         Reflect the fact that stat.c and lstat.c are no longer generated.
8015         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8016         (DISTCLEANFILES): Likewise.
8017         (EXTRA_DIST): Likewise.
8018         (all_local): Don't depend on stat.c or lstat.c.
8019         (stat.c, lstat.c): Remove rules.
8020         (EXTRA_DIST): Remove xstat.in.
8021
8022         * xstat.in: Remove file.  Contents moved into stat.c.
8023         * stat.c: New file.  Contents mostly from xstat.in.
8024         * stat.c: Rework so that it may serve to define rpl_lstat, too.
8025         * lstat.c: New file. Simply #define LSTAT and include stat.c.
8026
8027         * safe-read.c: Rework so that it may serve to define safe_write, too.
8028         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8029
8030 2002-12-03  Jim Meyering  <jim@meyering.net>
8031
8032         * safe-read.c, safe-write.c: Change variable names and comments, but
8033         not semantics, to minimize the differences between these two files.
8034         (safe_read): Change comment to mention SAFE_READ_ERROR.
8035
8036         * safe-read.c (IS_EINTR): Define.
8037         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8038
8039 2002-12-02  Bruno Haible  <bruno@clisp.org>
8040
8041         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8042         Define, taken from safe-read.c.
8043         (INT_MAX): Provide fallback.
8044         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8045         * safe-write.h (SAFE_WRITE_ERROR): Define.
8046
8047         * safe-read.c (EINTR): Remove definition.
8048         (safe_read): Don't use EINTR if it is absent.
8049
8050 2002-12-02  Jim Meyering  <jim@meyering.net>
8051
8052         * safe-read.c (EINTR): Define.
8053         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8054         (INT_MAX): Provide fallback.
8055         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8056
8057         * safe-read.h (SAFE_READ_ERROR): Define.
8058
8059 2002-12-01  Jim Meyering  <jim@meyering.net>
8060
8061         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8062         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8063
8064 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8065
8066         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8067         hash_rehash): Replace `if (limit <= value) abort ();' with
8068         `if (! (value < limit)) abort ();', for readability.
8069
8070 2002-11-26    <karl@gnu.org>
8071
8072         * strdup.c: copy from libc again, with jim's ok.
8073         * .cppi-disable: re-add strdup.c
8074
8075 2002-11-25    <karl@gnu.org>
8076
8077         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8078         instead of "strtol.c".
8079
8080 2002-11-25  Jim Meyering  <jim@meyering.net>
8081
8082         * mktime.c: Sync from libc, now that it has the latest fix.
8083
8084 2002-11-24    <karl@gnu.org>
8085
8086         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8087         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8088
8089 2002-11-24  Jim Meyering  <jim@meyering.net>
8090
8091         Update from coreutils:
8092
8093         * mktime.c: Merge in changes from libc.
8094
8095         Avoid a link-time failure on some Linux systems.
8096         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8097         (__mon_yday): Declare with the STATIC attribute.
8098         (__mktime_internal): Likewise.
8099         Based on a report from Greg Schafer.
8100
8101 2002-11-23  Jim Meyering  <jim@meyering.net>
8102
8103         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8104         Use `unsigned', not `int', as type of index.
8105
8106         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8107
8108         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8109
8110 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8111
8112         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8113         hint that one should use `if (! x) abort ();' rather than `assert
8114         (x);', and anyway it's one less thing to worry about configuring.
8115         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8116         hash_rehash, hash_insert): Use abort rather than assert.
8117
8118 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8119
8120         * quotearg.h: Allow multiple inclusion by surrounding with
8121         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8122         so that we can be included first.
8123         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8124         * quotearg.c: Include quotearg.h immediately after config.h.
8125         No need to include stddef.h or sys/types.h any more.
8126         Surround local include files with "", not "<>".
8127         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8128         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8129         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8130         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8131         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8132         (ISPRINT): Remove; no longer needed now that we assume C89.
8133
8134         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8135         Preserve errno.
8136
8137         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8138         quotearg_char): Use SIZE_MAX rather than
8139         (size_t) -1 when we are talking about "infinity".
8140
8141         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8142
8143 2002-11-22  Bruno Haible  <bruno@clisp.org>
8144
8145         * safe-read.h: Assume C89. Add comments.
8146         (safe_read): Change return type to size_t.
8147         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8148         counts > SSIZE_MAX correctly.
8149         * safe-write.h: New file.
8150         * safe-write.c: New file.
8151         * full-read.h: New file.
8152         * full-read.c: New file.
8153         * full-write.h: Assume C89. Add comments.
8154         * full-write.c: Include safe-write.h.
8155         (full_write): Rewritten to use safe_write.
8156         Suggested by Jim Meyering and Paul Eggert.
8157
8158 2002-11-21  Bruno Haible  <bruno@clisp.org>
8159
8160         Remove case insensitive option matching.
8161         * argmatch.h (argcasematch): Remove declaration.
8162         (ARGCASEMATCH): Remove macro.
8163         (__xargmatch_internal): Remove case_sensitive argument.
8164         (XARGMATCH): Update.
8165         (XARGCASEMATCH): Remove macro.
8166         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8167         case_sensitive argument.
8168         (argcasematch): Remove function.
8169         (__xargmatch_internal): Remove case_sensitive argument.
8170         (main): Use XARGMATCH instead of XARGCASEMATCH.
8171
8172         * xmalloc.c: Change compile-time error message. Add comment about
8173         required autoconf version.
8174
8175 2002-11-21  Jim Meyering  <jim@meyering.net>
8176
8177         * strdup.c (strdup): Tweak comment and initial #if/#include.
8178
8179         Merge in changes from the coreutils.
8180
8181         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8182         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8183         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8184         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8185         int.  Work more efficiently if X is the same width as uintmax_t.
8186         Do not compare X to -1, to avoid bogus compiler warning.
8187         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8188         Don't assume that f_frsize and f_bsize are the same type.
8189
8190         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8191         on FreeBSD.
8192
8193         * makepath.c (make_path): Restore umask *before* creating the final
8194         component.
8195         (make_path): Minor reformatting.
8196
8197         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8198         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8199
8200         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8201         ones.  At least on GNU/Linux systems, `auto' means something else.
8202         From Michael Stone.
8203
8204 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8205
8206         Merge argmatch cleanups from Bison.  Assume C89.
8207
8208         * argmatch.c: Include config.h here, not in argmatch.h.
8209         Include stdlib.h, for EXIT_FAILURE.
8210         Always include <string.h>, since we assume C89.
8211         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8212         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8213         Include <stddef.h> instead, since it's all we need for size_t.
8214         (PARAMS): Remove.  All uses removed.
8215         (ARRAY_CARDINALITY): Do not bother to #undef.
8216         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8217         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8218         Remove unnecessary parentheses.
8219         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8220         Insert necessary parentheses.
8221         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8222         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8223
8224 2002-11-19  Bruno Haible  <bruno@clisp.org>
8225
8226         * mbswidth.c: Include mbswidth.h right at the beginning.
8227         * mbswidth.h: Include <stddef.h>, for size_t.
8228
8229         * mbswidth.h (PARAMS): Remove macro.
8230         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8231         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8232
8233         * gcd.h (PARAMS): Remove macro.
8234         (gcd): Use ANSI C function declarations.
8235         * gcd.c (gcd): Likewise.
8236
8237 2002-11-15  Bruno Haible  <bruno@clisp.org>
8238
8239         * strcspn.c: Include <stddef.h>.
8240         (strcspn): Use ANSI C function declaration. Change return type to
8241         size_t. Use NULL.
8242         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8243         (strpbrk): Use NULL.
8244         * strpbrk.h (PARAMS): Remove macro.
8245         (strpbrk): Use ANSI C function declaration.
8246         * strstr.c: Don't include <sys/types.h>.
8247         * strstr.h (PARAMS): Remove macro.
8248         (strstr): Use ANSI C function declarations.
8249
8250 2002-11-06  Bruno Haible  <bruno@clisp.org>
8251
8252         * gcd.h (gcd): Change argument type to 'unsigned long'.
8253         * gcd.c (gcd): Likewise.
8254
8255 2002-11-05  Bruno Haible  <bruno@clisp.org>
8256
8257         * gcd.h: New file, from gettext-0.11.5.
8258         * gcd.c: New file, from gettext-0.11.5.
8259
8260 2002-11-05  Bruno Haible  <bruno@clisp.org>
8261
8262         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8263         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8264         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8265         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8266
8267         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8268         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8269
8270         * closeout.c: Include gettext.h instead of <libintl.h>.
8271         * human.c: Include gettext.h instead of <libintl.h>.
8272         * quotearg.c: Include gettext.h instead of <libintl.h>.
8273         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8274         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8275         * userspec.c: Include gettext.h instead of <libintl.h>.
8276         * version-etc.c: Include gettext.h instead of <libintl.h>.
8277         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8278         (textdomain): Remove definition.
8279         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8280
8281         * long-options.c: Remove include of <libintl.h> and definition of _.
8282         * same.c: Remove include of <libintl.h> and definition of _.
8283
8284 2002-11-04  Bruno Haible  <bruno@clisp.org>
8285
8286         * stpcpy.h: New file, from GNU gettext-0.11.5.
8287         * strcase.h: New file, from GNU gettext-0.11.5.
8288         * strpbrk.h: New file, from GNU gettext-0.11.5.
8289         * strstr.h: New file, from GNU gettext-0.11.5.
8290         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8291
8292 2002-05-09  Bruno Haible  <bruno@clisp.org>
8293
8294         * config.charset: Update for newest glibc. Add canonical names
8295         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8296
8297 2002-05-09  Bruno Haible  <bruno@clisp.org>
8298
8299         * localcharset.c (get_charset_aliases): Add more Windows specific
8300         aliases.
8301
8302 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8303
8304         * config.charset: A few additions for Solaris.
8305
8306 2001-12-05  Bruno Haible  <bruno@clisp.org>
8307
8308         * localcharset.c (locale_charset): Don't return an empty string.
8309
8310 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8311
8312         * config.charset: msdos in uk_UA uses CP1125.
8313
8314 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8315
8316         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8317         * localcharset.c (locale_charset): Declare as extern "C".
8318
8319 2002-02-15  Bruno Haible  <bruno@clisp.org>
8320
8321         * config.charset [msdosdjgpp]: For Russian, use CP866.
8322
8323 2002-02-11  Bruno Haible  <bruno@clisp.org>
8324
8325         * config.charset: Add support for NetBSD.
8326
8327 2002-09-25    <karl@gnu.org>
8328
8329         * strdup.c: copy from libc/string (via ../config/srclist*).
8330         * getopt*: copy from libc/posix.
8331         * gettext.h: copy from gettext.
8332         * .cppi-disable: add strdup.c, gettext.h.
8333
8334 2002-07-01  Jim Meyering  <meyering@lucent.com>
8335
8336         * c-stack.c: Include sys/time.h.
8337         From Volker Borchert.
8338
8339 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8340
8341         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8342         New macro.  Use it uniformly instead of
8343         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8344         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8345         reported by Vin Shelton.
8346
8347 2002-06-22  Jim Meyering  <meyering@lucent.com>
8348
8349         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8350         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8351
8352 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8353
8354         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8355         Do not assume SA_SIGINFO behavior.
8356         Bug reported by Jim Meyering on NetBSD 1.5.2.
8357
8358 2002-06-22  Jim Meyering  <meyering@lucent.com>
8359
8360         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8361
8362         * exitfail.c, exitfail.h: Likewise.
8363         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8364
8365         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8366         of fnmatch.h.
8367         (EXTRA_DIST): Add fnmatch_loop.c.
8368         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8369
8370         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8371         * fnmatch.c: Update from diffutils-2.8.2.
8372         * fnmatch_.h: New file.  From diffutils-2.8.2.
8373         * fnmatch.h: Remove file.
8374
8375 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8376
8377         * file-type.h: Report an error if neither S_ISREG nor
8378         S_IFREG is defined, instead of using a test specific to glibc
8379         2.2.  This should be safe, since POSIX requires S_ISREG and
8380         Unix Version 7 had S_IFREG.  We don't need to check for
8381         <sys/types.h> since we don't use any symbols that it defines.
8382
8383 2002-06-15  Jim Meyering  <meyering@lucent.com>
8384
8385         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8386         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8387         have been included before this file.
8388
8389 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8390
8391         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8392         so that each temporary file name is unique and valid in the first
8393         8 characters, for operation under DOS.
8394
8395 2002-06-15  Jim Meyering  <meyering@lucent.com>
8396
8397         Work even with DJGPP 2.03, which lacks support for symlinks.
8398         From Richard Dawe.
8399         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8400         is defined.
8401         * lchown.c (S_ISLNK): Likewise.
8402
8403 2002-06-14  Jim Meyering  <meyering@lucent.com>
8404
8405         * file-type.h: Use the version from diffutils-2.8.2.
8406         * file-type.c: Likewise.
8407
8408 2002-05-27  Jim Meyering  <meyering@lucent.com>
8409
8410         Fix a problem seen only on nonconforming systems whereby ls.c's
8411         use of localtime, and then of gettimeofday would cause trouble:
8412         the localtime call used to initialize rpl_gettimeofday's save
8413         mechanism would clobber ls's current local time information so
8414         that in any long listing the first file would always be listed
8415         with date 1970-01-01.  Analysis by Volker Borchert.
8416
8417         * gettimeofday.c (localtime): Undefine.
8418         (rpl_localtime): New function.
8419
8420 2002-05-22  Jim Meyering  <meyering@lucent.com>
8421
8422         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8423         * file-type.h: New file.
8424         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8425
8426 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8427
8428         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8429
8430 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8431
8432         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8433         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8434         of 127, since 64 is the largest conceivable number for ancient
8435         nonstandard hosts.
8436         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8437
8438 2002-04-28  Jim Meyering  <meyering@lucent.com>
8439
8440         * sig2str.c (WTERMSIG): Remove definition (unused).
8441
8442 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8443
8444         * sig2str.h, sig2str.c: New files.
8445         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8446
8447 2002-04-24  Jim Meyering  <meyering@lucent.com>
8448
8449         * gettext.h: New file, from Gettext.
8450         * Makefile.am (INCLUDES): Remove -I../intl.
8451         (libfetish_a_SOURCES): Add gettext.h.
8452
8453 2002-04-16  Jim Meyering  <meyering@lucent.com>
8454
8455         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8456         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8457         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8458
8459 2002-04-12  Jim Meyering  <meyering@lucent.com>
8460
8461         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8462
8463 2002-03-10  Jim Meyering  <meyering@lucent.com>
8464
8465         * makepath.c (make_path): Remove a comma from a diagnostic.
8466         Suggestion from Santiago Vila.
8467
8468 2002-03-08  Jim Meyering  <meyering@lucent.com>
8469
8470         * rename.c: Mention that this wrapper is needed also on
8471         mips-dec-ultrix4.4 systems.
8472
8473 2002-03-02  Jim Meyering  <meyering@lucent.com>
8474
8475         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8476         not HAVE_CLOCK_SETTIME.
8477
8478 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8479
8480         * nanosleep.h: Rename to....
8481         * timespec.h: New name for nanosleep.h.  All uses changed.
8482
8483         * gettime.c: New file.
8484         * settime.c: New file.
8485         * stime.c: Remove.
8486
8487         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8488         timespec.h.  Remove nanosleep.h.
8489
8490 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8491
8492         * acl.c, acl.h: New files.
8493         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8494
8495 2002-02-24  Jim Meyering  <meyering@lucent.com>
8496
8497         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8498         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8499         cause trouble.  Reported by Nelson Beebe.
8500
8501 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8502
8503         * path-concat.c (xpath_concat): Reorder code to pacify
8504         compilers that don't know that xalloc_die never returns.
8505
8506 2002-02-20  Jim Meyering  <meyering@lucent.com>
8507
8508         * getdate.c: Regenerate using bison-1.33.
8509
8510 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8511
8512         * posixver.c, posixver.h: New files.
8513         * Makefile.am (libfetish_a_SOURCES): Add them.
8514
8515 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8516             Bruno Haible  <bruno@clisp.org>
8517
8518         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8519         (fwrite_success_callback): New declaration.
8520         * unicodeio.c (unicode_to_mb): New function, extracted from
8521         print_unicode_char. Call failure callback instead of error.
8522         (fwrite_success_callback): New function.
8523         (exit_failure_callback): New function.
8524         (fallback_failure_callback): New function.
8525         (print_unicode_char): Call unicode_to_mb.
8526
8527 2002-01-26  Jim Meyering  <meyering@lucent.com>
8528
8529         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8530
8531 2002-01-22  Jim Meyering  <meyering@lucent.com>
8532
8533         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8534         Otherwise, some versions of automake would omit the rule that makes
8535         Makefile from Makefile.in.
8536
8537 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8538
8539         * xmemcoll.h, xmemcoll.c: New files.
8540         * Makefile.am (libfetish_a_SOURCES): Add them.
8541         * memcoll.c: Include errno.h, and declare errno if not defined.
8542         (memcoll): Set errno to zero if there is no error.
8543
8544         * quotearg.c (quotearg_buffer_restyled):
8545         Fix bug with quoting buffers containing NUL when backslashing escapes.
8546         This bug was exposed by the other changes in this patch.
8547         (quotearg_n_options): New arg ARGSIZE.
8548         All callers changed.
8549         (quoting_options_from_style): New function.
8550         (quotearg_n_style): Use it.
8551         (quotearg_n_style_mem): New function.
8552
8553         * quotearg.h (quotearg_n_style_mem): New function.
8554
8555 2002-01-16  Jim Meyering  <meyering@lucent.com>
8556
8557         * getdate.y: Add three semicolons, each just before a closing brace.
8558         Bison (as of version 1.31) no longer papers over that mistake.
8559
8560 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8561
8562         * backupfile.c (ISDIGIT): Comment fix.
8563         * getdate.y (ISDIGIT): Likewise.
8564         * posixtm.c (ISDIGIT, year): Likewise.
8565         * strverscmp.c (ISDIGIT): Likewise.
8566         * userspec.c (ISDIGIT): Likewise.
8567
8568 2002-01-05  Jim Meyering  <meyering@lucent.com>
8569
8570         * version-etc.c (version_etc_copyright): Update copyright year.
8571
8572 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8573
8574         * closeout.c (close_stdout_status): If ferror (stdout), do
8575         not silently exit merely because the output buffer happens to
8576         have nothing pending.
8577
8578 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8579
8580         See the big note in ../ChangeLog.
8581         * human.c (suffixes): Prefer K to k for 1024.
8582         (generate_suffix_backwards): New function.
8583         (human_readable_inexact): Use it.
8584         * xstrtol.c (__xstrtol): If there is no number but there
8585         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8586         Accept 'K' as well as 'k'.
8587
8588 2001-12-15  Jim Meyering  <meyering@lucent.com>
8589
8590         * regex.h (__restrict_arr): Update from libc.
8591
8592         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8593         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8594         (STREQ): Define.
8595
8596 2001-12-10  Jim Meyering  <meyering@lucent.com>
8597
8598         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8599         Instead, include "xalloc.h".
8600         (initbuffer): Don't cast xmalloc return value to char*.
8601         (readline): Reword comment.
8602         Don't cast xrealloc return value to char*
8603         Return NULL, not 0.
8604
8605 2001-12-09  Jim Meyering  <meyering@lucent.com>
8606
8607         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8608         `signed and unsigned type in conditional expression'.
8609         * posixtm.c (posix_time_parse): Likewise.
8610
8611         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8612
8613         * readtokens.c (readtoken): Declare an index to be of type unsigned
8614         to avoid a pedantic warning.
8615
8616         * getstr.c: Don't include assert.h.
8617         (getstr): Remove warning-evoking assertions.
8618         Return -1 if offset parameter is out of bounds.
8619         Change the type of a local from int to size_t.
8620
8621         * strftime.c (my_strftime_localtime_r): Include this function
8622         definition in the `#if ! HAVE_TM_GMTOFF' block.
8623
8624         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8625         Include xalloc.h instead.
8626
8627 2001-12-02  Jim Meyering  <meyering@lucent.com>
8628
8629         * tempname.c: Don't declare getenv, thus reverting the change of
8630         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8631         included.
8632
8633         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8634         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8635
8636 2001-11-30  Akim Demaille  <akim@epita.fr>
8637
8638         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8639         before being defined.
8640
8641 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8642
8643         * quotearg.h (quotearg_n, quotearg_n_style):
8644         First arg is int, not unsigned.
8645         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8646         (SIZE_MAX, UINT_MAX): New macros.
8647         (quotearg_n_options): Abort if N is negative.
8648         Avoid overflow check on hosts where size_t is 64 bits and int
8649         is 32 bits, as overflow is impossible there.
8650         Fix off-by-one typo that caused unnecessary reallocation.
8651
8652 2001-11-27  Jim Meyering  <meyering@lucent.com>
8653
8654         * tempname.c: Merge with version from libc.
8655         * regex.c: Likewise.
8656
8657         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8658         for which STDC_HEADERS is 0, it was not included, resulting in a
8659         warning about an integer-to-pointer conversion problem with getenv.
8660         Reported by Volker Borchert.
8661
8662 2001-11-26  Jim Meyering  <meyering@lucent.com>
8663
8664         * gtod.h: Remove file.
8665         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8666         * gettimeofday.c: Don't include gtod.h.
8667         (GTOD_init): Remove function.
8668         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8669         Suggestion from Volker Borchert.
8670
8671 2001-11-23  Jim Meyering  <meyering@lucent.com>
8672
8673         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8674         * hash.c (struct hash_table): Define it here instead.
8675
8676 2001-11-22  Jim Meyering  <meyering@lucent.com>
8677
8678         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8679
8680 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8681
8682         * tempname.c (TMP_MAX): Remove; no longer needed.
8683         (TEMPORARIES): New macro.
8684         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8685         removes an artificial limitation (e.g. HP-UX 10.20, where
8686         TMP_MAX is 17576).
8687
8688 2001-11-18  Jim Meyering  <meyering@lucent.com>
8689
8690         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8691         on SunOS 4.
8692
8693         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8694         files will be created before anything else.
8695
8696 2001-11-17  Jim Meyering  <meyering@lucent.com>
8697
8698         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8699         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8700         rather than group writable.  Patch by Juan F. Codagnone.
8701
8702         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8703         Instead, include "xalloc.h".
8704
8705         * mountlist.c: Include unlocked-io.h after all system headers.
8706         Remove explicit declarations of xmalloc, xrealloc,
8707         and xstrdup.  Instead, include "xalloc.h".
8708
8709         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8710         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8711         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8712
8713         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8714         Reported by Padraig Brady.
8715
8716         * mkstemp.c: #undef mkstemp.
8717         Include config.h.
8718         (rpl_mkstemp): Rename from mkstemp.
8719         Protoize.
8720
8721 2001-11-16  Jim Meyering  <meyering@lucent.com>
8722
8723         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8724         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8725         determine the amount of total physical memory, use pstat_getstatic.
8726         HPUX-11 doesn't define _SC_PHYS_PAGES.
8727         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8728         If sysconf couldn't be used to determine the amount of available
8729         physical memory, use both pstat_getstatic and pstat_getdynamic.
8730         Based on a patch from Bob Proulx.
8731
8732 2001-11-05  Jim Meyering  <meyering@lucent.com>
8733
8734         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8735
8736 2001-11-03  Jim Meyering  <meyering@lucent.com>
8737
8738         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8739         in argmatch_to_argument call.
8740
8741         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8742         argument.
8743
8744         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8745         e.g., a fault due to an attempt to free a NULL pointer.
8746
8747 2001-11-01  Jim Meyering  <meyering@lucent.com>
8748
8749         * dirfd.c, dirfd.h: New files.
8750         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8751
8752         * hash.c (hash_print) [TESTING]: Clean up.
8753
8754 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8755
8756         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8757         to avoid a warning if -Wall.
8758
8759 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8760
8761         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8762
8763 2001-10-21  Jim Meyering  <meyering@lucent.com>
8764
8765         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8766         this code would end up calling gettext even in packages built
8767         with --disable-nls.
8768         * getopt.c (_): Likewise.
8769         * regex.c (_): Likewise.
8770
8771 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8772
8773         * error.c (strerror_r): Do not declare unless !_LIBC.
8774         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8775         Use strerror_r that is only a macro, even if it is not a function.
8776         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8777         (private_strerror): Use prototypes, not old-style function definition.
8778         (print_errno_message): New function.
8779         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8780         char*-flavored one.
8781         (error_tail, error, error_at_line): Use it.
8782
8783 2001-10-11  Jim Meyering  <meyering@lucent.com>
8784
8785         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8786         and quote_n (1, ... to avoid clobbering a buffer.
8787
8788 2001-10-05  Jim Meyering  <meyering@lucent.com>
8789
8790         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8791         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8792         * hash-pjw.h: New file.
8793
8794 2001-09-30  Jim Meyering  <meyering@lucent.com>
8795
8796         * mountlist.c [MOUNTED_GETFSSTAT]:
8797         Include <sys/ucred.h>, for Apple Darwin.
8798         Include sys/mount.h and sys/fs_types.h only if available.
8799         (FS_TYPE): Define.
8800         (read_filesystem_list): Use FS_TYPE.
8801
8802 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8803
8804         * exclude.c (excluded_filename): 0 -> false, since it's
8805         a boolean context.
8806
8807 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8808
8809         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8810         #defines strtoimax.  Also treat the other strto* functions
8811         like strtoimax.
8812
8813         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8814         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8815         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8816
8817 2001-09-26  Jim Meyering  <meyering@lucent.com>
8818
8819         Most macros in unlocked-io.h had the wrong number of arguments.
8820         * gen-uio: New script.
8821         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8822         * unlocked-io.hin: Remove file.
8823         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8824         rather than trying to embed it here.
8825         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8826         Reported by Padraig Brady.
8827
8828 2001-09-25  Volker Borchert  <bt@teknon.de>
8829
8830         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8831
8832 2001-09-23  Jim Meyering  <meyering@lucent.com>
8833
8834         * mountlist.c: Remove useless parentheses in #if directives.
8835         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8836         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8837
8838 2001-09-22  Jim Meyering  <meyering@lucent.com>
8839
8840         * localcharset.c: Update from latest gettext.
8841         * config.charset: Likewise.
8842
8843 2001-09-20  Jim Meyering  <meyering@lucent.com>
8844
8845         * xstrtol.c (strtoimax): Guard declaration with
8846         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8847         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8848         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8849         (strtoumax): Likewise, for completeness (it wasn't necessary).
8850
8851 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8852
8853         * strtoimax.c (HAVE_LONG_LONG):
8854         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8855         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8856         to work around bug in IBM C compiler.
8857
8858 2001-09-16  Jim Meyering  <meyering@lucent.com>
8859
8860         * mkdir.c: New file.
8861
8862 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8863
8864         * xgetcwd.c: Revert some of the previous change; intead,
8865         fix the HAVE_GETCWD_NULL code to behave more like the
8866         !HAVE_GETCWD_NULL code used to.
8867
8868         Include "xalloc.h".
8869         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8870         invoke xalloc_die.
8871
8872 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8873
8874         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8875         Use ssize_t, not int, to store result of readlink.
8876         Check for ssize_t overflow as well as size_t overflow,
8877         as POSIX says the result of readlink is implementation-defined
8878         when ssize_t overflows.
8879         Remove unnecessary cast to char*.
8880         Use free+malloc instead of realloc, as the storage doesn't need
8881         to be preserved and it's clearer and can be more efficient that way.
8882         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8883         * xreadlink.h (xreadlink): Update prototype.
8884
8885 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8886
8887         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8888         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8889         spotted by Jim Meyering.
8890
8891 2001-09-03  Jim Meyering  <meyering@lucent.com>
8892
8893         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8894
8895 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8896
8897         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8898         like the HAVE_GETCWD_NULL code.
8899         Include pathmax.h if not HAVE_GETCWD.
8900         Do not include xalloc.h.
8901         (INITIAL_BUFFER_SIZE): New symbol.
8902         Do not use xmalloc / xrealloc, since the caller is responsible for
8903         handling errors.  Preserve errno around `free' during failure.
8904         Do not overrun buffer when using getwd.
8905
8906 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8907
8908         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8909         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8910
8911 2001-09-02  Jim Meyering  <meyering@lucent.com>
8912
8913         * error.c: Update from GNU libc.
8914
8915 2001-09-01  Jim Meyering  <meyering@lucent.com>
8916
8917         * xreadlink.c: New file.
8918         * xreadlink.h: New file.
8919         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8920
8921         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8922         doesn't conflict with sparc Solaris 7's definition in
8923         /usr/include/sys/int_types.h.
8924
8925         * exclude.c: Use `""', not `<>' to #include non-system header files.
8926         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8927         and strncasecmp as r-values.  Unixware didn't have declarations.
8928
8929 2001-08-31  Jim Meyering  <meyering@lucent.com>
8930
8931         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8932         Use an initial, malloc'd, buffer of length 128 rather than
8933         a statically allocated one of length 1024.
8934
8935 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8936
8937         * xgetcwd.c: Don't include pathmax.h.
8938         Include stdlib.h and unistd.h if available.
8939         Include xalloc.h.
8940         (xmalloc, xstrdup, free): Remove decls.
8941         (xgetcwd): Don't assume sizes fit in unsigned.
8942         Check for overflow when computing sizes.
8943         Simplify reallocation code.
8944
8945 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8946
8947         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8948
8949         * strtoimax.c: Renamed from strtoxmax.c, removing the
8950         old strtoimax.c.
8951
8952         Also, make the following further changes to make this file's
8953         configuration more similar to that of strtol.c:
8954         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8955         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8956         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8957         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8958         changed to signed values.
8959
8960         And make the following changes as well:
8961         Fix copyright notice, as 1999 was missing.
8962         (verify): New macro.
8963         (strtoimax): Check sizes at compile-time, not run-time.
8964         Prefer strtol to strtoll if both work.
8965         (main): Remove; it was not that useful and was a pain to maintain.
8966
8967         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8968
8969 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8970
8971         * savedir.c (savedir): Remove size parameter, as POSIX says that
8972         a directory's st_size can have an arbitrary value, so the old
8973         usage could waste an arbitrary amount of memory.  All uses
8974         changed.
8975         * savedir.h: Update prototype.
8976
8977 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8978
8979         * xstrtol.c (strtoimax): New decl.
8980
8981 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8982
8983         * xstrtol.h: Add copyright notice.
8984         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8985         LONGINT_INVALID_SUFFIX_CHAR.
8986
8987 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8988
8989         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8990         tm to be declared.
8991
8992 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8993
8994         * hash.c: Remove '2001' from copyright notice.
8995
8996 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8997
8998         * full-write.h: New file.
8999         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9000         * full-write.c: Correct credits, as cccp.c no longer
9001         exists and anyway it was so heavily changed from the old cccp
9002         code as to be unrecognizable.  Include full-write.h.
9003         (full_write) Return size_t, with short writes meaning failure.
9004         All callers changed.  This fixes a bug with large buffers
9005         on 64-bit hosts.
9006         * utime.c: Include full-write.h.
9007
9008 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9009
9010         Merge 'exclude' changes from tar 1.13.22.
9011         This fixes one or two unlikely storage allocation overflow bugs,
9012         but doesn't change user-visible behavior otherwise.
9013
9014 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9015
9016         * exclude.c (bool): Declare, perhaps by including stdbool.h.
9017         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9018         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9019         Include if available.
9020         (<xalloc.h>): Include
9021         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9022         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9023         collide with FNM macros.
9024         (struct patopts): New struct.
9025         (struct exclude): Use it, as exclude patterns now come with options.
9026         (new_exclude): Support above changes.
9027         (new_exclude, add_exclude_file):
9028         Initial size must now be a power of two to simplify overflow checking.
9029         (free_exclude, fnmatch_no_wildcards): New function.
9030         (excluded_filename): No longer requires options arg, as the options
9031         are determined by add_exclude.  Now returns bool, not int.
9032         (excluded_filename, add_exclude):
9033         Add support for the fancy new exclusion options.
9034         (add_exclude, add_exclude_file): Now takes int options arg.
9035         Check for arithmetic overflow when computing sizes.
9036         (add_exclude_file): xrealloc might modify errno, so don't
9037         realloc until after errno might be used.
9038
9039         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9040         New macros.
9041         (free_exclude): New decl.
9042         (add_exclude, add_exclude_file): Now takes int options arg.
9043         (excluded_filename): No longer requires options arg, as the options
9044         are determined by add_exclude.  Now returns bool, not int.
9045
9046 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9047
9048         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9049
9050 2001-08-27  Jim Meyering  <meyering@lucent.com>
9051
9052         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9053
9054         * version-etc.c (N_): Remove definition.
9055         Revert most of last change.
9056         Instead, simply don't mark the `Copyright...' string for translation.
9057         Based on advice from Paul Eggert.
9058
9059         * strtoxmax.c: Tweak comment.
9060
9061 2001-08-26  Jim Meyering  <meyering@lucent.com>
9062
9063         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9064         of copyright with `%s' so translators don't get an untranslated
9065         message in 2002.
9066         (COPYRIGHT_YEAR): Define.
9067         (version_etc): Use fprintf rather than fputs.
9068         Suggestion from Ulrich Drepper.
9069
9070         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9071
9072         * strtoll.c: New file, from GNU libc.
9073         * xstrtoimax.c: New file.
9074
9075         * xstrtol.h: Add xstrtoimax.
9076         * strtoumax.c: New file.  Simply include "strtoumax.c".
9077         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9078
9079         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9080         * strtoxmax.c: ... then renamed to this.
9081
9082 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9083
9084         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9085         Port to Solaris 8, where 'sed' requires a space after the 'r'
9086         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9087         Redirect output to $tmp just once.
9088
9089 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9090
9091         * addext.c (<errno.h>): Include.
9092         (errno): Declare if not defined.
9093         (addext): Work correctly when pathconf returns -1 and leaves
9094         errno alone because there is no limit.  Also, work even if
9095         pathconf returns a value greater than SIZE_MAX.
9096
9097 2001-08-12  Jim Meyering  <meyering@lucent.com>
9098
9099         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9100         Simply `return getcwd (NULL, 0);'.
9101         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9102         Use 1300 as initial value for length, not PATH_MAX.
9103
9104         * pathmax.h: Clean up cpp syntax.
9105
9106 2001-08-12  Jim Meyering  <meyering@lucent.com>
9107
9108         * gettimeofday.c: New file.
9109         * gtod.h: New file.
9110         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9111
9112 2001-08-04  Jim Meyering  <meyering@lucent.com>
9113
9114         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9115         to get in sync with glibc.
9116
9117 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9118
9119         The following changes are from gettext 0.10.39 as maintained by
9120         Bruno Haible.
9121
9122         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9123         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9124         with inverted sense.  All uses changed.
9125
9126         * mbswidth.c: Don't include <limits.h>.
9127         Include <stdlib.h> and <string.h> unconditionally.
9128         (iswcntrl, mbsinit, ISCNTRL): New macros.
9129         (mbsnwidth): Use K&R style function declarations.
9130         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9131         can optimize it when MB_CUR_MAX == 1.
9132         The width of control characters is zero, not 1.
9133
9134 2001-07-15  Jim Meyering  <meyering@lucent.com>
9135
9136         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9137         (BUILT_SOURCES): Add unlocked-io.h.
9138         (io_functions): Define.
9139         (unlocked-io.h): New rule.
9140         (DISTCLEANFILES): Add unlocked-io.h.
9141         (all-local): Depend on unlocked-io.h, to ensure it is created.
9142
9143         * unlocked-io.hin: New file
9144
9145         * regex.c: Update from glibc.
9146
9147 2001-07-05  Jim Meyering  <meyering@lucent.com>
9148
9149         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9150         recommendation.
9151         (libfetish_a_SOURCES): Put all .h files here instead.
9152         Remove a thus-exposed (better checks in automake) duplicate and
9153         two unnecessary .h files.
9154
9155 2001-06-11  Jim Meyering  <meyering@lucent.com>
9156
9157         * regex.c: Update from GNU libc.
9158
9159 2001-05-27  Jim Meyering  <meyering@lucent.com>
9160
9161         * readutmp.h (UT_TYPE): Define.
9162
9163 2001-05-24  Jim Meyering  <meyering@lucent.com>
9164
9165         * argmatch.c: Include "quote.h".
9166         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9167         quote function.  Reported by Göran Uddeborg.
9168
9169 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9170
9171         * dirname.c (dir_name): Compute append_dot using path, not newpath
9172         which is not yet declared.
9173
9174 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9175
9176         * Makefile.am (libfetish_a_SOURCES):
9177         Add strftime.c, since we now compile it on all hosts.
9178
9179         * strftime.c (my_strftime):
9180         Define to nstrftime if emacs, but only if my_strftime is not defined.
9181         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9182         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9183         Add one more extra argument: a nanoseconds value.
9184         All uses changed.
9185         (ns): New macro.
9186         (my_strftime function): Add %N format.
9187         (emacs_strftimeu): Renamed from emacs_strftime,
9188         with extra ut argument.
9189
9190 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9191
9192         dirname code cleanup.  base_name now behaves more compatibly
9193         with POSIX basename when given file names that have trailing
9194         slashes, and similarly for dir_name.  Add new primitives
9195         base_len and dir_len.  Put the directory-name-related decls
9196         into dirname.h.
9197
9198         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9199         * backupfile.c (base_name): Likewise.
9200         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9201         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9202         * makepath.c (strip_trailing_slashes): Likewise.
9203         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9204         Likewise.
9205         * rename.c (strip_trailing_slashes): Likewise.
9206         * same.c (base_name): Likewise.
9207         * stripslash.c (ISSLASH): Likewise.
9208
9209         * addext.c: Include <dirname.h> after size_t is defined.
9210         * backupfile.c: Likewise.
9211
9212         * addext.c (addext): Use base_len to trim redundant
9213         trailing slashes instead of doing it ourselves.
9214         But do not trim the last slash if it is not redundant.
9215
9216         * backupfile.c (find_backup_file_name,
9217         max_backup_version): Use base_len instead of rolling it ourselves.
9218         Handle the case of "" and (on DOS) "C:" correctly.
9219
9220         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9221         Include <string.h>, <dirname.h>.
9222         (base_name): Allow file names ending in slashes, other than names
9223         that are all slashes.  In this case, return the basename followed
9224         by the slashes.  This is more general, and can be used in places
9225         where the original base_name purposely had an assertion failure.
9226         (base_len): New function.
9227
9228         * dirname.c: Include <string.h> instead of <stdlib.h>.
9229         Do not include <assert.h>; no longer needed.
9230         Include xalloc.h.
9231         (memrchr): Remove decl.
9232         (dir_name_r): Remove.
9233         (dir_len): Renamed from dirlen.  All callers changed.
9234         Rewrite in terms of base_name, for simplicity and consistency.
9235         (dir_name): Never return NULL.  All callers changed.
9236         Do not include <stdlib.h> in test program; no longer needed.
9237         return 0; is fine for test program.
9238
9239         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9240         New macros.
9241         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9242
9243         * path-concat.c (path_concat): Use base_len to compute
9244         base length, not strlen; this means we cannot rely on memcpy
9245         to null-terminate.
9246
9247         * same.c (STREQ): Remove.
9248         (same_name): Handle the case where the basename ends in trailing '/'.
9249
9250         * stripslash.c (strip_trailing_slashes): Return nonzero if
9251         a slash was stripped.  Do not strip the last slash after a
9252         file system prefix.
9253
9254 2001-04-08  Jim Meyering  <meyering@lucent.com>
9255
9256         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9257         recomputed; that's necessary when the offset spans a DST transition.
9258         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9259
9260 2001-04-02  Jim Meyering  <meyering@lucent.com>
9261
9262         * regex.h, regex.c: Update from GNU libc.
9263
9264 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9265
9266         * version-etc.c (version_etc_copyright): Update to 2001.
9267
9268 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9269
9270         * tempname.c (uint64_t): Define to uintmax_t if
9271         not defined, and if UINT64_MAX is not defined.
9272         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9273         Reported by John David Anglin.
9274
9275 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9276
9277         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9278         alias if codeset is empty.
9279         * config.charset (BeOS): Use wildcard syntax.
9280
9281 2001-03-13  Jim Meyering  <meyering@lucent.com>
9282
9283         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9284         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9285         From Bruno Haible.
9286
9287 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9288
9289         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9290         Don't return NULL.
9291         * unicodeio.c (print_unicode_char): Simplify accordingly.
9292
9293 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9294
9295         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9296         support for DOS/DJGPP.
9297
9298 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9299
9300         * Makefile.am (libfetish_a_SOURCES):
9301         Add dup-safer.c, fopen-safer.c.
9302         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9303
9304         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9305
9306 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9307
9308         The mkstemp replacement is taken from glibc 2.2.2, with some
9309         portability fixes for use outside glibc, as follows:
9310
9311         * tempname.c (struct_stat64): New macro.
9312         (direxists, __gen_tempname): Use it.
9313         This avoids a portability problem with Solaris 8.
9314
9315         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9316         (<stddef.h>, <stdint.h>, <string.h>):
9317         Include only if STDC_HEADERS || _LIBC.
9318         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9319         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9320         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9321         (__set_errno): Define this macro if <errno.h> doesn't.
9322         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9323         Define these macros if <stdio.h> doesn't.
9324         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9325         Define these macros if <sys/stat.h>
9326         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9327         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9328         __xstat64): Define if not _LIBC.
9329         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9330         (__gen_tempname): Invoke gettimeofday only if
9331         HAVE_GETTIMEOFDAY || _LIBC;
9332         otherwise, fall back on plain "time".
9333         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9334
9335         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9336
9337         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9338
9339 2001-02-17  Jim Meyering  <meyering@lucent.com>
9340
9341         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9342         around included file name.
9343
9344         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9345
9346         * strftime.c: Update from GNU libc (the only changes were to comments).
9347
9348 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9349
9350         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9351
9352 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9353
9354         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9355         Remove workaround macros for hosts that have mbrtowc but not
9356         mbstate_t, as we now insist on proper declarations for both
9357         before using mbrtowc.
9358
9359 2001-02-17  Jim Meyering  <meyering@lucent.com>
9360
9361         * regex.c: Update from libc.
9362
9363 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9364
9365         * alloca.c (malloc): Undef before defining, since stdlib.h
9366         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9367         Reported by Mark Hounschell via Paul Eggert.
9368
9369 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9370
9371         * config.charset: Update for FreeBSD 4.2.
9372
9373 2001-01-26  Jim Meyering  <meyering@lucent.com>
9374
9375         * quotearg.c: Include stddef.h.
9376         * quote.c: Include stddef.h.
9377         Reported by Axel Kittenberger.
9378
9379         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9380         line in double quotes so that it evokes a better diagnostic.
9381         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9382         Reported by Axel Kittenberger.
9383
9384 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9385
9386         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9387         to avoid a warning.  Add back 'const' to inptr.
9388
9389 2001-01-16  Jim Meyering  <meyering@lucent.com>
9390
9391         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9392         From Bruno Haible.
9393
9394 2001-01-14  Jim Meyering  <meyering@lucent.com>
9395
9396         * rename.c: New file.  From Volker Borchert.
9397         Include stdlib.h, string.h or strings.h, and xalloc.h.
9398         Use strip_trailing_slashes rather than open-coding it.
9399
9400 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9401
9402         * strftime.c: Sync with glibc time/strftime.c 1.81.
9403
9404 2001-01-03  Jim Meyering  <meyering@lucent.com>
9405
9406         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9407         local `inptr' to avoid warning with some system declarations of iconv.
9408
9409 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9410
9411         * modechange.c: Do not assume that mode_t uses the
9412         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9413         the other-execute bit of FOO even if S_IXOTH != 1.
9414
9415         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9416         WOTH, XOTH, ALLM): New macros.
9417         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9418          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9419         Use them.
9420         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9421         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9422         (mode_compile):
9423         No need to use uintmax_t; unsigned long is long enough.
9424         Don't bother to get suffix since we don't use it.
9425
9426 2000-12-24  Jim Meyering  <meyering@lucent.com>
9427
9428         * hash.c (is_prime): Return explicit boolean values.
9429         (hash_get_first): Return NULL to appease Irix5.6's 89.
9430         Reported by Nelson Beebe.
9431
9432 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9433
9434         * localcharset.c (locale_charset): Add support for Win32.
9435
9436 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9437
9438         * physmem.h, physmem.c: New files.
9439
9440         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9441         (noinst_HEADERS): Add physmem.h.
9442
9443         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9444         't' for compatibility with Solaris 8 sort.
9445
9446 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9447
9448         * config.charset: Add support for BeOS.
9449
9450 2000-12-16  Jim Meyering  <meyering@lucent.com>
9451
9452         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9453         SHELLS_FILE to a file name that's useful on djgpp systems.
9454         Include stdlib.h.
9455         (ADDITIONAL_DEFAULT_SHELLS): Define.
9456         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9457         Based mostly on a patch from Prashant TR.
9458
9459 2000-12-16  Jim Meyering  <meyering@lucent.com>
9460
9461         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9462         N and M) would have treated it like `chown N:N FILE'.
9463
9464         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9465
9466 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9467
9468         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9469         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9470         to the list of canonical encodings. Rename EUC-CN to GB2312.
9471
9472 2000-12-08  Andreas Schwab  <schwab@suse.de>
9473
9474         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9475         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9476
9477 2000-12-07  Jim Meyering  <meyering@lucent.com>
9478
9479         * stripslash.c (ISSLASH): Define.
9480         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9481         From Prashant TR.
9482
9483         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9484         (dir_name_r): Declare this function as static.
9485         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9486         manifest itself on a name containing a mix of slashes and
9487         backslashes.
9488         Make this function work with names starting with a DOS-style
9489         drive letter and colon prefix.
9490         (dir_name): Append `.' if necessary.
9491         Based mostly on patches from Prashant TR and Eli Zaretskii.
9492
9493         * dirname.h (dir_name_r): Remove prototype.
9494
9495 2000-12-05  Jim Meyering  <meyering@lucent.com>
9496
9497         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9498
9499 2000-12-04  Jim Meyering  <meyering@lucent.com>
9500
9501         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9502         Also include memory.h, stdlib.h, unistd.h if appropriate.
9503         Reported by Andreas Jaeger (conflicting declaration of malloc).
9504
9505 2000-12-02  Jim Meyering  <meyering@lucent.com>
9506
9507         * closeout.h: Make idempotent, to avoid some obscure warnings.
9508
9509 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9510
9511         * memrchr.c: Include <config.h> before any system include file.
9512
9513 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9514
9515         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9516
9517 2000-11-26  Jim Meyering  <meyering@lucent.com>
9518
9519         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9520
9521 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9522
9523         * strftime.c (my_strftime): Do not invoke mbrlen with a
9524         size of (size_t) -1; it's not portable.
9525
9526 2000-11-17  Akim Demaille  <akim@epita.fr>
9527
9528         * obstack.h: Formatting changes.
9529         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9530         prevent type checking.
9531         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9532         cast the value to (void *): assigning a `foo *' to a `void *'
9533         variable is valid.
9534         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9535
9536 2000-11-17  Jim Meyering  <meyering@lucent.com>
9537
9538         * strstr.c: Update from GNU libc.
9539
9540 2000-11-16  Jim Meyering  <meyering@lucent.com>
9541
9542         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9543
9544 2000-11-11  Jim Meyering  <meyering@lucent.com>
9545
9546         * error.c: Add a couple #includes, merging from GNU libc version.
9547
9548 2000-11-10  Jim Meyering  <meyering@lucent.com>
9549
9550         * obstack.h: Update from GNU libc.
9551         * obstack.c: Likewise.
9552
9553 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9554
9555         * getusershell.c (setusershell): Use rewind rather than
9556         fseek/fseeko, to avoid configuration hassles with fseeko.
9557         Don't bother opening SHELLS_FILE if shellstream is NULL;
9558         it's not necessary.
9559
9560 2000-11-05  Jim Meyering  <meyering@lucent.com>
9561
9562         * makepath.h (make_dir): Declare.
9563         * makepath.c (make_dir): Remove `static' attribute.
9564         Tweak a comment.
9565
9566 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9567
9568         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9569         last one in a bucket, advance to the next bucket.
9570
9571 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9572
9573         * fnmatch.c: Do not comment out all the code if we are using
9574         the GNU C library, because in some cases we are replacing buggy
9575         code in the GNU C library itself.
9576
9577 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9578
9579         * error.h, getline.h, modechange.h:
9580         Remove "2000" from Copyright line, as the file hasn't been
9581         changed this year other than in the copyright notice.
9582
9583         * xalloc.h: Add "2000" to Copyright line, as this file
9584         was changed this year.
9585
9586 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9587
9588         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9589         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9590         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9591
9592 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9593
9594         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9595         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9596         doesn't define __restrict_arr.
9597
9598 2000-10-29  Jim Meyering  <meyering@lucent.com>
9599
9600         * xstat.in: Fix grammar in comment.
9601
9602 2000-10-28  Jim Meyering  <meyering@lucent.com>
9603
9604         * memchr.c: Update from libc.
9605         Adjust for portability:
9606         [HAVE_STDLIB_H]: Include stdlib.h.
9607         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9608         Undef __memchr, too.
9609         [!weak_alias]: Define __memchr to memchr.
9610
9611         * regex.c: Update from libc.
9612         * regex.h: Likewise.
9613         * getopt1.c: Likewise.
9614         * memcmp.c: Likewise.
9615
9616         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9617         Avoid using fseek, when possible -- it's broken by design.
9618         Patch by Ulrich Drepper.
9619
9620 2000-10-26  Jim Meyering  <meyering@lucent.com>
9621
9622         * strftime.c: Update from libc.
9623
9624 2000-10-25  Jim Meyering  <meyering@lucent.com>
9625
9626         * obstack.c: Update from libc.
9627
9628 2000-10-23  Jim Meyering  <meyering@lucent.com>
9629
9630         * hard-locale.c (hard_locale): Revert last change -- it was simply
9631         wrong.  That set_locale call must not have any side effects.
9632         From Paul Eggert.
9633
9634 2000-10-22  Jim Meyering  <meyering@lucent.com>
9635
9636         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9637         [CYCLIC]: Remove now-unused definition.
9638
9639         * save-cwd.c (O_DIRECTORY): Define, if needed.
9640         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9641         Suggestion from Ulrich Drepper.
9642
9643 2000-10-21  Jim Meyering  <meyering@lucent.com>
9644
9645         * dirname.c (dir_name_r): New function, factored out of dir_name.
9646         (dir_name): Use dir_name_r.
9647         * dirname.h (dir_name_r): Declare it.
9648
9649 2000-10-21  Jim Meyering  <meyering@lucent.com>
9650
9651         * dirname.c (memrchr): Declare if necessary.
9652         (dir_name): Remove the restriction that there be no
9653         trailing slashes.  Now, this code skips past them, effectively
9654         ignoring them.
9655         [TEST_DIRNAME] (main): New unit tests.
9656
9657         * memrchr.c: New file from GNU libc.
9658         Undef __memrchr, too.
9659         [!weak_alias]: Define __memrchr to memrchr.
9660         Guard weak_alias use with `#ifdef weak_alias'.
9661
9662 2000-10-17  Jim Meyering  <meyering@lucent.com>
9663
9664         * quote.h (PARAMS): Define and use.
9665         Reported by Akim Demaille.
9666
9667         * getopt.c: Update from libc.
9668
9669 2000-10-16  Jim Meyering  <meyering@lucent.com>
9670
9671         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9672         From Jan Fedak.
9673
9674 2000-09-25  Jim Meyering  <meyering@lucent.com>
9675
9676         * md5.h (rol): Define (from GnuPG).
9677
9678         * sha.c: Give credit (GnuPG) where due.
9679         (M): Use rol rather than open-coding it.
9680         Add a FIXME comment.
9681
9682 2000-09-21  Jim Meyering  <meyering@lucent.com>
9683
9684         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9685         Reported by Michael Stone.
9686
9687 2000-09-20  Jim Meyering  <meyering@lucent.com>
9688
9689         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9690         (noinst_HEADERS): Add sha.h.
9691         Based on code from Scott G. Miller and from GnuPG.
9692
9693 2000-09-15  Jim Meyering  <meyering@lucent.com>
9694
9695         * regex.c: Update from libc.
9696
9697 2000-09-10  Jim Meyering  <meyering@lucent.com>
9698
9699         * getopt.c (_getopt_internal): Update from glibc.
9700
9701 2000-09-09  Jim Meyering  <meyering@lucent.com>
9702
9703         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9704         think it should be used as a general replacement for isascii.
9705         * fnmatch.c: Likewise.
9706         * mbswidth.c: Likewise
9707         * regex.c: Likewise.
9708
9709         Don't use atoi.
9710         * userspec.c: Include sys/param.h and limits.h.
9711         Include xstrtol.h.
9712         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9713         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9714         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9715         UID, GID.  Check range.
9716
9717 2000-09-06  Jim Meyering  <meyering@lucent.com>
9718
9719         * getopt.c (_getopt_internal): Update from glibc.
9720
9721 2000-08-30  Jim Meyering  <meyering@lucent.com>
9722
9723         * strftime.c: Merge in changes from GNU libc.
9724
9725 2000-08-26  Jim Meyering  <meyering@lucent.com>
9726
9727         * closeout.c: Include "__fpending.h".
9728         (close_stdout_status): Return right away if there's nothing to flush.
9729
9730         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9731         * __fpending.c: New file.
9732         * __fpending.h: New file.
9733
9734 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9735
9736         Standardize on "memory exhausted" instead of "Memory exhausted"
9737         or "virtual memory exhausted".
9738         * obstack.c (print_and_abort): Use "memory exhausted", not
9739         "virtual memory exhausted".
9740         * same.c (same_name): Invoke xalloc_die instead of printing
9741         our own message.
9742         * userspec.c (parse_user_spec): Likewise.
9743         * bumpalloc.h: comment fix
9744         * same.c, userspec.c: Include xalloc.h.
9745
9746         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9747         not char *const and pointing to a constant array.
9748         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9749         (xrealloc): Comment fix.
9750
9751         * userspec.c (parse_user_spec):
9752         Don't translate a message until just before returning,
9753         to avoid unnecessary translation.
9754
9755 2000-08-07  Jim Meyering  <meyering@lucent.com>
9756
9757         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9758         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9759         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9760         getgroups.c, gethostname.c, getopt.h, group-member.c,
9761         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9762         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9763         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9764         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9765         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9766         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9767         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9768         yesno.c: Back out Copyright date changes for each file with no change
9769         this year.  This eases coordination with other programs using the same
9770         source code modules.  From Paul Eggert.
9771
9772 2000-08-03  Greg McGary  <greg@mcgary.org>
9773
9774         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9775         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9776         (EXTEND_BUFFER): Use them.
9777
9778 2000-08-01  Jim Meyering  <meyering@lucent.com>
9779
9780         * dirname.c (ISSLASH): Define.
9781         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9782         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9783         both `\' and `/' may be use as path separators.
9784         Based on a patch from Prashant TR.
9785
9786 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9787
9788         * quotearg.c (quotearg_n_options): Don't make the initial
9789         slot vector a constant, since it might get modified.
9790
9791 2000-07-31  Jim Meyering  <meyering@lucent.com>
9792
9793         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9794         * obstack.c (print_and_abort): Likewise.
9795
9796 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9797
9798         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9799         buffer, so that the caller can always quote one small
9800         component of a "memory exhausted" message in slot 0.
9801         From a suggestion by Jim Meyering.
9802
9803 2000-07-30  Jim Meyering  <meyering@lucent.com>
9804
9805         * makepath.c (make_path): Quote the other instance, too.
9806
9807         * quotearg.c (N_STATIC_SLOTVECS): Define.
9808         (STATIC_BUF_SIZE): Define.
9809         (quotearg_n_options): Use only statically allocated storage when
9810         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9811         than STATIC_BUF_SIZE.
9812
9813 2000-07-29  Jim Meyering  <meyering@lucent.com>
9814
9815         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9816         * dirname.c (dir_name): Likewise.
9817
9818         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9819
9820         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9821         (dir_name): Assert that there are no trailing slashes.
9822
9823 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9824
9825         * mbswidth.h (mbswidth): Add a flags argument.
9826         (mbswidth): New declaration.
9827         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9828         * mbswidth.c (mbswidth): Add a flags argument.
9829         (mbsnwidth): New function.
9830
9831 2000-07-24  Jim Meyering  <meyering@lucent.com>
9832
9833         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9834
9835 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9836
9837         * mbswidth.c (_XOPEN_SOURCE):
9838         Don't define; this causes problems on Solaris 7.
9839         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9840
9841 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9842
9843         * quotearg.c:
9844         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9845         so that mbstate_t is always defined.
9846
9847         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9848         be 1 in at least one GCC installation, and this configuration
9849         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9850         performance on hosts that have mbrtowc but have only unibyte
9851         locales, but I assume these hosts are rare.
9852
9853 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9854
9855         * quotearg.c: Streamline by invoking multibyte code only if needed.
9856         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9857         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9858         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9859         invoke multibyte primitives.
9860
9861 2000-07-23  Jim Meyering  <meyering@lucent.com>
9862
9863         * basename.c (base_name): Add an assertion.
9864
9865 2000-07-15  Bruno Haible  <clisp.cons.org>
9866
9867         * quotearg.c: When the system forces us to redefine mbstate_t,
9868         shadow its mbsinit function.
9869
9870 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9871
9872         * mbswidth.h: New file.
9873         * mbswidth.c: New file.
9874         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9875         (noinst_HEADERS): Add mbswidth.h.
9876
9877 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9878
9879         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9880         and IRIX 6.
9881
9882 2000-07-15  Jim Meyering  <meyering@lucent.com>
9883
9884         * makepath.c: Include quote.h.
9885         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9886         corresponding argument in a `quote (...)' call.
9887         Give better diagnostics.
9888
9889         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9890         (noinst_HEADERS): Add quote.h.
9891
9892         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9893         from tar's src/misc.c.
9894         * quote.h: New file.  Prototypes for same.
9895
9896 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9897
9898         From a suggestion by Bruno Haible.
9899         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9900         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9901         to decide whether to define the BeOS workaround macro;
9902         this adjusts to the change to AC_MBSTATE_T.
9903
9904 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9905
9906         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9907
9908         * quotearg.c (quoting_style_args, quoting_style_vals,
9909         quotearg_buffer_restyled): Add support for
9910         clocale_quoting_style.  Undo previous change to
9911         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9912         and "{RIGHT QUOTATION MARK}" msgids.
9913
9914 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9915
9916         The old behavior of quoting `like this' doesn't look good with
9917         newer, ISO-style fonts.  See:
9918         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9919
9920         Instead, quote "like this" by default.  Let the translator
9921         tailor the locale-specific quoting behavior by providing
9922         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9923
9924         * quotearg.c (N_): New macro.
9925         (gettext_default): New function.
9926         (quotearg_buffer_restyled): Use
9927         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9928         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9929
9930 2000-07-09  Jim Meyering  <meyering@lucent.com>
9931
9932         * Most files: Update copyright dates to include 2000.
9933
9934 2000-07-08  Jim Meyering  <meyering@lucent.com>
9935
9936         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9937         if not defined.
9938         (xgethostname): Remove now-unnecessary #ifdef.
9939         Move declaration of `err' into loop where it's used.
9940
9941 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9942
9943         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9944         by allocating a larger buffer. Test the gethostname return value for
9945         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9946         returns an error and ENAMETOOLONG isn't defined.
9947
9948 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9949         and Bruno Haible  <haible@clisp.cons.org>
9950
9951         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9952
9953 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9954
9955         * quotearg.c (struct quoting_options): Simplify quote_these_too
9956         dimension.
9957
9958 2000-07-03  Jim Meyering  <meyering@lucent.com>
9959
9960         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9961         Reported by Bruno Haible.
9962
9963 2000-07-04  Jim Meyering  <meyering@lucent.com>
9964
9965         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9966         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9967         lacks mbrtowc.
9968
9969 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9970         and Bruno Haible  <haible@clisp.cons.org>
9971
9972         * quotearg.c (mbrtowc):
9973         Assign to *pwc, and return 1 only if result is nonzero.
9974         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9975
9976 2000-07-03  Jim Meyering  <meyering@lucent.com>
9977
9978         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9979         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9980         From Bob Proulx.
9981
9982 2000-07-02  Jim Meyering  <meyering@lucent.com>
9983
9984         * quotearg.c (mbstate_t): Don't define here.
9985
9986 2000-07-02  Jim Meyering  <meyering@lucent.com>
9987
9988         * nanosleep.c (SIGCONT): Define if not already defined.
9989
9990 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9991
9992         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9993         per change in ../m4/ls-mntd-fs.m4.
9994         (read_filesystem_list): Ignore symbolic links.
9995
9996 2000-06-29  Jim Meyering  <meyering@lucent.com>
9997
9998         * same.c: Include <string.h> or <strings.h>, as appropriate,
9999         for declaration of strcmp.
10000
10001         * long-options.c: Include <stdlib.h>, for declaration of exit.
10002
10003         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10004         Avoid warning by casting result to `char *' to remove `const'.
10005
10006 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10007
10008         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10009
10010 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10011
10012         savedir now sets errno on failure and invokes xmalloc to get memory.
10013         Fix a couple of other minor bugs while we're at it.
10014
10015         * savedir.c (<unistd.h>): Do not include; there's no need.
10016         (NAMLEN): Remove macro.
10017         (malloc, realloc): Remove decls.
10018         (stpcpy): Likewise.
10019         ("xalloc.h"): Include.
10020         (NAME_SIZE_DEFAULT): New macro.
10021         (savedir): Use xmalloc / xrealloc to allocate memory.
10022         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10023         Skip "" directory entries.
10024         Use strlen to calculate directory entry length, since the old method
10025         is rarely used these days and isn't worth supporting.
10026         Don't use a pointer after freeing it.
10027         Check for integer overflow when calculating allocation size.
10028         Use memcpy to copy entries, instead of stpcpy.
10029         Set errno properly when returning NULL.
10030         Check for readdir error.
10031
10032 2000-06-26  Jim Meyering  <meyering@lucent.com>
10033
10034         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10035
10036 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10037
10038         * getusershell.c (xmalloc, xrealloc): Remove functions.
10039         Include xalloc.h.
10040         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10041
10042 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10043
10044         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10045
10046 2000-06-24  Jim Meyering  <meyering@lucent.com>
10047
10048         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10049
10050 2000-06-21  Jim Meyering  <meyering@lucent.com>
10051
10052         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10053
10054 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10055
10056         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10057         (mbrtowc, mbstate_t): Define substitutes if
10058         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10059         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10060         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10061
10062 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10063
10064         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10065         than 1024, return a memory chunk of least possible size, instead
10066         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10067         Use free/xmalloc instead of xrealloc to avoid copying for very long
10068         paths.
10069
10070 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10071
10072         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10073         address, not strdup.  Include <stdlib.h> and don't declare free().
10074
10075 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10076
10077         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10078         the empty string.
10079
10080 2000-06-21  Jim Meyering  <meyering@lucent.com>
10081
10082         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10083         (noinst_HEADERS): Add getstr.h.
10084
10085         * getline.c (getstr): Move into a separate file.
10086         * getstr.c (getstr): New file, extracted from getline.c, with
10087         the following changes: new parameter, delim2; both delim[12]
10088         parameters have type `int', not `char'.  The latter would lose
10089         with 8-bit delimiters.
10090         * getstr.h: New file.
10091
10092 2000-06-19  Jim Meyering  <meyering@lucent.com>
10093
10094         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10095
10096 2000-06-18  Jim Meyering  <meyering@lucent.com>
10097
10098         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10099         Besides, these days every porting target provides a mkdir function.
10100
10101         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10102         (this snippet comes from src/system.h).
10103
10104 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10105
10106         * human.c (adjust_value): New function.
10107         (human_readable_inexact): Apply rounding style even when
10108         printing approximate values.
10109
10110 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10111
10112         * human.c (human_readable_inexact): Allow an input block
10113         size that is not a multiple of the output block size, and vice versa.
10114         Reported by Piergiorgio Sartor.
10115
10116 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10117
10118         * getdate.y (get_date): Apply relative times after time
10119         zone indicator, not before.  Reported by Todd A. Jacobs.
10120
10121 2000-06-13  Jim Meyering  <meyering@lucent.com>
10122
10123         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10124
10125         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10126
10127 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10128
10129         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10130
10131 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10132
10133         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10134
10135 2000-06-04  Jim Meyering  <meyering@lucent.com>
10136
10137         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10138         SunOS 4.1.4 for which gid_t is an unsigned type.
10139
10140 2000-06-03  Jim Meyering  <meyering@lucent.com>
10141
10142         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10143
10144 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10145
10146         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10147         newer, don't install charset.alias.
10148         * config.charset: Change the Linux/glibc rules so they become empty
10149         on glibc-2.1 or newer.
10150
10151 2000-06-02  Jim Meyering  <meyering@lucent.com>
10152
10153         * mountlist.c: Back out last change.  Instead, do this...
10154         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10155         member using the same `ignore'-testing code.
10156         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10157         fs_type strings.
10158         From Mark D. Roth.
10159
10160 2000-05-29  Jim Meyering  <meyering@lucent.com>
10161
10162         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10163         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10164
10165 2000-05-22  Jim Meyering  <meyering@lucent.com>
10166
10167         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10168
10169 2000-05-18  Jim Meyering  <meyering@lucent.com>
10170
10171         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10172         back, too, since it may have been modified by allocate_entry.
10173         (hash_delete): Rewrite to use neither the assignment operator
10174         nor the comma operator in an if-expression.
10175
10176 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10177
10178         * closeout.c:
10179         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10180         Remove; no longer needed.
10181         "quotearg.h": Add include.
10182         (file_name): Do not bother to explicitly initialize to NULL; it's less
10183         efficient on some hosts.
10184         (close_stdout_status): Remove test as to whether stdout was already
10185         closed; it breaks for the case "echo x | sort >&-".
10186         Quote file name colons.
10187         Do not assume that _("write error") lacks format strings.
10188
10189 2000-05-15  Jim Meyering  <meyering@lucent.com>
10190
10191         * version-etc.c (version_etc_copyright): Update the copyright string
10192         used in all --version output.
10193
10194 2000-05-14  Jim Meyering  <meyering@lucent.com>
10195
10196         * closeout.c (close_stdout_set_file_name): New function.
10197         (close_stdout_status): Use new file-scoped global.
10198         Return right away if fstat says the stdout file descriptor is invalid.
10199         * closeout.h (close_stdout_set_file_name): Declare.
10200
10201 2000-05-10  Jim Meyering  <meyering@lucent.com>
10202
10203         * closeout.c [default_exit_status]: New file-scoped variable.
10204         (close_stdout_set_status): New function.
10205         * closeout.h (close_stdout_set_status): Declare.
10206
10207 2000-05-08  Jim Meyering  <meyering@lucent.com>
10208
10209         * long-options.c: Don't include closeout.h.
10210         (parse_long_options): Don't call close_stdout for --version.
10211
10212 2000-05-06  Jim Meyering  <meyering@lucent.com>
10213
10214         * strnlen.c: Undefine __strnlen and strnlen.
10215         [!weak_alias]: Define __strnlen to strnlen.
10216
10217         * atexit.c: New file, from libiberty.
10218
10219 2000-05-06  Jim Meyering  <meyering@lucent.com>
10220
10221         * closeout.c (close_stdout_status): Also check for errors on the
10222         stderr stream.
10223
10224 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10225
10226         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10227         instead of xmalloc, xrealloc, path_concat.
10228         (locale_charset): Treat empty environment variables as absent.
10229         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10230
10231 2000-05-04  Jim Meyering  <meyering@lucent.com>
10232
10233         * getopt.c: Update from glibc.
10234         * obstack.c: Likewise.
10235         * obstack.h: Likewise.
10236         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10237
10238         * regex.h: Likewise.
10239         * strndup.c: Likewise.
10240         * strnlen.c: New file, from glibc.
10241
10242 2000-05-01  Jim Meyering  <meyering@lucent.com>
10243
10244         * full-write.c (full_write): Remove `FIXME' part of comment.
10245
10246 2000-04-29  Jim Meyering  <meyering@lucent.com>
10247
10248         * path-concat.c: Declare strdup only if it's not defined.
10249         * canon-host.c: Likewise.
10250
10251 2000-04-28  Jim Meyering  <meyering@lucent.com>
10252
10253         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10254         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10255         included first, then limits.h is included by locale.h by libintl.h.
10256         From John David Anglin.
10257
10258 2000-04-25  Jim Meyering  <meyering@lucent.com>
10259
10260         * makepath.c (S_IRWXUGO): Define.
10261         (make_path): Always perform explicit chmod if MODE specifies any
10262         of the `special' permission bits.  Prompted by a bug report against
10263         install from Mate Wierdl and Joost van Baal.
10264
10265 2000-04-18  Jim Meyering  <meyering@lucent.com>
10266
10267         * README: New file.
10268
10269         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10270         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10271
10272 2000-04-17  Jim Meyering  <meyering@lucent.com>
10273
10274         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10275         the definition of it to rpl_strftime also defined-away the system's
10276         declaration.
10277
10278 2000-04-15  Jim Meyering  <meyering@lucent.com>
10279
10280         Use `C' to denote so-called `contiguous' files, the same way
10281         that tar does.
10282         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10283         (ftypelet): Use S_ISCTG.
10284         From Michael Deutschmann.
10285
10286 2000-04-14  Jim Meyering  <meyering@lucent.com>
10287
10288         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10289
10290 2000-04-08  Jim Meyering  <meyering@lucent.com>
10291
10292         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10293         names don't conflict.  Reported by Eli Zaretskii.
10294
10295 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10296
10297         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10298         bug.  Deal with the different error behavior of Irix iconv.
10299
10300 2000-04-07  Jim Meyering  <meyering@lucent.com>
10301
10302         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10303         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10304
10305 2000-04-05  Jim Meyering  <meyering@lucent.com>
10306
10307         Portability tweaks required for ultrix4.3.
10308         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10309         * readutmp.c: Include sys/types.h before sys/stat.h.
10310         * canon-host.c: Declare strdup.
10311         * path-concat.c: Likewise.
10312         From John David Anglin.
10313
10314 2000-04-04  Jim Meyering  <meyering@lucent.com>
10315
10316         Be more DOS 8.3-friendly.
10317         * ref-add.sin: Renamed from ref-add.sed.in.
10318         * ref-del.sin: Renamed from ref-del.sed.in.
10319         * Makefile.am: Reflect renaming.
10320         Reported by Eli Zaretskii.
10321
10322         Use a temporary file name that won't clash with `charset.alias'
10323         in the DOS 8.3 name space.
10324         * Makefile.am (charset_tmp): Define.
10325         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10326         (uninstall-local): Likewise.
10327         Reported by Eli Zaretskii.
10328
10329 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10330
10331         * time/strftime.c (my_strftime): Make sure we call the system
10332         strftime, not ourselves, when invoking the underlying strftime.
10333
10334 2000-03-24  Jim Meyering  <meyering@lucent.com>
10335
10336         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10337         (charset_alias): Define.
10338         (install-exec-local): Factor out common code.
10339         (uninstall-local): Split lines longer than 80.
10340         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10341         (SUFFIXES): Define.
10342         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10343         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10344
10345 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10346
10347         * config.charset: Output a line containing "Packages using this file".
10348         * ref-add.sed.in, ref-del.sed.in: New files.
10349         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10350         ref-del.sed): New rules.
10351
10352 2000-03-17  Jim Meyering  <meyering@lucent.com>
10353
10354         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10355         Otherwise, include <strings.h>
10356
10357 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10358
10359         * unicodeio.c (utf8_wctomb): New function.
10360         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10361         format instead of in UCS-4 with platform dependent endianness.
10362
10363 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10364
10365         * savedir.c (savedir): Work even if directory size is
10366         negative; this can happen with some screwy NFS configurations.
10367
10368 2000-03-06  Jim Meyering  <meyering@lucent.com>
10369
10370         * localcharset.c (get_charset_aliases): Don't try to free file_name
10371         if it's NULL (because we ran out of memory).  From Bruno Haible.
10372
10373 2000-03-05  Jim Meyering  <meyering@lucent.com>
10374
10375         * localcharset.c ("path-concat.h"): Include.
10376         (get_charset_aliases): Use path_concat instead of ANSI string
10377         concatenation.
10378
10379         * unicodeio.h (PARAMS): Define.
10380         Use it to guard prototype.
10381
10382 2000-03-04  Jim Meyering  <meyering@lucent.com>
10383
10384         * Makefile.am (install-exec-local): Create $(libdir) before installing
10385         into it.
10386         (uninstall-local): Uncomment this rule so `make distcheck' works
10387         once again.
10388
10389         * unicodeio.c (<errno.h>): Include it.
10390         (errno): Declare if not defined.
10391
10392         * localcharset.c: Add Bruno's comment justifying use of volatile.
10393
10394         * config.charset: New version, incorporating remarks from a linux
10395         i18n mailing list.  From Bruno Haible.
10396
10397 2000-03-02  Jim Meyering  <meyering@lucent.com>
10398
10399         * Makefile.am (EXTRA_DIST): Add config.charset.
10400
10401 2000-03-01  Jim Meyering  <meyering@lucent.com>
10402
10403         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10404         * unicodeio.c: Likewise.
10405
10406 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10407
10408         * config.charset: New file.
10409         * localcharset.c: New file.
10410         * unicodeio.h, unicodeio.c: New files.
10411         * Makefile.am (DEFS): Add -DLIBDIR=...
10412         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10413         (noinst_HEADERS): Add unicodeio.h.
10414         (all-local, install-exec-local, charset.alias): New targets.
10415
10416 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10417
10418         * quotearg.c (ALERT_CHAR): New macro.
10419         (quotearg_buffer_restyled): Use it.
10420
10421 2000-02-27  Jim Meyering  <meyering@lucent.com>
10422
10423         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10424         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10425
10426         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10427         not `#if STDC_HEADERS'.
10428         Declare malloc if needed.
10429
10430         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10431         now that autoconf always defines the HAVE_DECL_ symbols.
10432         * human.c: Likewise.
10433         * same.c: Likewise.
10434         * strtoumax.c: Likewise.
10435
10436         * backupfile.c: Arrange for cpp to fail if the configure-time
10437         declaration check was not run.
10438         * hash.c: Likewise.
10439         * human.c: Likewise.
10440         * same.c: Likewise.
10441         * strtoumax.c: Likewise.
10442
10443         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10444         then first look up the entire `.'-containing string as a login name.
10445
10446 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10447
10448         * getdate.y: Handle two-digit years with leading zeros correctly.
10449         (textint): New typedef.
10450         (parser_control): Member year changed from int to textint.
10451         All uses changed.
10452         (YYSTYPE): Removed; replaced by %union with int and textint members.
10453         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10454         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10455         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10456         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10457         (date, number, to_year): Use width of number in digits, not its value,
10458         to determine whether it's a 2-digit year, or a 2-digit time.
10459         (yylex): Store number of digits of numeric tokens.
10460         Reported by John Kendall.
10461
10462         (parser_control): Changed from struct parser_control to typedef (for
10463         consistency).  All uses changed.
10464
10465         (tID): Removed; not used.
10466         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10467
10468 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10469
10470         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10471         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10472
10473 2000-02-12  Jim Meyering  <meyering@lucent.com>
10474
10475         * userspec.c (ISDIGIT): Define it.
10476         (isdigit): Remove definition.
10477         (is_number): Use ISDIGIT, not isdigit.
10478         <libintl.h>: Include.
10479         (_ and N_): Define.
10480         (parse_user_spec): Mark translatable strings.
10481
10482 2000-02-10  Jim Meyering  <meyering@lucent.com>
10483
10484         With these changes, nanosleep.[ch] are finally enough like the other
10485         lib/* replacement files to compile on a few more losing systems.
10486
10487         * nanosleep.h: Don't include config.h.
10488         Remove prototype from declaration of nanosleep.
10489         (PARAMS): Remove now-unneeded definition.
10490         * nanosleep.c: #undef nanosleep.
10491         (rpl_nanosleep): Rename from nanosleep.
10492
10493 2000-02-03  Jim Meyering  <meyering@lucent.com>
10494
10495         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10496         rather than with `#if HAVE_UTMPNAME'.
10497
10498 2000-02-01  Jim Meyering  <meyering@lucent.com>
10499
10500         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10501
10502 2000-01-31  Jim Meyering  <meyering@lucent.com>
10503
10504         * nanosleep.h (nanosleep): Guard declaration with
10505         `#if ! HAVE_DECL_NANOSLEEP'.
10506         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10507         the declaration in that vendor's sys/timers.h.
10508         Reported by Christian Krackowizer.
10509
10510         * quotearg.c (ISASCII): Add #undef and move definition to follow
10511         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10512         (ISPRINT): Likewise.
10513         Reported by Tom Tromey.
10514
10515 2000-01-30  Jim Meyering  <meyering@lucent.com>
10516
10517         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10518         uses of ->ut_name.  The latter doesn't work with new Linux header files
10519         where only utmpx.ut_user is declared.
10520
10521         * readutmp.h (UT_USER): Define.
10522
10523 2000-01-23  Jim Meyering  <meyering@lucent.com>
10524
10525         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10526         obstack.c.
10527
10528 2000-01-22  Jim Meyering  <meyering@lucent.com>
10529
10530         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10531         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10532         Required for some AIX systems.  Reported by Christian Krackowizer.
10533         [TESTING] (main): New function.
10534
10535         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10536         * dirname.c (dir_name): Support for DOS-style file names with drive
10537         letters.
10538
10539         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10540
10541         * strverscmp.c (ISDIGIT): Define.
10542         (strverscmp): Use ISDIGIT, not isdigit.
10543
10544 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10545
10546         * nanosleep.c (nanosleep):
10547         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10548         POSIX.1 doesn't require SA_INTERRUPT and some systems
10549         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10550         it's been part of POSIX.1 since day 1 (in 1988).
10551
10552 2000-01-17  Jim Meyering  <meyering@lucent.com>
10553
10554         * interlock: Remove unused file.  Reported by François Pinard.
10555
10556 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10557
10558         * quotearg.c (quotearg_buffer_restyled): Do not quote
10559         alert, backslash, formfeed, and vertical tab unnecessarily in
10560         shell quoting style.
10561
10562
10563 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10564 Free Software Foundation, Inc.
10565 Copying and distribution of this file, with or without modification,
10566 are permitted provided the copyright notice and this notice are preserved.