* argz_.h: Sync from Libtool.
[pspp] / lib / ChangeLog
1 2006-09-05  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2
3         * argz_.h: Sync from Libtool.
4         
5         2006-09-04  George Bosilca <bosilca@cs.utk.edu>
6                 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7         
8         * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
9
10 2006-09-05  Davide Angelocola <davide.angelocola@tiscali.it>
11
12         * trim.h: New file.
13         * trim.c: New file.
14
15 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
16
17         * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
18         Problem reported by Ralf Wildenhues in
19         <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
20
21         * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
22         HAVE_STRUCT_STATFS_F_FSTYPENAME.
23
24 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
25
26         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
27         or stdbool.h, because they might not exist while configuring.
28
29         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
30         Don't include unistd.h or limits.h; not needed, since chdir-long.h
31         does that for us.
32         (O_DIRECTORY): Remove.
33
34 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
35
36         Work around a bug in both the Linux and SunOS 64-bit kernels:
37         nanosleep mishandles sleeps for longer than 2**31 seconds.
38         Problem reported by Frank v Waveren in
39         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
40         * nanosleep.c (BILLION): New constant.
41         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
42         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
43
44 2006-08-30  Jim Meyering  <jim@meyering.net>
45
46         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
47         the parameter.
48
49 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
50
51         * isapipe.c, isapipe.h: New files.
52
53 2006-08-29  Eric Blake  <ebb9@byu.net>
54
55         * error.c (error_at_line, print_errno_message): Match libc, after
56         resolution of upstream bug 3044.
57
58 2006-08-29  Bruno Haible  <bruno@clisp.org>
59
60         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
61
62 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
63
64         Sync from Libtool:
65
66         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
67
68         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
69         sharing with gnulib.  Report by Eric Blake.
70
71 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
72
73         * fcntl_.h: New file.
74         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
75         the fcntl module.
76         * dirchownmod.c: Likewise.
77         * fts.c: Likewise.
78
79         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
80         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
81         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
82         just before including <inttypes.h>, to avoid circular inclusion.
83
84 2006-08-28  Bruno Haible  <bruno@clisp.org>
85
86         * inttypes_.h (SCNX*): Remove definitions.
87         Reported by Eric Blake.
88
89 2006-08-26  Bruno Haible  <bruno@clisp.org>
90
91         * vasnprintf.c (EOVERFLOW): Remove definition.
92         (VASNPRINTF): Return a string of length > INT_MAX without failing.
93         * vasprintf.c: Include errno.h, limits.h.
94         (EOVERFLOW): New fallback definition.
95         (vasprintf): Test here whether the string length is > INT_MAX.
96         * vsnprintf.c: Include errno.h, limits.h.
97         (EOVERFLOW): New fallback definition.
98         (vsnprintf): Fix bug when generated string was too long for the buffer.
99         Test here whether the string length is > INT_MAX.
100
101 2006-08-26  Bruno Haible  <bruno@clisp.org>
102             Simon Josefsson  <jas@extundo.com>
103
104         BeOS portability.
105         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
106
107 2006-08-28  Bruno Haible  <bruno@clisp.org>
108
109         * c-strstr.h: New file, from GNU gettext.
110         * c-strstr.c: New file, from GNU gettext.
111
112 2006-08-26  Bruno Haible  <bruno@clisp.org>
113
114         * inttypes_.h: New file.
115         * inttypes.h: Remove file.
116         * stdint_.h: Include <inttypes.h> through its absolute filename.
117
118         * imaxabs.c: New file.
119
120         * imaxdiv.c: New file.
121
122 2006-08-22  Bruno Haible  <bruno@clisp.org>
123
124         * readutmp.h: Skip most definitions if neither <utmp.h> nor
125         <utmpx.h> exists.
126
127 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
128
129         BeOS portability.
130         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
131         Problem reported by Bruno Haible.
132
133 2006-08-21  Bruno Haible  <bruno@clisp.org>
134
135         BeOS portability.
136         * mbchar.h: Include <wctype.h> only if it exists.
137
138 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
139
140         * cycle-check.h: Include <stdint.h> unconditionally, since we
141         now assume the stdint module.  Do not include inttypes.h.
142         * fsusage.h: Likewise.
143         * getndelim2.c: Likewise.
144         * human.h: Likewise.
145         * inttostr.h: Likewise.
146         * obstack.c: Likewise.
147         * regex_internal.h: Likewise.
148         * tempname.c: Likewise.
149         * utimecmp.c: Likewise.
150         * xstrtol.h: Likewise.
151
152         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
153
154         * strtoimax.c: Adjust to macro name changes in Autoconf,
155         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
156         * xtime.h: Likewise.
157
158 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
159
160         * fchmodat.c: New file, from coreutils.  This was inadvertently
161         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
162
163 2006-08-18  Bruno Haible  <bruno@clisp.org>
164
165         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
166         (ME_DUMMY): Treat "kernfs" as a dummy.
167         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
168
169 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
170
171         Update from coreutils.
172
173         * __fpending.h: Add copyright notice.
174         * fprintftime.h: Likewise.
175         * savedir.c: Use (C) in copyright notice.
176         * savedir.h: Likewise.
177
178         2006-08-15  Jim Meyering  <jim@meyering.net>
179
180         * at-func.c: New file, with the logic of all emulated at-functions.
181         * openat-priv.h: Include <errno.h> and define ENOSYS,
182         in support of the EXPECTED_ERRNO macro.
183         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
184         Instead, define the appropriate symbols and include "at-func.c".
185         * mkdirat.c (mkdirat): Likewise.
186         * fchmodat.c (fchmodat): Likewise.
187         (ENOSYS): Remove definition.
188         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
189         Don't include "unistd--.h" -- it wasn't ever used.
190
191         2006-01-17  Jim Meyering  <jim@meyering.net>
192
193         Rewrite fts.c not to change the current working directory,
194         by using openat, fstatat, fdopendir, etc..
195
196         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
197         (HAVE_OPENAT_SUPPORT): Define.
198         [_LIBC] (fchdir): Don't undef or define; no longer used.
199         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
200         Now, this `function' always succeeds, and consumes its file descriptor
201         parameter -- so callers must not close such FDs.  Update callers.
202         (diropen_fd, opendirat, cwd_advance_fd): New functions.
203         (diropen): Add parameter, SP.  Adjust all callers.
204         Implement using diropen_fd, rather than open.
205         (fts_open): Initialize new member, fts_cwd_fd.
206         Remove fts_rft-setting code.
207         (fts_close): Close fts_cwd_fd, if necessary.
208         (__opendir2): Define in terms of opendir or opendirat,
209         depending on whether the FST_NOCHDIR flag is set.
210         (fts_build): Since fts_safe_changedir consumes its FD, and since
211         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
212         and close the dup'd file descriptor upon failure.
213         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
214         (fts_safe_changedir): Tweak semantics to reflect that this function
215         now calls cwd_advance_fd and hence consumes its FD argument.
216         * fts_.h [struct FTS] (fts_cwd_fd): New member.
217         [struct FTS] (fts_rft): Remove now-unused member.
218         [struct FTS] (fts_cycle.state): Improve comment.
219
220         * openat.c (openat_needs_fchdir): New function.
221         * openat.h (openat_needs_fchdir): Declare it.
222
223 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
224
225         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
226         Problem and fix reported by Pádraig Brady in
227         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
228
229 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
230
231         * memcoll.c (memcoll): Optimize for the common case where the
232         arguments are bytewise equal.
233
234 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
235
236         Change copyright notice from LGPL 2 to GPL 2, since that's the
237         standard form used in the gnulib repository.
238         * lock.c: LGPL -> GPL.
239         * lock.h: Likewise.
240         * strnlen1.c: Likewise.
241         * strnlen1.h: Likewise.
242         * tls.c: Likewise.
243         * tls.h: Likewise.
244         * tmpdir.c: Likewise.
245
246         * TODO: Remove; this belongs only in coreutils.
247
248 2006-08-14  Eric Blake  <ebb9@byu.net>
249
250         Import the following change from libc:
251
252         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
253
254         Upstream bug 2997.
255         * misc/error.c: Add space between program name and message if file
256         name is missing.
257
258 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
259
260         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
261         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
262
263         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
264         in wchar_t.  Problem reported by Eric Blake.
265
266         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
267         LEN is smaller than SIZE.  Suggested by Bruno Haible.
268         Also, help the compiler to keep LEN in a register.
269
270 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
271
272         * .cppi-disable: Add snprintf.h, socket_.h.
273         * snprintf.c: Include <errno.h> and <limits.h>.
274         (EOVERFLOW): Define if the system does not.
275         Do not include "minmax.h"; it wasn't used.
276         (snprintf): Don't assume size_t promotes to an unsigned type.
277         Fix bug when generated string was too long for the buffer: the
278         buffer's contents are supposed to be the initial prefix of the
279         output.  Don't assume vasnprintf returns EOVERFLOW if the size
280         exceeds INT_MAX; do the check ourselves.
281
282         Import the following changes from libc:
283
284         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
285
286         * posix/regex_internal.c (re_string_skip_chars): If no character has
287         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
288         to the byte which couldn't be converted.
289         (re_string_reconstruct): Don't clear valid_raw_len before calling
290         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
291         tip_context using re_string_context_at.
292
293         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
294
295         * posix/regex.h: g++ still cannot handled [restrict].
296
297         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
298
299         * posix/regex.h: Remove special handling for VMS.
300
301 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
302
303         Sync from coreutils.
304
305         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
306
307         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
308         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
309
310 2006-08-08  Eric Blake  <ebb9@byu.net>
311
312         * verror.c (verror_at_line): Work around glibc bug 2997, so that
313         verror_at_line output complies with GNU Coding Standards even when
314         file is NULL.
315
316 2006-08-08  Eric Blake  <ebb9@byu.net>
317
318         * verror.h, verror.c: New files.
319
320 2006-08-07  Bruno Haible  <bruno@clisp.org>
321
322         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
323         versions of AIX.
324         Reported by Ralf Wildenhues.
325
326 2006-08-06  Eric Blake  <ebb9@byu.net>
327
328         * error.h: Fold in some upstream changes from glibc.
329         * error.c: Likewise.
330
331 2006-07-29  Bruno Haible  <bruno@clisp.org>
332
333         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
334
335 2006-07-29  Bruno Haible  <bruno@clisp.org>
336
337         * setenv.c: Undo unintended modification done on 2006-02-27.
338
339 2006-07-28  Eric Blake  <ebb9@byu.net>
340
341         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
342         macro expansion.
343
344 2006-07-28  Simon Josefsson  <jas@extundo.com>
345
346         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
347         #include's.
348
349 2006-07-28  Simon Josefsson  <jas@extundo.com>
350
351         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
352         #include's.
353
354 2006-07-28  Bruno Haible <bruno@clisp.org>
355
356         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
357
358 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
359
360         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
361         arpa/inet.h.
362
363 2006-07-28  Bruno Haible  <bruno@clisp.org>
364
365         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
366         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
367         fallbacks.
368         Avoids link error on FreeBSD 4.x.
369         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
370
371         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
372         encoding.
373         * mbswidth.c (iswcntrl): Likewise.
374
375 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
376
377         * modechange.c (mode_compile): Numeric modes now affect setuid and
378         setgid on directories only if they set these bits.
379         * modechange.h: Remove obsolete comment about masks.
380
381 2006-07-27  Bruno Haible  <bruno@clisp.org>
382
383         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
384         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
385         defined.
386
387 2006-07-26  Eric Blake  <ebb9@byu.net>
388
389         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
390         like mingw that lack mkstemp.
391         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
392         avoid compilation warning on mingw.
393
394 2006-07-25  Bruno Haible  <bruno@clisp.org>
395
396         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
397         <stdarg.h> or config.h.
398
399 2006-07-24  Bruno Haible  <bruno@clisp.org>
400
401         * clean-temp.h: New file, from GNU gettext.
402         * clean-temp.c: New file, from GNU gettext.
403
404 2006-07-24  Bruno Haible  <bruno@clisp.org>
405
406         * tmpdir.h: New file, from GNU gettext.
407         * tmpdir.c: New file, from GNU gettext.
408
409 2006-07-23  Bruno Haible  <bruno@clisp.org>
410
411         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
412         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
413         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
414         gl_linked_remove_at): Use it.
415
416 2006-07-23  Eric Blake  <ebb9@byu.net>
417
418         * tmpfile-safer.c: New file.
419         * stdio-safer.h (fopen_safer): Add prototype.
420         * stdio--.h (tmpfile): Make safer.
421
422 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
423
424         * close-stream.c, close-stream.h: New files.
425
426 2006-07-22  Bruno Haible  <bruno@clisp.org>
427
428         Merge from GNU gettext 0.15.
429
430         2005-07-05  Bruno Haible  <bruno@clisp.org>
431
432                 * printf-args.c (printf_fetchargs): Work around broken
433                 definition of wint_t on mingw.
434
435         2005-02-12  Bruno Haible  <bruno@clisp.org>
436
437                 * xallocsa.h: Add extern "C" for C++.
438
439         2006-05-17  Bruno Haible  <bruno@clisp.org>
440
441                 Cygwin portability.
442                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
443
444         2006-04-30  Bruno Haible  <bruno@clisp.org>
445
446                 * progreloc.c: Include <mach-o/dyld.h> if available.
447                 (find_executable): Use _NSGetExecutablePath when possible.
448
449         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
450
451                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
452                 function.
453
454         2005-12-29  Bruno Haible  <bruno@clisp.org>
455
456                 * progreloc.c (set_program_name_and_installdir): Fix
457                 compilation error.
458
459         2005-12-04  Bruno Haible  <bruno@clisp.org>
460
461                 Cygwin portability.
462                 * progreloc.c: Include <windows.h> also on Cygwin.
463                 (find_executable): Add support for Cygwin.
464                 (set_program_name_and_installdir): Handle also platforms with
465                 nonempty EXEEXT.
466
467         2006-07-11  Bruno Haible  <bruno@clisp.org>
468
469                 * javacomp.c: Fix a comment.
470                 Reported by Jim Meyering.
471
472         2006-04-30  Bruno Haible  <bruno@clisp.org>
473
474                 * javacomp.h (compile_java_class): Add source_version,
475                 target_version arguments.
476                 * javacomp.c: Rewritten to choose only a compiler that
477                 respects the specified source_version and target_version.
478
479         2006-06-27  Bruno Haible  <bruno@clisp.org>
480
481                 Assume correct S_ISDIR macro.
482                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
483
484         2006-07-22  Bruno Haible  <bruno@clisp.org>
485
486                 * javaversion.h: New file, from GNU gettext.
487                 * javaversion.c: New file, from GNU gettext.
488                 * javaversion.java: New file, from GNU gettext.
489                 * javaversion.class: New file, from GNU gettext.
490
491         2006-05-17  Bruno Haible  <bruno@clisp.org>
492
493                 Cygwin portability.
494                 * javaexec.c (execute_java_class): Test for jview program
495                 also on Cygwin.
496
497         2006-04-09  Bruno Haible  <bruno@clisp.org>
498
499                 * fatal-signal.c: Don't include string.h.
500                 (at_fatal_signal): Use a copying loop instead of memcpy.
501
502         2005-12-04  Bruno Haible  <bruno@clisp.org>
503
504                 * csharpexec.c: Add support for 'clix' launcher (untested).
505                 (execute_csharp_using_sscli): New function.
506                 (execute_csharp_program): Call it.
507
508         2006-06-21  Bruno Haible  <bruno@clisp.org>
509
510                 Avoid warnings from recent versions of mcs.
511                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
512                 -o, -L, -r any more. Use options documented since mcs-1.0
513                 instead. Similarly for -g.
514
515         2005-07-09  Bruno Haible  <bruno@clisp.org>
516
517                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
518                 add a .dll suffix.
519                 Reported by Mark Junker <mjscod@gmx.de>.
520
521         2006-06-17  Bruno Haible  <bruno@clisp.org>
522
523                 * config.charset: Update for NetBSD 3.0.
524
525         2006-05-17  Bruno Haible  <bruno@clisp.org>
526
527                 Cygwin portability.
528                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
529
530         2006-05-16  Bruno Haible  <bruno@clisp.org>
531
532                 * localcharset.c [CYGWIN]: Include <windows.h>.
533                 (get_charset_aliases): For Cygwin, return the same CPxxx
534                 aliases list as under WIN32.
535                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
536                 the environment variables. Fall back to GetACP().
537
538         2006-04-05  Bruno Haible  <bruno@clisp.org>
539
540                 * config.charset: Update Juan Manuel Guerrero's address.
541
542         2005-02-12  Bruno Haible  <bruno@clisp.org>
543
544                 * allocsa.h: Add extern "C" for C++.
545
546         2005-02-10  Bruno Haible  <bruno@clisp.org>
547
548                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
549                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
550
551         2006-07-22  Bruno Haible  <bruno@clisp.org>
552
553                 * gettext.h: Update to GNU gettext-0.15.
554
555 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
556         and Simon Josefsson <jas@extundo.com>
557
558         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
559
560         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
561
562 2006-07-21  Eric Blake  <ebb9@byu.net>
563
564         * stdlib-safer.h: New file from coreutils, required by
565         stdlib--.h.
566
567 2006-07-19  Derek R. Price  <derek@ximbiot.com>
568
569         * getaddrinfo.h: Don't define unimplemented AI_* flags.
570         Reindent and repaginate.
571
572 2006-07-17  Bruno Haible  <bruno@clisp.org>
573
574         * gl_list.h: New file.
575         * gl_list.c: New file.
576         * gl_array_list.h: New file.
577         * gl_array_list.c: New file.
578         * gl_carray_list.h: New file.
579         * gl_carray_list.c: New file.
580         * gl_linked_list.h: New file.
581         * gl_linked_list.c: New file.
582         * gl_anylinked_list1.h: New file.
583         * gl_anylinked_list2.h: New file.
584         * gl_avltree_list.h: New file.
585         * gl_avltree_list.c: New file.
586         * gl_anyavltree_list1.h: New file.
587         * gl_anyavltree_list2.h: New file.
588         * gl_rbtree_list.h: New file.
589         * gl_rbtree_list.c: New file.
590         * gl_anyrbtree_list1.h: New file.
591         * gl_anyrbtree_list2.h: New file.
592         * gl_anytree_list1.h: New file.
593         * gl_anytree_list2.h: New file.
594         * gl_linkedhash_list.h: New file.
595         * gl_linkedhash_list.c: New file.
596         * gl_anyhash_list1.h: New file.
597         * gl_anyhash_list2.h: New file.
598         * gl_avltreehash_list.h: New file.
599         * gl_avltreehash_list.c: New file.
600         * gl_rbtreehash_list.h: New file.
601         * gl_rbtreehash_list.c: New file.
602         * gl_anytreehash_list1.h: New file.
603         * gl_anytreehash_list2.h: New file.
604
605         * gl_oset.h: New file.
606         * gl_oset.c: New file.
607         * gl_array_oset.h: New file.
608         * gl_array_oset.c: New file.
609         * gl_avltree_oset.h: New file.
610         * gl_avltree_oset.c: New file.
611         * gl_rbtree_oset.h: New file.
612         * gl_rbtree_oset.c: New file.
613         * gl_anytree_oset.h: New file.
614
615 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
616
617         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
618         New files.
619         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
620         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
621         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
622         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
623         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
624         callers changed.  Revamp internals significantly, by not
625         attempting to create directories that are temporarily more
626         permissive than the final results.  Do not attempt to use
627         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
628         This removes some race conditions, fixes some bugs, and simplifies
629         things.  Use new dirchownmod function to do owner and mode changes.
630         * mkdir-p.h: Likewise.
631         * modechange.c (octal_to_mode): New function.
632         (struct mode_change): New member mentioned.
633         (make_node_op_equals): New arg mentioned.  All callers changed.
634         (mode_compile): Keep track of which mode bits the user has explicitly
635         mentioned.
636         (mode_adjust): New arg DIR, so that we implement the X op correctly.
637         New arg PMODE_BITS, to keep track of which mode bits the user
638         mentioned; it treats S_ISUID and S_ISGID speciall.
639         All callers changed.
640         * modechange.h: Likewise.
641
642 2006-07-11  Derek R. Price  <derek@ximbiot.com>
643
644         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
645
646 2006-07-10  Derek R. Price  <derek@ximbiot.com>
647
648         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
649         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
650         macros into the GNU _D_EXACT_NAMLEN.
651         * savedir.c:  Likewise.
652         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
653
654 2006-07-09  Jim Meyering  <jim@meyering.net>
655
656         * argp-pv.c: Remove a doubled word in a comment.
657         * check-version.c (check_version): Likewise.
658         * javacomp.c (compile_java_class): Likewise.
659
660 2006-07-08  Jim Meyering  <jim@meyering.net>
661
662         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
663
664 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
665
666         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
667         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
668         brackets.  Other minor changes to suppress some compiler
669         warnings.
670
671 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
672
673         * getloadavg.c: Use __VMS, not VMS.
674         * getopt.c: Likewise.
675         * getpagesize.h: Likewise.
676         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
677         probably does not work.
678
679 2006-07-06  Derek R. Price  <derek@ximbiot.com>
680         and Paul Eggert  <eggert@cs.ucla.edu>
681
682         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
683         Don't worry about this obsolete case any more.
684         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
685         directories.
686         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
687         worry about this obsolete case any more.
688         * fts.c: Likewise.
689         * getcwd.c: Likewise.
690         * glob.h: Likewise.
691         * savedir.c: Likewise.
692
693 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
694
695         * .cppi-disable: Add wcwidth.
696         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
697         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
698         (ISGRAPH): Remove.  All uses changed to isgraph.
699         (FOLD) [!defined _LIBC]: Remove special case.
700         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
701         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
702         HAVE_ISBLANK.
703         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
704
705 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
706
707         * strtod.c (strtod): cast the argument of tolower to unsigned char.
708
709 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
710
711         * memcasecmp.c: Include <limits.h>.
712         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
713         * strtod.c (strtod): Don't assume isspace works on negative chars.
714         Don't assume isdigit succeeds only on '0' through '9'.
715
716 2006-07-05  Derek R. Price  <derek@ximbiot.com>
717
718         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
719         All uses of is_space replaced by isspace.
720         * exit.h: Don't talk about STDC_HEADERS.
721         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
722         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
723         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
724         replaced by isprint etc.
725         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
726         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
727         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
728         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
729         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
730         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
731
732 2006-07-05  Eric Blake  <ebb9@byu.net>
733
734         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
735         missing from netdb.h.
736         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
737
738 2006-06-27  Bruno Haible  <bruno@clisp.org>
739
740         Assume ANSI C header files and <ctype.h> functions.
741         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
742         (mbsnwidth): Use isprint, iscntrl instead.
743
744 2006-07-03  Jim Meyering  <jim@meyering.net>
745
746         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
747         macro is used before the first cycle_check call.
748
749 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
750
751         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
752         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
753         reported by Mark D. Baushke, one in
754         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
755
756         Merge from coreutils.
757
758         * .cppi-disable: Add stdint_.h.
759         * .cvsignore: Add stdint.h.
760
761         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
762
763         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
764         both double and long double versions.
765         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
766         * xstrtold.c: New file.
767         * xstrtod.h (xstrtold): New decl.
768
769         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
770
771         * filemode.c (setst): Remove.
772         (strmode): Rewrite to avoid setst.  This makes the code shorter,
773         (arguably) clearer, and the generated code is a bit smaller on my
774         Debian GNU/Linux stable x86 host.
775
776         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
777
778         * filemode.c: Include "filemode.h" first, to test the interface.
779         Assume that filemode.h includes sys/types.h and sys/stat.h.
780         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
781         (ftypelet): Reorder to put common cases first, for efficiency.
782         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
783         to do 'M'.
784         (strmode): Renamed from mode_string, and now stores 12 bytes instead
785         of 10, for compatibility with FreeBSD.  All callers changed.
786         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
787         that can't be deduced solely from st_mode.  First arg is now a const
788         pointer.
789         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
790         (strmode): Renamed from mode_string.
791         (filemodestring): New decl.
792         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
793         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
794         (S_ISPORT, S_ISWHT): New macros, if not already defined.
795
796         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
797
798         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
799         fsusage.h now does that.  Include fsusage.h first, to test interface.
800         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
801         at most one method (the old code could have generated decls that
802         didn't conform to C89, not that this was ever exercised).
803         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
804
805         2006-03-19  Jim Meyering  <jim@meyering.net>
806
807         Work even in a chroot where d_ino values for entries in "/"
808         don't match the stat.st_ino values for the same names.
809         * getcwd.c (__getcwd): When no d_ino value matches the target inode
810         number, iterate through all entries again, using lstat instead.
811         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
812         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
813
814         * getcwd.c (__getcwd): Clarify a comment.
815         Use memcpy in place of a call to strcpy.
816
817         2006-03-12  Jim Meyering  <jim@meyering.net>
818
819         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
820         that of the current directory (which we're about to chdir ".." out of),
821         then save the dev-ino of the parent, instead.
822
823         * same-inode.h (SAME_INODE): New file/macro.
824         * chdir-safer.c (SAME_INODE): Remove definition.
825         Include "same-inode.h", instead.
826         * same.c: Likewise.
827         * cycle-check.h: Include "same-inode.h".
828         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
829         * cycle-check.c (SAME_INODE): Remove definition.
830         * root-dev-ino.h: Include "same-inode.h".
831
832         2006-03-11  Eric Blake  <ebb9@byu.net>
833
834         * same.c (same_name): s/base_name/last_component/
835         * backupfile.c (check_extension, numbered_backup): Likewise.
836         * filenamecat.c (file_name_concat): Likewise.
837
838         2006-03-11  Eric Blake  <ebb9@byu.net>,
839                     Paul Eggert  <eggert@cs.ucla.edu>
840
841         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
842         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
843         drive prefix.
844         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
845         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
846         (last_component): New method.
847         * dirname.c (dir_len): Determine when drive letters need a
848         subsequent slash.  Preserve // when it is special.
849         (dir_name): Don't append dot when drive letter is absolute.
850         [TEST_DIRNAME]: Move into a full-blown gnulib test.
851         * basename.c (base_name): New semantics - malloc the result.
852         Preserve // when it is special.  Preserve relative files that look
853         like drive letters.
854         (base_len): Preserve // when it is special.
855         (last_component): New method, similar to old base_name semantics.
856         * stripslash.c (strip_trailing_slashes): Use last_component, not
857         base_name.  Strip redundant slashes from ///.
858
859 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
860
861         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
862         both are 64 bits, since this seems to be the tradition, and this
863         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
864         we ever run into a host that prefers long long to long in this
865         case, we'll need another configure-time test.  Problem reported by
866         Jim Meyering.
867
868 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
869
870         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
871         possible collision with system files.
872         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
873         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
874         WCHAR_MIN and WCHAR_MAX in this case.
875         (<stddef.h>): Do not include; no longer needed.
876         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
877         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
878         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
879         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
880         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
881         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
882         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
883         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
884         !defined(__c99))]: Include in this case too, since it's harmless
885         now.
886         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
887         dangerous to do so.
888         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
889         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
890         (_STDINT_MIN, _STDINT_MAX): New macros.
891         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
892         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
893         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
894         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
895         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
896         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
897         macros, not typedefs; this simplifies things quite a bit.
898         Use long int for all types narrower than int64_t.
899         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
900         Define in terms of long long int or int64_t or long int,
901         not int64_t or int32_t.  This saves some compile-time testing.
902         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
903         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
904         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
905         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
906         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
907         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
908         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
909         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
910         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
911         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
912         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
913         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
914         undef any previous version and define our own version, for
915         simplicity and consistency with the new macros for types.
916         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
917         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
918         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
919         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
920         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
921         @WINT_T_SUFFIX@ to keep things simple here.
922         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
923         Simplify by assuming typical 8/16/32/64 host, since we're
924         already doing that elsewhere anyway.
925         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
926         and assume long long int is 64 bits if available.  This
927         speeds up 'configure'.
928
929 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
930
931         * getaddrinfo.c: fixed typo
932
933 2006-06-29  Eric Blake  <ebb9@byu.net>
934
935         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
936         unused static function.
937
938 2006-06-29  Eric Blake  <ebb9@byu.net>
939
940         * stat_.h: New file.
941
942 2006-06-29  Derek R. Price  <derek@ximbiot.com>
943
944         * strftime.c: Assume strftime() exists.
945
946 2006-06-28  Bruno Haible  <bruno@clisp.org>
947
948         * getaddrinfo.h: Fix POSIX URL.
949         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
950         (use_win32_p): Make static.
951         (getaddrinfo): Reject service name if it is empty or does not consist
952         solely of decimal digits, or if its value is > 65535.
953         (getnameinfo): Remove useless casts.
954
955 2006-06-28  Derek R. Price  <derek@ximbiot.com>
956
957         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
958         Autoconf 2.60 says this stuff was obsolete.
959
960 2006-05-12  Bruno Haible  <bruno@clisp.org>
961
962         * mkdtemp.c [MINGW]: Include <io.h>.
963         (mkdir): Define using _mkdir.
964
965 2006-06-28  Bruno Haible  <bruno@clisp.org>
966
967         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
968         declaration for wcwidth.
969         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
970
971 2006-06-28  Eric Blake  <ebb9@byu.net>
972
973         * xvasprintf.h: Fix comments.
974
975 2006-06-28  Eric Blake  <ebb9@byu.net>
976
977         * mbchar.h (wcwidth): Include wcwidth.h.
978         * mbswidth.c (wcwidth): Move from here...
979         * wcwidth.h: ...to this new file.
980
981 2006-06-28  Simon Josefsson  <jas@extundo.com>
982
983         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
984         functions there.  It will succeed on Windows XP, but on Windows
985         2000 and (presumably) earlier, it will fail, and use the internal
986         re-implementation.
987         (use_win32_p): New function.
988         (getaddrinfo): Use strtoul on servname, to support numeric ports.
989         Support AI_NUMERICSERV to disable getservbyname.
990         (getnameinfo): New function, only supports
991         NI_NUMERICHOST|NI_NUMERICSERV for now.
992
993         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
994         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
995         getnameinfo.
996
997 2006-06-27  Bruno Haible  <bruno@clisp.org>
998
999         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1000
1001 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1002
1003         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1004         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
1005         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1006
1007 2006-06-26  Bruno Haible  <bruno@clisp.org>
1008
1009         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1010         WCHAR_MAX.
1011         Reported by Mark D. Baushke and Larry Jones.
1012
1013 2006-06-26  Bruno Haible  <bruno@clisp.org>
1014
1015         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1016         in pre-C99 mode.
1017         Suggested by Mark D. Baushke and Larry Jones.
1018
1019 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
1020
1021         * stdint_.h: Treat BSD/OS like OpenBSD.
1022
1023 2006-06-23  Bruno Haible  <bruno@clisp.org>
1024
1025         * stdint_.h: Treat IRIX like OpenBSD.
1026
1027 2006-06-23  Bruno Haible  <bruno@clisp.org>
1028
1029         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1030         ISO C 99 Technical Corrigendum 1.
1031
1032 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1033
1034         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1035         Some compiler complained about some of them.  Problem reported by
1036         Larry Jones in
1037         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1038
1039 2006-06-21  Simon Josefsson  <jas@extundo.com>
1040
1041         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1042         variable.
1043
1044         * socket_.h: Don't define WINVER.
1045
1046         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1047         slightly modified to work in gnulib.
1048
1049 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1050
1051         * read-file.c (fread_file): Start with buffer allocation of
1052         0 bytes rather than 1 byte; this simplifies the code.
1053         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1054         code to free buffer and save/restore errno.
1055         (internal_read_file): Remove unused local.
1056
1057 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1058
1059         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1060         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1061         Problem reported by Denis Excoffier in
1062         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1063
1064 2006-06-19  Simon Josefsson  <jas@extundo.com>
1065
1066         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1067
1068 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1069
1070         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1071
1072 2006-06-17  Bruno Haible  <bruno@clisp.org>
1073
1074         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1075
1076 2006-06-17  Bruno Haible  <bruno@clisp.org>
1077
1078         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1079         problem on Solaris 2.5.1.
1080
1081 2006-06-16  Eric Blake  <ebb9@byu.net>
1082
1083         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1084         * unicodeio.c [!defined errno]: Likewise.
1085         * strtol.c [!defined errno]: Likewise.
1086         * strtod.c [!defined errno]: Likewise.
1087
1088 2006-06-15  Bruno Haible  <bruno@clisp.org>
1089
1090         * stdint_.h: Rewritten to be fully auto-configured.
1091         Fixes bug on HP-UX/IA64.
1092
1093 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1094
1095         * getdate.y (__attribute__): Don't define if already defined.
1096         Problem reported by Larry Jones.
1097         * utimens.c (__attribute__): Likewise.
1098
1099 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1100
1101         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1102         reported by Andreas Schwab.
1103
1104 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1105             Bruno Haible  <bruno@clisp.org>
1106
1107         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1108
1109 2006-05-26  Martin Lambers  <marlam@marlam.de>
1110
1111         * getpass.c: Updates the test for the native W32 API, and adds
1112         missing includes, thus fixing compilation warnings.
1113
1114 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1115
1116         * tempname.c (small_open, large_open): New macros.
1117         (__open, __open64) [!_LIBC]: Remove.
1118         (__gen_tempname): Use small_open and large_open instead of __open
1119         and __open64.  This fixes a portability bug on HP-UX 11.11i
1120         reported by Simon Wing-Tang in
1121         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1122
1123 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1124
1125         * exclude.c (exclude_fnmatch): New function.
1126         (excluded_file_name): Call exclude_fnmatch.
1127         * exclude.h (excluded_file_name): New prototype
1128
1129 2006-05-24  Bruno Haible  <bruno@clisp.org>
1130
1131         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1132         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1133         Reported by Thorsten Maerz <torte@netztorte.de> via
1134         Aaron Stone <aaron@serendipity.cx>.
1135
1136 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1137
1138         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1139         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1140         (my_usleep): Don't mishandle maximum value.
1141
1142 2006-05-19  Jim Meyering  <jim@meyering.net>
1143
1144         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1145
1146 2006-05-17  Bruno Haible  <bruno@clisp.org>
1147
1148         Cygwin portability.
1149         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1150
1151 2006-05-17  Bruno Haible  <bruno@clisp.org>
1152
1153         * stdint_.h: Fix recognition of Cygwin.
1154
1155 2006-05-11  Jim Meyering  <jim@meyering.net>
1156
1157         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1158
1159 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1160
1161         * crc.c (crc32_update): Remove unnecessary L suffix.
1162         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1163         unwanted sign propagation, e.g., on hosts with 64-bit int.
1164         There still are some problems with reeelly weird theoretical hosts
1165         (e.g., 33-bit int) but it's not worth worrying about now.
1166         * sha1.c (rol): Likewise.
1167         (K1, K2, K3, K4): Remove unnecessary L suffix.
1168
1169 2006-05-10  Bruno Haible  <bruno@clisp.org>
1170
1171         * des.c: Cast to avoid warnings.
1172
1173 2006-05-10  Simon Josefsson  <jas@extundo.com>
1174
1175         * md4.c: Typo fix, update copyright years.
1176         (K1, K2): Don't use L because it turn computations into 64-bit on
1177         64-bit platforms.
1178
1179 2006-05-09  Bruno Haible  <bruno@clisp.org>
1180
1181         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1182         (EOVERFLOW): Define fallback value.
1183         (xstrcat): New function.
1184         (xvasprintf): Recognize the special case of a string concatenation.
1185
1186 2006-05-01  Bruno Haible  <bruno@clisp.org>
1187
1188         * stdint_.h: Shorter URL.
1189         * inttypes.h: Likewise.
1190
1191 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1192
1193         * verify.h: Document the internals better.  Most of this change
1194         was written by Bruno Haible.
1195
1196 2006-04-29  Bruno Haible  <bruno@clisp.org>
1197
1198         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1199         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1200
1201 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1202
1203         * getdate.y (get_date): When adding relative date, start with the
1204         initial time, not with the result of the first mktime call.
1205
1206 2006-04-23  Bruno Haible  <bruno@clisp.org>
1207
1208         * copy-file.c: Include <unistd.h> unconditionally.
1209         * execute.c: Likewise.
1210         * fatal-signal.c: Likewise.
1211         * findprog.c: Likewise.
1212         * mkdtemp.c: Likewise.
1213         * pipe.h: Likewise.
1214         * pipe.c: Likewise.
1215         * wait-process.h: Likewise.
1216
1217 2006-04-23  Bruno Haible  <bruno@clisp.org>
1218
1219         * fwriteerror.c (fwriteerror): Call fclose also when an error
1220         condition was already detected.
1221         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1222
1223 2006-04-19  Derek Price  <derek@ximbiot.com>
1224             Eric Blake  <ebb9@byu.net>
1225
1226         * inttypes.h: Correct grammar in comment.
1227
1228 2006-04-18  Derek Price  <derek@ximbiot.com>
1229             Paul Eggert  <eggert@cs.ucla.edu>
1230
1231         * inttypes.h: New file.
1232         * strtoimax.c: Assume <inttypes.h>.
1233
1234 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1235
1236         * utimens.c (futimens): glibc futimesat messes up if /proc
1237         isn't mounted.  Problem reported by Kir Kolyshkin.
1238
1239 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1240
1241         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1242         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1243         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1244
1245 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1246
1247         Merge regex changes from libc, removing some of our
1248         POSIX-conformance changes that were rejected and redoing them in a
1249         less-intrusive way.
1250
1251         * regcomp.c (re_compile_internal, init_dfa):
1252         Length arg is now size_t, not Idx.  All uses changed.
1253         (peek_token): Forward decl now says internal_function.
1254         (__re_error_msgid, __re_error_msgid_idx):
1255         Now static rather than extern with attribute_hidden.
1256         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1257         For some reason libc prefers K&R style defns for external functions.
1258         (regerror) [!defined _LIBC]: Likewise.
1259         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1260         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1261         (build_range_exp, build_collating_symbol):
1262         Use K&R-style defn.
1263         (re_compile_fastmap): Use '\0' to memset, not 0.
1264         (utf8_sb_map): Make the calculations more obvious.
1265         (init_dfa, parse_bracket_exp, build_charclass_op):
1266         Call calloc and cast result, as glibc does.
1267         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1268         (build_range_exp, build_collating_symbol):
1269         Now internal functions.
1270
1271         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1272
1273         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1274         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1275         Don't depend on VMS; depend on __VMS instead, for POSIX
1276         namespace cleanness.
1277         (regoff_t): Define to ssize_t, not long int.
1278
1279         Remove the REG_ macros named below.  Instead, make the old names
1280         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1281         __USE_GNU_REGEX.
1282         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1283         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1284         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1285         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1286         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1287         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1288         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1289         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1290         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1291         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1292         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1293         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1294         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1295         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1296         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1297         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1298         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1299         (REG_NREGS):
1300         Remove.  All uses replaced by the old RE_* names.
1301         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1302         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1303         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1304         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1305         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1306         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1307         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1308         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1309         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1310         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1311         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1312         Don't bother having these macros be independent of each others'
1313         values, since they no longer exist in the POSIX name space.
1314
1315         Rename the following member names back to their old names,
1316         unless !__USE_GNU_REGEX.  All uses changed back.
1317         (buffer): Renamed from re_buffer.
1318         (allocated): Renamed from re_allocated.
1319         (used): Renamed from re_used.
1320         (syntax): Renamed from re_syntax.
1321         (fastmap): Renamed from re_fastmap.
1322         (translate): Renamed from re_translate.
1323         (can_be_null): Renamed from re_can_be_null.
1324         (regs_allocated): Renamed from re_regs_allocated.
1325         (fastmap_accurate): Renamed from re_fastmap_accurate.
1326         (no_sub): Renamed from re_no_sub.
1327         (not_bol): Renamed from re_not_bol.
1328         (not_eol): Renamed from re_not_eol.
1329         (newline_anchor): Renamed from re_newline_anchor.
1330         (num_regs): Renamed from rm_num_regs.
1331         (start): Renamed from rm_start.
1332         (end): Renamed from rm_end.
1333
1334         (free_state): Move up a bit.
1335
1336         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1337         #define to be empty.
1338         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1339         when that is what is intended.
1340         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1341         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1342         (MAX): New macro.
1343         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1344         All uses changed back to re_malloc, etc.  It's now the caller's
1345         responsibility to check for overflow; all callers changed.
1346         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1347         (re_x2nrealloc): Remove.
1348         (free_state): Remove decl.
1349
1350         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1351         (re_set_registers, re_exec):
1352         Use K&R-style defn.
1353
1354         2006-01-31  Roland McGrath  <roland@redhat.com>
1355
1356         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1357         Reported by Mike Frysinger <vapier@gentoo.org>.
1358
1359         2006-01-15  Andreas Jaeger  <aj@suse.de>
1360
1361         [BZ #1950]
1362         * regex_internal.c (re_string_reconstruct): Adjust for
1363         build_wcs_upper_buffer change.
1364         (build_wcs_upper_buffer): Change return type.
1365
1366         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1367
1368         * regex_internal.h: Include <stdint.h> if available.
1369
1370         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1371
1372         * regex_internal.h (SIZE_MAX): Provide a default definition.
1373
1374         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1375
1376         * regcomp.c: Adjust for changed secondary hash function.
1377
1378         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1379
1380         * regex.h: Pretty printing.
1381         Clean up namespace a bit.
1382
1383         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1384
1385         * regexec.c (update_cur_sifted_state, check_arrival,
1386         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1387
1388         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1389                     Ulrich Drepper  <drepper@redhat.com>
1390
1391         [BZ #1302]
1392         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1393         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1394
1395         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1396
1397         [BZ #281]
1398         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1399         * regcomp.c: Remove unnecessary uses of
1400         unsigned RE_TRANSLATE_TYPE.
1401         * regex_internal.h: Likewise.
1402         * regex_internal.c: Likewise.
1403         * regexec.c: Likewise.
1404         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1405
1406         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1407
1408         * regexec.c (find_recover_state): Remove unnecessary
1409         initialization.
1410         (transit_state_bkref): Make DFA a const pointer.
1411         (get_subexp): Likewise.
1412         (check_arrival): Likewise.
1413         (update_cur_sifted_state): Likewise.
1414         (re_search_internal): Likewise.
1415         (prune_impossible_nodes): Likewise.
1416         (acquire_init_state_context): Likewise.
1417         (proceed_next_node): Likewise.
1418         (set_regs): Likewise.
1419         (free_fail_stack_return): Likewise.
1420         (check_arrival_expand_ecl): Mark DFA parameter as const.
1421         (check_arrival_expand_ecl_sub): Likewise.
1422         (check_subexp_limits): Likewise.
1423         (sub_epsilon_src_nodes):  Likewise.
1424         (add_epsilon_src_nodes):  Likewise.
1425         (merge_state_array): Likewise.
1426         (update_regs): Likewise.
1427         (build_trtable): Likewise.
1428         (sift_states_backward): Mark MCTX parameter as const.
1429         (build_sifted_states): Likewise.
1430         (update_cur_sifted_state): Likewise.
1431         (sift_states_mkref): Likewise.
1432         (check_arrival_expand_ecl): Mark eclosure as const.
1433         (check_dst_limits_calc_pos_1): Likewise.
1434         * regex_internal.h (re_match_context_t): Make dfa a const
1435         pointer.
1436
1437         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1438
1439         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1440         (transit_state_sb): Likewise.
1441         (transit_state_mb): Likewise.
1442         (sift_states_iter_mb): Likewise.
1443         (check_arrival_add_next_nodes): Likewise.
1444         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1445         [_LIBC] (re_search_2_stub): Use mempcpy.
1446
1447         * regex_internal.c (re_string_reconstruct): Avoid calling
1448         mbrtowc for very simple UTF-8 case.
1449
1450         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1451         a pointer-to-const.
1452         (re_acquire_state_context): Likewise.
1453         * regex_internal.h: Adjust prototypes.
1454
1455         * regex.c: Prevent using C++ compilers.
1456
1457         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1458         (re_acquire_state_context): Likewise.
1459
1460 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1461             Bruno Haible  <bruno@clisp.org>
1462
1463         * stdint_.h: On OpenBSD, don't redefine types already included in
1464         <sys/types.h> and <inttypes.h>.
1465
1466 2006-03-24  Eric Blake  <ebb9@byu.net>
1467
1468         * time_r.c (copy_string_result): Remove, as it is no longer used.
1469
1470 2006-03-24  Simon Josefsson  <jas@extundo.com>
1471
1472         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1473         including some doc fixes.
1474         (base64_encode_alloc): Fix +1 bug on allocation failures.
1475
1476 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1477
1478         * base64.c (base64_encode): Do not read past end of array with
1479         unsanitized input on systems with CHAR_BIT > 8.
1480
1481 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1482
1483         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1484         Typedef to long int, not to off_, as POSIX will likely change
1485         in that direction.
1486
1487 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1488
1489         * argp-help.c (validate_uparams): Fix typo
1490         * argp-parse.c (argp_default_options): Consistently begin help
1491         messages with a lowercase letter.
1492
1493 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1494
1495         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1496         overrun buffers and shouldn't be used (much as gets shouldn't be
1497         used).
1498         * time_r.c (asctime_r, ctime_r): Likewise.
1499
1500 2006-03-08  Simon Josefsson  <jas@extundo.com>
1501
1502         * gc-gnulib.c (randomize): Don't open files called 'no', they
1503         signal that configure disabled the device.
1504
1505 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1506
1507         * c-stack.c: Include unistd.h unconditionally, since we now assume
1508         the unistd module.
1509         * getlogin_r.c: Likewise.
1510         * getlogin_r.h: Likewise.
1511         * glob.c: Likewise.
1512         * pagealign_alloc.c: Likewise.
1513         * unistd_.h: Remove; no longer needed.
1514
1515 2006-03-07  Simon Josefsson  <jas@extundo.com>
1516
1517         * unistd_.h: New file.
1518
1519 2006-03-07  Simon Josefsson  <jas@extundo.com>
1520
1521         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1522
1523 2006-03-01  Simon Josefsson  <jas@extundo.com>
1524
1525         * readline.c: Fix typo, tiny patch from Stepan Kasal
1526         <kasal@ucw.cz>.
1527
1528 2006-02-28  Simon Josefsson  <jas@extundo.com>
1529
1530         * getopt.c: Protect #include of unistd.h, for MSVS.
1531
1532 2006-02-27  Simon Josefsson  <jas@extundo.com>
1533
1534         * base64.h: Indent #define's.  From Jim Meyering
1535         <jim@meyering.net>.
1536
1537 2006-02-27  Jim Meyering  <jim@meyering.net>
1538
1539         Revert the change of 2006-02-24, so these files can continue
1540         to be sync'd from gettext.
1541         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1542         of `config.h'.
1543
1544 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1545
1546         * glob.c: Say "invalid" rather than "illegal" in comments.
1547
1548 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1549
1550         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1551
1552 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1553
1554         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1555         AT_FDCWD exceeds INT_MAX.
1556         * openat.h (AT_FDCWD): Likewise.
1557
1558 2006-02-14  Jim Meyering  <jim@meyering.net>
1559
1560         Sync from coreutils.
1561
1562         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1563         failure on deficient systems, and simplify gnulib lgpl dependencies.
1564         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1565         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1566
1567         * xalloc-die.c: Remove unused definition of N_.
1568
1569 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1570
1571         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1572
1573 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1574
1575         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1576         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1577
1578 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1579
1580         * argp-namefrob.h: Restore changes accidentally lost during the
1581         "autoupdate" on 2005-12-12.
1582
1583 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1584
1585         * fnmatch.c (L_): Renamed from L, to work around a bug in
1586         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1587         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1588         All uses changed.
1589
1590 2006-01-26  Simon Josefsson  <jas@extundo.com>
1591
1592         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1593         prototype is visible on mingw32.
1594
1595         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1596         for mingw32.
1597
1598         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1599         mingw32).
1600
1601 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1602
1603         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1604         attempt to open for write; this always fails, at least on POSIX
1605         hosts.  This reinstates the 2006-01-09 change, which was
1606         inadvertently removed.
1607
1608 2006-01-26  Bruno Haible  <bruno@clisp.org>
1609             Paul Eggert  <eggert@cs.ucla.edu>
1610
1611         * stdbool_.h (_Bool)
1612         [(! (defined __cplusplus || defined __BEOS__)
1613           && !defined __GNUC__
1614           && !(defined __HP_cc || defined __xlc__
1615                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1616                || defined __sgi))]:
1617         #define to signed char in these cases too; this simplifies
1618         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1619         etc., separately) and makes it more conservative.
1620
1621 2006-01-21  Jim Meyering  <jim@meyering.net>
1622
1623         Sync from the stable (b5) branch of coreutils:
1624
1625         * fts.c (fts_children): Don't let close() clobber errno from
1626         failed fchdir().
1627
1628         * fts.c (fts_stat): When following a symlink-to-directory,
1629         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1630         a dangling symlink.  That can also happen at least for ELOOP.
1631         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1632         FYI, this bug predates the inclusion of fts.c in coreutils.
1633
1634         * fts.c (fts_open): Put new maxarglen declaration and uses
1635         in their own block, so pre-c99 compilers don't object.
1636
1637         Avoid the double-free (first in fts_read, second in fts_close) that
1638         would occur when an `active' directory is made inaccessible (e.g.,
1639         via chmod a-x) during a traversal.
1640         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1641         before returning.  Reproduce this failure by
1642         mkdir -p a/b; cd a; chmod a-x . b
1643         Reported by Stavros Passas.
1644
1645 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1646
1647         * argp-namefrob.h: Bugfix. Remove stray #
1648
1649 2006-01-25  Bruno Haible  <bruno@clisp.org>
1650
1651         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1652         warnings.
1653         Reported by Paul Eggert.
1654
1655 2006-01-25  Jim Meyering  <jim@meyering.net>
1656
1657         * fileblocks.c: Remove more useless parentheses.
1658         * readutmp.h: Likewise.
1659
1660 2006-01-24  Bruno Haible  <bruno@clisp.org>
1661
1662         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1663         has it.
1664         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1665         2005-11-26.
1666
1667         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1668         to avoid problems with the built-in _Bool type.
1669         Reported by Paul Eggert on 2005-11-26.
1670
1671 2006-01-24  Jim Meyering  <jim@meyering.net>
1672
1673         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1674
1675 2006-01-24  Simon Josefsson  <jas@extundo.com>
1676
1677         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1678         Bruno.
1679
1680 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1681
1682         Work around porting bugs reported by Dieter in
1683         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1684         * getopt.c (_NOPROTO): Remove; no longer needed.
1685         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1686         Include "getopt.h" first, to check interface.
1687         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1688         !HAVE_DECL_GETENV.
1689         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1690         (__strndup): Revert to K&R-style function dfns, the glibc style.
1691         * strnlen.c: Don't claim it's taken from glibc; it's not.
1692         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1693         Include strnlen.h first, to get prototype properly.
1694         (strnlen): Renamed from __strnlen.
1695         Remove weak alias.
1696
1697 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1698
1699         These changes imported from libc.
1700         * getopt.c: Use __fxprintf instead of inline stream orientation
1701         test and two separate function calls.
1702         * strndup.c (__strndup): Add libc_hidden_def.
1703
1704 2006-01-22  Bruno Haible  <bruno@clisp.org>
1705
1706         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1707         temporary buffer for sprintf, take into account the precision also
1708         for 'd', 'i', 'u', 'o', 'x', 'X'.
1709
1710 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1711
1712         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1713         to pacify gcc -Wswitch-default.
1714
1715 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1716
1717         * argp-help.c (usage_long_opt): Do not print DOC options.
1718         (__argp_base_name): Removed
1719         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1720         typo.
1721         (__argp_base_name): Provide macro definition or extern declaration
1722         depending on the configuration
1723
1724 2006-01-20  Simon Josefsson  <jas@extundo.com>
1725
1726         * inet_ntop.h: Unconditionally include sys/socket.h.
1727
1728 2006-01-19  Simon Josefsson  <jas@extundo.com>
1729
1730         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1731
1732 2006-01-12  Simon Josefsson  <jas@extundo.com>
1733
1734         * base64.c: Fix warning, reported by Bruno Haible
1735         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1736
1737 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1738
1739         Sync from coreutils.
1740         * md5.c: Fix commentary typos.
1741         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1742         * md5.h (__attribute__): Remove; unused.
1743         * sha1.c: Fix commentary to match md5 better.
1744         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1745         so that we don't need to worry about alignment.  All uses changed.
1746         This merges the 2005-10-28 md5 change into sha1.
1747
1748 2006-01-11  Jim Meyering  <jim@meyering.net>
1749
1750         Sync from coreutils.
1751         * md5.c (OP): Fix spacing.
1752
1753 2006-01-11  Simon Josefsson  <jas@extundo.com>
1754
1755         * stdint_.h (SIZE_MAX): Add missing (.
1756
1757 2006-01-10  Bruno Haible  <bruno@clisp.org>
1758
1759         * argp.h (__const): Remove macro. Use const instead.
1760         * argp-fmtstream.h (__const): Likewise.
1761         * glob_.h (__const): Remove macro.
1762         * glob-libc.h: Use const instead of __const.
1763
1764 2006-01-10  Jim Meyering  <jim@meyering.net>
1765
1766         Avoid the double-free (first in fts_read, second in fts_close) that
1767         would occur when an `active' directory is made inaccessible (e.g.,
1768         via chmod a-x) during a traversal.
1769         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1770         before returning.  Reproduce this failure by
1771         mkdir -p a/b; cd a; chmod a-x . b
1772         Reported by Stavros Passas.
1773
1774         Sync from coreutils.
1775         * sha1.c: Tweak grammar in a comment.
1776
1777 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1778
1779         * regex_internal.h (BITSET_WORD_BITS):
1780         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1781         preprocessor mishandles large unsigned values as if they were signed.
1782         Problem reported by Claudio Fontana in
1783         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1784
1785 2006-01-10  Simon Josefsson  <jas@extundo.com>
1786
1787         * socket_.h: New file.
1788
1789 2006-01-10  Bruno Haible  <bruno@clisp.org>
1790
1791         * localcharset.c: Update from GNU gettext.
1792
1793 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1794
1795         Sync from coreutils.
1796         * chdir-long.c (cdb_free): Don't bother trying to open directory
1797         for write access: POSIX says that must fail.
1798         * fts.c (diropen): Likewise.
1799         * save-cwd.c (save_cwd): Likewise.
1800         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1801         well, for minor improvements on hosts that lack O_DIRECTORY.
1802         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1803         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1804         Fall back on chown if open failed with EACCES.
1805
1806         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1807         Report an error at compile-time if only a 1-second nominal clock
1808         resolution is found.
1809
1810         * lchmod.h: New file.
1811         * mkdir-p.c: Include lchmod.h, lchown.h.
1812         (make_dir_parents): Use lchown rather than chown, and
1813         lchmod rather than chmod.
1814
1815         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1816         too.  Problem with "none" reported by Bob Proulx.  Problem with
1817         "proc" reported by n0dalus.
1818
1819         * mountlist.c: Include <limits.h>.
1820         (dev_from_mount_options)
1821         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1822         New function.  It no longer assumes "dev=" has the System V meaning
1823         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1824         (read_file_system_list)
1825         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1826         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1827         dev= in that case.
1828
1829         * posixtm.h (PDS_PRE_2000): New macro.
1830         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1831         All usages changed.  Reject dates outside the range 1969-1999 if
1832         PDS_PRE_2000 is used.
1833
1834 2006-01-09  Jim Meyering  <jim@meyering.net>
1835
1836         Sync from coreutils.
1837
1838         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1839
1840         * chdir-safer.h, chdir-safer.c: New files.
1841
1842         * modechange.c (mode_compile): Reject an invalid mode string
1843         that starts with an octal digit.  From Andreas Gruenbacher.
1844
1845         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1846         and dup to open_safer and dup_safer, respectively.
1847         (openat_permissive): Fix typo in comment.
1848
1849         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1850         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1851         (_): Remove; no longer needed.
1852         (openat): Renamed from rpl_openat; no need for rpl_openat
1853         since openat.h renames openat for us.
1854         Replace most of the body with a call to openat_permissive,
1855         to avoid duplicate code.
1856         Port to (probably hypothetical) environments were mode_t is
1857         wider than int.
1858         (openat_permissive): Require mode arg, so that we can check
1859         types better.  Put it just after flags.  Change cwd failure
1860         indicator from pointer-to-bool to pointer-to-errno-value.
1861         All callers changed.
1862         Invoke openat_save_fail and/or openat_restore_fail if
1863         cwd_errno is null, so that openat can call us.
1864         (openat_permissive, fdopendir, fstatat, unlinkat):
1865         Simplify errno handling to avoid some duplicate code,
1866         as it's OK to set errno on success.
1867         * openat.h: Revamp code so that function macros depend on
1868         __OPENAT_PREFIX only, not also on AT_FDCWD.
1869         (openat_ro): Remove.  Caller changed to use openat_permissive.
1870         (openat_permissive): Now a macro, if not a function.
1871         (openat_restore_fail, openat_save_fail): Now always functions,
1872         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1873
1874         * openat-priv.h: New file, defining macros used by mkdirat.c
1875         and openat.c.
1876         * mkdirat.c: Include openat-priv.h.
1877         Remove definitions of macros defined therein.
1878         * openat.c: Likewise.
1879
1880         * mkdirat.c (mkdirat): New file and function.
1881         * openat.h (mkdirat): Declare.
1882
1883         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1884
1885         * openat.h (openat_permissive): Declare.
1886         (openat_ro): Define.
1887
1888         * openat.c (EXPECTED_ERRNO): New macro.
1889         (openat_permissive): New function -- used in remove.c rewrite.
1890         (all functions): Set errno just before returning, only if there
1891         was an actual failure.
1892         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1893
1894         Emulate openat-family functions using Linux's procfs, if possible.
1895         Idea and some code based on Ulrich Drepper's glibc changes.
1896
1897         * openat.c: (BUILD_PROC_NAME): New macro.
1898         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1899         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1900         before falling back on save_cwd and restore_cwd.
1901         (fdopendir, fstatat, unlinkat): Likewise.
1902
1903         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1904         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1905
1906         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1907         as second argument to va_arg.  Otherwise, some versions of gcc
1908         warn that `if this code is reached, the program will abort'.
1909
1910 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1911
1912         Sync from coreutils.
1913
1914         Add POSIX ACL support
1915         * acl.h (copy_acl, set_acl): Add declarations.
1916         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1917         systems other than Linux.
1918         (chmod_or_fchmod): New function: use fchmod when possible,
1919         and chmod otherwise.
1920         (file_has_acl): Add a POSIX ACL implementation, with a
1921         Linux-specific subcase.
1922         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1923         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1924         acls are unsupported.
1925         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1926         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1927         are unsupported.
1928
1929 2006-01-09  Bruno Haible  <bruno@clisp.org>
1930
1931         * sysexit_.h (EX_OK): New macro.
1932         Suggested by Martin Lambers <marlam@marlam.de>.
1933
1934 2006-01-09  Bruno Haible  <bruno@clisp.org>
1935
1936         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1937         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1938         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1939         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1940
1941 2006-01-09  Bruno Haible  <bruno@clisp.org>
1942
1943         * stdint_.h (SIZE_MAX): Write the value without involving negative
1944         numbers.
1945
1946 2005-10-16  Bruno Haible  <bruno@clisp.org>
1947
1948         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1949         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1950
1951 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1952
1953         * strftime.c (tzname): Don't declare if it is already #defined.
1954         Problem reported for Mingw by Mark Junker.
1955
1956 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1957
1958         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1959         long int, not int, for nanosecond counts, so that people who are
1960         used to POSIX struct timespec won't be surprised.  Reported by Jim
1961         Meyering.
1962
1963 2005-12-16  Jim Meyering  <jim@meyering.net>
1964
1965         * fprintftime.c, fprintftime.h: New files.
1966
1967 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1968
1969         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1970         * argp-help.c (fill_in_uparams): Check if the constructed
1971         struct uparams is valid. Fall back to the default values if it is
1972         not.
1973
1974 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1975
1976         * argp-help.c (__argp_base_name): New function
1977         (__argp_short_program_name): Rewrite using __argp_base_name
1978         * argp-namefrob.h: Define program_invocation_name and
1979         program_invocation_short_name if requested
1980         (__argp_base_name): Add prototype
1981         * argp-parse.c (argp_def): Use gettext wrappers
1982         (argp_default_parser): Use __argp_base_name
1983         * argp-pin.c: New file. Defines program_invocation_name and
1984         program_invocation_short_name on systems that lack them.
1985
1986 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1987
1988         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1989         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1990         porting problem reported by Georg Schwarz in
1991         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1992
1993 2005-07-09  Bruno Haible  <bruno@clisp.org>
1994
1995         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1996         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1997         Reported by Mark Junker <mjscod@gmx.de>.
1998
1999 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2000
2001         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2002         (uintmax_t) [defined uintmax_t]: Do not declare.
2003         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2004         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2005         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
2006         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2007         sake of portability to weird hosts that C allows (though we don't
2008         know of any practical examples).
2009
2010         * savedir.h (fdsavedir): New decl.
2011         * savedir.c (fdsavedir, savedirstream): New functions; the latter
2012         contains most of the former guts of savedir.
2013         (savedir): Use savedirstream.
2014         Include "openat.h".
2015
2016 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2017
2018         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2019         coreutils no longer futzes with rounding modes.
2020
2021 2005-11-14  Jim Meyering  <jim@meyering.net>
2022
2023         * mkstemp-safer.c: Include <config.h>, required for possible
2024         replacement of mkstemp.
2025
2026 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2027
2028         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2029         business.
2030         (gethrxtime) [! (HAVE_NANOUPTIME
2031         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2032         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2033         our own approximation.
2034
2035 2005-11-10  Simon Josefsson  <jas@extundo.com>
2036
2037         * readline.c: Remove EOL.
2038
2039 2005-11-08  Eric Blake  <ebb9@byu.net>
2040
2041         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2042
2043 2005-11-08  Eric Blake  <ebb9@byu.net>
2044
2045         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2046
2047 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2048
2049         Fix porting problem reported by Theodoros V. Kalamatianos.
2050         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2051         Don't assume that futimes failing means we must fail.
2052
2053 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2054
2055         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2056         leave errno alone.  Problem reported by Dmitry V. Levin.
2057
2058 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2059
2060         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2061         errno alone.  Problem reported by Frederic Jolliton.
2062
2063 2005-10-28  Simon Josefsson  <jas@extundo.com>
2064
2065         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2066         "restrict" keywords, as per POSIX.  Protect the function
2067         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2068         Don't use K&R prototypes.  Check the sprintf return values.
2069         Re-define EAFNOSUPPORT if not present.  Indent.
2070
2071         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2072         suggested by Bruno Haible <bruno@clisp.org>.
2073
2074         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2075
2076         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2077
2078         * gc-libgcrypt.c: Add MD2 (which is not available through
2079         libgcrypt).
2080
2081         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2082
2083         * md2.h, md2.c: New files.
2084
2085 2005-10-24  Simon Josefsson  <jas@extundo.com>
2086
2087         * md4.h: Shrink buffer size, now that we changed the type.
2088
2089 2005-10-22  Simon Josefsson  <jas@extundo.com>
2090
2091         * arcfour.h, arcfour.c: Use fixed size indices in the
2092         arcfour_context struct (simplify test vector testing in GNU
2093         Shishi).
2094
2095 2005-10-22  Simon Josefsson  <jas@extundo.com>
2096
2097         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2098         suggested by Bruno Haible <bruno@clisp.org>.
2099
2100 2005-10-22  Simon Josefsson  <jas@extundo.com>
2101
2102         * crc.h: Include stddef.h, for size_t.
2103
2104 2005-10-21  Simon Josefsson  <jas@extundo.com>
2105
2106         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2107         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2108
2109 2005-10-21  Simon Josefsson  <jas@extundo.com>
2110
2111         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2112         block.
2113
2114 2005-10-21  Simon Josefsson  <jas@extundo.com>
2115
2116         * gc-gnulib.c: Support ARCTWO in CBC mode.
2117
2118 2005-10-21  Simon Josefsson  <jas@extundo.com>
2119
2120         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2121         <bruno@clisp.org>.
2122
2123         * hmac-sha1.c (hmac_sha1): Likewise.
2124
2125         * crc.c (crc32_update): Actually use crc parameter, suggested by
2126         Bruno Haible <bruno@clisp.org>.
2127
2128         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2129         <bruno@clisp.org>.
2130
2131 2005-10-21  Simon Josefsson  <jas@extundo.com>
2132
2133         * des.h, des.c: New files.
2134
2135         * gc-gnulib.c: Support DES.c
2136
2137 2005-10-21  Simon Josefsson  <jas@extundo.com>
2138
2139         * arctwo.h, arctwo.c: New files.
2140
2141         * gc-gnulib.c: Support ARCTWO.
2142
2143 2005-10-21  Simon Josefsson  <jas@extundo.com>
2144
2145         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2146
2147 2005-10-19  Simon Josefsson  <jas@extundo.com>
2148
2149         * gc-gnulib.c: Support ARCFOUR.
2150
2151 2005-10-19  Simon Josefsson  <jas@extundo.com>
2152
2153         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2154         support.
2155
2156         * gc.h: Add ECB enum type.
2157
2158         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2159
2160 2005-10-19  Simon Josefsson  <jas@extundo.com>
2161
2162         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2163
2164 2005-10-18  Simon Josefsson  <jas@extundo.com>
2165
2166         * md4.h, md4.c: New files, based on md5.?.
2167
2168 2005-10-17  Simon Josefsson  <jas@extundo.com>
2169
2170         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2171
2172         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2173
2174 2005-10-17  Simon Josefsson  <jas@extundo.com>
2175
2176         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2177
2178 2005-10-17  Simon Josefsson  <jas@extundo.com>
2179
2180         * gc.h, gc-libgcrypt.c: Add ciphers.
2181
2182 2005-10-17  Simon Josefsson  <jas@extundo.com>
2183
2184         * sha1.c: Use uint32_t instead of md5_uint32.t
2185
2186         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2187         md5.h.
2188
2189         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2190
2191         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2192
2193 2005-10-15  Simon Josefsson  <jas@extundo.com>
2194
2195         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2196
2197         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2198
2199 2005-10-14  Simon Josefsson  <jas@extundo.com>
2200
2201         * arcfour.h, arcfour.c: New files.
2202
2203 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2204
2205         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2206         include <wchar.h>; no longer needed.
2207
2208 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2209         and  Ulrich Drepper  <drepper@redhat.com>
2210
2211         Import from libc.
2212         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2213         instead of inline stream orientation test and two separate
2214         function calls.  Pay no attention to USE_IN_LIBIO.
2215
2216 2005-10-14  Roland McGrath  <roland@redhat.com>
2217
2218         Import from libc.  [BZ #1331]
2219         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2220         macro argument.
2221         Reported by Matej Vela <vela@debian.org>.
2222
2223 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2224
2225         * mkdir-p.c (make_dir_parents): Don't report an error if an
2226         intermediate directory is in a read-only file system.  Problem
2227         reported by Eric Blake.
2228
2229 2005-10-13  Simon Josefsson  <jas@extundo.com>
2230
2231         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2232         Move memory allocation outside of loop.
2233
2234 2005-10-12  Simon Josefsson  <jas@extundo.com>
2235
2236         * gc-pbkdf2-sha1.c: New file.
2237
2238         * gc.h: Add gc_pbkdf2_sha1 prototype.
2239
2240 2005-10-12  Simon Josefsson  <jas@extundo.com>
2241
2242         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2243         suggested by Bruno Haible <bruno@clisp.org>.
2244
2245 2005-10-12  Simon Josefsson  <jas@extundo.com>
2246
2247         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2248
2249         * gc-gnulib.c (gc_hmac_sha1): New function.
2250
2251 2005-10-12  Simon Josefsson  <jas@extundo.com>
2252
2253         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2254
2255 2005-10-12  Simon Josefsson  <jas@extundo.com>
2256
2257         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2258         GC_USE_HMAC_MD5, respectively.
2259
2260         * gc-libgcrypt.c (gc_md5): Fix assert call.
2261         (gc_md5): Fix typo.
2262
2263         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2264
2265         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2266
2267         * gc-gnulib.c (gc_hash_buffer): Ditto.
2268
2269 2005-10-11  Bruno Haible  <bruno@clisp.org>
2270
2271         * c-strcasestr.h: New file, from GNU gettext.
2272         * c-strcasestr.c: New file, from GNU gettext.
2273
2274 2005-10-11  Bruno Haible  <bruno@clisp.org>
2275
2276         * c-strcase.h: New file, from GNU gettext.
2277         * c-strcasecmp.c: New file, from GNU gettext.
2278         * c-strncasecmp.c: New file, from GNU gettext.
2279
2280 2005-10-11  Simon Josefsson  <jas@extundo.com>
2281
2282         * crc.h, crc.c: New files.
2283
2284         * gc.h (gc_hash_buffer): Add doc.
2285
2286 2005-10-08  Simon Josefsson  <jas@extundo.com>
2287
2288         * gc.h: Add gc_hash and gc_hash_buffer.
2289
2290         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2291
2292         * gc-libgcrypt.c (gc_hash_buffer): Add.
2293
2294 2005-10-11  Bruno Haible  <bruno@clisp.org>
2295
2296         * strcasecmp.c: Include limits.h.
2297         (strcasecmp): Avoid integer overflow on exotic platforms.
2298         * strncasecmp.c: Include limits.h.
2299         (strncasecmp): Avoid integer overflow on exotic platforms.
2300         Reported by Paul Eggert.
2301
2302 2005-10-06  Simon Josefsson  <jas@extundo.com>
2303
2304         * hmac-md5.c: New file.
2305
2306         * hmac.h: New file.
2307
2308 2005-10-06  Simon Josefsson  <jas@extundo.com>
2309
2310         * memxor.c (memxor): Avoid casts and warnings.
2311
2312 2005-10-05  Derek Price  <derek@ximbiot.com>
2313
2314         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2315
2316 2005-10-05  Simon Josefsson  <jas@extundo.com>
2317
2318         * memxor.c (memxor): Fix compiler error.
2319
2320         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2321         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2322
2323         * memxor.h, memxor.c: New files.
2324
2325         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2326         we assume all systems have it, suggested by Jim Meyering
2327         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2328         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2329         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2330         same reasons.
2331
2332 2005-10-04  Bruno Haible  <bruno@clisp.org>
2333
2334         * verify.h (verify_true): Provide alternative definition for C++.
2335
2336 2005-10-04  Simon Josefsson  <jas@extundo.com>
2337
2338         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2339         D. Baushke" <mdb@gnu.org>.
2340
2341 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2342
2343         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2344         (SSIZE_MAX): New macro, if not already defined.
2345         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2346         than 2 GiB.
2347
2348 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2349
2350         * exclude.c: Include verify.h.
2351         (verify): Remove.  All callers changed to use verify.h's version.
2352         * strtoimax.c: Likewise.
2353         * utimecmp.c: Likewis.e
2354
2355         Sync from coreutils.
2356         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2357         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2358         * .cvsignore: Add fts.h, search.h, t-fpending.
2359         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2360         bother returning ENOSYS if settimeofday or stime fails; just let
2361         them return whatever errno they want to return.
2362         * utimens.c: Include unistd.h, for dup2.
2363         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2364         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2365
2366 2005-10-02  Jim Meyering  <jim@meyering.net>
2367
2368         Sync from coreutils.
2369         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2370         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2371         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2372         Remove AT_FDCWD test.
2373         Do not consume the fd unless successful.
2374         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2375         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2376         block, so that we don't even try to compile it if settimeofday is
2377         available.  This works around a compilation failure on OSF1 V5.1,
2378         due to stime requiring a `long int*' while tv_sec is `int'.
2379
2380 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2381
2382         * getdelim.c (getdelim): Remove unused variables.
2383
2384 2005-10-01  Simon Josefsson  <jas@extundo.com>
2385
2386         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2387         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2388         AI_* and EAI_* definitions.  Protect function declarations.
2389
2390 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2391
2392         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2393         so that the code works even with ancient cpp.  Portability problem
2394         with GCC 2.7.2.1 reported by Thomas M.Ott.
2395
2396 2005-09-27  Jim Meyering  <jim@meyering.net>
2397
2398         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2399
2400         * intprops.h (signed_type_or_expr__): Define.
2401         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2402         for unsigned types.
2403
2404 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2405
2406         * verify.h (verify_expr): Remove, replacing with:
2407         (verify_true): New macro that returns true instead of void.
2408         (verify_type__): Remove.
2409         (verify): Use verify_true rather than verify_type__.
2410
2411 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2412
2413         * utimens.c (ENOSYS): Define if not already defined.
2414         (futimens): Support having a null PATH if the file descriptor
2415         is nonnegative.
2416
2417         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2418         Remove.
2419         (__attribute): Define to empty unless GCC 3.1 or later.
2420         This works around a core dump on OpenBSD 3.4, which has GCC
2421         2.95.3, which dumps core when given __attribute__(()).  It also
2422         simplifies other tests, since we really don't want to bother with
2423         worrying about which ancient version of GCC supported what.
2424         Original problem reported by Yoann Vandoorselaere, with part of
2425         the fix suggested by Derek Price.
2426
2427 2005-09-24  Jim Meyering  <jim@meyering.net>
2428
2429         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2430         so we can once again use a positive bitfield width of 1 -- now we
2431         don't have to explain why we were using a bitfield width of 2.
2432
2433 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2434
2435         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2436         Problem reported by Eric Blake.
2437         (getaddrinfo): Initialize se so that it's not garbage.
2438         Redo internal storage allocation so that it doesn't make unportable
2439         assumptions about alignment.
2440         Fix a memory leak.
2441
2442         * utimens.c (futimens): Use futimesat if available.
2443         Prefer it to futimes since it doesn't have the futimes bug.
2444
2445         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2446         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2447         Instead, declare a function that returns a pointer to an array,
2448         and use verify_type__ to declare the size of the array.
2449         Problem and germ of a solution reported by Bruno Haible.
2450         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2451         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2452
2453 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2454
2455         Sync from coreutils.
2456
2457         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2458         stat-time.h.
2459         * argmatch.h: Include verify.h
2460         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2461         (ARGMATCH_ASSERT): Remove; unused.
2462         * canonicalize.c: Assume STDC_HEADERS.
2463         * exclude.c: Include "strcase.h".
2464         * regex_internal.h [!defined _LIBC]: Likewise.
2465         * getusershell.c: Include stdio--.h rather than stdio.h
2466         and stdio-safer.h.
2467         (getusershell): Call fopen, not fopen_safer.
2468         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2469         Do not include unistd-safer.h.
2470         (save_cwd): Don't call fd_safer; no longer needed
2471         now that we include fcntl--.h.
2472
2473         * getdate.y (relative_time): New type.
2474         (RELATIVE_TIME_0): New constant.
2475         (parser_control): Use relative_time instead of doing it ourselves.
2476         (%union): Add new relative_time rel member.
2477         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2478         Now typeless.
2479         (relunit, relunit_snumber): Now of type rel.
2480         (zone, rel, relunit, get_date): Adjust to above changes.
2481
2482         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2483         Do not include unistd-safer.h.
2484         (getloadavg): Don't call fd_safer; no longer needed
2485         now that we include fcntl--.h.
2486
2487         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2488         (make_dir_parents): Treat ENOSYS like EEXIST.
2489
2490         Improve quality of diagnostics on restore_cwd failure.
2491         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2492         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2493         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2494         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2495         each time through the loop.  Do not diagnose restore_cwd failure;
2496         that is the caller's job (and perhaps the caller does not care).
2497
2498         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2499         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2500         If the file already exists but is not a directory, don't bother
2501         to try to make its parents.
2502         Close potential file descriptor leak if we can't chdir("/") (!).
2503         Don't always return true if chdir($PWD) fails; return true only
2504         if the requested action was done successfully (except for the
2505         chdir($PWD)).
2506         Don't log final directory unless we actually made it.
2507         Refactor to avoid duplicate code to fix up permissions.
2508         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2509
2510         * strftime.c (my_strftime): Rewrite the previous change slightly,
2511         to make it a bit faster and (I hope) clearer.
2512         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2513         Fix bug in formats like %2N.
2514
2515         * verify.h: New file.
2516
2517 2005-09-22  Jim Meyering  <jim@meyering.net>
2518
2519         Sync from coreutils.
2520
2521         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2522
2523         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2524         the .tm_year member, since otherwise gcc-4.0 would now warn about
2525         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2526
2527         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2528         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2529
2530         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2531         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2532         when run in a time zone for which daylight savings time is in effect
2533         for the starting date.
2534
2535         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2536         stop us from restricting permissions of just-created absolute-named
2537         directories.
2538         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2539         to restore initial working directory.
2540         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2541         to tell caller if/when we change the working directory and are
2542         unable to return to the initial one.
2543         * mkdir-p.h (make_dir_parents): Update prototype.
2544         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2545         `return false'.  This fixes a bug introduced on 2004-07-30.
2546
2547         * openat.c (fdopendir): Be sure to close the supplied
2548         file descriptor before returning.  This makes our replacement
2549         implementation a little closer to Solaris's, where fdopendir
2550         ties the file descriptor to the returned DIR* pointer.
2551         * openat.c (unlinkat): New function.
2552         * openat.h (unlinkat): Add prototype.
2553         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2554         (openat_restore_fail): Rename from openat_restore_die.
2555         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2556
2557         Provide an alternative to exiting immediately upon save_cwd or
2558         restore_cwd failure.  Now, an application can arrange e.g.,
2559         to perform a longjump in that case.
2560         * openat.c: Include dirname.h.
2561         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2562         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2563         and openat_restore_die rather than calling error directly.
2564         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2565
2566         * openat-die.c (openat_save_die, openat_restore_die): New file.
2567         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2568
2569         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2570         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2571                             int utc, int nanoseconds);
2572         Background:
2573         date should not have to allocate a megabyte of virtual memory to
2574         handle a format argument like +%1048575T.  When implemented with
2575         strftime, it must allocate such a buffer, use strftime to fill it
2576         in, print it, then free it.
2577         With fprintftime, it simply prints everything and exits.
2578         With no need for memory allocation, that's one fewer way to fail.
2579         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2580         optional field width, not before, so we accept %9:z, not %:9z.
2581         (my_strftime): Be sure to use L_('x') for literals.
2582
2583         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2584         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2585         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2586         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2587         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2588         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2589         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2590         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2591         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2592
2593         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2594         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2595         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2596         and don't include <sys/file.h>).
2597
2598 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2599
2600         Sync from coreutils.
2601
2602         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2603         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2604         [!LDAV_DONE]: Avoid unused variable warning.
2605
2606 2005-09-21  Bruno Haible  <bruno@clisp.org>
2607
2608         * unicodeio.h (unicode_to_mb): New declaration.
2609
2610 2005-09-20  Derek Price  <derek@ximbiot.com>
2611
2612         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2613
2614 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2615
2616         Use a consistent style for including <config.h>.
2617         * __fpending.c, acl.c, argmatch.c,
2618         argp-help.c, argp-parse.c,
2619         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2620         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2621         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2622         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2623         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2624         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2625         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2626         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2627         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2628         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2629         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2630         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2631         modechange.c, mountlist.c, open-safer.c, physmem.c,
2632         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2633         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2634         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2635         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2636         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2637         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2638         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2639         userspec.c, utimecmp.c, version-etc-fsf.c,
2640         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2641         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2642         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2643         Standardize inclusion of config.h.
2644         * __fpending.h, dirfd.h, getdate.h, human.h,
2645         inttostr.h:  Removed inclusion of config.h from header files.
2646         * inttostr.c:  Adjusted in-tree users.
2647         * timespec.h: Remove superfluous warning to include config.h.
2648         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2649         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2650         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2651         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2652
2653 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2654
2655         * stat-time.h: New file.
2656         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2657         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2658         in a different way.
2659         (timespec_cmp): New function.
2660         * utimecmp.c: Include stat-time.h.
2661         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2662         members exist, not on the obsolescent ST_MTIM_NSEC.
2663         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2664
2665 2005-09-15  Derek Price  <derek@ximbiot.com>
2666             Paul Eggert  <eggert@cs.ucla.edu>
2667
2668         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2669         changes, consolidating in...
2670         * regex_internal.h: ...this file.
2671
2672 2005-09-15  Derek Price  <derek@ximbiot.com>
2673
2674         * regex_internal.h: Blank `pure' for GNUC < 3.
2675         * regex_internal.c: Ditto, using this...
2676         (__GNUC_PREREQ): ...new macro.
2677         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2678         (__GNUC_PREREQ): ...this new macro.
2679
2680         * strstr.h: Include string.h. Define strstr as a macro here.
2681
2682 2005-09-13  Derek Price  <derek@ximbiot.com>
2683
2684         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2685         failure.
2686         Reported by Jim Meyering  <jim@meyering.net>.
2687
2688 2005-09-13  Jim Meyering  <jim@meyering.net>
2689
2690         * canon-host.c: Filter through gnu indent and reword comments slightly.
2691         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2692
2693 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2694
2695         * lib/base64.c: Typo.
2696         (base64_encode): Put b64str in initialized data section.
2697
2698 2005-09-12  Derek Price  <derek@ximbiot.com>
2699
2700         Return usable errors from canon-host.
2701         * canon-host.h: New file.
2702         * canon-host.c (canon_host): Wrap...
2703         (canon_host_r): ...this new function, which now relies exclusively on
2704         getaddrinfo.
2705         (ch_strerror): New function.
2706         (last_cherror): New global.
2707         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2708         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2709         void *.
2710         (freeaddrinfo): Free ai->ai_canonname when set.
2711
2712 2005-09-12  Derek Price  <derek@ximbiot.com>
2713             Paul Eggert  <eggert@cs.ucla.edu>
2714
2715         * glob-libc.h: Renamed from glob_.h.  The new version is
2716         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2717         protecting things that should be done only in gnulib contexts.
2718         * glob_.h: New file, containing only the glob things needed for
2719         gnulib.
2720         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2721         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2722         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2723         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2724         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2725         and to respect the namespace rules better.
2726
2727 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2728
2729         Merge glibc and coreutils changes into gnulib, plus a few
2730         extra fixes.
2731         * md5.c: Use #error rather than a string.
2732         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2733         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2734         (__attribute__): Define to empty for non recent-GCC.
2735         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2736         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2737         Renamed from their non-__ counterparts, with new macros replacing
2738         them if not _LIBC.  Add __THROW attribute.
2739         (rol): Remove.
2740         (struct md5_ctx): Align buffer if using GCC.
2741         * sha1.h (struct sha1_ctx): Likewise.
2742         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2743         The old name was backwards.
2744         (NOTSWAP): Remove; not used.
2745         (rol): New macro, moved here from md5.h.
2746         (sha1_process_block): Remove a FIXME that doesn't make sense.
2747
2748 2005-09-12  Derek Price  <derek@ximbiot.com>
2749
2750         * gai_strerror.c: Include config.h when available.  Include
2751         getaddrinfo.h before other headers to test interface.
2752         Reported by Larry Jones <lawrence.jones@ugs.com>.
2753
2754 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2755
2756         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2757         definitions, since that's the preferred style in glibc.
2758         Fix a minor spacing issue, and update copyright notice to match glibc's.
2759
2760 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2761
2762         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2763
2764 2005-09-06  Simon Josefsson  <jas@extundo.com>
2765
2766         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2767         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2768
2769 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2770
2771         Change bitset word type from unsigned int to unsigned long int,
2772         as this has better performance on typical 64-bit hosts.
2773         Port bitset code to hosts with unusual word sizes.
2774         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2775         (build_collating_symbol):
2776         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2777         argument is a bitset.  This is merely a style issue, but it makes
2778         it clearer that an entire array is expected.
2779         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2780         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2781         Port to the case where bitset_word is not the same as unsigned int.
2782         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2783         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2784         Likewise.
2785         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2786         (build_trtable, group_nodes_into_DFAstates):
2787         Likewise.
2788         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2789         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2790         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2791         * regexec.c (group_nodes_into_DFAstates): Likewise.
2792         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2793         * regcomp.c (optimize_subexps, lower_subexp):
2794         Work even if bitset_word has holes in its bitwise representation.
2795         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2796         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2797         Likewise.
2798         * regex_internal.c (re_string_reconstruct):
2799         Don't assume UCHAR_MAX == 255.
2800         * regex_internal.h (bitset_set_all): Likewise.
2801         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2802         All uses changed.
2803         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2804         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2805         All uses changed.
2806         (BITSET_WORD_MAX): New macro.
2807         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2808         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2809         (bitset_empty, bitset_copy):
2810         Prefer sizeof (bitset) to multiplying it out ourselves.
2811         (bitset_not_merge): Remove; unused.
2812         (bitset_contain): Return bool, not unsigned int with one bit on.
2813         All callers changed.
2814         * regexec.c (build_trtable): Don't assume bitset has no stricter
2815         alignment than re_node_set; do this by defining a new internal
2816         type struct dests_alloc and using it to allocate memory.
2817
2818 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2819
2820         Check for arithmetic overflow when calculating sizes, to prevent
2821         some buffer-overflow issues.  These patches are conservative, in the
2822         sense that when I couldn't determine whether an overflow was possible,
2823         I inserted a run-time check.
2824         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2825         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2826         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2827         (re_xnrealloc, re_x2nrealloc): New inline functions.
2828         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2829         (build_equiv_class, build_charclass): Check for arithmetic overflow
2830         in size expression calculations.
2831         * lib/regex_internal.c (re_string_realloc_buffers):
2832         (build_wcs_upper_buffer, re_node_set_add_intersect):
2833         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2834         (re_dfa_add_node, register_state): Likewise.
2835         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2836         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2837         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2838         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2839
2840 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2841
2842         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2843         to avoid a collision with bits/local_lim.h in glibc.
2844         All uses changed.  Problem reported by Dmitry V. Levin in
2845         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2846
2847         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2848         bugs in int versus size_t comparisons.
2849         (re_string_context_at): Fix bug where the code assumed that
2850         Idx is signed.
2851
2852         Use bool where appropriate.
2853         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2854         All callers changed.
2855         (calc_eclosure_iter): Likewise, for ROOT arg.
2856         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2857         (build_charclass_op): Likewise, for NON_MATCH arg.
2858         * regex_internal.c (re_string_allocate, re_string_construct):
2859         (re_string_construct_common): Likewise, for ICASE arg.
2860         * regexec.c (re_search_2_stub, re_search_stub):
2861         Likewise, for RET_LEN arg.
2862         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2863         (set_regs): Likewise, for FL_BACKTRACK arg.
2864         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2865         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2866         (calc_eclosure_iter, parse_bracket_exp):
2867         Use bool for internal variables that are booleans.
2868         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2869         (set_regs, build_sifted_states, sift_states_bkref):
2870         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2871         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2872         (find_collation_sequence_value):
2873         Likewise.
2874         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2875         (re_node_set_compare):
2876         Return bool, not int. All callers changed.
2877         * regexec.c (check_halt_node_context, check_dst_limits):
2878         (build_trtable, check_node_accept): Likewise.
2879         * regex_internal.h: Include stdbool.h.
2880
2881         Fix bugs uncovered when converting to bool.
2882         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2883         failure instead of charging ahead blindly.
2884         * regex_internal.c (register_state): Likewise.
2885         * regexec.c (re_search_2_stub): Use simpler method than boolean
2886         for freeing internal storage.
2887         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2888         bitset pieces used as boolean, to avoid undefined behavior
2889         on hosts that do int overflow checking.
2890
2891 2005-08-31  Derek Price  <derek@ximbiot.com>
2892
2893         * getdelim.c (getdelim): Return EOF on EOF.
2894         Reported by Larry Jones <lawrence.jones@ugs.com>.
2895
2896 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2897
2898         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2899         lengths fit in regoff_t; this isn't true if regoff_t is the same
2900         width as size_t.
2901         * regex.c (re_search_internal): 5th arg is LAST_START
2902         (= START + RANGE) instead of RANGE.  This avoids overflow
2903         problems when regoff_t is the same width as size_t.
2904         All callers changed.
2905         (re_search_2_stub): Check for overflow when adding the
2906         sizes of the two strings.
2907         (re_search_stub): Check for overflow when adding START
2908         to RANGE; if it occurs, substitute the extreme value.
2909
2910 2005-08-31  Jim Meyering  <jim@meyering.net>
2911
2912         * regcomp.c (search_duplicated_node): Make first pointer arg
2913         a pointer-to-const.
2914         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2915         (register_state): Likewise.
2916         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2917         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2918         (group_nodes_into_DFAstates): Likewise.
2919
2920 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2921
2922         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2923         old glibc regex code mishandles strings longer than 2**31 bytes.
2924         This patch fixes this when the regex code is used in gnulib
2925         (i.e., outside glibc).
2926
2927         This patch should not affect the use of the regex code inside
2928         glibc.  No doubt this problem also needs to be handled for glibc
2929         as well, but the result will be an incompatible change to the
2930         glibc ABI, and the old ABI will have to be supported too.  That
2931         can be the the subject for another patch.
2932
2933         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2934         governing whether the rest of this patch is active.  By default,
2935         the macro is disabled and the patch has no effect.
2936         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2937         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2938         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2939         (re_match_2, re_set_registers): Use the new types.
2940         * regex_internal.h (Idx, re_hashval_t): New types.
2941         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2942         New macros.
2943         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2944         (re_string_context_at, bin_tree_t, re_dfastate_t):
2945         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2946         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2947         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2948         (re_string_char_size_at, re_string_wchar_at):
2949         (re_string_elem_size_at):
2950         Use the new types and macros to port to 64-bit hosts.
2951         Use unsigned types for internal values, so that the code
2952         mostly works even for arrays larger than SSIZE_MAX.
2953         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2954         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2955         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2956         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2957         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2958         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2959         (calc_inveclosure, parse_dup_op, build_range_exp):
2960         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2961         (fetch_number, create_token_tree, mark_opt_subexp):
2962         Likewise.
2963         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2964         (create_cd_newstate, re_string_allocate, re_string_construct):
2965         (re_string_realloc_buffers, build_wcs_upper_buffer):
2966         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2967         (re_string_reconstruct, re_string_peek_byte_case):
2968         (re_string_fetch_byte_case, re_string_context_at):
2969         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2970         (re_node_set_init_copy, re_node_set_add_intersect):
2971         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2972         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2973         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2974         (re_acquire_state, re_acquire_state_context, register_state):
2975         Likewise.
2976         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2977         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2978         (re_search_internal, re_search_2_stub, re_search_stub)
2979         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2980         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2981         (update_cur_sifted_state, check_dst_limits):
2982         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2983         (check_subexp_limits, sift_states_bkref, merge_state_array):
2984         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2985         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2986         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2987         (expand_bkref_cache, check_node_accept_bytes):
2988         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2989         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2990         (acquire_init_state_context, check_halt_node_context):
2991         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2992         (sift_states_backward, clean_state_log_if_needed):
2993         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2994         (find_recover_state, transit_state_sb, transit_state_mb):
2995         (transit_state_bkref, build_trtable, match_ctx_clean):
2996         Likewise.
2997         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2998         to work around an assumption that REG_MISSING is negative.
2999
3000         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3001         (seek_collating_symbol_entry) [defined _LIBC]:
3002         (lookup_collation_sequence_value) [defined _LIBC]:
3003         (build_range_exp, build_collating_symbol) [defined _LIBC]:
3004         Use prototypes rather than old-style function definitions.
3005         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3006         (transit_state_sb) [0]:
3007         (find_collation_sequence_value) [defined _LIBC]: Likewise.
3008
3009         * regexec.c (re_search_internal): Simplify update of rm_so and
3010         rm_eo.
3011
3012         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3013         (optimize_subexps, lower_subexp):
3014         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3015         since the signed shift might overflow.  Use 1u<<31 instead.
3016         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3017         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3018         Likewise.
3019
3020         * regcomp.c (optimize_subexps, lower_subexp):
3021         Use CHAR_BIT rather than 8, for clarity.
3022         * regexec.c (check_dst_limits_calc_pos_1):
3023         (check_subexp_matching_top): Likewise.
3024         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3025         have to worry about portability issues when shifting it left.
3026         Remove no-longer-needed test for table_size > 0.
3027         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3028         in a word, as the resulting behavior is undefined.
3029         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3030         in one case, a <= should have been an <, and in another case the
3031         whole test was missing.
3032         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3033         the standard name CHAR_BIT.
3034         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3035         this is not true on one's complement and signed-magnitude hosts.
3036
3037         * regex_internal.h (re_sub_match_top_t): Remove unused member
3038         next_last_offset.
3039         (struct re_dfa_t): Remove unused member states_alloc.
3040         * regcomp.c (init_dfa): Don't initialize unused members.
3041
3042 2005-08-31  Bruno Haible  <bruno@clisp.org>
3043
3044         * strstr.c: Include <stddef.h>, for NULL.
3045         * strcasestr.c: Likewise.
3046         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3047
3048 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3049
3050         * iconvme.h: Add prototype for iconv_alloc.
3051
3052 2005-08-29  Simon Josefsson  <jas@extundo.com>
3053
3054         * iconvme.c: Fix errno.
3055
3056 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3057
3058         * iconvme.c: Split iconv_string into iconv_alloc.
3059
3060 2005-08-27  Jim Meyering  <jim@meyering.net>
3061
3062         * fopen-safer.c: Merge minor changes from coreutils.
3063         * dup-safer.c: Likewise.
3064         * fd-safer.c: Likewise.
3065
3066         Merge from coreutils.
3067         * stdio--.h: New file.
3068         * stdlib--.h: New file.
3069         * mkstemp-safer.c: New file.
3070
3071         GNU tar needs these.
3072         * pipe-safer.c: New file.
3073         * creat-safer.c: New file.
3074         * fcntl--.h (creat): Define to creat_safer.
3075         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3076         * unistd--.h (pipe): Define to pipe_safer.
3077         * unistd-safer.h: Declare pipe_safer.
3078
3079 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3080
3081         * regex_internal.h: Remove all references to
3082         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3083         or better.
3084         (bitset_not, bitset_merge, bitset_not_merge):
3085         (bitset_mask, re_string_allocate, re_string_construct):
3086         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3087         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3088         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3089         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3090         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3091         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3092         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3093         (re_acquire_state_context):
3094         Remove unnecessary forward decls.
3095         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3096         Put __attribute at function definition,
3097         now that the function decl has been removed.
3098         * lib/regex_internal.c (re_string_peek_byte_case):
3099         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3100         Likewise.
3101
3102 2005-08-26  Simon Josefsson  <jas@extundo.com>
3103
3104         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3105         Haible <bruno@clisp.org>.
3106
3107 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3108
3109         * regexec.c (set_regs): Don't alloca with an unbounded size.
3110
3111         alloca modernization/simplification for regex.
3112         * regex.c: Remove portability cruft for alloca.  This no longer
3113         needs to be at the start of the file, and can be moved into
3114         regex_internal.h and simplified.
3115         * regex_internal.h: Include <alloca.h>.
3116         (__libc_use_alloca) [!defined _LIBC]: New macro.
3117         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3118         now works outside glibc.
3119
3120 2005-08-24  Simon Josefsson  <jas@extundo.com>
3121
3122         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3123         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3124         GLIBC specific code.
3125
3126 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3127
3128         Make regex safe for g++.  This fixes one real bug (an "err"
3129         that should have been "*err").  g++ problem reported by
3130         Sam Steingold.
3131         * regex_internal.h (re_calloc): New macro, consistent with
3132         re_malloc etc.  All callers of calloc changed to use re_calloc.
3133         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3134         not int.  All callers changed.
3135         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3136         just use an array of size MB_LEN_MAX.
3137         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3138         (find_recover_state): Change "err" to "*err"; this fixes what
3139         appears to be a real bug.
3140         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3141         versus int.
3142
3143 2005-08-25  Jim Meyering  <jim@meyering.net>
3144
3145         * open-safer.c: Include <config.h>.
3146         Otherwise, we'd lose LARGEFILE support in any file using
3147         e.g. "fcntl--.h"
3148
3149 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3150
3151         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3152         * regex.h (regerror): Likewise.
3153
3154         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3155         requires this.  (The code never needed it.)
3156
3157         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3158         All uses of recently-renamed identifiers changed to use the new,
3159         POSIX-compliant names.  The code will build and run just fine
3160         without these changes, but it's better to eat our own dog food
3161         and use the standard-conforming names.
3162
3163         * regex.h: Fix a multitude of POSIX name space violations.
3164         These changes have an effect only for programs that define
3165         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3166         do not change anything for programs compiled in the normal way.
3167         Also, there is no effect on the ABI.
3168
3169         (_REGEX_SOURCE): New macro.
3170         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3171         defined and _GNU_SOURCE is not; this fixes a name space violation.
3172
3173         Rename the following macros to obey POSIX requirements.
3174         The old names are still visible as macros if _REGEX_SOURCE is defined.
3175         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3176         RE_BACKSLASH_ESCAPE_IN_LISTS.
3177         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3178         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3179         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3180         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3181         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3182         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3183         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3184         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3185         (REG_INTERVALS): renamed from RE_INTERVALS.
3186         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3187         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3188         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3189         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3190         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3191         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3192         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3193         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3194         RE_UNMATCHED_RIGHT_PAREN_ORD.
3195         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3196         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3197         (REG_DEBUG): renamed from RE_DEBUG.
3198         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3199         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3200         unusual, since we can't clash with the POSIX REG_ICASE.
3201         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3202         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3203         (REG_NO_SUB): renamed from RE_NO_SUB.
3204         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3205         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3206         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3207         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3208         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3209         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3210         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3211         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3212         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3213         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3214         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3215         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3216         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3217         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3218         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3219         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3220         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3221         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3222         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3223         (REG_FIXED): Renamed from REGS_FIXED.
3224         (REG_NREGS): Renamed from RE_NREGS.
3225
3226         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3227         of other REG_* macros, since POSIX says the user is allowed to
3228         #undef these macros selectively.
3229
3230         (reg_errcode_t): Update comment stating what other tables need
3231         to be consistent.
3232
3233         Rename the following enum values to obey POSIX requirements.
3234         The old names are still visible as macros.
3235         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3236         is not defined, since GNU is supposed to be a superset of POSIX as
3237         much as possible, and since we want reg_errcode_t to be a signed
3238         type for implementation consistency.
3239         (_REG_NOERROR): Renamed from REG_NOERROR.
3240         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3241         (_REG_BADPAT): Renamed from REG_BADPAT.
3242         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3243         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3244         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3245         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3246         (_REG_EBRACK): Renamed from REG_EBRACK.
3247         (_REG_EPAREN): Renamed from REG_EPAREN.
3248         (_REG_EBRACE): Renamed from REG_EBRACE.
3249         (_REG_BADBR): Renamed from REG_BADBR.
3250         (_REG_ERANGE): Renamed from REG_ERANGE.
3251         (_REG_ESPACE): Renamed from REG_ESPACE.
3252         (_REG_BADRPT): Renamed from REG_BADRPT.
3253         (_REG_EEND): Renamed from REG_EEND.
3254         (_REG_ESIZE): Renamed from REG_ESIZE.
3255         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3256         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3257         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3258         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3259         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3260
3261         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3262         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3263         changed.  But support the old name if the new one is not defined
3264         and if _REGEX_SOURCE.
3265
3266         Change the following member names in struct re_pattern_buffer.
3267         The old names are still supported if !_REGEX_SOURCE.
3268         The new names are always supported, regardless of _REGEX_SOURCE.
3269         (re_buffer): Renamed from buffer.
3270         (re_allocated): Renamed from allocated.
3271         (re_used): Renamed from used.
3272         (re_syntax): Renamed from syntax.
3273         (re_fastmap): Renamed from fastmap.
3274         (re_translate): Renamed from translate.
3275         (re_can_be_null): Renamed from can_be_null.
3276         (re_regs_allocated): Renamed from regs_allocated.
3277         (re_fastmap_accurate): Renamed from fastmap_accurate.
3278         (re_no_sub): Renamed from no_sub.
3279         (re_not_bol): Renamed from not_bol.
3280         (re_not_eol): Renamed from not_eol.
3281         (re_newline_anchor): Renamed from newline_anchor.
3282
3283         Change the following member names in struct re_registers.
3284         The old names are still supported if !_REGEX_SOURCE.
3285         The new names are always supported, regardless of _REGEX_SOURCE.
3286         (rm_num_regs): Renamed from num_regs.
3287         (rm_start): Renamed from start.
3288         (rm_end): Renamed from end.
3289
3290         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3291         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3292         Prepend __ to parameter names.
3293
3294         Undo yesterday's changes.
3295
3296 2005-08-24  Jim Meyering  <jim@meyering.net>
3297
3298         Sync from coreutils.
3299         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3300
3301 2005-08-21  Bruno Haible  <bruno@clisp.org>
3302
3303         * lock.h: Add multiple inclusion guard.
3304         * tls.h: Add multiple inclusion guard.
3305
3306 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3307
3308         * regex.h (REG_NOSYS)
3309         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3310         Define, since POSIX requires it as of 2001.
3311         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3312         New private symbol, used to keep the enum signed in all cases.
3313         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3314         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3315
3316         * regex_internal.c (re_string_skip_chars, register_state):
3317         (calc_state_hash):
3318         Remove forward decls; no longer needed now that we use prototypes.
3319         * regexec.c (acquire_init_state_context, check_halt_node_context):
3320         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3321         (clean_state_log_if_needed): Likewise.
3322
3323 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3324
3325         Fix problems reported by Sam Steingold in
3326         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3327         * regexec.c (sift_states_bkref): Fix portability bug: the code
3328         assumed that reg_errcode_t is a signed type, which is not
3329         necessarily true if _XOPEN_SOURCE is not defined.
3330         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3331         some compilers warn about it otherwise.
3332
3333 2005-08-20  Jim Meyering  <jim@meyering.net>
3334
3335         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3336         of unused local, dfa.
3337
3338 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3339
3340         * regcomp.c (create_initial_state): Remove duplicate decl.
3341         (init_word_char, create_initial_state, duplicate_node_closure):
3342         (fetch_token, peek_token_bracket, build_range_exp):
3343         (build_collating_symbol): Remove forward decls; no longer needed
3344         now that we use prototypes.
3345
3346         * regcomp.c:
3347         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3348         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3349         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3350         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3351         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3352         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3353         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3354         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3355         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3356         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3357         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3358         (build_charclass, build_charclass_op, fetch_number, create_tree):
3359         (create_token_tree, mark_opt_subexp, duplicate_tree):
3360         Use prototypes rather than old-style definitions.
3361
3362         * regex_internal.c:
3363         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3364         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3365         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3366         (re_string_reconstruct, re_string_peek_byte_case):
3367         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3368         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3369         (re_node_set_init_copy, re_node_set_add_intersect):
3370         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3371         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3372         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3373         (re_acquire_state, re_acquire_state_context, register_state):
3374         (create_ci_newstate, create_cd_newstate, free_state):
3375         Likewise.
3376         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3377         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3378         (re_search_internal, prune_impossible_nodes):
3379         (acquire_init_state_context, check_matching, static):
3380         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3381         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3382         (update_regs, sift_states_backward, build_sifted_states):
3383         (clean_state_log_if_needed, merge_state_array):
3384         (update_cur_sifted_state, add_epsilon_src_nodes):
3385         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3386         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3387         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3388         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3389         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3390         (check_arrival, check_arrival_add_next_nodes):
3391         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3392         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3393         (check_node_accept_bytes, check_node_accept, extend_buffers):
3394         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3395         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3396         (sift_ctx_init):
3397         Likewise.
3398
3399         * regex_internal.h:
3400         (re_string_allocate, re_string_construct, re_string_reconstruct):
3401         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3402         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3403         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3404         (re_string_context_at, re_string_peek_byte_case):
3405         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3406         is defined, since we now use prototypes always.
3407
3408         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3409         C89 or better.  All uses removed.
3410
3411 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3412
3413         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3414         [defined lint]: Suppress bogus uninitialized-variable warnings.
3415
3416         * regcomp.c (duplicate_node): Return new index, not an error code,
3417         and let the caller return REG_ESPACE if out of space.  This
3418         removes an uninitialied-variable warning with GCC 4.0.1, and also
3419         avoids taking the address of a local variable.  All callers
3420         changed.
3421
3422 2005-08-19  Jim Meyering  <jim@meyering.net>
3423
3424         * regexec.c (proceed_next_node): Redo local variables to
3425         avoid GCC shadowing warnings.
3426
3427 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3428
3429         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3430         (re_node_set_insert_last, re_dfa_add_node):
3431         Rename local variables to avoid GCC shadowing warnings.
3432
3433 2005-08-18  Bruno Haible  <bruno@clisp.org>
3434
3435         * strstr.c (strstr): Fix return value in multibyte case.
3436         * strcasestr.c (strcasestr): Likewise.
3437
3438 2005-08-17  Jim Meyering  <jim@meyering.net>
3439
3440         Make the %s format (seconds since the epoch) work for a negative
3441         number and when used with a zero-padded field width, e.g. %015s.
3442
3443         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3444         label so that it precedes the code to set `digits'.  Otherwise,
3445         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3446         print `00-22'.  Now, it prints `-0022', as it should.
3447
3448 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3449
3450         * regex.h: Remove useless space-before-tab.  From coreutils.
3451
3452 2005-08-17  Bruno Haible  <bruno@clisp.org>
3453
3454         * strcasestr.h: New file.
3455         * strcasestr.c: New file.
3456
3457 2005-08-17  Bruno Haible  <bruno@clisp.org>
3458
3459         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3460         * strstr.c: Completely rewritten, with multibyte locale support.
3461
3462 2005-08-17  Bruno Haible  <bruno@clisp.org>
3463
3464         * strcasecmp.c: Use mbuiter.h.
3465
3466 2005-08-17  Bruno Haible  <bruno@clisp.org>
3467
3468         * mbuiter.h: New file.
3469
3470 2005-08-16  Bruno Haible  <bruno@clisp.org>
3471
3472         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3473         (mbi_init): Update.
3474         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3475         NUL byte, not after it.
3476
3477 2005-08-16  Bruno Haible  <bruno@clisp.org>
3478
3479         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3480         the valid ones. Makes the comparison operations transitive:
3481         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3482         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3483
3484 2005-08-16  Bruno Haible  <bruno@clisp.org>
3485
3486         * strcase.h (strcasecmp): Add note in comments.
3487         * strncasecmp.c: Use code from strcasecmp.c.
3488         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3489         (strcasecmp): Work correctly in multibyte locales.
3490
3491 2005-08-16  Bruno Haible  <bruno@clisp.org>
3492
3493         * strnlen1.h: New file.
3494         * strnlen1.c: New file.
3495
3496 2005-08-16  Bruno Haible  <bruno@clisp.org>
3497
3498         * mbfile.h: New file.
3499
3500 2005-08-16  Bruno Haible  <bruno@clisp.org>
3501
3502         * mbiter.h: New file.
3503
3504 2005-08-16  Bruno Haible  <bruno@clisp.org>
3505
3506         * mbchar.h: New file.
3507         * mbchar.c: New file.
3508
3509 2005-08-16  Bruno Haible  <bruno@clisp.org>
3510
3511         * tls.h: New file, from GNU gettext.
3512         * tls.c: New file, from GNU gettext.
3513
3514 2005-08-15  Bruno Haible  <bruno@clisp.org>
3515
3516         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3517         is defined.
3518
3519 2005-08-14  Jim Meyering  <jim@meyering.net>
3520
3521         Sync from coreutils.
3522
3523         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3524         Use the hash-table-based cycle-detection code not just when
3525         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3526         Reported by James Youngman in
3527         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3528         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3529         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3530         This lets us compile with -DFTS_DEBUG, once again.
3531         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3532         * fts.c (fd_safer): Remove decl.
3533         Include fcntl--.h rather than unistd-safer.h
3534         (fts_safe_changedir): Don't call fd_safer; no longer needed
3535         now that we include fcntl--.h.
3536
3537 2005-08-11  Simon Josefsson  <jas@extundo.com>
3538
3539         * readline.h, readline.c: New file.
3540
3541 2005-08-11  Bruno Haible  <bruno@clisp.org>
3542
3543         * strnlen.h (strnlen): Change parameter name to match comment.
3544
3545 2005-08-10  Simon Josefsson  <jas@extundo.com>
3546
3547         * strndup.c: Use strnlen.h.
3548
3549         * strnlen.h: New file.
3550
3551 2005-08-02  Simon Josefsson  <jas@extundo.com>
3552
3553         * getline.h, getline.c: Rewrite.
3554
3555         * getdelim.h, getdelim.c: New files, ported from glibc.
3556
3557 2005-07-31  Bruno Haible  <bruno@clisp.org>
3558
3559         * lock.h (gl_lock_initializer): New macro.
3560         (gl_lock_define_initialized): Use it.
3561         (gl_rwlock_initializer): New macro.
3562         (gl_rwlock_define_initialized): Use it.
3563         (gl_recursive_lock_initializer): New macro.
3564         (gl_recursive_lock_define_initialized): Use it.
3565
3566 2005-07-26  Bruno Haible  <bruno@clisp.org>
3567
3568         * lock.h: Update from GNU gettext.
3569         * lock.c: Update from GNU gettext.
3570
3571 2005-07-18  Bruno Haible  <bruno@clisp.org>
3572
3573         * lock.h (gl_once_t): New type.
3574         (gl_once_define, gl_once): New macros.
3575         * lock.c (fresh_once): New variable.
3576         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3577         functions.
3578
3579 2005-07-18  Simon Josefsson  <jas@extundo.com>
3580
3581         * check-version.c (check_version): Accept identical versions too.
3582
3583 2005-07-18  Bruno Haible  <bruno@clisp.org>
3584
3585         * lock.h: New file, from GNU gettext.
3586         * lock.c: New file, from GNU gettext.
3587
3588 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3589
3590         * quotearg.c: Add translator comment suggested by Bruno Haible,
3591         with a minor change.
3592
3593 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3594
3595         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3596         copyright symbol and the year.
3597         * version-etc.c (COPYRIGHT_YEAR): New constant.
3598         (version_etc_va): Use parameterized copyright notice.
3599         Reword to conform to the current GNU coding standards.
3600
3601 2005-07-11  Simon Josefsson  <jas@extundo.com>
3602
3603         * size_max.h: New file.
3604
3605 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3606
3607         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3608         block of defines.
3609
3610 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3611        and  Paul Eggert  <eggert@cs.ucla.edu>
3612
3613         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3614         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3615
3616 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3617
3618         * regex.c, regex.h: Sync from libc.
3619         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3620         New files, synced from libc, except that regex_internal.h
3621         currently has a small porting fix.
3622
3623 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3624
3625         Remove the dependency of the strftime module on the tzset module.
3626         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3627         Copy the input structure, to work around some of the bug with
3628         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3629         Solaris releases, you should also use the tzset module, but we won't
3630         require it as a dependency any more since we don't want LGPLed code
3631         to depend on GPLed code.
3632
3633 2005-07-02  Jim Meyering  <jim@meyering.net>
3634
3635         * backupfile.c (backup_args): Change a `0' to NULL.
3636
3637 2005-07-01  Jim Meyering  <jim@meyering.net>
3638
3639         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3640         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3641         * save-cwd.c, tempname.c:
3642         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3643         and don't include <sys/file.h>).
3644
3645 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3646
3647         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3648         declares only 'struct timespec;' (!).
3649
3650 2005-06-29  Jim Meyering  <jim@meyering.net>
3651
3652         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3653         type name.  Use the variable name instead.
3654         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3655
3656 2005-06-28  Simon Josefsson  <jas@extundo.com>
3657
3658         * check-version.h, check-version.c: New files.
3659
3660 2005-06-28  Simon Josefsson  <jas@extundo.com>
3661
3662         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3663         collision with global variable.  Better indentation.  Don't
3664         increment buffer pointer beyond buffer end.  Based on comments
3665         from Paul Eggert <eggert@cs.ucla.edu>.
3666
3667         * base64.h: Indent.
3668
3669 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3670
3671         * canon-host.c (canon-host): Append trailing "," to 0 in
3672         initializer of struct addrinfo, as an indication that we don't
3673         care how many members the structure has.
3674
3675 2005-06-24  Derek Price  <derek@ximbiot.com>
3676         and Bruno Haible  <bruno@clisp.org>
3677
3678         Remove stat module & update lstat.
3679         * stat.c: Remove this file...
3680         (slash_aware_lstat): ...moving this content and its support...
3681         * lstat.c (rpl_lstat): ...into here.
3682         * lstat.h: New file.
3683
3684 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3685
3686         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3687         (ranged_convert): Don't save conversion in a temporary struct.
3688         This causes a warning with GCC 4.0.0, and anyway in the typical
3689         case it's not worth the extra 100 bytes or so of code.
3690         (ranged_convert, __mktime_internal): When calling a function via a
3691         pointer P, use P () rather than (*P) (), as we now assume C89 or
3692         better.
3693
3694 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3695
3696         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3697         "who -r" failed to give output.  Problem reported by Tim Waugh.
3698
3699         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3700         (xcalloc): Use it to avoid needless tests.
3701         Problem reported by Jim Meyering.
3702
3703 2005-06-16  Jim Meyering  <jim@meyering.net>
3704
3705         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3706         when either N or S is zero.
3707
3708 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3709
3710         * argp.h (__option_is_short): Check upper limit of
3711         __key. Isprint() requires its argument to have the value
3712         of an unsigned char or EOF.
3713
3714 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3715
3716         * fnmatch.c (fnmatch): If there is an encoding error in a
3717         multibyte string or pattern, fall back on unibyte matching.
3718         Problem reported by James Youngman.
3719
3720 2005-06-08  Bruno Haible  <bruno@clisp.org>
3721
3722         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3723         warning on mingw.
3724
3725 2005-06-08  Bruno Haible  <bruno@clisp.org>
3726
3727         * csharpcomp.h: New file, from GNU gettext.
3728         * csharpcomp.c: New file, from GNU gettext.
3729         * csharpcomp.sh.in: New file, from GNU gettext.
3730
3731 2005-06-07  Derek Price  <derek@ximbiot.com>
3732
3733         Sync from CVS.
3734         * glob_.h: Indent nested #ifdef.
3735
3736 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3737
3738         Sync from coreutils.
3739         Use "file name" when talking about file names, instead of "filename"
3740         or "path", as per the GNU coding standards.
3741         * mkdir-p.c: Renamed from makepath.c.
3742         (make_dir_parents): Renamed from make_path.  All callers changed.
3743         * mkdir-p.h: Likewise.  All includers changed.
3744         * filenamecat.c: Renamed from path-concat.c.
3745         (file_name_concat): Renamed from path_concat.  All callers changed.
3746         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3747         * filenamecat.h: Likewise.  All includers changed.
3748         * acl.c: Don't use "path" or "filename" to mean "file name"
3749         in comments or local variable names.
3750         * basename.c: Likewise.
3751         * canonicalize.c, canonicalize.h: Likewise.
3752         * dirname.c, dirname.h: Likewise.
3753         * euidaccess.c: Likewise.
3754         * exclude.c: Likewise
3755         * fnmatch_.h, fnmatch_loop.c: Likewise.
3756         * fsusage.c, fsuage.h: Likewise.
3757         * fts.c, fts_.h: Likewise.
3758         * getcwd.c: Likewise.
3759         * getloadavg.c: Likewise.
3760         * mkstemp.c: Likewise.
3761         * mountlist.c, mountlist.h: Likewise.
3762         * openat.c, openat.h: Likewise.
3763         * readlink-stub.c: Likewise.
3764         * readutmp.c, readutmp.h: Likewise.
3765         * rename.c: Likewise.
3766         * rmdir.c: Likewise.
3767         * same.c: Likewise.
3768         * savedir.c: Likewise.
3769         * stripslash.c: Likewise.
3770         * tempname.c: Likewise.
3771         * xreadlink.c: Likewise.
3772         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3773         All uses changed.
3774         * exclude.h: Likewise.
3775
3776         * euidaccess.c (getuid, getgid, getuid, getegid)
3777         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3778         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3779         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3780         * pathmax.h: Include <limits.h> unconditionally, since other
3781         files have been getting away with it for years (MORE/BSD 4.3
3782         is extinct now).
3783         * userspec.c (getpwnam, getgrnam, getgrgid)
3784         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3785
3786         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3787         Define to 256, not 255, as per modern POSIX.
3788
3789 2005-06-01  Bruno Haible  <bruno@clisp.org>
3790
3791         * csharpexec.h: New file, from GNU gettext.
3792         * csharpexec.c: New file, from GNU gettext.
3793         * csharpexec.sh.in: New file, from GNU gettext.
3794
3795 2005-05-31  Derek Price  <derek@ximbiot.com>
3796             Paul Eggert  <eggert@cs.ucla.edu>
3797
3798         Sync from cvs.
3799         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3800
3801 2005-05-29  Derek Price  <derek@ximbiot.com>
3802             Paul Eggert  <eggert@cs.ucla.edu>
3803
3804         * glob_.h, glob.c: New files.
3805
3806 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3807
3808         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3809
3810         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3811         the configuration hassle isn't worth it.
3812         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3813         (LONGEST_MODIFIER, PRIuMAX): Remove.
3814
3815 2005-05-27  Bruno Haible  <bruno@clisp.org>
3816
3817         * getlogin_r.h: Remove second include of <stddef.h>.
3818
3819 2005-05-25  Bruno Haible  <bruno@clisp.org>
3820             Derek Price  <derek@ximbiot.com>
3821
3822         * getlogin_r.h: Simplify API documentation.
3823
3824 2005-05-25  Derek Price  <derek@ximbiot.com>
3825             Paul Eggert  <eggert@cs.ucla.edu>
3826
3827         * getlogin_r.c, getlogin_r.h: New files.
3828
3829 2005-05-22  Bruno Haible  <bruno@clisp.org>
3830
3831         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3832         Also include <sys/param.h> if it defines MIN, MAX.
3833         Based on a patch by Derek Price <derek@ximbiot.com>.
3834
3835 2005-05-22  Bruno Haible  <bruno@clisp.org>
3836
3837         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3838         (INT64_MIN): Fix definition.
3839         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3840
3841         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3842         NEED_SIGNED_INT_TYPES.
3843
3844         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3845         HAVE_SYSTEM_INTTYPES.
3846
3847 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3848
3849         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3850         so that unistd-safer.h (GPL'ed code) need not be included.
3851
3852 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3853
3854         New fts module.
3855         * fts.c: Don't include "cycle-check.h" or "hash.h".
3856         (setup_dir, free_dir): New functions.
3857         (enter_dir, leave_dir): Define trivial
3858         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3859         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3860         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3861         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3862         Move to fts-cycle.c.
3863         (fts_open): Use setup_dir.
3864         (fts_close): Use free_dir.
3865         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3866         This adds a label and some gotos, but the alternatives were messier.
3867         Check for memory allocation failure when entering a dir.
3868         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3869         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3870         (FTS): New member fts_cycle, that is a union that contains the
3871         old active_dir_ht and cycle_state.  All uses changed to mention
3872         fts_cycle.ht and fts_cycle.state.
3873         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3874         fts.c, with the following changes:
3875         (setup_dir, free_dir): New functions.
3876         (enter_dir): Now returns bool.  Return true if successful, false
3877         if memory exhausted.  All callers changed.
3878         Do not bother partly cleaning up on
3879         memory allocation failure; that is free_dir's job.
3880         However, free ad if hash_insert fails, to avoid memory leak.
3881         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3882         fts->fts_options to see which union member to use.
3883
3884 2005-05-20  Jim Meyering  <jim@meyering.net>
3885
3886         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3887         Now a macro, to pacify GCC.
3888
3889 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3890
3891         * chown.c (rpl_chown): Return -1 on failure.
3892
3893 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3894
3895         * canonicalize.c: Include canonicalize.h first, to test interface.
3896         Include <stddef.h> unconditionally, since we assume C89 now.
3897         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3898         * fts.c: Include fts_.h first, to check interface.
3899         Do not include intprops.h; no longer needed.
3900         Include cycle-check.h and hash.h, since fts_.h no longer does.
3901         Remove unnecessary casts of closedir to void.
3902         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3903         decide whether to decrement nlinks.
3904         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3905         (FTS): Use struct hash_table * instead of Hash_table, so that
3906         we no longer need to include hash.h here.
3907
3908 2005-05-17  Jim Meyering  <jim@meyering.net>
3909
3910         * fts.c, fts_.h: New files, from coreutils.
3911
3912 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3913
3914         Sync from coreutils.
3915         * unlinkdir.c, unlinkdir.h: New files.
3916         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3917         regex.h, unlocked-io.h, xtime.h:
3918         White space changes only.
3919         * makepath.c (make_path): Port to hosts where leading "//" is special.
3920         * yesno.c: Include getline.h, not ctype.h.
3921         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3922         Use getline to remove arbitrary restriction on response length.
3923
3924 2005-05-13  Bruno Haible  <bruno@clisp.org>
3925
3926         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3927         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3928         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3929         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3930         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3931         Add support for 64-bit integers in the MSVC compiler.
3932
3933 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3934
3935         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3936         Change the initial comment to refer to GPL, not LGPL.
3937         gnulib-tool will change it to LGPL as needed.
3938
3939         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3940         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3941         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3942         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3943         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3944         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3945         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3946         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3947         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3948         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3949         concatpath.c, config.charset, copy-file.c, copy-file.h,
3950         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3951         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3952         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3953         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3954         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3955         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3956         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3957         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3958         full-read.c, full-read.h, full-write.c, full-write.h,
3959         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3960         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3961         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3962         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3963         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3964         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3965         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3966         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3967         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3968         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3969         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3970         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3971         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3972         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3973         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3974         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3975         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3976         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3977         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3978         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3979         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3980         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3981         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3982         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3983         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3984         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3985         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3986         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3987         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3988         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3989         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3990         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3991         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3992         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3993         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3994         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3995         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3996         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3997         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3998         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3999         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4000         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4001         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4002         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4003         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4004         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4005         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4006         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4007         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4008         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4009         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4010         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4011         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4012         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4013         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4014         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4015         Update FSF postal mail address.
4016
4017 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4018
4019         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4020         specified in ai_socktype. Fix invalid ai_protocol
4021         check. ai_protocol is usually set to 0 or depending on
4022         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4023         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4024         ai_socktype / ai_protocol in the returned addrinfo structure.
4025
4026 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4027             Bruno Haible  <bruno@clisp.org>
4028
4029         * inet_ntop.h: New file.
4030         * inet_ntop.c: New file, from glibc with modifications.
4031
4032 2005-05-08  Jim Meyering  <jim@meyering.net>
4033
4034         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4035
4036 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4037
4038         Merge from coreutils.  Among other things,
4039         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4040         * fd-safer.c: New file.
4041         * fcntl-safer.h, open-safer.c: Remove.
4042         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4043         * dup-safer.c: Include unistd-safer.h first.
4044         Don't include errno.h.
4045         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4046         * file-type.h: Don't assume invoker included sys/stat.h first.
4047         * file-type.c: Rely on file-type.h change.
4048         * getloadavg.c: Include unistd-safer.h.
4049         (getloadavg): Use safer open.
4050         * getusershell.c: Include "stdio-safer.h".
4051         (getusershell): Use safer fopen.
4052         * long-options.c (long_options): Use NULL rather than 0.
4053         * modechange.h (mode_free): Remove; all callers changed to invoke
4054         'free'.
4055         * modechange.c: Likewise.
4056         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4057         (MODE_DONE): New constant.
4058         (struct mode_change): Remove 'next' member.
4059         (make_node_op_equals): New function; like the old one of the
4060         same name, except it allocates an array.
4061         (mode_compile, mode_create_from_ref): Use it.
4062         (mode_compile): Allocate result as an array, not a linked list.
4063         Parse octal string ourself, so that we catch mistakes like "+0".
4064         (mode_adjust): Arg is an array, not a linked list.
4065         * modechange.c: Include stat-macros.h, xalloc.h.
4066         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4067         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4068         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4069         Remove.  This is now stat-macros.h's job.
4070         (talloc): Remove.  All callers replaced by xalloc, so that
4071         our invokers don't have to worry about reporting memory failures.
4072         (make_node_op_equals): Remove.
4073         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4074         New constants.
4075         (struct mode_change): Moved here from modechange.h.
4076         (mode_append_entry): Remove.
4077         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4078         apps to have incorrect behavior.  Use simpler algorithm for head
4079         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4080         Detect more invalid usages rather than having somewhat-random behavior.
4081         Don't insert an "a=" action, as that leads to incorrect behavior.
4082         (mode_compile, mode_create_from_ref): Return NULL on error instead
4083         of an enum, since now there's only one way to have an error.  All
4084         callers changed.
4085         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4086         at the correct time.  Simplify calculation of "+u" and its ilk.
4087         Don't mishandle "+X".
4088         (mode_free): Remove "register" and localize decls.
4089         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4090         (struct mode_change): Move to modechange.c; callers don't
4091         need to see this stuff.
4092         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4093         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4094         (mode_change, mode_adjust): Reflect the new signatures noted above.
4095         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4096         that might redefine system include files.
4097         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4098         (my_usleep): Use NULL rather than (void *) 0.
4099         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4100         Use siginterrupt to specify that system calls should be interrupted.
4101         (rpl_nanosleep): Move initialization of suspended closer to call of
4102         my_usleep.
4103         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4104         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4105         (desirable_utmp_entry): New function.
4106         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4107         using x2nrealloc, to simplify logic.
4108         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4109         size calculation.  Do not assume utmp file is a regular file.
4110         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4111         (READ_UTMP_CHECK_PIDS): New constant.
4112         * save-cwd.c: Include unistd-safer.h.
4113         (save_cwd): Use fd_safer.
4114         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4115         [!_LIBC] Include "stat-macros.h" instead.
4116         * unistd-safer.h (fd_safer): New decl.
4117
4118 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4119
4120         * byteswap_.h: New file.
4121
4122 2005-04-25  Albert Chin  <china@thewrittenword.com>
4123
4124         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4125         Toolkit C bug.
4126
4127 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4128
4129         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4130         that "UTC +1 second" continues to work.  Problem reported
4131         by Dmitry V. Levin.
4132         (relunit_snumber): New rule.
4133         (relunit): Use it.
4134
4135 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4136
4137         * getdate.y (universal_time_zone_table): New constant.
4138         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4139         universal_time_zone_table.
4140         (lookup_zone): Prefer universal_time_zone_table to
4141         local_time_zone_table, so that "GMT" time stamps are allowed in
4142         London during the summer.  Problem reported by Ian Abbott.
4143
4144 2005-04-12  Jim Meyering  <jim@meyering.net>
4145
4146         * human.c (humblock): Set *options even when returning due to
4147         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4148         warning from gcc-4.
4149
4150 2005-04-09  Jim Meyering  <jim@meyering.net>
4151
4152         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4153         -Wuninitialized: initialize tm0.tm_year.
4154
4155 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4156
4157         * getdate.y (parser_control): rels_seen is now a boolean, not a
4158         count, since there's no maximum.  All uses changed.
4159         Add member dsts_seen.
4160         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4161         not being INT_MAX.
4162         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4163         Use pc_rels_seen to decide whther a date is absolute.
4164
4165         * getdate.y (number): Don't overwrite year.
4166         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4167         check.
4168
4169 2005-04-02  Simon Josefsson  <jas@extundo.com>
4170
4171         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4172         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4173
4174 2005-03-27  Jim Meyering  <jim@meyering.net>
4175
4176         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4177
4178 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4179
4180         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4181         "one's complement" -> "ones' complement" in comment, as per Knuth.
4182         "value of type" -> "type or expression" in comment.
4183         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4184
4185 2005-03-26  Jim Meyering  <jim@meyering.net>
4186
4187         Comment nits.
4188         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4189         Correct typos: s/or/of/.
4190
4191 2005-03-23  Jim Meyering  <jim@meyering.net>
4192
4193         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4194
4195 2005-03-21  Jim Meyering  <jim@meyering.net>
4196
4197         Changes imported from coreutils.
4198
4199         * cycle-check.c: Don't include xalloc.h.
4200
4201         * path-concat.c: Don't include assert.h.
4202         (path_concat): Remove assertion that would have triggered
4203         for ABASE starting with more than one slash.
4204         Reported by Andreas Schwab.
4205
4206         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4207         properly when ABASE is an absolute file name.
4208         Correct the description of this function.
4209         Include <assert.h>.
4210         Add an assertion and a test driver.
4211         This fixes a bug introduced on 2004-07-02.
4212         Andreas Schwab reported the resulting failure of cp --parents:
4213         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4214
4215 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4216
4217         * strftime.c (my_strftime): If the underlying strftime returns 0
4218         (which shouldn't happen), generate nothing instead of returning 0
4219         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4220
4221 2005-03-16  Bruno Haible  <bruno@clisp.org>
4222
4223         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4224
4225 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4226
4227         * strftime.c (my_strftime): Prepend space to format so that we can
4228         reliably distinguish strftime failure from empty output on POSIX
4229         hosts.
4230
4231 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4232
4233         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4234         (iconv_string): Don't guess a size-zero buffer, as that might cause
4235         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4236         result would be 'too large', where 'too large' is (heuristically)
4237         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4238         overflow concerns.  This will prevent some unwanted malloc failures
4239         when the inputs are very large.
4240
4241 2005-03-15  Bruno Haible  <bruno@clisp.org>
4242
4243         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4244         'negate'.
4245
4246         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4247         variable.
4248
4249         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4250
4251 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4252
4253         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4254         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4255         intprops.h.
4256         * strtol.c: Likewise.
4257
4258 2005-03-14  Simon Josefsson  <jas@extundo.com>
4259
4260         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4261         <fx@gnu.org>.
4262
4263 2005-03-14  Jim Meyering  <jim@meyering.net>
4264
4265         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4266         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4267         to be nonzero so that we (and caller) can detect the difference
4268         between a valid zero-length expansion and an error return, even
4269         when the underlying strftime fails before writing anything into
4270         that location.
4271
4272 2005-03-10  Jim Meyering  <jim@meyering.net>
4273
4274         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4275         so that this module works on systems without fchdir.
4276
4277 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4278
4279         Factor int-properties macros into a single file, except for
4280         glibc-related files.
4281         * intprops.h: New file.
4282         * getloadavg.c: Include it instead of limits.h.
4283         (INT_STRLEN_BOUND): Remove.
4284         * human.c: Include intprops.h.
4285         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4286         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4287         * inttostr.h: Include intprops.h instead of limits.h.
4288         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4289         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4290         for consistency with intprops.h.
4291         (time_t_is_integer, twos_complement_arithmetic): Use them.
4292         * sig2str.h: Include <signal.h>, intprops.h.
4293         (INT_STRLEN_BOUND): Remove.
4294         * strftime.c (TYPE_SIGNED): Remove.
4295         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4296         * strtol.c: Adjust comments to match intprops.h.
4297         * userspec.c: Include intprops.h.
4298         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4299         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4300         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4301         instead of rolling our own expressions.
4302         * xstrtol.c: Include xstrtol.h first, to test interface.
4303
4304         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4305         instead of int.
4306         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4307         the right thing even if adding 1900 would overflow.  Similarly
4308         for tm_mon + 1 and tm_yday + 1.
4309         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4310         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4311         (DO_SIGNED_NUMBER): New macro.
4312         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4313
4314 2005-03-07  Bruno Haible  <bruno@clisp.org>
4315
4316         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4317
4318 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4319             Bruno Haible  <bruno@clisp.org>
4320
4321         * pagealign_alloc.h: New file.
4322         * pagealign_alloc.c: New file.
4323
4324 2005-01-28  Bruno Haible  <bruno@clisp.org>
4325
4326         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4327         stpncpy.c uses it.
4328
4329 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4330
4331         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4332         The workaround isn't strictly needed for POSIX conformance, and
4333         it's too much of a pain to configure and maintain.  We'll ask
4334         people to fix their kernels instead.
4335         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4336         (NANOSLEEP_BUG_WORKAROUND): Remove.
4337         (xnanosleep): Remove the workaround.
4338
4339 2005-02-12  Bruno Haible  <bruno@clisp.org>
4340
4341         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4342
4343 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4344
4345         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4346         * timespec.h (gettime): Return void, since it always
4347         succeeds now.  All uses changed.
4348         * gettime.c (gettime) Likewise.
4349         [HAVE_NANOTIME]: Prefer nanotime.
4350         Assume gettimeofday succeeds, as POSIX requires.
4351         Assime time () succeeds, since other code already does.
4352         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4353         (timespec_subtract): Remove.
4354         (NANOSLEEP_BUG_WORKAROUND): New constant.
4355         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4356         things considerably.  Use it only on GNU/Linux hosts, since the
4357         workaround shouldn't be needed elsewhere.
4358
4359 2005-02-24  Bruno Haible  <bruno@clisp.org>
4360
4361         * gettext.h: Update from GNU gettext 0.14.2.
4362
4363 2005-02-24  Bruno Haible  <bruno@clisp.org>
4364
4365         * localcharset.c: Update from GNU gettext 0.14.2.
4366         * config.charset: Update from GNU gettext 0.14.2.
4367
4368 2005-02-22  Simon Josefsson  <jas@extundo.com>
4369
4370         * iconvme.h, iconvme.c: New files, from libc.
4371
4372 2005-02-20  Neil Conway  <neilc@samurai.com>
4373
4374         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4375         returned by OSX/Darwin if the specified buffer is not large
4376         enough for the hostname.
4377
4378 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4379
4380         * memrchr.h: New file.
4381         * chdir-long.c: Include it.
4382         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4383         Don't bother including stddef.h.
4384
4385 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4386
4387         * argp-help.c (__argp_help): Create a fake struct argp_state and
4388         pass it to _help, otherwise the latter coredumps trying to
4389         dereference state.root_argp.
4390
4391 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4392
4393         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4394         inclusion.
4395         Include <sys/types.h>, for dev_t.
4396         (ME_DUMMY, ME_REMOTE): Move from here....
4397         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4398         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4399         Dmitry V. Levin.
4400         Include mountlist.h first, to test the interface.
4401
4402 2005-01-29  Bruno Haible  <bruno@clisp.org>
4403
4404         * progname.c (program_name): Initialize.
4405         Needed when linking statically on MacOS X.
4406
4407 2005-01-28  Bruno Haible  <bruno@clisp.org>
4408
4409         * javacomp.sh.in: New file, from GNU gettext.
4410         * javacomp.h: New file, from GNU gettext.
4411         * javacomp.c: New file, from GNU gettext.
4412
4413 2005-01-26  Bruno Haible  <bruno@clisp.org>
4414
4415         * javaexec.sh.in: New file, from GNU gettext.
4416         * javaexec.h: New file, from GNU gettext.
4417         * javaexec.c: New file, from GNU gettext.
4418
4419 2005-01-26  Simon Josefsson  <jas@extundo.com>
4420
4421         * gai_strerror.c: Use GPL in header.
4422
4423 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4424
4425         * argp-help.c (hol_entry_help): Avoid using non-constant
4426         initializers for struct pentry_state.
4427         (__argp_error): Check return value of __asprintf
4428         (__argp_failure): Translate error message
4429
4430         * argp-parse.c: Removed braces around the expansion of N_()
4431
4432 2005-01-21  Jim Meyering  <jim@meyering.net>
4433
4434         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4435         same value as for Solaris 9.
4436
4437         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4438         component length.  This included changing the parameter to be
4439         of type `char *' rather than `char const *'.
4440         * chdir-long.h (chdir_long): Update prototype.
4441
4442         * openat.c (fdopendir, fstatat): New functions.
4443         * openat.h: Include headers required for use of DIR and struct stat.
4444         [AT_SYMLINK_NOFOLLOW]: Define.
4445         (fdopendir, fstatat): Add prototypes.
4446
4447 2005-01-21  Bruno Haible  <bruno@clisp.org>
4448
4449         * classpath.h: New file, from GNU gettext.
4450         * classpath.c: New file, from GNU gettext.
4451
4452 2005-01-20  Simon Josefsson  <jas@extundo.com>
4453
4454         * version-etc-fsf.c: New file, with version_etc_copyright.
4455         * version-etc.c: Remove version_etc_copyright.
4456         * version-etc.h (version_etc_copyright): Use [] instead of * in
4457         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4458
4459 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4460
4461         * save-cwd.c (save_cwd): Remove code to support the case
4462         where fchdir is missing or flaky.
4463
4464 2005-01-20  Simon Josefsson  <jas@extundo.com>
4465
4466         * base64.h (isbase64): Add.
4467
4468         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4469         using a unsigned prototype, don't inline.
4470         (base64_decode): Use it.
4471
4472 2005-01-19  Bruno Haible  <bruno@clisp.org>
4473
4474         * sh-quote.h: New file, from GNU gettext.
4475         * sh-quote.c: New file, from GNU gettext.
4476
4477 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4478
4479         Merge changes from coreutils, as described below in several
4480         changelogs dated today.
4481
4482         * save-cwd.c: Include "save-cwd.h" before other include files.
4483         (O_DIRECTORY): Remove; not needed here, since "." must be
4484         a directory.  All uses removed.
4485         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4486         universal on Suns, and we also need to test for IRIX.
4487         Revamp code to use 'if' rather than '#if'.
4488         Avoid unnecessary comparison of cwd->desc to 0.
4489
4490         * utimens.c (futimens): Robustify the previous patch, by checking
4491         for known valid error numbers rather than observed invalid ones.
4492
4493 2005-01-18  Jim Meyering  <jim@meyering.net>
4494
4495         * version-etc.c (version_etc_copyright): Update copyright date.
4496
4497         * utimens.c (futimens): Account for the fact that futimes
4498         can also fail with errno == ENOSYS or errno == ENOENT.
4499         Patch from Dmitry V. Levin.
4500
4501         Change the name of the robust chdir function from chdir to chdir_long.
4502         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4503         (restore_cwd): Use chdir_long, not chdir.
4504         * chdir-long.c: Renamed from chdir.c.
4505         * chdir-long.h: Renamed from chdir.h.
4506         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4507         Hurd.
4508
4509 2005-01-18  Bob Proulx  <bob@proulx.com>
4510
4511         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4512         offsetof() macro construct to avoid compile failure with native HP-UX
4513         11.0 ANSI C compiler.
4514
4515 2005-01-06  Bruno Haible  <bruno@clisp.org>
4516
4517         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4518         because stpncpy.m4 takes care of it.
4519
4520 2004-01-24  Bruno Haible  <bruno@clisp.org>
4521
4522         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4523
4524 2003-10-09  Bruno Haible  <bruno@clisp.org>
4525
4526         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4527
4528 2005-01-06  Bruno Haible  <bruno@clisp.org>
4529
4530         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4531         * fwriteerror.c: Include <stdbool.h>.
4532         (fwriteerror): At the end, close the file stream. Record whether
4533         stdout was already closed.
4534
4535 2004-05-27  Bruno Haible  <bruno@clisp.org>
4536
4537         * execute.c (environ): Declare if needed.
4538         * pipe.c (environ): Likewise.
4539         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4540
4541 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4542
4543         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4544         definitions to be after all include files, to avoid collisions.
4545         Problem reported by Bob Proulx.
4546
4547 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4548
4549         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4550         not needed.  This removes a dependency on the gettext module.
4551         [defined _LIBC]: Do not include <libintl.h>; not needed.
4552
4553 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4554
4555         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4556         HAVE_DECL_STRTOLD.
4557
4558 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4559
4560         * argp-parse.c: Include <stddef.h>.
4561         (alignof, alignto): New macros.
4562         (parser_init): Don't assume that void * is aligned sufficiently
4563         for struct option.
4564
4565         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4566         need to extend the stack.
4567         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4568         large.
4569
4570 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4571
4572         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4573
4574 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4575
4576         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4577         Remove now-obsolete comment about AIX.
4578         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4579         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4580         (YYMAXDEPTH): New macro.
4581
4582 2004-12-18  Bruno Haible  <bruno@clisp.org>
4583
4584         * fatal-signal.c (fatal_signals): Make non-const.
4585         (init_fatal_signals): New function.
4586         (uninstall_handlers, install_handlers): Ignore signals that were set to
4587         SIG_IGN.
4588         (at_fatal_signal): Call init_fatal_signals.
4589         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4590         SIG_IGN.
4591         Reported by Paul Eggert.
4592
4593 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4594
4595         * getdate.y (textint): New member "negative".
4596         (time_zone_hhmm): New function.
4597         Expect 14 shift-reduce conflicts, not 13.
4598         (o_colon_minutes): New rule.
4599         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4600         (yylex): Set the "negative" member of signed numbers.
4601
4602 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4603
4604         Changes imported from coreutils.
4605         * hard-locale.c: Assume <locale.h> exists.
4606         Include "strdup.h".
4607         (GLIBC_VERSION): New macro.
4608         (hard_locale): Assume setlocale exists.
4609         Rewrite to avoid #ifdef.
4610         Use strdup rather than malloc + strcpy.
4611         * human.c: Assume <locale.h> exists.
4612         (human_readable): Assume localeconv exists.
4613
4614 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4615
4616         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4617         convert T2, not T.  (Imported from libc.)
4618
4619 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4620
4621         * getcwd.c (is_ENAMETOOLONG): New macro.
4622         (__getcwd.c): Don't restore errno; glibc doesn't.
4623         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4624         first, falling back to our code only if its results look suspicious.
4625         Ensure that the resulting buffer is only as large as necessary.
4626
4627         * readutmp.c: Include readutmp.h first.
4628         Include <errno.h>, since readutmp.h no longer does that.
4629         * readutmp.h: Don't include <errno.h>,
4630         <sys/param.h>, <time.h>; not needed to establish interface.
4631         (errno): Remove decl.
4632         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4633         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4634         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4635
4636 2004-11-28  Simon Josefsson  <jas@extundo.com>
4637
4638         * base64.h, base64.c: New file.
4639
4640 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4641
4642         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4643
4644 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4645
4646         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4647         HP's ANSI C compiler.
4648         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4649         Declaring int functions causes warnings on some modern systems and
4650         shouldn't be needed to compile on ancient ones.
4651         * same.c (MIN) [defined MIN]: Don't define, since it's already
4652         defined.
4653
4654         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4655         with the following changes.
4656         (__set_errno): Parenthesize properly.
4657         Include <stdbool.h>.
4658         (MIN, MAX, MATCHING_INO): New macros.
4659         (__getcwd): Define with prototype, not K&R form.
4660         Use heuristics to allocate default buffer on stack if possible.
4661         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4662         behavior, and to avoid the PATH_MAX limit when computing
4663         ../../../../...
4664         Use MATCHING_INO to compare inode number to file.
4665         Check for arithmetic overflow in size calculations.
4666         Fix bug in reallocation of dot array that caused getcwd to fail
4667         on directories nested deeper than 75.
4668         Be more careful about saving errno on error.
4669         Do not use realloc; use only free+malloc, as this is a bit
4670         more flexible and avoids a needless copy operation.
4671         Do not inspect st_dev and st_ino for symbolic links; POSIX
4672         doesn't specify the latter.
4673         Check for closedir errors.
4674         Avoid needless casts.
4675         Use "#ifdef weak_alias" around weak_alias, to be like other
4676         glibc code.
4677         The following changes to getcwd.c have effect only when used in
4678         gnulib; they have no effect inside glibc proper.
4679         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4680         as alloca isn't used.
4681         (alloca, __alloca): Likewise.
4682         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4683         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4684         unconditionally, as gnulib assumes C89 or better.
4685         Do not include <sys/param.h>.
4686         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4687         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4688         better.
4689         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4690         Include <dirent.h> in a way that is compatible with modern Autoconf.
4691         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4692         New macros, if not already defined.
4693         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4694         Use "_LIBC", not "defined _LIBC", for consistency.
4695         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4696         a mempcpy module.
4697         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4698         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4699         * xgetcwd.c: David MacKenzie's old code was removed, so give
4700         credit only to Jim Meyering and adjust the copyright dates.
4701         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4702         <stdlib.h>, <unistd.h>, "pathmax.h".
4703         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4704         (INITIAL_BUFFER_SIZE): Remove.
4705         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4706
4707 2004-11-23  Jim Meyering  <jim@meyering.net>
4708
4709         * getopt_.h: Remove trailing blanks.
4710
4711 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4712
4713         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4714         (futimens): New function, which uses futimes if available.
4715         (futimens, utimens): Support timespec==NULL, with same semantics
4716         as utime and utimens.
4717         * utimens.h (futimens): New decl.
4718
4719 2004-11-23  Jim Meyering  <jim@meyering.net>
4720
4721         * __fpending.c: Add comment.
4722
4723 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4724
4725         * getopt_.h: Re-addition of __getopt_argv_const caused
4726         redefinition warnings. To avoid them, include the defines
4727         in `#if !defined __need_getopt ... #endif'. The only place
4728         where __getopt_argv_const is used is in definitions
4729         of getopt_long and getopt_long_only below, which are as well
4730         protected by `#ifndef __need_getopt'.
4731         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4732         __need_getopt after including <stdio.h> and <unistd.h> These
4733         headers might have defined it.
4734
4735 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4736
4737         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4738         New macros.
4739         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4740         optopt): Use them instead of invoking ## directly; otherwise, the
4741         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4742
4743 2004-11-19  Bruno Haible  <bruno@clisp.org>
4744
4745         * strtok_r.c: Move comments from here...
4746         * strtok_r.h: ... to here.
4747
4748 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4749
4750         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4751         might fail.  Problem reported by Yoann Vandoorselaere.
4752         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4753         that mishandle size_t overflow.
4754
4755 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4756
4757         * canon-host.c: Include "strdup.h".
4758         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4759         Use strdup instead of malloc/strcpy to duplicate strings.
4760
4761         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4762         (human_space_before_unit): New constant.
4763         * human.c (human_readable): Support it.
4764
4765         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4766         (xgetcwd): Set errno correctly when failing.
4767         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4768         the failure is actually due to a PATH_MAX problem.
4769
4770         Further getopt changes to make it more likely that glibc will
4771         buy the changes back.
4772         * getopt.c (POSIXLY_CORRECT): New constant.
4773         (getopt): Use it, so to preserve glibc semantic
4774         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4775         when compiling for libc.
4776         * getopt_.h (__getopt_argv_const): Bring it back.
4777         (getopt_long, getopt_long_only): Use it.
4778
4779         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4780         New arg POSIXLY_CORRECT.  All callers changed.
4781         (getopt): Argv is now char * const *, as per standard.
4782         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4783         not char *__getopt_argv_const *.
4784         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4785         _getopt_long_only_r): Likewise.
4786         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4787         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4788         _getopt_long_r, _getopt_long_only_r): Likewise.
4789         * getopt_.h (__getopt_argv_const): Remove.
4790         (getopt): Argv is now char * const *, as per standard.
4791
4792         * getdate.y (tORDINAL): New token.
4793         (day, relunit): Allow it for relative times.
4794         (relative_time_table): Use tORDINAL for ordinals.
4795
4796 2004-11-15  Jim Meyering  <jim@meyering.net>
4797
4798         * closeout.c: Include "__fpending.h" once again.
4799         Include <stdbool.h>.
4800         (close_stdout): Don't fail just because stdout was closed initially,
4801         since some programs don't write to stdout in the normal course of
4802         operation (other than --version and --help), and we don't want this
4803         function to make e.g. `touch file >&-' fail.
4804         But do fail if it was closed and someone has tried to write to it.
4805         E.g., `printf foo >&-' must fail.
4806
4807 2004-11-11  Simon Josefsson  <jas@extundo.com>
4808
4809         * strtok_r.h, strtok_r.c: New file.
4810
4811 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4812
4813         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4814         we can stop lying to compilers about the constness of argv when we
4815         are compiled outside glibc.
4816         (getopt, getopt_long, getopt_long_only): Use it.
4817         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4818         getopt): Likewise.
4819         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4820         _getopt_long_only_r): Likewise.
4821         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4822         _getopt_long_only_r): Likewise.
4823
4824         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4825         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4826         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4827         the other external symbols.
4828         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4829         declaration, since the above renaming now works around collisions.
4830
4831 2004-11-11  Jim Meyering  <jim@meyering.net>
4832
4833         * linebreak.c: Remove trailing blanks.
4834         * alloca_.h: Likewise.
4835         * acosl.c: Likewise.
4836         * euidaccess.c: Likewise.
4837         * allocsa.h: Likewise.
4838
4839 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4840
4841         * mktime.c (SHR): New macro, which is a portable
4842         substitute for >> that should work even on Crays.
4843         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4844         Problem reported by Mark D. Baushke in
4845         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4846         * getdate.y (SHR): Likewise.
4847         (tm_diff): Use it.
4848         * strftime.c (SHR): Likewise.
4849         (tm_diff): Use it.
4850         * quotearg.c (struct quoting_options): Use unsigned int for
4851         quote_these_too, so that right shifts are well defined.  All uses
4852         changed.
4853
4854 2004-11-10  Simon Josefsson  <jas@extundo.com>
4855
4856         * getaddrinfo.h, getaddrinfo.c: New files.
4857
4858 2004-11-10  Jim Meyering  <jim@meyering.net>
4859
4860         Ensure that no close failure goes unreported.
4861         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4862         return early when it seems there's nothing to flush.
4863         Don't include __fpending.h.
4864
4865 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4866
4867         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4868
4869 2004-11-05  Bruno Haible  <bruno@clisp.org>
4870
4871         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4872         Reported by Mark D. Baushke <mdb@cvshome.org>.
4873
4874 2004-11-04  Bruno Haible  <bruno@clisp.org>
4875
4876         2004-09-11  Bruno Haible  <bruno@clisp.org>
4877                 * allocsa.valgrind: New file.
4878         2004-02-06  Bruno Haible  <bruno@clisp.org>
4879                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4880                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4881                 Reported by Christopher Seip <chris.seip@hp.com>.
4882
4883 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4884
4885         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4886         with errno == ERANGE if the buffer is too small.
4887         Problem reported by Mark D. Baushke.
4888
4889 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4890
4891         * xreadlink.c (MAXSIZE): New macro.
4892         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4893         size does not exceed MAXSIZE.  Avoid cast.
4894         As suggested by Mark D. Baushke in
4895         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4896         if readlink fails with buffer size just under MAXSIZE, try again
4897         with MAXSIZE.
4898
4899 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4900         and  Paul Eggert  <eggert@cs.ucla.edu>
4901
4902         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4903         (get_date): Overparenthesize to avoid GCC warning.
4904
4905 2004-11-02  Bruno Haible  <bruno@clisp.org>
4906
4907         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4908         function returns void.
4909
4910 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4911
4912         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4913         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4914         already declared.
4915
4916 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4917
4918         * getdate.y: Add support for TZ="foo" within a date string.
4919         Fix some bugs near time_t boundaries.  Reject dates with
4920         out-of-range components, e.g., "Sept 31".
4921         Include <stdlib.h>, "setenv.h", "xalloc.h".
4922         (ISDIGIT_LOCALE): Remove; unused.
4923         Note that the TZ and time functions used here are not reentrant.
4924         (mktime_ok, get_tz): New functions.
4925         (TZBUFSIZE): New constant.
4926         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4927         This requires that we sometimes generate our own TZ="XXX..." setting.
4928
4929 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4930
4931         * mktime.c (not_equal_tm): Remove redundant check.
4932
4933 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4934
4935         * getdate.y: Use Bison 1.875 features, and some minor
4936         code cleanups.  This change does not affect semantics.
4937         Don't include <stdlib.h>; no longer needed.
4938         Don't include unlocked-io.h; only the "#if TEST" code uses
4939         stdio, and performance isn't crucial there.
4940         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4941         Bison 1.875 features as described below.
4942         All uses of "PC." replaced by "pc->".
4943         (YYSTYPE): Add a forward declaration.
4944         (yylex, yyerror): Use full prototypes in forward decls.
4945         Use "%pure-parser" rather than obsolescent "%pure_parser".
4946         Use %parse-param and %lex-param instead of obsolescent
4947         YYPARSE_PARAM and YYLEX_PARAM.
4948         (meridian_table, month_and_day_table, time_units_table,
4949         relative_time_table, time_zone_table, military_table,
4950         lookup_zone, lookup_word, get_date):
4951         Use NULL instead of 0 where appropriate.
4952         (to_hour): Avoid abort (), to avoid a dependency on
4953         stdlib.h.
4954         (yyerror, yylex): Now accepts parser_control * arg.
4955         (main) [TEST]: Use '\0' rather than 0 for char.
4956
4957 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4958
4959         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4960         It's now the caller's responsibility to handle the case where
4961         !HAVE_GETPAGESIZE && !defined getpagesize.
4962
4963         * mktime.c (leapyear): Arg is long int, not int.
4964
4965 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4966
4967         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4968
4969 2004-10-12  Simon Josefsson  <jas@extundo.com>
4970
4971         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4972         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4973         to real functions.
4974
4975 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4976
4977         * vsnprintf.h: New file.
4978         * vsnprintf.c: New file.
4979
4980 2004-10-07  Bruno Haible  <bruno@clisp.org>
4981
4982         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4983         into the provided buffer.
4984
4985 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4986
4987         * diacrit.c, diacrit.h: Add GPL notice.
4988
4989         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4990         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4991         * logl.c (logl): Keep the code as similar to glibc as possible.
4992         This avoids a potential constant-folding bug.
4993
4994 2004-10-05  Bruno Haible  <bruno@clisp.org>
4995
4996         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4997
4998 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4999
5000         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
5001         * xmalloc.c (xmemdup): Likewise.
5002         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5003         XFREE): Remove these long-obsolescent macros.
5004         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5005         * xstrdup.c: Remove.
5006
5007         * regex.c (re_comp): Cast gettext return value to char *,
5008         Problem reported by Martin Neitzel via Mark D. Baushke.
5009
5010 2004-10-04  Simon Josefsson  <jas@extundo.com>
5011
5012         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5013         '#ifdef USE_UNLOCKED_IO'.
5014
5015 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
5016
5017         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5018         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5019         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5020         regex.c, sha1.c, version-etc.c, yesno.c:
5021         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5022         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5023         the includer's responsibility.
5024
5025         Sync from coreutils.
5026
5027         * modechange.c (mode_compile): Don't decrement a pointer that
5028         points to the start of a string, as the C Standard says the
5029         resulting behavior is undefined.
5030
5031         * backupfile.h (enum backuptype): Rename none -> no_backups,
5032         simple -> simple_backups, numbered_existing ->
5033         numbered_existing_backups, numbered -> numbered_backups
5034         to avoid shadowing problems.  All uses changed.
5035         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5036         * backupfile.c (check_extension, numbered_backup):
5037         Rename locals to avoid shadowing 'basename'.
5038         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5039         once.
5040
5041         * .cppi-disable: Add getopt_.h, getopt_int.h.
5042         * .cvsignore: Add getopt.h.
5043
5044 2004-10-04  Simon Josefsson  <jas@extundo.com>
5045
5046         * memmem.h: New file.
5047         * memmem.c: New file, taken from glibc.
5048
5049 2004-10-02  Jim Meyering  <jim@meyering.net>
5050
5051         * dirfd.h, getpagesize.h: Add copyright notice.
5052
5053 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5054
5055         * snprintf.c: Remove comments as to why each header is needed.
5056
5057 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5058
5059         * strsep.h: New file.
5060         * strsep.c: New file.
5061
5062 2004-10-01  Simon Josefsson  <jas@extundo.com>
5063
5064         * snprintf.c (snprintf): Handle size==0.
5065
5066 2004-10-01  Simon Josefsson  <jas@extundo.com>
5067             Bruno Haible  <bruno@clisp.org>
5068
5069         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5070         (snprintf): Declare 'args'.
5071
5072 2004-09-30  Simon Josefsson  <jas@extundo.com>
5073
5074         * snprintf.h, snprintf.c: New files.
5075
5076 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5077
5078         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5079         (hol_entry_help): Never translate an empty string.
5080         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5081         * argp.h (OPTION_NO_TRANS): New option.
5082
5083 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5084
5085         * xvasprintf.c: Include xalloc.h.
5086         (xvasprintf): Use xalloc_die, not xmalloc_die.
5087
5088 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5089
5090         * dummy.c: Change copyright notice to FSF, and license to GPL.
5091
5092 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5093
5094         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5095         Problem reported by Bruno Haible in:
5096         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5097
5098 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5099
5100         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5101         in case some system header has #define'd it.  Problem reported by
5102         Soeren D. Schulze in
5103         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5104
5105 2004-09-08  Bruno Haible  <bruno@clisp.org>
5106
5107         * stdint_.h: New file, taken from GNU clisp.
5108
5109 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5110
5111         * xvasprintf.h: New file.
5112         * xvasprintf.c: New file.
5113         * xasprintf.c: New file.
5114
5115 2004-09-08  Bruno Haible  <bruno@clisp.org>
5116
5117         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5118         is > INT_MAX.
5119         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5120
5121 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5122
5123         Import from coreutils.
5124         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5125         strings on unbounded length.  alloca's performance benefits aren't
5126         that important here.
5127         (V_STRDUP): Remove.
5128         (parse_with_separator): New function, with most of the internals
5129         of the old parse_user_spec.  Allow user to omit both user and group,
5130         for compatibility with FreeBSD.
5131         Clone only the user name, not the entire spec.
5132         Do not set *uid, *gid unless entirely successful.
5133         Avoid memory leak in some failing cases.
5134         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5135         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5136         (parse_user_spec): Rewrite to use parse_with_separator.
5137
5138 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5139
5140         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5141         its complicated substitute.
5142         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5143         and program_invocation_name.
5144         (__argp_basename) [!_LIBC]: Remove; the only use was
5145         replaced by its body.
5146         (__argp_short_program_name): Change condition from
5147         !defined __argp_short_program_name to
5148         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5149         to match argp-namefrob.h.
5150         (__argp_failure): Don't assume strerror_r returns char *.
5151         * argp-parse.c (N_): Define unconditionally.
5152         (argp_default_options): Fill out initializers with 0 to avoid
5153         gcc warnings.
5154
5155 2004-08-12  Simon Josefsson  <jas@extundo.com>
5156
5157         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5158         * getopt_.h: Renamed from getopt.h.
5159
5160 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5161
5162         Merge from coreutils.
5163
5164         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5165         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5166         for Reliant Unix 5.43.
5167
5168         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5169         (union fooround): Use uintmax_t, not long int.
5170         The rest is a merge from libc:
5171         [defined _LIBC]: Include <shlib-compat.h>.
5172         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5173
5174         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5175
5176         * strverscmp.c: Convert to UTF-8.
5177
5178 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5179
5180         * obstack.h (obstack_empty_p):
5181         Don't assume that chunk->contents is suitably aligned.
5182         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5183         Likewise. Problem reported by Benno in
5184         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5185
5186         * chown.c (rpl_chown): Work even if the file is writeable but not
5187         readable.  This could be improved further but it'd take some work.
5188
5189 2004-08-08  Simon Josefsson  <jas@extundo.com>
5190
5191         * xgethostname.c: Don't include error.h (not used).
5192
5193         * getpass.h: Add.
5194         * getpass.c: Include getpass.h first.
5195
5196 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5197
5198         * xalloc-die.c: New files.
5199         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5200         All uses removed.
5201         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5202         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5203         (_, N_, xalloc_die): Move to xalloc-die.c.
5204         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5205         so that we needn't mess with xalloc_msg_memory_exhausted.
5206
5207         * sha1.h: Renamed from sha.h.
5208         (SHA1_H): Renamed from _SHA_H.
5209         (sha1_ctx): Renamed from sha_ctx.
5210         (sha1_init_ctx): Renamed from sha_init_ctx.
5211         (sha1_process_block): Renamed from sha_process_block.
5212         (sha1_process_bytes): Renamed from sha_process_bytes.
5213         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5214         (sha1_read_ctx): Renamed from sha_read_ctx.
5215         (sha1_stream): Renamed from sha_stream.
5216         (sha1_buffer): Renamed from sha_buffer.
5217         * sha1.c: Likewise; renamed from sha.c.
5218         Do not include <sys/types.h>.
5219         Include <stddef.h> rather than <stdlib.h>.
5220
5221 2004-08-08  Bruno Haible  <bruno@clisp.org>
5222
5223         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5224         FILESYSTEM_PREFIX_LEN.
5225         * progreloc.c: Likewise.
5226         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5227
5228 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5229
5230         Merge from tar.
5231         * argp-help.c (make_hol, hol_append): Don't assume that
5232         SIZE_MAX is a valid preprocessor constant.
5233         (__argp_basename): Change from "#ifndef _LIBC"
5234         to "#ifndef __argp_short_program_name", so that
5235         we don't compile these functions for tar.
5236
5237         More merges from coreutils.
5238         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5239         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5240         yesno.h: New files.
5241         * addext.c: Remove; no longer needed.
5242         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5243         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5244         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5245         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5246         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5247         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5248         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5249         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5250         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5251         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5252         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5253         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5254         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5255         Import changes from coreutils.
5256
5257 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5258
5259         Merge from coreutils.
5260
5261         * .gdb-history: Remove; this doesn't belong here.
5262
5263         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5264         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5265         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5266
5267         * dirname.h: Include <stdbool.h>.
5268         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5269         for consistency with POSIX terminology.  All uses changed.
5270         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5271         (strip_trailing_slashes): Use bool for booleans.
5272         * stripslash.c (strip_trailing_slashes): Likewise.
5273
5274         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5275         sometimes returns a positive errno value even when it succeeds.
5276         (print_errno_message) [!LIBC]: Fall back on strerror if
5277         __strerror_r fails.
5278
5279         * path-concat.c (mempcpy): Don't define if a system header defines it.
5280         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5281         (longest_relative_suffix): New function.
5282         (path_concat): Use it.  Assume first argument is not NULL.
5283         Port to DOS.  Omit redundant separators.
5284         Report an error instead of returning NULL.
5285         Use mempcpy instead of memcpy.
5286         (xpath_concat): Remove: not declared or used.
5287
5288         * same.h: Include <stdbool.h>
5289         (same_name): Return bool, not int.
5290         * same.c (same_name): Likewise.
5291         (errno): Don't declare; we assume C89 or better now.
5292
5293         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5294         if not already defined.
5295
5296         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5297         * dup-safer.c (errno): Likewise.
5298
5299 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5300
5301         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5302         working.
5303
5304 2004-08-03  Simon Josefsson  <jas@extundo.com>
5305
5306         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5307         * progname.h: Don't include stdbool.h.
5308
5309 2004-08-02  Simon Josefsson  <jas@extundo.com>
5310
5311         * getsubopt.h: New file, with comments from Bruno Haible.
5312         * getsubopt.c: New file, from glibc, but slightly modified based on
5313         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5314
5315 2004-08-01  Simon Josefsson  <jas@extundo.com>
5316
5317         * xgetdomainname.c: Include stdlib.h, for free().
5318
5319 2004-07-16  Simon Josefsson  <jas@extundo.com>
5320
5321         * dummy.c: New file.
5322
5323 2004-07-16  Bruno Haible  <bruno@clisp.org>
5324
5325         * backupfile.h: Add extern "C" for C++.
5326         * closeout.h: Likewise.
5327         * copy-file.h: Likewise.
5328         * findprog.h: Likewise.
5329         * full-write.h: Likewise.
5330         * pathname.h: Likewise.
5331         * progname.h: Likewise.
5332         * stpcpy.h: Likewise.
5333         * stpncpy.h: Likewise.
5334         * strcase.h: Likewise.
5335         * strstr.h: Likewise.
5336         * xalloc.h: Likewise.
5337
5338         * mbswidth.h: Add extern "C" for C++.
5339         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5340
5341 2004-07-09  Simon Josefsson  <jas@extundo.com>
5342
5343         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5344         failed without this.)
5345
5346 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5347
5348         * fchown-stub.c: New file.
5349
5350 2004-06-24  Jim Meyering  <jim@meyering.net>
5351
5352         * obstack.h (obstack_base): Cast to (void *), per documentation.
5353
5354 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5355
5356         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5357
5358 2004-06-01  Jim Meyering  <jim@meyering.net>
5359
5360         * calloc.c: New file.
5361
5362 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5363
5364         * getdate.y (yylex): Allow space between sign and number.
5365         Problem reported by Dan Jacobson.
5366
5367 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5368         and  Jim Meyering  <jim@meyering.net>
5369
5370         Merge from coreutils CVS.
5371
5372         * stat-macros.h: New file, with contents from file-type.h
5373         and coreutils' system.h.
5374         * file-type.c: Include "stat-macros.h".
5375         * file-type.h (file_type): Move all macro definitions to new file,
5376         stat-macros.h.
5377
5378         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5379         Wrap old code with this conditional.
5380         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5381         function that does not dereference symlinks.
5382         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5383
5384         * xreadlink.c: Include xreadlink.h first, to catch .h file
5385         dependency problems.
5386         (xreadlink): Accept new arg SIZE, for efficiency.
5387         All decls and uses changed.
5388         * xreadlink.h: Include <stddef.h>, for size_t.
5389
5390         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5391         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5392
5393         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5394
5395 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5396
5397         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5398         macros to be defined.
5399         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5400         the allocator returns NULL because the requested size is zero.
5401
5402 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5403
5404         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5405         var.  Add comment explaining why libc still defines it.  This
5406         merges the following patch from glibc:
5407         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5408
5409 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5410
5411         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5412         present in glibc since revision 1.1 of this file.
5413         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5414         obstack_alignment_mask, obstack_alloc, obstack_base,
5415         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5416         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5417         obstack_grow0, obstack_init, obstack_int_grow,
5418         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5419         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5420         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5421         nonexistent functions.
5422
5423 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5424             Paul Eggert  <eggert@cs.ucla.edu>
5425
5426         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5427
5428 2004-05-14  Bruno Haible  <bruno@clisp.org>
5429
5430         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5431         that consists of a '.' followed by an empty digit string.
5432         Patch by Tor Lillqvist <tml@iki.fi>.
5433
5434 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5435
5436         Port obstack to the AS/400, where pointers are 16 bytes wide and
5437         you cannot cast an integer to a valid pointer.  This patch is
5438         currently waiting to be integrated into glibc; see
5439         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5440
5441         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5442         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5443         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5444         (struct obstack): temp member is now a union of a pointer and
5445         an integer, instead of an integer.  All integer uses changed.
5446         This does not affect the physical layout of struct obstack,
5447         except on hosts (like the AS/400) where the size or alignment of
5448         void * is greater than that of ptrdiff_t.
5449         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5450         __STDC__)]: Store temporary in pointer member of union, not
5451         integer member.
5452         * obstack.c: Include <stddef.h>, for offsetof.
5453         (struct fooalign): Remove; it doesn't need a name.
5454         (union fooround): Change double to long double, and add void *.
5455         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5456         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5457         not a macro.  Hence the values are always int; so remove all
5458         casts-to-int in uses.
5459
5460 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5461             Derek Price  <derek@ximbiot.com>
5462
5463         * alloca.c: Include <alloca.h>, to get our interface.
5464         * alloca_.h: Use __alloca on AIX, so that we don't have to
5465         include <alloca.h> first.  Use C89 prototype for alloca; this
5466         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5467         Use #elif for simplicity, since we can assume C89 now.
5468         Don't try to source the system alloca.h since it will not be found
5469         and to prevent recursively including its replacement.
5470         * fnmatch.c: Include <alloca.h> instead of opencoding.
5471         * regex.c: Likewise.
5472
5473 2004-05-16  Derek Price  <derek@ximbiot.com>
5474             Paul Eggert  <eggert@cs.ucla.edu>
5475
5476         getline cleanup.  This changes the getndelim2 API: both order of
5477         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5478         no delimiter).
5479
5480         * getline.c: Don't include stddef.h or stdio.h, since our
5481         interface does that.
5482         (getline): Always use getdelim, so that we don't have two
5483         copies of this code.
5484         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5485         if available.
5486         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5487         (GETNDELIM2_MAXIMUM): New macro.
5488         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5489         instead of the old practice of delim2==0.  All callers changed.
5490         Return -1 on overflow, instead of returning junk.
5491         Do not set *linesize unless allocation succeeds.
5492         * getndelim2.h: Do not include stddef.h; no longer needed, now
5493         that we include sys/types.h.
5494         * getnline.h: Likewise.
5495         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5496         (getndelim2): Reorder arguments.
5497         * getnline.c (getnline, getndelim):
5498         Don't discard the NMAX argument.
5499         (getnline): Invoke getndelim, to avoid code duplication.
5500         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5501         of (size_t) -1 by callers of the getnline family.
5502
5503 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5504
5505         * nanosleep.c (suspended): Change its type from int to
5506         sig_atomic_t volatile.
5507         (first_call): Make it private to rpl_nanosleep, and have it
5508         be zero initially as that's a bit faster.
5509         (my_usleep): Round up fractional times instead of truncating them,
5510         as this is the usual meaning for 'sleep'.
5511
5512         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5513         doesn't work.
5514         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5515         (ENOSYS): Define if not defined.
5516         (settime): Fall back on stime if it exists and settimeofday fails.
5517         But don't bother with fallbacks if a method fails with errno == EPERM.
5518
5519 2004-05-11  Jim Meyering  <jim@meyering.net>
5520
5521         Prior to this change, the save_cwd caller required read access to the
5522         current directory on most systems (ones with the fchdir function).
5523
5524         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5525         fails, try write-only, and finally, resort to using xgetcwd.
5526
5527 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5528
5529         * obstack.c, obstack.h: Import changes from libc.
5530
5531 2004-04-28  Bruno Haible  <bruno@clisp.org>
5532
5533         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5534         implicitly appends .exe to executables.
5535         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5536         accepts Windows pathnames.
5537         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5538         Cygwin like Windows, since it now accepts Windows pathnames.
5539         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5540         Cygwin like Windows, since it now accepts Windows pathnames.
5541         Reported by Derek Robert Price <derek@ximbiot.com>.
5542
5543 2004-04-20  Jim Meyering  <jim@meyering.net>
5544
5545         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5546
5547 2004-04-20  Jim Meyering  <jim@meyering.net>
5548             Bruno Haible  <bruno@clisp.org>
5549
5550         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5551         memory when realloc fails.
5552
5553 2004-04-18  Jim Meyering  <jim@meyering.net>
5554
5555         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5556         don't leak memory and do call END_UTMP_ENT.
5557
5558 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5559
5560         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5561         (CHAR_BIT): Remove, since we assume C89.
5562         Include <stdint.h> if available, as per current Autoconf CVS advice.
5563
5564 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5565
5566         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5567         not bool, to be more consistent with Unix conventions.
5568         Suggested by Bruno Haible.
5569
5570         Merge from coreutils.
5571
5572         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5573         New files.
5574
5575         * getdate.h: Include stdbool.h, and timespec.h instead of
5576         the usual <time.h> dance.
5577         (get_date): Change signature to support fractional time stamps.
5578         All callers changed.
5579         * getdate.y: Include "getdate.h" first, as we can now
5580         assume C89 and don't need to worry about 'const'.
5581         Similarly, include "unlocked-io.h" near start, not in middle.
5582         Include <limits.h>.
5583         (textint.value): Use long int rather than int.
5584         (textint.digits): Use size_t rather than int.
5585         (BILLION, LOG10_BILLION): New constants.
5586         (parser_control): New member rel_ns.  Members day_ordinal,
5587         time_zone, month, day, hour, minutes, rel_year, rel_month,
5588         rel_day, rel_hour, rel_minutes, rel_seconds
5589         are now long int, not int.  Member seconds is now struct timespec,
5590         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5591         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5592         not int.
5593         (%union.intval): Now long int, not int.
5594         New member timespec.
5595         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5596         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5597         (spec): Now is a timespec or an item list.
5598         (timespec, items): New nonterminals.
5599         (time, rel, relunit, number, get_date):
5600         Add support for fractional seconds.
5601         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5602         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5603         (to_hour): First arg is now long int, not int.
5604         (to_year): Returns long int, not int.
5605         Don't treat year -70 like 70.
5606         (tm_diff): Returns long int, not int.
5607         (lookup_word): Use bool instead of int when appropriate.
5608         (yylex): Use size_t for count, not int.
5609         Detect overflow when parsing large integer constants.
5610         Add support for fractions.
5611         (get_date): Make pointers 'const' if possible.
5612         Use more-portable code to detect integer overflow.
5613         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5614         Don't use ctime; it's not reliable if the year has >4 digits.
5615
5616         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5617         This is for compatibility with BSD.
5618
5619         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5620         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5621         From coreutils' system.h.
5622
5623         * userspec.c: Don't include "posixver.h".
5624         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5625         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5626         compatible extension.  Simplify code by removing a boolean int
5627         that was always nonzero if a string was nonnull.
5628
5629 2004-03-30  Jim Meyering  <jim@meyering.net>
5630
5631         Merge from coreutils.
5632
5633         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5634
5635         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5636         an empty input stream.
5637
5638         * readtokens.c: Include <stdbool.h>.
5639         (readtoken): Use `size_t' rather than int/long.
5640         All callers adjusted.
5641         Use `bool' rather than `int' where appropriate.
5642         Use memset rather than an explicit loop.
5643         Use x2nrealloc rather than xrealloc.
5644         Allow the use of `\0' as a delimiter.
5645         (readtokens): Likewise.
5646         * readtokens.h (readtoken, readtokens): Update prototypes.
5647
5648 2004-03-30  Bruno Haible  <bruno@clisp.org>
5649
5650         * getloadavg.c (getloadavg): Don't assume setlocale returns
5651         nonnull.
5652
5653 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5654
5655         Merge changes to getloadavg.c from coreutils and Emacs.
5656
5657         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5658         Define to an expression, not to the empty string.
5659         Include cloexec.h and xalloc.h.
5660         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5661         Use set_cloexec_flag rather than rolling our own.
5662         * cloexec.c, cloexec.h: New files.
5663
5664 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5665
5666         * getopt.h: Sync with libc CVS.
5667
5668 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5669             Bruno Haible  <bruno@clisp.org>
5670
5671         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5672         not on all platforms that have <wchar.h>.
5673         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5674
5675 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5676
5677         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5678         Sync with libc CVS.
5679         * getopt_int.h: New file, also synced from libc.
5680
5681 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5682
5683         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5684         '#if' expressions.  Unlike the code it replaces, it does not
5685         depend on (defined _SC_PAGESIZE).  However, it does depend on
5686         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5687         first reported by Jason Andrade in
5688         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5689
5690 2004-01-18  Simon Josefsson  <jas@extundo.com>
5691
5692         * strdup.h: New file.
5693         * strdup.c: Include it.
5694         * path-concat.c: Include strdup.h. Drop strdup declaration.
5695         * userspec.c: Include strdup.h. Drop strdup declaration.
5696
5697 2004-02-06  Karl Berry  <karl@gnu.org>
5698
5699         * config.charset: update from gettext 0.14.1.
5700
5701 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5702
5703         Add comments and code, prompted by suggestions from Bruno Haible
5704         for sh-quote.
5705         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5706         describing the enum quoting_style values.
5707         * quotearg.c (quotearg_alloc): New function.
5708         (quotearg_buffer_restyled): Treat lone { and } as special.
5709         Treat = as special.  Work around bug with older shells
5710         that "see" a '\' that is really the 2nd byte of a multibyte char.
5711         Quote empty string with shell_quoting_style.
5712
5713 2004-02-03  Bruno Haible  <bruno@clisp.org>
5714
5715         * pipe.h: New file, from GNU gettext.
5716         * pipe.c: New file, from GNU gettext.
5717
5718 2004-01-27  Bruno Haible  <bruno@clisp.org>
5719
5720         * execute.h: New file, from GNU gettext.
5721         * execute.c: New file, from GNU gettext.
5722         * w32spawn.h: New file, from GNU gettext.
5723
5724 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5725
5726         Exit-status fix from coreutils.
5727
5728         Use exit_failure consistently in place of EXIT_FAILURE,
5729         so that program exit statuses are consistent on failure.
5730
5731         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5732         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5733         * argmatch.h: Comment fix to match the above.
5734         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5735         Now a macro referring to exit_failure, instead of a separate
5736         variable.  Include "exitfail.h" to get it.
5737         * xstrtol.h: Include "exitfail.h".
5738         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5739
5740         * long-options.c (parse_long_options): Use prototype
5741         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5742         for clarity.
5743
5744 2004-01-21  Jim Meyering  <jim@meyering.net>
5745
5746         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5747         so as not to conflict with a different-sized __mktime_internal
5748         function in GNU libc.
5749         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5750         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5751
5752 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5753
5754         Merge from diffutils.
5755
5756         * file-type.c (file_type): Add typed memory objects.
5757         * file-type.h (S_TYPEISTMO): New macro.
5758
5759         * c-stack.h (c_stack_action): Remove argv argument.
5760         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5761         (die): Don't calculate message unless segv_action returns.
5762         (get_stack_location, min_address_from_argv, max_address_from_argv,
5763         volatile stack_base, volatile_stack_size): Remove.
5764         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5765         that every segmentation violation is a stack overflow.  (Ouch!)
5766         See Debian bug 136249 (still outstanding) for more info about why
5767         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5768
5769 2003-11-30  Bruno Haible  <bruno@clisp.org>
5770
5771         Safer stack allocation.
5772         * setenv.c: Include allocsa.h.
5773         (alloca): Remove fallback definition.
5774         (freea): Remove macro.
5775         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5776         instead of freea.
5777
5778 2003-10-17  Bruno Haible  <bruno@clisp.org>
5779
5780         * binary-io.h: Avoid warnings on Cygwin.
5781
5782 2003-12-28  Bruno Haible  <bruno@clisp.org>
5783
5784         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5785         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5786
5787 2003-11-28  Bruno Haible  <bruno@clisp.org>
5788
5789         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5790
5791 2003-11-27  Bruno Haible  <bruno@clisp.org>
5792
5793         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5794
5795 2003-11-17  Bruno Haible  <bruno@clisp.org>
5796
5797         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5798
5799 2003-11-24  Bruno Haible  <bruno@clisp.org>
5800
5801         * xallocsa.h: New file, from GNU gettext.
5802         * xallocsa.c: New file, from GNU gettext.
5803
5804 2003-11-24  Bruno Haible  <bruno@clisp.org>
5805
5806         * allocsa.h: New file, from GNU gettext.
5807         * allocsa.c: New file, from GNU gettext.
5808
5809 2003-11-24  Bruno Haible  <bruno@clisp.org>
5810
5811         * eealloc.h: New file.
5812
5813 2004-01-15  Jim Meyering  <jim@meyering.net>
5814
5815         Merge from coreutils.
5816
5817         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5818         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5819         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5820
5821         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5822         optional configure-time default.
5823
5824         * version-etc.c (version_etc_copyright): Update copyright date.
5825
5826         * xreadlink.c (xreadlink): Correct outdated comment.
5827
5828 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5829
5830         Merge from coreutils.
5831
5832         * posixver.c: Include posixver.h.
5833
5834         * same.c: Include <stdbool.h>, <limits.h>.
5835         (_POSIX_NAME_MAX): Define if not defined.
5836         (MIN): New macro.
5837         (same_name): If file names are silently truncated, report
5838         that the file names are the same if they are the same after
5839         the silent truncation.
5840
5841         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5842         conversion function.
5843         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5844         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5845         longer needed.
5846
5847 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5848
5849         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5850         with like-named macro in fnmatch.c.
5851         (EXT): Use an internal constant instead.
5852
5853         Merge fnmatch patches from glibc.
5854         * fnmatch.c (mbsinit): Remove define.
5855         Add libc_hidden_ver (__fnmatch, fnmatch).
5856         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5857         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5858
5859 2003-12-14  Karl Berry  <karl@gnu.org>
5860
5861         * config.charset: update from gettext-runtime.
5862
5863 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5864
5865         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5866         Bug reported by Alfred M. Szmidt.
5867
5868 2003-11-29  Karl Berry  <karl@gnu.org>
5869
5870         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5871
5872 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5873             Bruno Haible  <bruno@clisp.org>
5874
5875         * printf-parse.h: Don't include sys/types.h.
5876         (ARG_NONE): New macro.
5877         (char_directive): Change type of *arg_index fields to size_t.
5878         * printf-parse.c: Don't include sys/types.h.
5879         (SSIZE_MAX): Remove macro.
5880         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5881         Remove unnecessary overflow check.
5882         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5883         fields.
5884
5885 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5886
5887         * alloca.c: Remove dependency on xalloc module.
5888         (xalloc_die): Remove.
5889         (memory_full) [!defined emacs]: New macro.
5890         [!defined emacs]: Don't include xalloc.h.
5891         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5892         address arithmetic overflows.  Change datatypes a bit to avoid
5893         unnecessary casts.
5894
5895 2003-11-22  Jim Meyering  <jim@meyering.net>
5896
5897         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5898
5899 2003-11-17  Bruno Haible  <bruno@clisp.org>
5900
5901         * vasnprintf.c (alloca): Remove fallback definition.
5902         (freea): Remove definition.
5903         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5904         Reported by Paul Eggert.
5905
5906 2003-11-17  Jim Meyering  <jim@meyering.net>
5907
5908         On systems without utime and without a utimes function capable of
5909         dealing with a NULL struct utimbuf* argument, this utime replacement
5910         could -- in unusual circumstances -- leak a file descriptor.
5911         * utime.c: Include <unistd.h> and <errno.h>.
5912         (utime_null): Be sure to close `fd' and to preserve errno.
5913         Reported by Geoff Collyer via Arnold Robbins.
5914
5915 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5916             Bruno Haible  <bruno@clisp.org>
5917
5918         Protect against address arithmetic overflow.
5919         * printf-args.h: Include stddef.h.
5920         (arguments): Change type of field 'count' to size_t.
5921         * printf-args.c (printf_fetchargs): Use size_t instead of
5922         'unsigned int' where appropriate.
5923         * printf-parse.h: Include sys/types.h.
5924         (char_directive): Change type of *arg_index fields to ssize_t.
5925         (char_directives): Change type of fields 'count', max_*_length to
5926         size_t.
5927         * printf-parse.c: Include sys/types.h and xsize.h.
5928         (SSIZE_MAX): Define fallback value.
5929         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5930         instead of 'int' where appropriate. Check a_allocated, d_allocated
5931         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5932         * vasnprintf.c: Include xsize.h.
5933         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5934         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5935         overflow. Avoid wraparound when converting a width or precision from
5936         decimal to binary.
5937
5938 2003-11-16  Bruno Haible  <bruno@clisp.org>
5939
5940         Update from GNU gettext.
5941         * printf-parse.c: Generalize to it can be compiled for wide strings.
5942         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5943         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5944         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5945         SNPRINTF): New macros.
5946         Don't include <alloca.h> if the file is used inside libintl.
5947         (local_wcslen): New function, for Solaris 2.5.1.
5948         (VASNPRINTF): Use it instead of wcslen.
5949
5950 2003-11-16  Bruno Haible  <bruno@clisp.org>
5951
5952         * xsize.h (xmax): New function.
5953         (xsum, xsum3, xsum4): Declare as "pure" functions.
5954
5955 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5956
5957         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5958         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5959         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5960         heuristic is just as accurate as far as we know, and it removes a
5961         dependency on size_max.m4 and ptrdiff_max.m4.
5962
5963 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5964
5965         * xstrtol.c (__xstrtol): Remove "break" immediately after
5966         "return", to pacify some unknown compiler.  Problem reported
5967         by Joerg Schilling.
5968
5969 2003-11-11  Bruno Haible  <bruno@clisp.org>
5970
5971         * xsize.h (SIZE_MAX): Remove fallback definition.
5972         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5973         defined.
5974
5975 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5976
5977         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5978         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5979         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5980         From Bruno Haible.
5981         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5982         not (size_t) -1, since it's defined here.
5983
5984 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5985
5986         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5987         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5988         Reject sizes of exactly SIZE_MAX bytes.
5989         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5990         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5991
5992 2003-11-05  Bruno Haible  <bruno@clisp.org>
5993
5994         * xsize.h: Include limits.h, to avoid a possible collision with
5995         SIZE_MAX defined in <limits.h> on Solaris.
5996
5997 2003-11-04  Bruno Haible  <bruno@clisp.org>
5998
5999         * xsize.h: New file.
6000         * linebreak.c: Include xsize.h.
6001         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6002         argument for overflow.
6003         Suggested by Paul Eggert.
6004
6005 2003-10-31  Bruno Haible  <bruno@clisp.org>
6006
6007         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6008         to avoid (extremely rare) race condition.
6009         Suggested by Paul Eggert.
6010
6011 2003-11-03  Jim Meyering  <jim@meyering.net>
6012
6013         * userspec.c: Include "userspec.h".
6014         * userspec.h: New file.
6015
6016 2003-10-31  Paul Eggert  <eggert@twinsun.com>
6017
6018         * mountlist.h (struct mount_entry.me_type_malloced): New member.
6019         * mountlist.c (SIZE_MAX): Define if not defined already.
6020         (read_filesystem_list): Set and use me_type_malloced.
6021         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6022         whatever the type happens to be), for brevity and consistency.
6023         Check for size calculation overflow on Alphas running OSF/1.
6024
6025 2003-10-31  Jim Meyering  <jim@meyering.net>
6026
6027         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6028
6029         * linebuffer.c: Include <string.h> for declaration of memset.
6030
6031 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6032             Bruno Haible  <bruno@clisp.org>
6033
6034         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6035         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6036
6037 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6038
6039         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6040         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6041         no longer needed.
6042         * quotearg.c (quotearg_n_options): Use it.
6043         * group-member.c: Include <stdbool.h>.
6044         (free_group_info): Arg is now const *; don't free arg.
6045         (get_group_info): Now returns bool and accepts struct group_info *,
6046         rather than returning a malloc'ed struct group_info *.
6047         All uses changed.  Check for overflow in internal size calculation.
6048
6049         * getusershell.c (readname): Simplify the code by using x2nrealloc
6050         rather than xmalloc/xrealloc.
6051         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6052         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6053         conformance bug: the old code used a pointer after freeing the
6054         storage that it addressed.
6055         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6056         rather than doing it by hand.
6057         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6058         the buffer preserved.  Use free and xmalloc instead.
6059         * quotearg.c (quotearg_n_options): Likewise.
6060         Use a simpler test for size overflow.  Don't use xalloc_oversized
6061         because unsigned int might be wider than size_t (!); this suggests
6062         that we should switch from unsigned int to size_t for slot numbers.
6063
6064 2003-10-27  Bruno Haible  <bruno@clisp.org>
6065
6066         * stdbool_.h: Better support for BeOS.
6067
6068 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6069
6070         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6071         to allocate the returned structure.  Do not allocate a subarray,
6072         as x2nrealloc will do that.
6073         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6074         instead of xnrealloc.
6075         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6076
6077 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6078
6079         * xalloc.h (xalloc_oversized): New static inline function, for
6080         callers that want to do their own size-overflow checking.  Include
6081         <stdbool.h>, since xalloc_oversized returns bool.
6082         * xalloc.c (array_size_overflow): Remove.  All callers changed
6083         to use xalloc_oversized.
6084
6085         Add two functions x2realloc, x2nrealloc, for programs that grow
6086         arrays dynamically by doubling their sizes.
6087         * xalloc.h (x2realloc, x2nrealloc): New decls.
6088         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6089         New functions.
6090
6091         Port to C99 semantics for 'inline' of external functions.
6092         Bug reported by Bruno Haible.
6093         * xmalloc.c (xnmalloc_inline): New static inline function,
6094         with the old contents of xnmalloc.
6095         (xnmalloc, xmalloc): Use it.
6096         (xnrealloc_inline): New static inline function,
6097         with the old contents of xnrealloc.
6098         (xnrealloc, xrealloc): Use it.
6099
6100         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6101
6102 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6103
6104         Fix several address-calculation bugs in the hash modules,
6105         plus some minor code cleanup.
6106
6107         * hash.h: Include <stdbool.h>, for bool.
6108         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6109         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6110         hash_get_n_entries, hash_get_max_bucket_length,
6111         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6112         hash_rehash): Use size_t rather than unsigned.
6113         * hash.c (struct hash_table, hash_get_n_buckets,
6114         hash_get_n_buckets_used, hash_get_n_entries,
6115         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6116         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6117         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6118         Likewise.
6119         (SIZE_MAX): Define if not defined.
6120         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6121         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6122         hash_print):
6123         Use const * when possible.
6124         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6125         (check_tuning): Fix bug: if tuning parameters were very close to
6126         0 or 1, rounding errors could have caused subscript violations.
6127         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6128         (hash_initialize): Add 'fail:' label
6129         to free table and return NULL, and use it to simplify code.
6130         Use calloc rather than clearing the storage ourself.
6131         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6132         buffer size calculations.
6133         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6134         Include <stddef.h>, for size_t.
6135         * hash-pjw.c (hash_pjw): Likewise.
6136         Switch to method described by Bruno Haible.
6137         Include <limits.h>, for CHAR_BIT.
6138         (SIZE_BITS): New macro.
6139
6140 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6141
6142         * getndelim2.c (getndelim2): When size calculation overflows,
6143         ceiling the allocation at NMAX bytes rather than silently
6144         discarding input bytes before NMAX is reached.  This makes
6145         a difference only if NMAX exceeds SIZE_MAX / 2.
6146
6147         * obstack.c: Merge from glibc.
6148         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6149         Add libc_hidden_def (_obstack_newchunk).
6150         (_obstack_free) [! defined _LIBC]: Remove.
6151         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6152         a clone of the function body.
6153         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6154         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6155
6156         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6157         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6158         arg to memcpy.
6159
6160         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6161         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6162         Don't use lvalue casts, as GCC plans to remove support for them
6163         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6164         was also present in the non-GCC version, indicating that this
6165         code had always been buggy and had never been widely used.
6166         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6167         Use the fast variant of each macro, rather than copying the
6168         definiens of the fast variant; that way, we'll be more likely to
6169         catch future bugs in the fast variants.
6170
6171 2003-10-20  Bruno Haible  <bruno@clisp.org>
6172
6173         * wait-process.h: New file, from GNU gettext.
6174         * wait-process.c: New file, from GNU gettext.
6175
6176 2003-10-19  Jim Meyering  <jim@meyering.net>
6177
6178         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6179
6180 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6181
6182         * getgroups.c: Include <errno.h>, <stdlib.h>.
6183         (getgroups): First arg is int, not size_t.
6184         Don't let 'free' mangle errno.
6185
6186 2003-10-16  Jim Meyering  <jim@meyering.net>
6187
6188         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6189
6190 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6191
6192         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6193         (SIZE_MAX): Remove.
6194         (new_exclude, add_exclude_file): Initial size no longer needs to
6195         be a power of 2.
6196         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6197         our own address arithmetic overflow checking.
6198
6199         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6200         (fnmatch): Do not alloca more than 2000 wide characters;
6201         instead, use malloc for large buffers.
6202         Check for address arithmetic overflow, and return -1
6203         with errno set to ENOMEM in that case.
6204         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6205         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6206         instead, return -1.  Check for address arithmetic overflow.
6207
6208 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6209
6210         Handle invalid suffixes and overflow independently, so that
6211         callers can treat them independently as needed.  Fix some bugs in
6212         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6213         suffix for a human-readable blocksize.  The major caller-visible
6214         change is the addition of a new
6215         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6216         that both overflow and suffix chars were found.
6217
6218         * human.c (humblock): Don't check separately for invalid suffix
6219         char; that is xstrtoumax's job (now that its bug is fixed).
6220         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6221         INTMAX_MAX]: New macros.
6222         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6223         TYPE_MAXIMUM): New macros.
6224         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6225         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6226         if overflow occurs, as it's what __strtol does and it's more useful
6227         in practice.
6228         (__xstrtol): If __strtol reports some error other than ERANGE,
6229         reflect it to the caller as LONGINT_INVALID.  If it reports
6230         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6231         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6232         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6233         value.
6234         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6235         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6236         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6237         [defined UINTMAX_MAX]: New macros.
6238
6239 2003-10-14  Bruno Haible  <bruno@clisp.org>
6240
6241         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6242         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6243         Also use volatile where needed.
6244
6245 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6246
6247         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6248         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6249         and define in terms of the other primitives.
6250         * xmalloc.c: Include stdbool.h; do not include exit.h.
6251         (SIZE_MAX): Define if not already defined.
6252         (array_size_overflow): New function.
6253         (xalloc_die): Abort instead of exiting if 'error' returns.
6254         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6255         (xmalloc, xrealloc): Use them.
6256         (xcalloc): Check for address arithmetic overflow.
6257         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6258         a bit faster than strcpy.
6259
6260 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6261
6262         Merge getpass from libc, plus a few fixes.
6263
6264         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6265         Include <stdbool.h>.
6266         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6267         __fsetlocking to empty.
6268         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6269         do include <bits/libc-lock.h>.
6270         Do not include <fcntl.h>; not needed.
6271         [_LIBC]: Include <wchar.h>.
6272         (NOTCANCEL_MODE): New macro.
6273         (flockfile, funlockfile) [_LIBC]: New macros.
6274         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6275         [!_LIBC]: New macros.
6276         (call_fclose): New function.
6277         (getpass): Use it.  Save tty stream separately; this simplifies the
6278         code and makes it more reliable if stdin happens to equal stdout.
6279         Invoke __fsetlocking on tty.
6280         Handle thread cancellation if needed.
6281         Namespace cleanup (use __tcgetattr, __getline).
6282         Use bool for Booleans.
6283         [USE_IN_LIBIO]: Handle wide streams.
6284         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6285         stream might go where.
6286
6287         * unlocked-io.h: Include <stdio.h>, so that the caller
6288         doesn't have to include <stdio.h> before us.
6289         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6290         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6291         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6292         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6293         if not declared, so that we can use getpass.c code from libc without
6294         rewriting it.
6295         (flockfile, ftrylockfile, funlockfile): New macros.
6296
6297 2003-10-06  Bruno Haible  <bruno@clisp.org>
6298
6299         * version-etc-2.h: Remove file.
6300         * version-etc-2.c: Remove file.
6301
6302 2003-09-25  Jim Meyering  <jim@meyering.net>
6303             Bruno Haible  <bruno@clisp.org>
6304
6305         This lets translators provide better translations for the
6306         "Written by ..." part of --version output.
6307         * version-etc.h: Include stdarg.h.
6308         (version_etc_copyright): Declare as readonly.
6309         (version_etc): Make this function variadic with a NULL-terminated list
6310         of author name strings.
6311         (version_etc_va): New declaration.
6312         * version-etc.c: Include stdarg.h, stdlib.h.
6313         (version_etc_copyright): Declare as readonly.
6314         (version_etc_va): New function. Provide a different translatable string
6315         for each possible number of authors < 10. Abbreviate when there are 10
6316         authors or more.
6317         (version_etc): Make this function variadic. Call version_etc_va.
6318         Suggestion from Gary V. Vaughan.
6319
6320         * long-options.h (parse_long_options): Change prototype: the authors
6321         string is moved to the end and becomes variadic.
6322         * long-options.c: Include stdarg.h.
6323         (parse_long_options): Make this function variadic, too.
6324         Call version_etc_va, not version_etc.
6325
6326 2003-10-06  Bruno Haible  <bruno@clisp.org>
6327
6328         * fatal-signal.h: New file, from GNU gettext.
6329         * fatal-signal.c: New file, from GNU gettext.
6330
6331 2003-10-04  Karl Berry  <karl@gnu.org>
6332
6333         * argp*: update from libc.
6334
6335 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6336
6337         * getpass.c (getpass): Use a no-op fseek when switching from input to
6338         output mode on the same stream.
6339
6340 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6341
6342         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6343         Fix arg typo in previous patch.
6344
6345 2003-09-28  Jim Meyering  <jim@meyering.net>
6346
6347         * error.c: Correct cpp indentation.
6348
6349 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6350
6351         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6352         Omit the special code that used __typeof__, since we worry that
6353         it could be more trouble than it's worth.  See:
6354         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6355         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6356
6357         * free.c: New file.
6358
6359 2003-09-26  Jim Meyering  <jim@meyering.net>
6360
6361         * error.c (error_tail): Move some declarations
6362         into inner scope where the local variables are used.
6363
6364 2003-09-26  Bruno Haible  <bruno@clisp.org>
6365
6366         * stpncpy.h (gnu_stpncpy): New declaration.
6367         (stpncpy): Define as alias for gnu_stpncpy.
6368         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6369
6370 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6371
6372         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6373         (error_tail): Do not loop, reallocating temporary buffer, since
6374         the output cannot contain more wide characters than the input
6375         contains bytes, the size must be big enough already.  This avoids
6376         one potential size overflow calculation.  Check for size overflow
6377         when calculating temporary buffer size.  Free temporary buffer
6378         when done, if it was allocated with malloc; this plugs a memory
6379         leak.  Remove casts from void * to pointers, that are no longer
6380         needed now that we're assuming C89 or better.
6381
6382         Merge error changes from glibc.
6383
6384         * error.c, error.h: Update copyright notice header to match glibc.
6385         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6386         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6387         Disable cancellation while printing error.
6388         * error.h: Prepend __ to parameter names.
6389
6390 2003-09-25  Karl Berry  <karl@gnu.org>
6391
6392         * argp-fmtstream.c, argp-help.c: update from libc.
6393
6394 2003-09-25  Bruno Haible  <bruno@clisp.org>
6395
6396         * version-etc-2.h: New file, from version-etc.h with modifications.
6397         * version-etc-2.c: New file, from version-etc.c with modifications.
6398
6399 2003-09-25  Simon Josefsson  <jas@extundo.com>
6400
6401         * xgetdomainname.h: New file.
6402         * xgetdomainname.c: New file.
6403
6404 2003-09-25  Simon Josefsson  <jas@extundo.com>
6405             Bruno Haible  <bruno@clisp.org>
6406
6407         * getdomainname.h: New file.
6408         * getdomainname.c: New file.
6409
6410 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6411
6412         * linebuffer.c (freebuffer): Don't free the argument, just
6413         the buffer associated with the argument.  Bug reported by
6414         Simon Josefsson.
6415
6416 2003-09-19  Karl Berry  <karl@gnu.org>
6417
6418         * argp.h: update from libc.
6419
6420 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6421
6422         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6423         input error, instead of returning NULL the next time we are called
6424         (and therefore losing track of errno).
6425
6426 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6427
6428         * getndelim2.c (getndelim2): Don't trash errno when a read
6429         fails, so that the caller gets the proper errno.
6430
6431         * readutmp.c (read_utmp): Likewise.
6432         Check for fstat error.  Close stream and free storage
6433         when failing.
6434
6435 2003-09-14  Bruno Haible  <bruno@clisp.org>
6436
6437         * fwriteerror.h: New file.
6438         * fwriteerror.c: New file.
6439
6440 2003-09-14  Jim Meyering  <jim@meyering.net>
6441
6442         * getloadavg.c: Correct cpp indentation.
6443         * strdup.c: Likewise.
6444         * vasnprintf.c: Likewise.
6445
6446 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6447
6448         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6449         * obstack.c [!defined _LIBC]: Likewise.
6450         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6451         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6452         * exitfail.c: Don't include stdlib.h; no longer needed.
6453
6454         More changes to assume C89 or better.
6455
6456         * error.c (error_tail): Assume vprintf.
6457
6458         * argmatch.c (getenv): Remove decl.
6459         * progreloc.c (get_full_program_name): Define via prototype.
6460         * setenv.c (clearenv): Likewise.
6461         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6462         needed.
6463         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6464         (malloc, memcpy): Remove decls.
6465         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6466         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6467         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6468         (memcpy): Remove macro.
6469         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6470         (__P): Remove.  All uses removed.
6471         (PTR): Remove.  All uses changed to void *.
6472         (CHAR_BIT, NULL): Remove.
6473         (spaces, zeros, memset_space, memset_zero)
6474         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6475         Remove.
6476         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6477         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6478         Define with prototype.
6479         Remove now-unnecessary prototype decl.
6480         (extra_args_spec): Assume ANSI C.  All uses changed.
6481         (extra_args_spec_iso): Remove.
6482         (my_strftime, emacs_strftimeu): Define via prototype.
6483         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6484         unconditionally.
6485         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6486         * strtoimax.c: Include <stdlib.h> unconditionally.
6487         (strtoul, strtol): Remove decls.
6488         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6489         LONG_MAX): Remove.
6490         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6491         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6492         (LOCALE_PARAM_PROTO): New macro.
6493         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6494         (INTERNAL (strtol), strtol): Define with a prototype.
6495         (PARAMS): Remove.  All uses removed.
6496         * tempname.c: Include <string.h> unconditionally.
6497         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6498         * xgethostname.c (main): Define with a prototype.
6499         * xmalloc.c: Include "xalloc.h" first, to check interface.
6500         Include <stdlib.h> unconditionally.
6501         (calloc, malloc, realloc, free): Remove decls.
6502         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6503         Include <stdlib.h> unconditionally.  Sort include file names.
6504         (strtod): Remove.
6505         (xstrtod): Define with a prototype.
6506         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6507         (strtol, strtoul): Remove decls.
6508
6509 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6510
6511         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6512         Include <stdlib.h>, <string.h> unconditionally.
6513         Remove now-unnecessary cast to char *.
6514         * strnlen.c: Include <string.h> unconditionally.
6515         * yesno.c (yesno): Define with a prototype.
6516
6517 2003-09-10  Bruno Haible  <bruno@clisp.org>
6518
6519         * strcspn.c: Include <string.h> unconditionally.
6520         * strpbrk.c: Include <string.h> unconditionally.
6521         * strstr.c: Include <string.h> unconditionally.
6522         * unicodeio.c: Include <string.h> unconditionally.
6523         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6524         * unsetenv.c: Likewise.
6525         * xreadlink.c: Include <stdlib.h> unconditionally.
6526         * yesno.c: Include <stdlib.h> unconditionally.
6527         (rpmatch): Add prototype.
6528
6529 2003-09-10  Jim Meyering  <jim@meyering.net>
6530
6531         * error.c: Correct indentation of cpp directives.
6532
6533 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6534
6535         More K&R removal.
6536
6537         * acosl.c (main): Use a prototype.
6538         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6539         tanl.c: Likewise.
6540
6541         * getloadavg.c (getloadavg, main): Define via prototypes.
6542
6543         * getopt.h (struct option.name): Assume C89, and use 'const'.
6544         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6545         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6546         with a prototype.
6547         * getopt.c (const): Remove macro.
6548         Include <string.h> unconditionally.
6549         (my_index): Remove; all uses changed to strchr.
6550         (strlen): Remove decl.
6551         (exchange): Remove forward decl; no longer needed.
6552         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6553         Define with prototype.
6554         * getopt1.c (const): Remove macro.
6555         (getopt_long, getopt_long_only, main): Define with prototype.
6556
6557         * getugroups.c: Include <string.h> unconditionally.
6558
6559         * getusershell.c: Include <stdlib.h> unconditionally.
6560         (getusershell, setusershell, endusershell, readname, main):
6561         Define with prototypes.
6562
6563         * group-member.c: Include group-member.h first.
6564         Include <stdlib.h> unconditionally.
6565
6566         * hard-locale.c: Include hard-locale.h first.
6567         Include <stdlib.h>, <string.h> unconditionally.
6568
6569         * hash.c (free, malloc): Remove decls.
6570         Include <stdlib.h> unconditionally.
6571
6572         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6573         (getenv): Do not declare.
6574
6575         * idcache.c: Include <string.h> unconditionally.
6576
6577         * long-options.c: Include long-options.h first, to test interface.
6578         Include <stdlib.h> unconditionally.
6579
6580         * makepath.c: Include makepath.h first, to test interface.
6581         Include <stdlib.h> and <string.h> unconditionally.
6582
6583         * linebuffer.c: Include <stdlib.h>.
6584         (free): Remove decl.
6585
6586         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6587         rpl_malloc returns void *, not char *.
6588         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6589
6590         * md5.h: Include <limits.h> unconditionally.
6591         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6592         (__P): Remove; all uses removed.
6593         * md5.c: Include "md5.h" first.
6594         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6595         md5_buffer, md5_process_bytes, md5_process_block):
6596         Define with prototypes.
6597         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6598         * sha.c: Include "sha.h" first.
6599         Include <stdlib.h>, <string.h> unconditionally.
6600
6601         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6602         * memcmp.c (__ptr_t): Likewise.
6603         * memrchr.c (__ptr_t): Likewise.
6604         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6605         Include <string.h> unconditionally.
6606         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6607         * memchr.c: Include <stdlib.h> unconditionally.
6608         * memchr.c (LONG_MAX): Remove.
6609         * memrchr.c (LONG_MAX): Likewise.
6610         * memchr.c (__memchr): Define via a prototype.
6611         * memrchr.c (__memrchr): Likewise.
6612         * memcmp.c (__P): Remove, and remove all uses.
6613         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6614         Remove forward decls; no longer needed.
6615         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6616         Use types required by C89 in prototype.
6617
6618         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6619         * savedir.c: Likewise.
6620         * mkdir.c (free): Remove decl.
6621         * rmdir.c (rmdir): Define with a prototype.
6622         * savedir.c: Include savedir.h first, to test interface.
6623
6624         * mktime.c (STDC_HEADERS): Remove.
6625         Include <stdlib.h>, <string.h> unconditionally.
6626
6627         * modechange.c: Include <stdlib.h> unconditionally.
6628         (malloc): Remove decl.
6629
6630         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6631         (free): Remove decl.
6632
6633         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6634         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6635         (This type really should be intptr_t, but that's a C99ism.)
6636         (_obstack_memcpy): Remove: all uses changed to memcpy.
6637         Include <string.h> unconditionally.
6638         (struct obstack): Assume __STDC__ for types of members
6639         chunkfun, freefun, extra_arg.
6640         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6641         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6642         obstack_begin, obstack_specify_allocation,
6643         obstack_specify_allocation_with_arg, obstack_chunkfun,
6644         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6645         Remove unprototyped decls and the macros that use them.
6646         * obstack.c (POINTER): Remove.  All uses changed to void *.
6647         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6648         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6649         (defined __STDC__ && __STDC__)]:
6650         Remove nonprototyped code.
6651         Include <stdlib.h> unconditionally.
6652         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6653         _obstack_allocated_p, _obstack_free, obstack_free,
6654         _obstack_memory_used, print_and_abort):
6655         Define using prototypes.
6656         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6657         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6658         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6659         obstack_next_free, obstack_object_size, obstack_room) [0]:
6660         Remove unused, unprototyped code.
6661
6662         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6663
6664         * physmem.c (physmem_total, physmem_available, main): Define
6665         with prototypes.
6666
6667         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6668         (main): Define with a prototype.
6669
6670         * posixver.c (getenv): Remove decl.
6671
6672         * putenv.c (malloc): Returns void *, not char *.
6673         Include <string.h> unconditionally.
6674         (strchr, memcpy, NULL): Do not define.
6675
6676         * readtokens.c: Include readtokens.h first, to test interface.
6677         Include <stdlib.h>, <string.h> unconditionally.
6678         (init_tokenbuffer): Define with a prototype.
6679
6680         * regex.c (PARAMS): Remove.  All uses removed.
6681         All uses of _RE_ARGS removed, too.
6682         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6683         unconditionally.
6684         (bzero): Assume memset exists.
6685         (memcmp, memcpy, NULL): Remove.
6686         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6687         char, or assignments to local vars of type signed char.
6688         (init_syntax_once, PREFIX(extract_number_and_incr),
6689         PREFIX(print_partial_compiled_pattern),
6690         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6691         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6692         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6693         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6694         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6695         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6696         wcs_compile_range, byte_compile_range, truncate_wchar,
6697         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6698         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6699         count_mbs_length, wcs_re_match_2_internal,
6700         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6701         PREFIX(alt_match_null_string_p),
6702         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6703         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6704         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6705         now-unnecessary declaration, if any.
6706         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6707         regcomp, regexec):
6708         Remove now-unnecessary casts among pointer types.
6709         * regex.h (_RE_ARGS): Remove.  All uses removed.
6710
6711         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6712         (free): Remove decl.
6713
6714         * rpmatch.c: Include <stdlib.h> unconditionally.
6715
6716         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6717         (free): Remove decl.
6718
6719         * save-cwd.c: Include <stdlib.h> unconditionally.
6720         * xgetcwd.c: Likewise.
6721
6722         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6723         (free): Remove decl.
6724
6725         * strchrnul.c (strchrnul): Define with a prototype.
6726         Fix bug: c_in was not converted to char before searching.
6727
6728         The following changes are not K&R related:
6729
6730         * group-member.h: Include <sys/types.h>, so that this file is
6731         self-contained.
6732         * makepath.h: Likewise.
6733
6734         * getusershell.c (readname, default_index, line_size, readname):
6735         Use size_t, not int, for sizes.
6736         (readname): If the size overflows, report an error instead of
6737         looping forever.
6738
6739 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6740
6741         * getndelim2.c: Assume stdlib.h per the C89 spec.
6742
6743 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6744
6745         Assume C89 or better; remove K&R cruft.
6746         A few of these changes were first proposed by Derek Robert Price
6747         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6748
6749         * addext.c: Include <string.h> unconditionally.
6750         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6751         Don't declare getenv or malloc.
6752
6753         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6754         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6755         (NULL): Remove.
6756         (find_stack_direction, alloca): Use prototypes.
6757
6758         * atexit.c (atexit): Define using a prototype.
6759
6760         * basename.c, dirname.c, stripslash.c:
6761         Include <string.h> unconditionally.
6762
6763         * bcopy.c: Include <stddef.h>.
6764         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6765
6766         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6767
6768         * error.h (error, error_at_line, error_print_progname)
6769         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6770         * error.c: Include error.h first, to check interface.
6771         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6772         (VA_START): Remove; all uses changeed to va_start.
6773         (exit, strerror): Remove decls.
6774         (error_print_progname): Prototype uncondionally.
6775         Don't include <errno.h>; no longer needed.
6776         (private_strerror): Remove.
6777         (error_tail): Always define.
6778         (error, error_at_line): Assume C89 or better; always use prototypes.
6779         * fatal.c: Include "fatal.h" first, to test interface.
6780         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6781         (VA_START): Remove; all uses changed to va_start.
6782         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6783         this case.
6784         (exit): Remove decl.
6785         (fatal): Prototype unconditionally.  Assume va_start works.
6786         Abort at end, to pacify gcc.
6787
6788         * euidaccess.c (main): Define with a prototype.
6789
6790         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6791
6792         * exitfail.c: Include <stdlib.h> unconditionally.
6793
6794         * fnmatch_.h (__P): Remove.  All uses changed to assume
6795         prototypes.
6796         * fnmatch.c: Include fnmatch.h first, to test interface.
6797         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6798         (getenv): Remove decl.
6799         (fnmatch): Define using a prototype.
6800         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6801         (FCT): Define using a prototype.
6802
6803         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6804
6805         * gethostname.c: Include <stddef.h>.
6806         (gethostname): Define with prototype.  Length is size_t, not int.
6807
6808 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6809
6810         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6811         getversion.c should have been removed then, but was accidentally
6812         preserved.
6813
6814         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6815         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6816
6817 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6818
6819         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6820         copy_tm_result.  Bug reported by Simon Josefsson in
6821         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6822
6823 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6824
6825         * time_r.c, time_r.h: New files.
6826
6827         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6828         __localtime_r.
6829         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6830         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6831
6832         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6833         __gmtime_r.
6834         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6835         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6836         Include <time_r.h>.
6837
6838         * timegm.c: Switch to glibc implementation, with the following changes:
6839         [defined HAVE_CONFIG_H]: Include <config.h>.
6840         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6841         (__mktime_internal) [!defined _LIBC]: New decl.
6842         (__gmtime_r) [!defined _LIBC]: New macro and function.
6843         (timegm): Use a prototype, since gnulib assumes C89.
6844         Do not bother declaring tmp to be const, as it's not really usefu.
6845         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6846         (timegm): Declare only if HAVE_DECL_TIMEGM.
6847
6848 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6849
6850         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6851         Bug reported by Lute Kamstra in
6852         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6853
6854         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6855         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6856         course with correspondingly smaller numbers for tomorrow and
6857         yesterday.  From Tadayoshi Funaba.  Originally installed into
6858         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6859         coreutils merge?).
6860
6861 2003-08-31  Simon Josefsson  <jas@extundo.com>
6862
6863         * timegm.h: New file.
6864         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6865
6866 2003-08-31  Karl Berry  <karl@gnu.org>
6867
6868         * argp.h: update from libc.
6869
6870 2003-08-28  Bruno Haible  <bruno@clisp.org>
6871
6872         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6873         warning on QNX, which defines O_BINARY to 000000.
6874
6875 2003-08-24  Bruno Haible  <bruno@clisp.org>
6876
6877         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6878         MSVC7 <stdio.h> is included later.
6879
6880 2003-08-20  Bruno Haible  <bruno@clisp.org>
6881
6882         * progname.h: New file, from GNU gettext.
6883         * progname.c: New file, from GNU gettext.
6884         * progreloc.c: New file, from GNU gettext.
6885
6886 2003-08-19  Bruno Haible  <bruno@clisp.org>
6887
6888         * xstrdup.c: Assume <string.h> exists.
6889
6890 2003-08-18  Jim Meyering  <jim@meyering.net>
6891
6892         * setenv.h: Indent nested cpp directive.
6893         * vasnprintf.c: Remove trailing blanks.
6894
6895 2003-08-17  Simon Josefsson  <jas@extundo.com>
6896             Bruno Haible  <bruno@clisp.org>
6897
6898         * xstrndup.h: New file.
6899         * xstrndup.c: New file.
6900
6901 2003-08-17  Bruno Haible  <bruno@clisp.org>
6902
6903         * strndup.h: New file.
6904
6905 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6906
6907         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6908         space, undoing this 2003-08-12 change:
6909         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6910
6911 2003-08-16  Jim Meyering  <jim@meyering.net>
6912
6913         Merge from coreutils.
6914         * xstrtoimax.c: #else #if -> #elif.
6915         * xstrtoumax.c: Likewise.
6916
6917 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6918
6919         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6920         rather than tab, after '#' in shell-script copyright notices.
6921         Suggested by Bruno Haible.
6922
6923 2003-08-15  Jim Meyering  <jim@meyering.net>
6924         and Paul Eggert  <eggert@twinsun.com>
6925
6926         Merge from coreutils.
6927         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6928         member but strut utmpx does not.  Needed for AIX 4.3.3.
6929         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6930
6931 2003-08-15  Jim Meyering  <jim@meyering.net>
6932
6933         Merge from coreutils.
6934         * xgethostname.c: Include <stdlib.h>.
6935         (xghostname): Don't exit for anything other than memory-related
6936         failure; just return NULL.
6937         * userspec.c: Include "posixver.h".
6938         (parse_user_spec): Accept `.' as a separator only
6939         in pre-POSIX-200112 mode.
6940         * strtoimax.c: Use #elif rather than #else #if.
6941         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6942         Remove function, now that we can rely on a working tzset function.
6943         [!_LIBC]: Ensure that the required autoconf test has been run.
6944         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6945         Use underlying_strftime for %r.
6946         * sha.c: Merge in some clean-up and optimization changes from glibc.
6947         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6948         Ensure that it is a multiple of 64.
6949         Rearrange loop exit tests so as to avoid performing an
6950         additional fread after encountering an error or EOF.
6951         * realloc.c: Update copyright date.
6952
6953 2003-08-14  Jim Meyering  <jim@meyering.net>
6954
6955         Merge from coreutils.
6956         * obstack.h: Whitespace changes.
6957         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6958         and xcalloc return values.
6959         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6960         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6961         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6962         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6963         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6964         error from mntctl.
6965         Use mntctl's return value to drive the entry-processing loop, since
6966         we can't rely on the value of the vmt_length member in the last
6967         entry.  On some systems doing so could result in exhausting
6968         virtual memory.  Based in part on a patch from Mike Jetzer.
6969
6970 2003-08-14  Jim Meyering  <jim@meyering.net>
6971         and Paul Eggert  <eggert@twinsun.com>
6972
6973         Merges from coreutils, plus other fixes.
6974         * physmem.c: Merge in portability changes from gcc/libiberty
6975         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6976         for credits and details.  Thanks to Kaveh Ghazi for helping
6977         to keep these files in sync.
6978         (ARRAY_SIZE): Define it.
6979         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6980         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6981         (memcasecmp): Don't assume size_t fits in unsigned int.
6982         Remove casts and duplicate code.
6983         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6984         (memcpy): Remove definition.
6985         Merge in some clean-up and optimization changes from glibc.
6986         [BLOCKSIZE]: Move definition to top of file.
6987         Ensure that it is a multiple of 64.
6988         Rearrange loop exit tests so as to avoid performing an
6989         additional fread after encountering an error or EOF.
6990         * md5.h (md5_uintptr): Define.
6991         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6992         return to the initial working directory.  Preserve errno
6993         for caller.
6994         * idcache.c: Include "xalloc.h".
6995         (xmalloc, xrealloc): Remove decls.
6996         (getuser): Remove casts no longer required in C89.
6997         * human.c: Include stdio.h, for sprintf.
6998         * group-member.c: Include "xalloc.h".
6999         (xmalloc, xrealloc): Remove decls.
7000         (get_group_info): Remove casts no longer required in C89.
7001         * getusershell.c (readname): Remove casts no longer required in C89.
7002         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7003         * getline.c: Whitespace fix, from coreutils.
7004
7005 2003-08-13  Paul Eggert  <eggert@twinsun.com>
7006
7007         * exclude.c: Include <ctype.h>
7008         (IN_CTYPE_DOMAIN): New macro.
7009         (is_space): New fn.
7010         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7011         and empty lines.
7012
7013         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7014         Undo previous (whitespace-only) change.
7015
7016 2003-08-12  Paul Eggert  <eggert@twinsun.com>
7017
7018         * argp-help.c, argp-parse.c, config.charset, getopt.h:
7019         Normalize leading white space and remove trailing white space.
7020         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7021         notice, as per ../config/srclist-update.
7022
7023         Merge from coreutils.
7024         * euidaccess.h: New file.
7025         * euidaccess.c: Include it.
7026         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7027         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7028         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7029
7030 2003-08-11  Bruno Haible  <bruno@clisp.org>
7031
7032         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7033         (vasnprintf): Use it instead of wcslen.
7034
7035 2003-08-11  Bruno Haible  <bruno@clisp.org>
7036
7037         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7038         value to ensure that _Bool promotes to int. Use #define for _Bool when
7039         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7040
7041 2003-08-10  Karl Berry  <karl@gnu.org>
7042
7043         * regex.h: update from libc (whitespace fix).
7044
7045 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7046
7047         Merge some files from coreutils.  These changes were
7048         originally made by Jim Meyering.
7049         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7050         many older Unixes require this.
7051         * alloca.c (alloca): Remove cast to argument of free;
7052         no longer needed in C89.
7053         * alloca_.h, regex.h: Fix white space to match
7054         what GNU indent does.
7055
7056 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7057
7058         * bumpalloc.h: Remove.
7059
7060 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7061
7062         * getloadavg.c: Change copyright notice and spacing to conform to
7063         GNU coding style.
7064
7065         Merge from coreutils.
7066         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7067         From glibc.
7068         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7069         from Karl Berry, implemented by Jim Meyering.
7070         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7071         from Dmitry V. Levin.
7072         Remove anachronistic cast of xrealloc.
7073         * fnmatch_.h (__const): Remove.  Use 'const'.
7074         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7075         type. Otherwise, it wouldn't compile with at least /bin/cc on
7076         ymp-cray-unicos9.0.2.X.
7077         Combine two mostly-identical uses of alloca into one.
7078         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7079
7080 2003-08-04  Dave Love <d.love@dl.ac.uk>
7081
7082         [From Emacs.]
7083
7084         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7085         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7086         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7087         obsolete NLIST_NAME_UNION.
7088         [__GNU__]: Undef BSD and FSCALE.
7089         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7090
7091 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7092
7093         * stdbool_.h (_Bool): Make it signed char, instead of
7094         an enum type, so that it's guaranteed to promote to int.  See:
7095         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7096
7097 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7098
7099         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7100         (strerror): Don't assume that a printable int fits in 14 bytes.
7101
7102 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7103             Bruno Haible  <bruno@clisp.org>
7104
7105         * getline.h (getline, getdelim): Change return type to ssize_t.
7106         * getline.c (getline, getdelim): Likewise.
7107         Remove _GNU_SOURCE define; now it's defined in config.h through
7108         m4/getline.m4.
7109
7110 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7111
7112         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7113         over-parenthesization in macros.
7114
7115         Sync with coreutils.
7116
7117         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7118         required by C99.
7119
7120         Use `exit_failure' for xalloc and xmemcoll instead of their own
7121         private exit-failure variables.
7122         * xalloc.h (xalloc_exit_failure): Remove.
7123         * xmalloc.c: Likewise.  Include exitfail.h.
7124         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7125         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7126         * xmemcoll.c: Likewise.  Include exitfail.h.
7127         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7128
7129 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7130
7131         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7132         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7133         to test that it can stand by itself.  Include "exitfail.h".
7134         Clients should set exit_failure instead.
7135         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7136
7137 2003-07-18  Andreas Schwab  <schwab@suse.de>
7138
7139         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7140
7141 2003-07-18  Bruno Haible  <bruno@clisp.org>
7142
7143         * getndelim2.h: New file.
7144         * getndelim2.c: Make into a module of its own. Include config.h,
7145         getndelim2.h.
7146         (getndelim2): Make non-static. Change return type to ssize_t.
7147         * getline.h: Change argument names.
7148         * getline.c: Include getndelim2.h instead of getndelim2.c.
7149         * getnline.c: Include getndelim2.h.
7150
7151 2003-07-17  Bruno Haible  <bruno@clisp.org>
7152
7153         * Makefile.am: Remove file.
7154         * Makefile.in: Remove file.
7155
7156 2003-07-17  Bruno Haible  <bruno@clisp.org>
7157
7158         * getnline.h: New file.
7159         * getnline.c: New file.
7160         * getndelim2.c: New file, extracted from getline.c.
7161         (getndelim2): Renamed from getdelim2, with added nmax argument.
7162         * getline.c: Include getndelim2.c.
7163         (getdelim2): Moved out to getndelim2.c.
7164         (getline, getdelim): Update.
7165
7166 2003-07-15    <karl@gnu.org>
7167
7168         * vasnprintf.c: update from gettext.
7169
7170 2003-07-15  Jim Meyering  <jim@meyering.net>
7171
7172         * makepath.c (make_path): Enclose diagnostic in _(...).
7173
7174 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7175
7176         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7177         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7178         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7179         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7180         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7181         updated automatically by ../config/srclist-update.  This changes
7182         their license from LPGL to GPL.
7183
7184 2003-07-14  Jim Meyering  <jim@meyering.net>
7185
7186         Don't emit diagnostics.  Let callers do that.
7187         * save-cwd.c: Don't include "error.h".
7188         (save_cwd): Don't call error.  Ensure that errno is valid
7189         when returning nonzero.
7190
7191         * save-cwd.h (restore_cwd): Update prototype.
7192         * save-cwd.c (restore_cwd): Remove two parameters.
7193         Simplify.  Don't call error upon failure.  Let callers do that.
7194         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7195         when auditing is enabled.  But don't bother updating the #if.
7196
7197 2003-07-14  Simon Josefsson  <jas@extundo.com>
7198
7199         * mempcpy.h: New file.
7200         * mempcpy.c: New file.
7201
7202 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7203
7204         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7205         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7206         unicodeio.c, unicodeio.h, unlocked-io.h:
7207         Switch from LGPL to GPL.
7208
7209 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7210
7211         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7212         it breaks C++ compilation.
7213         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7214
7215 2003-07-10  Jim Meyering  <jim@meyering.net>
7216
7217         * vasnprintf.c: Remove trailing blanks.
7218         Make cpp indentation consistent.
7219
7220 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7221
7222         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7223         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7224         Switch from LGPL to GPL.
7225
7226 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7227
7228         * mktime.c: Fix some boundary cases and remove need for floating point.
7229
7230         Issue a compile-time diagnostic if time_t is floating point, or if
7231         two's complement arithmetic is not in effect, or if arithmetic
7232         right shift does not propagate the sign.  These assumptions were
7233         all in the original code but they weren't checked.
7234
7235         (TIME_T_MIDPOINT, verify): New macros.
7236         (__isleap): Remove; it has integer overflow problems.
7237         (leapyear): New function, without those problems.
7238         (ydhms_tm_diff): Remove; splitting into two parts.
7239         (ydhms_diff): New function, containing the arithmetic part of
7240         the old ydhms_tm_diff function.  Issue a compile-time
7241         diagnostic if we are not using C99 integer division.
7242         Avoid casts when possible.
7243         (guess_time_tm): New function, containing the checking part of
7244         the old ydhms_tm_diff function.  Return the new value, rather than
7245         the difference between it and the old.  Accept a new argument T
7246         so that *T specifies the old value.  Check for overflow in the result.
7247
7248         (__mktime_internal): Use a time_t offset, not a long int offset.
7249         This undoes the 2003-06-04 change, which is no longer needed now
7250         that we have better overflow checking.
7251         (localtime_offset): Likewise.
7252
7253         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7254         and long are 64-bit but int is only 32-bit.
7255         (ydhms_diff): Use long int to store year1 and yday1.
7256         Issue a compile-time diagnostic if long int is not wide enough.
7257
7258         (__mktime_internal): Use long int to store adjusted year and yday.
7259         Use plain C rather than preprocessor commands, if that doesn't
7260         affect efficiency.
7261         Check for overflow (and try to repair) after each probe
7262         rather than checking only at the very end.  This avoids some bugs
7263         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7264         does not equal GMT offset at maximum time).
7265         Use integer to check for overflow rather than floating point; this
7266         is more portable to non-IEEE hosts, and is a tad faster.
7267         When we detect that we are oscillating between two values,
7268         don't check whether tm_isdst has the requested value, since
7269         we already know the answer.  When tm_isdst has the wrong value,
7270         use a different heuristic to find the right one, based on the
7271         extreme values actually observed in practice in tz2003a,
7272         rather than the (overly optimistic) "previous 3 calendar quarters".
7273
7274         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7275         "T const" to accommodate glibc style.
7276         (check_result): Use less-confusing report format.  "long" -> "long int.
7277         (main): Likewise.
7278         Don't loop if the iteration overflows time_t.
7279         Allow a negative step in the iteration.
7280
7281 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7282
7283         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7284         having it depend on HAVE_SYS_TYPES_H.
7285
7286 2003-06-25  Bruno Haible  <bruno@clisp.org>
7287
7288         * readlink.c: New file.
7289
7290 2003-06-20  Bruno Haible  <bruno@clisp.org>
7291
7292         Assume C89, so PARAMS isn't needed.
7293         * unicodeio.h (PARAMS): Remove.
7294         * unicodeio.c: Don't use PARAMS.
7295
7296 2003-06-18  Jim Meyering  <jim@meyering.net>
7297
7298         Merge changes from coreutils.
7299         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7300         Remove explicit declarations of xmalloc and realloc.
7301         Include xalloc.h.
7302         (read_utmp): Remove anachronistic cast of xmalloc.
7303
7304 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7305
7306         Assume C89, so PARAMS isn't needed.
7307         * backupfile.h (PARAMS): Remove.  All uses removed.
7308         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7309         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7310         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7311         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7312         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7313         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7314         xstrtol.h: Likewise.
7315         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7316         same.h, strverscmp.h: Do not include config.h; no longer needed.
7317         Anyway, config.h should always be included before any other file.
7318
7319 2003-06-11  Simon Josefsson  <jas@extundo.com>
7320
7321         * sysexit_.h: New file.
7322
7323 2003-05-20  Derek Price  <derek@ximbiot.com>
7324
7325         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7326
7327 2003-06-10  Simon Josefsson  <jas@extundo.com>
7328
7329         * strchrnul.h: New file.
7330         * strchrnul.c: New file.
7331
7332 2003-06-10  Simon Josefsson <jas@extundo.com>
7333
7334         * argp.h: New file, from glibc.
7335         * argp-ba.c: New file, from glibc.
7336         * argp-eexst.c: New file, from glibc.
7337         * argp-fmtstream.c: New file, from glibc.
7338         * argp-fmtstream.h: New file, from glibc.
7339         * argp-fs-xinl.c: New file, from glibc.
7340         * argp-help.c: New file, from glibc.
7341         * argp-namefrob.h: New file, from glibc.
7342         * argp-parse.c: New file, from glibc.
7343         * argp-pv.c: New file, from glibc.
7344         * argp-pvh.c: New file, from glibc.
7345         * argp-xinl.c: New file, from glibc.
7346
7347 2003-06-07  Jim Meyering  <jim@meyering.net>
7348
7349         * readtokens.h: Put `Free Software Foundation, Inc.'
7350         in place of my name in the copyright comment.
7351         Remove definition and uses of __P.
7352
7353         From coreutils.
7354         * stat.c: Don't declare xmalloc explicitly.
7355         Instead, include "xalloc.h".
7356         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7357         xrealloc, and xcalloc return values.
7358         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7359         Improve comment.
7360         * xgetcwd.h: Remove definition/uses of PARAMS.
7361
7362 2003-06-06  Jim Meyering  <jim@meyering.net>
7363
7364         * stdbool_.h: Renamed from stdbool.h.in.
7365
7366 2003-06-06  Jim Meyering  <jim@meyering.net>
7367
7368         Merge from coreutils.
7369         * same.c: (same_name): Declare *_basename locals to be `const'.
7370         Consolidate declarations and initializations of *_base* locals.
7371
7372         Merge from coreutils.
7373         This avoids a core dump on systems without GNU putenv,
7374         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7375         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7376         (unsetenv): New static function, from GNU libc.
7377         (rpl_putenv): Use it.
7378
7379         * modechange.c: Remove trailing blanks.
7380
7381         Merge from coreutils.
7382         * fsusage.c: Remove declaration of statfs.
7383         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7384
7385         * posixtm.c: Include <stdbool.h> unconditionally.
7386
7387 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7388
7389         * mktime.c (__mktime_internal): When resolving a tm_isdst
7390         mismatch, look in future quarters as well as past.  This fixes a
7391         bug when processing fall-backwards gaps immediately after a long
7392         period of daylight-saving time.
7393
7394         * mktime.c: Assume freestanding C89 or better.
7395         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7396         (__P): Remove; not used.
7397         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7398         (mktime, not_equal_tm, print_tm, check_result,
7399         main): Use prototypes.  Use const * where appropriate.
7400         (main): Fix typo in testing code that uncovered by above changes.
7401         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7402
7403 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7404
7405         * mktime.c: Fix Debian bug 177940
7406         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7407         (localtime_offset): Now long int, not time_t, because we want it
7408         to be guaranteed to be signed.  All uses changed.
7409         (__mktime_internal): If overflow would occur when adding offset,
7410         don't add it.
7411
7412         Merge 'human' changes from coreutils.  Rewrite to support
7413         locale-specific notations like thousands separators.
7414         * human.c: Simplify authorship notice.
7415         Include human.h immediately after config.h.
7416         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7417         <limits.h>: Do not include, since human.h does.
7418         (SIZE_MAX, UINTMAX_MAX): New macros.
7419         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7420         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7421         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7422         (power_letter): Renamed from suffixes.
7423         (generate_suffix_backwards): Remove.
7424         (adjust_value): Now takes int style (because of human.h changes)
7425         and long double value (for greater precision on some platforms).
7426         (group_number): New function.
7427         (human_readable): Use it.  Use integer options, not enum.
7428         Put the options before the sizes in the arg list.
7429         Support all the new options.
7430         The old human_readable function has been removed;
7431         use inttostr.h instead.
7432         (human_readable, default_block_size, humblock):
7433         Use uintmax_t, not int, for block sizes.
7434         (human_readable_inexact, block_size_types): Remove.
7435         (block_size_opts): New constant.
7436         (human_options): Renamed from human_block_size, with new signature
7437         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7438         * human.h: Add copyright and authorship notice.
7439         Include <limits.h> and <stdbool.h> unconditionally.
7440         (PARAMS): Remove.  All uses removed.
7441         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7442         (enum human_inexact_style): Remove tag; now a nameless enum.
7443         (human_floor, human_ceiling, human_round_to_even): Now have
7444         values 2, 0, 1 rather than -1, 1, 0.
7445         (human_group_digits, human_suppress_point_zero, human_autoscale,
7446         human_base_1024, human_SI, human_B): New constants.
7447         (human_readable_inexact, human_block_size): Remove.
7448         (human_readable): Size args are now uintmax_t, not int.
7449         (human_options): New decl.
7450
7451         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7452         unnecessary now that we assume C89 or better.  This change
7453         imported from coreutils.
7454
7455         * mktime.c (__mktime_internal): Do not reject negative timestamps
7456         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7457         in the 2003-05-30 sync from glibc.
7458
7459         .h files should stand alone, but we shouldn't include <sys/types.h>
7460         if we can get away with just <stddef.h>.
7461
7462         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7463         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7464         rather than <sys/types.h>, as we merely need size_t.
7465         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7466         to get size_t.
7467         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7468         Include <stdio.h>, to get FILE.
7469         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7470         memcasecmp.h has included <stddef.h> and all we need is size_t.
7471         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7472         our interface, instead of including <sys/types.h>
7473
7474 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7475
7476         [from coreutils]
7477         Fix some minor time-related bugs with POSIX time arguments.
7478         Some valid time stamps were being rejected (notably -1, and
7479         time stamps before 1900 on 64-bit hosts).  And some invalid
7480         time stamps were being accepted, e.g. September 31.
7481
7482         * posixtm.h (posixtime): Return bool instead of time_t, so
7483         that we can return (time_t) -1 successfully.
7484         * posixtm.c: Likewise.
7485         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7486         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7487         (t): Remove static var.
7488         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7489         of static var.  All uses changed.
7490         (year): Do not reject years before 1900; they can occur with
7491         64-bit time_t.
7492         (posix_time_parse): Do not check for out-of-range components;
7493         that is now the caller's responsibility, since our checks were
7494         only approximations.
7495         (posixtime): Use mktime to check for out-of-range components,
7496         since it knows them exactly.
7497         If mktime returns (time_t) -1, check whether an error actually occurred
7498         by invoking localtime on -1.
7499         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7500         posixtime failures better.
7501         Improve the test data (in comments only).
7502
7503 2003-05-30    <karl@gnu.org>
7504
7505         * mktime.c: update from libc.
7506
7507 2003-05-30  Bruno Haible  <bruno@clisp.org>
7508
7509         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7510         * localcharset.h: Likewise.
7511         * localcharset.c: Likewise.
7512
7513 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7514
7515         Assume the headers required for C89 freestanding compilers.
7516         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7517         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7518         without checking for HAVE_LIMITS_H.
7519         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7520         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7521         to do that.
7522         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7523         * exclude.c: Include <stdbool.h> unconditionally.
7524         * tempname.c: Include <stddef.h> unconditionally.
7525         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7526         * modechange.c, rpmatch.c (NULL): Don't define, since
7527         <stddef.h> does that.
7528         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7529         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7530         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7531         * xstrtol.c: Likewise.
7532         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7533         * savedir.c: Include <stddef.h> instead of defining NULL.
7534
7535         * addext.c (addext): Use assignment rather than cast, to avoid
7536         warnings on some platforms.
7537
7538         * mktime.c (__mktime_internal): Do not reject negative timestamps
7539         arbitrarily.
7540
7541 2003-05-10  Bruno Haible  <bruno@clisp.org>
7542
7543         * linebreak.c (iconv_string_length): Don't return -1 just because the
7544         string is longer than 4 KB.
7545
7546 2003-05-12  Jim Meyering  <jim@meyering.net>
7547
7548         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7549         the space-padded-by-default conversion specifiers, %e, %k, %l.
7550
7551 2003-05-03  Bruno Haible  <bruno@clisp.org>
7552
7553         Upgrade to Unicode-4.0.
7554         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7555         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7556         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7557         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7558         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7559         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7560         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7561         Change width of U+E0100..U+E01EF from 1 to 0.
7562
7563 2003-04-25  Bruno Haible  <bruno@clisp.org>
7564
7565         * copy-file.c: Include <stddef.h>, for size_t.
7566
7567 2003-04-25  Jim Meyering  <jim@meyering.net>
7568
7569         * copy-file.c (copy_file_preserving): Declare buf_size to be
7570         of type size_t, not int.
7571
7572 2003-04-11  Jim Meyering  <jim@meyering.net>
7573
7574         Merge changes from Coreutils.
7575
7576         2003-03-22  Jim Meyering  <jim@meyering.net>
7577
7578         * strftime.c (widen): Cast alloca return value to proper type.
7579
7580         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7581
7582         From GNU libc.
7583         * strftime.c (my_strftime): Handle very large width
7584         specifications for numeric values correctly.  Improve checks for
7585         overflow.
7586
7587         2003-01-19  Jim Meyering  <jim@meyering.net>
7588
7589         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7590         (nl_get_alt_digit) [! defined my_strftime]: Define.
7591         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7592         _nl_get_alt_digit and _nl_get_walt_digit.
7593
7594         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7595         These changes have no effect outside of _LIBC.
7596
7597 2003-04-10  Bruno Haible  <bruno@clisp.org>
7598
7599         * findprog.h: New file, from GNU gettext.
7600         * findprog.c: New file, from GNU gettext.
7601
7602 2003-04-05  Jim Meyering  <jim@meyering.net>
7603
7604         Merge changes from Coreutils.
7605
7606         * exclude.h (PARAMS): Remove definition and uses.
7607         * exclude.c: Remove uses of `PARAMS'.
7608
7609         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7610         Add test-cases for DOS filenames. Declare program_name.
7611         (main): Set up program_name.  Patch by Rich Dawe.
7612
7613         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7614         error from mntctl.
7615         Use mntctl's return value to drive the entry-processing loop, since
7616         we can't rely on the value of the vmt_length member in the last
7617         entry.  On some systems doing so could result in exhausting
7618         virtual memory.  Based in part on a patch from Mike Jetzer.
7619
7620 2003-04-04  Bruno Haible  <bruno@clisp.org>
7621
7622         * linebreak.h: New file, from GNU gettext.
7623         * linebreak.c: New file, from GNU gettext with slight modifications.
7624         * lbrkprop.h: New file, from GNU gettext.
7625
7626 2003-04-03  Bruno Haible  <bruno@clisp.org>
7627
7628         * utf8-ucs4.h: New file, from GNU gettext.
7629         * utf16-ucs4.h: New file, from GNU gettext.
7630         * ucs4-utf8.h: New file, from GNU gettext.
7631         * ucs4-utf16.h: New file, from GNU gettext.
7632
7633 2003-04-02  Bruno Haible  <bruno@clisp.org>
7634
7635         * binary-io.h: New file, from GNU gettext.
7636
7637 2003-04-01  Bruno Haible  <bruno@clisp.org>
7638
7639         * pathname.h: New file, from GNU gettext.
7640         * concatpath.c: New file, from GNU gettext.
7641
7642 2003-03-30  Bruno Haible  <bruno@clisp.org>
7643
7644         * copy-file.c (copy_file_preserving): Don't set owner if the function
7645         chown() doesn't exist.
7646
7647 2003-03-28  Bruno Haible  <bruno@clisp.org>
7648
7649         * copy-file.h: New file, from GNU gettext.
7650         * copy-file.c: New file, from GNU gettext.
7651
7652 2003-03-18  Jim Meyering  <jim@meyering.net>
7653
7654         * quote.c (quote_n): Fix typo in comment.
7655
7656 2003-03-14  Jim Meyering  <jim@meyering.net>
7657
7658         Merge changes from Coreutils.
7659         * obstack.h (obstack_object_size): Declare temporary, __o,
7660         to be const, in order to avoid warnings.
7661         (obstack_room): Likewise.
7662         (obstack_empty_p): Likewise.
7663
7664 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7665
7666         Merge changes from Bison.
7667         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7668         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7669         when compiling Bison 1.875's `bitset bset = obstack_alloc
7670         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7671         * hash.c: Include <stdbool.h> unconditionally.
7672
7673 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7674
7675         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7676         Reported by Bruce Becker; see:
7677         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7678
7679 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7680             Bruno Haible  <bruno@clisp.org>
7681
7682         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7683         Reported by John Hughes, see
7684         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7685
7686 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7687
7688         * poll_.h: New file.
7689         * poll.c: New file.
7690
7691 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7692
7693         * mathl.h: New file.
7694         * acosl.c: New file.
7695         * asinl.c: New file.
7696         * atanl.c: New file.
7697         * ceill.c: New file.
7698         * cosl.c: New file.
7699         * expl.c: New file.
7700         * floorl.c: New file.
7701         * frexpl.c: New file.
7702         * ldexpl.c: New file.
7703         * logl.c: New file.
7704         * sincosl.c: New file.
7705         * sinl.c: New file.
7706         * sqrtl.c: New file.
7707         * tanl.c: New file.
7708         * trigl.c: New file.
7709         * trigl.h: New file.
7710
7711 2003-02-17  Bruno Haible  <bruno@clisp.org>
7712
7713         * mkdtemp.h: New file, from GNU gettext.
7714         * mkdtemp.c: New file, from GNU gettext.
7715
7716 2003-01-31  Bruno Haible  <bruno@clisp.org>
7717
7718         * rename.c: #undef rename before defining rpl_rename.
7719         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7720
7721 2003-01-30  Bruno Haible  <bruno@clisp.org>
7722
7723         * printf-args.h: New file, from GNU gettext.
7724         * printf-args.c: New file, from GNU gettext.
7725         * printf-parse.h: New file, from GNU gettext.
7726         * printf-parse.c: New file, from GNU gettext.
7727         * vasnprintf.h: New file, from GNU gettext.
7728         * vasnprintf.c: New file, from GNU gettext.
7729         * asnprintf.c: New file, from GNU gettext.
7730         * vasprintf.h: New file, from GNU gettext with modifications.
7731         * vasprintf.c: New file, from GNU gettext.
7732         * asprintf.c: New file, from GNU gettext.
7733
7734 2003-01-29  Bruno Haible  <bruno@clisp.org>
7735
7736         * stpncpy.h: New file, from GNU gettext with modifications.
7737         * stpncpy.c: New file, from GNU gettext with modifications.
7738
7739 2003-01-28  Bruno Haible  <bruno@clisp.org>
7740
7741         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7742         Paul Eggert.
7743         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7744         Paul Eggert.
7745
7746 2003-01-27  Bruno Haible  <bruno@clisp.org>
7747
7748         * xsetenv.h: New file, from GNU gettext.
7749         * xsetenv.c: New file, from GNU gettext.
7750
7751 2003-01-23  Bruno Haible  <bruno@clisp.org>
7752
7753         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7754
7755 2003-01-22  Bruno Haible  <bruno@clisp.org>
7756
7757         * exit.h: New file, from GNU gettext.
7758
7759 2003-01-11  Bruno Haible  <bruno@clisp.org>
7760
7761         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7762         * strcase.h (strcasecmp, strncasecmp): Likewise.
7763
7764 2003-01-14  Jim Meyering  <jim@meyering.net>
7765
7766         * same.c (same_name): Tweak a comment.
7767
7768 2003-01-11  Bruno Haible  <bruno@clisp.org>
7769
7770         * same.c (same_name): Reorder tests so as to avoid calling stat()
7771         when a string comparison is sufficient.
7772
7773 2003-01-11  Bruno Haible  <bruno@clisp.org>
7774
7775         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7776         'unsigned int'.
7777
7778 2003-01-11  Bruno Haible  <bruno@clisp.org>
7779
7780         * hash-pjw.c: Add comment about low quality of this function.
7781
7782 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7783
7784         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7785         to avoid collisions with libcurses and libreadline.
7786
7787         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7788         * getstr.h, getstr.c: Remove.
7789         * getline.c: Include "getline.h", to check interface.
7790         Move body of old getstr.c here: this defines MIN_CHUNK and
7791         declares getdelim2, which is renamed from getstr.
7792         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7793
7794         * linebuffer.c (readlinebuffer): Renamed from readline.
7795         All uses changed.
7796         * linebuffer.h: Likewise.
7797         (readline): Remove backward-compatibility macro.
7798
7799 2003-01-12  Jim Meyering  <jim@meyering.net>
7800
7801         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7802
7803 2003-01-10  Bruno Haible  <bruno@clisp.org>
7804
7805         * alloca_.h: New file.
7806         * getdate.y: Unconditionally include alloca.h.
7807         * makepath.c: Likewise.
7808         * setenv.c: Likewise.
7809         * userspec.c: Likewise.
7810
7811 2003-01-09  Bruno Haible  <bruno@clisp.org>
7812
7813         * stdbool.h.in: New file.
7814
7815 2003-01-08  Bruno Haible  <bruno@clisp.org>
7816
7817         * safe-read.c: Include specification header first, to ensure its
7818         selfcontainedness.
7819         * full-write.c: Likewise.
7820
7821 2003-01-08  Jim Meyering  <jim@meyering.net>
7822
7823         * full-write.c: Undefine and define-away `const' after inclusion
7824         of errno.h, not before.  Suggestion from Bruno Haible.
7825
7826 2003-01-07  Jim Meyering  <jim@meyering.net>
7827
7828         * full-write.c: Rework so that it may serve to define full_read, too.
7829         * full-read.c: Simply #define FULL_READ and include full-write.c.
7830
7831 2003-01-06  Jim Meyering  <jim@meyering.net>
7832
7833         * version-etc.c: Update year in translatable copyright string.
7834
7835 2002-12-25  Bruno Haible  <bruno@clisp.org>
7836
7837         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7838         * xstrtol.h: Likewise.
7839         * xstrtoimax.c: Likewise.
7840         * xstrtoumax.c: Likewise.
7841         * human.h: Likewise.
7842
7843         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7844         on systems that have <inttypes.h> but not <stdint.h>.
7845
7846 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7847
7848         * memcoll.c (memcoll): Fall back on a simple algorithm using
7849         memcmp if strcoll doesn't work.
7850
7851 2002-12-23  Bruno Haible  <bruno@clisp.org>
7852
7853         * localcharset.h: New file.
7854         * localcharset.c: Include it.
7855         * unicodeio.c: Likewise.
7856
7857 2002-12-22  Bruno Haible  <bruno@clisp.org>
7858
7859         * utime.c (utime_null): No need to call ftruncate if the file was
7860         nonempty.
7861
7862 2002-12-23  Bruno Haible  <bruno@clisp.org>
7863
7864         * memcoll.c (STRCOLL): New macro.
7865         (memcoll): Use it.
7866
7867 2002-12-22  Bruno Haible  <bruno@clisp.org>
7868
7869         * getstr.h (getstr): Define, to avoid clash with libcurses.
7870         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7871
7872 2002-12-22  Bruno Haible  <bruno@clisp.org>
7873
7874         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7875
7876 2002-12-23  Bruno Haible  <bruno@clisp.org>
7877
7878         * getline.h: Include <stddef.h>, for size_t.
7879
7880         * unicodeio.h: Include <stddef.h>, for size_t.
7881         * unicodeio.c: Don't include <stddef.h>.
7882
7883 2002-12-17  Bruno Haible  <bruno@clisp.org>
7884
7885         * canon-host.c (strdup): Remove unused declaration.
7886
7887         * fsusage.c: Include full_read.h.
7888         (get_fs_usage): Use full_read instead of safe_read.
7889
7890         * utime.c (utime_null): Use SAFE_READ_ERROR.
7891
7892 2002-12-11  Bruno Haible  <bruno@clisp.org>
7893
7894         * setenv.h: Rewritten to cope with systems that have setenv() but not
7895         unsetenv().
7896         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7897         modifications:
7898
7899         2002-12-11  Bruno Haible  <bruno@clisp.org>
7900
7901                 * setenv.c (alloca): Fall back to malloc.
7902                 (freea): New macro.
7903                 (setenv): Use freea() to free memory allocated with alloca().
7904
7905         2002-11-13  Bruno Haible  <bruno@clisp.org>
7906
7907                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7908                 function declarations.
7909                 * unsetenv.c (unsetenv): Likewise.
7910
7911         2002-03-04  Bruno Haible  <bruno@clisp.org>
7912
7913                 Portability to AIX 4.3.3.
7914                 * unsetenv.c: New file, extracted from setenv.c.
7915                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7916
7917         2001-12-20  Bruno Haible  <bruno@clisp.org>
7918
7919                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7920                 use malloc instead. For SunOS 4.
7921
7922         2001-12-11  Bruno Haible  <bruno@clisp.org>
7923
7924                 * setenv.c: Declare alloca.
7925                 (compar_fn_t): New typedef.
7926                 (KNOWN_VALUE, STORE_VALUE): Use it.
7927
7928         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7929         setenv.h.
7930
7931 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7932
7933         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7934         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7935         Choose values that are less likely to collide with system fnmatch
7936         options.
7937         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7938         defined (e.g., a pure POSIX system).
7939         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7940         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7941
7942 2002-12-06  Jim Meyering  <jim@meyering.net>
7943
7944         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7945
7946         Merge in changes from libc's misc/error.c, in preparation
7947         for the merge of gnulib's changes back into libc.
7948
7949         * error.c (_): Define only if not already defined.
7950         Move definition to follow all #include directives.
7951         Include unlocked-io.h only if !_LIBC.
7952         [_LIBC]: Include <libio/libioP.h>.
7953         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7954         (fflush): Tweak definition to use INTUSE.
7955         (putc): Define.
7956
7957 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7958
7959         * alloca.c [defined emacs]: Include "lisp.h".
7960         (xalloc_die) [defined emacs]: New macro.
7961         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7962         [! defined emacs]: Include <xalloc.h>.
7963         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7964         (pointer): Typedef to POINTER_TYPE *.
7965         (malloc): Remove decl; we now always use xmalloc.
7966         (alloca): Use old-style definition, since Emacs needs this.
7967         Check for arithmetic overflow when computing combined size.
7968
7969 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7970
7971         Do not generate unlocked-io.h automatically, since it's easier to
7972         maintain it by hand.
7973
7974         * unlocked-io.h: New file, from GNU diffutils,
7975         but with proper copyright notice and attribution.
7976         * gen-uio: Remove.
7977         * Makefile.am: Add copyright notice.
7978         (libfetish_a_SOURCES): Add unlocked-io.h.
7979         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7980         (DISTCLEANFILES, io_functions): Remove macros.
7981         (EXTRA_DIST): Remove gen_uio.
7982         (unlocked-io.h): Remove rule.
7983
7984 2002-12-04  Jim Meyering  <jim@meyering.net>
7985
7986         Reflect the fact that stat.c and lstat.c are no longer generated.
7987         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7988         (DISTCLEANFILES): Likewise.
7989         (EXTRA_DIST): Likewise.
7990         (all_local): Don't depend on stat.c or lstat.c.
7991         (stat.c, lstat.c): Remove rules.
7992         (EXTRA_DIST): Remove xstat.in.
7993
7994         * xstat.in: Remove file.  Contents moved into stat.c.
7995         * stat.c: New file.  Contents mostly from xstat.in.
7996         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7997         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7998
7999         * safe-read.c: Rework so that it may serve to define safe_write, too.
8000         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8001
8002 2002-12-03  Jim Meyering  <jim@meyering.net>
8003
8004         * safe-read.c, safe-write.c: Change variable names and comments, but
8005         not semantics, to minimize the differences between these two files.
8006         (safe_read): Change comment to mention SAFE_READ_ERROR.
8007
8008         * safe-read.c (IS_EINTR): Define.
8009         (safe_read): Use IS_EINTR in place of in-function cpp directives.
8010
8011 2002-12-02  Bruno Haible  <bruno@clisp.org>
8012
8013         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8014         Define, taken from safe-read.c.
8015         (INT_MAX): Provide fallback.
8016         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8017         * safe-write.h (SAFE_WRITE_ERROR): Define.
8018
8019         * safe-read.c (EINTR): Remove definition.
8020         (safe_read): Don't use EINTR if it is absent.
8021
8022 2002-12-02  Jim Meyering  <jim@meyering.net>
8023
8024         * safe-read.c (EINTR): Define.
8025         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8026         (INT_MAX): Provide fallback.
8027         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8028
8029         * safe-read.h (SAFE_READ_ERROR): Define.
8030
8031 2002-12-01  Jim Meyering  <jim@meyering.net>
8032
8033         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8034         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8035
8036 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8037
8038         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8039         hash_rehash): Replace `if (limit <= value) abort ();' with
8040         `if (! (value < limit)) abort ();', for readability.
8041
8042 2002-11-26    <karl@gnu.org>
8043
8044         * strdup.c: copy from libc again, with jim's ok.
8045         * .cppi-disable: re-add strdup.c
8046
8047 2002-11-25    <karl@gnu.org>
8048
8049         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8050         instead of "strtol.c".
8051
8052 2002-11-25  Jim Meyering  <jim@meyering.net>
8053
8054         * mktime.c: Sync from libc, now that it has the latest fix.
8055
8056 2002-11-24    <karl@gnu.org>
8057
8058         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8059         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8060
8061 2002-11-24  Jim Meyering  <jim@meyering.net>
8062
8063         Update from coreutils:
8064
8065         * mktime.c: Merge in changes from libc.
8066
8067         Avoid a link-time failure on some Linux systems.
8068         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8069         (__mon_yday): Declare with the STATIC attribute.
8070         (__mktime_internal): Likewise.
8071         Based on a report from Greg Schafer.
8072
8073 2002-11-23  Jim Meyering  <jim@meyering.net>
8074
8075         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8076         Use `unsigned', not `int', as type of index.
8077
8078         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8079
8080         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8081
8082 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8083
8084         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8085         hint that one should use `if (! x) abort ();' rather than `assert
8086         (x);', and anyway it's one less thing to worry about configuring.
8087         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8088         hash_rehash, hash_insert): Use abort rather than assert.
8089
8090 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8091
8092         * quotearg.h: Allow multiple inclusion by surrounding with
8093         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8094         so that we can be included first.
8095         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8096         * quotearg.c: Include quotearg.h immediately after config.h.
8097         No need to include stddef.h or sys/types.h any more.
8098         Surround local include files with "", not "<>".
8099         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8100         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8101         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8102         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8103         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8104         (ISPRINT): Remove; no longer needed now that we assume C89.
8105
8106         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8107         Preserve errno.
8108
8109         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8110         quotearg_char): Use SIZE_MAX rather than
8111         (size_t) -1 when we are talking about "infinity".
8112
8113         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8114
8115 2002-11-22  Bruno Haible  <bruno@clisp.org>
8116
8117         * safe-read.h: Assume C89. Add comments.
8118         (safe_read): Change return type to size_t.
8119         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8120         counts > SSIZE_MAX correctly.
8121         * safe-write.h: New file.
8122         * safe-write.c: New file.
8123         * full-read.h: New file.
8124         * full-read.c: New file.
8125         * full-write.h: Assume C89. Add comments.
8126         * full-write.c: Include safe-write.h.
8127         (full_write): Rewritten to use safe_write.
8128         Suggested by Jim Meyering and Paul Eggert.
8129
8130 2002-11-21  Bruno Haible  <bruno@clisp.org>
8131
8132         Remove case insensitive option matching.
8133         * argmatch.h (argcasematch): Remove declaration.
8134         (ARGCASEMATCH): Remove macro.
8135         (__xargmatch_internal): Remove case_sensitive argument.
8136         (XARGMATCH): Update.
8137         (XARGCASEMATCH): Remove macro.
8138         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8139         case_sensitive argument.
8140         (argcasematch): Remove function.
8141         (__xargmatch_internal): Remove case_sensitive argument.
8142         (main): Use XARGMATCH instead of XARGCASEMATCH.
8143
8144         * xmalloc.c: Change compile-time error message. Add comment about
8145         required autoconf version.
8146
8147 2002-11-21  Jim Meyering  <jim@meyering.net>
8148
8149         * strdup.c (strdup): Tweak comment and initial #if/#include.
8150
8151         Merge in changes from the coreutils.
8152
8153         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8154         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8155         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8156         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8157         int.  Work more efficiently if X is the same width as uintmax_t.
8158         Do not compare X to -1, to avoid bogus compiler warning.
8159         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8160         Don't assume that f_frsize and f_bsize are the same type.
8161
8162         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8163         on FreeBSD.
8164
8165         * makepath.c (make_path): Restore umask *before* creating the final
8166         component.
8167         (make_path): Minor reformatting.
8168
8169         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8170         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8171
8172         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8173         ones.  At least on GNU/Linux systems, `auto' means something else.
8174         From Michael Stone.
8175
8176 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8177
8178         Merge argmatch cleanups from Bison.  Assume C89.
8179
8180         * argmatch.c: Include config.h here, not in argmatch.h.
8181         Include stdlib.h, for EXIT_FAILURE.
8182         Always include <string.h>, since we assume C89.
8183         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8184         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8185         Include <stddef.h> instead, since it's all we need for size_t.
8186         (PARAMS): Remove.  All uses removed.
8187         (ARRAY_CARDINALITY): Do not bother to #undef.
8188         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8189         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8190         Remove unnecessary parentheses.
8191         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8192         Insert necessary parentheses.
8193         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8194         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8195
8196 2002-11-19  Bruno Haible  <bruno@clisp.org>
8197
8198         * mbswidth.c: Include mbswidth.h right at the beginning.
8199         * mbswidth.h: Include <stddef.h>, for size_t.
8200
8201         * mbswidth.h (PARAMS): Remove macro.
8202         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8203         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8204
8205         * gcd.h (PARAMS): Remove macro.
8206         (gcd): Use ANSI C function declarations.
8207         * gcd.c (gcd): Likewise.
8208
8209 2002-11-15  Bruno Haible  <bruno@clisp.org>
8210
8211         * strcspn.c: Include <stddef.h>.
8212         (strcspn): Use ANSI C function declaration. Change return type to
8213         size_t. Use NULL.
8214         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8215         (strpbrk): Use NULL.
8216         * strpbrk.h (PARAMS): Remove macro.
8217         (strpbrk): Use ANSI C function declaration.
8218         * strstr.c: Don't include <sys/types.h>.
8219         * strstr.h (PARAMS): Remove macro.
8220         (strstr): Use ANSI C function declarations.
8221
8222 2002-11-06  Bruno Haible  <bruno@clisp.org>
8223
8224         * gcd.h (gcd): Change argument type to 'unsigned long'.
8225         * gcd.c (gcd): Likewise.
8226
8227 2002-11-05  Bruno Haible  <bruno@clisp.org>
8228
8229         * gcd.h: New file, from gettext-0.11.5.
8230         * gcd.c: New file, from gettext-0.11.5.
8231
8232 2002-11-05  Bruno Haible  <bruno@clisp.org>
8233
8234         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8235         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8236         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8237         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8238
8239         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8240         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8241
8242         * closeout.c: Include gettext.h instead of <libintl.h>.
8243         * human.c: Include gettext.h instead of <libintl.h>.
8244         * quotearg.c: Include gettext.h instead of <libintl.h>.
8245         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8246         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8247         * userspec.c: Include gettext.h instead of <libintl.h>.
8248         * version-etc.c: Include gettext.h instead of <libintl.h>.
8249         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8250         (textdomain): Remove definition.
8251         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8252
8253         * long-options.c: Remove include of <libintl.h> and definition of _.
8254         * same.c: Remove include of <libintl.h> and definition of _.
8255
8256 2002-11-04  Bruno Haible  <bruno@clisp.org>
8257
8258         * stpcpy.h: New file, from GNU gettext-0.11.5.
8259         * strcase.h: New file, from GNU gettext-0.11.5.
8260         * strpbrk.h: New file, from GNU gettext-0.11.5.
8261         * strstr.h: New file, from GNU gettext-0.11.5.
8262         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8263
8264 2002-05-09  Bruno Haible  <bruno@clisp.org>
8265
8266         * config.charset: Update for newest glibc. Add canonical names
8267         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8268
8269 2002-05-09  Bruno Haible  <bruno@clisp.org>
8270
8271         * localcharset.c (get_charset_aliases): Add more Windows specific
8272         aliases.
8273
8274 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8275
8276         * config.charset: A few additions for Solaris.
8277
8278 2001-12-05  Bruno Haible  <bruno@clisp.org>
8279
8280         * localcharset.c (locale_charset): Don't return an empty string.
8281
8282 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8283
8284         * config.charset: msdos in uk_UA uses CP1125.
8285
8286 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8287
8288         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8289         * localcharset.c (locale_charset): Declare as extern "C".
8290
8291 2002-02-15  Bruno Haible  <bruno@clisp.org>
8292
8293         * config.charset [msdosdjgpp]: For Russian, use CP866.
8294
8295 2002-02-11  Bruno Haible  <bruno@clisp.org>
8296
8297         * config.charset: Add support for NetBSD.
8298
8299 2002-09-25    <karl@gnu.org>
8300
8301         * strdup.c: copy from libc/string (via ../config/srclist*).
8302         * getopt*: copy from libc/posix.
8303         * gettext.h: copy from gettext.
8304         * .cppi-disable: add strdup.c, gettext.h.
8305
8306 2002-07-01  Jim Meyering  <meyering@lucent.com>
8307
8308         * c-stack.c: Include sys/time.h.
8309         From Volker Borchert.
8310
8311 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8312
8313         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8314         New macro.  Use it uniformly instead of
8315         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8316         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8317         reported by Vin Shelton.
8318
8319 2002-06-22  Jim Meyering  <meyering@lucent.com>
8320
8321         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8322         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8323
8324 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8325
8326         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8327         Do not assume SA_SIGINFO behavior.
8328         Bug reported by Jim Meyering on NetBSD 1.5.2.
8329
8330 2002-06-22  Jim Meyering  <meyering@lucent.com>
8331
8332         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8333
8334         * exitfail.c, exitfail.h: Likewise.
8335         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8336
8337         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8338         of fnmatch.h.
8339         (EXTRA_DIST): Add fnmatch_loop.c.
8340         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8341
8342         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8343         * fnmatch.c: Update from diffutils-2.8.2.
8344         * fnmatch_.h: New file.  From diffutils-2.8.2.
8345         * fnmatch.h: Remove file.
8346
8347 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8348
8349         * file-type.h: Report an error if neither S_ISREG nor
8350         S_IFREG is defined, instead of using a test specific to glibc
8351         2.2.  This should be safe, since POSIX requires S_ISREG and
8352         Unix Version 7 had S_IFREG.  We don't need to check for
8353         <sys/types.h> since we don't use any symbols that it defines.
8354
8355 2002-06-15  Jim Meyering  <meyering@lucent.com>
8356
8357         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8358         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8359         have been included before this file.
8360
8361 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8362
8363         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8364         so that each temporary file name is unique and valid in the first
8365         8 characters, for operation under DOS.
8366
8367 2002-06-15  Jim Meyering  <meyering@lucent.com>
8368
8369         Work even with DJGPP 2.03, which lacks support for symlinks.
8370         From Richard Dawe.
8371         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8372         is defined.
8373         * lchown.c (S_ISLNK): Likewise.
8374
8375 2002-06-14  Jim Meyering  <meyering@lucent.com>
8376
8377         * file-type.h: Use the version from diffutils-2.8.2.
8378         * file-type.c: Likewise.
8379
8380 2002-05-27  Jim Meyering  <meyering@lucent.com>
8381
8382         Fix a problem seen only on nonconforming systems whereby ls.c's
8383         use of localtime, and then of gettimeofday would cause trouble:
8384         the localtime call used to initialize rpl_gettimeofday's save
8385         mechanism would clobber ls's current local time information so
8386         that in any long listing the first file would always be listed
8387         with date 1970-01-01.  Analysis by Volker Borchert.
8388
8389         * gettimeofday.c (localtime): Undefine.
8390         (rpl_localtime): New function.
8391
8392 2002-05-22  Jim Meyering  <meyering@lucent.com>
8393
8394         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8395         * file-type.h: New file.
8396         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8397
8398 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8399
8400         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8401
8402 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8403
8404         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8405         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8406         of 127, since 64 is the largest conceivable number for ancient
8407         nonstandard hosts.
8408         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8409
8410 2002-04-28  Jim Meyering  <meyering@lucent.com>
8411
8412         * sig2str.c (WTERMSIG): Remove definition (unused).
8413
8414 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8415
8416         * sig2str.h, sig2str.c: New files.
8417         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8418
8419 2002-04-24  Jim Meyering  <meyering@lucent.com>
8420
8421         * gettext.h: New file, from Gettext.
8422         * Makefile.am (INCLUDES): Remove -I../intl.
8423         (libfetish_a_SOURCES): Add gettext.h.
8424
8425 2002-04-16  Jim Meyering  <meyering@lucent.com>
8426
8427         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8428         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8429         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8430
8431 2002-04-12  Jim Meyering  <meyering@lucent.com>
8432
8433         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8434
8435 2002-03-10  Jim Meyering  <meyering@lucent.com>
8436
8437         * makepath.c (make_path): Remove a comma from a diagnostic.
8438         Suggestion from Santiago Vila.
8439
8440 2002-03-08  Jim Meyering  <meyering@lucent.com>
8441
8442         * rename.c: Mention that this wrapper is needed also on
8443         mips-dec-ultrix4.4 systems.
8444
8445 2002-03-02  Jim Meyering  <meyering@lucent.com>
8446
8447         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8448         not HAVE_CLOCK_SETTIME.
8449
8450 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8451
8452         * nanosleep.h: Rename to....
8453         * timespec.h: New name for nanosleep.h.  All uses changed.
8454
8455         * gettime.c: New file.
8456         * settime.c: New file.
8457         * stime.c: Remove.
8458
8459         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8460         timespec.h.  Remove nanosleep.h.
8461
8462 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8463
8464         * acl.c, acl.h: New files.
8465         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8466
8467 2002-02-24  Jim Meyering  <meyering@lucent.com>
8468
8469         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8470         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8471         cause trouble.  Reported by Nelson Beebe.
8472
8473 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8474
8475         * path-concat.c (xpath_concat): Reorder code to pacify
8476         compilers that don't know that xalloc_die never returns.
8477
8478 2002-02-20  Jim Meyering  <meyering@lucent.com>
8479
8480         * getdate.c: Regenerate using bison-1.33.
8481
8482 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8483
8484         * posixver.c, posixver.h: New files.
8485         * Makefile.am (libfetish_a_SOURCES): Add them.
8486
8487 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8488             Bruno Haible  <bruno@clisp.org>
8489
8490         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8491         (fwrite_success_callback): New declaration.
8492         * unicodeio.c (unicode_to_mb): New function, extracted from
8493         print_unicode_char. Call failure callback instead of error.
8494         (fwrite_success_callback): New function.
8495         (exit_failure_callback): New function.
8496         (fallback_failure_callback): New function.
8497         (print_unicode_char): Call unicode_to_mb.
8498
8499 2002-01-26  Jim Meyering  <meyering@lucent.com>
8500
8501         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8502
8503 2002-01-22  Jim Meyering  <meyering@lucent.com>
8504
8505         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8506         Otherwise, some versions of automake would omit the rule that makes
8507         Makefile from Makefile.in.
8508
8509 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8510
8511         * xmemcoll.h, xmemcoll.c: New files.
8512         * Makefile.am (libfetish_a_SOURCES): Add them.
8513         * memcoll.c: Include errno.h, and declare errno if not defined.
8514         (memcoll): Set errno to zero if there is no error.
8515
8516         * quotearg.c (quotearg_buffer_restyled):
8517         Fix bug with quoting buffers containing NUL when backslashing escapes.
8518         This bug was exposed by the other changes in this patch.
8519         (quotearg_n_options): New arg ARGSIZE.
8520         All callers changed.
8521         (quoting_options_from_style): New function.
8522         (quotearg_n_style): Use it.
8523         (quotearg_n_style_mem): New function.
8524
8525         * quotearg.h (quotearg_n_style_mem): New function.
8526
8527 2002-01-16  Jim Meyering  <meyering@lucent.com>
8528
8529         * getdate.y: Add three semicolons, each just before a closing brace.
8530         Bison (as of version 1.31) no longer papers over that mistake.
8531
8532 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8533
8534         * backupfile.c (ISDIGIT): Comment fix.
8535         * getdate.y (ISDIGIT): Likewise.
8536         * posixtm.c (ISDIGIT, year): Likewise.
8537         * strverscmp.c (ISDIGIT): Likewise.
8538         * userspec.c (ISDIGIT): Likewise.
8539
8540 2002-01-05  Jim Meyering  <meyering@lucent.com>
8541
8542         * version-etc.c (version_etc_copyright): Update copyright year.
8543
8544 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8545
8546         * closeout.c (close_stdout_status): If ferror (stdout), do
8547         not silently exit merely because the output buffer happens to
8548         have nothing pending.
8549
8550 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8551
8552         See the big note in ../ChangeLog.
8553         * human.c (suffixes): Prefer K to k for 1024.
8554         (generate_suffix_backwards): New function.
8555         (human_readable_inexact): Use it.
8556         * xstrtol.c (__xstrtol): If there is no number but there
8557         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8558         Accept 'K' as well as 'k'.
8559
8560 2001-12-15  Jim Meyering  <meyering@lucent.com>
8561
8562         * regex.h (__restrict_arr): Update from libc.
8563
8564         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8565         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8566         (STREQ): Define.
8567
8568 2001-12-10  Jim Meyering  <meyering@lucent.com>
8569
8570         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8571         Instead, include "xalloc.h".
8572         (initbuffer): Don't cast xmalloc return value to char*.
8573         (readline): Reword comment.
8574         Don't cast xrealloc return value to char*
8575         Return NULL, not 0.
8576
8577 2001-12-09  Jim Meyering  <meyering@lucent.com>
8578
8579         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8580         `signed and unsigned type in conditional expression'.
8581         * posixtm.c (posix_time_parse): Likewise.
8582
8583         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8584
8585         * readtokens.c (readtoken): Declare an index to be of type unsigned
8586         to avoid a pedantic warning.
8587
8588         * getstr.c: Don't include assert.h.
8589         (getstr): Remove warning-evoking assertions.
8590         Return -1 if offset parameter is out of bounds.
8591         Change the type of a local from int to size_t.
8592
8593         * strftime.c (my_strftime_localtime_r): Include this function
8594         definition in the `#if ! HAVE_TM_GMTOFF' block.
8595
8596         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8597         Include xalloc.h instead.
8598
8599 2001-12-02  Jim Meyering  <meyering@lucent.com>
8600
8601         * tempname.c: Don't declare getenv, thus reverting the change of
8602         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8603         included.
8604
8605         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8606         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8607
8608 2001-11-30  Akim Demaille  <akim@epita.fr>
8609
8610         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8611         before being defined.
8612
8613 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8614
8615         * quotearg.h (quotearg_n, quotearg_n_style):
8616         First arg is int, not unsigned.
8617         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8618         (SIZE_MAX, UINT_MAX): New macros.
8619         (quotearg_n_options): Abort if N is negative.
8620         Avoid overflow check on hosts where size_t is 64 bits and int
8621         is 32 bits, as overflow is impossible there.
8622         Fix off-by-one typo that caused unnecessary reallocation.
8623
8624 2001-11-27  Jim Meyering  <meyering@lucent.com>
8625
8626         * tempname.c: Merge with version from libc.
8627         * regex.c: Likewise.
8628
8629         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8630         for which STDC_HEADERS is 0, it was not included, resulting in a
8631         warning about an integer-to-pointer conversion problem with getenv.
8632         Reported by Volker Borchert.
8633
8634 2001-11-26  Jim Meyering  <meyering@lucent.com>
8635
8636         * gtod.h: Remove file.
8637         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8638         * gettimeofday.c: Don't include gtod.h.
8639         (GTOD_init): Remove function.
8640         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8641         Suggestion from Volker Borchert.
8642
8643 2001-11-23  Jim Meyering  <meyering@lucent.com>
8644
8645         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8646         * hash.c (struct hash_table): Define it here instead.
8647
8648 2001-11-22  Jim Meyering  <meyering@lucent.com>
8649
8650         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8651
8652 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8653
8654         * tempname.c (TMP_MAX): Remove; no longer needed.
8655         (TEMPORARIES): New macro.
8656         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8657         removes an artificial limitation (e.g. HP-UX 10.20, where
8658         TMP_MAX is 17576).
8659
8660 2001-11-18  Jim Meyering  <meyering@lucent.com>
8661
8662         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8663         on SunOS 4.
8664
8665         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8666         files will be created before anything else.
8667
8668 2001-11-17  Jim Meyering  <meyering@lucent.com>
8669
8670         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8671         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8672         rather than group writable.  Patch by Juan F. Codagnone.
8673
8674         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8675         Instead, include "xalloc.h".
8676
8677         * mountlist.c: Include unlocked-io.h after all system headers.
8678         Remove explicit declarations of xmalloc, xrealloc,
8679         and xstrdup.  Instead, include "xalloc.h".
8680
8681         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8682         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8683         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8684
8685         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8686         Reported by Padraig Brady.
8687
8688         * mkstemp.c: #undef mkstemp.
8689         Include config.h.
8690         (rpl_mkstemp): Rename from mkstemp.
8691         Protoize.
8692
8693 2001-11-16  Jim Meyering  <meyering@lucent.com>
8694
8695         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8696         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8697         determine the amount of total physical memory, use pstat_getstatic.
8698         HPUX-11 doesn't define _SC_PHYS_PAGES.
8699         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8700         If sysconf couldn't be used to determine the amount of available
8701         physical memory, use both pstat_getstatic and pstat_getdynamic.
8702         Based on a patch from Bob Proulx.
8703
8704 2001-11-05  Jim Meyering  <meyering@lucent.com>
8705
8706         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8707
8708 2001-11-03  Jim Meyering  <meyering@lucent.com>
8709
8710         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8711         in argmatch_to_argument call.
8712
8713         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8714         argument.
8715
8716         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8717         e.g., a fault due to an attempt to free a NULL pointer.
8718
8719 2001-11-01  Jim Meyering  <meyering@lucent.com>
8720
8721         * dirfd.c, dirfd.h: New files.
8722         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8723
8724         * hash.c (hash_print) [TESTING]: Clean up.
8725
8726 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8727
8728         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8729         to avoid a warning if -Wall.
8730
8731 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8732
8733         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8734
8735 2001-10-21  Jim Meyering  <meyering@lucent.com>
8736
8737         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8738         this code would end up calling gettext even in packages built
8739         with --disable-nls.
8740         * getopt.c (_): Likewise.
8741         * regex.c (_): Likewise.
8742
8743 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8744
8745         * error.c (strerror_r): Do not declare unless !_LIBC.
8746         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8747         Use strerror_r that is only a macro, even if it is not a function.
8748         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8749         (private_strerror): Use prototypes, not old-style function definition.
8750         (print_errno_message): New function.
8751         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8752         char*-flavored one.
8753         (error_tail, error, error_at_line): Use it.
8754
8755 2001-10-11  Jim Meyering  <meyering@lucent.com>
8756
8757         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8758         and quote_n (1, ... to avoid clobbering a buffer.
8759
8760 2001-10-05  Jim Meyering  <meyering@lucent.com>
8761
8762         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8763         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8764         * hash-pjw.h: New file.
8765
8766 2001-09-30  Jim Meyering  <meyering@lucent.com>
8767
8768         * mountlist.c [MOUNTED_GETFSSTAT]:
8769         Include <sys/ucred.h>, for Apple Darwin.
8770         Include sys/mount.h and sys/fs_types.h only if available.
8771         (FS_TYPE): Define.
8772         (read_filesystem_list): Use FS_TYPE.
8773
8774 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8775
8776         * exclude.c (excluded_filename): 0 -> false, since it's
8777         a boolean context.
8778
8779 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8780
8781         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8782         #defines strtoimax.  Also treat the other strto* functions
8783         like strtoimax.
8784
8785         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8786         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8787         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8788
8789 2001-09-26  Jim Meyering  <meyering@lucent.com>
8790
8791         Most macros in unlocked-io.h had the wrong number of arguments.
8792         * gen-uio: New script.
8793         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8794         * unlocked-io.hin: Remove file.
8795         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8796         rather than trying to embed it here.
8797         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8798         Reported by Padraig Brady.
8799
8800 2001-09-25  Volker Borchert  <bt@teknon.de>
8801
8802         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8803
8804 2001-09-23  Jim Meyering  <meyering@lucent.com>
8805
8806         * mountlist.c: Remove useless parentheses in #if directives.
8807         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8808         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8809
8810 2001-09-22  Jim Meyering  <meyering@lucent.com>
8811
8812         * localcharset.c: Update from latest gettext.
8813         * config.charset: Likewise.
8814
8815 2001-09-20  Jim Meyering  <meyering@lucent.com>
8816
8817         * xstrtol.c (strtoimax): Guard declaration with
8818         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8819         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8820         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8821         (strtoumax): Likewise, for completeness (it wasn't necessary).
8822
8823 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8824
8825         * strtoimax.c (HAVE_LONG_LONG):
8826         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8827         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8828         to work around bug in IBM C compiler.
8829
8830 2001-09-16  Jim Meyering  <meyering@lucent.com>
8831
8832         * mkdir.c: New file.
8833
8834 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8835
8836         * xgetcwd.c: Revert some of the previous change; intead,
8837         fix the HAVE_GETCWD_NULL code to behave more like the
8838         !HAVE_GETCWD_NULL code used to.
8839
8840         Include "xalloc.h".
8841         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8842         invoke xalloc_die.
8843
8844 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8845
8846         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8847         Use ssize_t, not int, to store result of readlink.
8848         Check for ssize_t overflow as well as size_t overflow,
8849         as POSIX says the result of readlink is implementation-defined
8850         when ssize_t overflows.
8851         Remove unnecessary cast to char*.
8852         Use free+malloc instead of realloc, as the storage doesn't need
8853         to be preserved and it's clearer and can be more efficient that way.
8854         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8855         * xreadlink.h (xreadlink): Update prototype.
8856
8857 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8858
8859         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8860         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8861         spotted by Jim Meyering.
8862
8863 2001-09-03  Jim Meyering  <meyering@lucent.com>
8864
8865         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8866
8867 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8868
8869         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8870         like the HAVE_GETCWD_NULL code.
8871         Include pathmax.h if not HAVE_GETCWD.
8872         Do not include xalloc.h.
8873         (INITIAL_BUFFER_SIZE): New symbol.
8874         Do not use xmalloc / xrealloc, since the caller is responsible for
8875         handling errors.  Preserve errno around `free' during failure.
8876         Do not overrun buffer when using getwd.
8877
8878 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8879
8880         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8881         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8882
8883 2001-09-02  Jim Meyering  <meyering@lucent.com>
8884
8885         * error.c: Update from GNU libc.
8886
8887 2001-09-01  Jim Meyering  <meyering@lucent.com>
8888
8889         * xreadlink.c: New file.
8890         * xreadlink.h: New file.
8891         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8892
8893         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8894         doesn't conflict with sparc Solaris 7's definition in
8895         /usr/include/sys/int_types.h.
8896
8897         * exclude.c: Use `""', not `<>' to #include non-system header files.
8898         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8899         and strncasecmp as r-values.  Unixware didn't have declarations.
8900
8901 2001-08-31  Jim Meyering  <meyering@lucent.com>
8902
8903         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8904         Use an initial, malloc'd, buffer of length 128 rather than
8905         a statically allocated one of length 1024.
8906
8907 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8908
8909         * xgetcwd.c: Don't include pathmax.h.
8910         Include stdlib.h and unistd.h if available.
8911         Include xalloc.h.
8912         (xmalloc, xstrdup, free): Remove decls.
8913         (xgetcwd): Don't assume sizes fit in unsigned.
8914         Check for overflow when computing sizes.
8915         Simplify reallocation code.
8916
8917 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8918
8919         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8920
8921         * strtoimax.c: Renamed from strtoxmax.c, removing the
8922         old strtoimax.c.
8923
8924         Also, make the following further changes to make this file's
8925         configuration more similar to that of strtol.c:
8926         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8927         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8928         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8929         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8930         changed to signed values.
8931
8932         And make the following changes as well:
8933         Fix copyright notice, as 1999 was missing.
8934         (verify): New macro.
8935         (strtoimax): Check sizes at compile-time, not run-time.
8936         Prefer strtol to strtoll if both work.
8937         (main): Remove; it was not that useful and was a pain to maintain.
8938
8939         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8940
8941 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8942
8943         * savedir.c (savedir): Remove size parameter, as POSIX says that
8944         a directory's st_size can have an arbitrary value, so the old
8945         usage could waste an arbitrary amount of memory.  All uses
8946         changed.
8947         * savedir.h: Update prototype.
8948
8949 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8950
8951         * xstrtol.c (strtoimax): New decl.
8952
8953 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8954
8955         * xstrtol.h: Add copyright notice.
8956         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8957         LONGINT_INVALID_SUFFIX_CHAR.
8958
8959 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8960
8961         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8962         tm to be declared.
8963
8964 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8965
8966         * hash.c: Remove '2001' from copyright notice.
8967
8968 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8969
8970         * full-write.h: New file.
8971         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8972         * full-write.c: Correct credits, as cccp.c no longer
8973         exists and anyway it was so heavily changed from the old cccp
8974         code as to be unrecognizable.  Include full-write.h.
8975         (full_write) Return size_t, with short writes meaning failure.
8976         All callers changed.  This fixes a bug with large buffers
8977         on 64-bit hosts.
8978         * utime.c: Include full-write.h.
8979
8980 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8981
8982         Merge 'exclude' changes from tar 1.13.22.
8983         This fixes one or two unlikely storage allocation overflow bugs,
8984         but doesn't change user-visible behavior otherwise.
8985
8986 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8987
8988         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8989         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8990         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8991         Include if available.
8992         (<xalloc.h>): Include
8993         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8994         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8995         collide with FNM macros.
8996         (struct patopts): New struct.
8997         (struct exclude): Use it, as exclude patterns now come with options.
8998         (new_exclude): Support above changes.
8999         (new_exclude, add_exclude_file):
9000         Initial size must now be a power of two to simplify overflow checking.
9001         (free_exclude, fnmatch_no_wildcards): New function.
9002         (excluded_filename): No longer requires options arg, as the options
9003         are determined by add_exclude.  Now returns bool, not int.
9004         (excluded_filename, add_exclude):
9005         Add support for the fancy new exclusion options.
9006         (add_exclude, add_exclude_file): Now takes int options arg.
9007         Check for arithmetic overflow when computing sizes.
9008         (add_exclude_file): xrealloc might modify errno, so don't
9009         realloc until after errno might be used.
9010
9011         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9012         New macros.
9013         (free_exclude): New decl.
9014         (add_exclude, add_exclude_file): Now takes int options arg.
9015         (excluded_filename): No longer requires options arg, as the options
9016         are determined by add_exclude.  Now returns bool, not int.
9017
9018 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9019
9020         * alloca.c (alloca): Arg is of type size_t, not unsigned.
9021
9022 2001-08-27  Jim Meyering  <meyering@lucent.com>
9023
9024         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9025
9026         * version-etc.c (N_): Remove definition.
9027         Revert most of last change.
9028         Instead, simply don't mark the `Copyright...' string for translation.
9029         Based on advice from Paul Eggert.
9030
9031         * strtoxmax.c: Tweak comment.
9032
9033 2001-08-26  Jim Meyering  <meyering@lucent.com>
9034
9035         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9036         of copyright with `%s' so translators don't get an untranslated
9037         message in 2002.
9038         (COPYRIGHT_YEAR): Define.
9039         (version_etc): Use fprintf rather than fputs.
9040         Suggestion from Ulrich Drepper.
9041
9042         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9043
9044         * strtoll.c: New file, from GNU libc.
9045         * xstrtoimax.c: New file.
9046
9047         * xstrtol.h: Add xstrtoimax.
9048         * strtoumax.c: New file.  Simply include "strtoumax.c".
9049         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9050
9051         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9052         * strtoxmax.c: ... then renamed to this.
9053
9054 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9055
9056         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9057         Port to Solaris 8, where 'sed' requires a space after the 'r'
9058         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9059         Redirect output to $tmp just once.
9060
9061 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9062
9063         * addext.c (<errno.h>): Include.
9064         (errno): Declare if not defined.
9065         (addext): Work correctly when pathconf returns -1 and leaves
9066         errno alone because there is no limit.  Also, work even if
9067         pathconf returns a value greater than SIZE_MAX.
9068
9069 2001-08-12  Jim Meyering  <meyering@lucent.com>
9070
9071         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9072         Simply `return getcwd (NULL, 0);'.
9073         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9074         Use 1300 as initial value for length, not PATH_MAX.
9075
9076         * pathmax.h: Clean up cpp syntax.
9077
9078 2001-08-12  Jim Meyering  <meyering@lucent.com>
9079
9080         * gettimeofday.c: New file.
9081         * gtod.h: New file.
9082         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9083
9084 2001-08-04  Jim Meyering  <meyering@lucent.com>
9085
9086         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9087         to get in sync with glibc.
9088
9089 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9090
9091         The following changes are from gettext 0.10.39 as maintained by
9092         Bruno Haible.
9093
9094         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9095         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9096         with inverted sense.  All uses changed.
9097
9098         * mbswidth.c: Don't include <limits.h>.
9099         Include <stdlib.h> and <string.h> unconditionally.
9100         (iswcntrl, mbsinit, ISCNTRL): New macros.
9101         (mbsnwidth): Use K&R style function declarations.
9102         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9103         can optimize it when MB_CUR_MAX == 1.
9104         The width of control characters is zero, not 1.
9105
9106 2001-07-15  Jim Meyering  <meyering@lucent.com>
9107
9108         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9109         (BUILT_SOURCES): Add unlocked-io.h.
9110         (io_functions): Define.
9111         (unlocked-io.h): New rule.
9112         (DISTCLEANFILES): Add unlocked-io.h.
9113         (all-local): Depend on unlocked-io.h, to ensure it is created.
9114
9115         * unlocked-io.hin: New file
9116
9117         * regex.c: Update from glibc.
9118
9119 2001-07-05  Jim Meyering  <meyering@lucent.com>
9120
9121         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9122         recommendation.
9123         (libfetish_a_SOURCES): Put all .h files here instead.
9124         Remove a thus-exposed (better checks in automake) duplicate and
9125         two unnecessary .h files.
9126
9127 2001-06-11  Jim Meyering  <meyering@lucent.com>
9128
9129         * regex.c: Update from GNU libc.
9130
9131 2001-05-27  Jim Meyering  <meyering@lucent.com>
9132
9133         * readutmp.h (UT_TYPE): Define.
9134
9135 2001-05-24  Jim Meyering  <meyering@lucent.com>
9136
9137         * argmatch.c: Include "quote.h".
9138         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9139         quote function.  Reported by Göran Uddeborg.
9140
9141 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9142
9143         * dirname.c (dir_name): Compute append_dot using path, not newpath
9144         which is not yet declared.
9145
9146 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9147
9148         * Makefile.am (libfetish_a_SOURCES):
9149         Add strftime.c, since we now compile it on all hosts.
9150
9151         * strftime.c (my_strftime):
9152         Define to nstrftime if emacs, but only if my_strftime is not defined.
9153         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9154         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9155         Add one more extra argument: a nanoseconds value.
9156         All uses changed.
9157         (ns): New macro.
9158         (my_strftime function): Add %N format.
9159         (emacs_strftimeu): Renamed from emacs_strftime,
9160         with extra ut argument.
9161
9162 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9163
9164         dirname code cleanup.  base_name now behaves more compatibly
9165         with POSIX basename when given file names that have trailing
9166         slashes, and similarly for dir_name.  Add new primitives
9167         base_len and dir_len.  Put the directory-name-related decls
9168         into dirname.h.
9169
9170         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9171         * backupfile.c (base_name): Likewise.
9172         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9173         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9174         * makepath.c (strip_trailing_slashes): Likewise.
9175         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9176         Likewise.
9177         * rename.c (strip_trailing_slashes): Likewise.
9178         * same.c (base_name): Likewise.
9179         * stripslash.c (ISSLASH): Likewise.
9180
9181         * addext.c: Include <dirname.h> after size_t is defined.
9182         * backupfile.c: Likewise.
9183
9184         * addext.c (addext): Use base_len to trim redundant
9185         trailing slashes instead of doing it ourselves.
9186         But do not trim the last slash if it is not redundant.
9187
9188         * backupfile.c (find_backup_file_name,
9189         max_backup_version): Use base_len instead of rolling it ourselves.
9190         Handle the case of "" and (on DOS) "C:" correctly.
9191
9192         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9193         Include <string.h>, <dirname.h>.
9194         (base_name): Allow file names ending in slashes, other than names
9195         that are all slashes.  In this case, return the basename followed
9196         by the slashes.  This is more general, and can be used in places
9197         where the original base_name purposely had an assertion failure.
9198         (base_len): New function.
9199
9200         * dirname.c: Include <string.h> instead of <stdlib.h>.
9201         Do not include <assert.h>; no longer needed.
9202         Include xalloc.h.
9203         (memrchr): Remove decl.
9204         (dir_name_r): Remove.
9205         (dir_len): Renamed from dirlen.  All callers changed.
9206         Rewrite in terms of base_name, for simplicity and consistency.
9207         (dir_name): Never return NULL.  All callers changed.
9208         Do not include <stdlib.h> in test program; no longer needed.
9209         return 0; is fine for test program.
9210
9211         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9212         New macros.
9213         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9214
9215         * path-concat.c (path_concat): Use base_len to compute
9216         base length, not strlen; this means we cannot rely on memcpy
9217         to null-terminate.
9218
9219         * same.c (STREQ): Remove.
9220         (same_name): Handle the case where the basename ends in trailing '/'.
9221
9222         * stripslash.c (strip_trailing_slashes): Return nonzero if
9223         a slash was stripped.  Do not strip the last slash after a
9224         file system prefix.
9225
9226 2001-04-08  Jim Meyering  <meyering@lucent.com>
9227
9228         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9229         recomputed; that's necessary when the offset spans a DST transition.
9230         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9231
9232 2001-04-02  Jim Meyering  <meyering@lucent.com>
9233
9234         * regex.h, regex.c: Update from GNU libc.
9235
9236 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9237
9238         * version-etc.c (version_etc_copyright): Update to 2001.
9239
9240 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9241
9242         * tempname.c (uint64_t): Define to uintmax_t if
9243         not defined, and if UINT64_MAX is not defined.
9244         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9245         Reported by John David Anglin.
9246
9247 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9248
9249         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9250         alias if codeset is empty.
9251         * config.charset (BeOS): Use wildcard syntax.
9252
9253 2001-03-13  Jim Meyering  <meyering@lucent.com>
9254
9255         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9256         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9257         From Bruno Haible.
9258
9259 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9260
9261         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9262         Don't return NULL.
9263         * unicodeio.c (print_unicode_char): Simplify accordingly.
9264
9265 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9266
9267         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9268         support for DOS/DJGPP.
9269
9270 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9271
9272         * Makefile.am (libfetish_a_SOURCES):
9273         Add dup-safer.c, fopen-safer.c.
9274         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9275
9276         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9277
9278 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9279
9280         The mkstemp replacement is taken from glibc 2.2.2, with some
9281         portability fixes for use outside glibc, as follows:
9282
9283         * tempname.c (struct_stat64): New macro.
9284         (direxists, __gen_tempname): Use it.
9285         This avoids a portability problem with Solaris 8.
9286
9287         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9288         (<stddef.h>, <stdint.h>, <string.h>):
9289         Include only if STDC_HEADERS || _LIBC.
9290         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9291         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9292         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9293         (__set_errno): Define this macro if <errno.h> doesn't.
9294         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9295         Define these macros if <stdio.h> doesn't.
9296         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9297         Define these macros if <sys/stat.h>
9298         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9299         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9300         __xstat64): Define if not _LIBC.
9301         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9302         (__gen_tempname): Invoke gettimeofday only if
9303         HAVE_GETTIMEOFDAY || _LIBC;
9304         otherwise, fall back on plain "time".
9305         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9306
9307         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9308
9309         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9310
9311 2001-02-17  Jim Meyering  <meyering@lucent.com>
9312
9313         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9314         around included file name.
9315
9316         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9317
9318         * strftime.c: Update from GNU libc (the only changes were to comments).
9319
9320 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9321
9322         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9323
9324 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9325
9326         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9327         Remove workaround macros for hosts that have mbrtowc but not
9328         mbstate_t, as we now insist on proper declarations for both
9329         before using mbrtowc.
9330
9331 2001-02-17  Jim Meyering  <meyering@lucent.com>
9332
9333         * regex.c: Update from libc.
9334
9335 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9336
9337         * alloca.c (malloc): Undef before defining, since stdlib.h
9338         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9339         Reported by Mark Hounschell via Paul Eggert.
9340
9341 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9342
9343         * config.charset: Update for FreeBSD 4.2.
9344
9345 2001-01-26  Jim Meyering  <meyering@lucent.com>
9346
9347         * quotearg.c: Include stddef.h.
9348         * quote.c: Include stddef.h.
9349         Reported by Axel Kittenberger.
9350
9351         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9352         line in double quotes so that it evokes a better diagnostic.
9353         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9354         Reported by Axel Kittenberger.
9355
9356 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9357
9358         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9359         to avoid a warning.  Add back 'const' to inptr.
9360
9361 2001-01-16  Jim Meyering  <meyering@lucent.com>
9362
9363         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9364         From Bruno Haible.
9365
9366 2001-01-14  Jim Meyering  <meyering@lucent.com>
9367
9368         * rename.c: New file.  From Volker Borchert.
9369         Include stdlib.h, string.h or strings.h, and xalloc.h.
9370         Use strip_trailing_slashes rather than open-coding it.
9371
9372 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9373
9374         * strftime.c: Sync with glibc time/strftime.c 1.81.
9375
9376 2001-01-03  Jim Meyering  <meyering@lucent.com>
9377
9378         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9379         local `inptr' to avoid warning with some system declarations of iconv.
9380
9381 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9382
9383         * modechange.c: Do not assume that mode_t uses the
9384         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9385         the other-execute bit of FOO even if S_IXOTH != 1.
9386
9387         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9388         WOTH, XOTH, ALLM): New macros.
9389         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9390          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9391         Use them.
9392         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9393         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9394         (mode_compile):
9395         No need to use uintmax_t; unsigned long is long enough.
9396         Don't bother to get suffix since we don't use it.
9397
9398 2000-12-24  Jim Meyering  <meyering@lucent.com>
9399
9400         * hash.c (is_prime): Return explicit boolean values.
9401         (hash_get_first): Return NULL to appease Irix5.6's 89.
9402         Reported by Nelson Beebe.
9403
9404 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9405
9406         * localcharset.c (locale_charset): Add support for Win32.
9407
9408 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9409
9410         * physmem.h, physmem.c: New files.
9411
9412         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9413         (noinst_HEADERS): Add physmem.h.
9414
9415         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9416         't' for compatibility with Solaris 8 sort.
9417
9418 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9419
9420         * config.charset: Add support for BeOS.
9421
9422 2000-12-16  Jim Meyering  <meyering@lucent.com>
9423
9424         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9425         SHELLS_FILE to a file name that's useful on djgpp systems.
9426         Include stdlib.h.
9427         (ADDITIONAL_DEFAULT_SHELLS): Define.
9428         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9429         Based mostly on a patch from Prashant TR.
9430
9431 2000-12-16  Jim Meyering  <meyering@lucent.com>
9432
9433         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9434         N and M) would have treated it like `chown N:N FILE'.
9435
9436         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9437
9438 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9439
9440         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9441         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9442         to the list of canonical encodings. Rename EUC-CN to GB2312.
9443
9444 2000-12-08  Andreas Schwab  <schwab@suse.de>
9445
9446         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9447         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9448
9449 2000-12-07  Jim Meyering  <meyering@lucent.com>
9450
9451         * stripslash.c (ISSLASH): Define.
9452         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9453         From Prashant TR.
9454
9455         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9456         (dir_name_r): Declare this function as static.
9457         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9458         manifest itself on a name containing a mix of slashes and
9459         backslashes.
9460         Make this function work with names starting with a DOS-style
9461         drive letter and colon prefix.
9462         (dir_name): Append `.' if necessary.
9463         Based mostly on patches from Prashant TR and Eli Zaretskii.
9464
9465         * dirname.h (dir_name_r): Remove prototype.
9466
9467 2000-12-05  Jim Meyering  <meyering@lucent.com>
9468
9469         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9470
9471 2000-12-04  Jim Meyering  <meyering@lucent.com>
9472
9473         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9474         Also include memory.h, stdlib.h, unistd.h if appropriate.
9475         Reported by Andreas Jaeger (conflicting declaration of malloc).
9476
9477 2000-12-02  Jim Meyering  <meyering@lucent.com>
9478
9479         * closeout.h: Make idempotent, to avoid some obscure warnings.
9480
9481 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9482
9483         * memrchr.c: Include <config.h> before any system include file.
9484
9485 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9486
9487         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9488
9489 2000-11-26  Jim Meyering  <meyering@lucent.com>
9490
9491         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9492
9493 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9494
9495         * strftime.c (my_strftime): Do not invoke mbrlen with a
9496         size of (size_t) -1; it's not portable.
9497
9498 2000-11-17  Akim Demaille  <akim@epita.fr>
9499
9500         * obstack.h: Formatting changes.
9501         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9502         prevent type checking.
9503         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9504         cast the value to (void *): assigning a `foo *' to a `void *'
9505         variable is valid.
9506         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9507
9508 2000-11-17  Jim Meyering  <meyering@lucent.com>
9509
9510         * strstr.c: Update from GNU libc.
9511
9512 2000-11-16  Jim Meyering  <meyering@lucent.com>
9513
9514         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9515
9516 2000-11-11  Jim Meyering  <meyering@lucent.com>
9517
9518         * error.c: Add a couple #includes, merging from GNU libc version.
9519
9520 2000-11-10  Jim Meyering  <meyering@lucent.com>
9521
9522         * obstack.h: Update from GNU libc.
9523         * obstack.c: Likewise.
9524
9525 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9526
9527         * getusershell.c (setusershell): Use rewind rather than
9528         fseek/fseeko, to avoid configuration hassles with fseeko.
9529         Don't bother opening SHELLS_FILE if shellstream is NULL;
9530         it's not necessary.
9531
9532 2000-11-05  Jim Meyering  <meyering@lucent.com>
9533
9534         * makepath.h (make_dir): Declare.
9535         * makepath.c (make_dir): Remove `static' attribute.
9536         Tweak a comment.
9537
9538 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9539
9540         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9541         last one in a bucket, advance to the next bucket.
9542
9543 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9544
9545         * fnmatch.c: Do not comment out all the code if we are using
9546         the GNU C library, because in some cases we are replacing buggy
9547         code in the GNU C library itself.
9548
9549 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9550
9551         * error.h, getline.h, modechange.h:
9552         Remove "2000" from Copyright line, as the file hasn't been
9553         changed this year other than in the copyright notice.
9554
9555         * xalloc.h: Add "2000" to Copyright line, as this file
9556         was changed this year.
9557
9558 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9559
9560         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9561         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9562         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9563
9564 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9565
9566         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9567         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9568         doesn't define __restrict_arr.
9569
9570 2000-10-29  Jim Meyering  <meyering@lucent.com>
9571
9572         * xstat.in: Fix grammar in comment.
9573
9574 2000-10-28  Jim Meyering  <meyering@lucent.com>
9575
9576         * memchr.c: Update from libc.
9577         Adjust for portability:
9578         [HAVE_STDLIB_H]: Include stdlib.h.
9579         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9580         Undef __memchr, too.
9581         [!weak_alias]: Define __memchr to memchr.
9582
9583         * regex.c: Update from libc.
9584         * regex.h: Likewise.
9585         * getopt1.c: Likewise.
9586         * memcmp.c: Likewise.
9587
9588         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9589         Avoid using fseek, when possible -- it's broken by design.
9590         Patch by Ulrich Drepper.
9591
9592 2000-10-26  Jim Meyering  <meyering@lucent.com>
9593
9594         * strftime.c: Update from libc.
9595
9596 2000-10-25  Jim Meyering  <meyering@lucent.com>
9597
9598         * obstack.c: Update from libc.
9599
9600 2000-10-23  Jim Meyering  <meyering@lucent.com>
9601
9602         * hard-locale.c (hard_locale): Revert last change -- it was simply
9603         wrong.  That set_locale call must not have any side effects.
9604         From Paul Eggert.
9605
9606 2000-10-22  Jim Meyering  <meyering@lucent.com>
9607
9608         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9609         [CYCLIC]: Remove now-unused definition.
9610
9611         * save-cwd.c (O_DIRECTORY): Define, if needed.
9612         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9613         Suggestion from Ulrich Drepper.
9614
9615 2000-10-21  Jim Meyering  <meyering@lucent.com>
9616
9617         * dirname.c (dir_name_r): New function, factored out of dir_name.
9618         (dir_name): Use dir_name_r.
9619         * dirname.h (dir_name_r): Declare it.
9620
9621 2000-10-21  Jim Meyering  <meyering@lucent.com>
9622
9623         * dirname.c (memrchr): Declare if necessary.
9624         (dir_name): Remove the restriction that there be no
9625         trailing slashes.  Now, this code skips past them, effectively
9626         ignoring them.
9627         [TEST_DIRNAME] (main): New unit tests.
9628
9629         * memrchr.c: New file from GNU libc.
9630         Undef __memrchr, too.
9631         [!weak_alias]: Define __memrchr to memrchr.
9632         Guard weak_alias use with `#ifdef weak_alias'.
9633
9634 2000-10-17  Jim Meyering  <meyering@lucent.com>
9635
9636         * quote.h (PARAMS): Define and use.
9637         Reported by Akim Demaille.
9638
9639         * getopt.c: Update from libc.
9640
9641 2000-10-16  Jim Meyering  <meyering@lucent.com>
9642
9643         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9644         From Jan Fedak.
9645
9646 2000-09-25  Jim Meyering  <meyering@lucent.com>
9647
9648         * md5.h (rol): Define (from GnuPG).
9649
9650         * sha.c: Give credit (GnuPG) where due.
9651         (M): Use rol rather than open-coding it.
9652         Add a FIXME comment.
9653
9654 2000-09-21  Jim Meyering  <meyering@lucent.com>
9655
9656         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9657         Reported by Michael Stone.
9658
9659 2000-09-20  Jim Meyering  <meyering@lucent.com>
9660
9661         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9662         (noinst_HEADERS): Add sha.h.
9663         Based on code from Scott G. Miller and from GnuPG.
9664
9665 2000-09-15  Jim Meyering  <meyering@lucent.com>
9666
9667         * regex.c: Update from libc.
9668
9669 2000-09-10  Jim Meyering  <meyering@lucent.com>
9670
9671         * getopt.c (_getopt_internal): Update from glibc.
9672
9673 2000-09-09  Jim Meyering  <meyering@lucent.com>
9674
9675         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9676         think it should be used as a general replacement for isascii.
9677         * fnmatch.c: Likewise.
9678         * mbswidth.c: Likewise
9679         * regex.c: Likewise.
9680
9681         Don't use atoi.
9682         * userspec.c: Include sys/param.h and limits.h.
9683         Include xstrtol.h.
9684         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9685         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9686         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9687         UID, GID.  Check range.
9688
9689 2000-09-06  Jim Meyering  <meyering@lucent.com>
9690
9691         * getopt.c (_getopt_internal): Update from glibc.
9692
9693 2000-08-30  Jim Meyering  <meyering@lucent.com>
9694
9695         * strftime.c: Merge in changes from GNU libc.
9696
9697 2000-08-26  Jim Meyering  <meyering@lucent.com>
9698
9699         * closeout.c: Include "__fpending.h".
9700         (close_stdout_status): Return right away if there's nothing to flush.
9701
9702         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9703         * __fpending.c: New file.
9704         * __fpending.h: New file.
9705
9706 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9707
9708         Standardize on "memory exhausted" instead of "Memory exhausted"
9709         or "virtual memory exhausted".
9710         * obstack.c (print_and_abort): Use "memory exhausted", not
9711         "virtual memory exhausted".
9712         * same.c (same_name): Invoke xalloc_die instead of printing
9713         our own message.
9714         * userspec.c (parse_user_spec): Likewise.
9715         * bumpalloc.h: comment fix
9716         * same.c, userspec.c: Include xalloc.h.
9717
9718         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9719         not char *const and pointing to a constant array.
9720         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9721         (xrealloc): Comment fix.
9722
9723         * userspec.c (parse_user_spec):
9724         Don't translate a message until just before returning,
9725         to avoid unnecessary translation.
9726
9727 2000-08-07  Jim Meyering  <meyering@lucent.com>
9728
9729         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9730         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9731         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9732         getgroups.c, gethostname.c, getopt.h, group-member.c,
9733         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9734         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9735         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9736         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9737         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9738         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9739         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9740         yesno.c: Back out Copyright date changes for each file with no change
9741         this year.  This eases coordination with other programs using the same
9742         source code modules.  From Paul Eggert.
9743
9744 2000-08-03  Greg McGary  <greg@mcgary.org>
9745
9746         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9747         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9748         (EXTEND_BUFFER): Use them.
9749
9750 2000-08-01  Jim Meyering  <meyering@lucent.com>
9751
9752         * dirname.c (ISSLASH): Define.
9753         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9754         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9755         both `\' and `/' may be use as path separators.
9756         Based on a patch from Prashant TR.
9757
9758 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9759
9760         * quotearg.c (quotearg_n_options): Don't make the initial
9761         slot vector a constant, since it might get modified.
9762
9763 2000-07-31  Jim Meyering  <meyering@lucent.com>
9764
9765         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9766         * obstack.c (print_and_abort): Likewise.
9767
9768 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9769
9770         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9771         buffer, so that the caller can always quote one small
9772         component of a "memory exhausted" message in slot 0.
9773         From a suggestion by Jim Meyering.
9774
9775 2000-07-30  Jim Meyering  <meyering@lucent.com>
9776
9777         * makepath.c (make_path): Quote the other instance, too.
9778
9779         * quotearg.c (N_STATIC_SLOTVECS): Define.
9780         (STATIC_BUF_SIZE): Define.
9781         (quotearg_n_options): Use only statically allocated storage when
9782         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9783         than STATIC_BUF_SIZE.
9784
9785 2000-07-29  Jim Meyering  <meyering@lucent.com>
9786
9787         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9788         * dirname.c (dir_name): Likewise.
9789
9790         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9791
9792         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9793         (dir_name): Assert that there are no trailing slashes.
9794
9795 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9796
9797         * mbswidth.h (mbswidth): Add a flags argument.
9798         (mbswidth): New declaration.
9799         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9800         * mbswidth.c (mbswidth): Add a flags argument.
9801         (mbsnwidth): New function.
9802
9803 2000-07-24  Jim Meyering  <meyering@lucent.com>
9804
9805         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9806
9807 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9808
9809         * mbswidth.c (_XOPEN_SOURCE):
9810         Don't define; this causes problems on Solaris 7.
9811         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9812
9813 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9814
9815         * quotearg.c:
9816         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9817         so that mbstate_t is always defined.
9818
9819         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9820         be 1 in at least one GCC installation, and this configuration
9821         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9822         performance on hosts that have mbrtowc but have only unibyte
9823         locales, but I assume these hosts are rare.
9824
9825 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9826
9827         * quotearg.c: Streamline by invoking multibyte code only if needed.
9828         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9829         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9830         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9831         invoke multibyte primitives.
9832
9833 2000-07-23  Jim Meyering  <meyering@lucent.com>
9834
9835         * basename.c (base_name): Add an assertion.
9836
9837 2000-07-15  Bruno Haible  <clisp.cons.org>
9838
9839         * quotearg.c: When the system forces us to redefine mbstate_t,
9840         shadow its mbsinit function.
9841
9842 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9843
9844         * mbswidth.h: New file.
9845         * mbswidth.c: New file.
9846         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9847         (noinst_HEADERS): Add mbswidth.h.
9848
9849 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9850
9851         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9852         and IRIX 6.
9853
9854 2000-07-15  Jim Meyering  <meyering@lucent.com>
9855
9856         * makepath.c: Include quote.h.
9857         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9858         corresponding argument in a `quote (...)' call.
9859         Give better diagnostics.
9860
9861         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9862         (noinst_HEADERS): Add quote.h.
9863
9864         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9865         from tar's src/misc.c.
9866         * quote.h: New file.  Prototypes for same.
9867
9868 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9869
9870         From a suggestion by Bruno Haible.
9871         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9872         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9873         to decide whether to define the BeOS workaround macro;
9874         this adjusts to the change to AC_MBSTATE_T.
9875
9876 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9877
9878         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9879
9880         * quotearg.c (quoting_style_args, quoting_style_vals,
9881         quotearg_buffer_restyled): Add support for
9882         clocale_quoting_style.  Undo previous change to
9883         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9884         and "{RIGHT QUOTATION MARK}" msgids.
9885
9886 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9887
9888         The old behavior of quoting `like this' doesn't look good with
9889         newer, ISO-style fonts.  See:
9890         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9891
9892         Instead, quote "like this" by default.  Let the translator
9893         tailor the locale-specific quoting behavior by providing
9894         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9895
9896         * quotearg.c (N_): New macro.
9897         (gettext_default): New function.
9898         (quotearg_buffer_restyled): Use
9899         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9900         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9901
9902 2000-07-09  Jim Meyering  <meyering@lucent.com>
9903
9904         * Most files: Update copyright dates to include 2000.
9905
9906 2000-07-08  Jim Meyering  <meyering@lucent.com>
9907
9908         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9909         if not defined.
9910         (xgethostname): Remove now-unnecessary #ifdef.
9911         Move declaration of `err' into loop where it's used.
9912
9913 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9914
9915         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9916         by allocating a larger buffer. Test the gethostname return value for
9917         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9918         returns an error and ENAMETOOLONG isn't defined.
9919
9920 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9921         and Bruno Haible  <haible@clisp.cons.org>
9922
9923         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9924
9925 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9926
9927         * quotearg.c (struct quoting_options): Simplify quote_these_too
9928         dimension.
9929
9930 2000-07-03  Jim Meyering  <meyering@lucent.com>
9931
9932         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9933         Reported by Bruno Haible.
9934
9935 2000-07-04  Jim Meyering  <meyering@lucent.com>
9936
9937         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9938         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9939         lacks mbrtowc.
9940
9941 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9942         and Bruno Haible  <haible@clisp.cons.org>
9943
9944         * quotearg.c (mbrtowc):
9945         Assign to *pwc, and return 1 only if result is nonzero.
9946         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9947
9948 2000-07-03  Jim Meyering  <meyering@lucent.com>
9949
9950         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9951         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9952         From Bob Proulx.
9953
9954 2000-07-02  Jim Meyering  <meyering@lucent.com>
9955
9956         * quotearg.c (mbstate_t): Don't define here.
9957
9958 2000-07-02  Jim Meyering  <meyering@lucent.com>
9959
9960         * nanosleep.c (SIGCONT): Define if not already defined.
9961
9962 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9963
9964         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9965         per change in ../m4/ls-mntd-fs.m4.
9966         (read_filesystem_list): Ignore symbolic links.
9967
9968 2000-06-29  Jim Meyering  <meyering@lucent.com>
9969
9970         * same.c: Include <string.h> or <strings.h>, as appropriate,
9971         for declaration of strcmp.
9972
9973         * long-options.c: Include <stdlib.h>, for declaration of exit.
9974
9975         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9976         Avoid warning by casting result to `char *' to remove `const'.
9977
9978 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9979
9980         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9981
9982 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9983
9984         savedir now sets errno on failure and invokes xmalloc to get memory.
9985         Fix a couple of other minor bugs while we're at it.
9986
9987         * savedir.c (<unistd.h>): Do not include; there's no need.
9988         (NAMLEN): Remove macro.
9989         (malloc, realloc): Remove decls.
9990         (stpcpy): Likewise.
9991         ("xalloc.h"): Include.
9992         (NAME_SIZE_DEFAULT): New macro.
9993         (savedir): Use xmalloc / xrealloc to allocate memory.
9994         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9995         Skip "" directory entries.
9996         Use strlen to calculate directory entry length, since the old method
9997         is rarely used these days and isn't worth supporting.
9998         Don't use a pointer after freeing it.
9999         Check for integer overflow when calculating allocation size.
10000         Use memcpy to copy entries, instead of stpcpy.
10001         Set errno properly when returning NULL.
10002         Check for readdir error.
10003
10004 2000-06-26  Jim Meyering  <meyering@lucent.com>
10005
10006         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10007
10008 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10009
10010         * getusershell.c (xmalloc, xrealloc): Remove functions.
10011         Include xalloc.h.
10012         Don't include <stdlib.h>.  Don't declare malloc, realloc.
10013
10014 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
10015
10016         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10017
10018 2000-06-24  Jim Meyering  <meyering@lucent.com>
10019
10020         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10021
10022 2000-06-21  Jim Meyering  <meyering@lucent.com>
10023
10024         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10025
10026 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10027
10028         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10029         (mbrtowc, mbstate_t): Define substitutes if
10030         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10031         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10032         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10033
10034 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10035
10036         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10037         than 1024, return a memory chunk of least possible size, instead
10038         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10039         Use free/xmalloc instead of xrealloc to avoid copying for very long
10040         paths.
10041
10042 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10043
10044         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10045         address, not strdup.  Include <stdlib.h> and don't declare free().
10046
10047 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10048
10049         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10050         the empty string.
10051
10052 2000-06-21  Jim Meyering  <meyering@lucent.com>
10053
10054         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10055         (noinst_HEADERS): Add getstr.h.
10056
10057         * getline.c (getstr): Move into a separate file.
10058         * getstr.c (getstr): New file, extracted from getline.c, with
10059         the following changes: new parameter, delim2; both delim[12]
10060         parameters have type `int', not `char'.  The latter would lose
10061         with 8-bit delimiters.
10062         * getstr.h: New file.
10063
10064 2000-06-19  Jim Meyering  <meyering@lucent.com>
10065
10066         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10067
10068 2000-06-18  Jim Meyering  <meyering@lucent.com>
10069
10070         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10071         Besides, these days every porting target provides a mkdir function.
10072
10073         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10074         (this snippet comes from src/system.h).
10075
10076 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10077
10078         * human.c (adjust_value): New function.
10079         (human_readable_inexact): Apply rounding style even when
10080         printing approximate values.
10081
10082 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10083
10084         * human.c (human_readable_inexact): Allow an input block
10085         size that is not a multiple of the output block size, and vice versa.
10086         Reported by Piergiorgio Sartor.
10087
10088 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10089
10090         * getdate.y (get_date): Apply relative times after time
10091         zone indicator, not before.  Reported by Todd A. Jacobs.
10092
10093 2000-06-13  Jim Meyering  <meyering@lucent.com>
10094
10095         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10096
10097         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10098
10099 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10100
10101         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10102
10103 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10104
10105         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10106
10107 2000-06-04  Jim Meyering  <meyering@lucent.com>
10108
10109         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10110         SunOS 4.1.4 for which gid_t is an unsigned type.
10111
10112 2000-06-03  Jim Meyering  <meyering@lucent.com>
10113
10114         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10115
10116 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10117
10118         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10119         newer, don't install charset.alias.
10120         * config.charset: Change the Linux/glibc rules so they become empty
10121         on glibc-2.1 or newer.
10122
10123 2000-06-02  Jim Meyering  <meyering@lucent.com>
10124
10125         * mountlist.c: Back out last change.  Instead, do this...
10126         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10127         member using the same `ignore'-testing code.
10128         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10129         fs_type strings.
10130         From Mark D. Roth.
10131
10132 2000-05-29  Jim Meyering  <meyering@lucent.com>
10133
10134         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10135         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10136
10137 2000-05-22  Jim Meyering  <meyering@lucent.com>
10138
10139         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10140
10141 2000-05-18  Jim Meyering  <meyering@lucent.com>
10142
10143         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10144         back, too, since it may have been modified by allocate_entry.
10145         (hash_delete): Rewrite to use neither the assignment operator
10146         nor the comma operator in an if-expression.
10147
10148 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10149
10150         * closeout.c:
10151         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10152         Remove; no longer needed.
10153         "quotearg.h": Add include.
10154         (file_name): Do not bother to explicitly initialize to NULL; it's less
10155         efficient on some hosts.
10156         (close_stdout_status): Remove test as to whether stdout was already
10157         closed; it breaks for the case "echo x | sort >&-".
10158         Quote file name colons.
10159         Do not assume that _("write error") lacks format strings.
10160
10161 2000-05-15  Jim Meyering  <meyering@lucent.com>
10162
10163         * version-etc.c (version_etc_copyright): Update the copyright string
10164         used in all --version output.
10165
10166 2000-05-14  Jim Meyering  <meyering@lucent.com>
10167
10168         * closeout.c (close_stdout_set_file_name): New function.
10169         (close_stdout_status): Use new file-scoped global.
10170         Return right away if fstat says the stdout file descriptor is invalid.
10171         * closeout.h (close_stdout_set_file_name): Declare.
10172
10173 2000-05-10  Jim Meyering  <meyering@lucent.com>
10174
10175         * closeout.c [default_exit_status]: New file-scoped variable.
10176         (close_stdout_set_status): New function.
10177         * closeout.h (close_stdout_set_status): Declare.
10178
10179 2000-05-08  Jim Meyering  <meyering@lucent.com>
10180
10181         * long-options.c: Don't include closeout.h.
10182         (parse_long_options): Don't call close_stdout for --version.
10183
10184 2000-05-06  Jim Meyering  <meyering@lucent.com>
10185
10186         * strnlen.c: Undefine __strnlen and strnlen.
10187         [!weak_alias]: Define __strnlen to strnlen.
10188
10189         * atexit.c: New file, from libiberty.
10190
10191 2000-05-06  Jim Meyering  <meyering@lucent.com>
10192
10193         * closeout.c (close_stdout_status): Also check for errors on the
10194         stderr stream.
10195
10196 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10197
10198         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10199         instead of xmalloc, xrealloc, path_concat.
10200         (locale_charset): Treat empty environment variables as absent.
10201         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10202
10203 2000-05-04  Jim Meyering  <meyering@lucent.com>
10204
10205         * getopt.c: Update from glibc.
10206         * obstack.c: Likewise.
10207         * obstack.h: Likewise.
10208         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10209
10210         * regex.h: Likewise.
10211         * strndup.c: Likewise.
10212         * strnlen.c: New file, from glibc.
10213
10214 2000-05-01  Jim Meyering  <meyering@lucent.com>
10215
10216         * full-write.c (full_write): Remove `FIXME' part of comment.
10217
10218 2000-04-29  Jim Meyering  <meyering@lucent.com>
10219
10220         * path-concat.c: Declare strdup only if it's not defined.
10221         * canon-host.c: Likewise.
10222
10223 2000-04-28  Jim Meyering  <meyering@lucent.com>
10224
10225         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10226         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10227         included first, then limits.h is included by locale.h by libintl.h.
10228         From John David Anglin.
10229
10230 2000-04-25  Jim Meyering  <meyering@lucent.com>
10231
10232         * makepath.c (S_IRWXUGO): Define.
10233         (make_path): Always perform explicit chmod if MODE specifies any
10234         of the `special' permission bits.  Prompted by a bug report against
10235         install from Mate Wierdl and Joost van Baal.
10236
10237 2000-04-18  Jim Meyering  <meyering@lucent.com>
10238
10239         * README: New file.
10240
10241         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10242         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10243
10244 2000-04-17  Jim Meyering  <meyering@lucent.com>
10245
10246         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10247         the definition of it to rpl_strftime also defined-away the system's
10248         declaration.
10249
10250 2000-04-15  Jim Meyering  <meyering@lucent.com>
10251
10252         Use `C' to denote so-called `contiguous' files, the same way
10253         that tar does.
10254         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10255         (ftypelet): Use S_ISCTG.
10256         From Michael Deutschmann.
10257
10258 2000-04-14  Jim Meyering  <meyering@lucent.com>
10259
10260         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10261
10262 2000-04-08  Jim Meyering  <meyering@lucent.com>
10263
10264         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10265         names don't conflict.  Reported by Eli Zaretskii.
10266
10267 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10268
10269         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10270         bug.  Deal with the different error behavior of Irix iconv.
10271
10272 2000-04-07  Jim Meyering  <meyering@lucent.com>
10273
10274         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10275         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10276
10277 2000-04-05  Jim Meyering  <meyering@lucent.com>
10278
10279         Portability tweaks required for ultrix4.3.
10280         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10281         * readutmp.c: Include sys/types.h before sys/stat.h.
10282         * canon-host.c: Declare strdup.
10283         * path-concat.c: Likewise.
10284         From John David Anglin.
10285
10286 2000-04-04  Jim Meyering  <meyering@lucent.com>
10287
10288         Be more DOS 8.3-friendly.
10289         * ref-add.sin: Renamed from ref-add.sed.in.
10290         * ref-del.sin: Renamed from ref-del.sed.in.
10291         * Makefile.am: Reflect renaming.
10292         Reported by Eli Zaretskii.
10293
10294         Use a temporary file name that won't clash with `charset.alias'
10295         in the DOS 8.3 name space.
10296         * Makefile.am (charset_tmp): Define.
10297         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10298         (uninstall-local): Likewise.
10299         Reported by Eli Zaretskii.
10300
10301 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10302
10303         * time/strftime.c (my_strftime): Make sure we call the system
10304         strftime, not ourselves, when invoking the underlying strftime.
10305
10306 2000-03-24  Jim Meyering  <meyering@lucent.com>
10307
10308         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10309         (charset_alias): Define.
10310         (install-exec-local): Factor out common code.
10311         (uninstall-local): Split lines longer than 80.
10312         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10313         (SUFFIXES): Define.
10314         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10315         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10316
10317 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10318
10319         * config.charset: Output a line containing "Packages using this file".
10320         * ref-add.sed.in, ref-del.sed.in: New files.
10321         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10322         ref-del.sed): New rules.
10323
10324 2000-03-17  Jim Meyering  <meyering@lucent.com>
10325
10326         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10327         Otherwise, include <strings.h>
10328
10329 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10330
10331         * unicodeio.c (utf8_wctomb): New function.
10332         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10333         format instead of in UCS-4 with platform dependent endianness.
10334
10335 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10336
10337         * savedir.c (savedir): Work even if directory size is
10338         negative; this can happen with some screwy NFS configurations.
10339
10340 2000-03-06  Jim Meyering  <meyering@lucent.com>
10341
10342         * localcharset.c (get_charset_aliases): Don't try to free file_name
10343         if it's NULL (because we ran out of memory).  From Bruno Haible.
10344
10345 2000-03-05  Jim Meyering  <meyering@lucent.com>
10346
10347         * localcharset.c ("path-concat.h"): Include.
10348         (get_charset_aliases): Use path_concat instead of ANSI string
10349         concatenation.
10350
10351         * unicodeio.h (PARAMS): Define.
10352         Use it to guard prototype.
10353
10354 2000-03-04  Jim Meyering  <meyering@lucent.com>
10355
10356         * Makefile.am (install-exec-local): Create $(libdir) before installing
10357         into it.
10358         (uninstall-local): Uncomment this rule so `make distcheck' works
10359         once again.
10360
10361         * unicodeio.c (<errno.h>): Include it.
10362         (errno): Declare if not defined.
10363
10364         * localcharset.c: Add Bruno's comment justifying use of volatile.
10365
10366         * config.charset: New version, incorporating remarks from a linux
10367         i18n mailing list.  From Bruno Haible.
10368
10369 2000-03-02  Jim Meyering  <meyering@lucent.com>
10370
10371         * Makefile.am (EXTRA_DIST): Add config.charset.
10372
10373 2000-03-01  Jim Meyering  <meyering@lucent.com>
10374
10375         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10376         * unicodeio.c: Likewise.
10377
10378 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10379
10380         * config.charset: New file.
10381         * localcharset.c: New file.
10382         * unicodeio.h, unicodeio.c: New files.
10383         * Makefile.am (DEFS): Add -DLIBDIR=...
10384         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10385         (noinst_HEADERS): Add unicodeio.h.
10386         (all-local, install-exec-local, charset.alias): New targets.
10387
10388 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10389
10390         * quotearg.c (ALERT_CHAR): New macro.
10391         (quotearg_buffer_restyled): Use it.
10392
10393 2000-02-27  Jim Meyering  <meyering@lucent.com>
10394
10395         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10396         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10397
10398         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10399         not `#if STDC_HEADERS'.
10400         Declare malloc if needed.
10401
10402         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10403         now that autoconf always defines the HAVE_DECL_ symbols.
10404         * human.c: Likewise.
10405         * same.c: Likewise.
10406         * strtoumax.c: Likewise.
10407
10408         * backupfile.c: Arrange for cpp to fail if the configure-time
10409         declaration check was not run.
10410         * hash.c: Likewise.
10411         * human.c: Likewise.
10412         * same.c: Likewise.
10413         * strtoumax.c: Likewise.
10414
10415         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10416         then first look up the entire `.'-containing string as a login name.
10417
10418 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10419
10420         * getdate.y: Handle two-digit years with leading zeros correctly.
10421         (textint): New typedef.
10422         (parser_control): Member year changed from int to textint.
10423         All uses changed.
10424         (YYSTYPE): Removed; replaced by %union with int and textint members.
10425         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10426         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10427         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10428         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10429         (date, number, to_year): Use width of number in digits, not its value,
10430         to determine whether it's a 2-digit year, or a 2-digit time.
10431         (yylex): Store number of digits of numeric tokens.
10432         Reported by John Kendall.
10433
10434         (parser_control): Changed from struct parser_control to typedef (for
10435         consistency).  All uses changed.
10436
10437         (tID): Removed; not used.
10438         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10439
10440 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10441
10442         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10443         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10444
10445 2000-02-12  Jim Meyering  <meyering@lucent.com>
10446
10447         * userspec.c (ISDIGIT): Define it.
10448         (isdigit): Remove definition.
10449         (is_number): Use ISDIGIT, not isdigit.
10450         <libintl.h>: Include.
10451         (_ and N_): Define.
10452         (parse_user_spec): Mark translatable strings.
10453
10454 2000-02-10  Jim Meyering  <meyering@lucent.com>
10455
10456         With these changes, nanosleep.[ch] are finally enough like the other
10457         lib/* replacement files to compile on a few more losing systems.
10458
10459         * nanosleep.h: Don't include config.h.
10460         Remove prototype from declaration of nanosleep.
10461         (PARAMS): Remove now-unneeded definition.
10462         * nanosleep.c: #undef nanosleep.
10463         (rpl_nanosleep): Rename from nanosleep.
10464
10465 2000-02-03  Jim Meyering  <meyering@lucent.com>
10466
10467         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10468         rather than with `#if HAVE_UTMPNAME'.
10469
10470 2000-02-01  Jim Meyering  <meyering@lucent.com>
10471
10472         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10473
10474 2000-01-31  Jim Meyering  <meyering@lucent.com>
10475
10476         * nanosleep.h (nanosleep): Guard declaration with
10477         `#if ! HAVE_DECL_NANOSLEEP'.
10478         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10479         the declaration in that vendor's sys/timers.h.
10480         Reported by Christian Krackowizer.
10481
10482         * quotearg.c (ISASCII): Add #undef and move definition to follow
10483         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10484         (ISPRINT): Likewise.
10485         Reported by Tom Tromey.
10486
10487 2000-01-30  Jim Meyering  <meyering@lucent.com>
10488
10489         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10490         uses of ->ut_name.  The latter doesn't work with new Linux header files
10491         where only utmpx.ut_user is declared.
10492
10493         * readutmp.h (UT_USER): Define.
10494
10495 2000-01-23  Jim Meyering  <meyering@lucent.com>
10496
10497         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10498         obstack.c.
10499
10500 2000-01-22  Jim Meyering  <meyering@lucent.com>
10501
10502         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10503         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10504         Required for some AIX systems.  Reported by Christian Krackowizer.
10505         [TESTING] (main): New function.
10506
10507         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10508         * dirname.c (dir_name): Support for DOS-style file names with drive
10509         letters.
10510
10511         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10512
10513         * strverscmp.c (ISDIGIT): Define.
10514         (strverscmp): Use ISDIGIT, not isdigit.
10515
10516 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10517
10518         * nanosleep.c (nanosleep):
10519         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10520         POSIX.1 doesn't require SA_INTERRUPT and some systems
10521         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10522         it's been part of POSIX.1 since day 1 (in 1988).
10523
10524 2000-01-17  Jim Meyering  <meyering@lucent.com>
10525
10526         * interlock: Remove unused file.  Reported by François Pinard.
10527
10528 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10529
10530         * quotearg.c (quotearg_buffer_restyled): Do not quote
10531         alert, backslash, formfeed, and vertical tab unnecessarily in
10532         shell quoting style.
10533
10534
10535 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10536 Free Software Foundation, Inc.
10537 Copying and distribution of this file, with or without modification,
10538 are permitted provided the copyright notice and this notice are preserved.