6f7d25cc26c1a80bf2c041ed04447b1aa545c25c
[gnulib.git] / lib / ChangeLog
1 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * isapipe.c, isapipe.h: New files.
4
5 2006-08-29  Eric Blake  <ebb9@byu.net>
6
7         * error.c (error_at_line, print_errno_message): Match libc, after
8         resolution of upstream bug 3044.
9
10 2006-08-29  Bruno Haible  <bruno@clisp.org>
11
12         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
13
14 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
15
16         Sync from Libtool:
17
18         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
19
20         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
21         sharing with gnulib.  Report by Eric Blake.
22
23 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
24
25         * fcntl_.h: New file.
26         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
27         the fcntl module.
28         * dirchownmod.c: Likewise.
29         * fts.c: Likewise.
30
31         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
32         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
33         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
34         just before including <inttypes.h>, to avoid circular inclusion.
35
36 2006-08-28  Bruno Haible  <bruno@clisp.org>
37
38         * inttypes_.h (SCNX*): Remove definitions.
39         Reported by Eric Blake.
40
41 2006-08-26  Bruno Haible  <bruno@clisp.org>
42
43         * vasnprintf.c (EOVERFLOW): Remove definition.
44         (VASNPRINTF): Return a string of length > INT_MAX without failing.
45         * vasprintf.c: Include errno.h, limits.h.
46         (EOVERFLOW): New fallback definition.
47         (vasprintf): Test here whether the string length is > INT_MAX.
48         * vsnprintf.c: Include errno.h, limits.h.
49         (EOVERFLOW): New fallback definition.
50         (vsnprintf): Fix bug when generated string was too long for the buffer.
51         Test here whether the string length is > INT_MAX.
52
53 2006-08-26  Bruno Haible  <bruno@clisp.org>
54             Simon Josefsson  <jas@extundo.com>
55
56         BeOS portability.
57         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
58
59 2006-08-28  Bruno Haible  <bruno@clisp.org>
60
61         * c-strstr.h: New file, from GNU gettext.
62         * c-strstr.c: New file, from GNU gettext.
63
64 2006-08-26  Bruno Haible  <bruno@clisp.org>
65
66         * inttypes_.h: New file.
67         * inttypes.h: Remove file.
68         * stdint_.h: Include <inttypes.h> through its absolute filename.
69
70         * imaxabs.c: New file.
71
72         * imaxdiv.c: New file.
73
74 2006-08-22  Bruno Haible  <bruno@clisp.org>
75
76         * readutmp.h: Skip most definitions if neither <utmp.h> nor
77         <utmpx.h> exists.
78
79 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
80
81         BeOS portability.
82         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
83         Problem reported by Bruno Haible.
84
85 2006-08-21  Bruno Haible  <bruno@clisp.org>
86
87         BeOS portability.
88         * mbchar.h: Include <wctype.h> only if it exists.
89
90 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
91
92         * cycle-check.h: Include <stdint.h> unconditionally, since we
93         now assume the stdint module.  Do not include inttypes.h.
94         * fsusage.h: Likewise.
95         * getndelim2.c: Likewise.
96         * human.h: Likewise.
97         * inttostr.h: Likewise.
98         * obstack.c: Likewise.
99         * regex_internal.h: Likewise.
100         * tempname.c: Likewise.
101         * utimecmp.c: Likewise.
102         * xstrtol.h: Likewise.
103
104         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
105
106         * strtoimax.c: Adjust to macro name changes in Autoconf,
107         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
108         * xtime.h: Likewise.
109
110 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
111
112         * fchmodat.c: New file, from coreutils.  This was inadvertently
113         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
114
115 2006-08-18  Bruno Haible  <bruno@clisp.org>
116
117         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
118         (ME_DUMMY): Treat "kernfs" as a dummy.
119         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
120
121 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
122
123         Update from coreutils.
124
125         * __fpending.h: Add copyright notice.
126         * fprintftime.h: Likewise.
127         * savedir.c: Use (C) in copyright notice.
128         * savedir.h: Likewise.
129
130         2006-08-15  Jim Meyering  <jim@meyering.net>
131
132         * at-func.c: New file, with the logic of all emulated at-functions.
133         * openat-priv.h: Include <errno.h> and define ENOSYS,
134         in support of the EXPECTED_ERRNO macro.
135         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
136         Instead, define the appropriate symbols and include "at-func.c".
137         * mkdirat.c (mkdirat): Likewise.
138         * fchmodat.c (fchmodat): Likewise.
139         (ENOSYS): Remove definition.
140         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
141         Don't include "unistd--.h" -- it wasn't ever used.
142
143         2006-01-17  Jim Meyering  <jim@meyering.net>
144
145         Rewrite fts.c not to change the current working directory,
146         by using openat, fstatat, fdopendir, etc..
147
148         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
149         (HAVE_OPENAT_SUPPORT): Define.
150         [_LIBC] (fchdir): Don't undef or define; no longer used.
151         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
152         Now, this `function' always succeeds, and consumes its file descriptor
153         parameter -- so callers must not close such FDs.  Update callers.
154         (diropen_fd, opendirat, cwd_advance_fd): New functions.
155         (diropen): Add parameter, SP.  Adjust all callers.
156         Implement using diropen_fd, rather than open.
157         (fts_open): Initialize new member, fts_cwd_fd.
158         Remove fts_rft-setting code.
159         (fts_close): Close fts_cwd_fd, if necessary.
160         (__opendir2): Define in terms of opendir or opendirat,
161         depending on whether the FST_NOCHDIR flag is set.
162         (fts_build): Since fts_safe_changedir consumes its FD, and since
163         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
164         and close the dup'd file descriptor upon failure.
165         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
166         (fts_safe_changedir): Tweak semantics to reflect that this function
167         now calls cwd_advance_fd and hence consumes its FD argument.
168         * fts_.h [struct FTS] (fts_cwd_fd): New member.
169         [struct FTS] (fts_rft): Remove now-unused member.
170         [struct FTS] (fts_cycle.state): Improve comment.
171
172         * openat.c (openat_needs_fchdir): New function.
173         * openat.h (openat_needs_fchdir): Declare it.
174
175 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
176
177         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
178         Problem and fix reported by Pádraig Brady in
179         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
180
181 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
182
183         * memcoll.c (memcoll): Optimize for the common case where the
184         arguments are bytewise equal.
185
186 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
187
188         Change copyright notice from LGPL 2 to GPL 2, since that's the
189         standard form used in the gnulib repository.
190         * lock.c: LGPL -> GPL.
191         * lock.h: Likewise.
192         * strnlen1.c: Likewise.
193         * strnlen1.h: Likewise.
194         * tls.c: Likewise.
195         * tls.h: Likewise.
196         * tmpdir.c: Likewise.
197
198         * TODO: Remove; this belongs only in coreutils.
199
200 2006-08-14  Eric Blake  <ebb9@byu.net>
201
202         Import the following change from libc:
203
204         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
205
206         Upstream bug 2997.
207         * misc/error.c: Add space between program name and message if file
208         name is missing.
209
210 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
211
212         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
213         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
214
215         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
216         in wchar_t.  Problem reported by Eric Blake.
217
218         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
219         LEN is smaller than SIZE.  Suggested by Bruno Haible.
220         Also, help the compiler to keep LEN in a register.
221
222 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
223
224         * .cppi-disable: Add snprintf.h, socket_.h.
225         * snprintf.c: Include <errno.h> and <limits.h>.
226         (EOVERFLOW): Define if the system does not.
227         Do not include "minmax.h"; it wasn't used.
228         (snprintf): Don't assume size_t promotes to an unsigned type.
229         Fix bug when generated string was too long for the buffer: the
230         buffer's contents are supposed to be the initial prefix of the
231         output.  Don't assume vasnprintf returns EOVERFLOW if the size
232         exceeds INT_MAX; do the check ourselves.
233
234         Import the following changes from libc:
235
236         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
237
238         * posix/regex_internal.c (re_string_skip_chars): If no character has
239         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
240         to the byte which couldn't be converted.
241         (re_string_reconstruct): Don't clear valid_raw_len before calling
242         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
243         tip_context using re_string_context_at.
244
245         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
246
247         * posix/regex.h: g++ still cannot handled [restrict].
248
249         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
250
251         * posix/regex.h: Remove special handling for VMS.
252
253 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
254
255         Sync from coreutils.
256
257         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
258
259         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
260         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
261
262 2006-08-08  Eric Blake  <ebb9@byu.net>
263
264         * verror.c (verror_at_line): Work around glibc bug 2997, so that
265         verror_at_line output complies with GNU Coding Standards even when
266         file is NULL.
267
268 2006-08-08  Eric Blake  <ebb9@byu.net>
269
270         * verror.h, verror.c: New files.
271
272 2006-08-07  Bruno Haible  <bruno@clisp.org>
273
274         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
275         versions of AIX.
276         Reported by Ralf Wildenhues.
277
278 2006-08-06  Eric Blake  <ebb9@byu.net>
279
280         * error.h: Fold in some upstream changes from glibc.
281         * error.c: Likewise.
282
283 2006-07-29  Bruno Haible  <bruno@clisp.org>
284
285         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
286
287 2006-07-29  Bruno Haible  <bruno@clisp.org>
288
289         * setenv.c: Undo unintended modification done on 2006-02-27.
290
291 2006-07-28  Eric Blake  <ebb9@byu.net>
292
293         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
294         macro expansion.
295
296 2006-07-28  Simon Josefsson  <jas@extundo.com>
297
298         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
299         #include's.
300
301 2006-07-28  Simon Josefsson  <jas@extundo.com>
302
303         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
304         #include's.
305
306 2006-07-28  Bruno Haible <bruno@clisp.org>
307
308         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
309
310 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
311
312         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
313         arpa/inet.h.
314
315 2006-07-28  Bruno Haible  <bruno@clisp.org>
316
317         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
318         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
319         fallbacks.
320         Avoids link error on FreeBSD 4.x.
321         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
322
323         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
324         encoding.
325         * mbswidth.c (iswcntrl): Likewise.
326
327 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
328
329         * modechange.c (mode_compile): Numeric modes now affect setuid and
330         setgid on directories only if they set these bits.
331         * modechange.h: Remove obsolete comment about masks.
332
333 2006-07-27  Bruno Haible  <bruno@clisp.org>
334
335         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
336         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
337         defined.
338
339 2006-07-26  Eric Blake  <ebb9@byu.net>
340
341         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
342         like mingw that lack mkstemp.
343         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
344         avoid compilation warning on mingw.
345
346 2006-07-25  Bruno Haible  <bruno@clisp.org>
347
348         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
349         <stdarg.h> or config.h.
350
351 2006-07-24  Bruno Haible  <bruno@clisp.org>
352
353         * clean-temp.h: New file, from GNU gettext.
354         * clean-temp.c: New file, from GNU gettext.
355
356 2006-07-24  Bruno Haible  <bruno@clisp.org>
357
358         * tmpdir.h: New file, from GNU gettext.
359         * tmpdir.c: New file, from GNU gettext.
360
361 2006-07-23  Bruno Haible  <bruno@clisp.org>
362
363         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
364         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
365         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
366         gl_linked_remove_at): Use it.
367
368 2006-07-23  Eric Blake  <ebb9@byu.net>
369
370         * tmpfile-safer.c: New file.
371         * stdio-safer.h (fopen_safer): Add prototype.
372         * stdio--.h (tmpfile): Make safer.
373
374 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
375
376         * close-stream.c, close-stream.h: New files.
377
378 2006-07-22  Bruno Haible  <bruno@clisp.org>
379
380         Merge from GNU gettext 0.15.
381
382         2005-07-05  Bruno Haible  <bruno@clisp.org>
383
384                 * printf-args.c (printf_fetchargs): Work around broken
385                 definition of wint_t on mingw.
386
387         2005-02-12  Bruno Haible  <bruno@clisp.org>
388
389                 * xallocsa.h: Add extern "C" for C++.
390
391         2006-05-17  Bruno Haible  <bruno@clisp.org>
392
393                 Cygwin portability.
394                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
395
396         2006-04-30  Bruno Haible  <bruno@clisp.org>
397
398                 * progreloc.c: Include <mach-o/dyld.h> if available.
399                 (find_executable): Use _NSGetExecutablePath when possible.
400
401         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
402
403                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
404                 function.
405
406         2005-12-29  Bruno Haible  <bruno@clisp.org>
407
408                 * progreloc.c (set_program_name_and_installdir): Fix
409                 compilation error.
410
411         2005-12-04  Bruno Haible  <bruno@clisp.org>
412
413                 Cygwin portability.
414                 * progreloc.c: Include <windows.h> also on Cygwin.
415                 (find_executable): Add support for Cygwin.
416                 (set_program_name_and_installdir): Handle also platforms with
417                 nonempty EXEEXT.
418
419         2006-07-11  Bruno Haible  <bruno@clisp.org>
420
421                 * javacomp.c: Fix a comment.
422                 Reported by Jim Meyering.
423
424         2006-04-30  Bruno Haible  <bruno@clisp.org>
425
426                 * javacomp.h (compile_java_class): Add source_version,
427                 target_version arguments.
428                 * javacomp.c: Rewritten to choose only a compiler that
429                 respects the specified source_version and target_version.
430
431         2006-06-27  Bruno Haible  <bruno@clisp.org>
432
433                 Assume correct S_ISDIR macro.
434                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
435
436         2006-07-22  Bruno Haible  <bruno@clisp.org>
437
438                 * javaversion.h: New file, from GNU gettext.
439                 * javaversion.c: New file, from GNU gettext.
440                 * javaversion.java: New file, from GNU gettext.
441                 * javaversion.class: New file, from GNU gettext.
442
443         2006-05-17  Bruno Haible  <bruno@clisp.org>
444
445                 Cygwin portability.
446                 * javaexec.c (execute_java_class): Test for jview program
447                 also on Cygwin.
448
449         2006-04-09  Bruno Haible  <bruno@clisp.org>
450
451                 * fatal-signal.c: Don't include string.h.
452                 (at_fatal_signal): Use a copying loop instead of memcpy.
453
454         2005-12-04  Bruno Haible  <bruno@clisp.org>
455
456                 * csharpexec.c: Add support for 'clix' launcher (untested).
457                 (execute_csharp_using_sscli): New function.
458                 (execute_csharp_program): Call it.
459
460         2006-06-21  Bruno Haible  <bruno@clisp.org>
461
462                 Avoid warnings from recent versions of mcs.
463                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
464                 -o, -L, -r any more. Use options documented since mcs-1.0
465                 instead. Similarly for -g.
466
467         2005-07-09  Bruno Haible  <bruno@clisp.org>
468
469                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
470                 add a .dll suffix.
471                 Reported by Mark Junker <mjscod@gmx.de>.
472
473         2006-06-17  Bruno Haible  <bruno@clisp.org>
474
475                 * config.charset: Update for NetBSD 3.0.
476
477         2006-05-17  Bruno Haible  <bruno@clisp.org>
478
479                 Cygwin portability.
480                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
481
482         2006-05-16  Bruno Haible  <bruno@clisp.org>
483
484                 * localcharset.c [CYGWIN]: Include <windows.h>.
485                 (get_charset_aliases): For Cygwin, return the same CPxxx
486                 aliases list as under WIN32.
487                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
488                 the environment variables. Fall back to GetACP().
489
490         2006-04-05  Bruno Haible  <bruno@clisp.org>
491
492                 * config.charset: Update Juan Manuel Guerrero's address.
493
494         2005-02-12  Bruno Haible  <bruno@clisp.org>
495
496                 * allocsa.h: Add extern "C" for C++.
497
498         2005-02-10  Bruno Haible  <bruno@clisp.org>
499
500                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
501                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
502
503         2006-07-22  Bruno Haible  <bruno@clisp.org>
504
505                 * gettext.h: Update to GNU gettext-0.15.
506
507 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
508         and Simon Josefsson <jas@extundo.com>
509
510         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
511
512         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
513
514 2006-07-21  Eric Blake  <ebb9@byu.net>
515
516         * stdlib-safer.h: New file from coreutils, required by
517         stdlib--.h.
518
519 2006-07-19  Derek R. Price  <derek@ximbiot.com>
520
521         * getaddrinfo.h: Don't define unimplemented AI_* flags.
522         Reindent and repaginate.
523
524 2006-07-17  Bruno Haible  <bruno@clisp.org>
525
526         * gl_list.h: New file.
527         * gl_list.c: New file.
528         * gl_array_list.h: New file.
529         * gl_array_list.c: New file.
530         * gl_carray_list.h: New file.
531         * gl_carray_list.c: New file.
532         * gl_linked_list.h: New file.
533         * gl_linked_list.c: New file.
534         * gl_anylinked_list1.h: New file.
535         * gl_anylinked_list2.h: New file.
536         * gl_avltree_list.h: New file.
537         * gl_avltree_list.c: New file.
538         * gl_anyavltree_list1.h: New file.
539         * gl_anyavltree_list2.h: New file.
540         * gl_rbtree_list.h: New file.
541         * gl_rbtree_list.c: New file.
542         * gl_anyrbtree_list1.h: New file.
543         * gl_anyrbtree_list2.h: New file.
544         * gl_anytree_list1.h: New file.
545         * gl_anytree_list2.h: New file.
546         * gl_linkedhash_list.h: New file.
547         * gl_linkedhash_list.c: New file.
548         * gl_anyhash_list1.h: New file.
549         * gl_anyhash_list2.h: New file.
550         * gl_avltreehash_list.h: New file.
551         * gl_avltreehash_list.c: New file.
552         * gl_rbtreehash_list.h: New file.
553         * gl_rbtreehash_list.c: New file.
554         * gl_anytreehash_list1.h: New file.
555         * gl_anytreehash_list2.h: New file.
556
557         * gl_oset.h: New file.
558         * gl_oset.c: New file.
559         * gl_array_oset.h: New file.
560         * gl_array_oset.c: New file.
561         * gl_avltree_oset.h: New file.
562         * gl_avltree_oset.c: New file.
563         * gl_rbtree_oset.h: New file.
564         * gl_rbtree_oset.c: New file.
565         * gl_anytree_oset.h: New file.
566
567 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
568
569         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
570         New files.
571         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
572         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
573         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
574         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
575         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
576         callers changed.  Revamp internals significantly, by not
577         attempting to create directories that are temporarily more
578         permissive than the final results.  Do not attempt to use
579         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
580         This removes some race conditions, fixes some bugs, and simplifies
581         things.  Use new dirchownmod function to do owner and mode changes.
582         * mkdir-p.h: Likewise.
583         * modechange.c (octal_to_mode): New function.
584         (struct mode_change): New member mentioned.
585         (make_node_op_equals): New arg mentioned.  All callers changed.
586         (mode_compile): Keep track of which mode bits the user has explicitly
587         mentioned.
588         (mode_adjust): New arg DIR, so that we implement the X op correctly.
589         New arg PMODE_BITS, to keep track of which mode bits the user
590         mentioned; it treats S_ISUID and S_ISGID speciall.
591         All callers changed.
592         * modechange.h: Likewise.
593
594 2006-07-11  Derek R. Price  <derek@ximbiot.com>
595
596         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
597
598 2006-07-10  Derek R. Price  <derek@ximbiot.com>
599
600         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
601         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
602         macros into the GNU _D_EXACT_NAMLEN.
603         * savedir.c:  Likewise.
604         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
605
606 2006-07-09  Jim Meyering  <jim@meyering.net>
607
608         * argp-pv.c: Remove a doubled word in a comment.
609         * check-version.c (check_version): Likewise.
610         * javacomp.c (compile_java_class): Likewise.
611
612 2006-07-08  Jim Meyering  <jim@meyering.net>
613
614         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
615
616 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
617
618         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
619         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
620         brackets.  Other minor changes to suppress some compiler
621         warnings.
622
623 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
624
625         * getloadavg.c: Use __VMS, not VMS.
626         * getopt.c: Likewise.
627         * getpagesize.h: Likewise.
628         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
629         probably does not work.
630
631 2006-07-06  Derek R. Price  <derek@ximbiot.com>
632         and Paul Eggert  <eggert@cs.ucla.edu>
633
634         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
635         Don't worry about this obsolete case any more.
636         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
637         directories.
638         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
639         worry about this obsolete case any more.
640         * fts.c: Likewise.
641         * getcwd.c: Likewise.
642         * glob.h: Likewise.
643         * savedir.c: Likewise.
644
645 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
646
647         * .cppi-disable: Add wcwidth.
648         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
649         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
650         (ISGRAPH): Remove.  All uses changed to isgraph.
651         (FOLD) [!defined _LIBC]: Remove special case.
652         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
653         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
654         HAVE_ISBLANK.
655         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
656
657 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
658
659         * strtod.c (strtod): cast the argument of tolower to unsigned char.
660
661 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
662
663         * memcasecmp.c: Include <limits.h>.
664         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
665         * strtod.c (strtod): Don't assume isspace works on negative chars.
666         Don't assume isdigit succeeds only on '0' through '9'.
667
668 2006-07-05  Derek R. Price  <derek@ximbiot.com>
669
670         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
671         All uses of is_space replaced by isspace.
672         * exit.h: Don't talk about STDC_HEADERS.
673         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
674         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
675         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
676         replaced by isprint etc.
677         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
678         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
679         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
680         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
681         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
682         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
683
684 2006-07-05  Eric Blake  <ebb9@byu.net>
685
686         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
687         missing from netdb.h.
688         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
689
690 2006-06-27  Bruno Haible  <bruno@clisp.org>
691
692         Assume ANSI C header files and <ctype.h> functions.
693         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
694         (mbsnwidth): Use isprint, iscntrl instead.
695
696 2006-07-03  Jim Meyering  <jim@meyering.net>
697
698         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
699         macro is used before the first cycle_check call.
700
701 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
702
703         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
704         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
705         reported by Mark D. Baushke, one in
706         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
707
708         Merge from coreutils.
709
710         * .cppi-disable: Add stdint_.h.
711         * .cvsignore: Add stdint.h.
712
713         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
714
715         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
716         both double and long double versions.
717         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
718         * xstrtold.c: New file.
719         * xstrtod.h (xstrtold): New decl.
720
721         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
722
723         * filemode.c (setst): Remove.
724         (strmode): Rewrite to avoid setst.  This makes the code shorter,
725         (arguably) clearer, and the generated code is a bit smaller on my
726         Debian GNU/Linux stable x86 host.
727
728         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
729
730         * filemode.c: Include "filemode.h" first, to test the interface.
731         Assume that filemode.h includes sys/types.h and sys/stat.h.
732         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
733         (ftypelet): Reorder to put common cases first, for efficiency.
734         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
735         to do 'M'.
736         (strmode): Renamed from mode_string, and now stores 12 bytes instead
737         of 10, for compatibility with FreeBSD.  All callers changed.
738         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
739         that can't be deduced solely from st_mode.  First arg is now a const
740         pointer.
741         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
742         (strmode): Renamed from mode_string.
743         (filemodestring): New decl.
744         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
745         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
746         (S_ISPORT, S_ISWHT): New macros, if not already defined.
747
748         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
749
750         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
751         fsusage.h now does that.  Include fsusage.h first, to test interface.
752         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
753         at most one method (the old code could have generated decls that
754         didn't conform to C89, not that this was ever exercised).
755         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
756
757         2006-03-19  Jim Meyering  <jim@meyering.net>
758
759         Work even in a chroot where d_ino values for entries in "/"
760         don't match the stat.st_ino values for the same names.
761         * getcwd.c (__getcwd): When no d_ino value matches the target inode
762         number, iterate through all entries again, using lstat instead.
763         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
764         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
765
766         * getcwd.c (__getcwd): Clarify a comment.
767         Use memcpy in place of a call to strcpy.
768
769         2006-03-12  Jim Meyering  <jim@meyering.net>
770
771         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
772         that of the current directory (which we're about to chdir ".." out of),
773         then save the dev-ino of the parent, instead.
774
775         * same-inode.h (SAME_INODE): New file/macro.
776         * chdir-safer.c (SAME_INODE): Remove definition.
777         Include "same-inode.h", instead.
778         * same.c: Likewise.
779         * cycle-check.h: Include "same-inode.h".
780         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
781         * cycle-check.c (SAME_INODE): Remove definition.
782         * root-dev-ino.h: Include "same-inode.h".
783
784         2006-03-11  Eric Blake  <ebb9@byu.net>
785
786         * same.c (same_name): s/base_name/last_component/
787         * backupfile.c (check_extension, numbered_backup): Likewise.
788         * filenamecat.c (file_name_concat): Likewise.
789
790         2006-03-11  Eric Blake  <ebb9@byu.net>,
791                     Paul Eggert  <eggert@cs.ucla.edu>
792
793         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
794         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
795         drive prefix.
796         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
797         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
798         (last_component): New method.
799         * dirname.c (dir_len): Determine when drive letters need a
800         subsequent slash.  Preserve // when it is special.
801         (dir_name): Don't append dot when drive letter is absolute.
802         [TEST_DIRNAME]: Move into a full-blown gnulib test.
803         * basename.c (base_name): New semantics - malloc the result.
804         Preserve // when it is special.  Preserve relative files that look
805         like drive letters.
806         (base_len): Preserve // when it is special.
807         (last_component): New method, similar to old base_name semantics.
808         * stripslash.c (strip_trailing_slashes): Use last_component, not
809         base_name.  Strip redundant slashes from ///.
810
811 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
812
813         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
814         both are 64 bits, since this seems to be the tradition, and this
815         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
816         we ever run into a host that prefers long long to long in this
817         case, we'll need another configure-time test.  Problem reported by
818         Jim Meyering.
819
820 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
821
822         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
823         possible collision with system files.
824         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
825         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
826         WCHAR_MIN and WCHAR_MAX in this case.
827         (<stddef.h>): Do not include; no longer needed.
828         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
829         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
830         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
831         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
832         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
833         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
834         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
835         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
836         !defined(__c99))]: Include in this case too, since it's harmless
837         now.
838         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
839         dangerous to do so.
840         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
841         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
842         (_STDINT_MIN, _STDINT_MAX): New macros.
843         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
844         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
845         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
846         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
847         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
848         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
849         macros, not typedefs; this simplifies things quite a bit.
850         Use long int for all types narrower than int64_t.
851         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
852         Define in terms of long long int or int64_t or long int,
853         not int64_t or int32_t.  This saves some compile-time testing.
854         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
855         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
856         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
857         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
858         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
859         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
860         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
861         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
862         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
863         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
864         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
865         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
866         undef any previous version and define our own version, for
867         simplicity and consistency with the new macros for types.
868         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
869         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
870         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
871         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
872         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
873         @WINT_T_SUFFIX@ to keep things simple here.
874         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
875         Simplify by assuming typical 8/16/32/64 host, since we're
876         already doing that elsewhere anyway.
877         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
878         and assume long long int is 64 bits if available.  This
879         speeds up 'configure'.
880
881 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
882
883         * getaddrinfo.c: fixed typo
884
885 2006-06-29  Eric Blake  <ebb9@byu.net>
886
887         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
888         unused static function.
889
890 2006-06-29  Eric Blake  <ebb9@byu.net>
891
892         * stat_.h: New file.
893
894 2006-06-29  Derek R. Price  <derek@ximbiot.com>
895
896         * strftime.c: Assume strftime() exists.
897
898 2006-06-28  Bruno Haible  <bruno@clisp.org>
899
900         * getaddrinfo.h: Fix POSIX URL.
901         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
902         (use_win32_p): Make static.
903         (getaddrinfo): Reject service name if it is empty or does not consist
904         solely of decimal digits, or if its value is > 65535.
905         (getnameinfo): Remove useless casts.
906
907 2006-06-28  Derek R. Price  <derek@ximbiot.com>
908
909         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
910         Autoconf 2.60 says this stuff was obsolete.
911
912 2006-05-12  Bruno Haible  <bruno@clisp.org>
913
914         * mkdtemp.c [MINGW]: Include <io.h>.
915         (mkdir): Define using _mkdir.
916
917 2006-06-28  Bruno Haible  <bruno@clisp.org>
918
919         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
920         declaration for wcwidth.
921         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
922
923 2006-06-28  Eric Blake  <ebb9@byu.net>
924
925         * xvasprintf.h: Fix comments.
926
927 2006-06-28  Eric Blake  <ebb9@byu.net>
928
929         * mbchar.h (wcwidth): Include wcwidth.h.
930         * mbswidth.c (wcwidth): Move from here...
931         * wcwidth.h: ...to this new file.
932
933 2006-06-28  Simon Josefsson  <jas@extundo.com>
934
935         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
936         functions there.  It will succeed on Windows XP, but on Windows
937         2000 and (presumably) earlier, it will fail, and use the internal
938         re-implementation.
939         (use_win32_p): New function.
940         (getaddrinfo): Use strtoul on servname, to support numeric ports.
941         Support AI_NUMERICSERV to disable getservbyname.
942         (getnameinfo): New function, only supports
943         NI_NUMERICHOST|NI_NUMERICSERV for now.
944
945         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
946         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
947         getnameinfo.
948
949 2006-06-27  Bruno Haible  <bruno@clisp.org>
950
951         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
952
953 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
954
955         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
956         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
957         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
958
959 2006-06-26  Bruno Haible  <bruno@clisp.org>
960
961         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
962         WCHAR_MAX.
963         Reported by Mark D. Baushke and Larry Jones.
964
965 2006-06-26  Bruno Haible  <bruno@clisp.org>
966
967         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
968         in pre-C99 mode.
969         Suggested by Mark D. Baushke and Larry Jones.
970
971 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
972
973         * stdint_.h: Treat BSD/OS like OpenBSD.
974
975 2006-06-23  Bruno Haible  <bruno@clisp.org>
976
977         * stdint_.h: Treat IRIX like OpenBSD.
978
979 2006-06-23  Bruno Haible  <bruno@clisp.org>
980
981         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
982         ISO C 99 Technical Corrigendum 1.
983
984 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
985
986         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
987         Some compiler complained about some of them.  Problem reported by
988         Larry Jones in
989         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
990
991 2006-06-21  Simon Josefsson  <jas@extundo.com>
992
993         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
994         variable.
995
996         * socket_.h: Don't define WINVER.
997
998         * inet_pton.h, inet_pton.c: New file, taken from glibc but
999         slightly modified to work in gnulib.
1000
1001 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1002
1003         * read-file.c (fread_file): Start with buffer allocation of
1004         0 bytes rather than 1 byte; this simplifies the code.
1005         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1006         code to free buffer and save/restore errno.
1007         (internal_read_file): Remove unused local.
1008
1009 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1010
1011         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1012         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1013         Problem reported by Denis Excoffier in
1014         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1015
1016 2006-06-19  Simon Josefsson  <jas@extundo.com>
1017
1018         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1019
1020 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1021
1022         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1023
1024 2006-06-17  Bruno Haible  <bruno@clisp.org>
1025
1026         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1027
1028 2006-06-17  Bruno Haible  <bruno@clisp.org>
1029
1030         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1031         problem on Solaris 2.5.1.
1032
1033 2006-06-16  Eric Blake  <ebb9@byu.net>
1034
1035         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1036         * unicodeio.c [!defined errno]: Likewise.
1037         * strtol.c [!defined errno]: Likewise.
1038         * strtod.c [!defined errno]: Likewise.
1039
1040 2006-06-15  Bruno Haible  <bruno@clisp.org>
1041
1042         * stdint_.h: Rewritten to be fully auto-configured.
1043         Fixes bug on HP-UX/IA64.
1044
1045 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1046
1047         * getdate.y (__attribute__): Don't define if already defined.
1048         Problem reported by Larry Jones.
1049         * utimens.c (__attribute__): Likewise.
1050
1051 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1052
1053         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1054         reported by Andreas Schwab.
1055
1056 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1057             Bruno Haible  <bruno@clisp.org>
1058
1059         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1060
1061 2006-05-26  Martin Lambers  <marlam@marlam.de>
1062
1063         * getpass.c: Updates the test for the native W32 API, and adds
1064         missing includes, thus fixing compilation warnings.
1065
1066 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1067
1068         * tempname.c (small_open, large_open): New macros.
1069         (__open, __open64) [!_LIBC]: Remove.
1070         (__gen_tempname): Use small_open and large_open instead of __open
1071         and __open64.  This fixes a portability bug on HP-UX 11.11i
1072         reported by Simon Wing-Tang in
1073         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1074
1075 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1076
1077         * exclude.c (exclude_fnmatch): New function.
1078         (excluded_file_name): Call exclude_fnmatch.
1079         * exclude.h (excluded_file_name): New prototype
1080
1081 2006-05-24  Bruno Haible  <bruno@clisp.org>
1082
1083         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1084         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1085         Reported by Thorsten Maerz <torte@netztorte.de> via
1086         Aaron Stone <aaron@serendipity.cx>.
1087
1088 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1089
1090         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1091         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1092         (my_usleep): Don't mishandle maximum value.
1093
1094 2006-05-19  Jim Meyering  <jim@meyering.net>
1095
1096         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1097
1098 2006-05-17  Bruno Haible  <bruno@clisp.org>
1099
1100         Cygwin portability.
1101         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1102
1103 2006-05-17  Bruno Haible  <bruno@clisp.org>
1104
1105         * stdint_.h: Fix recognition of Cygwin.
1106
1107 2006-05-11  Jim Meyering  <jim@meyering.net>
1108
1109         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1110
1111 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1112
1113         * crc.c (crc32_update): Remove unnecessary L suffix.
1114         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1115         unwanted sign propagation, e.g., on hosts with 64-bit int.
1116         There still are some problems with reeelly weird theoretical hosts
1117         (e.g., 33-bit int) but it's not worth worrying about now.
1118         * sha1.c (rol): Likewise.
1119         (K1, K2, K3, K4): Remove unnecessary L suffix.
1120
1121 2006-05-10  Bruno Haible  <bruno@clisp.org>
1122
1123         * des.c: Cast to avoid warnings.
1124
1125 2006-05-10  Simon Josefsson  <jas@extundo.com>
1126
1127         * md4.c: Typo fix, update copyright years.
1128         (K1, K2): Don't use L because it turn computations into 64-bit on
1129         64-bit platforms.
1130
1131 2006-05-09  Bruno Haible  <bruno@clisp.org>
1132
1133         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1134         (EOVERFLOW): Define fallback value.
1135         (xstrcat): New function.
1136         (xvasprintf): Recognize the special case of a string concatenation.
1137
1138 2006-05-01  Bruno Haible  <bruno@clisp.org>
1139
1140         * stdint_.h: Shorter URL.
1141         * inttypes.h: Likewise.
1142
1143 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1144
1145         * verify.h: Document the internals better.  Most of this change
1146         was written by Bruno Haible.
1147
1148 2006-04-29  Bruno Haible  <bruno@clisp.org>
1149
1150         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1151         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1152
1153 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1154
1155         * getdate.y (get_date): When adding relative date, start with the
1156         initial time, not with the result of the first mktime call.
1157
1158 2006-04-23  Bruno Haible  <bruno@clisp.org>
1159
1160         * copy-file.c: Include <unistd.h> unconditionally.
1161         * execute.c: Likewise.
1162         * fatal-signal.c: Likewise.
1163         * findprog.c: Likewise.
1164         * mkdtemp.c: Likewise.
1165         * pipe.h: Likewise.
1166         * pipe.c: Likewise.
1167         * wait-process.h: Likewise.
1168
1169 2006-04-23  Bruno Haible  <bruno@clisp.org>
1170
1171         * fwriteerror.c (fwriteerror): Call fclose also when an error
1172         condition was already detected.
1173         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1174
1175 2006-04-19  Derek Price  <derek@ximbiot.com>
1176             Eric Blake  <ebb9@byu.net>
1177
1178         * inttypes.h: Correct grammar in comment.
1179
1180 2006-04-18  Derek Price  <derek@ximbiot.com>
1181             Paul Eggert  <eggert@cs.ucla.edu>
1182
1183         * inttypes.h: New file.
1184         * strtoimax.c: Assume <inttypes.h>.
1185
1186 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1187
1188         * utimens.c (futimens): glibc futimesat messes up if /proc
1189         isn't mounted.  Problem reported by Kir Kolyshkin.
1190
1191 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1192
1193         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1194         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1195         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1196
1197 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1198
1199         Merge regex changes from libc, removing some of our
1200         POSIX-conformance changes that were rejected and redoing them in a
1201         less-intrusive way.
1202
1203         * regcomp.c (re_compile_internal, init_dfa):
1204         Length arg is now size_t, not Idx.  All uses changed.
1205         (peek_token): Forward decl now says internal_function.
1206         (__re_error_msgid, __re_error_msgid_idx):
1207         Now static rather than extern with attribute_hidden.
1208         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1209         For some reason libc prefers K&R style defns for external functions.
1210         (regerror) [!defined _LIBC]: Likewise.
1211         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1212         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1213         (build_range_exp, build_collating_symbol):
1214         Use K&R-style defn.
1215         (re_compile_fastmap): Use '\0' to memset, not 0.
1216         (utf8_sb_map): Make the calculations more obvious.
1217         (init_dfa, parse_bracket_exp, build_charclass_op):
1218         Call calloc and cast result, as glibc does.
1219         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1220         (build_range_exp, build_collating_symbol):
1221         Now internal functions.
1222
1223         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1224
1225         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1226         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1227         Don't depend on VMS; depend on __VMS instead, for POSIX
1228         namespace cleanness.
1229         (regoff_t): Define to ssize_t, not long int.
1230
1231         Remove the REG_ macros named below.  Instead, make the old names
1232         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1233         __USE_GNU_REGEX.
1234         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1235         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1236         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1237         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1238         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1239         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1240         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1241         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1242         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1243         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1244         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1245         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1246         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1247         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1248         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1249         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1250         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1251         (REG_NREGS):
1252         Remove.  All uses replaced by the old RE_* names.
1253         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1254         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1255         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1256         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1257         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1258         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1259         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1260         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1261         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1262         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1263         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1264         Don't bother having these macros be independent of each others'
1265         values, since they no longer exist in the POSIX name space.
1266
1267         Rename the following member names back to their old names,
1268         unless !__USE_GNU_REGEX.  All uses changed back.
1269         (buffer): Renamed from re_buffer.
1270         (allocated): Renamed from re_allocated.
1271         (used): Renamed from re_used.
1272         (syntax): Renamed from re_syntax.
1273         (fastmap): Renamed from re_fastmap.
1274         (translate): Renamed from re_translate.
1275         (can_be_null): Renamed from re_can_be_null.
1276         (regs_allocated): Renamed from re_regs_allocated.
1277         (fastmap_accurate): Renamed from re_fastmap_accurate.
1278         (no_sub): Renamed from re_no_sub.
1279         (not_bol): Renamed from re_not_bol.
1280         (not_eol): Renamed from re_not_eol.
1281         (newline_anchor): Renamed from re_newline_anchor.
1282         (num_regs): Renamed from rm_num_regs.
1283         (start): Renamed from rm_start.
1284         (end): Renamed from rm_end.
1285
1286         (free_state): Move up a bit.
1287
1288         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1289         #define to be empty.
1290         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1291         when that is what is intended.
1292         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1293         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1294         (MAX): New macro.
1295         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1296         All uses changed back to re_malloc, etc.  It's now the caller's
1297         responsibility to check for overflow; all callers changed.
1298         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1299         (re_x2nrealloc): Remove.
1300         (free_state): Remove decl.
1301
1302         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1303         (re_set_registers, re_exec):
1304         Use K&R-style defn.
1305
1306         2006-01-31  Roland McGrath  <roland@redhat.com>
1307
1308         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1309         Reported by Mike Frysinger <vapier@gentoo.org>.
1310
1311         2006-01-15  Andreas Jaeger  <aj@suse.de>
1312
1313         [BZ #1950]
1314         * regex_internal.c (re_string_reconstruct): Adjust for
1315         build_wcs_upper_buffer change.
1316         (build_wcs_upper_buffer): Change return type.
1317
1318         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1319
1320         * regex_internal.h: Include <stdint.h> if available.
1321
1322         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1323
1324         * regex_internal.h (SIZE_MAX): Provide a default definition.
1325
1326         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1327
1328         * regcomp.c: Adjust for changed secondary hash function.
1329
1330         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1331
1332         * regex.h: Pretty printing.
1333         Clean up namespace a bit.
1334
1335         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1336
1337         * regexec.c (update_cur_sifted_state, check_arrival,
1338         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1339
1340         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1341                     Ulrich Drepper  <drepper@redhat.com>
1342
1343         [BZ #1302]
1344         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1345         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1346
1347         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1348
1349         [BZ #281]
1350         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1351         * regcomp.c: Remove unnecessary uses of
1352         unsigned RE_TRANSLATE_TYPE.
1353         * regex_internal.h: Likewise.
1354         * regex_internal.c: Likewise.
1355         * regexec.c: Likewise.
1356         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1357
1358         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1359
1360         * regexec.c (find_recover_state): Remove unnecessary
1361         initialization.
1362         (transit_state_bkref): Make DFA a const pointer.
1363         (get_subexp): Likewise.
1364         (check_arrival): Likewise.
1365         (update_cur_sifted_state): Likewise.
1366         (re_search_internal): Likewise.
1367         (prune_impossible_nodes): Likewise.
1368         (acquire_init_state_context): Likewise.
1369         (proceed_next_node): Likewise.
1370         (set_regs): Likewise.
1371         (free_fail_stack_return): Likewise.
1372         (check_arrival_expand_ecl): Mark DFA parameter as const.
1373         (check_arrival_expand_ecl_sub): Likewise.
1374         (check_subexp_limits): Likewise.
1375         (sub_epsilon_src_nodes):  Likewise.
1376         (add_epsilon_src_nodes):  Likewise.
1377         (merge_state_array): Likewise.
1378         (update_regs): Likewise.
1379         (build_trtable): Likewise.
1380         (sift_states_backward): Mark MCTX parameter as const.
1381         (build_sifted_states): Likewise.
1382         (update_cur_sifted_state): Likewise.
1383         (sift_states_mkref): Likewise.
1384         (check_arrival_expand_ecl): Mark eclosure as const.
1385         (check_dst_limits_calc_pos_1): Likewise.
1386         * regex_internal.h (re_match_context_t): Make dfa a const
1387         pointer.
1388
1389         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1390
1391         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1392         (transit_state_sb): Likewise.
1393         (transit_state_mb): Likewise.
1394         (sift_states_iter_mb): Likewise.
1395         (check_arrival_add_next_nodes): Likewise.
1396         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1397         [_LIBC] (re_search_2_stub): Use mempcpy.
1398
1399         * regex_internal.c (re_string_reconstruct): Avoid calling
1400         mbrtowc for very simple UTF-8 case.
1401
1402         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1403         a pointer-to-const.
1404         (re_acquire_state_context): Likewise.
1405         * regex_internal.h: Adjust prototypes.
1406
1407         * regex.c: Prevent using C++ compilers.
1408
1409         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1410         (re_acquire_state_context): Likewise.
1411
1412 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1413             Bruno Haible  <bruno@clisp.org>
1414
1415         * stdint_.h: On OpenBSD, don't redefine types already included in
1416         <sys/types.h> and <inttypes.h>.
1417
1418 2006-03-24  Eric Blake  <ebb9@byu.net>
1419
1420         * time_r.c (copy_string_result): Remove, as it is no longer used.
1421
1422 2006-03-24  Simon Josefsson  <jas@extundo.com>
1423
1424         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1425         including some doc fixes.
1426         (base64_encode_alloc): Fix +1 bug on allocation failures.
1427
1428 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1429
1430         * base64.c (base64_encode): Do not read past end of array with
1431         unsanitized input on systems with CHAR_BIT > 8.
1432
1433 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1434
1435         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1436         Typedef to long int, not to off_, as POSIX will likely change
1437         in that direction.
1438
1439 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1440
1441         * argp-help.c (validate_uparams): Fix typo
1442         * argp-parse.c (argp_default_options): Consistently begin help
1443         messages with a lowercase letter.
1444
1445 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1446
1447         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1448         overrun buffers and shouldn't be used (much as gets shouldn't be
1449         used).
1450         * time_r.c (asctime_r, ctime_r): Likewise.
1451
1452 2006-03-08  Simon Josefsson  <jas@extundo.com>
1453
1454         * gc-gnulib.c (randomize): Don't open files called 'no', they
1455         signal that configure disabled the device.
1456
1457 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1458
1459         * c-stack.c: Include unistd.h unconditionally, since we now assume
1460         the unistd module.
1461         * getlogin_r.c: Likewise.
1462         * getlogin_r.h: Likewise.
1463         * glob.c: Likewise.
1464         * pagealign_alloc.c: Likewise.
1465         * unistd_.h: Remove; no longer needed.
1466
1467 2006-03-07  Simon Josefsson  <jas@extundo.com>
1468
1469         * unistd_.h: New file.
1470
1471 2006-03-07  Simon Josefsson  <jas@extundo.com>
1472
1473         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1474
1475 2006-03-01  Simon Josefsson  <jas@extundo.com>
1476
1477         * readline.c: Fix typo, tiny patch from Stepan Kasal
1478         <kasal@ucw.cz>.
1479
1480 2006-02-28  Simon Josefsson  <jas@extundo.com>
1481
1482         * getopt.c: Protect #include of unistd.h, for MSVS.
1483
1484 2006-02-27  Simon Josefsson  <jas@extundo.com>
1485
1486         * base64.h: Indent #define's.  From Jim Meyering
1487         <jim@meyering.net>.
1488
1489 2006-02-27  Jim Meyering  <jim@meyering.net>
1490
1491         Revert the change of 2006-02-24, so these files can continue
1492         to be sync'd from gettext.
1493         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1494         of `config.h'.
1495
1496 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1497
1498         * glob.c: Say "invalid" rather than "illegal" in comments.
1499
1500 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1501
1502         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1503
1504 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1505
1506         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1507         AT_FDCWD exceeds INT_MAX.
1508         * openat.h (AT_FDCWD): Likewise.
1509
1510 2006-02-14  Jim Meyering  <jim@meyering.net>
1511
1512         Sync from coreutils.
1513
1514         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1515         failure on deficient systems, and simplify gnulib lgpl dependencies.
1516         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1517         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1518
1519         * xalloc-die.c: Remove unused definition of N_.
1520
1521 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1522
1523         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1524
1525 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1526
1527         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1528         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1529
1530 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1531
1532         * argp-namefrob.h: Restore changes accidentally lost during the
1533         "autoupdate" on 2005-12-12.
1534
1535 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1536
1537         * fnmatch.c (L_): Renamed from L, to work around a bug in
1538         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1539         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1540         All uses changed.
1541
1542 2006-01-26  Simon Josefsson  <jas@extundo.com>
1543
1544         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1545         prototype is visible on mingw32.
1546
1547         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1548         for mingw32.
1549
1550         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1551         mingw32).
1552
1553 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1554
1555         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1556         attempt to open for write; this always fails, at least on POSIX
1557         hosts.  This reinstates the 2006-01-09 change, which was
1558         inadvertently removed.
1559
1560 2006-01-26  Bruno Haible  <bruno@clisp.org>
1561             Paul Eggert  <eggert@cs.ucla.edu>
1562
1563         * stdbool_.h (_Bool)
1564         [(! (defined __cplusplus || defined __BEOS__)
1565           && !defined __GNUC__
1566           && !(defined __HP_cc || defined __xlc__
1567                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1568                || defined __sgi))]:
1569         #define to signed char in these cases too; this simplifies
1570         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1571         etc., separately) and makes it more conservative.
1572
1573 2006-01-21  Jim Meyering  <jim@meyering.net>
1574
1575         Sync from the stable (b5) branch of coreutils:
1576
1577         * fts.c (fts_children): Don't let close() clobber errno from
1578         failed fchdir().
1579
1580         * fts.c (fts_stat): When following a symlink-to-directory,
1581         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1582         a dangling symlink.  That can also happen at least for ELOOP.
1583         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1584         FYI, this bug predates the inclusion of fts.c in coreutils.
1585
1586         * fts.c (fts_open): Put new maxarglen declaration and uses
1587         in their own block, so pre-c99 compilers don't object.
1588
1589         Avoid the double-free (first in fts_read, second in fts_close) that
1590         would occur when an `active' directory is made inaccessible (e.g.,
1591         via chmod a-x) during a traversal.
1592         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1593         before returning.  Reproduce this failure by
1594         mkdir -p a/b; cd a; chmod a-x . b
1595         Reported by Stavros Passas.
1596
1597 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1598
1599         * argp-namefrob.h: Bugfix. Remove stray #
1600
1601 2006-01-25  Bruno Haible  <bruno@clisp.org>
1602
1603         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1604         warnings.
1605         Reported by Paul Eggert.
1606
1607 2006-01-25  Jim Meyering  <jim@meyering.net>
1608
1609         * fileblocks.c: Remove more useless parentheses.
1610         * readutmp.h: Likewise.
1611
1612 2006-01-24  Bruno Haible  <bruno@clisp.org>
1613
1614         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1615         has it.
1616         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1617         2005-11-26.
1618
1619         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1620         to avoid problems with the built-in _Bool type.
1621         Reported by Paul Eggert on 2005-11-26.
1622
1623 2006-01-24  Jim Meyering  <jim@meyering.net>
1624
1625         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1626
1627 2006-01-24  Simon Josefsson  <jas@extundo.com>
1628
1629         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1630         Bruno.
1631
1632 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1633
1634         Work around porting bugs reported by Dieter in
1635         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1636         * getopt.c (_NOPROTO): Remove; no longer needed.
1637         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1638         Include "getopt.h" first, to check interface.
1639         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1640         !HAVE_DECL_GETENV.
1641         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1642         (__strndup): Revert to K&R-style function dfns, the glibc style.
1643         * strnlen.c: Don't claim it's taken from glibc; it's not.
1644         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1645         Include strnlen.h first, to get prototype properly.
1646         (strnlen): Renamed from __strnlen.
1647         Remove weak alias.
1648
1649 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1650
1651         These changes imported from libc.
1652         * getopt.c: Use __fxprintf instead of inline stream orientation
1653         test and two separate function calls.
1654         * strndup.c (__strndup): Add libc_hidden_def.
1655
1656 2006-01-22  Bruno Haible  <bruno@clisp.org>
1657
1658         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1659         temporary buffer for sprintf, take into account the precision also
1660         for 'd', 'i', 'u', 'o', 'x', 'X'.
1661
1662 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1663
1664         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1665         to pacify gcc -Wswitch-default.
1666
1667 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1668
1669         * argp-help.c (usage_long_opt): Do not print DOC options.
1670         (__argp_base_name): Removed
1671         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1672         typo.
1673         (__argp_base_name): Provide macro definition or extern declaration
1674         depending on the configuration
1675
1676 2006-01-20  Simon Josefsson  <jas@extundo.com>
1677
1678         * inet_ntop.h: Unconditionally include sys/socket.h.
1679
1680 2006-01-19  Simon Josefsson  <jas@extundo.com>
1681
1682         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1683
1684 2006-01-12  Simon Josefsson  <jas@extundo.com>
1685
1686         * base64.c: Fix warning, reported by Bruno Haible
1687         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1688
1689 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1690
1691         Sync from coreutils.
1692         * md5.c: Fix commentary typos.
1693         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1694         * md5.h (__attribute__): Remove; unused.
1695         * sha1.c: Fix commentary to match md5 better.
1696         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1697         so that we don't need to worry about alignment.  All uses changed.
1698         This merges the 2005-10-28 md5 change into sha1.
1699
1700 2006-01-11  Jim Meyering  <jim@meyering.net>
1701
1702         Sync from coreutils.
1703         * md5.c (OP): Fix spacing.
1704
1705 2006-01-11  Simon Josefsson  <jas@extundo.com>
1706
1707         * stdint_.h (SIZE_MAX): Add missing (.
1708
1709 2006-01-10  Bruno Haible  <bruno@clisp.org>
1710
1711         * argp.h (__const): Remove macro. Use const instead.
1712         * argp-fmtstream.h (__const): Likewise.
1713         * glob_.h (__const): Remove macro.
1714         * glob-libc.h: Use const instead of __const.
1715
1716 2006-01-10  Jim Meyering  <jim@meyering.net>
1717
1718         Avoid the double-free (first in fts_read, second in fts_close) that
1719         would occur when an `active' directory is made inaccessible (e.g.,
1720         via chmod a-x) during a traversal.
1721         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1722         before returning.  Reproduce this failure by
1723         mkdir -p a/b; cd a; chmod a-x . b
1724         Reported by Stavros Passas.
1725
1726         Sync from coreutils.
1727         * sha1.c: Tweak grammar in a comment.
1728
1729 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1730
1731         * regex_internal.h (BITSET_WORD_BITS):
1732         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1733         preprocessor mishandles large unsigned values as if they were signed.
1734         Problem reported by Claudio Fontana in
1735         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1736
1737 2006-01-10  Simon Josefsson  <jas@extundo.com>
1738
1739         * socket_.h: New file.
1740
1741 2006-01-10  Bruno Haible  <bruno@clisp.org>
1742
1743         * localcharset.c: Update from GNU gettext.
1744
1745 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1746
1747         Sync from coreutils.
1748         * chdir-long.c (cdb_free): Don't bother trying to open directory
1749         for write access: POSIX says that must fail.
1750         * fts.c (diropen): Likewise.
1751         * save-cwd.c (save_cwd): Likewise.
1752         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1753         well, for minor improvements on hosts that lack O_DIRECTORY.
1754         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1755         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1756         Fall back on chown if open failed with EACCES.
1757
1758         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1759         Report an error at compile-time if only a 1-second nominal clock
1760         resolution is found.
1761
1762         * lchmod.h: New file.
1763         * mkdir-p.c: Include lchmod.h, lchown.h.
1764         (make_dir_parents): Use lchown rather than chown, and
1765         lchmod rather than chmod.
1766
1767         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1768         too.  Problem with "none" reported by Bob Proulx.  Problem with
1769         "proc" reported by n0dalus.
1770
1771         * mountlist.c: Include <limits.h>.
1772         (dev_from_mount_options)
1773         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1774         New function.  It no longer assumes "dev=" has the System V meaning
1775         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1776         (read_file_system_list)
1777         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1778         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1779         dev= in that case.
1780
1781         * posixtm.h (PDS_PRE_2000): New macro.
1782         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1783         All usages changed.  Reject dates outside the range 1969-1999 if
1784         PDS_PRE_2000 is used.
1785
1786 2006-01-09  Jim Meyering  <jim@meyering.net>
1787
1788         Sync from coreutils.
1789
1790         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1791
1792         * chdir-safer.h, chdir-safer.c: New files.
1793
1794         * modechange.c (mode_compile): Reject an invalid mode string
1795         that starts with an octal digit.  From Andreas Gruenbacher.
1796
1797         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1798         and dup to open_safer and dup_safer, respectively.
1799         (openat_permissive): Fix typo in comment.
1800
1801         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1802         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1803         (_): Remove; no longer needed.
1804         (openat): Renamed from rpl_openat; no need for rpl_openat
1805         since openat.h renames openat for us.
1806         Replace most of the body with a call to openat_permissive,
1807         to avoid duplicate code.
1808         Port to (probably hypothetical) environments were mode_t is
1809         wider than int.
1810         (openat_permissive): Require mode arg, so that we can check
1811         types better.  Put it just after flags.  Change cwd failure
1812         indicator from pointer-to-bool to pointer-to-errno-value.
1813         All callers changed.
1814         Invoke openat_save_fail and/or openat_restore_fail if
1815         cwd_errno is null, so that openat can call us.
1816         (openat_permissive, fdopendir, fstatat, unlinkat):
1817         Simplify errno handling to avoid some duplicate code,
1818         as it's OK to set errno on success.
1819         * openat.h: Revamp code so that function macros depend on
1820         __OPENAT_PREFIX only, not also on AT_FDCWD.
1821         (openat_ro): Remove.  Caller changed to use openat_permissive.
1822         (openat_permissive): Now a macro, if not a function.
1823         (openat_restore_fail, openat_save_fail): Now always functions,
1824         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1825
1826         * openat-priv.h: New file, defining macros used by mkdirat.c
1827         and openat.c.
1828         * mkdirat.c: Include openat-priv.h.
1829         Remove definitions of macros defined therein.
1830         * openat.c: Likewise.
1831
1832         * mkdirat.c (mkdirat): New file and function.
1833         * openat.h (mkdirat): Declare.
1834
1835         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1836
1837         * openat.h (openat_permissive): Declare.
1838         (openat_ro): Define.
1839
1840         * openat.c (EXPECTED_ERRNO): New macro.
1841         (openat_permissive): New function -- used in remove.c rewrite.
1842         (all functions): Set errno just before returning, only if there
1843         was an actual failure.
1844         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1845
1846         Emulate openat-family functions using Linux's procfs, if possible.
1847         Idea and some code based on Ulrich Drepper's glibc changes.
1848
1849         * openat.c: (BUILD_PROC_NAME): New macro.
1850         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1851         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1852         before falling back on save_cwd and restore_cwd.
1853         (fdopendir, fstatat, unlinkat): Likewise.
1854
1855         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1856         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1857
1858         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1859         as second argument to va_arg.  Otherwise, some versions of gcc
1860         warn that `if this code is reached, the program will abort'.
1861
1862 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1863
1864         Sync from coreutils.
1865
1866         Add POSIX ACL support
1867         * acl.h (copy_acl, set_acl): Add declarations.
1868         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1869         systems other than Linux.
1870         (chmod_or_fchmod): New function: use fchmod when possible,
1871         and chmod otherwise.
1872         (file_has_acl): Add a POSIX ACL implementation, with a
1873         Linux-specific subcase.
1874         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1875         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1876         acls are unsupported.
1877         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1878         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1879         are unsupported.
1880
1881 2006-01-09  Bruno Haible  <bruno@clisp.org>
1882
1883         * sysexit_.h (EX_OK): New macro.
1884         Suggested by Martin Lambers <marlam@marlam.de>.
1885
1886 2006-01-09  Bruno Haible  <bruno@clisp.org>
1887
1888         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1889         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1890         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1891         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1892
1893 2006-01-09  Bruno Haible  <bruno@clisp.org>
1894
1895         * stdint_.h (SIZE_MAX): Write the value without involving negative
1896         numbers.
1897
1898 2005-10-16  Bruno Haible  <bruno@clisp.org>
1899
1900         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1901         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1902
1903 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1904
1905         * strftime.c (tzname): Don't declare if it is already #defined.
1906         Problem reported for Mingw by Mark Junker.
1907
1908 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1909
1910         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1911         long int, not int, for nanosecond counts, so that people who are
1912         used to POSIX struct timespec won't be surprised.  Reported by Jim
1913         Meyering.
1914
1915 2005-12-16  Jim Meyering  <jim@meyering.net>
1916
1917         * fprintftime.c, fprintftime.h: New files.
1918
1919 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1920
1921         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1922         * argp-help.c (fill_in_uparams): Check if the constructed
1923         struct uparams is valid. Fall back to the default values if it is
1924         not.
1925
1926 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1927
1928         * argp-help.c (__argp_base_name): New function
1929         (__argp_short_program_name): Rewrite using __argp_base_name
1930         * argp-namefrob.h: Define program_invocation_name and
1931         program_invocation_short_name if requested
1932         (__argp_base_name): Add prototype
1933         * argp-parse.c (argp_def): Use gettext wrappers
1934         (argp_default_parser): Use __argp_base_name
1935         * argp-pin.c: New file. Defines program_invocation_name and
1936         program_invocation_short_name on systems that lack them.
1937
1938 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1939
1940         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1941         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1942         porting problem reported by Georg Schwarz in
1943         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1944
1945 2005-07-09  Bruno Haible  <bruno@clisp.org>
1946
1947         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1948         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1949         Reported by Mark Junker <mjscod@gmx.de>.
1950
1951 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1952
1953         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1954         (uintmax_t) [defined uintmax_t]: Do not declare.
1955         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1956         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1957         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1958         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1959         sake of portability to weird hosts that C allows (though we don't
1960         know of any practical examples).
1961
1962         * savedir.h (fdsavedir): New decl.
1963         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1964         contains most of the former guts of savedir.
1965         (savedir): Use savedirstream.
1966         Include "openat.h".
1967
1968 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1969
1970         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1971         coreutils no longer futzes with rounding modes.
1972
1973 2005-11-14  Jim Meyering  <jim@meyering.net>
1974
1975         * mkstemp-safer.c: Include <config.h>, required for possible
1976         replacement of mkstemp.
1977
1978 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1979
1980         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1981         business.
1982         (gethrxtime) [! (HAVE_NANOUPTIME
1983         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1984         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1985         our own approximation.
1986
1987 2005-11-10  Simon Josefsson  <jas@extundo.com>
1988
1989         * readline.c: Remove EOL.
1990
1991 2005-11-08  Eric Blake  <ebb9@byu.net>
1992
1993         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1994
1995 2005-11-08  Eric Blake  <ebb9@byu.net>
1996
1997         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1998
1999 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2000
2001         Fix porting problem reported by Theodoros V. Kalamatianos.
2002         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2003         Don't assume that futimes failing means we must fail.
2004
2005 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2006
2007         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2008         leave errno alone.  Problem reported by Dmitry V. Levin.
2009
2010 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2011
2012         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2013         errno alone.  Problem reported by Frederic Jolliton.
2014
2015 2005-10-28  Simon Josefsson  <jas@extundo.com>
2016
2017         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2018         "restrict" keywords, as per POSIX.  Protect the function
2019         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2020         Don't use K&R prototypes.  Check the sprintf return values.
2021         Re-define EAFNOSUPPORT if not present.  Indent.
2022
2023         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2024         suggested by Bruno Haible <bruno@clisp.org>.
2025
2026         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2027
2028         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2029
2030         * gc-libgcrypt.c: Add MD2 (which is not available through
2031         libgcrypt).
2032
2033         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2034
2035         * md2.h, md2.c: New files.
2036
2037 2005-10-24  Simon Josefsson  <jas@extundo.com>
2038
2039         * md4.h: Shrink buffer size, now that we changed the type.
2040
2041 2005-10-22  Simon Josefsson  <jas@extundo.com>
2042
2043         * arcfour.h, arcfour.c: Use fixed size indices in the
2044         arcfour_context struct (simplify test vector testing in GNU
2045         Shishi).
2046
2047 2005-10-22  Simon Josefsson  <jas@extundo.com>
2048
2049         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2050         suggested by Bruno Haible <bruno@clisp.org>.
2051
2052 2005-10-22  Simon Josefsson  <jas@extundo.com>
2053
2054         * crc.h: Include stddef.h, for size_t.
2055
2056 2005-10-21  Simon Josefsson  <jas@extundo.com>
2057
2058         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2059         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2060
2061 2005-10-21  Simon Josefsson  <jas@extundo.com>
2062
2063         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2064         block.
2065
2066 2005-10-21  Simon Josefsson  <jas@extundo.com>
2067
2068         * gc-gnulib.c: Support ARCTWO in CBC mode.
2069
2070 2005-10-21  Simon Josefsson  <jas@extundo.com>
2071
2072         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2073         <bruno@clisp.org>.
2074
2075         * hmac-sha1.c (hmac_sha1): Likewise.
2076
2077         * crc.c (crc32_update): Actually use crc parameter, suggested by
2078         Bruno Haible <bruno@clisp.org>.
2079
2080         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2081         <bruno@clisp.org>.
2082
2083 2005-10-21  Simon Josefsson  <jas@extundo.com>
2084
2085         * des.h, des.c: New files.
2086
2087         * gc-gnulib.c: Support DES.c
2088
2089 2005-10-21  Simon Josefsson  <jas@extundo.com>
2090
2091         * arctwo.h, arctwo.c: New files.
2092
2093         * gc-gnulib.c: Support ARCTWO.
2094
2095 2005-10-21  Simon Josefsson  <jas@extundo.com>
2096
2097         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2098
2099 2005-10-19  Simon Josefsson  <jas@extundo.com>
2100
2101         * gc-gnulib.c: Support ARCFOUR.
2102
2103 2005-10-19  Simon Josefsson  <jas@extundo.com>
2104
2105         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2106         support.
2107
2108         * gc.h: Add ECB enum type.
2109
2110         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2111
2112 2005-10-19  Simon Josefsson  <jas@extundo.com>
2113
2114         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2115
2116 2005-10-18  Simon Josefsson  <jas@extundo.com>
2117
2118         * md4.h, md4.c: New files, based on md5.?.
2119
2120 2005-10-17  Simon Josefsson  <jas@extundo.com>
2121
2122         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2123
2124         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2125
2126 2005-10-17  Simon Josefsson  <jas@extundo.com>
2127
2128         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2129
2130 2005-10-17  Simon Josefsson  <jas@extundo.com>
2131
2132         * gc.h, gc-libgcrypt.c: Add ciphers.
2133
2134 2005-10-17  Simon Josefsson  <jas@extundo.com>
2135
2136         * sha1.c: Use uint32_t instead of md5_uint32.t
2137
2138         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2139         md5.h.
2140
2141         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2142
2143         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2144
2145 2005-10-15  Simon Josefsson  <jas@extundo.com>
2146
2147         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2148
2149         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2150
2151 2005-10-14  Simon Josefsson  <jas@extundo.com>
2152
2153         * arcfour.h, arcfour.c: New files.
2154
2155 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2156
2157         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2158         include <wchar.h>; no longer needed.
2159
2160 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2161         and  Ulrich Drepper  <drepper@redhat.com>
2162
2163         Import from libc.
2164         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2165         instead of inline stream orientation test and two separate
2166         function calls.  Pay no attention to USE_IN_LIBIO.
2167
2168 2005-10-14  Roland McGrath  <roland@redhat.com>
2169
2170         Import from libc.  [BZ #1331]
2171         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2172         macro argument.
2173         Reported by Matej Vela <vela@debian.org>.
2174
2175 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2176
2177         * mkdir-p.c (make_dir_parents): Don't report an error if an
2178         intermediate directory is in a read-only file system.  Problem
2179         reported by Eric Blake.
2180
2181 2005-10-13  Simon Josefsson  <jas@extundo.com>
2182
2183         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2184         Move memory allocation outside of loop.
2185
2186 2005-10-12  Simon Josefsson  <jas@extundo.com>
2187
2188         * gc-pbkdf2-sha1.c: New file.
2189
2190         * gc.h: Add gc_pbkdf2_sha1 prototype.
2191
2192 2005-10-12  Simon Josefsson  <jas@extundo.com>
2193
2194         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2195         suggested by Bruno Haible <bruno@clisp.org>.
2196
2197 2005-10-12  Simon Josefsson  <jas@extundo.com>
2198
2199         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2200
2201         * gc-gnulib.c (gc_hmac_sha1): New function.
2202
2203 2005-10-12  Simon Josefsson  <jas@extundo.com>
2204
2205         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2206
2207 2005-10-12  Simon Josefsson  <jas@extundo.com>
2208
2209         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2210         GC_USE_HMAC_MD5, respectively.
2211
2212         * gc-libgcrypt.c (gc_md5): Fix assert call.
2213         (gc_md5): Fix typo.
2214
2215         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2216
2217         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2218
2219         * gc-gnulib.c (gc_hash_buffer): Ditto.
2220
2221 2005-10-11  Bruno Haible  <bruno@clisp.org>
2222
2223         * c-strcasestr.h: New file, from GNU gettext.
2224         * c-strcasestr.c: New file, from GNU gettext.
2225
2226 2005-10-11  Bruno Haible  <bruno@clisp.org>
2227
2228         * c-strcase.h: New file, from GNU gettext.
2229         * c-strcasecmp.c: New file, from GNU gettext.
2230         * c-strncasecmp.c: New file, from GNU gettext.
2231
2232 2005-10-11  Simon Josefsson  <jas@extundo.com>
2233
2234         * crc.h, crc.c: New files.
2235
2236         * gc.h (gc_hash_buffer): Add doc.
2237
2238 2005-10-08  Simon Josefsson  <jas@extundo.com>
2239
2240         * gc.h: Add gc_hash and gc_hash_buffer.
2241
2242         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2243
2244         * gc-libgcrypt.c (gc_hash_buffer): Add.
2245
2246 2005-10-11  Bruno Haible  <bruno@clisp.org>
2247
2248         * strcasecmp.c: Include limits.h.
2249         (strcasecmp): Avoid integer overflow on exotic platforms.
2250         * strncasecmp.c: Include limits.h.
2251         (strncasecmp): Avoid integer overflow on exotic platforms.
2252         Reported by Paul Eggert.
2253
2254 2005-10-06  Simon Josefsson  <jas@extundo.com>
2255
2256         * hmac-md5.c: New file.
2257
2258         * hmac.h: New file.
2259
2260 2005-10-06  Simon Josefsson  <jas@extundo.com>
2261
2262         * memxor.c (memxor): Avoid casts and warnings.
2263
2264 2005-10-05  Derek Price  <derek@ximbiot.com>
2265
2266         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2267
2268 2005-10-05  Simon Josefsson  <jas@extundo.com>
2269
2270         * memxor.c (memxor): Fix compiler error.
2271
2272         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2273         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2274
2275         * memxor.h, memxor.c: New files.
2276
2277         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2278         we assume all systems have it, suggested by Jim Meyering
2279         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2280         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2281         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2282         same reasons.
2283
2284 2005-10-04  Bruno Haible  <bruno@clisp.org>
2285
2286         * verify.h (verify_true): Provide alternative definition for C++.
2287
2288 2005-10-04  Simon Josefsson  <jas@extundo.com>
2289
2290         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2291         D. Baushke" <mdb@gnu.org>.
2292
2293 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2294
2295         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2296         (SSIZE_MAX): New macro, if not already defined.
2297         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2298         than 2 GiB.
2299
2300 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2301
2302         * exclude.c: Include verify.h.
2303         (verify): Remove.  All callers changed to use verify.h's version.
2304         * strtoimax.c: Likewise.
2305         * utimecmp.c: Likewis.e
2306
2307         Sync from coreutils.
2308         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2309         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2310         * .cvsignore: Add fts.h, search.h, t-fpending.
2311         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2312         bother returning ENOSYS if settimeofday or stime fails; just let
2313         them return whatever errno they want to return.
2314         * utimens.c: Include unistd.h, for dup2.
2315         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2316         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2317
2318 2005-10-02  Jim Meyering  <jim@meyering.net>
2319
2320         Sync from coreutils.
2321         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2322         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2323         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2324         Remove AT_FDCWD test.
2325         Do not consume the fd unless successful.
2326         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2327         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2328         block, so that we don't even try to compile it if settimeofday is
2329         available.  This works around a compilation failure on OSF1 V5.1,
2330         due to stime requiring a `long int*' while tv_sec is `int'.
2331
2332 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2333
2334         * getdelim.c (getdelim): Remove unused variables.
2335
2336 2005-10-01  Simon Josefsson  <jas@extundo.com>
2337
2338         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2339         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2340         AI_* and EAI_* definitions.  Protect function declarations.
2341
2342 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2343
2344         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2345         so that the code works even with ancient cpp.  Portability problem
2346         with GCC 2.7.2.1 reported by Thomas M.Ott.
2347
2348 2005-09-27  Jim Meyering  <jim@meyering.net>
2349
2350         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2351
2352         * intprops.h (signed_type_or_expr__): Define.
2353         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2354         for unsigned types.
2355
2356 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2357
2358         * verify.h (verify_expr): Remove, replacing with:
2359         (verify_true): New macro that returns true instead of void.
2360         (verify_type__): Remove.
2361         (verify): Use verify_true rather than verify_type__.
2362
2363 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2364
2365         * utimens.c (ENOSYS): Define if not already defined.
2366         (futimens): Support having a null PATH if the file descriptor
2367         is nonnegative.
2368
2369         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2370         Remove.
2371         (__attribute): Define to empty unless GCC 3.1 or later.
2372         This works around a core dump on OpenBSD 3.4, which has GCC
2373         2.95.3, which dumps core when given __attribute__(()).  It also
2374         simplifies other tests, since we really don't want to bother with
2375         worrying about which ancient version of GCC supported what.
2376         Original problem reported by Yoann Vandoorselaere, with part of
2377         the fix suggested by Derek Price.
2378
2379 2005-09-24  Jim Meyering  <jim@meyering.net>
2380
2381         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2382         so we can once again use a positive bitfield width of 1 -- now we
2383         don't have to explain why we were using a bitfield width of 2.
2384
2385 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2386
2387         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2388         Problem reported by Eric Blake.
2389         (getaddrinfo): Initialize se so that it's not garbage.
2390         Redo internal storage allocation so that it doesn't make unportable
2391         assumptions about alignment.
2392         Fix a memory leak.
2393
2394         * utimens.c (futimens): Use futimesat if available.
2395         Prefer it to futimes since it doesn't have the futimes bug.
2396
2397         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2398         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2399         Instead, declare a function that returns a pointer to an array,
2400         and use verify_type__ to declare the size of the array.
2401         Problem and germ of a solution reported by Bruno Haible.
2402         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2403         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2404
2405 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2406
2407         Sync from coreutils.
2408
2409         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2410         stat-time.h.
2411         * argmatch.h: Include verify.h
2412         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2413         (ARGMATCH_ASSERT): Remove; unused.
2414         * canonicalize.c: Assume STDC_HEADERS.
2415         * exclude.c: Include "strcase.h".
2416         * regex_internal.h [!defined _LIBC]: Likewise.
2417         * getusershell.c: Include stdio--.h rather than stdio.h
2418         and stdio-safer.h.
2419         (getusershell): Call fopen, not fopen_safer.
2420         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2421         Do not include unistd-safer.h.
2422         (save_cwd): Don't call fd_safer; no longer needed
2423         now that we include fcntl--.h.
2424
2425         * getdate.y (relative_time): New type.
2426         (RELATIVE_TIME_0): New constant.
2427         (parser_control): Use relative_time instead of doing it ourselves.
2428         (%union): Add new relative_time rel member.
2429         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2430         Now typeless.
2431         (relunit, relunit_snumber): Now of type rel.
2432         (zone, rel, relunit, get_date): Adjust to above changes.
2433
2434         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2435         Do not include unistd-safer.h.
2436         (getloadavg): Don't call fd_safer; no longer needed
2437         now that we include fcntl--.h.
2438
2439         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2440         (make_dir_parents): Treat ENOSYS like EEXIST.
2441
2442         Improve quality of diagnostics on restore_cwd failure.
2443         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2444         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2445         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2446         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2447         each time through the loop.  Do not diagnose restore_cwd failure;
2448         that is the caller's job (and perhaps the caller does not care).
2449
2450         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2451         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2452         If the file already exists but is not a directory, don't bother
2453         to try to make its parents.
2454         Close potential file descriptor leak if we can't chdir("/") (!).
2455         Don't always return true if chdir($PWD) fails; return true only
2456         if the requested action was done successfully (except for the
2457         chdir($PWD)).
2458         Don't log final directory unless we actually made it.
2459         Refactor to avoid duplicate code to fix up permissions.
2460         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2461
2462         * strftime.c (my_strftime): Rewrite the previous change slightly,
2463         to make it a bit faster and (I hope) clearer.
2464         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2465         Fix bug in formats like %2N.
2466
2467         * verify.h: New file.
2468
2469 2005-09-22  Jim Meyering  <jim@meyering.net>
2470
2471         Sync from coreutils.
2472
2473         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2474
2475         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2476         the .tm_year member, since otherwise gcc-4.0 would now warn about
2477         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2478
2479         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2480         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2481
2482         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2483         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2484         when run in a time zone for which daylight savings time is in effect
2485         for the starting date.
2486
2487         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2488         stop us from restricting permissions of just-created absolute-named
2489         directories.
2490         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2491         to restore initial working directory.
2492         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2493         to tell caller if/when we change the working directory and are
2494         unable to return to the initial one.
2495         * mkdir-p.h (make_dir_parents): Update prototype.
2496         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2497         `return false'.  This fixes a bug introduced on 2004-07-30.
2498
2499         * openat.c (fdopendir): Be sure to close the supplied
2500         file descriptor before returning.  This makes our replacement
2501         implementation a little closer to Solaris's, where fdopendir
2502         ties the file descriptor to the returned DIR* pointer.
2503         * openat.c (unlinkat): New function.
2504         * openat.h (unlinkat): Add prototype.
2505         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2506         (openat_restore_fail): Rename from openat_restore_die.
2507         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2508
2509         Provide an alternative to exiting immediately upon save_cwd or
2510         restore_cwd failure.  Now, an application can arrange e.g.,
2511         to perform a longjump in that case.
2512         * openat.c: Include dirname.h.
2513         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2514         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2515         and openat_restore_die rather than calling error directly.
2516         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2517
2518         * openat-die.c (openat_save_die, openat_restore_die): New file.
2519         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2520
2521         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2522         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2523                             int utc, int nanoseconds);
2524         Background:
2525         date should not have to allocate a megabyte of virtual memory to
2526         handle a format argument like +%1048575T.  When implemented with
2527         strftime, it must allocate such a buffer, use strftime to fill it
2528         in, print it, then free it.
2529         With fprintftime, it simply prints everything and exits.
2530         With no need for memory allocation, that's one fewer way to fail.
2531         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2532         optional field width, not before, so we accept %9:z, not %:9z.
2533         (my_strftime): Be sure to use L_('x') for literals.
2534
2535         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2536         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2537         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2538         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2539         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2540         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2541         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2542         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2543         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2544
2545         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2546         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2547         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2548         and don't include <sys/file.h>).
2549
2550 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2551
2552         Sync from coreutils.
2553
2554         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2555         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2556         [!LDAV_DONE]: Avoid unused variable warning.
2557
2558 2005-09-21  Bruno Haible  <bruno@clisp.org>
2559
2560         * unicodeio.h (unicode_to_mb): New declaration.
2561
2562 2005-09-20  Derek Price  <derek@ximbiot.com>
2563
2564         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2565
2566 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2567
2568         Use a consistent style for including <config.h>.
2569         * __fpending.c, acl.c, argmatch.c,
2570         argp-help.c, argp-parse.c,
2571         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2572         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2573         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2574         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2575         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2576         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2577         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2578         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2579         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2580         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2581         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2582         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2583         modechange.c, mountlist.c, open-safer.c, physmem.c,
2584         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2585         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2586         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2587         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2588         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2589         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2590         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2591         userspec.c, utimecmp.c, version-etc-fsf.c,
2592         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2593         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2594         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2595         Standardize inclusion of config.h.
2596         * __fpending.h, dirfd.h, getdate.h, human.h,
2597         inttostr.h:  Removed inclusion of config.h from header files.
2598         * inttostr.c:  Adjusted in-tree users.
2599         * timespec.h: Remove superfluous warning to include config.h.
2600         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2601         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2602         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2603         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2604
2605 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2606
2607         * stat-time.h: New file.
2608         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2609         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2610         in a different way.
2611         (timespec_cmp): New function.
2612         * utimecmp.c: Include stat-time.h.
2613         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2614         members exist, not on the obsolescent ST_MTIM_NSEC.
2615         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2616
2617 2005-09-15  Derek Price  <derek@ximbiot.com>
2618             Paul Eggert  <eggert@cs.ucla.edu>
2619
2620         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2621         changes, consolidating in...
2622         * regex_internal.h: ...this file.
2623
2624 2005-09-15  Derek Price  <derek@ximbiot.com>
2625
2626         * regex_internal.h: Blank `pure' for GNUC < 3.
2627         * regex_internal.c: Ditto, using this...
2628         (__GNUC_PREREQ): ...new macro.
2629         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2630         (__GNUC_PREREQ): ...this new macro.
2631
2632         * strstr.h: Include string.h. Define strstr as a macro here.
2633
2634 2005-09-13  Derek Price  <derek@ximbiot.com>
2635
2636         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2637         failure.
2638         Reported by Jim Meyering  <jim@meyering.net>.
2639
2640 2005-09-13  Jim Meyering  <jim@meyering.net>
2641
2642         * canon-host.c: Filter through gnu indent and reword comments slightly.
2643         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2644
2645 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2646
2647         * lib/base64.c: Typo.
2648         (base64_encode): Put b64str in initialized data section.
2649
2650 2005-09-12  Derek Price  <derek@ximbiot.com>
2651
2652         Return usable errors from canon-host.
2653         * canon-host.h: New file.
2654         * canon-host.c (canon_host): Wrap...
2655         (canon_host_r): ...this new function, which now relies exclusively on
2656         getaddrinfo.
2657         (ch_strerror): New function.
2658         (last_cherror): New global.
2659         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2660         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2661         void *.
2662         (freeaddrinfo): Free ai->ai_canonname when set.
2663
2664 2005-09-12  Derek Price  <derek@ximbiot.com>
2665             Paul Eggert  <eggert@cs.ucla.edu>
2666
2667         * glob-libc.h: Renamed from glob_.h.  The new version is
2668         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2669         protecting things that should be done only in gnulib contexts.
2670         * glob_.h: New file, containing only the glob things needed for
2671         gnulib.
2672         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2673         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2674         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2675         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2676         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2677         and to respect the namespace rules better.
2678
2679 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2680
2681         Merge glibc and coreutils changes into gnulib, plus a few
2682         extra fixes.
2683         * md5.c: Use #error rather than a string.
2684         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2685         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2686         (__attribute__): Define to empty for non recent-GCC.
2687         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2688         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2689         Renamed from their non-__ counterparts, with new macros replacing
2690         them if not _LIBC.  Add __THROW attribute.
2691         (rol): Remove.
2692         (struct md5_ctx): Align buffer if using GCC.
2693         * sha1.h (struct sha1_ctx): Likewise.
2694         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2695         The old name was backwards.
2696         (NOTSWAP): Remove; not used.
2697         (rol): New macro, moved here from md5.h.
2698         (sha1_process_block): Remove a FIXME that doesn't make sense.
2699
2700 2005-09-12  Derek Price  <derek@ximbiot.com>
2701
2702         * gai_strerror.c: Include config.h when available.  Include
2703         getaddrinfo.h before other headers to test interface.
2704         Reported by Larry Jones <lawrence.jones@ugs.com>.
2705
2706 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2707
2708         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2709         definitions, since that's the preferred style in glibc.
2710         Fix a minor spacing issue, and update copyright notice to match glibc's.
2711
2712 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2713
2714         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2715
2716 2005-09-06  Simon Josefsson  <jas@extundo.com>
2717
2718         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2719         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2720
2721 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2722
2723         Change bitset word type from unsigned int to unsigned long int,
2724         as this has better performance on typical 64-bit hosts.
2725         Port bitset code to hosts with unusual word sizes.
2726         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2727         (build_collating_symbol):
2728         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2729         argument is a bitset.  This is merely a style issue, but it makes
2730         it clearer that an entire array is expected.
2731         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2732         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2733         Port to the case where bitset_word is not the same as unsigned int.
2734         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2735         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2736         Likewise.
2737         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2738         (build_trtable, group_nodes_into_DFAstates):
2739         Likewise.
2740         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2741         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2742         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2743         * regexec.c (group_nodes_into_DFAstates): Likewise.
2744         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2745         * regcomp.c (optimize_subexps, lower_subexp):
2746         Work even if bitset_word has holes in its bitwise representation.
2747         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2748         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2749         Likewise.
2750         * regex_internal.c (re_string_reconstruct):
2751         Don't assume UCHAR_MAX == 255.
2752         * regex_internal.h (bitset_set_all): Likewise.
2753         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2754         All uses changed.
2755         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2756         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2757         All uses changed.
2758         (BITSET_WORD_MAX): New macro.
2759         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2760         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2761         (bitset_empty, bitset_copy):
2762         Prefer sizeof (bitset) to multiplying it out ourselves.
2763         (bitset_not_merge): Remove; unused.
2764         (bitset_contain): Return bool, not unsigned int with one bit on.
2765         All callers changed.
2766         * regexec.c (build_trtable): Don't assume bitset has no stricter
2767         alignment than re_node_set; do this by defining a new internal
2768         type struct dests_alloc and using it to allocate memory.
2769
2770 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2771
2772         Check for arithmetic overflow when calculating sizes, to prevent
2773         some buffer-overflow issues.  These patches are conservative, in the
2774         sense that when I couldn't determine whether an overflow was possible,
2775         I inserted a run-time check.
2776         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2777         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2778         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2779         (re_xnrealloc, re_x2nrealloc): New inline functions.
2780         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2781         (build_equiv_class, build_charclass): Check for arithmetic overflow
2782         in size expression calculations.
2783         * lib/regex_internal.c (re_string_realloc_buffers):
2784         (build_wcs_upper_buffer, re_node_set_add_intersect):
2785         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2786         (re_dfa_add_node, register_state): Likewise.
2787         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2788         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2789         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2790         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2791
2792 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2793
2794         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2795         to avoid a collision with bits/local_lim.h in glibc.
2796         All uses changed.  Problem reported by Dmitry V. Levin in
2797         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2798
2799         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2800         bugs in int versus size_t comparisons.
2801         (re_string_context_at): Fix bug where the code assumed that
2802         Idx is signed.
2803
2804         Use bool where appropriate.
2805         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2806         All callers changed.
2807         (calc_eclosure_iter): Likewise, for ROOT arg.
2808         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2809         (build_charclass_op): Likewise, for NON_MATCH arg.
2810         * regex_internal.c (re_string_allocate, re_string_construct):
2811         (re_string_construct_common): Likewise, for ICASE arg.
2812         * regexec.c (re_search_2_stub, re_search_stub):
2813         Likewise, for RET_LEN arg.
2814         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2815         (set_regs): Likewise, for FL_BACKTRACK arg.
2816         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2817         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2818         (calc_eclosure_iter, parse_bracket_exp):
2819         Use bool for internal variables that are booleans.
2820         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2821         (set_regs, build_sifted_states, sift_states_bkref):
2822         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2823         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2824         (find_collation_sequence_value):
2825         Likewise.
2826         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2827         (re_node_set_compare):
2828         Return bool, not int. All callers changed.
2829         * regexec.c (check_halt_node_context, check_dst_limits):
2830         (build_trtable, check_node_accept): Likewise.
2831         * regex_internal.h: Include stdbool.h.
2832
2833         Fix bugs uncovered when converting to bool.
2834         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2835         failure instead of charging ahead blindly.
2836         * regex_internal.c (register_state): Likewise.
2837         * regexec.c (re_search_2_stub): Use simpler method than boolean
2838         for freeing internal storage.
2839         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2840         bitset pieces used as boolean, to avoid undefined behavior
2841         on hosts that do int overflow checking.
2842
2843 2005-08-31  Derek Price  <derek@ximbiot.com>
2844
2845         * getdelim.c (getdelim): Return EOF on EOF.
2846         Reported by Larry Jones <lawrence.jones@ugs.com>.
2847
2848 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2849
2850         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2851         lengths fit in regoff_t; this isn't true if regoff_t is the same
2852         width as size_t.
2853         * regex.c (re_search_internal): 5th arg is LAST_START
2854         (= START + RANGE) instead of RANGE.  This avoids overflow
2855         problems when regoff_t is the same width as size_t.
2856         All callers changed.
2857         (re_search_2_stub): Check for overflow when adding the
2858         sizes of the two strings.
2859         (re_search_stub): Check for overflow when adding START
2860         to RANGE; if it occurs, substitute the extreme value.
2861
2862 2005-08-31  Jim Meyering  <jim@meyering.net>
2863
2864         * regcomp.c (search_duplicated_node): Make first pointer arg
2865         a pointer-to-const.
2866         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2867         (register_state): Likewise.
2868         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2869         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2870         (group_nodes_into_DFAstates): Likewise.
2871
2872 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2873
2874         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2875         old glibc regex code mishandles strings longer than 2**31 bytes.
2876         This patch fixes this when the regex code is used in gnulib
2877         (i.e., outside glibc).
2878
2879         This patch should not affect the use of the regex code inside
2880         glibc.  No doubt this problem also needs to be handled for glibc
2881         as well, but the result will be an incompatible change to the
2882         glibc ABI, and the old ABI will have to be supported too.  That
2883         can be the the subject for another patch.
2884
2885         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2886         governing whether the rest of this patch is active.  By default,
2887         the macro is disabled and the patch has no effect.
2888         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2889         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2890         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2891         (re_match_2, re_set_registers): Use the new types.
2892         * regex_internal.h (Idx, re_hashval_t): New types.
2893         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2894         New macros.
2895         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2896         (re_string_context_at, bin_tree_t, re_dfastate_t):
2897         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2898         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2899         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2900         (re_string_char_size_at, re_string_wchar_at):
2901         (re_string_elem_size_at):
2902         Use the new types and macros to port to 64-bit hosts.
2903         Use unsigned types for internal values, so that the code
2904         mostly works even for arrays larger than SSIZE_MAX.
2905         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2906         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2907         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2908         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2909         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2910         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2911         (calc_inveclosure, parse_dup_op, build_range_exp):
2912         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2913         (fetch_number, create_token_tree, mark_opt_subexp):
2914         Likewise.
2915         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2916         (create_cd_newstate, re_string_allocate, re_string_construct):
2917         (re_string_realloc_buffers, build_wcs_upper_buffer):
2918         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2919         (re_string_reconstruct, re_string_peek_byte_case):
2920         (re_string_fetch_byte_case, re_string_context_at):
2921         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2922         (re_node_set_init_copy, re_node_set_add_intersect):
2923         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2924         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2925         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2926         (re_acquire_state, re_acquire_state_context, register_state):
2927         Likewise.
2928         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2929         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2930         (re_search_internal, re_search_2_stub, re_search_stub)
2931         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2932         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2933         (update_cur_sifted_state, check_dst_limits):
2934         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2935         (check_subexp_limits, sift_states_bkref, merge_state_array):
2936         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2937         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2938         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2939         (expand_bkref_cache, check_node_accept_bytes):
2940         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2941         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2942         (acquire_init_state_context, check_halt_node_context):
2943         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2944         (sift_states_backward, clean_state_log_if_needed):
2945         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2946         (find_recover_state, transit_state_sb, transit_state_mb):
2947         (transit_state_bkref, build_trtable, match_ctx_clean):
2948         Likewise.
2949         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2950         to work around an assumption that REG_MISSING is negative.
2951
2952         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2953         (seek_collating_symbol_entry) [defined _LIBC]:
2954         (lookup_collation_sequence_value) [defined _LIBC]:
2955         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2956         Use prototypes rather than old-style function definitions.
2957         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2958         (transit_state_sb) [0]:
2959         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2960
2961         * regexec.c (re_search_internal): Simplify update of rm_so and
2962         rm_eo.
2963
2964         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2965         (optimize_subexps, lower_subexp):
2966         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2967         since the signed shift might overflow.  Use 1u<<31 instead.
2968         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2969         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2970         Likewise.
2971
2972         * regcomp.c (optimize_subexps, lower_subexp):
2973         Use CHAR_BIT rather than 8, for clarity.
2974         * regexec.c (check_dst_limits_calc_pos_1):
2975         (check_subexp_matching_top): Likewise.
2976         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2977         have to worry about portability issues when shifting it left.
2978         Remove no-longer-needed test for table_size > 0.
2979         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2980         in a word, as the resulting behavior is undefined.
2981         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2982         in one case, a <= should have been an <, and in another case the
2983         whole test was missing.
2984         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2985         the standard name CHAR_BIT.
2986         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2987         this is not true on one's complement and signed-magnitude hosts.
2988
2989         * regex_internal.h (re_sub_match_top_t): Remove unused member
2990         next_last_offset.
2991         (struct re_dfa_t): Remove unused member states_alloc.
2992         * regcomp.c (init_dfa): Don't initialize unused members.
2993
2994 2005-08-31  Bruno Haible  <bruno@clisp.org>
2995
2996         * strstr.c: Include <stddef.h>, for NULL.
2997         * strcasestr.c: Likewise.
2998         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2999
3000 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3001
3002         * iconvme.h: Add prototype for iconv_alloc.
3003
3004 2005-08-29  Simon Josefsson  <jas@extundo.com>
3005
3006         * iconvme.c: Fix errno.
3007
3008 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3009
3010         * iconvme.c: Split iconv_string into iconv_alloc.
3011
3012 2005-08-27  Jim Meyering  <jim@meyering.net>
3013
3014         * fopen-safer.c: Merge minor changes from coreutils.
3015         * dup-safer.c: Likewise.
3016         * fd-safer.c: Likewise.
3017
3018         Merge from coreutils.
3019         * stdio--.h: New file.
3020         * stdlib--.h: New file.
3021         * mkstemp-safer.c: New file.
3022
3023         GNU tar needs these.
3024         * pipe-safer.c: New file.
3025         * creat-safer.c: New file.
3026         * fcntl--.h (creat): Define to creat_safer.
3027         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3028         * unistd--.h (pipe): Define to pipe_safer.
3029         * unistd-safer.h: Declare pipe_safer.
3030
3031 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3032
3033         * regex_internal.h: Remove all references to
3034         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3035         or better.
3036         (bitset_not, bitset_merge, bitset_not_merge):
3037         (bitset_mask, re_string_allocate, re_string_construct):
3038         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3039         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3040         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3041         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3042         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3043         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3044         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3045         (re_acquire_state_context):
3046         Remove unnecessary forward decls.
3047         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3048         Put __attribute at function definition,
3049         now that the function decl has been removed.
3050         * lib/regex_internal.c (re_string_peek_byte_case):
3051         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3052         Likewise.
3053
3054 2005-08-26  Simon Josefsson  <jas@extundo.com>
3055
3056         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3057         Haible <bruno@clisp.org>.
3058
3059 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3060
3061         * regexec.c (set_regs): Don't alloca with an unbounded size.
3062
3063         alloca modernization/simplification for regex.
3064         * regex.c: Remove portability cruft for alloca.  This no longer
3065         needs to be at the start of the file, and can be moved into
3066         regex_internal.h and simplified.
3067         * regex_internal.h: Include <alloca.h>.
3068         (__libc_use_alloca) [!defined _LIBC]: New macro.
3069         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3070         now works outside glibc.
3071
3072 2005-08-24  Simon Josefsson  <jas@extundo.com>
3073
3074         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3075         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3076         GLIBC specific code.
3077
3078 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3079
3080         Make regex safe for g++.  This fixes one real bug (an "err"
3081         that should have been "*err").  g++ problem reported by
3082         Sam Steingold.
3083         * regex_internal.h (re_calloc): New macro, consistent with
3084         re_malloc etc.  All callers of calloc changed to use re_calloc.
3085         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3086         not int.  All callers changed.
3087         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3088         just use an array of size MB_LEN_MAX.
3089         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3090         (find_recover_state): Change "err" to "*err"; this fixes what
3091         appears to be a real bug.
3092         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3093         versus int.
3094
3095 2005-08-25  Jim Meyering  <jim@meyering.net>
3096
3097         * open-safer.c: Include <config.h>.
3098         Otherwise, we'd lose LARGEFILE support in any file using
3099         e.g. "fcntl--.h"
3100
3101 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3102
3103         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3104         * regex.h (regerror): Likewise.
3105
3106         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3107         requires this.  (The code never needed it.)
3108
3109         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3110         All uses of recently-renamed identifiers changed to use the new,
3111         POSIX-compliant names.  The code will build and run just fine
3112         without these changes, but it's better to eat our own dog food
3113         and use the standard-conforming names.
3114
3115         * regex.h: Fix a multitude of POSIX name space violations.
3116         These changes have an effect only for programs that define
3117         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3118         do not change anything for programs compiled in the normal way.
3119         Also, there is no effect on the ABI.
3120
3121         (_REGEX_SOURCE): New macro.
3122         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3123         defined and _GNU_SOURCE is not; this fixes a name space violation.
3124
3125         Rename the following macros to obey POSIX requirements.
3126         The old names are still visible as macros if _REGEX_SOURCE is defined.
3127         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3128         RE_BACKSLASH_ESCAPE_IN_LISTS.
3129         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3130         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3131         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3132         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3133         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3134         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3135         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3136         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3137         (REG_INTERVALS): renamed from RE_INTERVALS.
3138         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3139         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3140         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3141         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3142         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3143         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3144         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3145         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3146         RE_UNMATCHED_RIGHT_PAREN_ORD.
3147         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3148         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3149         (REG_DEBUG): renamed from RE_DEBUG.
3150         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3151         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3152         unusual, since we can't clash with the POSIX REG_ICASE.
3153         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3154         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3155         (REG_NO_SUB): renamed from RE_NO_SUB.
3156         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3157         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3158         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3159         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3160         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3161         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3162         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3163         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3164         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3165         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3166         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3167         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3168         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3169         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3170         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3171         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3172         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3173         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3174         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3175         (REG_FIXED): Renamed from REGS_FIXED.
3176         (REG_NREGS): Renamed from RE_NREGS.
3177
3178         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3179         of other REG_* macros, since POSIX says the user is allowed to
3180         #undef these macros selectively.
3181
3182         (reg_errcode_t): Update comment stating what other tables need
3183         to be consistent.
3184
3185         Rename the following enum values to obey POSIX requirements.
3186         The old names are still visible as macros.
3187         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3188         is not defined, since GNU is supposed to be a superset of POSIX as
3189         much as possible, and since we want reg_errcode_t to be a signed
3190         type for implementation consistency.
3191         (_REG_NOERROR): Renamed from REG_NOERROR.
3192         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3193         (_REG_BADPAT): Renamed from REG_BADPAT.
3194         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3195         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3196         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3197         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3198         (_REG_EBRACK): Renamed from REG_EBRACK.
3199         (_REG_EPAREN): Renamed from REG_EPAREN.
3200         (_REG_EBRACE): Renamed from REG_EBRACE.
3201         (_REG_BADBR): Renamed from REG_BADBR.
3202         (_REG_ERANGE): Renamed from REG_ERANGE.
3203         (_REG_ESPACE): Renamed from REG_ESPACE.
3204         (_REG_BADRPT): Renamed from REG_BADRPT.
3205         (_REG_EEND): Renamed from REG_EEND.
3206         (_REG_ESIZE): Renamed from REG_ESIZE.
3207         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3208         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3209         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3210         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3211         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3212
3213         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3214         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3215         changed.  But support the old name if the new one is not defined
3216         and if _REGEX_SOURCE.
3217
3218         Change the following member names in struct re_pattern_buffer.
3219         The old names are still supported if !_REGEX_SOURCE.
3220         The new names are always supported, regardless of _REGEX_SOURCE.
3221         (re_buffer): Renamed from buffer.
3222         (re_allocated): Renamed from allocated.
3223         (re_used): Renamed from used.
3224         (re_syntax): Renamed from syntax.
3225         (re_fastmap): Renamed from fastmap.
3226         (re_translate): Renamed from translate.
3227         (re_can_be_null): Renamed from can_be_null.
3228         (re_regs_allocated): Renamed from regs_allocated.
3229         (re_fastmap_accurate): Renamed from fastmap_accurate.
3230         (re_no_sub): Renamed from no_sub.
3231         (re_not_bol): Renamed from not_bol.
3232         (re_not_eol): Renamed from not_eol.
3233         (re_newline_anchor): Renamed from newline_anchor.
3234
3235         Change the following member names in struct re_registers.
3236         The old names are still supported if !_REGEX_SOURCE.
3237         The new names are always supported, regardless of _REGEX_SOURCE.
3238         (rm_num_regs): Renamed from num_regs.
3239         (rm_start): Renamed from start.
3240         (rm_end): Renamed from end.
3241
3242         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3243         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3244         Prepend __ to parameter names.
3245
3246         Undo yesterday's changes.
3247
3248 2005-08-24  Jim Meyering  <jim@meyering.net>
3249
3250         Sync from coreutils.
3251         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3252
3253 2005-08-21  Bruno Haible  <bruno@clisp.org>
3254
3255         * lock.h: Add multiple inclusion guard.
3256         * tls.h: Add multiple inclusion guard.
3257
3258 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3259
3260         * regex.h (REG_NOSYS)
3261         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3262         Define, since POSIX requires it as of 2001.
3263         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3264         New private symbol, used to keep the enum signed in all cases.
3265         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3266         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3267
3268         * regex_internal.c (re_string_skip_chars, register_state):
3269         (calc_state_hash):
3270         Remove forward decls; no longer needed now that we use prototypes.
3271         * regexec.c (acquire_init_state_context, check_halt_node_context):
3272         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3273         (clean_state_log_if_needed): Likewise.
3274
3275 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3276
3277         Fix problems reported by Sam Steingold in
3278         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3279         * regexec.c (sift_states_bkref): Fix portability bug: the code
3280         assumed that reg_errcode_t is a signed type, which is not
3281         necessarily true if _XOPEN_SOURCE is not defined.
3282         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3283         some compilers warn about it otherwise.
3284
3285 2005-08-20  Jim Meyering  <jim@meyering.net>
3286
3287         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3288         of unused local, dfa.
3289
3290 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3291
3292         * regcomp.c (create_initial_state): Remove duplicate decl.
3293         (init_word_char, create_initial_state, duplicate_node_closure):
3294         (fetch_token, peek_token_bracket, build_range_exp):
3295         (build_collating_symbol): Remove forward decls; no longer needed
3296         now that we use prototypes.
3297
3298         * regcomp.c:
3299         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3300         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3301         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3302         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3303         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3304         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3305         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3306         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3307         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3308         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3309         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3310         (build_charclass, build_charclass_op, fetch_number, create_tree):
3311         (create_token_tree, mark_opt_subexp, duplicate_tree):
3312         Use prototypes rather than old-style definitions.
3313
3314         * regex_internal.c:
3315         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3316         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3317         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3318         (re_string_reconstruct, re_string_peek_byte_case):
3319         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3320         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3321         (re_node_set_init_copy, re_node_set_add_intersect):
3322         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3323         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3324         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3325         (re_acquire_state, re_acquire_state_context, register_state):
3326         (create_ci_newstate, create_cd_newstate, free_state):
3327         Likewise.
3328         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3329         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3330         (re_search_internal, prune_impossible_nodes):
3331         (acquire_init_state_context, check_matching, static):
3332         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3333         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3334         (update_regs, sift_states_backward, build_sifted_states):
3335         (clean_state_log_if_needed, merge_state_array):
3336         (update_cur_sifted_state, add_epsilon_src_nodes):
3337         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3338         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3339         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3340         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3341         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3342         (check_arrival, check_arrival_add_next_nodes):
3343         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3344         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3345         (check_node_accept_bytes, check_node_accept, extend_buffers):
3346         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3347         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3348         (sift_ctx_init):
3349         Likewise.
3350
3351         * regex_internal.h:
3352         (re_string_allocate, re_string_construct, re_string_reconstruct):
3353         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3354         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3355         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3356         (re_string_context_at, re_string_peek_byte_case):
3357         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3358         is defined, since we now use prototypes always.
3359
3360         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3361         C89 or better.  All uses removed.
3362
3363 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3364
3365         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3366         [defined lint]: Suppress bogus uninitialized-variable warnings.
3367
3368         * regcomp.c (duplicate_node): Return new index, not an error code,
3369         and let the caller return REG_ESPACE if out of space.  This
3370         removes an uninitialied-variable warning with GCC 4.0.1, and also
3371         avoids taking the address of a local variable.  All callers
3372         changed.
3373
3374 2005-08-19  Jim Meyering  <jim@meyering.net>
3375
3376         * regexec.c (proceed_next_node): Redo local variables to
3377         avoid GCC shadowing warnings.
3378
3379 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3380
3381         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3382         (re_node_set_insert_last, re_dfa_add_node):
3383         Rename local variables to avoid GCC shadowing warnings.
3384
3385 2005-08-18  Bruno Haible  <bruno@clisp.org>
3386
3387         * strstr.c (strstr): Fix return value in multibyte case.
3388         * strcasestr.c (strcasestr): Likewise.
3389
3390 2005-08-17  Jim Meyering  <jim@meyering.net>
3391
3392         Make the %s format (seconds since the epoch) work for a negative
3393         number and when used with a zero-padded field width, e.g. %015s.
3394
3395         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3396         label so that it precedes the code to set `digits'.  Otherwise,
3397         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3398         print `00-22'.  Now, it prints `-0022', as it should.
3399
3400 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3401
3402         * regex.h: Remove useless space-before-tab.  From coreutils.
3403
3404 2005-08-17  Bruno Haible  <bruno@clisp.org>
3405
3406         * strcasestr.h: New file.
3407         * strcasestr.c: New file.
3408
3409 2005-08-17  Bruno Haible  <bruno@clisp.org>
3410
3411         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3412         * strstr.c: Completely rewritten, with multibyte locale support.
3413
3414 2005-08-17  Bruno Haible  <bruno@clisp.org>
3415
3416         * strcasecmp.c: Use mbuiter.h.
3417
3418 2005-08-17  Bruno Haible  <bruno@clisp.org>
3419
3420         * mbuiter.h: New file.
3421
3422 2005-08-16  Bruno Haible  <bruno@clisp.org>
3423
3424         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3425         (mbi_init): Update.
3426         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3427         NUL byte, not after it.
3428
3429 2005-08-16  Bruno Haible  <bruno@clisp.org>
3430
3431         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3432         the valid ones. Makes the comparison operations transitive:
3433         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3434         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3435
3436 2005-08-16  Bruno Haible  <bruno@clisp.org>
3437
3438         * strcase.h (strcasecmp): Add note in comments.
3439         * strncasecmp.c: Use code from strcasecmp.c.
3440         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3441         (strcasecmp): Work correctly in multibyte locales.
3442
3443 2005-08-16  Bruno Haible  <bruno@clisp.org>
3444
3445         * strnlen1.h: New file.
3446         * strnlen1.c: New file.
3447
3448 2005-08-16  Bruno Haible  <bruno@clisp.org>
3449
3450         * mbfile.h: New file.
3451
3452 2005-08-16  Bruno Haible  <bruno@clisp.org>
3453
3454         * mbiter.h: New file.
3455
3456 2005-08-16  Bruno Haible  <bruno@clisp.org>
3457
3458         * mbchar.h: New file.
3459         * mbchar.c: New file.
3460
3461 2005-08-16  Bruno Haible  <bruno@clisp.org>
3462
3463         * tls.h: New file, from GNU gettext.
3464         * tls.c: New file, from GNU gettext.
3465
3466 2005-08-15  Bruno Haible  <bruno@clisp.org>
3467
3468         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3469         is defined.
3470
3471 2005-08-14  Jim Meyering  <jim@meyering.net>
3472
3473         Sync from coreutils.
3474
3475         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3476         Use the hash-table-based cycle-detection code not just when
3477         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3478         Reported by James Youngman in
3479         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3480         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3481         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3482         This lets us compile with -DFTS_DEBUG, once again.
3483         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3484         * fts.c (fd_safer): Remove decl.
3485         Include fcntl--.h rather than unistd-safer.h
3486         (fts_safe_changedir): Don't call fd_safer; no longer needed
3487         now that we include fcntl--.h.
3488
3489 2005-08-11  Simon Josefsson  <jas@extundo.com>
3490
3491         * readline.h, readline.c: New file.
3492
3493 2005-08-11  Bruno Haible  <bruno@clisp.org>
3494
3495         * strnlen.h (strnlen): Change parameter name to match comment.
3496
3497 2005-08-10  Simon Josefsson  <jas@extundo.com>
3498
3499         * strndup.c: Use strnlen.h.
3500
3501         * strnlen.h: New file.
3502
3503 2005-08-02  Simon Josefsson  <jas@extundo.com>
3504
3505         * getline.h, getline.c: Rewrite.
3506
3507         * getdelim.h, getdelim.c: New files, ported from glibc.
3508
3509 2005-07-31  Bruno Haible  <bruno@clisp.org>
3510
3511         * lock.h (gl_lock_initializer): New macro.
3512         (gl_lock_define_initialized): Use it.
3513         (gl_rwlock_initializer): New macro.
3514         (gl_rwlock_define_initialized): Use it.
3515         (gl_recursive_lock_initializer): New macro.
3516         (gl_recursive_lock_define_initialized): Use it.
3517
3518 2005-07-26  Bruno Haible  <bruno@clisp.org>
3519
3520         * lock.h: Update from GNU gettext.
3521         * lock.c: Update from GNU gettext.
3522
3523 2005-07-18  Bruno Haible  <bruno@clisp.org>
3524
3525         * lock.h (gl_once_t): New type.
3526         (gl_once_define, gl_once): New macros.
3527         * lock.c (fresh_once): New variable.
3528         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3529         functions.
3530
3531 2005-07-18  Simon Josefsson  <jas@extundo.com>
3532
3533         * check-version.c (check_version): Accept identical versions too.
3534
3535 2005-07-18  Bruno Haible  <bruno@clisp.org>
3536
3537         * lock.h: New file, from GNU gettext.
3538         * lock.c: New file, from GNU gettext.
3539
3540 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3541
3542         * quotearg.c: Add translator comment suggested by Bruno Haible,
3543         with a minor change.
3544
3545 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3546
3547         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3548         copyright symbol and the year.
3549         * version-etc.c (COPYRIGHT_YEAR): New constant.
3550         (version_etc_va): Use parameterized copyright notice.
3551         Reword to conform to the current GNU coding standards.
3552
3553 2005-07-11  Simon Josefsson  <jas@extundo.com>
3554
3555         * size_max.h: New file.
3556
3557 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3558
3559         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3560         block of defines.
3561
3562 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3563        and  Paul Eggert  <eggert@cs.ucla.edu>
3564
3565         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3566         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3567
3568 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3569
3570         * regex.c, regex.h: Sync from libc.
3571         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3572         New files, synced from libc, except that regex_internal.h
3573         currently has a small porting fix.
3574
3575 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3576
3577         Remove the dependency of the strftime module on the tzset module.
3578         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3579         Copy the input structure, to work around some of the bug with
3580         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3581         Solaris releases, you should also use the tzset module, but we won't
3582         require it as a dependency any more since we don't want LGPLed code
3583         to depend on GPLed code.
3584
3585 2005-07-02  Jim Meyering  <jim@meyering.net>
3586
3587         * backupfile.c (backup_args): Change a `0' to NULL.
3588
3589 2005-07-01  Jim Meyering  <jim@meyering.net>
3590
3591         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3592         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3593         * save-cwd.c, tempname.c:
3594         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3595         and don't include <sys/file.h>).
3596
3597 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3598
3599         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3600         declares only 'struct timespec;' (!).
3601
3602 2005-06-29  Jim Meyering  <jim@meyering.net>
3603
3604         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3605         type name.  Use the variable name instead.
3606         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3607
3608 2005-06-28  Simon Josefsson  <jas@extundo.com>
3609
3610         * check-version.h, check-version.c: New files.
3611
3612 2005-06-28  Simon Josefsson  <jas@extundo.com>
3613
3614         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3615         collision with global variable.  Better indentation.  Don't
3616         increment buffer pointer beyond buffer end.  Based on comments
3617         from Paul Eggert <eggert@cs.ucla.edu>.
3618
3619         * base64.h: Indent.
3620
3621 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3622
3623         * canon-host.c (canon-host): Append trailing "," to 0 in
3624         initializer of struct addrinfo, as an indication that we don't
3625         care how many members the structure has.
3626
3627 2005-06-24  Derek Price  <derek@ximbiot.com>
3628         and Bruno Haible  <bruno@clisp.org>
3629
3630         Remove stat module & update lstat.
3631         * stat.c: Remove this file...
3632         (slash_aware_lstat): ...moving this content and its support...
3633         * lstat.c (rpl_lstat): ...into here.
3634         * lstat.h: New file.
3635
3636 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3637
3638         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3639         (ranged_convert): Don't save conversion in a temporary struct.
3640         This causes a warning with GCC 4.0.0, and anyway in the typical
3641         case it's not worth the extra 100 bytes or so of code.
3642         (ranged_convert, __mktime_internal): When calling a function via a
3643         pointer P, use P () rather than (*P) (), as we now assume C89 or
3644         better.
3645
3646 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3647
3648         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3649         "who -r" failed to give output.  Problem reported by Tim Waugh.
3650
3651         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3652         (xcalloc): Use it to avoid needless tests.
3653         Problem reported by Jim Meyering.
3654
3655 2005-06-16  Jim Meyering  <jim@meyering.net>
3656
3657         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3658         when either N or S is zero.
3659
3660 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3661
3662         * argp.h (__option_is_short): Check upper limit of
3663         __key. Isprint() requires its argument to have the value
3664         of an unsigned char or EOF.
3665
3666 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3667
3668         * fnmatch.c (fnmatch): If there is an encoding error in a
3669         multibyte string or pattern, fall back on unibyte matching.
3670         Problem reported by James Youngman.
3671
3672 2005-06-08  Bruno Haible  <bruno@clisp.org>
3673
3674         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3675         warning on mingw.
3676
3677 2005-06-08  Bruno Haible  <bruno@clisp.org>
3678
3679         * csharpcomp.h: New file, from GNU gettext.
3680         * csharpcomp.c: New file, from GNU gettext.
3681         * csharpcomp.sh.in: New file, from GNU gettext.
3682
3683 2005-06-07  Derek Price  <derek@ximbiot.com>
3684
3685         Sync from CVS.
3686         * glob_.h: Indent nested #ifdef.
3687
3688 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3689
3690         Sync from coreutils.
3691         Use "file name" when talking about file names, instead of "filename"
3692         or "path", as per the GNU coding standards.
3693         * mkdir-p.c: Renamed from makepath.c.
3694         (make_dir_parents): Renamed from make_path.  All callers changed.
3695         * mkdir-p.h: Likewise.  All includers changed.
3696         * filenamecat.c: Renamed from path-concat.c.
3697         (file_name_concat): Renamed from path_concat.  All callers changed.
3698         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3699         * filenamecat.h: Likewise.  All includers changed.
3700         * acl.c: Don't use "path" or "filename" to mean "file name"
3701         in comments or local variable names.
3702         * basename.c: Likewise.
3703         * canonicalize.c, canonicalize.h: Likewise.
3704         * dirname.c, dirname.h: Likewise.
3705         * euidaccess.c: Likewise.
3706         * exclude.c: Likewise
3707         * fnmatch_.h, fnmatch_loop.c: Likewise.
3708         * fsusage.c, fsuage.h: Likewise.
3709         * fts.c, fts_.h: Likewise.
3710         * getcwd.c: Likewise.
3711         * getloadavg.c: Likewise.
3712         * mkstemp.c: Likewise.
3713         * mountlist.c, mountlist.h: Likewise.
3714         * openat.c, openat.h: Likewise.
3715         * readlink-stub.c: Likewise.
3716         * readutmp.c, readutmp.h: Likewise.
3717         * rename.c: Likewise.
3718         * rmdir.c: Likewise.
3719         * same.c: Likewise.
3720         * savedir.c: Likewise.
3721         * stripslash.c: Likewise.
3722         * tempname.c: Likewise.
3723         * xreadlink.c: Likewise.
3724         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3725         All uses changed.
3726         * exclude.h: Likewise.
3727
3728         * euidaccess.c (getuid, getgid, getuid, getegid)
3729         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3730         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3731         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3732         * pathmax.h: Include <limits.h> unconditionally, since other
3733         files have been getting away with it for years (MORE/BSD 4.3
3734         is extinct now).
3735         * userspec.c (getpwnam, getgrnam, getgrgid)
3736         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3737
3738         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3739         Define to 256, not 255, as per modern POSIX.
3740
3741 2005-06-01  Bruno Haible  <bruno@clisp.org>
3742
3743         * csharpexec.h: New file, from GNU gettext.
3744         * csharpexec.c: New file, from GNU gettext.
3745         * csharpexec.sh.in: New file, from GNU gettext.
3746
3747 2005-05-31  Derek Price  <derek@ximbiot.com>
3748             Paul Eggert  <eggert@cs.ucla.edu>
3749
3750         Sync from cvs.
3751         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3752
3753 2005-05-29  Derek Price  <derek@ximbiot.com>
3754             Paul Eggert  <eggert@cs.ucla.edu>
3755
3756         * glob_.h, glob.c: New files.
3757
3758 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3759
3760         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3761
3762         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3763         the configuration hassle isn't worth it.
3764         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3765         (LONGEST_MODIFIER, PRIuMAX): Remove.
3766
3767 2005-05-27  Bruno Haible  <bruno@clisp.org>
3768
3769         * getlogin_r.h: Remove second include of <stddef.h>.
3770
3771 2005-05-25  Bruno Haible  <bruno@clisp.org>
3772             Derek Price  <derek@ximbiot.com>
3773
3774         * getlogin_r.h: Simplify API documentation.
3775
3776 2005-05-25  Derek Price  <derek@ximbiot.com>
3777             Paul Eggert  <eggert@cs.ucla.edu>
3778
3779         * getlogin_r.c, getlogin_r.h: New files.
3780
3781 2005-05-22  Bruno Haible  <bruno@clisp.org>
3782
3783         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3784         Also include <sys/param.h> if it defines MIN, MAX.
3785         Based on a patch by Derek Price <derek@ximbiot.com>.
3786
3787 2005-05-22  Bruno Haible  <bruno@clisp.org>
3788
3789         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3790         (INT64_MIN): Fix definition.
3791         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3792
3793         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3794         NEED_SIGNED_INT_TYPES.
3795
3796         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3797         HAVE_SYSTEM_INTTYPES.
3798
3799 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3800
3801         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3802         so that unistd-safer.h (GPL'ed code) need not be included.
3803
3804 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3805
3806         New fts module.
3807         * fts.c: Don't include "cycle-check.h" or "hash.h".
3808         (setup_dir, free_dir): New functions.
3809         (enter_dir, leave_dir): Define trivial
3810         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3811         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3812         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3813         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3814         Move to fts-cycle.c.
3815         (fts_open): Use setup_dir.
3816         (fts_close): Use free_dir.
3817         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3818         This adds a label and some gotos, but the alternatives were messier.
3819         Check for memory allocation failure when entering a dir.
3820         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3821         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3822         (FTS): New member fts_cycle, that is a union that contains the
3823         old active_dir_ht and cycle_state.  All uses changed to mention
3824         fts_cycle.ht and fts_cycle.state.
3825         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3826         fts.c, with the following changes:
3827         (setup_dir, free_dir): New functions.
3828         (enter_dir): Now returns bool.  Return true if successful, false
3829         if memory exhausted.  All callers changed.
3830         Do not bother partly cleaning up on
3831         memory allocation failure; that is free_dir's job.
3832         However, free ad if hash_insert fails, to avoid memory leak.
3833         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3834         fts->fts_options to see which union member to use.
3835
3836 2005-05-20  Jim Meyering  <jim@meyering.net>
3837
3838         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3839         Now a macro, to pacify GCC.
3840
3841 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3842
3843         * chown.c (rpl_chown): Return -1 on failure.
3844
3845 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3846
3847         * canonicalize.c: Include canonicalize.h first, to test interface.
3848         Include <stddef.h> unconditionally, since we assume C89 now.
3849         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3850         * fts.c: Include fts_.h first, to check interface.
3851         Do not include intprops.h; no longer needed.
3852         Include cycle-check.h and hash.h, since fts_.h no longer does.
3853         Remove unnecessary casts of closedir to void.
3854         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3855         decide whether to decrement nlinks.
3856         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3857         (FTS): Use struct hash_table * instead of Hash_table, so that
3858         we no longer need to include hash.h here.
3859
3860 2005-05-17  Jim Meyering  <jim@meyering.net>
3861
3862         * fts.c, fts_.h: New files, from coreutils.
3863
3864 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3865
3866         Sync from coreutils.
3867         * unlinkdir.c, unlinkdir.h: New files.
3868         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3869         regex.h, unlocked-io.h, xtime.h:
3870         White space changes only.
3871         * makepath.c (make_path): Port to hosts where leading "//" is special.
3872         * yesno.c: Include getline.h, not ctype.h.
3873         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3874         Use getline to remove arbitrary restriction on response length.
3875
3876 2005-05-13  Bruno Haible  <bruno@clisp.org>
3877
3878         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3879         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3880         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3881         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3882         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3883         Add support for 64-bit integers in the MSVC compiler.
3884
3885 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3886
3887         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3888         Change the initial comment to refer to GPL, not LGPL.
3889         gnulib-tool will change it to LGPL as needed.
3890
3891         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3892         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3893         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3894         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3895         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3896         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3897         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3898         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3899         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3900         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3901         concatpath.c, config.charset, copy-file.c, copy-file.h,
3902         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3903         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3904         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3905         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3906         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3907         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3908         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3909         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3910         full-read.c, full-read.h, full-write.c, full-write.h,
3911         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3912         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3913         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3914         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3915         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3916         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3917         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3918         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3919         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3920         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3921         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3922         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3923         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3924         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3925         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3926         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3927         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3928         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3929         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3930         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3931         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3932         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3933         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3934         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3935         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3936         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3937         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3938         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3939         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3940         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3941         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3942         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3943         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3944         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3945         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3946         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3947         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3948         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3949         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3950         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3951         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3952         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3953         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3954         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3955         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3956         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3957         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3958         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3959         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3960         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3961         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3962         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3963         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3964         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3965         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3966         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3967         Update FSF postal mail address.
3968
3969 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3970
3971         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3972         specified in ai_socktype. Fix invalid ai_protocol
3973         check. ai_protocol is usually set to 0 or depending on
3974         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3975         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3976         ai_socktype / ai_protocol in the returned addrinfo structure.
3977
3978 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3979             Bruno Haible  <bruno@clisp.org>
3980
3981         * inet_ntop.h: New file.
3982         * inet_ntop.c: New file, from glibc with modifications.
3983
3984 2005-05-08  Jim Meyering  <jim@meyering.net>
3985
3986         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3987
3988 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3989
3990         Merge from coreutils.  Among other things,
3991         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3992         * fd-safer.c: New file.
3993         * fcntl-safer.h, open-safer.c: Remove.
3994         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3995         * dup-safer.c: Include unistd-safer.h first.
3996         Don't include errno.h.
3997         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3998         * file-type.h: Don't assume invoker included sys/stat.h first.
3999         * file-type.c: Rely on file-type.h change.
4000         * getloadavg.c: Include unistd-safer.h.
4001         (getloadavg): Use safer open.
4002         * getusershell.c: Include "stdio-safer.h".
4003         (getusershell): Use safer fopen.
4004         * long-options.c (long_options): Use NULL rather than 0.
4005         * modechange.h (mode_free): Remove; all callers changed to invoke
4006         'free'.
4007         * modechange.c: Likewise.
4008         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4009         (MODE_DONE): New constant.
4010         (struct mode_change): Remove 'next' member.
4011         (make_node_op_equals): New function; like the old one of the
4012         same name, except it allocates an array.
4013         (mode_compile, mode_create_from_ref): Use it.
4014         (mode_compile): Allocate result as an array, not a linked list.
4015         Parse octal string ourself, so that we catch mistakes like "+0".
4016         (mode_adjust): Arg is an array, not a linked list.
4017         * modechange.c: Include stat-macros.h, xalloc.h.
4018         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4019         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4020         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4021         Remove.  This is now stat-macros.h's job.
4022         (talloc): Remove.  All callers replaced by xalloc, so that
4023         our invokers don't have to worry about reporting memory failures.
4024         (make_node_op_equals): Remove.
4025         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4026         New constants.
4027         (struct mode_change): Moved here from modechange.h.
4028         (mode_append_entry): Remove.
4029         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4030         apps to have incorrect behavior.  Use simpler algorithm for head
4031         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4032         Detect more invalid usages rather than having somewhat-random behavior.
4033         Don't insert an "a=" action, as that leads to incorrect behavior.
4034         (mode_compile, mode_create_from_ref): Return NULL on error instead
4035         of an enum, since now there's only one way to have an error.  All
4036         callers changed.
4037         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4038         at the correct time.  Simplify calculation of "+u" and its ilk.
4039         Don't mishandle "+X".
4040         (mode_free): Remove "register" and localize decls.
4041         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4042         (struct mode_change): Move to modechange.c; callers don't
4043         need to see this stuff.
4044         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4045         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4046         (mode_change, mode_adjust): Reflect the new signatures noted above.
4047         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4048         that might redefine system include files.
4049         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4050         (my_usleep): Use NULL rather than (void *) 0.
4051         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4052         Use siginterrupt to specify that system calls should be interrupted.
4053         (rpl_nanosleep): Move initialization of suspended closer to call of
4054         my_usleep.
4055         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4056         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4057         (desirable_utmp_entry): New function.
4058         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4059         using x2nrealloc, to simplify logic.
4060         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4061         size calculation.  Do not assume utmp file is a regular file.
4062         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4063         (READ_UTMP_CHECK_PIDS): New constant.
4064         * save-cwd.c: Include unistd-safer.h.
4065         (save_cwd): Use fd_safer.
4066         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4067         [!_LIBC] Include "stat-macros.h" instead.
4068         * unistd-safer.h (fd_safer): New decl.
4069
4070 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4071
4072         * byteswap_.h: New file.
4073
4074 2005-04-25  Albert Chin  <china@thewrittenword.com>
4075
4076         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4077         Toolkit C bug.
4078
4079 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4080
4081         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4082         that "UTC +1 second" continues to work.  Problem reported
4083         by Dmitry V. Levin.
4084         (relunit_snumber): New rule.
4085         (relunit): Use it.
4086
4087 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4088
4089         * getdate.y (universal_time_zone_table): New constant.
4090         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4091         universal_time_zone_table.
4092         (lookup_zone): Prefer universal_time_zone_table to
4093         local_time_zone_table, so that "GMT" time stamps are allowed in
4094         London during the summer.  Problem reported by Ian Abbott.
4095
4096 2005-04-12  Jim Meyering  <jim@meyering.net>
4097
4098         * human.c (humblock): Set *options even when returning due to
4099         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4100         warning from gcc-4.
4101
4102 2005-04-09  Jim Meyering  <jim@meyering.net>
4103
4104         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4105         -Wuninitialized: initialize tm0.tm_year.
4106
4107 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4108
4109         * getdate.y (parser_control): rels_seen is now a boolean, not a
4110         count, since there's no maximum.  All uses changed.
4111         Add member dsts_seen.
4112         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4113         not being INT_MAX.
4114         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4115         Use pc_rels_seen to decide whther a date is absolute.
4116
4117         * getdate.y (number): Don't overwrite year.
4118         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4119         check.
4120
4121 2005-04-02  Simon Josefsson  <jas@extundo.com>
4122
4123         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4124         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4125
4126 2005-03-27  Jim Meyering  <jim@meyering.net>
4127
4128         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4129
4130 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4131
4132         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4133         "one's complement" -> "ones' complement" in comment, as per Knuth.
4134         "value of type" -> "type or expression" in comment.
4135         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4136
4137 2005-03-26  Jim Meyering  <jim@meyering.net>
4138
4139         Comment nits.
4140         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4141         Correct typos: s/or/of/.
4142
4143 2005-03-23  Jim Meyering  <jim@meyering.net>
4144
4145         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4146
4147 2005-03-21  Jim Meyering  <jim@meyering.net>
4148
4149         Changes imported from coreutils.
4150
4151         * cycle-check.c: Don't include xalloc.h.
4152
4153         * path-concat.c: Don't include assert.h.
4154         (path_concat): Remove assertion that would have triggered
4155         for ABASE starting with more than one slash.
4156         Reported by Andreas Schwab.
4157
4158         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4159         properly when ABASE is an absolute file name.
4160         Correct the description of this function.
4161         Include <assert.h>.
4162         Add an assertion and a test driver.
4163         This fixes a bug introduced on 2004-07-02.
4164         Andreas Schwab reported the resulting failure of cp --parents:
4165         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4166
4167 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4168
4169         * strftime.c (my_strftime): If the underlying strftime returns 0
4170         (which shouldn't happen), generate nothing instead of returning 0
4171         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4172
4173 2005-03-16  Bruno Haible  <bruno@clisp.org>
4174
4175         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4176
4177 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4178
4179         * strftime.c (my_strftime): Prepend space to format so that we can
4180         reliably distinguish strftime failure from empty output on POSIX
4181         hosts.
4182
4183 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4184
4185         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4186         (iconv_string): Don't guess a size-zero buffer, as that might cause
4187         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4188         result would be 'too large', where 'too large' is (heuristically)
4189         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4190         overflow concerns.  This will prevent some unwanted malloc failures
4191         when the inputs are very large.
4192
4193 2005-03-15  Bruno Haible  <bruno@clisp.org>
4194
4195         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4196         'negate'.
4197
4198         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4199         variable.
4200
4201         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4202
4203 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4204
4205         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4206         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4207         intprops.h.
4208         * strtol.c: Likewise.
4209
4210 2005-03-14  Simon Josefsson  <jas@extundo.com>
4211
4212         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4213         <fx@gnu.org>.
4214
4215 2005-03-14  Jim Meyering  <jim@meyering.net>
4216
4217         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4218         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4219         to be nonzero so that we (and caller) can detect the difference
4220         between a valid zero-length expansion and an error return, even
4221         when the underlying strftime fails before writing anything into
4222         that location.
4223
4224 2005-03-10  Jim Meyering  <jim@meyering.net>
4225
4226         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4227         so that this module works on systems without fchdir.
4228
4229 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4230
4231         Factor int-properties macros into a single file, except for
4232         glibc-related files.
4233         * intprops.h: New file.
4234         * getloadavg.c: Include it instead of limits.h.
4235         (INT_STRLEN_BOUND): Remove.
4236         * human.c: Include intprops.h.
4237         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4238         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4239         * inttostr.h: Include intprops.h instead of limits.h.
4240         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4241         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4242         for consistency with intprops.h.
4243         (time_t_is_integer, twos_complement_arithmetic): Use them.
4244         * sig2str.h: Include <signal.h>, intprops.h.
4245         (INT_STRLEN_BOUND): Remove.
4246         * strftime.c (TYPE_SIGNED): Remove.
4247         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4248         * strtol.c: Adjust comments to match intprops.h.
4249         * userspec.c: Include intprops.h.
4250         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4251         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4252         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4253         instead of rolling our own expressions.
4254         * xstrtol.c: Include xstrtol.h first, to test interface.
4255
4256         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4257         instead of int.
4258         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4259         the right thing even if adding 1900 would overflow.  Similarly
4260         for tm_mon + 1 and tm_yday + 1.
4261         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4262         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4263         (DO_SIGNED_NUMBER): New macro.
4264         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4265
4266 2005-03-07  Bruno Haible  <bruno@clisp.org>
4267
4268         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4269
4270 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4271             Bruno Haible  <bruno@clisp.org>
4272
4273         * pagealign_alloc.h: New file.
4274         * pagealign_alloc.c: New file.
4275
4276 2005-01-28  Bruno Haible  <bruno@clisp.org>
4277
4278         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4279         stpncpy.c uses it.
4280
4281 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4282
4283         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4284         The workaround isn't strictly needed for POSIX conformance, and
4285         it's too much of a pain to configure and maintain.  We'll ask
4286         people to fix their kernels instead.
4287         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4288         (NANOSLEEP_BUG_WORKAROUND): Remove.
4289         (xnanosleep): Remove the workaround.
4290
4291 2005-02-12  Bruno Haible  <bruno@clisp.org>
4292
4293         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4294
4295 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4296
4297         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4298         * timespec.h (gettime): Return void, since it always
4299         succeeds now.  All uses changed.
4300         * gettime.c (gettime) Likewise.
4301         [HAVE_NANOTIME]: Prefer nanotime.
4302         Assume gettimeofday succeeds, as POSIX requires.
4303         Assime time () succeeds, since other code already does.
4304         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4305         (timespec_subtract): Remove.
4306         (NANOSLEEP_BUG_WORKAROUND): New constant.
4307         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4308         things considerably.  Use it only on GNU/Linux hosts, since the
4309         workaround shouldn't be needed elsewhere.
4310
4311 2005-02-24  Bruno Haible  <bruno@clisp.org>
4312
4313         * gettext.h: Update from GNU gettext 0.14.2.
4314
4315 2005-02-24  Bruno Haible  <bruno@clisp.org>
4316
4317         * localcharset.c: Update from GNU gettext 0.14.2.
4318         * config.charset: Update from GNU gettext 0.14.2.
4319
4320 2005-02-22  Simon Josefsson  <jas@extundo.com>
4321
4322         * iconvme.h, iconvme.c: New files, from libc.
4323
4324 2005-02-20  Neil Conway  <neilc@samurai.com>
4325
4326         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4327         returned by OSX/Darwin if the specified buffer is not large
4328         enough for the hostname.
4329
4330 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4331
4332         * memrchr.h: New file.
4333         * chdir-long.c: Include it.
4334         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4335         Don't bother including stddef.h.
4336
4337 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4338
4339         * argp-help.c (__argp_help): Create a fake struct argp_state and
4340         pass it to _help, otherwise the latter coredumps trying to
4341         dereference state.root_argp.
4342
4343 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4344
4345         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4346         inclusion.
4347         Include <sys/types.h>, for dev_t.
4348         (ME_DUMMY, ME_REMOTE): Move from here....
4349         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4350         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4351         Dmitry V. Levin.
4352         Include mountlist.h first, to test the interface.
4353
4354 2005-01-29  Bruno Haible  <bruno@clisp.org>
4355
4356         * progname.c (program_name): Initialize.
4357         Needed when linking statically on MacOS X.
4358
4359 2005-01-28  Bruno Haible  <bruno@clisp.org>
4360
4361         * javacomp.sh.in: New file, from GNU gettext.
4362         * javacomp.h: New file, from GNU gettext.
4363         * javacomp.c: New file, from GNU gettext.
4364
4365 2005-01-26  Bruno Haible  <bruno@clisp.org>
4366
4367         * javaexec.sh.in: New file, from GNU gettext.
4368         * javaexec.h: New file, from GNU gettext.
4369         * javaexec.c: New file, from GNU gettext.
4370
4371 2005-01-26  Simon Josefsson  <jas@extundo.com>
4372
4373         * gai_strerror.c: Use GPL in header.
4374
4375 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4376
4377         * argp-help.c (hol_entry_help): Avoid using non-constant
4378         initializers for struct pentry_state.
4379         (__argp_error): Check return value of __asprintf
4380         (__argp_failure): Translate error message
4381
4382         * argp-parse.c: Removed braces around the expansion of N_()
4383
4384 2005-01-21  Jim Meyering  <jim@meyering.net>
4385
4386         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4387         same value as for Solaris 9.
4388
4389         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4390         component length.  This included changing the parameter to be
4391         of type `char *' rather than `char const *'.
4392         * chdir-long.h (chdir_long): Update prototype.
4393
4394         * openat.c (fdopendir, fstatat): New functions.
4395         * openat.h: Include headers required for use of DIR and struct stat.
4396         [AT_SYMLINK_NOFOLLOW]: Define.
4397         (fdopendir, fstatat): Add prototypes.
4398
4399 2005-01-21  Bruno Haible  <bruno@clisp.org>
4400
4401         * classpath.h: New file, from GNU gettext.
4402         * classpath.c: New file, from GNU gettext.
4403
4404 2005-01-20  Simon Josefsson  <jas@extundo.com>
4405
4406         * version-etc-fsf.c: New file, with version_etc_copyright.
4407         * version-etc.c: Remove version_etc_copyright.
4408         * version-etc.h (version_etc_copyright): Use [] instead of * in
4409         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4410
4411 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4412
4413         * save-cwd.c (save_cwd): Remove code to support the case
4414         where fchdir is missing or flaky.
4415
4416 2005-01-20  Simon Josefsson  <jas@extundo.com>
4417
4418         * base64.h (isbase64): Add.
4419
4420         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4421         using a unsigned prototype, don't inline.
4422         (base64_decode): Use it.
4423
4424 2005-01-19  Bruno Haible  <bruno@clisp.org>
4425
4426         * sh-quote.h: New file, from GNU gettext.
4427         * sh-quote.c: New file, from GNU gettext.
4428
4429 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4430
4431         Merge changes from coreutils, as described below in several
4432         changelogs dated today.
4433
4434         * save-cwd.c: Include "save-cwd.h" before other include files.
4435         (O_DIRECTORY): Remove; not needed here, since "." must be
4436         a directory.  All uses removed.
4437         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4438         universal on Suns, and we also need to test for IRIX.
4439         Revamp code to use 'if' rather than '#if'.
4440         Avoid unnecessary comparison of cwd->desc to 0.
4441
4442         * utimens.c (futimens): Robustify the previous patch, by checking
4443         for known valid error numbers rather than observed invalid ones.
4444
4445 2005-01-18  Jim Meyering  <jim@meyering.net>
4446
4447         * version-etc.c (version_etc_copyright): Update copyright date.
4448
4449         * utimens.c (futimens): Account for the fact that futimes
4450         can also fail with errno == ENOSYS or errno == ENOENT.
4451         Patch from Dmitry V. Levin.
4452
4453         Change the name of the robust chdir function from chdir to chdir_long.
4454         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4455         (restore_cwd): Use chdir_long, not chdir.
4456         * chdir-long.c: Renamed from chdir.c.
4457         * chdir-long.h: Renamed from chdir.h.
4458         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4459         Hurd.
4460
4461 2005-01-18  Bob Proulx  <bob@proulx.com>
4462
4463         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4464         offsetof() macro construct to avoid compile failure with native HP-UX
4465         11.0 ANSI C compiler.
4466
4467 2005-01-06  Bruno Haible  <bruno@clisp.org>
4468
4469         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4470         because stpncpy.m4 takes care of it.
4471
4472 2004-01-24  Bruno Haible  <bruno@clisp.org>
4473
4474         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4475
4476 2003-10-09  Bruno Haible  <bruno@clisp.org>
4477
4478         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4479
4480 2005-01-06  Bruno Haible  <bruno@clisp.org>
4481
4482         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4483         * fwriteerror.c: Include <stdbool.h>.
4484         (fwriteerror): At the end, close the file stream. Record whether
4485         stdout was already closed.
4486
4487 2004-05-27  Bruno Haible  <bruno@clisp.org>
4488
4489         * execute.c (environ): Declare if needed.
4490         * pipe.c (environ): Likewise.
4491         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4492
4493 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4494
4495         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4496         definitions to be after all include files, to avoid collisions.
4497         Problem reported by Bob Proulx.
4498
4499 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4500
4501         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4502         not needed.  This removes a dependency on the gettext module.
4503         [defined _LIBC]: Do not include <libintl.h>; not needed.
4504
4505 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4506
4507         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4508         HAVE_DECL_STRTOLD.
4509
4510 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4511
4512         * argp-parse.c: Include <stddef.h>.
4513         (alignof, alignto): New macros.
4514         (parser_init): Don't assume that void * is aligned sufficiently
4515         for struct option.
4516
4517         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4518         need to extend the stack.
4519         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4520         large.
4521
4522 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4523
4524         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4525
4526 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4527
4528         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4529         Remove now-obsolete comment about AIX.
4530         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4531         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4532         (YYMAXDEPTH): New macro.
4533
4534 2004-12-18  Bruno Haible  <bruno@clisp.org>
4535
4536         * fatal-signal.c (fatal_signals): Make non-const.
4537         (init_fatal_signals): New function.
4538         (uninstall_handlers, install_handlers): Ignore signals that were set to
4539         SIG_IGN.
4540         (at_fatal_signal): Call init_fatal_signals.
4541         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4542         SIG_IGN.
4543         Reported by Paul Eggert.
4544
4545 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4546
4547         * getdate.y (textint): New member "negative".
4548         (time_zone_hhmm): New function.
4549         Expect 14 shift-reduce conflicts, not 13.
4550         (o_colon_minutes): New rule.
4551         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4552         (yylex): Set the "negative" member of signed numbers.
4553
4554 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4555
4556         Changes imported from coreutils.
4557         * hard-locale.c: Assume <locale.h> exists.
4558         Include "strdup.h".
4559         (GLIBC_VERSION): New macro.
4560         (hard_locale): Assume setlocale exists.
4561         Rewrite to avoid #ifdef.
4562         Use strdup rather than malloc + strcpy.
4563         * human.c: Assume <locale.h> exists.
4564         (human_readable): Assume localeconv exists.
4565
4566 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4567
4568         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4569         convert T2, not T.  (Imported from libc.)
4570
4571 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4572
4573         * getcwd.c (is_ENAMETOOLONG): New macro.
4574         (__getcwd.c): Don't restore errno; glibc doesn't.
4575         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4576         first, falling back to our code only if its results look suspicious.
4577         Ensure that the resulting buffer is only as large as necessary.
4578
4579         * readutmp.c: Include readutmp.h first.
4580         Include <errno.h>, since readutmp.h no longer does that.
4581         * readutmp.h: Don't include <errno.h>,
4582         <sys/param.h>, <time.h>; not needed to establish interface.
4583         (errno): Remove decl.
4584         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4585         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4586         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4587
4588 2004-11-28  Simon Josefsson  <jas@extundo.com>
4589
4590         * base64.h, base64.c: New file.
4591
4592 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4593
4594         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4595
4596 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4597
4598         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4599         HP's ANSI C compiler.
4600         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4601         Declaring int functions causes warnings on some modern systems and
4602         shouldn't be needed to compile on ancient ones.
4603         * same.c (MIN) [defined MIN]: Don't define, since it's already
4604         defined.
4605
4606         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4607         with the following changes.
4608         (__set_errno): Parenthesize properly.
4609         Include <stdbool.h>.
4610         (MIN, MAX, MATCHING_INO): New macros.
4611         (__getcwd): Define with prototype, not K&R form.
4612         Use heuristics to allocate default buffer on stack if possible.
4613         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4614         behavior, and to avoid the PATH_MAX limit when computing
4615         ../../../../...
4616         Use MATCHING_INO to compare inode number to file.
4617         Check for arithmetic overflow in size calculations.
4618         Fix bug in reallocation of dot array that caused getcwd to fail
4619         on directories nested deeper than 75.
4620         Be more careful about saving errno on error.
4621         Do not use realloc; use only free+malloc, as this is a bit
4622         more flexible and avoids a needless copy operation.
4623         Do not inspect st_dev and st_ino for symbolic links; POSIX
4624         doesn't specify the latter.
4625         Check for closedir errors.
4626         Avoid needless casts.
4627         Use "#ifdef weak_alias" around weak_alias, to be like other
4628         glibc code.
4629         The following changes to getcwd.c have effect only when used in
4630         gnulib; they have no effect inside glibc proper.
4631         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4632         as alloca isn't used.
4633         (alloca, __alloca): Likewise.
4634         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4635         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4636         unconditionally, as gnulib assumes C89 or better.
4637         Do not include <sys/param.h>.
4638         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4639         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4640         better.
4641         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4642         Include <dirent.h> in a way that is compatible with modern Autoconf.
4643         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4644         New macros, if not already defined.
4645         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4646         Use "_LIBC", not "defined _LIBC", for consistency.
4647         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4648         a mempcpy module.
4649         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4650         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4651         * xgetcwd.c: David MacKenzie's old code was removed, so give
4652         credit only to Jim Meyering and adjust the copyright dates.
4653         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4654         <stdlib.h>, <unistd.h>, "pathmax.h".
4655         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4656         (INITIAL_BUFFER_SIZE): Remove.
4657         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4658
4659 2004-11-23  Jim Meyering  <jim@meyering.net>
4660
4661         * getopt_.h: Remove trailing blanks.
4662
4663 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4664
4665         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4666         (futimens): New function, which uses futimes if available.
4667         (futimens, utimens): Support timespec==NULL, with same semantics
4668         as utime and utimens.
4669         * utimens.h (futimens): New decl.
4670
4671 2004-11-23  Jim Meyering  <jim@meyering.net>
4672
4673         * __fpending.c: Add comment.
4674
4675 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4676
4677         * getopt_.h: Re-addition of __getopt_argv_const caused
4678         redefinition warnings. To avoid them, include the defines
4679         in `#if !defined __need_getopt ... #endif'. The only place
4680         where __getopt_argv_const is used is in definitions
4681         of getopt_long and getopt_long_only below, which are as well
4682         protected by `#ifndef __need_getopt'.
4683         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4684         __need_getopt after including <stdio.h> and <unistd.h> These
4685         headers might have defined it.
4686
4687 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4688
4689         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4690         New macros.
4691         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4692         optopt): Use them instead of invoking ## directly; otherwise, the
4693         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4694
4695 2004-11-19  Bruno Haible  <bruno@clisp.org>
4696
4697         * strtok_r.c: Move comments from here...
4698         * strtok_r.h: ... to here.
4699
4700 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4701
4702         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4703         might fail.  Problem reported by Yoann Vandoorselaere.
4704         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4705         that mishandle size_t overflow.
4706
4707 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4708
4709         * canon-host.c: Include "strdup.h".
4710         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4711         Use strdup instead of malloc/strcpy to duplicate strings.
4712
4713         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4714         (human_space_before_unit): New constant.
4715         * human.c (human_readable): Support it.
4716
4717         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4718         (xgetcwd): Set errno correctly when failing.
4719         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4720         the failure is actually due to a PATH_MAX problem.
4721
4722         Further getopt changes to make it more likely that glibc will
4723         buy the changes back.
4724         * getopt.c (POSIXLY_CORRECT): New constant.
4725         (getopt): Use it, so to preserve glibc semantic
4726         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4727         when compiling for libc.
4728         * getopt_.h (__getopt_argv_const): Bring it back.
4729         (getopt_long, getopt_long_only): Use it.
4730
4731         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4732         New arg POSIXLY_CORRECT.  All callers changed.
4733         (getopt): Argv is now char * const *, as per standard.
4734         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4735         not char *__getopt_argv_const *.
4736         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4737         _getopt_long_only_r): Likewise.
4738         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4739         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4740         _getopt_long_r, _getopt_long_only_r): Likewise.
4741         * getopt_.h (__getopt_argv_const): Remove.
4742         (getopt): Argv is now char * const *, as per standard.
4743
4744         * getdate.y (tORDINAL): New token.
4745         (day, relunit): Allow it for relative times.
4746         (relative_time_table): Use tORDINAL for ordinals.
4747
4748 2004-11-15  Jim Meyering  <jim@meyering.net>
4749
4750         * closeout.c: Include "__fpending.h" once again.
4751         Include <stdbool.h>.
4752         (close_stdout): Don't fail just because stdout was closed initially,
4753         since some programs don't write to stdout in the normal course of
4754         operation (other than --version and --help), and we don't want this
4755         function to make e.g. `touch file >&-' fail.
4756         But do fail if it was closed and someone has tried to write to it.
4757         E.g., `printf foo >&-' must fail.
4758
4759 2004-11-11  Simon Josefsson  <jas@extundo.com>
4760
4761         * strtok_r.h, strtok_r.c: New file.
4762
4763 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4764
4765         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4766         we can stop lying to compilers about the constness of argv when we
4767         are compiled outside glibc.
4768         (getopt, getopt_long, getopt_long_only): Use it.
4769         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4770         getopt): Likewise.
4771         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4772         _getopt_long_only_r): Likewise.
4773         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4774         _getopt_long_only_r): Likewise.
4775
4776         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4777         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4778         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4779         the other external symbols.
4780         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4781         declaration, since the above renaming now works around collisions.
4782
4783 2004-11-11  Jim Meyering  <jim@meyering.net>
4784
4785         * linebreak.c: Remove trailing blanks.
4786         * alloca_.h: Likewise.
4787         * acosl.c: Likewise.
4788         * euidaccess.c: Likewise.
4789         * allocsa.h: Likewise.
4790
4791 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4792
4793         * mktime.c (SHR): New macro, which is a portable
4794         substitute for >> that should work even on Crays.
4795         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4796         Problem reported by Mark D. Baushke in
4797         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4798         * getdate.y (SHR): Likewise.
4799         (tm_diff): Use it.
4800         * strftime.c (SHR): Likewise.
4801         (tm_diff): Use it.
4802         * quotearg.c (struct quoting_options): Use unsigned int for
4803         quote_these_too, so that right shifts are well defined.  All uses
4804         changed.
4805
4806 2004-11-10  Simon Josefsson  <jas@extundo.com>
4807
4808         * getaddrinfo.h, getaddrinfo.c: New files.
4809
4810 2004-11-10  Jim Meyering  <jim@meyering.net>
4811
4812         Ensure that no close failure goes unreported.
4813         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4814         return early when it seems there's nothing to flush.
4815         Don't include __fpending.h.
4816
4817 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4818
4819         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4820
4821 2004-11-05  Bruno Haible  <bruno@clisp.org>
4822
4823         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4824         Reported by Mark D. Baushke <mdb@cvshome.org>.
4825
4826 2004-11-04  Bruno Haible  <bruno@clisp.org>
4827
4828         2004-09-11  Bruno Haible  <bruno@clisp.org>
4829                 * allocsa.valgrind: New file.
4830         2004-02-06  Bruno Haible  <bruno@clisp.org>
4831                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4832                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4833                 Reported by Christopher Seip <chris.seip@hp.com>.
4834
4835 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4836
4837         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4838         with errno == ERANGE if the buffer is too small.
4839         Problem reported by Mark D. Baushke.
4840
4841 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4842
4843         * xreadlink.c (MAXSIZE): New macro.
4844         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4845         size does not exceed MAXSIZE.  Avoid cast.
4846         As suggested by Mark D. Baushke in
4847         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4848         if readlink fails with buffer size just under MAXSIZE, try again
4849         with MAXSIZE.
4850
4851 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4852         and  Paul Eggert  <eggert@cs.ucla.edu>
4853
4854         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4855         (get_date): Overparenthesize to avoid GCC warning.
4856
4857 2004-11-02  Bruno Haible  <bruno@clisp.org>
4858
4859         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4860         function returns void.
4861
4862 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4863
4864         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4865         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4866         already declared.
4867
4868 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4869
4870         * getdate.y: Add support for TZ="foo" within a date string.
4871         Fix some bugs near time_t boundaries.  Reject dates with
4872         out-of-range components, e.g., "Sept 31".
4873         Include <stdlib.h>, "setenv.h", "xalloc.h".
4874         (ISDIGIT_LOCALE): Remove; unused.
4875         Note that the TZ and time functions used here are not reentrant.
4876         (mktime_ok, get_tz): New functions.
4877         (TZBUFSIZE): New constant.
4878         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4879         This requires that we sometimes generate our own TZ="XXX..." setting.
4880
4881 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4882
4883         * mktime.c (not_equal_tm): Remove redundant check.
4884
4885 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4886
4887         * getdate.y: Use Bison 1.875 features, and some minor
4888         code cleanups.  This change does not affect semantics.
4889         Don't include <stdlib.h>; no longer needed.
4890         Don't include unlocked-io.h; only the "#if TEST" code uses
4891         stdio, and performance isn't crucial there.
4892         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4893         Bison 1.875 features as described below.
4894         All uses of "PC." replaced by "pc->".
4895         (YYSTYPE): Add a forward declaration.
4896         (yylex, yyerror): Use full prototypes in forward decls.
4897         Use "%pure-parser" rather than obsolescent "%pure_parser".
4898         Use %parse-param and %lex-param instead of obsolescent
4899         YYPARSE_PARAM and YYLEX_PARAM.
4900         (meridian_table, month_and_day_table, time_units_table,
4901         relative_time_table, time_zone_table, military_table,
4902         lookup_zone, lookup_word, get_date):
4903         Use NULL instead of 0 where appropriate.
4904         (to_hour): Avoid abort (), to avoid a dependency on
4905         stdlib.h.
4906         (yyerror, yylex): Now accepts parser_control * arg.
4907         (main) [TEST]: Use '\0' rather than 0 for char.
4908
4909 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4910
4911         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4912         It's now the caller's responsibility to handle the case where
4913         !HAVE_GETPAGESIZE && !defined getpagesize.
4914
4915         * mktime.c (leapyear): Arg is long int, not int.
4916
4917 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4918
4919         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4920
4921 2004-10-12  Simon Josefsson  <jas@extundo.com>
4922
4923         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4924         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4925         to real functions.
4926
4927 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4928
4929         * vsnprintf.h: New file.
4930         * vsnprintf.c: New file.
4931
4932 2004-10-07  Bruno Haible  <bruno@clisp.org>
4933
4934         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4935         into the provided buffer.
4936
4937 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4938
4939         * diacrit.c, diacrit.h: Add GPL notice.
4940
4941         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4942         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4943         * logl.c (logl): Keep the code as similar to glibc as possible.
4944         This avoids a potential constant-folding bug.
4945
4946 2004-10-05  Bruno Haible  <bruno@clisp.org>
4947
4948         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4949
4950 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4951
4952         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4953         * xmalloc.c (xmemdup): Likewise.
4954         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4955         XFREE): Remove these long-obsolescent macros.
4956         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4957         * xstrdup.c: Remove.
4958
4959         * regex.c (re_comp): Cast gettext return value to char *,
4960         Problem reported by Martin Neitzel via Mark D. Baushke.
4961
4962 2004-10-04  Simon Josefsson  <jas@extundo.com>
4963
4964         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4965         '#ifdef USE_UNLOCKED_IO'.
4966
4967 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4968
4969         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4970         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4971         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4972         regex.c, sha1.c, version-etc.c, yesno.c:
4973         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4974         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4975         the includer's responsibility.
4976
4977         Sync from coreutils.
4978
4979         * modechange.c (mode_compile): Don't decrement a pointer that
4980         points to the start of a string, as the C Standard says the
4981         resulting behavior is undefined.
4982
4983         * backupfile.h (enum backuptype): Rename none -> no_backups,
4984         simple -> simple_backups, numbered_existing ->
4985         numbered_existing_backups, numbered -> numbered_backups
4986         to avoid shadowing problems.  All uses changed.
4987         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4988         * backupfile.c (check_extension, numbered_backup):
4989         Rename locals to avoid shadowing 'basename'.
4990         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4991         once.
4992
4993         * .cppi-disable: Add getopt_.h, getopt_int.h.
4994         * .cvsignore: Add getopt.h.
4995
4996 2004-10-04  Simon Josefsson  <jas@extundo.com>
4997
4998         * memmem.h: New file.
4999         * memmem.c: New file, taken from glibc.
5000
5001 2004-10-02  Jim Meyering  <jim@meyering.net>
5002
5003         * dirfd.h, getpagesize.h: Add copyright notice.
5004
5005 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5006
5007         * snprintf.c: Remove comments as to why each header is needed.
5008
5009 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5010
5011         * strsep.h: New file.
5012         * strsep.c: New file.
5013
5014 2004-10-01  Simon Josefsson  <jas@extundo.com>
5015
5016         * snprintf.c (snprintf): Handle size==0.
5017
5018 2004-10-01  Simon Josefsson  <jas@extundo.com>
5019             Bruno Haible  <bruno@clisp.org>
5020
5021         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5022         (snprintf): Declare 'args'.
5023
5024 2004-09-30  Simon Josefsson  <jas@extundo.com>
5025
5026         * snprintf.h, snprintf.c: New files.
5027
5028 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5029
5030         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5031         (hol_entry_help): Never translate an empty string.
5032         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5033         * argp.h (OPTION_NO_TRANS): New option.
5034
5035 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5036
5037         * xvasprintf.c: Include xalloc.h.
5038         (xvasprintf): Use xalloc_die, not xmalloc_die.
5039
5040 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5041
5042         * dummy.c: Change copyright notice to FSF, and license to GPL.
5043
5044 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5045
5046         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5047         Problem reported by Bruno Haible in:
5048         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5049
5050 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5051
5052         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5053         in case some system header has #define'd it.  Problem reported by
5054         Soeren D. Schulze in
5055         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5056
5057 2004-09-08  Bruno Haible  <bruno@clisp.org>
5058
5059         * stdint_.h: New file, taken from GNU clisp.
5060
5061 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5062
5063         * xvasprintf.h: New file.
5064         * xvasprintf.c: New file.
5065         * xasprintf.c: New file.
5066
5067 2004-09-08  Bruno Haible  <bruno@clisp.org>
5068
5069         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5070         is > INT_MAX.
5071         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5072
5073 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5074
5075         Import from coreutils.
5076         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5077         strings on unbounded length.  alloca's performance benefits aren't
5078         that important here.
5079         (V_STRDUP): Remove.
5080         (parse_with_separator): New function, with most of the internals
5081         of the old parse_user_spec.  Allow user to omit both user and group,
5082         for compatibility with FreeBSD.
5083         Clone only the user name, not the entire spec.
5084         Do not set *uid, *gid unless entirely successful.
5085         Avoid memory leak in some failing cases.
5086         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5087         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5088         (parse_user_spec): Rewrite to use parse_with_separator.
5089
5090 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5091
5092         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5093         its complicated substitute.
5094         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5095         and program_invocation_name.
5096         (__argp_basename) [!_LIBC]: Remove; the only use was
5097         replaced by its body.
5098         (__argp_short_program_name): Change condition from
5099         !defined __argp_short_program_name to
5100         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5101         to match argp-namefrob.h.
5102         (__argp_failure): Don't assume strerror_r returns char *.
5103         * argp-parse.c (N_): Define unconditionally.
5104         (argp_default_options): Fill out initializers with 0 to avoid
5105         gcc warnings.
5106
5107 2004-08-12  Simon Josefsson  <jas@extundo.com>
5108
5109         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5110         * getopt_.h: Renamed from getopt.h.
5111
5112 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5113
5114         Merge from coreutils.
5115
5116         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5117         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5118         for Reliant Unix 5.43.
5119
5120         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5121         (union fooround): Use uintmax_t, not long int.
5122         The rest is a merge from libc:
5123         [defined _LIBC]: Include <shlib-compat.h>.
5124         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5125
5126         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5127
5128         * strverscmp.c: Convert to UTF-8.
5129
5130 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5131
5132         * obstack.h (obstack_empty_p):
5133         Don't assume that chunk->contents is suitably aligned.
5134         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5135         Likewise. Problem reported by Benno in
5136         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5137
5138         * chown.c (rpl_chown): Work even if the file is writeable but not
5139         readable.  This could be improved further but it'd take some work.
5140
5141 2004-08-08  Simon Josefsson  <jas@extundo.com>
5142
5143         * xgethostname.c: Don't include error.h (not used).
5144
5145         * getpass.h: Add.
5146         * getpass.c: Include getpass.h first.
5147
5148 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5149
5150         * xalloc-die.c: New files.
5151         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5152         All uses removed.
5153         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5154         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5155         (_, N_, xalloc_die): Move to xalloc-die.c.
5156         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5157         so that we needn't mess with xalloc_msg_memory_exhausted.
5158
5159         * sha1.h: Renamed from sha.h.
5160         (SHA1_H): Renamed from _SHA_H.
5161         (sha1_ctx): Renamed from sha_ctx.
5162         (sha1_init_ctx): Renamed from sha_init_ctx.
5163         (sha1_process_block): Renamed from sha_process_block.
5164         (sha1_process_bytes): Renamed from sha_process_bytes.
5165         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5166         (sha1_read_ctx): Renamed from sha_read_ctx.
5167         (sha1_stream): Renamed from sha_stream.
5168         (sha1_buffer): Renamed from sha_buffer.
5169         * sha1.c: Likewise; renamed from sha.c.
5170         Do not include <sys/types.h>.
5171         Include <stddef.h> rather than <stdlib.h>.
5172
5173 2004-08-08  Bruno Haible  <bruno@clisp.org>
5174
5175         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5176         FILESYSTEM_PREFIX_LEN.
5177         * progreloc.c: Likewise.
5178         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5179
5180 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5181
5182         Merge from tar.
5183         * argp-help.c (make_hol, hol_append): Don't assume that
5184         SIZE_MAX is a valid preprocessor constant.
5185         (__argp_basename): Change from "#ifndef _LIBC"
5186         to "#ifndef __argp_short_program_name", so that
5187         we don't compile these functions for tar.
5188
5189         More merges from coreutils.
5190         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5191         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5192         yesno.h: New files.
5193         * addext.c: Remove; no longer needed.
5194         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5195         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5196         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5197         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5198         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5199         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5200         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5201         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5202         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5203         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5204         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5205         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5206         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5207         Import changes from coreutils.
5208
5209 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5210
5211         Merge from coreutils.
5212
5213         * .gdb-history: Remove; this doesn't belong here.
5214
5215         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5216         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5217         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5218
5219         * dirname.h: Include <stdbool.h>.
5220         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5221         for consistency with POSIX terminology.  All uses changed.
5222         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5223         (strip_trailing_slashes): Use bool for booleans.
5224         * stripslash.c (strip_trailing_slashes): Likewise.
5225
5226         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5227         sometimes returns a positive errno value even when it succeeds.
5228         (print_errno_message) [!LIBC]: Fall back on strerror if
5229         __strerror_r fails.
5230
5231         * path-concat.c (mempcpy): Don't define if a system header defines it.
5232         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5233         (longest_relative_suffix): New function.
5234         (path_concat): Use it.  Assume first argument is not NULL.
5235         Port to DOS.  Omit redundant separators.
5236         Report an error instead of returning NULL.
5237         Use mempcpy instead of memcpy.
5238         (xpath_concat): Remove: not declared or used.
5239
5240         * same.h: Include <stdbool.h>
5241         (same_name): Return bool, not int.
5242         * same.c (same_name): Likewise.
5243         (errno): Don't declare; we assume C89 or better now.
5244
5245         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5246         if not already defined.
5247
5248         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5249         * dup-safer.c (errno): Likewise.
5250
5251 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5252
5253         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5254         working.
5255
5256 2004-08-03  Simon Josefsson  <jas@extundo.com>
5257
5258         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5259         * progname.h: Don't include stdbool.h.
5260
5261 2004-08-02  Simon Josefsson  <jas@extundo.com>
5262
5263         * getsubopt.h: New file, with comments from Bruno Haible.
5264         * getsubopt.c: New file, from glibc, but slightly modified based on
5265         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5266
5267 2004-08-01  Simon Josefsson  <jas@extundo.com>
5268
5269         * xgetdomainname.c: Include stdlib.h, for free().
5270
5271 2004-07-16  Simon Josefsson  <jas@extundo.com>
5272
5273         * dummy.c: New file.
5274
5275 2004-07-16  Bruno Haible  <bruno@clisp.org>
5276
5277         * backupfile.h: Add extern "C" for C++.
5278         * closeout.h: Likewise.
5279         * copy-file.h: Likewise.
5280         * findprog.h: Likewise.
5281         * full-write.h: Likewise.
5282         * pathname.h: Likewise.
5283         * progname.h: Likewise.
5284         * stpcpy.h: Likewise.
5285         * stpncpy.h: Likewise.
5286         * strcase.h: Likewise.
5287         * strstr.h: Likewise.
5288         * xalloc.h: Likewise.
5289
5290         * mbswidth.h: Add extern "C" for C++.
5291         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5292
5293 2004-07-09  Simon Josefsson  <jas@extundo.com>
5294
5295         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5296         failed without this.)
5297
5298 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5299
5300         * fchown-stub.c: New file.
5301
5302 2004-06-24  Jim Meyering  <jim@meyering.net>
5303
5304         * obstack.h (obstack_base): Cast to (void *), per documentation.
5305
5306 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5307
5308         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5309
5310 2004-06-01  Jim Meyering  <jim@meyering.net>
5311
5312         * calloc.c: New file.
5313
5314 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5315
5316         * getdate.y (yylex): Allow space between sign and number.
5317         Problem reported by Dan Jacobson.
5318
5319 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5320         and  Jim Meyering  <jim@meyering.net>
5321
5322         Merge from coreutils CVS.
5323
5324         * stat-macros.h: New file, with contents from file-type.h
5325         and coreutils' system.h.
5326         * file-type.c: Include "stat-macros.h".
5327         * file-type.h (file_type): Move all macro definitions to new file,
5328         stat-macros.h.
5329
5330         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5331         Wrap old code with this conditional.
5332         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5333         function that does not dereference symlinks.
5334         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5335
5336         * xreadlink.c: Include xreadlink.h first, to catch .h file
5337         dependency problems.
5338         (xreadlink): Accept new arg SIZE, for efficiency.
5339         All decls and uses changed.
5340         * xreadlink.h: Include <stddef.h>, for size_t.
5341
5342         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5343         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5344
5345         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5346
5347 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5348
5349         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5350         macros to be defined.
5351         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5352         the allocator returns NULL because the requested size is zero.
5353
5354 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5355
5356         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5357         var.  Add comment explaining why libc still defines it.  This
5358         merges the following patch from glibc:
5359         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5360
5361 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5362
5363         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5364         present in glibc since revision 1.1 of this file.
5365         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5366         obstack_alignment_mask, obstack_alloc, obstack_base,
5367         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5368         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5369         obstack_grow0, obstack_init, obstack_int_grow,
5370         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5371         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5372         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5373         nonexistent functions.
5374
5375 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5376             Paul Eggert  <eggert@cs.ucla.edu>
5377
5378         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5379
5380 2004-05-14  Bruno Haible  <bruno@clisp.org>
5381
5382         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5383         that consists of a '.' followed by an empty digit string.
5384         Patch by Tor Lillqvist <tml@iki.fi>.
5385
5386 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5387
5388         Port obstack to the AS/400, where pointers are 16 bytes wide and
5389         you cannot cast an integer to a valid pointer.  This patch is
5390         currently waiting to be integrated into glibc; see
5391         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5392
5393         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5394         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5395         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5396         (struct obstack): temp member is now a union of a pointer and
5397         an integer, instead of an integer.  All integer uses changed.
5398         This does not affect the physical layout of struct obstack,
5399         except on hosts (like the AS/400) where the size or alignment of
5400         void * is greater than that of ptrdiff_t.
5401         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5402         __STDC__)]: Store temporary in pointer member of union, not
5403         integer member.
5404         * obstack.c: Include <stddef.h>, for offsetof.
5405         (struct fooalign): Remove; it doesn't need a name.
5406         (union fooround): Change double to long double, and add void *.
5407         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5408         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5409         not a macro.  Hence the values are always int; so remove all
5410         casts-to-int in uses.
5411
5412 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5413             Derek Price  <derek@ximbiot.com>
5414
5415         * alloca.c: Include <alloca.h>, to get our interface.
5416         * alloca_.h: Use __alloca on AIX, so that we don't have to
5417         include <alloca.h> first.  Use C89 prototype for alloca; this
5418         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5419         Use #elif for simplicity, since we can assume C89 now.
5420         Don't try to source the system alloca.h since it will not be found
5421         and to prevent recursively including its replacement.
5422         * fnmatch.c: Include <alloca.h> instead of opencoding.
5423         * regex.c: Likewise.
5424
5425 2004-05-16  Derek Price  <derek@ximbiot.com>
5426             Paul Eggert  <eggert@cs.ucla.edu>
5427
5428         getline cleanup.  This changes the getndelim2 API: both order of
5429         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5430         no delimiter).
5431
5432         * getline.c: Don't include stddef.h or stdio.h, since our
5433         interface does that.
5434         (getline): Always use getdelim, so that we don't have two
5435         copies of this code.
5436         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5437         if available.
5438         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5439         (GETNDELIM2_MAXIMUM): New macro.
5440         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5441         instead of the old practice of delim2==0.  All callers changed.
5442         Return -1 on overflow, instead of returning junk.
5443         Do not set *linesize unless allocation succeeds.
5444         * getndelim2.h: Do not include stddef.h; no longer needed, now
5445         that we include sys/types.h.
5446         * getnline.h: Likewise.
5447         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5448         (getndelim2): Reorder arguments.
5449         * getnline.c (getnline, getndelim):
5450         Don't discard the NMAX argument.
5451         (getnline): Invoke getndelim, to avoid code duplication.
5452         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5453         of (size_t) -1 by callers of the getnline family.
5454
5455 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5456
5457         * nanosleep.c (suspended): Change its type from int to
5458         sig_atomic_t volatile.
5459         (first_call): Make it private to rpl_nanosleep, and have it
5460         be zero initially as that's a bit faster.
5461         (my_usleep): Round up fractional times instead of truncating them,
5462         as this is the usual meaning for 'sleep'.
5463
5464         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5465         doesn't work.
5466         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5467         (ENOSYS): Define if not defined.
5468         (settime): Fall back on stime if it exists and settimeofday fails.
5469         But don't bother with fallbacks if a method fails with errno == EPERM.
5470
5471 2004-05-11  Jim Meyering  <jim@meyering.net>
5472
5473         Prior to this change, the save_cwd caller required read access to the
5474         current directory on most systems (ones with the fchdir function).
5475
5476         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5477         fails, try write-only, and finally, resort to using xgetcwd.
5478
5479 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5480
5481         * obstack.c, obstack.h: Import changes from libc.
5482
5483 2004-04-28  Bruno Haible  <bruno@clisp.org>
5484
5485         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5486         implicitly appends .exe to executables.
5487         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5488         accepts Windows pathnames.
5489         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5490         Cygwin like Windows, since it now accepts Windows pathnames.
5491         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5492         Cygwin like Windows, since it now accepts Windows pathnames.
5493         Reported by Derek Robert Price <derek@ximbiot.com>.
5494
5495 2004-04-20  Jim Meyering  <jim@meyering.net>
5496
5497         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5498
5499 2004-04-20  Jim Meyering  <jim@meyering.net>
5500             Bruno Haible  <bruno@clisp.org>
5501
5502         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5503         memory when realloc fails.
5504
5505 2004-04-18  Jim Meyering  <jim@meyering.net>
5506
5507         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5508         don't leak memory and do call END_UTMP_ENT.
5509
5510 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5511
5512         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5513         (CHAR_BIT): Remove, since we assume C89.
5514         Include <stdint.h> if available, as per current Autoconf CVS advice.
5515
5516 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5517
5518         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5519         not bool, to be more consistent with Unix conventions.
5520         Suggested by Bruno Haible.
5521
5522         Merge from coreutils.
5523
5524         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5525         New files.
5526
5527         * getdate.h: Include stdbool.h, and timespec.h instead of
5528         the usual <time.h> dance.
5529         (get_date): Change signature to support fractional time stamps.
5530         All callers changed.
5531         * getdate.y: Include "getdate.h" first, as we can now
5532         assume C89 and don't need to worry about 'const'.
5533         Similarly, include "unlocked-io.h" near start, not in middle.
5534         Include <limits.h>.
5535         (textint.value): Use long int rather than int.
5536         (textint.digits): Use size_t rather than int.
5537         (BILLION, LOG10_BILLION): New constants.
5538         (parser_control): New member rel_ns.  Members day_ordinal,
5539         time_zone, month, day, hour, minutes, rel_year, rel_month,
5540         rel_day, rel_hour, rel_minutes, rel_seconds
5541         are now long int, not int.  Member seconds is now struct timespec,
5542         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5543         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5544         not int.
5545         (%union.intval): Now long int, not int.
5546         New member timespec.
5547         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5548         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5549         (spec): Now is a timespec or an item list.
5550         (timespec, items): New nonterminals.
5551         (time, rel, relunit, number, get_date):
5552         Add support for fractional seconds.
5553         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5554         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5555         (to_hour): First arg is now long int, not int.
5556         (to_year): Returns long int, not int.
5557         Don't treat year -70 like 70.
5558         (tm_diff): Returns long int, not int.
5559         (lookup_word): Use bool instead of int when appropriate.
5560         (yylex): Use size_t for count, not int.
5561         Detect overflow when parsing large integer constants.
5562         Add support for fractions.
5563         (get_date): Make pointers 'const' if possible.
5564         Use more-portable code to detect integer overflow.
5565         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5566         Don't use ctime; it's not reliable if the year has >4 digits.
5567
5568         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5569         This is for compatibility with BSD.
5570
5571         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5572         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5573         From coreutils' system.h.
5574
5575         * userspec.c: Don't include "posixver.h".
5576         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5577         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5578         compatible extension.  Simplify code by removing a boolean int
5579         that was always nonzero if a string was nonnull.
5580
5581 2004-03-30  Jim Meyering  <jim@meyering.net>
5582
5583         Merge from coreutils.
5584
5585         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5586
5587         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5588         an empty input stream.
5589
5590         * readtokens.c: Include <stdbool.h>.
5591         (readtoken): Use `size_t' rather than int/long.
5592         All callers adjusted.
5593         Use `bool' rather than `int' where appropriate.
5594         Use memset rather than an explicit loop.
5595         Use x2nrealloc rather than xrealloc.
5596         Allow the use of `\0' as a delimiter.
5597         (readtokens): Likewise.
5598         * readtokens.h (readtoken, readtokens): Update prototypes.
5599
5600 2004-03-30  Bruno Haible  <bruno@clisp.org>
5601
5602         * getloadavg.c (getloadavg): Don't assume setlocale returns
5603         nonnull.
5604
5605 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5606
5607         Merge changes to getloadavg.c from coreutils and Emacs.
5608
5609         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5610         Define to an expression, not to the empty string.
5611         Include cloexec.h and xalloc.h.
5612         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5613         Use set_cloexec_flag rather than rolling our own.
5614         * cloexec.c, cloexec.h: New files.
5615
5616 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5617
5618         * getopt.h: Sync with libc CVS.
5619
5620 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5621             Bruno Haible  <bruno@clisp.org>
5622
5623         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5624         not on all platforms that have <wchar.h>.
5625         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5626
5627 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5628
5629         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5630         Sync with libc CVS.
5631         * getopt_int.h: New file, also synced from libc.
5632
5633 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5634
5635         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5636         '#if' expressions.  Unlike the code it replaces, it does not
5637         depend on (defined _SC_PAGESIZE).  However, it does depend on
5638         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5639         first reported by Jason Andrade in
5640         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5641
5642 2004-01-18  Simon Josefsson  <jas@extundo.com>
5643
5644         * strdup.h: New file.
5645         * strdup.c: Include it.
5646         * path-concat.c: Include strdup.h. Drop strdup declaration.
5647         * userspec.c: Include strdup.h. Drop strdup declaration.
5648
5649 2004-02-06  Karl Berry  <karl@gnu.org>
5650
5651         * config.charset: update from gettext 0.14.1.
5652
5653 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5654
5655         Add comments and code, prompted by suggestions from Bruno Haible
5656         for sh-quote.
5657         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5658         describing the enum quoting_style values.
5659         * quotearg.c (quotearg_alloc): New function.
5660         (quotearg_buffer_restyled): Treat lone { and } as special.
5661         Treat = as special.  Work around bug with older shells
5662         that "see" a '\' that is really the 2nd byte of a multibyte char.
5663         Quote empty string with shell_quoting_style.
5664
5665 2004-02-03  Bruno Haible  <bruno@clisp.org>
5666
5667         * pipe.h: New file, from GNU gettext.
5668         * pipe.c: New file, from GNU gettext.
5669
5670 2004-01-27  Bruno Haible  <bruno@clisp.org>
5671
5672         * execute.h: New file, from GNU gettext.
5673         * execute.c: New file, from GNU gettext.
5674         * w32spawn.h: New file, from GNU gettext.
5675
5676 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5677
5678         Exit-status fix from coreutils.
5679
5680         Use exit_failure consistently in place of EXIT_FAILURE,
5681         so that program exit statuses are consistent on failure.
5682
5683         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5684         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5685         * argmatch.h: Comment fix to match the above.
5686         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5687         Now a macro referring to exit_failure, instead of a separate
5688         variable.  Include "exitfail.h" to get it.
5689         * xstrtol.h: Include "exitfail.h".
5690         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5691
5692         * long-options.c (parse_long_options): Use prototype
5693         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5694         for clarity.
5695
5696 2004-01-21  Jim Meyering  <jim@meyering.net>
5697
5698         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5699         so as not to conflict with a different-sized __mktime_internal
5700         function in GNU libc.
5701         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5702         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5703
5704 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5705
5706         Merge from diffutils.
5707
5708         * file-type.c (file_type): Add typed memory objects.
5709         * file-type.h (S_TYPEISTMO): New macro.
5710
5711         * c-stack.h (c_stack_action): Remove argv argument.
5712         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5713         (die): Don't calculate message unless segv_action returns.
5714         (get_stack_location, min_address_from_argv, max_address_from_argv,
5715         volatile stack_base, volatile_stack_size): Remove.
5716         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5717         that every segmentation violation is a stack overflow.  (Ouch!)
5718         See Debian bug 136249 (still outstanding) for more info about why
5719         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5720
5721 2003-11-30  Bruno Haible  <bruno@clisp.org>
5722
5723         Safer stack allocation.
5724         * setenv.c: Include allocsa.h.
5725         (alloca): Remove fallback definition.
5726         (freea): Remove macro.
5727         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5728         instead of freea.
5729
5730 2003-10-17  Bruno Haible  <bruno@clisp.org>
5731
5732         * binary-io.h: Avoid warnings on Cygwin.
5733
5734 2003-12-28  Bruno Haible  <bruno@clisp.org>
5735
5736         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5737         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5738
5739 2003-11-28  Bruno Haible  <bruno@clisp.org>
5740
5741         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5742
5743 2003-11-27  Bruno Haible  <bruno@clisp.org>
5744
5745         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5746
5747 2003-11-17  Bruno Haible  <bruno@clisp.org>
5748
5749         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5750
5751 2003-11-24  Bruno Haible  <bruno@clisp.org>
5752
5753         * xallocsa.h: New file, from GNU gettext.
5754         * xallocsa.c: New file, from GNU gettext.
5755
5756 2003-11-24  Bruno Haible  <bruno@clisp.org>
5757
5758         * allocsa.h: New file, from GNU gettext.
5759         * allocsa.c: New file, from GNU gettext.
5760
5761 2003-11-24  Bruno Haible  <bruno@clisp.org>
5762
5763         * eealloc.h: New file.
5764
5765 2004-01-15  Jim Meyering  <jim@meyering.net>
5766
5767         Merge from coreutils.
5768
5769         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5770         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5771         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5772
5773         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5774         optional configure-time default.
5775
5776         * version-etc.c (version_etc_copyright): Update copyright date.
5777
5778         * xreadlink.c (xreadlink): Correct outdated comment.
5779
5780 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5781
5782         Merge from coreutils.
5783
5784         * posixver.c: Include posixver.h.
5785
5786         * same.c: Include <stdbool.h>, <limits.h>.
5787         (_POSIX_NAME_MAX): Define if not defined.
5788         (MIN): New macro.
5789         (same_name): If file names are silently truncated, report
5790         that the file names are the same if they are the same after
5791         the silent truncation.
5792
5793         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5794         conversion function.
5795         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5796         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5797         longer needed.
5798
5799 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5800
5801         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5802         with like-named macro in fnmatch.c.
5803         (EXT): Use an internal constant instead.
5804
5805         Merge fnmatch patches from glibc.
5806         * fnmatch.c (mbsinit): Remove define.
5807         Add libc_hidden_ver (__fnmatch, fnmatch).
5808         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5809         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5810
5811 2003-12-14  Karl Berry  <karl@gnu.org>
5812
5813         * config.charset: update from gettext-runtime.
5814
5815 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5816
5817         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5818         Bug reported by Alfred M. Szmidt.
5819
5820 2003-11-29  Karl Berry  <karl@gnu.org>
5821
5822         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5823
5824 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5825             Bruno Haible  <bruno@clisp.org>
5826
5827         * printf-parse.h: Don't include sys/types.h.
5828         (ARG_NONE): New macro.
5829         (char_directive): Change type of *arg_index fields to size_t.
5830         * printf-parse.c: Don't include sys/types.h.
5831         (SSIZE_MAX): Remove macro.
5832         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5833         Remove unnecessary overflow check.
5834         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5835         fields.
5836
5837 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5838
5839         * alloca.c: Remove dependency on xalloc module.
5840         (xalloc_die): Remove.
5841         (memory_full) [!defined emacs]: New macro.
5842         [!defined emacs]: Don't include xalloc.h.
5843         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5844         address arithmetic overflows.  Change datatypes a bit to avoid
5845         unnecessary casts.
5846
5847 2003-11-22  Jim Meyering  <jim@meyering.net>
5848
5849         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5850
5851 2003-11-17  Bruno Haible  <bruno@clisp.org>
5852
5853         * vasnprintf.c (alloca): Remove fallback definition.
5854         (freea): Remove definition.
5855         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5856         Reported by Paul Eggert.
5857
5858 2003-11-17  Jim Meyering  <jim@meyering.net>
5859
5860         On systems without utime and without a utimes function capable of
5861         dealing with a NULL struct utimbuf* argument, this utime replacement
5862         could -- in unusual circumstances -- leak a file descriptor.
5863         * utime.c: Include <unistd.h> and <errno.h>.
5864         (utime_null): Be sure to close `fd' and to preserve errno.
5865         Reported by Geoff Collyer via Arnold Robbins.
5866
5867 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5868             Bruno Haible  <bruno@clisp.org>
5869
5870         Protect against address arithmetic overflow.
5871         * printf-args.h: Include stddef.h.
5872         (arguments): Change type of field 'count' to size_t.
5873         * printf-args.c (printf_fetchargs): Use size_t instead of
5874         'unsigned int' where appropriate.
5875         * printf-parse.h: Include sys/types.h.
5876         (char_directive): Change type of *arg_index fields to ssize_t.
5877         (char_directives): Change type of fields 'count', max_*_length to
5878         size_t.
5879         * printf-parse.c: Include sys/types.h and xsize.h.
5880         (SSIZE_MAX): Define fallback value.
5881         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5882         instead of 'int' where appropriate. Check a_allocated, d_allocated
5883         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5884         * vasnprintf.c: Include xsize.h.
5885         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5886         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5887         overflow. Avoid wraparound when converting a width or precision from
5888         decimal to binary.
5889
5890 2003-11-16  Bruno Haible  <bruno@clisp.org>
5891
5892         Update from GNU gettext.
5893         * printf-parse.c: Generalize to it can be compiled for wide strings.
5894         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5895         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5896         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5897         SNPRINTF): New macros.
5898         Don't include <alloca.h> if the file is used inside libintl.
5899         (local_wcslen): New function, for Solaris 2.5.1.
5900         (VASNPRINTF): Use it instead of wcslen.
5901
5902 2003-11-16  Bruno Haible  <bruno@clisp.org>
5903
5904         * xsize.h (xmax): New function.
5905         (xsum, xsum3, xsum4): Declare as "pure" functions.
5906
5907 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5908
5909         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5910         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5911         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5912         heuristic is just as accurate as far as we know, and it removes a
5913         dependency on size_max.m4 and ptrdiff_max.m4.
5914
5915 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5916
5917         * xstrtol.c (__xstrtol): Remove "break" immediately after
5918         "return", to pacify some unknown compiler.  Problem reported
5919         by Joerg Schilling.
5920
5921 2003-11-11  Bruno Haible  <bruno@clisp.org>
5922
5923         * xsize.h (SIZE_MAX): Remove fallback definition.
5924         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5925         defined.
5926
5927 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5928
5929         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5930         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5931         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5932         From Bruno Haible.
5933         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5934         not (size_t) -1, since it's defined here.
5935
5936 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5937
5938         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5939         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5940         Reject sizes of exactly SIZE_MAX bytes.
5941         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5942         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5943
5944 2003-11-05  Bruno Haible  <bruno@clisp.org>
5945
5946         * xsize.h: Include limits.h, to avoid a possible collision with
5947         SIZE_MAX defined in <limits.h> on Solaris.
5948
5949 2003-11-04  Bruno Haible  <bruno@clisp.org>
5950
5951         * xsize.h: New file.
5952         * linebreak.c: Include xsize.h.
5953         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5954         argument for overflow.
5955         Suggested by Paul Eggert.
5956
5957 2003-10-31  Bruno Haible  <bruno@clisp.org>
5958
5959         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5960         to avoid (extremely rare) race condition.
5961         Suggested by Paul Eggert.
5962
5963 2003-11-03  Jim Meyering  <jim@meyering.net>
5964
5965         * userspec.c: Include "userspec.h".
5966         * userspec.h: New file.
5967
5968 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5969
5970         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5971         * mountlist.c (SIZE_MAX): Define if not defined already.
5972         (read_filesystem_list): Set and use me_type_malloced.
5973         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5974         whatever the type happens to be), for brevity and consistency.
5975         Check for size calculation overflow on Alphas running OSF/1.
5976
5977 2003-10-31  Jim Meyering  <jim@meyering.net>
5978
5979         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5980
5981         * linebuffer.c: Include <string.h> for declaration of memset.
5982
5983 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5984             Bruno Haible  <bruno@clisp.org>
5985
5986         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5987         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5988
5989 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5990
5991         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5992         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5993         no longer needed.
5994         * quotearg.c (quotearg_n_options): Use it.
5995         * group-member.c: Include <stdbool.h>.
5996         (free_group_info): Arg is now const *; don't free arg.
5997         (get_group_info): Now returns bool and accepts struct group_info *,
5998         rather than returning a malloc'ed struct group_info *.
5999         All uses changed.  Check for overflow in internal size calculation.
6000
6001         * getusershell.c (readname): Simplify the code by using x2nrealloc
6002         rather than xmalloc/xrealloc.
6003         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6004         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6005         conformance bug: the old code used a pointer after freeing the
6006         storage that it addressed.
6007         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6008         rather than doing it by hand.
6009         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6010         the buffer preserved.  Use free and xmalloc instead.
6011         * quotearg.c (quotearg_n_options): Likewise.
6012         Use a simpler test for size overflow.  Don't use xalloc_oversized
6013         because unsigned int might be wider than size_t (!); this suggests
6014         that we should switch from unsigned int to size_t for slot numbers.
6015
6016 2003-10-27  Bruno Haible  <bruno@clisp.org>
6017
6018         * stdbool_.h: Better support for BeOS.
6019
6020 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6021
6022         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6023         to allocate the returned structure.  Do not allocate a subarray,
6024         as x2nrealloc will do that.
6025         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6026         instead of xnrealloc.
6027         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6028
6029 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6030
6031         * xalloc.h (xalloc_oversized): New static inline function, for
6032         callers that want to do their own size-overflow checking.  Include
6033         <stdbool.h>, since xalloc_oversized returns bool.
6034         * xalloc.c (array_size_overflow): Remove.  All callers changed
6035         to use xalloc_oversized.
6036
6037         Add two functions x2realloc, x2nrealloc, for programs that grow
6038         arrays dynamically by doubling their sizes.
6039         * xalloc.h (x2realloc, x2nrealloc): New decls.
6040         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6041         New functions.
6042
6043         Port to C99 semantics for 'inline' of external functions.
6044         Bug reported by Bruno Haible.
6045         * xmalloc.c (xnmalloc_inline): New static inline function,
6046         with the old contents of xnmalloc.
6047         (xnmalloc, xmalloc): Use it.
6048         (xnrealloc_inline): New static inline function,
6049         with the old contents of xnrealloc.
6050         (xnrealloc, xrealloc): Use it.
6051
6052         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6053
6054 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6055
6056         Fix several address-calculation bugs in the hash modules,
6057         plus some minor code cleanup.
6058
6059         * hash.h: Include <stdbool.h>, for bool.
6060         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6061         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6062         hash_get_n_entries, hash_get_max_bucket_length,
6063         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6064         hash_rehash): Use size_t rather than unsigned.
6065         * hash.c (struct hash_table, hash_get_n_buckets,
6066         hash_get_n_buckets_used, hash_get_n_entries,
6067         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6068         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6069         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6070         Likewise.
6071         (SIZE_MAX): Define if not defined.
6072         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6073         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6074         hash_print):
6075         Use const * when possible.
6076         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6077         (check_tuning): Fix bug: if tuning parameters were very close to
6078         0 or 1, rounding errors could have caused subscript violations.
6079         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6080         (hash_initialize): Add 'fail:' label
6081         to free table and return NULL, and use it to simplify code.
6082         Use calloc rather than clearing the storage ourself.
6083         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6084         buffer size calculations.
6085         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6086         Include <stddef.h>, for size_t.
6087         * hash-pjw.c (hash_pjw): Likewise.
6088         Switch to method described by Bruno Haible.
6089         Include <limits.h>, for CHAR_BIT.
6090         (SIZE_BITS): New macro.
6091
6092 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6093
6094         * getndelim2.c (getndelim2): When size calculation overflows,
6095         ceiling the allocation at NMAX bytes rather than silently
6096         discarding input bytes before NMAX is reached.  This makes
6097         a difference only if NMAX exceeds SIZE_MAX / 2.
6098
6099         * obstack.c: Merge from glibc.
6100         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6101         Add libc_hidden_def (_obstack_newchunk).
6102         (_obstack_free) [! defined _LIBC]: Remove.
6103         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6104         a clone of the function body.
6105         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6106         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6107
6108         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6109         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6110         arg to memcpy.
6111
6112         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6113         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6114         Don't use lvalue casts, as GCC plans to remove support for them
6115         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6116         was also present in the non-GCC version, indicating that this
6117         code had always been buggy and had never been widely used.
6118         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6119         Use the fast variant of each macro, rather than copying the
6120         definiens of the fast variant; that way, we'll be more likely to
6121         catch future bugs in the fast variants.
6122
6123 2003-10-20  Bruno Haible  <bruno@clisp.org>
6124
6125         * wait-process.h: New file, from GNU gettext.
6126         * wait-process.c: New file, from GNU gettext.
6127
6128 2003-10-19  Jim Meyering  <jim@meyering.net>
6129
6130         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6131
6132 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6133
6134         * getgroups.c: Include <errno.h>, <stdlib.h>.
6135         (getgroups): First arg is int, not size_t.
6136         Don't let 'free' mangle errno.
6137
6138 2003-10-16  Jim Meyering  <jim@meyering.net>
6139
6140         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6141
6142 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6143
6144         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6145         (SIZE_MAX): Remove.
6146         (new_exclude, add_exclude_file): Initial size no longer needs to
6147         be a power of 2.
6148         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6149         our own address arithmetic overflow checking.
6150
6151         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6152         (fnmatch): Do not alloca more than 2000 wide characters;
6153         instead, use malloc for large buffers.
6154         Check for address arithmetic overflow, and return -1
6155         with errno set to ENOMEM in that case.
6156         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6157         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6158         instead, return -1.  Check for address arithmetic overflow.
6159
6160 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6161
6162         Handle invalid suffixes and overflow independently, so that
6163         callers can treat them independently as needed.  Fix some bugs in
6164         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6165         suffix for a human-readable blocksize.  The major caller-visible
6166         change is the addition of a new
6167         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6168         that both overflow and suffix chars were found.
6169
6170         * human.c (humblock): Don't check separately for invalid suffix
6171         char; that is xstrtoumax's job (now that its bug is fixed).
6172         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6173         INTMAX_MAX]: New macros.
6174         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6175         TYPE_MAXIMUM): New macros.
6176         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6177         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6178         if overflow occurs, as it's what __strtol does and it's more useful
6179         in practice.
6180         (__xstrtol): If __strtol reports some error other than ERANGE,
6181         reflect it to the caller as LONGINT_INVALID.  If it reports
6182         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6183         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6184         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6185         value.
6186         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6187         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6188         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6189         [defined UINTMAX_MAX]: New macros.
6190
6191 2003-10-14  Bruno Haible  <bruno@clisp.org>
6192
6193         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6194         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6195         Also use volatile where needed.
6196
6197 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6198
6199         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6200         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6201         and define in terms of the other primitives.
6202         * xmalloc.c: Include stdbool.h; do not include exit.h.
6203         (SIZE_MAX): Define if not already defined.
6204         (array_size_overflow): New function.
6205         (xalloc_die): Abort instead of exiting if 'error' returns.
6206         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6207         (xmalloc, xrealloc): Use them.
6208         (xcalloc): Check for address arithmetic overflow.
6209         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6210         a bit faster than strcpy.
6211
6212 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6213
6214         Merge getpass from libc, plus a few fixes.
6215
6216         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6217         Include <stdbool.h>.
6218         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6219         __fsetlocking to empty.
6220         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6221         do include <bits/libc-lock.h>.
6222         Do not include <fcntl.h>; not needed.
6223         [_LIBC]: Include <wchar.h>.
6224         (NOTCANCEL_MODE): New macro.
6225         (flockfile, funlockfile) [_LIBC]: New macros.
6226         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6227         [!_LIBC]: New macros.
6228         (call_fclose): New function.
6229         (getpass): Use it.  Save tty stream separately; this simplifies the
6230         code and makes it more reliable if stdin happens to equal stdout.
6231         Invoke __fsetlocking on tty.
6232         Handle thread cancellation if needed.
6233         Namespace cleanup (use __tcgetattr, __getline).
6234         Use bool for Booleans.
6235         [USE_IN_LIBIO]: Handle wide streams.
6236         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6237         stream might go where.
6238
6239         * unlocked-io.h: Include <stdio.h>, so that the caller
6240         doesn't have to include <stdio.h> before us.
6241         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6242         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6243         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6244         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6245         if not declared, so that we can use getpass.c code from libc without
6246         rewriting it.
6247         (flockfile, ftrylockfile, funlockfile): New macros.
6248
6249 2003-10-06  Bruno Haible  <bruno@clisp.org>
6250
6251         * version-etc-2.h: Remove file.
6252         * version-etc-2.c: Remove file.
6253
6254 2003-09-25  Jim Meyering  <jim@meyering.net>
6255             Bruno Haible  <bruno@clisp.org>
6256
6257         This lets translators provide better translations for the
6258         "Written by ..." part of --version output.
6259         * version-etc.h: Include stdarg.h.
6260         (version_etc_copyright): Declare as readonly.
6261         (version_etc): Make this function variadic with a NULL-terminated list
6262         of author name strings.
6263         (version_etc_va): New declaration.
6264         * version-etc.c: Include stdarg.h, stdlib.h.
6265         (version_etc_copyright): Declare as readonly.
6266         (version_etc_va): New function. Provide a different translatable string
6267         for each possible number of authors < 10. Abbreviate when there are 10
6268         authors or more.
6269         (version_etc): Make this function variadic. Call version_etc_va.
6270         Suggestion from Gary V. Vaughan.
6271
6272         * long-options.h (parse_long_options): Change prototype: the authors
6273         string is moved to the end and becomes variadic.
6274         * long-options.c: Include stdarg.h.
6275         (parse_long_options): Make this function variadic, too.
6276         Call version_etc_va, not version_etc.
6277
6278 2003-10-06  Bruno Haible  <bruno@clisp.org>
6279
6280         * fatal-signal.h: New file, from GNU gettext.
6281         * fatal-signal.c: New file, from GNU gettext.
6282
6283 2003-10-04  Karl Berry  <karl@gnu.org>
6284
6285         * argp*: update from libc.
6286
6287 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6288
6289         * getpass.c (getpass): Use a no-op fseek when switching from input to
6290         output mode on the same stream.
6291
6292 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6293
6294         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6295         Fix arg typo in previous patch.
6296
6297 2003-09-28  Jim Meyering  <jim@meyering.net>
6298
6299         * error.c: Correct cpp indentation.
6300
6301 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6302
6303         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6304         Omit the special code that used __typeof__, since we worry that
6305         it could be more trouble than it's worth.  See:
6306         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6307         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6308
6309         * free.c: New file.
6310
6311 2003-09-26  Jim Meyering  <jim@meyering.net>
6312
6313         * error.c (error_tail): Move some declarations
6314         into inner scope where the local variables are used.
6315
6316 2003-09-26  Bruno Haible  <bruno@clisp.org>
6317
6318         * stpncpy.h (gnu_stpncpy): New declaration.
6319         (stpncpy): Define as alias for gnu_stpncpy.
6320         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6321
6322 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6323
6324         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6325         (error_tail): Do not loop, reallocating temporary buffer, since
6326         the output cannot contain more wide characters than the input
6327         contains bytes, the size must be big enough already.  This avoids
6328         one potential size overflow calculation.  Check for size overflow
6329         when calculating temporary buffer size.  Free temporary buffer
6330         when done, if it was allocated with malloc; this plugs a memory
6331         leak.  Remove casts from void * to pointers, that are no longer
6332         needed now that we're assuming C89 or better.
6333
6334         Merge error changes from glibc.
6335
6336         * error.c, error.h: Update copyright notice header to match glibc.
6337         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6338         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6339         Disable cancellation while printing error.
6340         * error.h: Prepend __ to parameter names.
6341
6342 2003-09-25  Karl Berry  <karl@gnu.org>
6343
6344         * argp-fmtstream.c, argp-help.c: update from libc.
6345
6346 2003-09-25  Bruno Haible  <bruno@clisp.org>
6347
6348         * version-etc-2.h: New file, from version-etc.h with modifications.
6349         * version-etc-2.c: New file, from version-etc.c with modifications.
6350
6351 2003-09-25  Simon Josefsson  <jas@extundo.com>
6352
6353         * xgetdomainname.h: New file.
6354         * xgetdomainname.c: New file.
6355
6356 2003-09-25  Simon Josefsson  <jas@extundo.com>
6357             Bruno Haible  <bruno@clisp.org>
6358
6359         * getdomainname.h: New file.
6360         * getdomainname.c: New file.
6361
6362 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6363
6364         * linebuffer.c (freebuffer): Don't free the argument, just
6365         the buffer associated with the argument.  Bug reported by
6366         Simon Josefsson.
6367
6368 2003-09-19  Karl Berry  <karl@gnu.org>
6369
6370         * argp.h: update from libc.
6371
6372 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6373
6374         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6375         input error, instead of returning NULL the next time we are called
6376         (and therefore losing track of errno).
6377
6378 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6379
6380         * getndelim2.c (getndelim2): Don't trash errno when a read
6381         fails, so that the caller gets the proper errno.
6382
6383         * readutmp.c (read_utmp): Likewise.
6384         Check for fstat error.  Close stream and free storage
6385         when failing.
6386
6387 2003-09-14  Bruno Haible  <bruno@clisp.org>
6388
6389         * fwriteerror.h: New file.
6390         * fwriteerror.c: New file.
6391
6392 2003-09-14  Jim Meyering  <jim@meyering.net>
6393
6394         * getloadavg.c: Correct cpp indentation.
6395         * strdup.c: Likewise.
6396         * vasnprintf.c: Likewise.
6397
6398 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6399
6400         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6401         * obstack.c [!defined _LIBC]: Likewise.
6402         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6403         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6404         * exitfail.c: Don't include stdlib.h; no longer needed.
6405
6406         More changes to assume C89 or better.
6407
6408         * error.c (error_tail): Assume vprintf.
6409
6410         * argmatch.c (getenv): Remove decl.
6411         * progreloc.c (get_full_program_name): Define via prototype.
6412         * setenv.c (clearenv): Likewise.
6413         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6414         needed.
6415         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6416         (malloc, memcpy): Remove decls.
6417         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6418         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6419         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6420         (memcpy): Remove macro.
6421         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6422         (__P): Remove.  All uses removed.
6423         (PTR): Remove.  All uses changed to void *.
6424         (CHAR_BIT, NULL): Remove.
6425         (spaces, zeros, memset_space, memset_zero)
6426         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6427         Remove.
6428         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6429         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6430         Define with prototype.
6431         Remove now-unnecessary prototype decl.
6432         (extra_args_spec): Assume ANSI C.  All uses changed.
6433         (extra_args_spec_iso): Remove.
6434         (my_strftime, emacs_strftimeu): Define via prototype.
6435         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6436         unconditionally.
6437         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6438         * strtoimax.c: Include <stdlib.h> unconditionally.
6439         (strtoul, strtol): Remove decls.
6440         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6441         LONG_MAX): Remove.
6442         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6443         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6444         (LOCALE_PARAM_PROTO): New macro.
6445         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6446         (INTERNAL (strtol), strtol): Define with a prototype.
6447         (PARAMS): Remove.  All uses removed.
6448         * tempname.c: Include <string.h> unconditionally.
6449         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6450         * xgethostname.c (main): Define with a prototype.
6451         * xmalloc.c: Include "xalloc.h" first, to check interface.
6452         Include <stdlib.h> unconditionally.
6453         (calloc, malloc, realloc, free): Remove decls.
6454         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6455         Include <stdlib.h> unconditionally.  Sort include file names.
6456         (strtod): Remove.
6457         (xstrtod): Define with a prototype.
6458         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6459         (strtol, strtoul): Remove decls.
6460
6461 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6462
6463         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6464         Include <stdlib.h>, <string.h> unconditionally.
6465         Remove now-unnecessary cast to char *.
6466         * strnlen.c: Include <string.h> unconditionally.
6467         * yesno.c (yesno): Define with a prototype.
6468
6469 2003-09-10  Bruno Haible  <bruno@clisp.org>
6470
6471         * strcspn.c: Include <string.h> unconditionally.
6472         * strpbrk.c: Include <string.h> unconditionally.
6473         * strstr.c: Include <string.h> unconditionally.
6474         * unicodeio.c: Include <string.h> unconditionally.
6475         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6476         * unsetenv.c: Likewise.
6477         * xreadlink.c: Include <stdlib.h> unconditionally.
6478         * yesno.c: Include <stdlib.h> unconditionally.
6479         (rpmatch): Add prototype.
6480
6481 2003-09-10  Jim Meyering  <jim@meyering.net>
6482
6483         * error.c: Correct indentation of cpp directives.
6484
6485 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6486
6487         More K&R removal.
6488
6489         * acosl.c (main): Use a prototype.
6490         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6491         tanl.c: Likewise.
6492
6493         * getloadavg.c (getloadavg, main): Define via prototypes.
6494
6495         * getopt.h (struct option.name): Assume C89, and use 'const'.
6496         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6497         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6498         with a prototype.
6499         * getopt.c (const): Remove macro.
6500         Include <string.h> unconditionally.
6501         (my_index): Remove; all uses changed to strchr.
6502         (strlen): Remove decl.
6503         (exchange): Remove forward decl; no longer needed.
6504         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6505         Define with prototype.
6506         * getopt1.c (const): Remove macro.
6507         (getopt_long, getopt_long_only, main): Define with prototype.
6508
6509         * getugroups.c: Include <string.h> unconditionally.
6510
6511         * getusershell.c: Include <stdlib.h> unconditionally.
6512         (getusershell, setusershell, endusershell, readname, main):
6513         Define with prototypes.
6514
6515         * group-member.c: Include group-member.h first.
6516         Include <stdlib.h> unconditionally.
6517
6518         * hard-locale.c: Include hard-locale.h first.
6519         Include <stdlib.h>, <string.h> unconditionally.
6520
6521         * hash.c (free, malloc): Remove decls.
6522         Include <stdlib.h> unconditionally.
6523
6524         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6525         (getenv): Do not declare.
6526
6527         * idcache.c: Include <string.h> unconditionally.
6528
6529         * long-options.c: Include long-options.h first, to test interface.
6530         Include <stdlib.h> unconditionally.
6531
6532         * makepath.c: Include makepath.h first, to test interface.
6533         Include <stdlib.h> and <string.h> unconditionally.
6534
6535         * linebuffer.c: Include <stdlib.h>.
6536         (free): Remove decl.
6537
6538         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6539         rpl_malloc returns void *, not char *.
6540         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6541
6542         * md5.h: Include <limits.h> unconditionally.
6543         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6544         (__P): Remove; all uses removed.
6545         * md5.c: Include "md5.h" first.
6546         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6547         md5_buffer, md5_process_bytes, md5_process_block):
6548         Define with prototypes.
6549         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6550         * sha.c: Include "sha.h" first.
6551         Include <stdlib.h>, <string.h> unconditionally.
6552
6553         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6554         * memcmp.c (__ptr_t): Likewise.
6555         * memrchr.c (__ptr_t): Likewise.
6556         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6557         Include <string.h> unconditionally.
6558         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6559         * memchr.c: Include <stdlib.h> unconditionally.
6560         * memchr.c (LONG_MAX): Remove.
6561         * memrchr.c (LONG_MAX): Likewise.
6562         * memchr.c (__memchr): Define via a prototype.
6563         * memrchr.c (__memrchr): Likewise.
6564         * memcmp.c (__P): Remove, and remove all uses.
6565         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6566         Remove forward decls; no longer needed.
6567         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6568         Use types required by C89 in prototype.
6569
6570         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6571         * savedir.c: Likewise.
6572         * mkdir.c (free): Remove decl.
6573         * rmdir.c (rmdir): Define with a prototype.
6574         * savedir.c: Include savedir.h first, to test interface.
6575
6576         * mktime.c (STDC_HEADERS): Remove.
6577         Include <stdlib.h>, <string.h> unconditionally.
6578
6579         * modechange.c: Include <stdlib.h> unconditionally.
6580         (malloc): Remove decl.
6581
6582         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6583         (free): Remove decl.
6584
6585         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6586         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6587         (This type really should be intptr_t, but that's a C99ism.)
6588         (_obstack_memcpy): Remove: all uses changed to memcpy.
6589         Include <string.h> unconditionally.
6590         (struct obstack): Assume __STDC__ for types of members
6591         chunkfun, freefun, extra_arg.
6592         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6593         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6594         obstack_begin, obstack_specify_allocation,
6595         obstack_specify_allocation_with_arg, obstack_chunkfun,
6596         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6597         Remove unprototyped decls and the macros that use them.
6598         * obstack.c (POINTER): Remove.  All uses changed to void *.
6599         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6600         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6601         (defined __STDC__ && __STDC__)]:
6602         Remove nonprototyped code.
6603         Include <stdlib.h> unconditionally.
6604         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6605         _obstack_allocated_p, _obstack_free, obstack_free,
6606         _obstack_memory_used, print_and_abort):
6607         Define using prototypes.
6608         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6609         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6610         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6611         obstack_next_free, obstack_object_size, obstack_room) [0]:
6612         Remove unused, unprototyped code.
6613
6614         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6615
6616         * physmem.c (physmem_total, physmem_available, main): Define
6617         with prototypes.
6618
6619         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6620         (main): Define with a prototype.
6621
6622         * posixver.c (getenv): Remove decl.
6623
6624         * putenv.c (malloc): Returns void *, not char *.
6625         Include <string.h> unconditionally.
6626         (strchr, memcpy, NULL): Do not define.
6627
6628         * readtokens.c: Include readtokens.h first, to test interface.
6629         Include <stdlib.h>, <string.h> unconditionally.
6630         (init_tokenbuffer): Define with a prototype.
6631
6632         * regex.c (PARAMS): Remove.  All uses removed.
6633         All uses of _RE_ARGS removed, too.
6634         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6635         unconditionally.
6636         (bzero): Assume memset exists.
6637         (memcmp, memcpy, NULL): Remove.
6638         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6639         char, or assignments to local vars of type signed char.
6640         (init_syntax_once, PREFIX(extract_number_and_incr),
6641         PREFIX(print_partial_compiled_pattern),
6642         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6643         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6644         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6645         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6646         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6647         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6648         wcs_compile_range, byte_compile_range, truncate_wchar,
6649         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6650         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6651         count_mbs_length, wcs_re_match_2_internal,
6652         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6653         PREFIX(alt_match_null_string_p),
6654         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6655         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6656         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6657         now-unnecessary declaration, if any.
6658         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6659         regcomp, regexec):
6660         Remove now-unnecessary casts among pointer types.
6661         * regex.h (_RE_ARGS): Remove.  All uses removed.
6662
6663         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6664         (free): Remove decl.
6665
6666         * rpmatch.c: Include <stdlib.h> unconditionally.
6667
6668         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6669         (free): Remove decl.
6670
6671         * save-cwd.c: Include <stdlib.h> unconditionally.
6672         * xgetcwd.c: Likewise.
6673
6674         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6675         (free): Remove decl.
6676
6677         * strchrnul.c (strchrnul): Define with a prototype.
6678         Fix bug: c_in was not converted to char before searching.
6679
6680         The following changes are not K&R related:
6681
6682         * group-member.h: Include <sys/types.h>, so that this file is
6683         self-contained.
6684         * makepath.h: Likewise.
6685
6686         * getusershell.c (readname, default_index, line_size, readname):
6687         Use size_t, not int, for sizes.
6688         (readname): If the size overflows, report an error instead of
6689         looping forever.
6690
6691 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6692
6693         * getndelim2.c: Assume stdlib.h per the C89 spec.
6694
6695 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6696
6697         Assume C89 or better; remove K&R cruft.
6698         A few of these changes were first proposed by Derek Robert Price
6699         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6700
6701         * addext.c: Include <string.h> unconditionally.
6702         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6703         Don't declare getenv or malloc.
6704
6705         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6706         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6707         (NULL): Remove.
6708         (find_stack_direction, alloca): Use prototypes.
6709
6710         * atexit.c (atexit): Define using a prototype.
6711
6712         * basename.c, dirname.c, stripslash.c:
6713         Include <string.h> unconditionally.
6714
6715         * bcopy.c: Include <stddef.h>.
6716         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6717
6718         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6719
6720         * error.h (error, error_at_line, error_print_progname)
6721         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6722         * error.c: Include error.h first, to check interface.
6723         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6724         (VA_START): Remove; all uses changeed to va_start.
6725         (exit, strerror): Remove decls.
6726         (error_print_progname): Prototype uncondionally.
6727         Don't include <errno.h>; no longer needed.
6728         (private_strerror): Remove.
6729         (error_tail): Always define.
6730         (error, error_at_line): Assume C89 or better; always use prototypes.
6731         * fatal.c: Include "fatal.h" first, to test interface.
6732         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6733         (VA_START): Remove; all uses changed to va_start.
6734         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6735         this case.
6736         (exit): Remove decl.
6737         (fatal): Prototype unconditionally.  Assume va_start works.
6738         Abort at end, to pacify gcc.
6739
6740         * euidaccess.c (main): Define with a prototype.
6741
6742         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6743
6744         * exitfail.c: Include <stdlib.h> unconditionally.
6745
6746         * fnmatch_.h (__P): Remove.  All uses changed to assume
6747         prototypes.
6748         * fnmatch.c: Include fnmatch.h first, to test interface.
6749         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6750         (getenv): Remove decl.
6751         (fnmatch): Define using a prototype.
6752         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6753         (FCT): Define using a prototype.
6754
6755         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6756
6757         * gethostname.c: Include <stddef.h>.
6758         (gethostname): Define with prototype.  Length is size_t, not int.
6759
6760 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6761
6762         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6763         getversion.c should have been removed then, but was accidentally
6764         preserved.
6765
6766         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6767         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6768
6769 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6770
6771         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6772         copy_tm_result.  Bug reported by Simon Josefsson in
6773         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6774
6775 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6776
6777         * time_r.c, time_r.h: New files.
6778
6779         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6780         __localtime_r.
6781         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6782         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6783
6784         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6785         __gmtime_r.
6786         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6787         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6788         Include <time_r.h>.
6789
6790         * timegm.c: Switch to glibc implementation, with the following changes:
6791         [defined HAVE_CONFIG_H]: Include <config.h>.
6792         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6793         (__mktime_internal) [!defined _LIBC]: New decl.
6794         (__gmtime_r) [!defined _LIBC]: New macro and function.
6795         (timegm): Use a prototype, since gnulib assumes C89.
6796         Do not bother declaring tmp to be const, as it's not really usefu.
6797         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6798         (timegm): Declare only if HAVE_DECL_TIMEGM.
6799
6800 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6801
6802         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6803         Bug reported by Lute Kamstra in
6804         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6805
6806         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6807         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6808         course with correspondingly smaller numbers for tomorrow and
6809         yesterday.  From Tadayoshi Funaba.  Originally installed into
6810         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6811         coreutils merge?).
6812
6813 2003-08-31  Simon Josefsson  <jas@extundo.com>
6814
6815         * timegm.h: New file.
6816         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6817
6818 2003-08-31  Karl Berry  <karl@gnu.org>
6819
6820         * argp.h: update from libc.
6821
6822 2003-08-28  Bruno Haible  <bruno@clisp.org>
6823
6824         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6825         warning on QNX, which defines O_BINARY to 000000.
6826
6827 2003-08-24  Bruno Haible  <bruno@clisp.org>
6828
6829         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6830         MSVC7 <stdio.h> is included later.
6831
6832 2003-08-20  Bruno Haible  <bruno@clisp.org>
6833
6834         * progname.h: New file, from GNU gettext.
6835         * progname.c: New file, from GNU gettext.
6836         * progreloc.c: New file, from GNU gettext.
6837
6838 2003-08-19  Bruno Haible  <bruno@clisp.org>
6839
6840         * xstrdup.c: Assume <string.h> exists.
6841
6842 2003-08-18  Jim Meyering  <jim@meyering.net>
6843
6844         * setenv.h: Indent nested cpp directive.
6845         * vasnprintf.c: Remove trailing blanks.
6846
6847 2003-08-17  Simon Josefsson  <jas@extundo.com>
6848             Bruno Haible  <bruno@clisp.org>
6849
6850         * xstrndup.h: New file.
6851         * xstrndup.c: New file.
6852
6853 2003-08-17  Bruno Haible  <bruno@clisp.org>
6854
6855         * strndup.h: New file.
6856
6857 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6858
6859         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6860         space, undoing this 2003-08-12 change:
6861         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6862
6863 2003-08-16  Jim Meyering  <jim@meyering.net>
6864
6865         Merge from coreutils.
6866         * xstrtoimax.c: #else #if -> #elif.
6867         * xstrtoumax.c: Likewise.
6868
6869 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6870
6871         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6872         rather than tab, after '#' in shell-script copyright notices.
6873         Suggested by Bruno Haible.
6874
6875 2003-08-15  Jim Meyering  <jim@meyering.net>
6876         and Paul Eggert  <eggert@twinsun.com>
6877
6878         Merge from coreutils.
6879         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6880         member but strut utmpx does not.  Needed for AIX 4.3.3.
6881         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6882
6883 2003-08-15  Jim Meyering  <jim@meyering.net>
6884
6885         Merge from coreutils.
6886         * xgethostname.c: Include <stdlib.h>.
6887         (xghostname): Don't exit for anything other than memory-related
6888         failure; just return NULL.
6889         * userspec.c: Include "posixver.h".
6890         (parse_user_spec): Accept `.' as a separator only
6891         in pre-POSIX-200112 mode.
6892         * strtoimax.c: Use #elif rather than #else #if.
6893         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6894         Remove function, now that we can rely on a working tzset function.
6895         [!_LIBC]: Ensure that the required autoconf test has been run.
6896         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6897         Use underlying_strftime for %r.
6898         * sha.c: Merge in some clean-up and optimization changes from glibc.
6899         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6900         Ensure that it is a multiple of 64.
6901         Rearrange loop exit tests so as to avoid performing an
6902         additional fread after encountering an error or EOF.
6903         * realloc.c: Update copyright date.
6904
6905 2003-08-14  Jim Meyering  <jim@meyering.net>
6906
6907         Merge from coreutils.
6908         * obstack.h: Whitespace changes.
6909         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6910         and xcalloc return values.
6911         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6912         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6913         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6914         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6915         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6916         error from mntctl.
6917         Use mntctl's return value to drive the entry-processing loop, since
6918         we can't rely on the value of the vmt_length member in the last
6919         entry.  On some systems doing so could result in exhausting
6920         virtual memory.  Based in part on a patch from Mike Jetzer.
6921
6922 2003-08-14  Jim Meyering  <jim@meyering.net>
6923         and Paul Eggert  <eggert@twinsun.com>
6924
6925         Merges from coreutils, plus other fixes.
6926         * physmem.c: Merge in portability changes from gcc/libiberty
6927         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6928         for credits and details.  Thanks to Kaveh Ghazi for helping
6929         to keep these files in sync.
6930         (ARRAY_SIZE): Define it.
6931         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6932         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6933         (memcasecmp): Don't assume size_t fits in unsigned int.
6934         Remove casts and duplicate code.
6935         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6936         (memcpy): Remove definition.
6937         Merge in some clean-up and optimization changes from glibc.
6938         [BLOCKSIZE]: Move definition to top of file.
6939         Ensure that it is a multiple of 64.
6940         Rearrange loop exit tests so as to avoid performing an
6941         additional fread after encountering an error or EOF.
6942         * md5.h (md5_uintptr): Define.
6943         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6944         return to the initial working directory.  Preserve errno
6945         for caller.
6946         * idcache.c: Include "xalloc.h".
6947         (xmalloc, xrealloc): Remove decls.
6948         (getuser): Remove casts no longer required in C89.
6949         * human.c: Include stdio.h, for sprintf.
6950         * group-member.c: Include "xalloc.h".
6951         (xmalloc, xrealloc): Remove decls.
6952         (get_group_info): Remove casts no longer required in C89.
6953         * getusershell.c (readname): Remove casts no longer required in C89.
6954         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6955         * getline.c: Whitespace fix, from coreutils.
6956
6957 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6958
6959         * exclude.c: Include <ctype.h>
6960         (IN_CTYPE_DOMAIN): New macro.
6961         (is_space): New fn.
6962         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6963         and empty lines.
6964
6965         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6966         Undo previous (whitespace-only) change.
6967
6968 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6969
6970         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6971         Normalize leading white space and remove trailing white space.
6972         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6973         notice, as per ../config/srclist-update.
6974
6975         Merge from coreutils.
6976         * euidaccess.h: New file.
6977         * euidaccess.c: Include it.
6978         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6979         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6980         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6981
6982 2003-08-11  Bruno Haible  <bruno@clisp.org>
6983
6984         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6985         (vasnprintf): Use it instead of wcslen.
6986
6987 2003-08-11  Bruno Haible  <bruno@clisp.org>
6988
6989         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6990         value to ensure that _Bool promotes to int. Use #define for _Bool when
6991         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6992
6993 2003-08-10  Karl Berry  <karl@gnu.org>
6994
6995         * regex.h: update from libc (whitespace fix).
6996
6997 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6998
6999         Merge some files from coreutils.  These changes were
7000         originally made by Jim Meyering.
7001         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7002         many older Unixes require this.
7003         * alloca.c (alloca): Remove cast to argument of free;
7004         no longer needed in C89.
7005         * alloca_.h, regex.h: Fix white space to match
7006         what GNU indent does.
7007
7008 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7009
7010         * bumpalloc.h: Remove.
7011
7012 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7013
7014         * getloadavg.c: Change copyright notice and spacing to conform to
7015         GNU coding style.
7016
7017         Merge from coreutils.
7018         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7019         From glibc.
7020         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7021         from Karl Berry, implemented by Jim Meyering.
7022         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7023         from Dmitry V. Levin.
7024         Remove anachronistic cast of xrealloc.
7025         * fnmatch_.h (__const): Remove.  Use 'const'.
7026         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7027         type. Otherwise, it wouldn't compile with at least /bin/cc on
7028         ymp-cray-unicos9.0.2.X.
7029         Combine two mostly-identical uses of alloca into one.
7030         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7031
7032 2003-08-04  Dave Love <d.love@dl.ac.uk>
7033
7034         [From Emacs.]
7035
7036         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7037         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7038         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7039         obsolete NLIST_NAME_UNION.
7040         [__GNU__]: Undef BSD and FSCALE.
7041         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7042
7043 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7044
7045         * stdbool_.h (_Bool): Make it signed char, instead of
7046         an enum type, so that it's guaranteed to promote to int.  See:
7047         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7048
7049 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7050
7051         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7052         (strerror): Don't assume that a printable int fits in 14 bytes.
7053
7054 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7055             Bruno Haible  <bruno@clisp.org>
7056
7057         * getline.h (getline, getdelim): Change return type to ssize_t.
7058         * getline.c (getline, getdelim): Likewise.
7059         Remove _GNU_SOURCE define; now it's defined in config.h through
7060         m4/getline.m4.
7061
7062 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7063
7064         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7065         over-parenthesization in macros.
7066
7067         Sync with coreutils.
7068
7069         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7070         required by C99.
7071
7072         Use `exit_failure' for xalloc and xmemcoll instead of their own
7073         private exit-failure variables.
7074         * xalloc.h (xalloc_exit_failure): Remove.
7075         * xmalloc.c: Likewise.  Include exitfail.h.
7076         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7077         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7078         * xmemcoll.c: Likewise.  Include exitfail.h.
7079         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7080
7081 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7082
7083         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7084         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7085         to test that it can stand by itself.  Include "exitfail.h".
7086         Clients should set exit_failure instead.
7087         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7088
7089 2003-07-18  Andreas Schwab  <schwab@suse.de>
7090
7091         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7092
7093 2003-07-18  Bruno Haible  <bruno@clisp.org>
7094
7095         * getndelim2.h: New file.
7096         * getndelim2.c: Make into a module of its own. Include config.h,
7097         getndelim2.h.
7098         (getndelim2): Make non-static. Change return type to ssize_t.
7099         * getline.h: Change argument names.
7100         * getline.c: Include getndelim2.h instead of getndelim2.c.
7101         * getnline.c: Include getndelim2.h.
7102
7103 2003-07-17  Bruno Haible  <bruno@clisp.org>
7104
7105         * Makefile.am: Remove file.
7106         * Makefile.in: Remove file.
7107
7108 2003-07-17  Bruno Haible  <bruno@clisp.org>
7109
7110         * getnline.h: New file.
7111         * getnline.c: New file.
7112         * getndelim2.c: New file, extracted from getline.c.
7113         (getndelim2): Renamed from getdelim2, with added nmax argument.
7114         * getline.c: Include getndelim2.c.
7115         (getdelim2): Moved out to getndelim2.c.
7116         (getline, getdelim): Update.
7117
7118 2003-07-15    <karl@gnu.org>
7119
7120         * vasnprintf.c: update from gettext.
7121
7122 2003-07-15  Jim Meyering  <jim@meyering.net>
7123
7124         * makepath.c (make_path): Enclose diagnostic in _(...).
7125
7126 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7127
7128         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7129         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7130         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7131         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7132         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7133         updated automatically by ../config/srclist-update.  This changes
7134         their license from LPGL to GPL.
7135
7136 2003-07-14  Jim Meyering  <jim@meyering.net>
7137
7138         Don't emit diagnostics.  Let callers do that.
7139         * save-cwd.c: Don't include "error.h".
7140         (save_cwd): Don't call error.  Ensure that errno is valid
7141         when returning nonzero.
7142
7143         * save-cwd.h (restore_cwd): Update prototype.
7144         * save-cwd.c (restore_cwd): Remove two parameters.
7145         Simplify.  Don't call error upon failure.  Let callers do that.
7146         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7147         when auditing is enabled.  But don't bother updating the #if.
7148
7149 2003-07-14  Simon Josefsson  <jas@extundo.com>
7150
7151         * mempcpy.h: New file.
7152         * mempcpy.c: New file.
7153
7154 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7155
7156         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7157         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7158         unicodeio.c, unicodeio.h, unlocked-io.h:
7159         Switch from LGPL to GPL.
7160
7161 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7162
7163         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7164         it breaks C++ compilation.
7165         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7166
7167 2003-07-10  Jim Meyering  <jim@meyering.net>
7168
7169         * vasnprintf.c: Remove trailing blanks.
7170         Make cpp indentation consistent.
7171
7172 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7173
7174         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7175         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7176         Switch from LGPL to GPL.
7177
7178 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7179
7180         * mktime.c: Fix some boundary cases and remove need for floating point.
7181
7182         Issue a compile-time diagnostic if time_t is floating point, or if
7183         two's complement arithmetic is not in effect, or if arithmetic
7184         right shift does not propagate the sign.  These assumptions were
7185         all in the original code but they weren't checked.
7186
7187         (TIME_T_MIDPOINT, verify): New macros.
7188         (__isleap): Remove; it has integer overflow problems.
7189         (leapyear): New function, without those problems.
7190         (ydhms_tm_diff): Remove; splitting into two parts.
7191         (ydhms_diff): New function, containing the arithmetic part of
7192         the old ydhms_tm_diff function.  Issue a compile-time
7193         diagnostic if we are not using C99 integer division.
7194         Avoid casts when possible.
7195         (guess_time_tm): New function, containing the checking part of
7196         the old ydhms_tm_diff function.  Return the new value, rather than
7197         the difference between it and the old.  Accept a new argument T
7198         so that *T specifies the old value.  Check for overflow in the result.
7199
7200         (__mktime_internal): Use a time_t offset, not a long int offset.
7201         This undoes the 2003-06-04 change, which is no longer needed now
7202         that we have better overflow checking.
7203         (localtime_offset): Likewise.
7204
7205         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7206         and long are 64-bit but int is only 32-bit.
7207         (ydhms_diff): Use long int to store year1 and yday1.
7208         Issue a compile-time diagnostic if long int is not wide enough.
7209
7210         (__mktime_internal): Use long int to store adjusted year and yday.
7211         Use plain C rather than preprocessor commands, if that doesn't
7212         affect efficiency.
7213         Check for overflow (and try to repair) after each probe
7214         rather than checking only at the very end.  This avoids some bugs
7215         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7216         does not equal GMT offset at maximum time).
7217         Use integer to check for overflow rather than floating point; this
7218         is more portable to non-IEEE hosts, and is a tad faster.
7219         When we detect that we are oscillating between two values,
7220         don't check whether tm_isdst has the requested value, since
7221         we already know the answer.  When tm_isdst has the wrong value,
7222         use a different heuristic to find the right one, based on the
7223         extreme values actually observed in practice in tz2003a,
7224         rather than the (overly optimistic) "previous 3 calendar quarters".
7225
7226         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7227         "T const" to accommodate glibc style.
7228         (check_result): Use less-confusing report format.  "long" -> "long int.
7229         (main): Likewise.
7230         Don't loop if the iteration overflows time_t.
7231         Allow a negative step in the iteration.
7232
7233 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7234
7235         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7236         having it depend on HAVE_SYS_TYPES_H.
7237
7238 2003-06-25  Bruno Haible  <bruno@clisp.org>
7239
7240         * readlink.c: New file.
7241
7242 2003-06-20  Bruno Haible  <bruno@clisp.org>
7243
7244         Assume C89, so PARAMS isn't needed.
7245         * unicodeio.h (PARAMS): Remove.
7246         * unicodeio.c: Don't use PARAMS.
7247
7248 2003-06-18  Jim Meyering  <jim@meyering.net>
7249
7250         Merge changes from coreutils.
7251         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7252         Remove explicit declarations of xmalloc and realloc.
7253         Include xalloc.h.
7254         (read_utmp): Remove anachronistic cast of xmalloc.
7255
7256 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7257
7258         Assume C89, so PARAMS isn't needed.
7259         * backupfile.h (PARAMS): Remove.  All uses removed.
7260         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7261         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7262         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7263         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7264         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7265         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7266         xstrtol.h: Likewise.
7267         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7268         same.h, strverscmp.h: Do not include config.h; no longer needed.
7269         Anyway, config.h should always be included before any other file.
7270
7271 2003-06-11  Simon Josefsson  <jas@extundo.com>
7272
7273         * sysexit_.h: New file.
7274
7275 2003-05-20  Derek Price  <derek@ximbiot.com>
7276
7277         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7278
7279 2003-06-10  Simon Josefsson  <jas@extundo.com>
7280
7281         * strchrnul.h: New file.
7282         * strchrnul.c: New file.
7283
7284 2003-06-10  Simon Josefsson <jas@extundo.com>
7285
7286         * argp.h: New file, from glibc.
7287         * argp-ba.c: New file, from glibc.
7288         * argp-eexst.c: New file, from glibc.
7289         * argp-fmtstream.c: New file, from glibc.
7290         * argp-fmtstream.h: New file, from glibc.
7291         * argp-fs-xinl.c: New file, from glibc.
7292         * argp-help.c: New file, from glibc.
7293         * argp-namefrob.h: New file, from glibc.
7294         * argp-parse.c: New file, from glibc.
7295         * argp-pv.c: New file, from glibc.
7296         * argp-pvh.c: New file, from glibc.
7297         * argp-xinl.c: New file, from glibc.
7298
7299 2003-06-07  Jim Meyering  <jim@meyering.net>
7300
7301         * readtokens.h: Put `Free Software Foundation, Inc.'
7302         in place of my name in the copyright comment.
7303         Remove definition and uses of __P.
7304
7305         From coreutils.
7306         * stat.c: Don't declare xmalloc explicitly.
7307         Instead, include "xalloc.h".
7308         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7309         xrealloc, and xcalloc return values.
7310         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7311         Improve comment.
7312         * xgetcwd.h: Remove definition/uses of PARAMS.
7313
7314 2003-06-06  Jim Meyering  <jim@meyering.net>
7315
7316         * stdbool_.h: Renamed from stdbool.h.in.
7317
7318 2003-06-06  Jim Meyering  <jim@meyering.net>
7319
7320         Merge from coreutils.
7321         * same.c: (same_name): Declare *_basename locals to be `const'.
7322         Consolidate declarations and initializations of *_base* locals.
7323
7324         Merge from coreutils.
7325         This avoids a core dump on systems without GNU putenv,
7326         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7327         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7328         (unsetenv): New static function, from GNU libc.
7329         (rpl_putenv): Use it.
7330
7331         * modechange.c: Remove trailing blanks.
7332
7333         Merge from coreutils.
7334         * fsusage.c: Remove declaration of statfs.
7335         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7336
7337         * posixtm.c: Include <stdbool.h> unconditionally.
7338
7339 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7340
7341         * mktime.c (__mktime_internal): When resolving a tm_isdst
7342         mismatch, look in future quarters as well as past.  This fixes a
7343         bug when processing fall-backwards gaps immediately after a long
7344         period of daylight-saving time.
7345
7346         * mktime.c: Assume freestanding C89 or better.
7347         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7348         (__P): Remove; not used.
7349         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7350         (mktime, not_equal_tm, print_tm, check_result,
7351         main): Use prototypes.  Use const * where appropriate.
7352         (main): Fix typo in testing code that uncovered by above changes.
7353         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7354
7355 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7356
7357         * mktime.c: Fix Debian bug 177940
7358         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7359         (localtime_offset): Now long int, not time_t, because we want it
7360         to be guaranteed to be signed.  All uses changed.
7361         (__mktime_internal): If overflow would occur when adding offset,
7362         don't add it.
7363
7364         Merge 'human' changes from coreutils.  Rewrite to support
7365         locale-specific notations like thousands separators.
7366         * human.c: Simplify authorship notice.
7367         Include human.h immediately after config.h.
7368         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7369         <limits.h>: Do not include, since human.h does.
7370         (SIZE_MAX, UINTMAX_MAX): New macros.
7371         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7372         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7373         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7374         (power_letter): Renamed from suffixes.
7375         (generate_suffix_backwards): Remove.
7376         (adjust_value): Now takes int style (because of human.h changes)
7377         and long double value (for greater precision on some platforms).
7378         (group_number): New function.
7379         (human_readable): Use it.  Use integer options, not enum.
7380         Put the options before the sizes in the arg list.
7381         Support all the new options.
7382         The old human_readable function has been removed;
7383         use inttostr.h instead.
7384         (human_readable, default_block_size, humblock):
7385         Use uintmax_t, not int, for block sizes.
7386         (human_readable_inexact, block_size_types): Remove.
7387         (block_size_opts): New constant.
7388         (human_options): Renamed from human_block_size, with new signature
7389         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7390         * human.h: Add copyright and authorship notice.
7391         Include <limits.h> and <stdbool.h> unconditionally.
7392         (PARAMS): Remove.  All uses removed.
7393         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7394         (enum human_inexact_style): Remove tag; now a nameless enum.
7395         (human_floor, human_ceiling, human_round_to_even): Now have
7396         values 2, 0, 1 rather than -1, 1, 0.
7397         (human_group_digits, human_suppress_point_zero, human_autoscale,
7398         human_base_1024, human_SI, human_B): New constants.
7399         (human_readable_inexact, human_block_size): Remove.
7400         (human_readable): Size args are now uintmax_t, not int.
7401         (human_options): New decl.
7402
7403         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7404         unnecessary now that we assume C89 or better.  This change
7405         imported from coreutils.
7406
7407         * mktime.c (__mktime_internal): Do not reject negative timestamps
7408         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7409         in the 2003-05-30 sync from glibc.
7410
7411         .h files should stand alone, but we shouldn't include <sys/types.h>
7412         if we can get away with just <stddef.h>.
7413
7414         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7415         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7416         rather than <sys/types.h>, as we merely need size_t.
7417         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7418         to get size_t.
7419         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7420         Include <stdio.h>, to get FILE.
7421         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7422         memcasecmp.h has included <stddef.h> and all we need is size_t.
7423         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7424         our interface, instead of including <sys/types.h>
7425
7426 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7427
7428         [from coreutils]
7429         Fix some minor time-related bugs with POSIX time arguments.
7430         Some valid time stamps were being rejected (notably -1, and
7431         time stamps before 1900 on 64-bit hosts).  And some invalid
7432         time stamps were being accepted, e.g. September 31.
7433
7434         * posixtm.h (posixtime): Return bool instead of time_t, so
7435         that we can return (time_t) -1 successfully.
7436         * posixtm.c: Likewise.
7437         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7438         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7439         (t): Remove static var.
7440         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7441         of static var.  All uses changed.
7442         (year): Do not reject years before 1900; they can occur with
7443         64-bit time_t.
7444         (posix_time_parse): Do not check for out-of-range components;
7445         that is now the caller's responsibility, since our checks were
7446         only approximations.
7447         (posixtime): Use mktime to check for out-of-range components,
7448         since it knows them exactly.
7449         If mktime returns (time_t) -1, check whether an error actually occurred
7450         by invoking localtime on -1.
7451         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7452         posixtime failures better.
7453         Improve the test data (in comments only).
7454
7455 2003-05-30    <karl@gnu.org>
7456
7457         * mktime.c: update from libc.
7458
7459 2003-05-30  Bruno Haible  <bruno@clisp.org>
7460
7461         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7462         * localcharset.h: Likewise.
7463         * localcharset.c: Likewise.
7464
7465 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7466
7467         Assume the headers required for C89 freestanding compilers.
7468         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7469         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7470         without checking for HAVE_LIMITS_H.
7471         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7472         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7473         to do that.
7474         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7475         * exclude.c: Include <stdbool.h> unconditionally.
7476         * tempname.c: Include <stddef.h> unconditionally.
7477         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7478         * modechange.c, rpmatch.c (NULL): Don't define, since
7479         <stddef.h> does that.
7480         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7481         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7482         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7483         * xstrtol.c: Likewise.
7484         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7485         * savedir.c: Include <stddef.h> instead of defining NULL.
7486
7487         * addext.c (addext): Use assignment rather than cast, to avoid
7488         warnings on some platforms.
7489
7490         * mktime.c (__mktime_internal): Do not reject negative timestamps
7491         arbitrarily.
7492
7493 2003-05-10  Bruno Haible  <bruno@clisp.org>
7494
7495         * linebreak.c (iconv_string_length): Don't return -1 just because the
7496         string is longer than 4 KB.
7497
7498 2003-05-12  Jim Meyering  <jim@meyering.net>
7499
7500         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7501         the space-padded-by-default conversion specifiers, %e, %k, %l.
7502
7503 2003-05-03  Bruno Haible  <bruno@clisp.org>
7504
7505         Upgrade to Unicode-4.0.
7506         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7507         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7508         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7509         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7510         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7511         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7512         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7513         Change width of U+E0100..U+E01EF from 1 to 0.
7514
7515 2003-04-25  Bruno Haible  <bruno@clisp.org>
7516
7517         * copy-file.c: Include <stddef.h>, for size_t.
7518
7519 2003-04-25  Jim Meyering  <jim@meyering.net>
7520
7521         * copy-file.c (copy_file_preserving): Declare buf_size to be
7522         of type size_t, not int.
7523
7524 2003-04-11  Jim Meyering  <jim@meyering.net>
7525
7526         Merge changes from Coreutils.
7527
7528         2003-03-22  Jim Meyering  <jim@meyering.net>
7529
7530         * strftime.c (widen): Cast alloca return value to proper type.
7531
7532         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7533
7534         From GNU libc.
7535         * strftime.c (my_strftime): Handle very large width
7536         specifications for numeric values correctly.  Improve checks for
7537         overflow.
7538
7539         2003-01-19  Jim Meyering  <jim@meyering.net>
7540
7541         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7542         (nl_get_alt_digit) [! defined my_strftime]: Define.
7543         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7544         _nl_get_alt_digit and _nl_get_walt_digit.
7545
7546         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7547         These changes have no effect outside of _LIBC.
7548
7549 2003-04-10  Bruno Haible  <bruno@clisp.org>
7550
7551         * findprog.h: New file, from GNU gettext.
7552         * findprog.c: New file, from GNU gettext.
7553
7554 2003-04-05  Jim Meyering  <jim@meyering.net>
7555
7556         Merge changes from Coreutils.
7557
7558         * exclude.h (PARAMS): Remove definition and uses.
7559         * exclude.c: Remove uses of `PARAMS'.
7560
7561         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7562         Add test-cases for DOS filenames. Declare program_name.
7563         (main): Set up program_name.  Patch by Rich Dawe.
7564
7565         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7566         error from mntctl.
7567         Use mntctl's return value to drive the entry-processing loop, since
7568         we can't rely on the value of the vmt_length member in the last
7569         entry.  On some systems doing so could result in exhausting
7570         virtual memory.  Based in part on a patch from Mike Jetzer.
7571
7572 2003-04-04  Bruno Haible  <bruno@clisp.org>
7573
7574         * linebreak.h: New file, from GNU gettext.
7575         * linebreak.c: New file, from GNU gettext with slight modifications.
7576         * lbrkprop.h: New file, from GNU gettext.
7577
7578 2003-04-03  Bruno Haible  <bruno@clisp.org>
7579
7580         * utf8-ucs4.h: New file, from GNU gettext.
7581         * utf16-ucs4.h: New file, from GNU gettext.
7582         * ucs4-utf8.h: New file, from GNU gettext.
7583         * ucs4-utf16.h: New file, from GNU gettext.
7584
7585 2003-04-02  Bruno Haible  <bruno@clisp.org>
7586
7587         * binary-io.h: New file, from GNU gettext.
7588
7589 2003-04-01  Bruno Haible  <bruno@clisp.org>
7590
7591         * pathname.h: New file, from GNU gettext.
7592         * concatpath.c: New file, from GNU gettext.
7593
7594 2003-03-30  Bruno Haible  <bruno@clisp.org>
7595
7596         * copy-file.c (copy_file_preserving): Don't set owner if the function
7597         chown() doesn't exist.
7598
7599 2003-03-28  Bruno Haible  <bruno@clisp.org>
7600
7601         * copy-file.h: New file, from GNU gettext.
7602         * copy-file.c: New file, from GNU gettext.
7603
7604 2003-03-18  Jim Meyering  <jim@meyering.net>
7605
7606         * quote.c (quote_n): Fix typo in comment.
7607
7608 2003-03-14  Jim Meyering  <jim@meyering.net>
7609
7610         Merge changes from Coreutils.
7611         * obstack.h (obstack_object_size): Declare temporary, __o,
7612         to be const, in order to avoid warnings.
7613         (obstack_room): Likewise.
7614         (obstack_empty_p): Likewise.
7615
7616 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7617
7618         Merge changes from Bison.
7619         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7620         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7621         when compiling Bison 1.875's `bitset bset = obstack_alloc
7622         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7623         * hash.c: Include <stdbool.h> unconditionally.
7624
7625 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7626
7627         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7628         Reported by Bruce Becker; see:
7629         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7630
7631 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7632             Bruno Haible  <bruno@clisp.org>
7633
7634         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7635         Reported by John Hughes, see
7636         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7637
7638 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7639
7640         * poll_.h: New file.
7641         * poll.c: New file.
7642
7643 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7644
7645         * mathl.h: New file.
7646         * acosl.c: New file.
7647         * asinl.c: New file.
7648         * atanl.c: New file.
7649         * ceill.c: New file.
7650         * cosl.c: New file.
7651         * expl.c: New file.
7652         * floorl.c: New file.
7653         * frexpl.c: New file.
7654         * ldexpl.c: New file.
7655         * logl.c: New file.
7656         * sincosl.c: New file.
7657         * sinl.c: New file.
7658         * sqrtl.c: New file.
7659         * tanl.c: New file.
7660         * trigl.c: New file.
7661         * trigl.h: New file.
7662
7663 2003-02-17  Bruno Haible  <bruno@clisp.org>
7664
7665         * mkdtemp.h: New file, from GNU gettext.
7666         * mkdtemp.c: New file, from GNU gettext.
7667
7668 2003-01-31  Bruno Haible  <bruno@clisp.org>
7669
7670         * rename.c: #undef rename before defining rpl_rename.
7671         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7672
7673 2003-01-30  Bruno Haible  <bruno@clisp.org>
7674
7675         * printf-args.h: New file, from GNU gettext.
7676         * printf-args.c: New file, from GNU gettext.
7677         * printf-parse.h: New file, from GNU gettext.
7678         * printf-parse.c: New file, from GNU gettext.
7679         * vasnprintf.h: New file, from GNU gettext.
7680         * vasnprintf.c: New file, from GNU gettext.
7681         * asnprintf.c: New file, from GNU gettext.
7682         * vasprintf.h: New file, from GNU gettext with modifications.
7683         * vasprintf.c: New file, from GNU gettext.
7684         * asprintf.c: New file, from GNU gettext.
7685
7686 2003-01-29  Bruno Haible  <bruno@clisp.org>
7687
7688         * stpncpy.h: New file, from GNU gettext with modifications.
7689         * stpncpy.c: New file, from GNU gettext with modifications.
7690
7691 2003-01-28  Bruno Haible  <bruno@clisp.org>
7692
7693         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7694         Paul Eggert.
7695         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7696         Paul Eggert.
7697
7698 2003-01-27  Bruno Haible  <bruno@clisp.org>
7699
7700         * xsetenv.h: New file, from GNU gettext.
7701         * xsetenv.c: New file, from GNU gettext.
7702
7703 2003-01-23  Bruno Haible  <bruno@clisp.org>
7704
7705         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7706
7707 2003-01-22  Bruno Haible  <bruno@clisp.org>
7708
7709         * exit.h: New file, from GNU gettext.
7710
7711 2003-01-11  Bruno Haible  <bruno@clisp.org>
7712
7713         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7714         * strcase.h (strcasecmp, strncasecmp): Likewise.
7715
7716 2003-01-14  Jim Meyering  <jim@meyering.net>
7717
7718         * same.c (same_name): Tweak a comment.
7719
7720 2003-01-11  Bruno Haible  <bruno@clisp.org>
7721
7722         * same.c (same_name): Reorder tests so as to avoid calling stat()
7723         when a string comparison is sufficient.
7724
7725 2003-01-11  Bruno Haible  <bruno@clisp.org>
7726
7727         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7728         'unsigned int'.
7729
7730 2003-01-11  Bruno Haible  <bruno@clisp.org>
7731
7732         * hash-pjw.c: Add comment about low quality of this function.
7733
7734 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7735
7736         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7737         to avoid collisions with libcurses and libreadline.
7738
7739         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7740         * getstr.h, getstr.c: Remove.
7741         * getline.c: Include "getline.h", to check interface.
7742         Move body of old getstr.c here: this defines MIN_CHUNK and
7743         declares getdelim2, which is renamed from getstr.
7744         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7745
7746         * linebuffer.c (readlinebuffer): Renamed from readline.
7747         All uses changed.
7748         * linebuffer.h: Likewise.
7749         (readline): Remove backward-compatibility macro.
7750
7751 2003-01-12  Jim Meyering  <jim@meyering.net>
7752
7753         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7754
7755 2003-01-10  Bruno Haible  <bruno@clisp.org>
7756
7757         * alloca_.h: New file.
7758         * getdate.y: Unconditionally include alloca.h.
7759         * makepath.c: Likewise.
7760         * setenv.c: Likewise.
7761         * userspec.c: Likewise.
7762
7763 2003-01-09  Bruno Haible  <bruno@clisp.org>
7764
7765         * stdbool.h.in: New file.
7766
7767 2003-01-08  Bruno Haible  <bruno@clisp.org>
7768
7769         * safe-read.c: Include specification header first, to ensure its
7770         selfcontainedness.
7771         * full-write.c: Likewise.
7772
7773 2003-01-08  Jim Meyering  <jim@meyering.net>
7774
7775         * full-write.c: Undefine and define-away `const' after inclusion
7776         of errno.h, not before.  Suggestion from Bruno Haible.
7777
7778 2003-01-07  Jim Meyering  <jim@meyering.net>
7779
7780         * full-write.c: Rework so that it may serve to define full_read, too.
7781         * full-read.c: Simply #define FULL_READ and include full-write.c.
7782
7783 2003-01-06  Jim Meyering  <jim@meyering.net>
7784
7785         * version-etc.c: Update year in translatable copyright string.
7786
7787 2002-12-25  Bruno Haible  <bruno@clisp.org>
7788
7789         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7790         * xstrtol.h: Likewise.
7791         * xstrtoimax.c: Likewise.
7792         * xstrtoumax.c: Likewise.
7793         * human.h: Likewise.
7794
7795         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7796         on systems that have <inttypes.h> but not <stdint.h>.
7797
7798 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7799
7800         * memcoll.c (memcoll): Fall back on a simple algorithm using
7801         memcmp if strcoll doesn't work.
7802
7803 2002-12-23  Bruno Haible  <bruno@clisp.org>
7804
7805         * localcharset.h: New file.
7806         * localcharset.c: Include it.
7807         * unicodeio.c: Likewise.
7808
7809 2002-12-22  Bruno Haible  <bruno@clisp.org>
7810
7811         * utime.c (utime_null): No need to call ftruncate if the file was
7812         nonempty.
7813
7814 2002-12-23  Bruno Haible  <bruno@clisp.org>
7815
7816         * memcoll.c (STRCOLL): New macro.
7817         (memcoll): Use it.
7818
7819 2002-12-22  Bruno Haible  <bruno@clisp.org>
7820
7821         * getstr.h (getstr): Define, to avoid clash with libcurses.
7822         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7823
7824 2002-12-22  Bruno Haible  <bruno@clisp.org>
7825
7826         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7827
7828 2002-12-23  Bruno Haible  <bruno@clisp.org>
7829
7830         * getline.h: Include <stddef.h>, for size_t.
7831
7832         * unicodeio.h: Include <stddef.h>, for size_t.
7833         * unicodeio.c: Don't include <stddef.h>.
7834
7835 2002-12-17  Bruno Haible  <bruno@clisp.org>
7836
7837         * canon-host.c (strdup): Remove unused declaration.
7838
7839         * fsusage.c: Include full_read.h.
7840         (get_fs_usage): Use full_read instead of safe_read.
7841
7842         * utime.c (utime_null): Use SAFE_READ_ERROR.
7843
7844 2002-12-11  Bruno Haible  <bruno@clisp.org>
7845
7846         * setenv.h: Rewritten to cope with systems that have setenv() but not
7847         unsetenv().
7848         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7849         modifications:
7850
7851         2002-12-11  Bruno Haible  <bruno@clisp.org>
7852
7853                 * setenv.c (alloca): Fall back to malloc.
7854                 (freea): New macro.
7855                 (setenv): Use freea() to free memory allocated with alloca().
7856
7857         2002-11-13  Bruno Haible  <bruno@clisp.org>
7858
7859                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7860                 function declarations.
7861                 * unsetenv.c (unsetenv): Likewise.
7862
7863         2002-03-04  Bruno Haible  <bruno@clisp.org>
7864
7865                 Portability to AIX 4.3.3.
7866                 * unsetenv.c: New file, extracted from setenv.c.
7867                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7868
7869         2001-12-20  Bruno Haible  <bruno@clisp.org>
7870
7871                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7872                 use malloc instead. For SunOS 4.
7873
7874         2001-12-11  Bruno Haible  <bruno@clisp.org>
7875
7876                 * setenv.c: Declare alloca.
7877                 (compar_fn_t): New typedef.
7878                 (KNOWN_VALUE, STORE_VALUE): Use it.
7879
7880         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7881         setenv.h.
7882
7883 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7884
7885         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7886         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7887         Choose values that are less likely to collide with system fnmatch
7888         options.
7889         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7890         defined (e.g., a pure POSIX system).
7891         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7892         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7893
7894 2002-12-06  Jim Meyering  <jim@meyering.net>
7895
7896         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7897
7898         Merge in changes from libc's misc/error.c, in preparation
7899         for the merge of gnulib's changes back into libc.
7900
7901         * error.c (_): Define only if not already defined.
7902         Move definition to follow all #include directives.
7903         Include unlocked-io.h only if !_LIBC.
7904         [_LIBC]: Include <libio/libioP.h>.
7905         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7906         (fflush): Tweak definition to use INTUSE.
7907         (putc): Define.
7908
7909 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7910
7911         * alloca.c [defined emacs]: Include "lisp.h".
7912         (xalloc_die) [defined emacs]: New macro.
7913         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7914         [! defined emacs]: Include <xalloc.h>.
7915         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7916         (pointer): Typedef to POINTER_TYPE *.
7917         (malloc): Remove decl; we now always use xmalloc.
7918         (alloca): Use old-style definition, since Emacs needs this.
7919         Check for arithmetic overflow when computing combined size.
7920
7921 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7922
7923         Do not generate unlocked-io.h automatically, since it's easier to
7924         maintain it by hand.
7925
7926         * unlocked-io.h: New file, from GNU diffutils,
7927         but with proper copyright notice and attribution.
7928         * gen-uio: Remove.
7929         * Makefile.am: Add copyright notice.
7930         (libfetish_a_SOURCES): Add unlocked-io.h.
7931         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7932         (DISTCLEANFILES, io_functions): Remove macros.
7933         (EXTRA_DIST): Remove gen_uio.
7934         (unlocked-io.h): Remove rule.
7935
7936 2002-12-04  Jim Meyering  <jim@meyering.net>
7937
7938         Reflect the fact that stat.c and lstat.c are no longer generated.
7939         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7940         (DISTCLEANFILES): Likewise.
7941         (EXTRA_DIST): Likewise.
7942         (all_local): Don't depend on stat.c or lstat.c.
7943         (stat.c, lstat.c): Remove rules.
7944         (EXTRA_DIST): Remove xstat.in.
7945
7946         * xstat.in: Remove file.  Contents moved into stat.c.
7947         * stat.c: New file.  Contents mostly from xstat.in.
7948         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7949         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7950
7951         * safe-read.c: Rework so that it may serve to define safe_write, too.
7952         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7953
7954 2002-12-03  Jim Meyering  <jim@meyering.net>
7955
7956         * safe-read.c, safe-write.c: Change variable names and comments, but
7957         not semantics, to minimize the differences between these two files.
7958         (safe_read): Change comment to mention SAFE_READ_ERROR.
7959
7960         * safe-read.c (IS_EINTR): Define.
7961         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7962
7963 2002-12-02  Bruno Haible  <bruno@clisp.org>
7964
7965         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7966         Define, taken from safe-read.c.
7967         (INT_MAX): Provide fallback.
7968         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7969         * safe-write.h (SAFE_WRITE_ERROR): Define.
7970
7971         * safe-read.c (EINTR): Remove definition.
7972         (safe_read): Don't use EINTR if it is absent.
7973
7974 2002-12-02  Jim Meyering  <jim@meyering.net>
7975
7976         * safe-read.c (EINTR): Define.
7977         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7978         (INT_MAX): Provide fallback.
7979         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7980
7981         * safe-read.h (SAFE_READ_ERROR): Define.
7982
7983 2002-12-01  Jim Meyering  <jim@meyering.net>
7984
7985         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7986         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7987
7988 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7989
7990         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7991         hash_rehash): Replace `if (limit <= value) abort ();' with
7992         `if (! (value < limit)) abort ();', for readability.
7993
7994 2002-11-26    <karl@gnu.org>
7995
7996         * strdup.c: copy from libc again, with jim's ok.
7997         * .cppi-disable: re-add strdup.c
7998
7999 2002-11-25    <karl@gnu.org>
8000
8001         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8002         instead of "strtol.c".
8003
8004 2002-11-25  Jim Meyering  <jim@meyering.net>
8005
8006         * mktime.c: Sync from libc, now that it has the latest fix.
8007
8008 2002-11-24    <karl@gnu.org>
8009
8010         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8011         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8012
8013 2002-11-24  Jim Meyering  <jim@meyering.net>
8014
8015         Update from coreutils:
8016
8017         * mktime.c: Merge in changes from libc.
8018
8019         Avoid a link-time failure on some Linux systems.
8020         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8021         (__mon_yday): Declare with the STATIC attribute.
8022         (__mktime_internal): Likewise.
8023         Based on a report from Greg Schafer.
8024
8025 2002-11-23  Jim Meyering  <jim@meyering.net>
8026
8027         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8028         Use `unsigned', not `int', as type of index.
8029
8030         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8031
8032         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8033
8034 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8035
8036         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8037         hint that one should use `if (! x) abort ();' rather than `assert
8038         (x);', and anyway it's one less thing to worry about configuring.
8039         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8040         hash_rehash, hash_insert): Use abort rather than assert.
8041
8042 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8043
8044         * quotearg.h: Allow multiple inclusion by surrounding with
8045         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8046         so that we can be included first.
8047         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8048         * quotearg.c: Include quotearg.h immediately after config.h.
8049         No need to include stddef.h or sys/types.h any more.
8050         Surround local include files with "", not "<>".
8051         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8052         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8053         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8054         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8055         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8056         (ISPRINT): Remove; no longer needed now that we assume C89.
8057
8058         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8059         Preserve errno.
8060
8061         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8062         quotearg_char): Use SIZE_MAX rather than
8063         (size_t) -1 when we are talking about "infinity".
8064
8065         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8066
8067 2002-11-22  Bruno Haible  <bruno@clisp.org>
8068
8069         * safe-read.h: Assume C89. Add comments.
8070         (safe_read): Change return type to size_t.
8071         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8072         counts > SSIZE_MAX correctly.
8073         * safe-write.h: New file.
8074         * safe-write.c: New file.
8075         * full-read.h: New file.
8076         * full-read.c: New file.
8077         * full-write.h: Assume C89. Add comments.
8078         * full-write.c: Include safe-write.h.
8079         (full_write): Rewritten to use safe_write.
8080         Suggested by Jim Meyering and Paul Eggert.
8081
8082 2002-11-21  Bruno Haible  <bruno@clisp.org>
8083
8084         Remove case insensitive option matching.
8085         * argmatch.h (argcasematch): Remove declaration.
8086         (ARGCASEMATCH): Remove macro.
8087         (__xargmatch_internal): Remove case_sensitive argument.
8088         (XARGMATCH): Update.
8089         (XARGCASEMATCH): Remove macro.
8090         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8091         case_sensitive argument.
8092         (argcasematch): Remove function.
8093         (__xargmatch_internal): Remove case_sensitive argument.
8094         (main): Use XARGMATCH instead of XARGCASEMATCH.
8095
8096         * xmalloc.c: Change compile-time error message. Add comment about
8097         required autoconf version.
8098
8099 2002-11-21  Jim Meyering  <jim@meyering.net>
8100
8101         * strdup.c (strdup): Tweak comment and initial #if/#include.
8102
8103         Merge in changes from the coreutils.
8104
8105         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8106         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8107         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8108         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8109         int.  Work more efficiently if X is the same width as uintmax_t.
8110         Do not compare X to -1, to avoid bogus compiler warning.
8111         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8112         Don't assume that f_frsize and f_bsize are the same type.
8113
8114         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8115         on FreeBSD.
8116
8117         * makepath.c (make_path): Restore umask *before* creating the final
8118         component.
8119         (make_path): Minor reformatting.
8120
8121         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8122         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8123
8124         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8125         ones.  At least on GNU/Linux systems, `auto' means something else.
8126         From Michael Stone.
8127
8128 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8129
8130         Merge argmatch cleanups from Bison.  Assume C89.
8131
8132         * argmatch.c: Include config.h here, not in argmatch.h.
8133         Include stdlib.h, for EXIT_FAILURE.
8134         Always include <string.h>, since we assume C89.
8135         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8136         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8137         Include <stddef.h> instead, since it's all we need for size_t.
8138         (PARAMS): Remove.  All uses removed.
8139         (ARRAY_CARDINALITY): Do not bother to #undef.
8140         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8141         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8142         Remove unnecessary parentheses.
8143         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8144         Insert necessary parentheses.
8145         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8146         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8147
8148 2002-11-19  Bruno Haible  <bruno@clisp.org>
8149
8150         * mbswidth.c: Include mbswidth.h right at the beginning.
8151         * mbswidth.h: Include <stddef.h>, for size_t.
8152
8153         * mbswidth.h (PARAMS): Remove macro.
8154         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8155         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8156
8157         * gcd.h (PARAMS): Remove macro.
8158         (gcd): Use ANSI C function declarations.
8159         * gcd.c (gcd): Likewise.
8160
8161 2002-11-15  Bruno Haible  <bruno@clisp.org>
8162
8163         * strcspn.c: Include <stddef.h>.
8164         (strcspn): Use ANSI C function declaration. Change return type to
8165         size_t. Use NULL.
8166         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8167         (strpbrk): Use NULL.
8168         * strpbrk.h (PARAMS): Remove macro.
8169         (strpbrk): Use ANSI C function declaration.
8170         * strstr.c: Don't include <sys/types.h>.
8171         * strstr.h (PARAMS): Remove macro.
8172         (strstr): Use ANSI C function declarations.
8173
8174 2002-11-06  Bruno Haible  <bruno@clisp.org>
8175
8176         * gcd.h (gcd): Change argument type to 'unsigned long'.
8177         * gcd.c (gcd): Likewise.
8178
8179 2002-11-05  Bruno Haible  <bruno@clisp.org>
8180
8181         * gcd.h: New file, from gettext-0.11.5.
8182         * gcd.c: New file, from gettext-0.11.5.
8183
8184 2002-11-05  Bruno Haible  <bruno@clisp.org>
8185
8186         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8187         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8188         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8189         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8190
8191         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8192         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8193
8194         * closeout.c: Include gettext.h instead of <libintl.h>.
8195         * human.c: Include gettext.h instead of <libintl.h>.
8196         * quotearg.c: Include gettext.h instead of <libintl.h>.
8197         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8198         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8199         * userspec.c: Include gettext.h instead of <libintl.h>.
8200         * version-etc.c: Include gettext.h instead of <libintl.h>.
8201         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8202         (textdomain): Remove definition.
8203         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8204
8205         * long-options.c: Remove include of <libintl.h> and definition of _.
8206         * same.c: Remove include of <libintl.h> and definition of _.
8207
8208 2002-11-04  Bruno Haible  <bruno@clisp.org>
8209
8210         * stpcpy.h: New file, from GNU gettext-0.11.5.
8211         * strcase.h: New file, from GNU gettext-0.11.5.
8212         * strpbrk.h: New file, from GNU gettext-0.11.5.
8213         * strstr.h: New file, from GNU gettext-0.11.5.
8214         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8215
8216 2002-05-09  Bruno Haible  <bruno@clisp.org>
8217
8218         * config.charset: Update for newest glibc. Add canonical names
8219         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8220
8221 2002-05-09  Bruno Haible  <bruno@clisp.org>
8222
8223         * localcharset.c (get_charset_aliases): Add more Windows specific
8224         aliases.
8225
8226 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8227
8228         * config.charset: A few additions for Solaris.
8229
8230 2001-12-05  Bruno Haible  <bruno@clisp.org>
8231
8232         * localcharset.c (locale_charset): Don't return an empty string.
8233
8234 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8235
8236         * config.charset: msdos in uk_UA uses CP1125.
8237
8238 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8239
8240         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8241         * localcharset.c (locale_charset): Declare as extern "C".
8242
8243 2002-02-15  Bruno Haible  <bruno@clisp.org>
8244
8245         * config.charset [msdosdjgpp]: For Russian, use CP866.
8246
8247 2002-02-11  Bruno Haible  <bruno@clisp.org>
8248
8249         * config.charset: Add support for NetBSD.
8250
8251 2002-09-25    <karl@gnu.org>
8252
8253         * strdup.c: copy from libc/string (via ../config/srclist*).
8254         * getopt*: copy from libc/posix.
8255         * gettext.h: copy from gettext.
8256         * .cppi-disable: add strdup.c, gettext.h.
8257
8258 2002-07-01  Jim Meyering  <meyering@lucent.com>
8259
8260         * c-stack.c: Include sys/time.h.
8261         From Volker Borchert.
8262
8263 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8264
8265         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8266         New macro.  Use it uniformly instead of
8267         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8268         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8269         reported by Vin Shelton.
8270
8271 2002-06-22  Jim Meyering  <meyering@lucent.com>
8272
8273         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8274         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8275
8276 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8277
8278         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8279         Do not assume SA_SIGINFO behavior.
8280         Bug reported by Jim Meyering on NetBSD 1.5.2.
8281
8282 2002-06-22  Jim Meyering  <meyering@lucent.com>
8283
8284         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8285
8286         * exitfail.c, exitfail.h: Likewise.
8287         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8288
8289         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8290         of fnmatch.h.
8291         (EXTRA_DIST): Add fnmatch_loop.c.
8292         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8293
8294         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8295         * fnmatch.c: Update from diffutils-2.8.2.
8296         * fnmatch_.h: New file.  From diffutils-2.8.2.
8297         * fnmatch.h: Remove file.
8298
8299 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8300
8301         * file-type.h: Report an error if neither S_ISREG nor
8302         S_IFREG is defined, instead of using a test specific to glibc
8303         2.2.  This should be safe, since POSIX requires S_ISREG and
8304         Unix Version 7 had S_IFREG.  We don't need to check for
8305         <sys/types.h> since we don't use any symbols that it defines.
8306
8307 2002-06-15  Jim Meyering  <meyering@lucent.com>
8308
8309         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8310         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8311         have been included before this file.
8312
8313 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8314
8315         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8316         so that each temporary file name is unique and valid in the first
8317         8 characters, for operation under DOS.
8318
8319 2002-06-15  Jim Meyering  <meyering@lucent.com>
8320
8321         Work even with DJGPP 2.03, which lacks support for symlinks.
8322         From Richard Dawe.
8323         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8324         is defined.
8325         * lchown.c (S_ISLNK): Likewise.
8326
8327 2002-06-14  Jim Meyering  <meyering@lucent.com>
8328
8329         * file-type.h: Use the version from diffutils-2.8.2.
8330         * file-type.c: Likewise.
8331
8332 2002-05-27  Jim Meyering  <meyering@lucent.com>
8333
8334         Fix a problem seen only on nonconforming systems whereby ls.c's
8335         use of localtime, and then of gettimeofday would cause trouble:
8336         the localtime call used to initialize rpl_gettimeofday's save
8337         mechanism would clobber ls's current local time information so
8338         that in any long listing the first file would always be listed
8339         with date 1970-01-01.  Analysis by Volker Borchert.
8340
8341         * gettimeofday.c (localtime): Undefine.
8342         (rpl_localtime): New function.
8343
8344 2002-05-22  Jim Meyering  <meyering@lucent.com>
8345
8346         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8347         * file-type.h: New file.
8348         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8349
8350 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8351
8352         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8353
8354 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8355
8356         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8357         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8358         of 127, since 64 is the largest conceivable number for ancient
8359         nonstandard hosts.
8360         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8361
8362 2002-04-28  Jim Meyering  <meyering@lucent.com>
8363
8364         * sig2str.c (WTERMSIG): Remove definition (unused).
8365
8366 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8367
8368         * sig2str.h, sig2str.c: New files.
8369         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8370
8371 2002-04-24  Jim Meyering  <meyering@lucent.com>
8372
8373         * gettext.h: New file, from Gettext.
8374         * Makefile.am (INCLUDES): Remove -I../intl.
8375         (libfetish_a_SOURCES): Add gettext.h.
8376
8377 2002-04-16  Jim Meyering  <meyering@lucent.com>
8378
8379         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8380         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8381         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8382
8383 2002-04-12  Jim Meyering  <meyering@lucent.com>
8384
8385         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8386
8387 2002-03-10  Jim Meyering  <meyering@lucent.com>
8388
8389         * makepath.c (make_path): Remove a comma from a diagnostic.
8390         Suggestion from Santiago Vila.
8391
8392 2002-03-08  Jim Meyering  <meyering@lucent.com>
8393
8394         * rename.c: Mention that this wrapper is needed also on
8395         mips-dec-ultrix4.4 systems.
8396
8397 2002-03-02  Jim Meyering  <meyering@lucent.com>
8398
8399         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8400         not HAVE_CLOCK_SETTIME.
8401
8402 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8403
8404         * nanosleep.h: Rename to....
8405         * timespec.h: New name for nanosleep.h.  All uses changed.
8406
8407         * gettime.c: New file.
8408         * settime.c: New file.
8409         * stime.c: Remove.
8410
8411         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8412         timespec.h.  Remove nanosleep.h.
8413
8414 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8415
8416         * acl.c, acl.h: New files.
8417         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8418
8419 2002-02-24  Jim Meyering  <meyering@lucent.com>
8420
8421         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8422         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8423         cause trouble.  Reported by Nelson Beebe.
8424
8425 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8426
8427         * path-concat.c (xpath_concat): Reorder code to pacify
8428         compilers that don't know that xalloc_die never returns.
8429
8430 2002-02-20  Jim Meyering  <meyering@lucent.com>
8431
8432         * getdate.c: Regenerate using bison-1.33.
8433
8434 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8435
8436         * posixver.c, posixver.h: New files.
8437         * Makefile.am (libfetish_a_SOURCES): Add them.
8438
8439 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8440             Bruno Haible  <bruno@clisp.org>
8441
8442         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8443         (fwrite_success_callback): New declaration.
8444         * unicodeio.c (unicode_to_mb): New function, extracted from
8445         print_unicode_char. Call failure callback instead of error.
8446         (fwrite_success_callback): New function.
8447         (exit_failure_callback): New function.
8448         (fallback_failure_callback): New function.
8449         (print_unicode_char): Call unicode_to_mb.
8450
8451 2002-01-26  Jim Meyering  <meyering@lucent.com>
8452
8453         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8454
8455 2002-01-22  Jim Meyering  <meyering@lucent.com>
8456
8457         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8458         Otherwise, some versions of automake would omit the rule that makes
8459         Makefile from Makefile.in.
8460
8461 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8462
8463         * xmemcoll.h, xmemcoll.c: New files.
8464         * Makefile.am (libfetish_a_SOURCES): Add them.
8465         * memcoll.c: Include errno.h, and declare errno if not defined.
8466         (memcoll): Set errno to zero if there is no error.
8467
8468         * quotearg.c (quotearg_buffer_restyled):
8469         Fix bug with quoting buffers containing NUL when backslashing escapes.
8470         This bug was exposed by the other changes in this patch.
8471         (quotearg_n_options): New arg ARGSIZE.
8472         All callers changed.
8473         (quoting_options_from_style): New function.
8474         (quotearg_n_style): Use it.
8475         (quotearg_n_style_mem): New function.
8476
8477         * quotearg.h (quotearg_n_style_mem): New function.
8478
8479 2002-01-16  Jim Meyering  <meyering@lucent.com>
8480
8481         * getdate.y: Add three semicolons, each just before a closing brace.
8482         Bison (as of version 1.31) no longer papers over that mistake.
8483
8484 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8485
8486         * backupfile.c (ISDIGIT): Comment fix.
8487         * getdate.y (ISDIGIT): Likewise.
8488         * posixtm.c (ISDIGIT, year): Likewise.
8489         * strverscmp.c (ISDIGIT): Likewise.
8490         * userspec.c (ISDIGIT): Likewise.
8491
8492 2002-01-05  Jim Meyering  <meyering@lucent.com>
8493
8494         * version-etc.c (version_etc_copyright): Update copyright year.
8495
8496 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8497
8498         * closeout.c (close_stdout_status): If ferror (stdout), do
8499         not silently exit merely because the output buffer happens to
8500         have nothing pending.
8501
8502 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8503
8504         See the big note in ../ChangeLog.
8505         * human.c (suffixes): Prefer K to k for 1024.
8506         (generate_suffix_backwards): New function.
8507         (human_readable_inexact): Use it.
8508         * xstrtol.c (__xstrtol): If there is no number but there
8509         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8510         Accept 'K' as well as 'k'.
8511
8512 2001-12-15  Jim Meyering  <meyering@lucent.com>
8513
8514         * regex.h (__restrict_arr): Update from libc.
8515
8516         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8517         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8518         (STREQ): Define.
8519
8520 2001-12-10  Jim Meyering  <meyering@lucent.com>
8521
8522         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8523         Instead, include "xalloc.h".
8524         (initbuffer): Don't cast xmalloc return value to char*.
8525         (readline): Reword comment.
8526         Don't cast xrealloc return value to char*
8527         Return NULL, not 0.
8528
8529 2001-12-09  Jim Meyering  <meyering@lucent.com>
8530
8531         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8532         `signed and unsigned type in conditional expression'.
8533         * posixtm.c (posix_time_parse): Likewise.
8534
8535         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8536
8537         * readtokens.c (readtoken): Declare an index to be of type unsigned
8538         to avoid a pedantic warning.
8539
8540         * getstr.c: Don't include assert.h.
8541         (getstr): Remove warning-evoking assertions.
8542         Return -1 if offset parameter is out of bounds.
8543         Change the type of a local from int to size_t.
8544
8545         * strftime.c (my_strftime_localtime_r): Include this function
8546         definition in the `#if ! HAVE_TM_GMTOFF' block.
8547
8548         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8549         Include xalloc.h instead.
8550
8551 2001-12-02  Jim Meyering  <meyering@lucent.com>
8552
8553         * tempname.c: Don't declare getenv, thus reverting the change of
8554         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8555         included.
8556
8557         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8558         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8559
8560 2001-11-30  Akim Demaille  <akim@epita.fr>
8561
8562         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8563         before being defined.
8564
8565 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8566
8567         * quotearg.h (quotearg_n, quotearg_n_style):
8568         First arg is int, not unsigned.
8569         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8570         (SIZE_MAX, UINT_MAX): New macros.
8571         (quotearg_n_options): Abort if N is negative.
8572         Avoid overflow check on hosts where size_t is 64 bits and int
8573         is 32 bits, as overflow is impossible there.
8574         Fix off-by-one typo that caused unnecessary reallocation.
8575
8576 2001-11-27  Jim Meyering  <meyering@lucent.com>
8577
8578         * tempname.c: Merge with version from libc.
8579         * regex.c: Likewise.
8580
8581         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8582         for which STDC_HEADERS is 0, it was not included, resulting in a
8583         warning about an integer-to-pointer conversion problem with getenv.
8584         Reported by Volker Borchert.
8585
8586 2001-11-26  Jim Meyering  <meyering@lucent.com>
8587
8588         * gtod.h: Remove file.
8589         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8590         * gettimeofday.c: Don't include gtod.h.
8591         (GTOD_init): Remove function.
8592         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8593         Suggestion from Volker Borchert.
8594
8595 2001-11-23  Jim Meyering  <meyering@lucent.com>
8596
8597         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8598         * hash.c (struct hash_table): Define it here instead.
8599
8600 2001-11-22  Jim Meyering  <meyering@lucent.com>
8601
8602         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8603
8604 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8605
8606         * tempname.c (TMP_MAX): Remove; no longer needed.
8607         (TEMPORARIES): New macro.
8608         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8609         removes an artificial limitation (e.g. HP-UX 10.20, where
8610         TMP_MAX is 17576).
8611
8612 2001-11-18  Jim Meyering  <meyering@lucent.com>
8613
8614         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8615         on SunOS 4.
8616
8617         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8618         files will be created before anything else.
8619
8620 2001-11-17  Jim Meyering  <meyering@lucent.com>
8621
8622         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8623         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8624         rather than group writable.  Patch by Juan F. Codagnone.
8625
8626         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8627         Instead, include "xalloc.h".
8628
8629         * mountlist.c: Include unlocked-io.h after all system headers.
8630         Remove explicit declarations of xmalloc, xrealloc,
8631         and xstrdup.  Instead, include "xalloc.h".
8632
8633         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8634         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8635         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8636
8637         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8638         Reported by Padraig Brady.
8639
8640         * mkstemp.c: #undef mkstemp.
8641         Include config.h.
8642         (rpl_mkstemp): Rename from mkstemp.
8643         Protoize.
8644
8645 2001-11-16  Jim Meyering  <meyering@lucent.com>
8646
8647         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8648         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8649         determine the amount of total physical memory, use pstat_getstatic.
8650         HPUX-11 doesn't define _SC_PHYS_PAGES.
8651         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8652         If sysconf couldn't be used to determine the amount of available
8653         physical memory, use both pstat_getstatic and pstat_getdynamic.
8654         Based on a patch from Bob Proulx.
8655
8656 2001-11-05  Jim Meyering  <meyering@lucent.com>
8657
8658         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8659
8660 2001-11-03  Jim Meyering  <meyering@lucent.com>
8661
8662         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8663         in argmatch_to_argument call.
8664
8665         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8666         argument.
8667
8668         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8669         e.g., a fault due to an attempt to free a NULL pointer.
8670
8671 2001-11-01  Jim Meyering  <meyering@lucent.com>
8672
8673         * dirfd.c, dirfd.h: New files.
8674         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8675
8676         * hash.c (hash_print) [TESTING]: Clean up.
8677
8678 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8679
8680         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8681         to avoid a warning if -Wall.
8682
8683 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8684
8685         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8686
8687 2001-10-21  Jim Meyering  <meyering@lucent.com>
8688
8689         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8690         this code would end up calling gettext even in packages built
8691         with --disable-nls.
8692         * getopt.c (_): Likewise.
8693         * regex.c (_): Likewise.
8694
8695 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8696
8697         * error.c (strerror_r): Do not declare unless !_LIBC.
8698         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8699         Use strerror_r that is only a macro, even if it is not a function.
8700         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8701         (private_strerror): Use prototypes, not old-style function definition.
8702         (print_errno_message): New function.
8703         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8704         char*-flavored one.
8705         (error_tail, error, error_at_line): Use it.
8706
8707 2001-10-11  Jim Meyering  <meyering@lucent.com>
8708
8709         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8710         and quote_n (1, ... to avoid clobbering a buffer.
8711
8712 2001-10-05  Jim Meyering  <meyering@lucent.com>
8713
8714         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8715         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8716         * hash-pjw.h: New file.
8717
8718 2001-09-30  Jim Meyering  <meyering@lucent.com>
8719
8720         * mountlist.c [MOUNTED_GETFSSTAT]:
8721         Include <sys/ucred.h>, for Apple Darwin.
8722         Include sys/mount.h and sys/fs_types.h only if available.
8723         (FS_TYPE): Define.
8724         (read_filesystem_list): Use FS_TYPE.
8725
8726 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8727
8728         * exclude.c (excluded_filename): 0 -> false, since it's
8729         a boolean context.
8730
8731 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8732
8733         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8734         #defines strtoimax.  Also treat the other strto* functions
8735         like strtoimax.
8736
8737         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8738         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8739         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8740
8741 2001-09-26  Jim Meyering  <meyering@lucent.com>
8742
8743         Most macros in unlocked-io.h had the wrong number of arguments.
8744         * gen-uio: New script.
8745         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8746         * unlocked-io.hin: Remove file.
8747         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8748         rather than trying to embed it here.
8749         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8750         Reported by Padraig Brady.
8751
8752 2001-09-25  Volker Borchert  <bt@teknon.de>
8753
8754         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8755
8756 2001-09-23  Jim Meyering  <meyering@lucent.com>
8757
8758         * mountlist.c: Remove useless parentheses in #if directives.
8759         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8760         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8761
8762 2001-09-22  Jim Meyering  <meyering@lucent.com>
8763
8764         * localcharset.c: Update from latest gettext.
8765         * config.charset: Likewise.
8766
8767 2001-09-20  Jim Meyering  <meyering@lucent.com>
8768
8769         * xstrtol.c (strtoimax): Guard declaration with
8770         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8771         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8772         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8773         (strtoumax): Likewise, for completeness (it wasn't necessary).
8774
8775 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8776
8777         * strtoimax.c (HAVE_LONG_LONG):
8778         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8779         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8780         to work around bug in IBM C compiler.
8781
8782 2001-09-16  Jim Meyering  <meyering@lucent.com>
8783
8784         * mkdir.c: New file.
8785
8786 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8787
8788         * xgetcwd.c: Revert some of the previous change; intead,
8789         fix the HAVE_GETCWD_NULL code to behave more like the
8790         !HAVE_GETCWD_NULL code used to.
8791
8792         Include "xalloc.h".
8793         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8794         invoke xalloc_die.
8795
8796 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8797
8798         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8799         Use ssize_t, not int, to store result of readlink.
8800         Check for ssize_t overflow as well as size_t overflow,
8801         as POSIX says the result of readlink is implementation-defined
8802         when ssize_t overflows.
8803         Remove unnecessary cast to char*.
8804         Use free+malloc instead of realloc, as the storage doesn't need
8805         to be preserved and it's clearer and can be more efficient that way.
8806         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8807         * xreadlink.h (xreadlink): Update prototype.
8808
8809 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8810
8811         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8812         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8813         spotted by Jim Meyering.
8814
8815 2001-09-03  Jim Meyering  <meyering@lucent.com>
8816
8817         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8818
8819 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8820
8821         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8822         like the HAVE_GETCWD_NULL code.
8823         Include pathmax.h if not HAVE_GETCWD.
8824         Do not include xalloc.h.
8825         (INITIAL_BUFFER_SIZE): New symbol.
8826         Do not use xmalloc / xrealloc, since the caller is responsible for
8827         handling errors.  Preserve errno around `free' during failure.
8828         Do not overrun buffer when using getwd.
8829
8830 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8831
8832         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8833         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8834
8835 2001-09-02  Jim Meyering  <meyering@lucent.com>
8836
8837         * error.c: Update from GNU libc.
8838
8839 2001-09-01  Jim Meyering  <meyering@lucent.com>
8840
8841         * xreadlink.c: New file.
8842         * xreadlink.h: New file.
8843         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8844
8845         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8846         doesn't conflict with sparc Solaris 7's definition in
8847         /usr/include/sys/int_types.h.
8848
8849         * exclude.c: Use `""', not `<>' to #include non-system header files.
8850         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8851         and strncasecmp as r-values.  Unixware didn't have declarations.
8852
8853 2001-08-31  Jim Meyering  <meyering@lucent.com>
8854
8855         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8856         Use an initial, malloc'd, buffer of length 128 rather than
8857         a statically allocated one of length 1024.
8858
8859 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8860
8861         * xgetcwd.c: Don't include pathmax.h.
8862         Include stdlib.h and unistd.h if available.
8863         Include xalloc.h.
8864         (xmalloc, xstrdup, free): Remove decls.
8865         (xgetcwd): Don't assume sizes fit in unsigned.
8866         Check for overflow when computing sizes.
8867         Simplify reallocation code.
8868
8869 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8870
8871         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8872
8873         * strtoimax.c: Renamed from strtoxmax.c, removing the
8874         old strtoimax.c.
8875
8876         Also, make the following further changes to make this file's
8877         configuration more similar to that of strtol.c:
8878         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8879         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8880         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8881         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8882         changed to signed values.
8883
8884         And make the following changes as well:
8885         Fix copyright notice, as 1999 was missing.
8886         (verify): New macro.
8887         (strtoimax): Check sizes at compile-time, not run-time.
8888         Prefer strtol to strtoll if both work.
8889         (main): Remove; it was not that useful and was a pain to maintain.
8890
8891         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8892
8893 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8894
8895         * savedir.c (savedir): Remove size parameter, as POSIX says that
8896         a directory's st_size can have an arbitrary value, so the old
8897         usage could waste an arbitrary amount of memory.  All uses
8898         changed.
8899         * savedir.h: Update prototype.
8900
8901 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8902
8903         * xstrtol.c (strtoimax): New decl.
8904
8905 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8906
8907         * xstrtol.h: Add copyright notice.
8908         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8909         LONGINT_INVALID_SUFFIX_CHAR.
8910
8911 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8912
8913         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8914         tm to be declared.
8915
8916 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8917
8918         * hash.c: Remove '2001' from copyright notice.
8919
8920 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8921
8922         * full-write.h: New file.
8923         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8924         * full-write.c: Correct credits, as cccp.c no longer
8925         exists and anyway it was so heavily changed from the old cccp
8926         code as to be unrecognizable.  Include full-write.h.
8927         (full_write) Return size_t, with short writes meaning failure.
8928         All callers changed.  This fixes a bug with large buffers
8929         on 64-bit hosts.
8930         * utime.c: Include full-write.h.
8931
8932 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8933
8934         Merge 'exclude' changes from tar 1.13.22.
8935         This fixes one or two unlikely storage allocation overflow bugs,
8936         but doesn't change user-visible behavior otherwise.
8937
8938 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8939
8940         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8941         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8942         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8943         Include if available.
8944         (<xalloc.h>): Include
8945         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8946         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8947         collide with FNM macros.
8948         (struct patopts): New struct.
8949         (struct exclude): Use it, as exclude patterns now come with options.
8950         (new_exclude): Support above changes.
8951         (new_exclude, add_exclude_file):
8952         Initial size must now be a power of two to simplify overflow checking.
8953         (free_exclude, fnmatch_no_wildcards): New function.
8954         (excluded_filename): No longer requires options arg, as the options
8955         are determined by add_exclude.  Now returns bool, not int.
8956         (excluded_filename, add_exclude):
8957         Add support for the fancy new exclusion options.
8958         (add_exclude, add_exclude_file): Now takes int options arg.
8959         Check for arithmetic overflow when computing sizes.
8960         (add_exclude_file): xrealloc might modify errno, so don't
8961         realloc until after errno might be used.
8962
8963         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8964         New macros.
8965         (free_exclude): New decl.
8966         (add_exclude, add_exclude_file): Now takes int options arg.
8967         (excluded_filename): No longer requires options arg, as the options
8968         are determined by add_exclude.  Now returns bool, not int.
8969
8970 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8971
8972         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8973
8974 2001-08-27  Jim Meyering  <meyering@lucent.com>
8975
8976         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8977
8978         * version-etc.c (N_): Remove definition.
8979         Revert most of last change.
8980         Instead, simply don't mark the `Copyright...' string for translation.
8981         Based on advice from Paul Eggert.
8982
8983         * strtoxmax.c: Tweak comment.
8984
8985 2001-08-26  Jim Meyering  <meyering@lucent.com>
8986
8987         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8988         of copyright with `%s' so translators don't get an untranslated
8989         message in 2002.
8990         (COPYRIGHT_YEAR): Define.
8991         (version_etc): Use fprintf rather than fputs.
8992         Suggestion from Ulrich Drepper.
8993
8994         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8995
8996         * strtoll.c: New file, from GNU libc.
8997         * xstrtoimax.c: New file.
8998
8999         * xstrtol.h: Add xstrtoimax.
9000         * strtoumax.c: New file.  Simply include "strtoumax.c".
9001         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9002
9003         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9004         * strtoxmax.c: ... then renamed to this.
9005
9006 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9007
9008         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9009         Port to Solaris 8, where 'sed' requires a space after the 'r'
9010         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9011         Redirect output to $tmp just once.
9012
9013 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9014
9015         * addext.c (<errno.h>): Include.
9016         (errno): Declare if not defined.
9017         (addext): Work correctly when pathconf returns -1 and leaves
9018         errno alone because there is no limit.  Also, work even if
9019         pathconf returns a value greater than SIZE_MAX.
9020
9021 2001-08-12  Jim Meyering  <meyering@lucent.com>
9022
9023         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9024         Simply `return getcwd (NULL, 0);'.
9025         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9026         Use 1300 as initial value for length, not PATH_MAX.
9027
9028         * pathmax.h: Clean up cpp syntax.
9029
9030 2001-08-12  Jim Meyering  <meyering@lucent.com>
9031
9032         * gettimeofday.c: New file.
9033         * gtod.h: New file.
9034         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9035
9036 2001-08-04  Jim Meyering  <meyering@lucent.com>
9037
9038         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9039         to get in sync with glibc.
9040
9041 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9042
9043         The following changes are from gettext 0.10.39 as maintained by
9044         Bruno Haible.
9045
9046         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9047         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9048         with inverted sense.  All uses changed.
9049
9050         * mbswidth.c: Don't include <limits.h>.
9051         Include <stdlib.h> and <string.h> unconditionally.
9052         (iswcntrl, mbsinit, ISCNTRL): New macros.
9053         (mbsnwidth): Use K&R style function declarations.
9054         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9055         can optimize it when MB_CUR_MAX == 1.
9056         The width of control characters is zero, not 1.
9057
9058 2001-07-15  Jim Meyering  <meyering@lucent.com>
9059
9060         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9061         (BUILT_SOURCES): Add unlocked-io.h.
9062         (io_functions): Define.
9063         (unlocked-io.h): New rule.
9064         (DISTCLEANFILES): Add unlocked-io.h.
9065         (all-local): Depend on unlocked-io.h, to ensure it is created.
9066
9067         * unlocked-io.hin: New file
9068
9069         * regex.c: Update from glibc.
9070
9071 2001-07-05  Jim Meyering  <meyering@lucent.com>
9072
9073         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9074         recommendation.
9075         (libfetish_a_SOURCES): Put all .h files here instead.
9076         Remove a thus-exposed (better checks in automake) duplicate and
9077         two unnecessary .h files.
9078
9079 2001-06-11  Jim Meyering  <meyering@lucent.com>
9080
9081         * regex.c: Update from GNU libc.
9082
9083 2001-05-27  Jim Meyering  <meyering@lucent.com>
9084
9085         * readutmp.h (UT_TYPE): Define.
9086
9087 2001-05-24  Jim Meyering  <meyering@lucent.com>
9088
9089         * argmatch.c: Include "quote.h".
9090         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9091         quote function.  Reported by Göran Uddeborg.
9092
9093 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9094
9095         * dirname.c (dir_name): Compute append_dot using path, not newpath
9096         which is not yet declared.
9097
9098 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9099
9100         * Makefile.am (libfetish_a_SOURCES):
9101         Add strftime.c, since we now compile it on all hosts.
9102
9103         * strftime.c (my_strftime):
9104         Define to nstrftime if emacs, but only if my_strftime is not defined.
9105         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9106         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9107         Add one more extra argument: a nanoseconds value.
9108         All uses changed.
9109         (ns): New macro.
9110         (my_strftime function): Add %N format.
9111         (emacs_strftimeu): Renamed from emacs_strftime,
9112         with extra ut argument.
9113
9114 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9115
9116         dirname code cleanup.  base_name now behaves more compatibly
9117         with POSIX basename when given file names that have trailing
9118         slashes, and similarly for dir_name.  Add new primitives
9119         base_len and dir_len.  Put the directory-name-related decls
9120         into dirname.h.
9121
9122         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9123         * backupfile.c (base_name): Likewise.
9124         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9125         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9126         * makepath.c (strip_trailing_slashes): Likewise.
9127         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9128         Likewise.
9129         * rename.c (strip_trailing_slashes): Likewise.
9130         * same.c (base_name): Likewise.
9131         * stripslash.c (ISSLASH): Likewise.
9132
9133         * addext.c: Include <dirname.h> after size_t is defined.
9134         * backupfile.c: Likewise.
9135
9136         * addext.c (addext): Use base_len to trim redundant
9137         trailing slashes instead of doing it ourselves.
9138         But do not trim the last slash if it is not redundant.
9139
9140         * backupfile.c (find_backup_file_name,
9141         max_backup_version): Use base_len instead of rolling it ourselves.
9142         Handle the case of "" and (on DOS) "C:" correctly.
9143
9144         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9145         Include <string.h>, <dirname.h>.
9146         (base_name): Allow file names ending in slashes, other than names
9147         that are all slashes.  In this case, return the basename followed
9148         by the slashes.  This is more general, and can be used in places
9149         where the original base_name purposely had an assertion failure.
9150         (base_len): New function.
9151
9152         * dirname.c: Include <string.h> instead of <stdlib.h>.
9153         Do not include <assert.h>; no longer needed.
9154         Include xalloc.h.
9155         (memrchr): Remove decl.
9156         (dir_name_r): Remove.
9157         (dir_len): Renamed from dirlen.  All callers changed.
9158         Rewrite in terms of base_name, for simplicity and consistency.
9159         (dir_name): Never return NULL.  All callers changed.
9160         Do not include <stdlib.h> in test program; no longer needed.
9161         return 0; is fine for test program.
9162
9163         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9164         New macros.
9165         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9166
9167         * path-concat.c (path_concat): Use base_len to compute
9168         base length, not strlen; this means we cannot rely on memcpy
9169         to null-terminate.
9170
9171         * same.c (STREQ): Remove.
9172         (same_name): Handle the case where the basename ends in trailing '/'.
9173
9174         * stripslash.c (strip_trailing_slashes): Return nonzero if
9175         a slash was stripped.  Do not strip the last slash after a
9176         file system prefix.
9177
9178 2001-04-08  Jim Meyering  <meyering@lucent.com>
9179
9180         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9181         recomputed; that's necessary when the offset spans a DST transition.
9182         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9183
9184 2001-04-02  Jim Meyering  <meyering@lucent.com>
9185
9186         * regex.h, regex.c: Update from GNU libc.
9187
9188 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9189
9190         * version-etc.c (version_etc_copyright): Update to 2001.
9191
9192 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9193
9194         * tempname.c (uint64_t): Define to uintmax_t if
9195         not defined, and if UINT64_MAX is not defined.
9196         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9197         Reported by John David Anglin.
9198
9199 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9200
9201         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9202         alias if codeset is empty.
9203         * config.charset (BeOS): Use wildcard syntax.
9204
9205 2001-03-13  Jim Meyering  <meyering@lucent.com>
9206
9207         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9208         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9209         From Bruno Haible.
9210
9211 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9212
9213         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9214         Don't return NULL.
9215         * unicodeio.c (print_unicode_char): Simplify accordingly.
9216
9217 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9218
9219         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9220         support for DOS/DJGPP.
9221
9222 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9223
9224         * Makefile.am (libfetish_a_SOURCES):
9225         Add dup-safer.c, fopen-safer.c.
9226         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9227
9228         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9229
9230 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9231
9232         The mkstemp replacement is taken from glibc 2.2.2, with some
9233         portability fixes for use outside glibc, as follows:
9234
9235         * tempname.c (struct_stat64): New macro.
9236         (direxists, __gen_tempname): Use it.
9237         This avoids a portability problem with Solaris 8.
9238
9239         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9240         (<stddef.h>, <stdint.h>, <string.h>):
9241         Include only if STDC_HEADERS || _LIBC.
9242         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9243         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9244         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9245         (__set_errno): Define this macro if <errno.h> doesn't.
9246         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9247         Define these macros if <stdio.h> doesn't.
9248         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9249         Define these macros if <sys/stat.h>
9250         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9251         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9252         __xstat64): Define if not _LIBC.
9253         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9254         (__gen_tempname): Invoke gettimeofday only if
9255         HAVE_GETTIMEOFDAY || _LIBC;
9256         otherwise, fall back on plain "time".
9257         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9258
9259         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9260
9261         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9262
9263 2001-02-17  Jim Meyering  <meyering@lucent.com>
9264
9265         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9266         around included file name.
9267
9268         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9269
9270         * strftime.c: Update from GNU libc (the only changes were to comments).
9271
9272 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9273
9274         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9275
9276 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9277
9278         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9279         Remove workaround macros for hosts that have mbrtowc but not
9280         mbstate_t, as we now insist on proper declarations for both
9281         before using mbrtowc.
9282
9283 2001-02-17  Jim Meyering  <meyering@lucent.com>
9284
9285         * regex.c: Update from libc.
9286
9287 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9288
9289         * alloca.c (malloc): Undef before defining, since stdlib.h
9290         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9291         Reported by Mark Hounschell via Paul Eggert.
9292
9293 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9294
9295         * config.charset: Update for FreeBSD 4.2.
9296
9297 2001-01-26  Jim Meyering  <meyering@lucent.com>
9298
9299         * quotearg.c: Include stddef.h.
9300         * quote.c: Include stddef.h.
9301         Reported by Axel Kittenberger.
9302
9303         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9304         line in double quotes so that it evokes a better diagnostic.
9305         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9306         Reported by Axel Kittenberger.
9307
9308 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9309
9310         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9311         to avoid a warning.  Add back 'const' to inptr.
9312
9313 2001-01-16  Jim Meyering  <meyering@lucent.com>
9314
9315         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9316         From Bruno Haible.
9317
9318 2001-01-14  Jim Meyering  <meyering@lucent.com>
9319
9320         * rename.c: New file.  From Volker Borchert.
9321         Include stdlib.h, string.h or strings.h, and xalloc.h.
9322         Use strip_trailing_slashes rather than open-coding it.
9323
9324 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9325
9326         * strftime.c: Sync with glibc time/strftime.c 1.81.
9327
9328 2001-01-03  Jim Meyering  <meyering@lucent.com>
9329
9330         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9331         local `inptr' to avoid warning with some system declarations of iconv.
9332
9333 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9334
9335         * modechange.c: Do not assume that mode_t uses the
9336         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9337         the other-execute bit of FOO even if S_IXOTH != 1.
9338
9339         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9340         WOTH, XOTH, ALLM): New macros.
9341         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9342          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9343         Use them.
9344         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9345         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9346         (mode_compile):
9347         No need to use uintmax_t; unsigned long is long enough.
9348         Don't bother to get suffix since we don't use it.
9349
9350 2000-12-24  Jim Meyering  <meyering@lucent.com>
9351
9352         * hash.c (is_prime): Return explicit boolean values.
9353         (hash_get_first): Return NULL to appease Irix5.6's 89.
9354         Reported by Nelson Beebe.
9355
9356 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9357
9358         * localcharset.c (locale_charset): Add support for Win32.
9359
9360 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9361
9362         * physmem.h, physmem.c: New files.
9363
9364         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9365         (noinst_HEADERS): Add physmem.h.
9366
9367         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9368         't' for compatibility with Solaris 8 sort.
9369
9370 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9371
9372         * config.charset: Add support for BeOS.
9373
9374 2000-12-16  Jim Meyering  <meyering@lucent.com>
9375
9376         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9377         SHELLS_FILE to a file name that's useful on djgpp systems.
9378         Include stdlib.h.
9379         (ADDITIONAL_DEFAULT_SHELLS): Define.
9380         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9381         Based mostly on a patch from Prashant TR.
9382
9383 2000-12-16  Jim Meyering  <meyering@lucent.com>
9384
9385         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9386         N and M) would have treated it like `chown N:N FILE'.
9387
9388         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9389
9390 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9391
9392         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9393         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9394         to the list of canonical encodings. Rename EUC-CN to GB2312.
9395
9396 2000-12-08  Andreas Schwab  <schwab@suse.de>
9397
9398         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9399         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9400
9401 2000-12-07  Jim Meyering  <meyering@lucent.com>
9402
9403         * stripslash.c (ISSLASH): Define.
9404         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9405         From Prashant TR.
9406
9407         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9408         (dir_name_r): Declare this function as static.
9409         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9410         manifest itself on a name containing a mix of slashes and
9411         backslashes.
9412         Make this function work with names starting with a DOS-style
9413         drive letter and colon prefix.
9414         (dir_name): Append `.' if necessary.
9415         Based mostly on patches from Prashant TR and Eli Zaretskii.
9416
9417         * dirname.h (dir_name_r): Remove prototype.
9418
9419 2000-12-05  Jim Meyering  <meyering@lucent.com>
9420
9421         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9422
9423 2000-12-04  Jim Meyering  <meyering@lucent.com>
9424
9425         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9426         Also include memory.h, stdlib.h, unistd.h if appropriate.
9427         Reported by Andreas Jaeger (conflicting declaration of malloc).
9428
9429 2000-12-02  Jim Meyering  <meyering@lucent.com>
9430
9431         * closeout.h: Make idempotent, to avoid some obscure warnings.
9432
9433 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9434
9435         * memrchr.c: Include <config.h> before any system include file.
9436
9437 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9438
9439         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9440
9441 2000-11-26  Jim Meyering  <meyering@lucent.com>
9442
9443         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9444
9445 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9446
9447         * strftime.c (my_strftime): Do not invoke mbrlen with a
9448         size of (size_t) -1; it's not portable.
9449
9450 2000-11-17  Akim Demaille  <akim@epita.fr>
9451
9452         * obstack.h: Formatting changes.
9453         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9454         prevent type checking.
9455         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9456         cast the value to (void *): assigning a `foo *' to a `void *'
9457         variable is valid.
9458         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9459
9460 2000-11-17  Jim Meyering  <meyering@lucent.com>
9461
9462         * strstr.c: Update from GNU libc.
9463
9464 2000-11-16  Jim Meyering  <meyering@lucent.com>
9465
9466         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9467
9468 2000-11-11  Jim Meyering  <meyering@lucent.com>
9469
9470         * error.c: Add a couple #includes, merging from GNU libc version.
9471
9472 2000-11-10  Jim Meyering  <meyering@lucent.com>
9473
9474         * obstack.h: Update from GNU libc.
9475         * obstack.c: Likewise.
9476
9477 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9478
9479         * getusershell.c (setusershell): Use rewind rather than
9480         fseek/fseeko, to avoid configuration hassles with fseeko.
9481         Don't bother opening SHELLS_FILE if shellstream is NULL;
9482         it's not necessary.
9483
9484 2000-11-05  Jim Meyering  <meyering@lucent.com>
9485
9486         * makepath.h (make_dir): Declare.
9487         * makepath.c (make_dir): Remove `static' attribute.
9488         Tweak a comment.
9489
9490 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9491
9492         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9493         last one in a bucket, advance to the next bucket.
9494
9495 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9496
9497         * fnmatch.c: Do not comment out all the code if we are using
9498         the GNU C library, because in some cases we are replacing buggy
9499         code in the GNU C library itself.
9500
9501 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9502
9503         * error.h, getline.h, modechange.h:
9504         Remove "2000" from Copyright line, as the file hasn't been
9505         changed this year other than in the copyright notice.
9506
9507         * xalloc.h: Add "2000" to Copyright line, as this file
9508         was changed this year.
9509
9510 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9511
9512         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9513         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9514         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9515
9516 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9517
9518         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9519         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9520         doesn't define __restrict_arr.
9521
9522 2000-10-29  Jim Meyering  <meyering@lucent.com>
9523
9524         * xstat.in: Fix grammar in comment.
9525
9526 2000-10-28  Jim Meyering  <meyering@lucent.com>
9527
9528         * memchr.c: Update from libc.
9529         Adjust for portability:
9530         [HAVE_STDLIB_H]: Include stdlib.h.
9531         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9532         Undef __memchr, too.
9533         [!weak_alias]: Define __memchr to memchr.
9534
9535         * regex.c: Update from libc.
9536         * regex.h: Likewise.
9537         * getopt1.c: Likewise.
9538         * memcmp.c: Likewise.
9539
9540         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9541         Avoid using fseek, when possible -- it's broken by design.
9542         Patch by Ulrich Drepper.
9543
9544 2000-10-26  Jim Meyering  <meyering@lucent.com>
9545
9546         * strftime.c: Update from libc.
9547
9548 2000-10-25  Jim Meyering  <meyering@lucent.com>
9549
9550         * obstack.c: Update from libc.
9551
9552 2000-10-23  Jim Meyering  <meyering@lucent.com>
9553
9554         * hard-locale.c (hard_locale): Revert last change -- it was simply
9555         wrong.  That set_locale call must not have any side effects.
9556         From Paul Eggert.
9557
9558 2000-10-22  Jim Meyering  <meyering@lucent.com>
9559
9560         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9561         [CYCLIC]: Remove now-unused definition.
9562
9563         * save-cwd.c (O_DIRECTORY): Define, if needed.
9564         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9565         Suggestion from Ulrich Drepper.
9566
9567 2000-10-21  Jim Meyering  <meyering@lucent.com>
9568
9569         * dirname.c (dir_name_r): New function, factored out of dir_name.
9570         (dir_name): Use dir_name_r.
9571         * dirname.h (dir_name_r): Declare it.
9572
9573 2000-10-21  Jim Meyering  <meyering@lucent.com>
9574
9575         * dirname.c (memrchr): Declare if necessary.
9576         (dir_name): Remove the restriction that there be no
9577         trailing slashes.  Now, this code skips past them, effectively
9578         ignoring them.
9579         [TEST_DIRNAME] (main): New unit tests.
9580
9581         * memrchr.c: New file from GNU libc.
9582         Undef __memrchr, too.
9583         [!weak_alias]: Define __memrchr to memrchr.
9584         Guard weak_alias use with `#ifdef weak_alias'.
9585
9586 2000-10-17  Jim Meyering  <meyering@lucent.com>
9587
9588         * quote.h (PARAMS): Define and use.
9589         Reported by Akim Demaille.
9590
9591         * getopt.c: Update from libc.
9592
9593 2000-10-16  Jim Meyering  <meyering@lucent.com>
9594
9595         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9596         From Jan Fedak.
9597
9598 2000-09-25  Jim Meyering  <meyering@lucent.com>
9599
9600         * md5.h (rol): Define (from GnuPG).
9601
9602         * sha.c: Give credit (GnuPG) where due.
9603         (M): Use rol rather than open-coding it.
9604         Add a FIXME comment.
9605
9606 2000-09-21  Jim Meyering  <meyering@lucent.com>
9607
9608         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9609         Reported by Michael Stone.
9610
9611 2000-09-20  Jim Meyering  <meyering@lucent.com>
9612
9613         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9614         (noinst_HEADERS): Add sha.h.
9615         Based on code from Scott G. Miller and from GnuPG.
9616
9617 2000-09-15  Jim Meyering  <meyering@lucent.com>
9618
9619         * regex.c: Update from libc.
9620
9621 2000-09-10  Jim Meyering  <meyering@lucent.com>
9622
9623         * getopt.c (_getopt_internal): Update from glibc.
9624
9625 2000-09-09  Jim Meyering  <meyering@lucent.com>
9626
9627         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9628         think it should be used as a general replacement for isascii.
9629         * fnmatch.c: Likewise.
9630         * mbswidth.c: Likewise
9631         * regex.c: Likewise.
9632
9633         Don't use atoi.
9634         * userspec.c: Include sys/param.h and limits.h.
9635         Include xstrtol.h.
9636         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9637         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9638         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9639         UID, GID.  Check range.
9640
9641 2000-09-06  Jim Meyering  <meyering@lucent.com>
9642
9643         * getopt.c (_getopt_internal): Update from glibc.
9644
9645 2000-08-30  Jim Meyering  <meyering@lucent.com>
9646
9647         * strftime.c: Merge in changes from GNU libc.
9648
9649 2000-08-26  Jim Meyering  <meyering@lucent.com>
9650
9651         * closeout.c: Include "__fpending.h".
9652         (close_stdout_status): Return right away if there's nothing to flush.
9653
9654         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9655         * __fpending.c: New file.
9656         * __fpending.h: New file.
9657
9658 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9659
9660         Standardize on "memory exhausted" instead of "Memory exhausted"
9661         or "virtual memory exhausted".
9662         * obstack.c (print_and_abort): Use "memory exhausted", not
9663         "virtual memory exhausted".
9664         * same.c (same_name): Invoke xalloc_die instead of printing
9665         our own message.
9666         * userspec.c (parse_user_spec): Likewise.
9667         * bumpalloc.h: comment fix
9668         * same.c, userspec.c: Include xalloc.h.
9669
9670         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9671         not char *const and pointing to a constant array.
9672         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9673         (xrealloc): Comment fix.
9674
9675         * userspec.c (parse_user_spec):
9676         Don't translate a message until just before returning,
9677         to avoid unnecessary translation.
9678
9679 2000-08-07  Jim Meyering  <meyering@lucent.com>
9680
9681         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9682         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9683         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9684         getgroups.c, gethostname.c, getopt.h, group-member.c,
9685         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9686         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9687         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9688         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9689         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9690         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9691         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9692         yesno.c: Back out Copyright date changes for each file with no change
9693         this year.  This eases coordination with other programs using the same
9694         source code modules.  From Paul Eggert.
9695
9696 2000-08-03  Greg McGary  <greg@mcgary.org>
9697
9698         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9699         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9700         (EXTEND_BUFFER): Use them.
9701
9702 2000-08-01  Jim Meyering  <meyering@lucent.com>
9703
9704         * dirname.c (ISSLASH): Define.
9705         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9706         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9707         both `\' and `/' may be use as path separators.
9708         Based on a patch from Prashant TR.
9709
9710 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9711
9712         * quotearg.c (quotearg_n_options): Don't make the initial
9713         slot vector a constant, since it might get modified.
9714
9715 2000-07-31  Jim Meyering  <meyering@lucent.com>
9716
9717         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9718         * obstack.c (print_and_abort): Likewise.
9719
9720 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9721
9722         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9723         buffer, so that the caller can always quote one small
9724         component of a "memory exhausted" message in slot 0.
9725         From a suggestion by Jim Meyering.
9726
9727 2000-07-30  Jim Meyering  <meyering@lucent.com>
9728
9729         * makepath.c (make_path): Quote the other instance, too.
9730
9731         * quotearg.c (N_STATIC_SLOTVECS): Define.
9732         (STATIC_BUF_SIZE): Define.
9733         (quotearg_n_options): Use only statically allocated storage when
9734         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9735         than STATIC_BUF_SIZE.
9736
9737 2000-07-29  Jim Meyering  <meyering@lucent.com>
9738
9739         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9740         * dirname.c (dir_name): Likewise.
9741
9742         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9743
9744         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9745         (dir_name): Assert that there are no trailing slashes.
9746
9747 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9748
9749         * mbswidth.h (mbswidth): Add a flags argument.
9750         (mbswidth): New declaration.
9751         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9752         * mbswidth.c (mbswidth): Add a flags argument.
9753         (mbsnwidth): New function.
9754
9755 2000-07-24  Jim Meyering  <meyering@lucent.com>
9756
9757         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9758
9759 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9760
9761         * mbswidth.c (_XOPEN_SOURCE):
9762         Don't define; this causes problems on Solaris 7.
9763         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9764
9765 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9766
9767         * quotearg.c:
9768         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9769         so that mbstate_t is always defined.
9770
9771         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9772         be 1 in at least one GCC installation, and this configuration
9773         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9774         performance on hosts that have mbrtowc but have only unibyte
9775         locales, but I assume these hosts are rare.
9776
9777 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9778
9779         * quotearg.c: Streamline by invoking multibyte code only if needed.
9780         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9781         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9782         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9783         invoke multibyte primitives.
9784
9785 2000-07-23  Jim Meyering  <meyering@lucent.com>
9786
9787         * basename.c (base_name): Add an assertion.
9788
9789 2000-07-15  Bruno Haible  <clisp.cons.org>
9790
9791         * quotearg.c: When the system forces us to redefine mbstate_t,
9792         shadow its mbsinit function.
9793
9794 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9795
9796         * mbswidth.h: New file.
9797         * mbswidth.c: New file.
9798         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9799         (noinst_HEADERS): Add mbswidth.h.
9800
9801 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9802
9803         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9804         and IRIX 6.
9805
9806 2000-07-15  Jim Meyering  <meyering@lucent.com>
9807
9808         * makepath.c: Include quote.h.
9809         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9810         corresponding argument in a `quote (...)' call.
9811         Give better diagnostics.
9812
9813         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9814         (noinst_HEADERS): Add quote.h.
9815
9816         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9817         from tar's src/misc.c.
9818         * quote.h: New file.  Prototypes for same.
9819
9820 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9821
9822         From a suggestion by Bruno Haible.
9823         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9824         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9825         to decide whether to define the BeOS workaround macro;
9826         this adjusts to the change to AC_MBSTATE_T.
9827
9828 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9829
9830         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9831
9832         * quotearg.c (quoting_style_args, quoting_style_vals,
9833         quotearg_buffer_restyled): Add support for
9834         clocale_quoting_style.  Undo previous change to
9835         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9836         and "{RIGHT QUOTATION MARK}" msgids.
9837
9838 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9839
9840         The old behavior of quoting `like this' doesn't look good with
9841         newer, ISO-style fonts.  See:
9842         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9843
9844         Instead, quote "like this" by default.  Let the translator
9845         tailor the locale-specific quoting behavior by providing
9846         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9847
9848         * quotearg.c (N_): New macro.
9849         (gettext_default): New function.
9850         (quotearg_buffer_restyled): Use
9851         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9852         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9853
9854 2000-07-09  Jim Meyering  <meyering@lucent.com>
9855
9856         * Most files: Update copyright dates to include 2000.
9857
9858 2000-07-08  Jim Meyering  <meyering@lucent.com>
9859
9860         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9861         if not defined.
9862         (xgethostname): Remove now-unnecessary #ifdef.
9863         Move declaration of `err' into loop where it's used.
9864
9865 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9866
9867         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9868         by allocating a larger buffer. Test the gethostname return value for
9869         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9870         returns an error and ENAMETOOLONG isn't defined.
9871
9872 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9873         and Bruno Haible  <haible@clisp.cons.org>
9874
9875         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9876
9877 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9878
9879         * quotearg.c (struct quoting_options): Simplify quote_these_too
9880         dimension.
9881
9882 2000-07-03  Jim Meyering  <meyering@lucent.com>
9883
9884         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9885         Reported by Bruno Haible.
9886
9887 2000-07-04  Jim Meyering  <meyering@lucent.com>
9888
9889         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9890         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9891         lacks mbrtowc.
9892
9893 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9894         and Bruno Haible  <haible@clisp.cons.org>
9895
9896         * quotearg.c (mbrtowc):
9897         Assign to *pwc, and return 1 only if result is nonzero.
9898         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9899
9900 2000-07-03  Jim Meyering  <meyering@lucent.com>
9901
9902         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9903         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9904         From Bob Proulx.
9905
9906 2000-07-02  Jim Meyering  <meyering@lucent.com>
9907
9908         * quotearg.c (mbstate_t): Don't define here.
9909
9910 2000-07-02  Jim Meyering  <meyering@lucent.com>
9911
9912         * nanosleep.c (SIGCONT): Define if not already defined.
9913
9914 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9915
9916         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9917         per change in ../m4/ls-mntd-fs.m4.
9918         (read_filesystem_list): Ignore symbolic links.
9919
9920 2000-06-29  Jim Meyering  <meyering@lucent.com>
9921
9922         * same.c: Include <string.h> or <strings.h>, as appropriate,
9923         for declaration of strcmp.
9924
9925         * long-options.c: Include <stdlib.h>, for declaration of exit.
9926
9927         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9928         Avoid warning by casting result to `char *' to remove `const'.
9929
9930 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9931
9932         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9933
9934 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9935
9936         savedir now sets errno on failure and invokes xmalloc to get memory.
9937         Fix a couple of other minor bugs while we're at it.
9938
9939         * savedir.c (<unistd.h>): Do not include; there's no need.
9940         (NAMLEN): Remove macro.
9941         (malloc, realloc): Remove decls.
9942         (stpcpy): Likewise.
9943         ("xalloc.h"): Include.
9944         (NAME_SIZE_DEFAULT): New macro.
9945         (savedir): Use xmalloc / xrealloc to allocate memory.
9946         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9947         Skip "" directory entries.
9948         Use strlen to calculate directory entry length, since the old method
9949         is rarely used these days and isn't worth supporting.
9950         Don't use a pointer after freeing it.
9951         Check for integer overflow when calculating allocation size.
9952         Use memcpy to copy entries, instead of stpcpy.
9953         Set errno properly when returning NULL.
9954         Check for readdir error.
9955
9956 2000-06-26  Jim Meyering  <meyering@lucent.com>
9957
9958         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9959
9960 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9961
9962         * getusershell.c (xmalloc, xrealloc): Remove functions.
9963         Include xalloc.h.
9964         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9965
9966 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9967
9968         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9969
9970 2000-06-24  Jim Meyering  <meyering@lucent.com>
9971
9972         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9973
9974 2000-06-21  Jim Meyering  <meyering@lucent.com>
9975
9976         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9977
9978 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9979
9980         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9981         (mbrtowc, mbstate_t): Define substitutes if
9982         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9983         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9984         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9985
9986 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9987
9988         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9989         than 1024, return a memory chunk of least possible size, instead
9990         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9991         Use free/xmalloc instead of xrealloc to avoid copying for very long
9992         paths.
9993
9994 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9995
9996         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9997         address, not strdup.  Include <stdlib.h> and don't declare free().
9998
9999 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10000
10001         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10002         the empty string.
10003
10004 2000-06-21  Jim Meyering  <meyering@lucent.com>
10005
10006         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10007         (noinst_HEADERS): Add getstr.h.
10008
10009         * getline.c (getstr): Move into a separate file.
10010         * getstr.c (getstr): New file, extracted from getline.c, with
10011         the following changes: new parameter, delim2; both delim[12]
10012         parameters have type `int', not `char'.  The latter would lose
10013         with 8-bit delimiters.
10014         * getstr.h: New file.
10015
10016 2000-06-19  Jim Meyering  <meyering@lucent.com>
10017
10018         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10019
10020 2000-06-18  Jim Meyering  <meyering@lucent.com>
10021
10022         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10023         Besides, these days every porting target provides a mkdir function.
10024
10025         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10026         (this snippet comes from src/system.h).
10027
10028 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10029
10030         * human.c (adjust_value): New function.
10031         (human_readable_inexact): Apply rounding style even when
10032         printing approximate values.
10033
10034 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10035
10036         * human.c (human_readable_inexact): Allow an input block
10037         size that is not a multiple of the output block size, and vice versa.
10038         Reported by Piergiorgio Sartor.
10039
10040 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10041
10042         * getdate.y (get_date): Apply relative times after time
10043         zone indicator, not before.  Reported by Todd A. Jacobs.
10044
10045 2000-06-13  Jim Meyering  <meyering@lucent.com>
10046
10047         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10048
10049         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10050
10051 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10052
10053         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10054
10055 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10056
10057         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10058
10059 2000-06-04  Jim Meyering  <meyering@lucent.com>
10060
10061         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10062         SunOS 4.1.4 for which gid_t is an unsigned type.
10063
10064 2000-06-03  Jim Meyering  <meyering@lucent.com>
10065
10066         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10067
10068 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10069
10070         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10071         newer, don't install charset.alias.
10072         * config.charset: Change the Linux/glibc rules so they become empty
10073         on glibc-2.1 or newer.
10074
10075 2000-06-02  Jim Meyering  <meyering@lucent.com>
10076
10077         * mountlist.c: Back out last change.  Instead, do this...
10078         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10079         member using the same `ignore'-testing code.
10080         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10081         fs_type strings.
10082         From Mark D. Roth.
10083
10084 2000-05-29  Jim Meyering  <meyering@lucent.com>
10085
10086         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10087         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10088
10089 2000-05-22  Jim Meyering  <meyering@lucent.com>
10090
10091         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10092
10093 2000-05-18  Jim Meyering  <meyering@lucent.com>
10094
10095         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10096         back, too, since it may have been modified by allocate_entry.
10097         (hash_delete): Rewrite to use neither the assignment operator
10098         nor the comma operator in an if-expression.
10099
10100 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10101
10102         * closeout.c:
10103         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10104         Remove; no longer needed.
10105         "quotearg.h": Add include.
10106         (file_name): Do not bother to explicitly initialize to NULL; it's less
10107         efficient on some hosts.
10108         (close_stdout_status): Remove test as to whether stdout was already
10109         closed; it breaks for the case "echo x | sort >&-".
10110         Quote file name colons.
10111         Do not assume that _("write error") lacks format strings.
10112
10113 2000-05-15  Jim Meyering  <meyering@lucent.com>
10114
10115         * version-etc.c (version_etc_copyright): Update the copyright string
10116         used in all --version output.
10117
10118 2000-05-14  Jim Meyering  <meyering@lucent.com>
10119
10120         * closeout.c (close_stdout_set_file_name): New function.
10121         (close_stdout_status): Use new file-scoped global.
10122         Return right away if fstat says the stdout file descriptor is invalid.
10123         * closeout.h (close_stdout_set_file_name): Declare.
10124
10125 2000-05-10  Jim Meyering  <meyering@lucent.com>
10126
10127         * closeout.c [default_exit_status]: New file-scoped variable.
10128         (close_stdout_set_status): New function.
10129         * closeout.h (close_stdout_set_status): Declare.
10130
10131 2000-05-08  Jim Meyering  <meyering@lucent.com>
10132
10133         * long-options.c: Don't include closeout.h.
10134         (parse_long_options): Don't call close_stdout for --version.
10135
10136 2000-05-06  Jim Meyering  <meyering@lucent.com>
10137
10138         * strnlen.c: Undefine __strnlen and strnlen.
10139         [!weak_alias]: Define __strnlen to strnlen.
10140
10141         * atexit.c: New file, from libiberty.
10142
10143 2000-05-06  Jim Meyering  <meyering@lucent.com>
10144
10145         * closeout.c (close_stdout_status): Also check for errors on the
10146         stderr stream.
10147
10148 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10149
10150         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10151         instead of xmalloc, xrealloc, path_concat.
10152         (locale_charset): Treat empty environment variables as absent.
10153         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10154
10155 2000-05-04  Jim Meyering  <meyering@lucent.com>
10156
10157         * getopt.c: Update from glibc.
10158         * obstack.c: Likewise.
10159         * obstack.h: Likewise.
10160         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10161
10162         * regex.h: Likewise.
10163         * strndup.c: Likewise.
10164         * strnlen.c: New file, from glibc.
10165
10166 2000-05-01  Jim Meyering  <meyering@lucent.com>
10167
10168         * full-write.c (full_write): Remove `FIXME' part of comment.
10169
10170 2000-04-29  Jim Meyering  <meyering@lucent.com>
10171
10172         * path-concat.c: Declare strdup only if it's not defined.
10173         * canon-host.c: Likewise.
10174
10175 2000-04-28  Jim Meyering  <meyering@lucent.com>
10176
10177         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10178         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10179         included first, then limits.h is included by locale.h by libintl.h.
10180         From John David Anglin.
10181
10182 2000-04-25  Jim Meyering  <meyering@lucent.com>
10183
10184         * makepath.c (S_IRWXUGO): Define.
10185         (make_path): Always perform explicit chmod if MODE specifies any
10186         of the `special' permission bits.  Prompted by a bug report against
10187         install from Mate Wierdl and Joost van Baal.
10188
10189 2000-04-18  Jim Meyering  <meyering@lucent.com>
10190
10191         * README: New file.
10192
10193         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10194         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10195
10196 2000-04-17  Jim Meyering  <meyering@lucent.com>
10197
10198         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10199         the definition of it to rpl_strftime also defined-away the system's
10200         declaration.
10201
10202 2000-04-15  Jim Meyering  <meyering@lucent.com>
10203
10204         Use `C' to denote so-called `contiguous' files, the same way
10205         that tar does.
10206         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10207         (ftypelet): Use S_ISCTG.
10208         From Michael Deutschmann.
10209
10210 2000-04-14  Jim Meyering  <meyering@lucent.com>
10211
10212         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10213
10214 2000-04-08  Jim Meyering  <meyering@lucent.com>
10215
10216         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10217         names don't conflict.  Reported by Eli Zaretskii.
10218
10219 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10220
10221         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10222         bug.  Deal with the different error behavior of Irix iconv.
10223
10224 2000-04-07  Jim Meyering  <meyering@lucent.com>
10225
10226         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10227         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10228
10229 2000-04-05  Jim Meyering  <meyering@lucent.com>
10230
10231         Portability tweaks required for ultrix4.3.
10232         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10233         * readutmp.c: Include sys/types.h before sys/stat.h.
10234         * canon-host.c: Declare strdup.
10235         * path-concat.c: Likewise.
10236         From John David Anglin.
10237
10238 2000-04-04  Jim Meyering  <meyering@lucent.com>
10239
10240         Be more DOS 8.3-friendly.
10241         * ref-add.sin: Renamed from ref-add.sed.in.
10242         * ref-del.sin: Renamed from ref-del.sed.in.
10243         * Makefile.am: Reflect renaming.
10244         Reported by Eli Zaretskii.
10245
10246         Use a temporary file name that won't clash with `charset.alias'
10247         in the DOS 8.3 name space.
10248         * Makefile.am (charset_tmp): Define.
10249         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10250         (uninstall-local): Likewise.
10251         Reported by Eli Zaretskii.
10252
10253 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10254
10255         * time/strftime.c (my_strftime): Make sure we call the system
10256         strftime, not ourselves, when invoking the underlying strftime.
10257
10258 2000-03-24  Jim Meyering  <meyering@lucent.com>
10259
10260         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10261         (charset_alias): Define.
10262         (install-exec-local): Factor out common code.
10263         (uninstall-local): Split lines longer than 80.
10264         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10265         (SUFFIXES): Define.
10266         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10267         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10268
10269 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10270
10271         * config.charset: Output a line containing "Packages using this file".
10272         * ref-add.sed.in, ref-del.sed.in: New files.
10273         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10274         ref-del.sed): New rules.
10275
10276 2000-03-17  Jim Meyering  <meyering@lucent.com>
10277
10278         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10279         Otherwise, include <strings.h>
10280
10281 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10282
10283         * unicodeio.c (utf8_wctomb): New function.
10284         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10285         format instead of in UCS-4 with platform dependent endianness.
10286
10287 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10288
10289         * savedir.c (savedir): Work even if directory size is
10290         negative; this can happen with some screwy NFS configurations.
10291
10292 2000-03-06  Jim Meyering  <meyering@lucent.com>
10293
10294         * localcharset.c (get_charset_aliases): Don't try to free file_name
10295         if it's NULL (because we ran out of memory).  From Bruno Haible.
10296
10297 2000-03-05  Jim Meyering  <meyering@lucent.com>
10298
10299         * localcharset.c ("path-concat.h"): Include.
10300         (get_charset_aliases): Use path_concat instead of ANSI string
10301         concatenation.
10302
10303         * unicodeio.h (PARAMS): Define.
10304         Use it to guard prototype.
10305
10306 2000-03-04  Jim Meyering  <meyering@lucent.com>
10307
10308         * Makefile.am (install-exec-local): Create $(libdir) before installing
10309         into it.
10310         (uninstall-local): Uncomment this rule so `make distcheck' works
10311         once again.
10312
10313         * unicodeio.c (<errno.h>): Include it.
10314         (errno): Declare if not defined.
10315
10316         * localcharset.c: Add Bruno's comment justifying use of volatile.
10317
10318         * config.charset: New version, incorporating remarks from a linux
10319         i18n mailing list.  From Bruno Haible.
10320
10321 2000-03-02  Jim Meyering  <meyering@lucent.com>
10322
10323         * Makefile.am (EXTRA_DIST): Add config.charset.
10324
10325 2000-03-01  Jim Meyering  <meyering@lucent.com>
10326
10327         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10328         * unicodeio.c: Likewise.
10329
10330 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10331
10332         * config.charset: New file.
10333         * localcharset.c: New file.
10334         * unicodeio.h, unicodeio.c: New files.
10335         * Makefile.am (DEFS): Add -DLIBDIR=...
10336         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10337         (noinst_HEADERS): Add unicodeio.h.
10338         (all-local, install-exec-local, charset.alias): New targets.
10339
10340 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10341
10342         * quotearg.c (ALERT_CHAR): New macro.
10343         (quotearg_buffer_restyled): Use it.
10344
10345 2000-02-27  Jim Meyering  <meyering@lucent.com>
10346
10347         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10348         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10349
10350         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10351         not `#if STDC_HEADERS'.
10352         Declare malloc if needed.
10353
10354         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10355         now that autoconf always defines the HAVE_DECL_ symbols.
10356         * human.c: Likewise.
10357         * same.c: Likewise.
10358         * strtoumax.c: Likewise.
10359
10360         * backupfile.c: Arrange for cpp to fail if the configure-time
10361         declaration check was not run.
10362         * hash.c: Likewise.
10363         * human.c: Likewise.
10364         * same.c: Likewise.
10365         * strtoumax.c: Likewise.
10366
10367         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10368         then first look up the entire `.'-containing string as a login name.
10369
10370 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10371
10372         * getdate.y: Handle two-digit years with leading zeros correctly.
10373         (textint): New typedef.
10374         (parser_control): Member year changed from int to textint.
10375         All uses changed.
10376         (YYSTYPE): Removed; replaced by %union with int and textint members.
10377         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10378         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10379         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10380         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10381         (date, number, to_year): Use width of number in digits, not its value,
10382         to determine whether it's a 2-digit year, or a 2-digit time.
10383         (yylex): Store number of digits of numeric tokens.
10384         Reported by John Kendall.
10385
10386         (parser_control): Changed from struct parser_control to typedef (for
10387         consistency).  All uses changed.
10388
10389         (tID): Removed; not used.
10390         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10391
10392 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10393
10394         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10395         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10396
10397 2000-02-12  Jim Meyering  <meyering@lucent.com>
10398
10399         * userspec.c (ISDIGIT): Define it.
10400         (isdigit): Remove definition.
10401         (is_number): Use ISDIGIT, not isdigit.
10402         <libintl.h>: Include.
10403         (_ and N_): Define.
10404         (parse_user_spec): Mark translatable strings.
10405
10406 2000-02-10  Jim Meyering  <meyering@lucent.com>
10407
10408         With these changes, nanosleep.[ch] are finally enough like the other
10409         lib/* replacement files to compile on a few more losing systems.
10410
10411         * nanosleep.h: Don't include config.h.
10412         Remove prototype from declaration of nanosleep.
10413         (PARAMS): Remove now-unneeded definition.
10414         * nanosleep.c: #undef nanosleep.
10415         (rpl_nanosleep): Rename from nanosleep.
10416
10417 2000-02-03  Jim Meyering  <meyering@lucent.com>
10418
10419         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10420         rather than with `#if HAVE_UTMPNAME'.
10421
10422 2000-02-01  Jim Meyering  <meyering@lucent.com>
10423
10424         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10425
10426 2000-01-31  Jim Meyering  <meyering@lucent.com>
10427
10428         * nanosleep.h (nanosleep): Guard declaration with
10429         `#if ! HAVE_DECL_NANOSLEEP'.
10430         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10431         the declaration in that vendor's sys/timers.h.
10432         Reported by Christian Krackowizer.
10433
10434         * quotearg.c (ISASCII): Add #undef and move definition to follow
10435         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10436         (ISPRINT): Likewise.
10437         Reported by Tom Tromey.
10438
10439 2000-01-30  Jim Meyering  <meyering@lucent.com>
10440
10441         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10442         uses of ->ut_name.  The latter doesn't work with new Linux header files
10443         where only utmpx.ut_user is declared.
10444
10445         * readutmp.h (UT_USER): Define.
10446
10447 2000-01-23  Jim Meyering  <meyering@lucent.com>
10448
10449         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10450         obstack.c.
10451
10452 2000-01-22  Jim Meyering  <meyering@lucent.com>
10453
10454         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10455         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10456         Required for some AIX systems.  Reported by Christian Krackowizer.
10457         [TESTING] (main): New function.
10458
10459         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10460         * dirname.c (dir_name): Support for DOS-style file names with drive
10461         letters.
10462
10463         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10464
10465         * strverscmp.c (ISDIGIT): Define.
10466         (strverscmp): Use ISDIGIT, not isdigit.
10467
10468 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10469
10470         * nanosleep.c (nanosleep):
10471         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10472         POSIX.1 doesn't require SA_INTERRUPT and some systems
10473         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10474         it's been part of POSIX.1 since day 1 (in 1988).
10475
10476 2000-01-17  Jim Meyering  <meyering@lucent.com>
10477
10478         * interlock: Remove unused file.  Reported by François Pinard.
10479
10480 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10481
10482         * quotearg.c (quotearg_buffer_restyled): Do not quote
10483         alert, backslash, formfeed, and vertical tab unnecessarily in
10484         shell quoting style.
10485
10486
10487 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10488 Free Software Foundation, Inc.
10489 Copying and distribution of this file, with or without modification,
10490 are permitted provided the copyright notice and this notice are preserved.