* error.c (error_at_line, print_errno_message): Match libc, after
[pspp] / lib / ChangeLog
1 2006-08-29  Eric Blake  <ebb9@byu.net>
2
3         * error.c (error_at_line, print_errno_message): Match libc, after
4         resolution of upstream bug 3044.
5
6 2006-08-29  Bruno Haible  <bruno@clisp.org>
7
8         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
9
10 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
11
12         Sync from Libtool:
13
14         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
15
16         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
17         sharing with gnulib.  Report by Eric Blake.
18
19 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
20
21         * fcntl_.h: New file.
22         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
23         the fcntl module.
24         * dirchownmod.c: Likewise.
25         * fts.c: Likewise.
26
27         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
28         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
29         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
30         just before including <inttypes.h>, to avoid circular inclusion.
31
32 2006-08-28  Bruno Haible  <bruno@clisp.org>
33
34         * inttypes_.h (SCNX*): Remove definitions.
35         Reported by Eric Blake.
36
37 2006-08-26  Bruno Haible  <bruno@clisp.org>
38
39         * vasnprintf.c (EOVERFLOW): Remove definition.
40         (VASNPRINTF): Return a string of length > INT_MAX without failing.
41         * vasprintf.c: Include errno.h, limits.h.
42         (EOVERFLOW): New fallback definition.
43         (vasprintf): Test here whether the string length is > INT_MAX.
44         * vsnprintf.c: Include errno.h, limits.h.
45         (EOVERFLOW): New fallback definition.
46         (vsnprintf): Fix bug when generated string was too long for the buffer.
47         Test here whether the string length is > INT_MAX.
48
49 2006-08-26  Bruno Haible  <bruno@clisp.org>
50             Simon Josefsson  <jas@extundo.com>
51
52         BeOS portability.
53         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
54
55 2006-08-28  Bruno Haible  <bruno@clisp.org>
56
57         * c-strstr.h: New file, from GNU gettext.
58         * c-strstr.c: New file, from GNU gettext.
59
60 2006-08-26  Bruno Haible  <bruno@clisp.org>
61
62         * inttypes_.h: New file.
63         * inttypes.h: Remove file.
64         * stdint_.h: Include <inttypes.h> through its absolute filename.
65
66         * imaxabs.c: New file.
67
68         * imaxdiv.c: New file.
69
70 2006-08-22  Bruno Haible  <bruno@clisp.org>
71
72         * readutmp.h: Skip most definitions if neither <utmp.h> nor
73         <utmpx.h> exists.
74
75 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
76
77         BeOS portability.
78         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
79         Problem reported by Bruno Haible.
80
81 2006-08-21  Bruno Haible  <bruno@clisp.org>
82
83         BeOS portability.
84         * mbchar.h: Include <wctype.h> only if it exists.
85
86 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
87
88         * cycle-check.h: Include <stdint.h> unconditionally, since we
89         now assume the stdint module.  Do not include inttypes.h.
90         * fsusage.h: Likewise.
91         * getndelim2.c: Likewise.
92         * human.h: Likewise.
93         * inttostr.h: Likewise.
94         * obstack.c: Likewise.
95         * regex_internal.h: Likewise.
96         * tempname.c: Likewise.
97         * utimecmp.c: Likewise.
98         * xstrtol.h: Likewise.
99
100         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
101
102         * strtoimax.c: Adjust to macro name changes in Autoconf,
103         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
104         * xtime.h: Likewise.
105
106 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
107
108         * fchmodat.c: New file, from coreutils.  This was inadvertently
109         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
110
111 2006-08-18  Bruno Haible  <bruno@clisp.org>
112
113         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
114         (ME_DUMMY): Treat "kernfs" as a dummy.
115         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
116
117 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
118
119         Update from coreutils.
120
121         * __fpending.h: Add copyright notice.
122         * fprintftime.h: Likewise.
123         * savedir.c: Use (C) in copyright notice.
124         * savedir.h: Likewise.
125
126         2006-08-15  Jim Meyering  <jim@meyering.net>
127
128         * at-func.c: New file, with the logic of all emulated at-functions.
129         * openat-priv.h: Include <errno.h> and define ENOSYS,
130         in support of the EXPECTED_ERRNO macro.
131         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
132         Instead, define the appropriate symbols and include "at-func.c".
133         * mkdirat.c (mkdirat): Likewise.
134         * fchmodat.c (fchmodat): Likewise.
135         (ENOSYS): Remove definition.
136         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
137         Don't include "unistd--.h" -- it wasn't ever used.
138
139         2006-01-17  Jim Meyering  <jim@meyering.net>
140
141         Rewrite fts.c not to change the current working directory,
142         by using openat, fstatat, fdopendir, etc..
143
144         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
145         (HAVE_OPENAT_SUPPORT): Define.
146         [_LIBC] (fchdir): Don't undef or define; no longer used.
147         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
148         Now, this `function' always succeeds, and consumes its file descriptor
149         parameter -- so callers must not close such FDs.  Update callers.
150         (diropen_fd, opendirat, cwd_advance_fd): New functions.
151         (diropen): Add parameter, SP.  Adjust all callers.
152         Implement using diropen_fd, rather than open.
153         (fts_open): Initialize new member, fts_cwd_fd.
154         Remove fts_rft-setting code.
155         (fts_close): Close fts_cwd_fd, if necessary.
156         (__opendir2): Define in terms of opendir or opendirat,
157         depending on whether the FST_NOCHDIR flag is set.
158         (fts_build): Since fts_safe_changedir consumes its FD, and since
159         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
160         and close the dup'd file descriptor upon failure.
161         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
162         (fts_safe_changedir): Tweak semantics to reflect that this function
163         now calls cwd_advance_fd and hence consumes its FD argument.
164         * fts_.h [struct FTS] (fts_cwd_fd): New member.
165         [struct FTS] (fts_rft): Remove now-unused member.
166         [struct FTS] (fts_cycle.state): Improve comment.
167
168         * openat.c (openat_needs_fchdir): New function.
169         * openat.h (openat_needs_fchdir): Declare it.
170
171 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
172
173         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
174         Problem and fix reported by Pádraig Brady in
175         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
176
177 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
178
179         * memcoll.c (memcoll): Optimize for the common case where the
180         arguments are bytewise equal.
181
182 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
183
184         Change copyright notice from LGPL 2 to GPL 2, since that's the
185         standard form used in the gnulib repository.
186         * lock.c: LGPL -> GPL.
187         * lock.h: Likewise.
188         * strnlen1.c: Likewise.
189         * strnlen1.h: Likewise.
190         * tls.c: Likewise.
191         * tls.h: Likewise.
192         * tmpdir.c: Likewise.
193
194         * TODO: Remove; this belongs only in coreutils.
195
196 2006-08-14  Eric Blake  <ebb9@byu.net>
197
198         Import the following change from libc:
199
200         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
201
202         Upstream bug 2997.
203         * misc/error.c: Add space between program name and message if file
204         name is missing.
205
206 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
207
208         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
209         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
210
211         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
212         in wchar_t.  Problem reported by Eric Blake.
213
214         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
215         LEN is smaller than SIZE.  Suggested by Bruno Haible.
216         Also, help the compiler to keep LEN in a register.
217
218 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
219
220         * .cppi-disable: Add snprintf.h, socket_.h.
221         * snprintf.c: Include <errno.h> and <limits.h>.
222         (EOVERFLOW): Define if the system does not.
223         Do not include "minmax.h"; it wasn't used.
224         (snprintf): Don't assume size_t promotes to an unsigned type.
225         Fix bug when generated string was too long for the buffer: the
226         buffer's contents are supposed to be the initial prefix of the
227         output.  Don't assume vasnprintf returns EOVERFLOW if the size
228         exceeds INT_MAX; do the check ourselves.
229
230         Import the following changes from libc:
231
232         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
233
234         * posix/regex_internal.c (re_string_skip_chars): If no character has
235         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
236         to the byte which couldn't be converted.
237         (re_string_reconstruct): Don't clear valid_raw_len before calling
238         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
239         tip_context using re_string_context_at.
240
241         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
242
243         * posix/regex.h: g++ still cannot handled [restrict].
244
245         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
246
247         * posix/regex.h: Remove special handling for VMS.
248
249 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
250
251         Sync from coreutils.
252
253         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
254
255         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
256         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
257
258 2006-08-08  Eric Blake  <ebb9@byu.net>
259
260         * verror.c (verror_at_line): Work around glibc bug 2997, so that
261         verror_at_line output complies with GNU Coding Standards even when
262         file is NULL.
263
264 2006-08-08  Eric Blake  <ebb9@byu.net>
265
266         * verror.h, verror.c: New files.
267
268 2006-08-07  Bruno Haible  <bruno@clisp.org>
269
270         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
271         versions of AIX.
272         Reported by Ralf Wildenhues.
273
274 2006-08-06  Eric Blake  <ebb9@byu.net>
275
276         * error.h: Fold in some upstream changes from glibc.
277         * error.c: Likewise.
278
279 2006-07-29  Bruno Haible  <bruno@clisp.org>
280
281         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
282
283 2006-07-29  Bruno Haible  <bruno@clisp.org>
284
285         * setenv.c: Undo unintended modification done on 2006-02-27.
286
287 2006-07-28  Eric Blake  <ebb9@byu.net>
288
289         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
290         macro expansion.
291
292 2006-07-28  Simon Josefsson  <jas@extundo.com>
293
294         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
295         #include's.
296
297 2006-07-28  Simon Josefsson  <jas@extundo.com>
298
299         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
300         #include's.
301
302 2006-07-28  Bruno Haible <bruno@clisp.org>
303
304         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
305
306 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
307
308         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
309         arpa/inet.h.
310
311 2006-07-28  Bruno Haible  <bruno@clisp.org>
312
313         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
314         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
315         fallbacks.
316         Avoids link error on FreeBSD 4.x.
317         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
318
319         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
320         encoding.
321         * mbswidth.c (iswcntrl): Likewise.
322
323 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
324
325         * modechange.c (mode_compile): Numeric modes now affect setuid and
326         setgid on directories only if they set these bits.
327         * modechange.h: Remove obsolete comment about masks.
328
329 2006-07-27  Bruno Haible  <bruno@clisp.org>
330
331         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
332         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
333         defined.
334
335 2006-07-26  Eric Blake  <ebb9@byu.net>
336
337         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
338         like mingw that lack mkstemp.
339         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
340         avoid compilation warning on mingw.
341
342 2006-07-25  Bruno Haible  <bruno@clisp.org>
343
344         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
345         <stdarg.h> or config.h.
346
347 2006-07-24  Bruno Haible  <bruno@clisp.org>
348
349         * clean-temp.h: New file, from GNU gettext.
350         * clean-temp.c: New file, from GNU gettext.
351
352 2006-07-24  Bruno Haible  <bruno@clisp.org>
353
354         * tmpdir.h: New file, from GNU gettext.
355         * tmpdir.c: New file, from GNU gettext.
356
357 2006-07-23  Bruno Haible  <bruno@clisp.org>
358
359         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
360         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
361         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
362         gl_linked_remove_at): Use it.
363
364 2006-07-23  Eric Blake  <ebb9@byu.net>
365
366         * tmpfile-safer.c: New file.
367         * stdio-safer.h (fopen_safer): Add prototype.
368         * stdio--.h (tmpfile): Make safer.
369
370 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
371
372         * close-stream.c, close-stream.h: New files.
373
374 2006-07-22  Bruno Haible  <bruno@clisp.org>
375
376         Merge from GNU gettext 0.15.
377
378         2005-07-05  Bruno Haible  <bruno@clisp.org>
379
380                 * printf-args.c (printf_fetchargs): Work around broken
381                 definition of wint_t on mingw.
382
383         2005-02-12  Bruno Haible  <bruno@clisp.org>
384
385                 * xallocsa.h: Add extern "C" for C++.
386
387         2006-05-17  Bruno Haible  <bruno@clisp.org>
388
389                 Cygwin portability.
390                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
391
392         2006-04-30  Bruno Haible  <bruno@clisp.org>
393
394                 * progreloc.c: Include <mach-o/dyld.h> if available.
395                 (find_executable): Use _NSGetExecutablePath when possible.
396
397         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
398
399                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
400                 function.
401
402         2005-12-29  Bruno Haible  <bruno@clisp.org>
403
404                 * progreloc.c (set_program_name_and_installdir): Fix
405                 compilation error.
406
407         2005-12-04  Bruno Haible  <bruno@clisp.org>
408
409                 Cygwin portability.
410                 * progreloc.c: Include <windows.h> also on Cygwin.
411                 (find_executable): Add support for Cygwin.
412                 (set_program_name_and_installdir): Handle also platforms with
413                 nonempty EXEEXT.
414
415         2006-07-11  Bruno Haible  <bruno@clisp.org>
416
417                 * javacomp.c: Fix a comment.
418                 Reported by Jim Meyering.
419
420         2006-04-30  Bruno Haible  <bruno@clisp.org>
421
422                 * javacomp.h (compile_java_class): Add source_version,
423                 target_version arguments.
424                 * javacomp.c: Rewritten to choose only a compiler that
425                 respects the specified source_version and target_version.
426
427         2006-06-27  Bruno Haible  <bruno@clisp.org>
428
429                 Assume correct S_ISDIR macro.
430                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
431
432         2006-07-22  Bruno Haible  <bruno@clisp.org>
433
434                 * javaversion.h: New file, from GNU gettext.
435                 * javaversion.c: New file, from GNU gettext.
436                 * javaversion.java: New file, from GNU gettext.
437                 * javaversion.class: New file, from GNU gettext.
438
439         2006-05-17  Bruno Haible  <bruno@clisp.org>
440
441                 Cygwin portability.
442                 * javaexec.c (execute_java_class): Test for jview program
443                 also on Cygwin.
444
445         2006-04-09  Bruno Haible  <bruno@clisp.org>
446
447                 * fatal-signal.c: Don't include string.h.
448                 (at_fatal_signal): Use a copying loop instead of memcpy.
449
450         2005-12-04  Bruno Haible  <bruno@clisp.org>
451
452                 * csharpexec.c: Add support for 'clix' launcher (untested).
453                 (execute_csharp_using_sscli): New function.
454                 (execute_csharp_program): Call it.
455
456         2006-06-21  Bruno Haible  <bruno@clisp.org>
457
458                 Avoid warnings from recent versions of mcs.
459                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
460                 -o, -L, -r any more. Use options documented since mcs-1.0
461                 instead. Similarly for -g.
462
463         2005-07-09  Bruno Haible  <bruno@clisp.org>
464
465                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
466                 add a .dll suffix.
467                 Reported by Mark Junker <mjscod@gmx.de>.
468
469         2006-06-17  Bruno Haible  <bruno@clisp.org>
470
471                 * config.charset: Update for NetBSD 3.0.
472
473         2006-05-17  Bruno Haible  <bruno@clisp.org>
474
475                 Cygwin portability.
476                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
477
478         2006-05-16  Bruno Haible  <bruno@clisp.org>
479
480                 * localcharset.c [CYGWIN]: Include <windows.h>.
481                 (get_charset_aliases): For Cygwin, return the same CPxxx
482                 aliases list as under WIN32.
483                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
484                 the environment variables. Fall back to GetACP().
485
486         2006-04-05  Bruno Haible  <bruno@clisp.org>
487
488                 * config.charset: Update Juan Manuel Guerrero's address.
489
490         2005-02-12  Bruno Haible  <bruno@clisp.org>
491
492                 * allocsa.h: Add extern "C" for C++.
493
494         2005-02-10  Bruno Haible  <bruno@clisp.org>
495
496                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
497                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
498
499         2006-07-22  Bruno Haible  <bruno@clisp.org>
500
501                 * gettext.h: Update to GNU gettext-0.15.
502
503 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
504         and Simon Josefsson <jas@extundo.com>
505
506         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
507
508         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
509
510 2006-07-21  Eric Blake  <ebb9@byu.net>
511
512         * stdlib-safer.h: New file from coreutils, required by
513         stdlib--.h.
514
515 2006-07-19  Derek R. Price  <derek@ximbiot.com>
516
517         * getaddrinfo.h: Don't define unimplemented AI_* flags.
518         Reindent and repaginate.
519
520 2006-07-17  Bruno Haible  <bruno@clisp.org>
521
522         * gl_list.h: New file.
523         * gl_list.c: New file.
524         * gl_array_list.h: New file.
525         * gl_array_list.c: New file.
526         * gl_carray_list.h: New file.
527         * gl_carray_list.c: New file.
528         * gl_linked_list.h: New file.
529         * gl_linked_list.c: New file.
530         * gl_anylinked_list1.h: New file.
531         * gl_anylinked_list2.h: New file.
532         * gl_avltree_list.h: New file.
533         * gl_avltree_list.c: New file.
534         * gl_anyavltree_list1.h: New file.
535         * gl_anyavltree_list2.h: New file.
536         * gl_rbtree_list.h: New file.
537         * gl_rbtree_list.c: New file.
538         * gl_anyrbtree_list1.h: New file.
539         * gl_anyrbtree_list2.h: New file.
540         * gl_anytree_list1.h: New file.
541         * gl_anytree_list2.h: New file.
542         * gl_linkedhash_list.h: New file.
543         * gl_linkedhash_list.c: New file.
544         * gl_anyhash_list1.h: New file.
545         * gl_anyhash_list2.h: New file.
546         * gl_avltreehash_list.h: New file.
547         * gl_avltreehash_list.c: New file.
548         * gl_rbtreehash_list.h: New file.
549         * gl_rbtreehash_list.c: New file.
550         * gl_anytreehash_list1.h: New file.
551         * gl_anytreehash_list2.h: New file.
552
553         * gl_oset.h: New file.
554         * gl_oset.c: New file.
555         * gl_array_oset.h: New file.
556         * gl_array_oset.c: New file.
557         * gl_avltree_oset.h: New file.
558         * gl_avltree_oset.c: New file.
559         * gl_rbtree_oset.h: New file.
560         * gl_rbtree_oset.c: New file.
561         * gl_anytree_oset.h: New file.
562
563 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
564
565         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
566         New files.
567         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
568         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
569         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
570         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
571         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
572         callers changed.  Revamp internals significantly, by not
573         attempting to create directories that are temporarily more
574         permissive than the final results.  Do not attempt to use
575         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
576         This removes some race conditions, fixes some bugs, and simplifies
577         things.  Use new dirchownmod function to do owner and mode changes.
578         * mkdir-p.h: Likewise.
579         * modechange.c (octal_to_mode): New function.
580         (struct mode_change): New member mentioned.
581         (make_node_op_equals): New arg mentioned.  All callers changed.
582         (mode_compile): Keep track of which mode bits the user has explicitly
583         mentioned.
584         (mode_adjust): New arg DIR, so that we implement the X op correctly.
585         New arg PMODE_BITS, to keep track of which mode bits the user
586         mentioned; it treats S_ISUID and S_ISGID speciall.
587         All callers changed.
588         * modechange.h: Likewise.
589
590 2006-07-11  Derek R. Price  <derek@ximbiot.com>
591
592         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
593
594 2006-07-10  Derek R. Price  <derek@ximbiot.com>
595
596         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
597         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
598         macros into the GNU _D_EXACT_NAMLEN.
599         * savedir.c:  Likewise.
600         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
601
602 2006-07-09  Jim Meyering  <jim@meyering.net>
603
604         * argp-pv.c: Remove a doubled word in a comment.
605         * check-version.c (check_version): Likewise.
606         * javacomp.c (compile_java_class): Likewise.
607
608 2006-07-08  Jim Meyering  <jim@meyering.net>
609
610         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
611
612 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
613
614         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
615         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
616         brackets.  Other minor changes to suppress some compiler
617         warnings.
618
619 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
620
621         * getloadavg.c: Use __VMS, not VMS.
622         * getopt.c: Likewise.
623         * getpagesize.h: Likewise.
624         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
625         probably does not work.
626
627 2006-07-06  Derek R. Price  <derek@ximbiot.com>
628         and Paul Eggert  <eggert@cs.ucla.edu>
629
630         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
631         Don't worry about this obsolete case any more.
632         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
633         directories.
634         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
635         worry about this obsolete case any more.
636         * fts.c: Likewise.
637         * getcwd.c: Likewise.
638         * glob.h: Likewise.
639         * savedir.c: Likewise.
640
641 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
642
643         * .cppi-disable: Add wcwidth.
644         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
645         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
646         (ISGRAPH): Remove.  All uses changed to isgraph.
647         (FOLD) [!defined _LIBC]: Remove special case.
648         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
649         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
650         HAVE_ISBLANK.
651         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
652
653 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
654
655         * strtod.c (strtod): cast the argument of tolower to unsigned char.
656
657 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
658
659         * memcasecmp.c: Include <limits.h>.
660         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
661         * strtod.c (strtod): Don't assume isspace works on negative chars.
662         Don't assume isdigit succeeds only on '0' through '9'.
663
664 2006-07-05  Derek R. Price  <derek@ximbiot.com>
665
666         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
667         All uses of is_space replaced by isspace.
668         * exit.h: Don't talk about STDC_HEADERS.
669         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
670         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
671         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
672         replaced by isprint etc.
673         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
674         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
675         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
676         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
677         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
678         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
679
680 2006-07-05  Eric Blake  <ebb9@byu.net>
681
682         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
683         missing from netdb.h.
684         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
685
686 2006-06-27  Bruno Haible  <bruno@clisp.org>
687
688         Assume ANSI C header files and <ctype.h> functions.
689         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
690         (mbsnwidth): Use isprint, iscntrl instead.
691
692 2006-07-03  Jim Meyering  <jim@meyering.net>
693
694         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
695         macro is used before the first cycle_check call.
696
697 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
698
699         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
700         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
701         reported by Mark D. Baushke, one in
702         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
703
704         Merge from coreutils.
705
706         * .cppi-disable: Add stdint_.h.
707         * .cvsignore: Add stdint.h.
708
709         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
710
711         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
712         both double and long double versions.
713         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
714         * xstrtold.c: New file.
715         * xstrtod.h (xstrtold): New decl.
716
717         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
718
719         * filemode.c (setst): Remove.
720         (strmode): Rewrite to avoid setst.  This makes the code shorter,
721         (arguably) clearer, and the generated code is a bit smaller on my
722         Debian GNU/Linux stable x86 host.
723
724         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
725
726         * filemode.c: Include "filemode.h" first, to test the interface.
727         Assume that filemode.h includes sys/types.h and sys/stat.h.
728         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
729         (ftypelet): Reorder to put common cases first, for efficiency.
730         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
731         to do 'M'.
732         (strmode): Renamed from mode_string, and now stores 12 bytes instead
733         of 10, for compatibility with FreeBSD.  All callers changed.
734         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
735         that can't be deduced solely from st_mode.  First arg is now a const
736         pointer.
737         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
738         (strmode): Renamed from mode_string.
739         (filemodestring): New decl.
740         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
741         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
742         (S_ISPORT, S_ISWHT): New macros, if not already defined.
743
744         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
745
746         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
747         fsusage.h now does that.  Include fsusage.h first, to test interface.
748         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
749         at most one method (the old code could have generated decls that
750         didn't conform to C89, not that this was ever exercised).
751         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
752
753         2006-03-19  Jim Meyering  <jim@meyering.net>
754
755         Work even in a chroot where d_ino values for entries in "/"
756         don't match the stat.st_ino values for the same names.
757         * getcwd.c (__getcwd): When no d_ino value matches the target inode
758         number, iterate through all entries again, using lstat instead.
759         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
760         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
761
762         * getcwd.c (__getcwd): Clarify a comment.
763         Use memcpy in place of a call to strcpy.
764
765         2006-03-12  Jim Meyering  <jim@meyering.net>
766
767         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
768         that of the current directory (which we're about to chdir ".." out of),
769         then save the dev-ino of the parent, instead.
770
771         * same-inode.h (SAME_INODE): New file/macro.
772         * chdir-safer.c (SAME_INODE): Remove definition.
773         Include "same-inode.h", instead.
774         * same.c: Likewise.
775         * cycle-check.h: Include "same-inode.h".
776         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
777         * cycle-check.c (SAME_INODE): Remove definition.
778         * root-dev-ino.h: Include "same-inode.h".
779
780         2006-03-11  Eric Blake  <ebb9@byu.net>
781
782         * same.c (same_name): s/base_name/last_component/
783         * backupfile.c (check_extension, numbered_backup): Likewise.
784         * filenamecat.c (file_name_concat): Likewise.
785
786         2006-03-11  Eric Blake  <ebb9@byu.net>,
787                     Paul Eggert  <eggert@cs.ucla.edu>
788
789         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
790         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
791         drive prefix.
792         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
793         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
794         (last_component): New method.
795         * dirname.c (dir_len): Determine when drive letters need a
796         subsequent slash.  Preserve // when it is special.
797         (dir_name): Don't append dot when drive letter is absolute.
798         [TEST_DIRNAME]: Move into a full-blown gnulib test.
799         * basename.c (base_name): New semantics - malloc the result.
800         Preserve // when it is special.  Preserve relative files that look
801         like drive letters.
802         (base_len): Preserve // when it is special.
803         (last_component): New method, similar to old base_name semantics.
804         * stripslash.c (strip_trailing_slashes): Use last_component, not
805         base_name.  Strip redundant slashes from ///.
806
807 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
808
809         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
810         both are 64 bits, since this seems to be the tradition, and this
811         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
812         we ever run into a host that prefers long long to long in this
813         case, we'll need another configure-time test.  Problem reported by
814         Jim Meyering.
815
816 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
817
818         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
819         possible collision with system files.
820         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
821         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
822         WCHAR_MIN and WCHAR_MAX in this case.
823         (<stddef.h>): Do not include; no longer needed.
824         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
825         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
826         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
827         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
828         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
829         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
830         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
831         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
832         !defined(__c99))]: Include in this case too, since it's harmless
833         now.
834         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
835         dangerous to do so.
836         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
837         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
838         (_STDINT_MIN, _STDINT_MAX): New macros.
839         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
840         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
841         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
842         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
843         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
844         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
845         macros, not typedefs; this simplifies things quite a bit.
846         Use long int for all types narrower than int64_t.
847         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
848         Define in terms of long long int or int64_t or long int,
849         not int64_t or int32_t.  This saves some compile-time testing.
850         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
851         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
852         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
853         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
854         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
855         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
856         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
857         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
858         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
859         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
860         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
861         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
862         undef any previous version and define our own version, for
863         simplicity and consistency with the new macros for types.
864         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
865         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
866         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
867         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
868         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
869         @WINT_T_SUFFIX@ to keep things simple here.
870         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
871         Simplify by assuming typical 8/16/32/64 host, since we're
872         already doing that elsewhere anyway.
873         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
874         and assume long long int is 64 bits if available.  This
875         speeds up 'configure'.
876
877 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
878
879         * getaddrinfo.c: fixed typo
880
881 2006-06-29  Eric Blake  <ebb9@byu.net>
882
883         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
884         unused static function.
885
886 2006-06-29  Eric Blake  <ebb9@byu.net>
887
888         * stat_.h: New file.
889
890 2006-06-29  Derek R. Price  <derek@ximbiot.com>
891
892         * strftime.c: Assume strftime() exists.
893
894 2006-06-28  Bruno Haible  <bruno@clisp.org>
895
896         * getaddrinfo.h: Fix POSIX URL.
897         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
898         (use_win32_p): Make static.
899         (getaddrinfo): Reject service name if it is empty or does not consist
900         solely of decimal digits, or if its value is > 65535.
901         (getnameinfo): Remove useless casts.
902
903 2006-06-28  Derek R. Price  <derek@ximbiot.com>
904
905         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
906         Autoconf 2.60 says this stuff was obsolete.
907
908 2006-05-12  Bruno Haible  <bruno@clisp.org>
909
910         * mkdtemp.c [MINGW]: Include <io.h>.
911         (mkdir): Define using _mkdir.
912
913 2006-06-28  Bruno Haible  <bruno@clisp.org>
914
915         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
916         declaration for wcwidth.
917         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
918
919 2006-06-28  Eric Blake  <ebb9@byu.net>
920
921         * xvasprintf.h: Fix comments.
922
923 2006-06-28  Eric Blake  <ebb9@byu.net>
924
925         * mbchar.h (wcwidth): Include wcwidth.h.
926         * mbswidth.c (wcwidth): Move from here...
927         * wcwidth.h: ...to this new file.
928
929 2006-06-28  Simon Josefsson  <jas@extundo.com>
930
931         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
932         functions there.  It will succeed on Windows XP, but on Windows
933         2000 and (presumably) earlier, it will fail, and use the internal
934         re-implementation.
935         (use_win32_p): New function.
936         (getaddrinfo): Use strtoul on servname, to support numeric ports.
937         Support AI_NUMERICSERV to disable getservbyname.
938         (getnameinfo): New function, only supports
939         NI_NUMERICHOST|NI_NUMERICSERV for now.
940
941         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
942         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
943         getnameinfo.
944
945 2006-06-27  Bruno Haible  <bruno@clisp.org>
946
947         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
948
949 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
950
951         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
952         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
953         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
954
955 2006-06-26  Bruno Haible  <bruno@clisp.org>
956
957         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
958         WCHAR_MAX.
959         Reported by Mark D. Baushke and Larry Jones.
960
961 2006-06-26  Bruno Haible  <bruno@clisp.org>
962
963         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
964         in pre-C99 mode.
965         Suggested by Mark D. Baushke and Larry Jones.
966
967 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
968
969         * stdint_.h: Treat BSD/OS like OpenBSD.
970
971 2006-06-23  Bruno Haible  <bruno@clisp.org>
972
973         * stdint_.h: Treat IRIX like OpenBSD.
974
975 2006-06-23  Bruno Haible  <bruno@clisp.org>
976
977         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
978         ISO C 99 Technical Corrigendum 1.
979
980 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
981
982         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
983         Some compiler complained about some of them.  Problem reported by
984         Larry Jones in
985         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
986
987 2006-06-21  Simon Josefsson  <jas@extundo.com>
988
989         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
990         variable.
991
992         * socket_.h: Don't define WINVER.
993
994         * inet_pton.h, inet_pton.c: New file, taken from glibc but
995         slightly modified to work in gnulib.
996
997 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
998
999         * read-file.c (fread_file): Start with buffer allocation of
1000         0 bytes rather than 1 byte; this simplifies the code.
1001         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1002         code to free buffer and save/restore errno.
1003         (internal_read_file): Remove unused local.
1004
1005 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1006
1007         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1008         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1009         Problem reported by Denis Excoffier in
1010         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1011
1012 2006-06-19  Simon Josefsson  <jas@extundo.com>
1013
1014         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1015
1016 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1017
1018         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1019
1020 2006-06-17  Bruno Haible  <bruno@clisp.org>
1021
1022         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1023
1024 2006-06-17  Bruno Haible  <bruno@clisp.org>
1025
1026         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1027         problem on Solaris 2.5.1.
1028
1029 2006-06-16  Eric Blake  <ebb9@byu.net>
1030
1031         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1032         * unicodeio.c [!defined errno]: Likewise.
1033         * strtol.c [!defined errno]: Likewise.
1034         * strtod.c [!defined errno]: Likewise.
1035
1036 2006-06-15  Bruno Haible  <bruno@clisp.org>
1037
1038         * stdint_.h: Rewritten to be fully auto-configured.
1039         Fixes bug on HP-UX/IA64.
1040
1041 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1042
1043         * getdate.y (__attribute__): Don't define if already defined.
1044         Problem reported by Larry Jones.
1045         * utimens.c (__attribute__): Likewise.
1046
1047 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1048
1049         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1050         reported by Andreas Schwab.
1051
1052 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1053             Bruno Haible  <bruno@clisp.org>
1054
1055         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1056
1057 2006-05-26  Martin Lambers  <marlam@marlam.de>
1058
1059         * getpass.c: Updates the test for the native W32 API, and adds
1060         missing includes, thus fixing compilation warnings.
1061
1062 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1063
1064         * tempname.c (small_open, large_open): New macros.
1065         (__open, __open64) [!_LIBC]: Remove.
1066         (__gen_tempname): Use small_open and large_open instead of __open
1067         and __open64.  This fixes a portability bug on HP-UX 11.11i
1068         reported by Simon Wing-Tang in
1069         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1070
1071 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1072
1073         * exclude.c (exclude_fnmatch): New function.
1074         (excluded_file_name): Call exclude_fnmatch.
1075         * exclude.h (excluded_file_name): New prototype
1076
1077 2006-05-24  Bruno Haible  <bruno@clisp.org>
1078
1079         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1080         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1081         Reported by Thorsten Maerz <torte@netztorte.de> via
1082         Aaron Stone <aaron@serendipity.cx>.
1083
1084 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1085
1086         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1087         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1088         (my_usleep): Don't mishandle maximum value.
1089
1090 2006-05-19  Jim Meyering  <jim@meyering.net>
1091
1092         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1093
1094 2006-05-17  Bruno Haible  <bruno@clisp.org>
1095
1096         Cygwin portability.
1097         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1098
1099 2006-05-17  Bruno Haible  <bruno@clisp.org>
1100
1101         * stdint_.h: Fix recognition of Cygwin.
1102
1103 2006-05-11  Jim Meyering  <jim@meyering.net>
1104
1105         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1106
1107 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1108
1109         * crc.c (crc32_update): Remove unnecessary L suffix.
1110         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1111         unwanted sign propagation, e.g., on hosts with 64-bit int.
1112         There still are some problems with reeelly weird theoretical hosts
1113         (e.g., 33-bit int) but it's not worth worrying about now.
1114         * sha1.c (rol): Likewise.
1115         (K1, K2, K3, K4): Remove unnecessary L suffix.
1116
1117 2006-05-10  Bruno Haible  <bruno@clisp.org>
1118
1119         * des.c: Cast to avoid warnings.
1120
1121 2006-05-10  Simon Josefsson  <jas@extundo.com>
1122
1123         * md4.c: Typo fix, update copyright years.
1124         (K1, K2): Don't use L because it turn computations into 64-bit on
1125         64-bit platforms.
1126
1127 2006-05-09  Bruno Haible  <bruno@clisp.org>
1128
1129         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1130         (EOVERFLOW): Define fallback value.
1131         (xstrcat): New function.
1132         (xvasprintf): Recognize the special case of a string concatenation.
1133
1134 2006-05-01  Bruno Haible  <bruno@clisp.org>
1135
1136         * stdint_.h: Shorter URL.
1137         * inttypes.h: Likewise.
1138
1139 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1140
1141         * verify.h: Document the internals better.  Most of this change
1142         was written by Bruno Haible.
1143
1144 2006-04-29  Bruno Haible  <bruno@clisp.org>
1145
1146         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1147         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1148
1149 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1150
1151         * getdate.y (get_date): When adding relative date, start with the
1152         initial time, not with the result of the first mktime call.
1153
1154 2006-04-23  Bruno Haible  <bruno@clisp.org>
1155
1156         * copy-file.c: Include <unistd.h> unconditionally.
1157         * execute.c: Likewise.
1158         * fatal-signal.c: Likewise.
1159         * findprog.c: Likewise.
1160         * mkdtemp.c: Likewise.
1161         * pipe.h: Likewise.
1162         * pipe.c: Likewise.
1163         * wait-process.h: Likewise.
1164
1165 2006-04-23  Bruno Haible  <bruno@clisp.org>
1166
1167         * fwriteerror.c (fwriteerror): Call fclose also when an error
1168         condition was already detected.
1169         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1170
1171 2006-04-19  Derek Price  <derek@ximbiot.com>
1172             Eric Blake  <ebb9@byu.net>
1173
1174         * inttypes.h: Correct grammar in comment.
1175
1176 2006-04-18  Derek Price  <derek@ximbiot.com>
1177             Paul Eggert  <eggert@cs.ucla.edu>
1178
1179         * inttypes.h: New file.
1180         * strtoimax.c: Assume <inttypes.h>.
1181
1182 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1183
1184         * utimens.c (futimens): glibc futimesat messes up if /proc
1185         isn't mounted.  Problem reported by Kir Kolyshkin.
1186
1187 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1188
1189         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1190         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1191         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1192
1193 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1194
1195         Merge regex changes from libc, removing some of our
1196         POSIX-conformance changes that were rejected and redoing them in a
1197         less-intrusive way.
1198
1199         * regcomp.c (re_compile_internal, init_dfa):
1200         Length arg is now size_t, not Idx.  All uses changed.
1201         (peek_token): Forward decl now says internal_function.
1202         (__re_error_msgid, __re_error_msgid_idx):
1203         Now static rather than extern with attribute_hidden.
1204         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1205         For some reason libc prefers K&R style defns for external functions.
1206         (regerror) [!defined _LIBC]: Likewise.
1207         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1208         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1209         (build_range_exp, build_collating_symbol):
1210         Use K&R-style defn.
1211         (re_compile_fastmap): Use '\0' to memset, not 0.
1212         (utf8_sb_map): Make the calculations more obvious.
1213         (init_dfa, parse_bracket_exp, build_charclass_op):
1214         Call calloc and cast result, as glibc does.
1215         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1216         (build_range_exp, build_collating_symbol):
1217         Now internal functions.
1218
1219         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1220
1221         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1222         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1223         Don't depend on VMS; depend on __VMS instead, for POSIX
1224         namespace cleanness.
1225         (regoff_t): Define to ssize_t, not long int.
1226
1227         Remove the REG_ macros named below.  Instead, make the old names
1228         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1229         __USE_GNU_REGEX.
1230         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1231         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1232         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1233         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1234         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1235         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1236         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1237         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1238         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1239         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1240         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1241         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1242         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1243         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1244         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1245         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1246         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1247         (REG_NREGS):
1248         Remove.  All uses replaced by the old RE_* names.
1249         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1250         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1251         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1252         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1253         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1254         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1255         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1256         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1257         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1258         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1259         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1260         Don't bother having these macros be independent of each others'
1261         values, since they no longer exist in the POSIX name space.
1262
1263         Rename the following member names back to their old names,
1264         unless !__USE_GNU_REGEX.  All uses changed back.
1265         (buffer): Renamed from re_buffer.
1266         (allocated): Renamed from re_allocated.
1267         (used): Renamed from re_used.
1268         (syntax): Renamed from re_syntax.
1269         (fastmap): Renamed from re_fastmap.
1270         (translate): Renamed from re_translate.
1271         (can_be_null): Renamed from re_can_be_null.
1272         (regs_allocated): Renamed from re_regs_allocated.
1273         (fastmap_accurate): Renamed from re_fastmap_accurate.
1274         (no_sub): Renamed from re_no_sub.
1275         (not_bol): Renamed from re_not_bol.
1276         (not_eol): Renamed from re_not_eol.
1277         (newline_anchor): Renamed from re_newline_anchor.
1278         (num_regs): Renamed from rm_num_regs.
1279         (start): Renamed from rm_start.
1280         (end): Renamed from rm_end.
1281
1282         (free_state): Move up a bit.
1283
1284         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1285         #define to be empty.
1286         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1287         when that is what is intended.
1288         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1289         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1290         (MAX): New macro.
1291         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1292         All uses changed back to re_malloc, etc.  It's now the caller's
1293         responsibility to check for overflow; all callers changed.
1294         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1295         (re_x2nrealloc): Remove.
1296         (free_state): Remove decl.
1297
1298         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1299         (re_set_registers, re_exec):
1300         Use K&R-style defn.
1301
1302         2006-01-31  Roland McGrath  <roland@redhat.com>
1303
1304         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1305         Reported by Mike Frysinger <vapier@gentoo.org>.
1306
1307         2006-01-15  Andreas Jaeger  <aj@suse.de>
1308
1309         [BZ #1950]
1310         * regex_internal.c (re_string_reconstruct): Adjust for
1311         build_wcs_upper_buffer change.
1312         (build_wcs_upper_buffer): Change return type.
1313
1314         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1315
1316         * regex_internal.h: Include <stdint.h> if available.
1317
1318         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1319
1320         * regex_internal.h (SIZE_MAX): Provide a default definition.
1321
1322         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1323
1324         * regcomp.c: Adjust for changed secondary hash function.
1325
1326         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1327
1328         * regex.h: Pretty printing.
1329         Clean up namespace a bit.
1330
1331         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1332
1333         * regexec.c (update_cur_sifted_state, check_arrival,
1334         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1335
1336         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1337                     Ulrich Drepper  <drepper@redhat.com>
1338
1339         [BZ #1302]
1340         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1341         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1342
1343         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1344
1345         [BZ #281]
1346         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1347         * regcomp.c: Remove unnecessary uses of
1348         unsigned RE_TRANSLATE_TYPE.
1349         * regex_internal.h: Likewise.
1350         * regex_internal.c: Likewise.
1351         * regexec.c: Likewise.
1352         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1353
1354         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1355
1356         * regexec.c (find_recover_state): Remove unnecessary
1357         initialization.
1358         (transit_state_bkref): Make DFA a const pointer.
1359         (get_subexp): Likewise.
1360         (check_arrival): Likewise.
1361         (update_cur_sifted_state): Likewise.
1362         (re_search_internal): Likewise.
1363         (prune_impossible_nodes): Likewise.
1364         (acquire_init_state_context): Likewise.
1365         (proceed_next_node): Likewise.
1366         (set_regs): Likewise.
1367         (free_fail_stack_return): Likewise.
1368         (check_arrival_expand_ecl): Mark DFA parameter as const.
1369         (check_arrival_expand_ecl_sub): Likewise.
1370         (check_subexp_limits): Likewise.
1371         (sub_epsilon_src_nodes):  Likewise.
1372         (add_epsilon_src_nodes):  Likewise.
1373         (merge_state_array): Likewise.
1374         (update_regs): Likewise.
1375         (build_trtable): Likewise.
1376         (sift_states_backward): Mark MCTX parameter as const.
1377         (build_sifted_states): Likewise.
1378         (update_cur_sifted_state): Likewise.
1379         (sift_states_mkref): Likewise.
1380         (check_arrival_expand_ecl): Mark eclosure as const.
1381         (check_dst_limits_calc_pos_1): Likewise.
1382         * regex_internal.h (re_match_context_t): Make dfa a const
1383         pointer.
1384
1385         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1386
1387         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1388         (transit_state_sb): Likewise.
1389         (transit_state_mb): Likewise.
1390         (sift_states_iter_mb): Likewise.
1391         (check_arrival_add_next_nodes): Likewise.
1392         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1393         [_LIBC] (re_search_2_stub): Use mempcpy.
1394
1395         * regex_internal.c (re_string_reconstruct): Avoid calling
1396         mbrtowc for very simple UTF-8 case.
1397
1398         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1399         a pointer-to-const.
1400         (re_acquire_state_context): Likewise.
1401         * regex_internal.h: Adjust prototypes.
1402
1403         * regex.c: Prevent using C++ compilers.
1404
1405         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1406         (re_acquire_state_context): Likewise.
1407
1408 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1409             Bruno Haible  <bruno@clisp.org>
1410
1411         * stdint_.h: On OpenBSD, don't redefine types already included in
1412         <sys/types.h> and <inttypes.h>.
1413
1414 2006-03-24  Eric Blake  <ebb9@byu.net>
1415
1416         * time_r.c (copy_string_result): Remove, as it is no longer used.
1417
1418 2006-03-24  Simon Josefsson  <jas@extundo.com>
1419
1420         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1421         including some doc fixes.
1422         (base64_encode_alloc): Fix +1 bug on allocation failures.
1423
1424 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1425
1426         * base64.c (base64_encode): Do not read past end of array with
1427         unsanitized input on systems with CHAR_BIT > 8.
1428
1429 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1430
1431         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1432         Typedef to long int, not to off_, as POSIX will likely change
1433         in that direction.
1434
1435 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1436
1437         * argp-help.c (validate_uparams): Fix typo
1438         * argp-parse.c (argp_default_options): Consistently begin help
1439         messages with a lowercase letter.
1440
1441 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1442
1443         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1444         overrun buffers and shouldn't be used (much as gets shouldn't be
1445         used).
1446         * time_r.c (asctime_r, ctime_r): Likewise.
1447
1448 2006-03-08  Simon Josefsson  <jas@extundo.com>
1449
1450         * gc-gnulib.c (randomize): Don't open files called 'no', they
1451         signal that configure disabled the device.
1452
1453 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1454
1455         * c-stack.c: Include unistd.h unconditionally, since we now assume
1456         the unistd module.
1457         * getlogin_r.c: Likewise.
1458         * getlogin_r.h: Likewise.
1459         * glob.c: Likewise.
1460         * pagealign_alloc.c: Likewise.
1461         * unistd_.h: Remove; no longer needed.
1462
1463 2006-03-07  Simon Josefsson  <jas@extundo.com>
1464
1465         * unistd_.h: New file.
1466
1467 2006-03-07  Simon Josefsson  <jas@extundo.com>
1468
1469         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1470
1471 2006-03-01  Simon Josefsson  <jas@extundo.com>
1472
1473         * readline.c: Fix typo, tiny patch from Stepan Kasal
1474         <kasal@ucw.cz>.
1475
1476 2006-02-28  Simon Josefsson  <jas@extundo.com>
1477
1478         * getopt.c: Protect #include of unistd.h, for MSVS.
1479
1480 2006-02-27  Simon Josefsson  <jas@extundo.com>
1481
1482         * base64.h: Indent #define's.  From Jim Meyering
1483         <jim@meyering.net>.
1484
1485 2006-02-27  Jim Meyering  <jim@meyering.net>
1486
1487         Revert the change of 2006-02-24, so these files can continue
1488         to be sync'd from gettext.
1489         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1490         of `config.h'.
1491
1492 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1493
1494         * glob.c: Say "invalid" rather than "illegal" in comments.
1495
1496 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1497
1498         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1499
1500 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1501
1502         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1503         AT_FDCWD exceeds INT_MAX.
1504         * openat.h (AT_FDCWD): Likewise.
1505
1506 2006-02-14  Jim Meyering  <jim@meyering.net>
1507
1508         Sync from coreutils.
1509
1510         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1511         failure on deficient systems, and simplify gnulib lgpl dependencies.
1512         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1513         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1514
1515         * xalloc-die.c: Remove unused definition of N_.
1516
1517 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1518
1519         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1520
1521 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1522
1523         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1524         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1525
1526 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1527
1528         * argp-namefrob.h: Restore changes accidentally lost during the
1529         "autoupdate" on 2005-12-12.
1530
1531 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1532
1533         * fnmatch.c (L_): Renamed from L, to work around a bug in
1534         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1535         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1536         All uses changed.
1537
1538 2006-01-26  Simon Josefsson  <jas@extundo.com>
1539
1540         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1541         prototype is visible on mingw32.
1542
1543         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1544         for mingw32.
1545
1546         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1547         mingw32).
1548
1549 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1550
1551         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1552         attempt to open for write; this always fails, at least on POSIX
1553         hosts.  This reinstates the 2006-01-09 change, which was
1554         inadvertently removed.
1555
1556 2006-01-26  Bruno Haible  <bruno@clisp.org>
1557             Paul Eggert  <eggert@cs.ucla.edu>
1558
1559         * stdbool_.h (_Bool)
1560         [(! (defined __cplusplus || defined __BEOS__)
1561           && !defined __GNUC__
1562           && !(defined __HP_cc || defined __xlc__
1563                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1564                || defined __sgi))]:
1565         #define to signed char in these cases too; this simplifies
1566         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1567         etc., separately) and makes it more conservative.
1568
1569 2006-01-21  Jim Meyering  <jim@meyering.net>
1570
1571         Sync from the stable (b5) branch of coreutils:
1572
1573         * fts.c (fts_children): Don't let close() clobber errno from
1574         failed fchdir().
1575
1576         * fts.c (fts_stat): When following a symlink-to-directory,
1577         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1578         a dangling symlink.  That can also happen at least for ELOOP.
1579         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1580         FYI, this bug predates the inclusion of fts.c in coreutils.
1581
1582         * fts.c (fts_open): Put new maxarglen declaration and uses
1583         in their own block, so pre-c99 compilers don't object.
1584
1585         Avoid the double-free (first in fts_read, second in fts_close) that
1586         would occur when an `active' directory is made inaccessible (e.g.,
1587         via chmod a-x) during a traversal.
1588         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1589         before returning.  Reproduce this failure by
1590         mkdir -p a/b; cd a; chmod a-x . b
1591         Reported by Stavros Passas.
1592
1593 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1594
1595         * argp-namefrob.h: Bugfix. Remove stray #
1596
1597 2006-01-25  Bruno Haible  <bruno@clisp.org>
1598
1599         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1600         warnings.
1601         Reported by Paul Eggert.
1602
1603 2006-01-25  Jim Meyering  <jim@meyering.net>
1604
1605         * fileblocks.c: Remove more useless parentheses.
1606         * readutmp.h: Likewise.
1607
1608 2006-01-24  Bruno Haible  <bruno@clisp.org>
1609
1610         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1611         has it.
1612         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1613         2005-11-26.
1614
1615         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1616         to avoid problems with the built-in _Bool type.
1617         Reported by Paul Eggert on 2005-11-26.
1618
1619 2006-01-24  Jim Meyering  <jim@meyering.net>
1620
1621         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1622
1623 2006-01-24  Simon Josefsson  <jas@extundo.com>
1624
1625         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1626         Bruno.
1627
1628 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1629
1630         Work around porting bugs reported by Dieter in
1631         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1632         * getopt.c (_NOPROTO): Remove; no longer needed.
1633         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1634         Include "getopt.h" first, to check interface.
1635         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1636         !HAVE_DECL_GETENV.
1637         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1638         (__strndup): Revert to K&R-style function dfns, the glibc style.
1639         * strnlen.c: Don't claim it's taken from glibc; it's not.
1640         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1641         Include strnlen.h first, to get prototype properly.
1642         (strnlen): Renamed from __strnlen.
1643         Remove weak alias.
1644
1645 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1646
1647         These changes imported from libc.
1648         * getopt.c: Use __fxprintf instead of inline stream orientation
1649         test and two separate function calls.
1650         * strndup.c (__strndup): Add libc_hidden_def.
1651
1652 2006-01-22  Bruno Haible  <bruno@clisp.org>
1653
1654         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1655         temporary buffer for sprintf, take into account the precision also
1656         for 'd', 'i', 'u', 'o', 'x', 'X'.
1657
1658 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1659
1660         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1661         to pacify gcc -Wswitch-default.
1662
1663 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1664
1665         * argp-help.c (usage_long_opt): Do not print DOC options.
1666         (__argp_base_name): Removed
1667         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1668         typo.
1669         (__argp_base_name): Provide macro definition or extern declaration
1670         depending on the configuration
1671
1672 2006-01-20  Simon Josefsson  <jas@extundo.com>
1673
1674         * inet_ntop.h: Unconditionally include sys/socket.h.
1675
1676 2006-01-19  Simon Josefsson  <jas@extundo.com>
1677
1678         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1679
1680 2006-01-12  Simon Josefsson  <jas@extundo.com>
1681
1682         * base64.c: Fix warning, reported by Bruno Haible
1683         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1684
1685 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1686
1687         Sync from coreutils.
1688         * md5.c: Fix commentary typos.
1689         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1690         * md5.h (__attribute__): Remove; unused.
1691         * sha1.c: Fix commentary to match md5 better.
1692         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1693         so that we don't need to worry about alignment.  All uses changed.
1694         This merges the 2005-10-28 md5 change into sha1.
1695
1696 2006-01-11  Jim Meyering  <jim@meyering.net>
1697
1698         Sync from coreutils.
1699         * md5.c (OP): Fix spacing.
1700
1701 2006-01-11  Simon Josefsson  <jas@extundo.com>
1702
1703         * stdint_.h (SIZE_MAX): Add missing (.
1704
1705 2006-01-10  Bruno Haible  <bruno@clisp.org>
1706
1707         * argp.h (__const): Remove macro. Use const instead.
1708         * argp-fmtstream.h (__const): Likewise.
1709         * glob_.h (__const): Remove macro.
1710         * glob-libc.h: Use const instead of __const.
1711
1712 2006-01-10  Jim Meyering  <jim@meyering.net>
1713
1714         Avoid the double-free (first in fts_read, second in fts_close) that
1715         would occur when an `active' directory is made inaccessible (e.g.,
1716         via chmod a-x) during a traversal.
1717         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1718         before returning.  Reproduce this failure by
1719         mkdir -p a/b; cd a; chmod a-x . b
1720         Reported by Stavros Passas.
1721
1722         Sync from coreutils.
1723         * sha1.c: Tweak grammar in a comment.
1724
1725 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1726
1727         * regex_internal.h (BITSET_WORD_BITS):
1728         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1729         preprocessor mishandles large unsigned values as if they were signed.
1730         Problem reported by Claudio Fontana in
1731         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1732
1733 2006-01-10  Simon Josefsson  <jas@extundo.com>
1734
1735         * socket_.h: New file.
1736
1737 2006-01-10  Bruno Haible  <bruno@clisp.org>
1738
1739         * localcharset.c: Update from GNU gettext.
1740
1741 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1742
1743         Sync from coreutils.
1744         * chdir-long.c (cdb_free): Don't bother trying to open directory
1745         for write access: POSIX says that must fail.
1746         * fts.c (diropen): Likewise.
1747         * save-cwd.c (save_cwd): Likewise.
1748         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1749         well, for minor improvements on hosts that lack O_DIRECTORY.
1750         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1751         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1752         Fall back on chown if open failed with EACCES.
1753
1754         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1755         Report an error at compile-time if only a 1-second nominal clock
1756         resolution is found.
1757
1758         * lchmod.h: New file.
1759         * mkdir-p.c: Include lchmod.h, lchown.h.
1760         (make_dir_parents): Use lchown rather than chown, and
1761         lchmod rather than chmod.
1762
1763         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1764         too.  Problem with "none" reported by Bob Proulx.  Problem with
1765         "proc" reported by n0dalus.
1766
1767         * mountlist.c: Include <limits.h>.
1768         (dev_from_mount_options)
1769         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1770         New function.  It no longer assumes "dev=" has the System V meaning
1771         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1772         (read_file_system_list)
1773         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1774         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1775         dev= in that case.
1776
1777         * posixtm.h (PDS_PRE_2000): New macro.
1778         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1779         All usages changed.  Reject dates outside the range 1969-1999 if
1780         PDS_PRE_2000 is used.
1781
1782 2006-01-09  Jim Meyering  <jim@meyering.net>
1783
1784         Sync from coreutils.
1785
1786         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1787
1788         * chdir-safer.h, chdir-safer.c: New files.
1789
1790         * modechange.c (mode_compile): Reject an invalid mode string
1791         that starts with an octal digit.  From Andreas Gruenbacher.
1792
1793         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1794         and dup to open_safer and dup_safer, respectively.
1795         (openat_permissive): Fix typo in comment.
1796
1797         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1798         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1799         (_): Remove; no longer needed.
1800         (openat): Renamed from rpl_openat; no need for rpl_openat
1801         since openat.h renames openat for us.
1802         Replace most of the body with a call to openat_permissive,
1803         to avoid duplicate code.
1804         Port to (probably hypothetical) environments were mode_t is
1805         wider than int.
1806         (openat_permissive): Require mode arg, so that we can check
1807         types better.  Put it just after flags.  Change cwd failure
1808         indicator from pointer-to-bool to pointer-to-errno-value.
1809         All callers changed.
1810         Invoke openat_save_fail and/or openat_restore_fail if
1811         cwd_errno is null, so that openat can call us.
1812         (openat_permissive, fdopendir, fstatat, unlinkat):
1813         Simplify errno handling to avoid some duplicate code,
1814         as it's OK to set errno on success.
1815         * openat.h: Revamp code so that function macros depend on
1816         __OPENAT_PREFIX only, not also on AT_FDCWD.
1817         (openat_ro): Remove.  Caller changed to use openat_permissive.
1818         (openat_permissive): Now a macro, if not a function.
1819         (openat_restore_fail, openat_save_fail): Now always functions,
1820         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1821
1822         * openat-priv.h: New file, defining macros used by mkdirat.c
1823         and openat.c.
1824         * mkdirat.c: Include openat-priv.h.
1825         Remove definitions of macros defined therein.
1826         * openat.c: Likewise.
1827
1828         * mkdirat.c (mkdirat): New file and function.
1829         * openat.h (mkdirat): Declare.
1830
1831         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1832
1833         * openat.h (openat_permissive): Declare.
1834         (openat_ro): Define.
1835
1836         * openat.c (EXPECTED_ERRNO): New macro.
1837         (openat_permissive): New function -- used in remove.c rewrite.
1838         (all functions): Set errno just before returning, only if there
1839         was an actual failure.
1840         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1841
1842         Emulate openat-family functions using Linux's procfs, if possible.
1843         Idea and some code based on Ulrich Drepper's glibc changes.
1844
1845         * openat.c: (BUILD_PROC_NAME): New macro.
1846         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1847         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1848         before falling back on save_cwd and restore_cwd.
1849         (fdopendir, fstatat, unlinkat): Likewise.
1850
1851         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1852         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1853
1854         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1855         as second argument to va_arg.  Otherwise, some versions of gcc
1856         warn that `if this code is reached, the program will abort'.
1857
1858 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1859
1860         Sync from coreutils.
1861
1862         Add POSIX ACL support
1863         * acl.h (copy_acl, set_acl): Add declarations.
1864         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1865         systems other than Linux.
1866         (chmod_or_fchmod): New function: use fchmod when possible,
1867         and chmod otherwise.
1868         (file_has_acl): Add a POSIX ACL implementation, with a
1869         Linux-specific subcase.
1870         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1871         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1872         acls are unsupported.
1873         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1874         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1875         are unsupported.
1876
1877 2006-01-09  Bruno Haible  <bruno@clisp.org>
1878
1879         * sysexit_.h (EX_OK): New macro.
1880         Suggested by Martin Lambers <marlam@marlam.de>.
1881
1882 2006-01-09  Bruno Haible  <bruno@clisp.org>
1883
1884         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1885         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1886         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1887         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1888
1889 2006-01-09  Bruno Haible  <bruno@clisp.org>
1890
1891         * stdint_.h (SIZE_MAX): Write the value without involving negative
1892         numbers.
1893
1894 2005-10-16  Bruno Haible  <bruno@clisp.org>
1895
1896         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1897         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1898
1899 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1900
1901         * strftime.c (tzname): Don't declare if it is already #defined.
1902         Problem reported for Mingw by Mark Junker.
1903
1904 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1905
1906         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1907         long int, not int, for nanosecond counts, so that people who are
1908         used to POSIX struct timespec won't be surprised.  Reported by Jim
1909         Meyering.
1910
1911 2005-12-16  Jim Meyering  <jim@meyering.net>
1912
1913         * fprintftime.c, fprintftime.h: New files.
1914
1915 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1916
1917         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1918         * argp-help.c (fill_in_uparams): Check if the constructed
1919         struct uparams is valid. Fall back to the default values if it is
1920         not.
1921
1922 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1923
1924         * argp-help.c (__argp_base_name): New function
1925         (__argp_short_program_name): Rewrite using __argp_base_name
1926         * argp-namefrob.h: Define program_invocation_name and
1927         program_invocation_short_name if requested
1928         (__argp_base_name): Add prototype
1929         * argp-parse.c (argp_def): Use gettext wrappers
1930         (argp_default_parser): Use __argp_base_name
1931         * argp-pin.c: New file. Defines program_invocation_name and
1932         program_invocation_short_name on systems that lack them.
1933
1934 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1935
1936         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1937         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1938         porting problem reported by Georg Schwarz in
1939         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1940
1941 2005-07-09  Bruno Haible  <bruno@clisp.org>
1942
1943         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1944         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1945         Reported by Mark Junker <mjscod@gmx.de>.
1946
1947 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1948
1949         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1950         (uintmax_t) [defined uintmax_t]: Do not declare.
1951         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1952         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1953         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1954         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1955         sake of portability to weird hosts that C allows (though we don't
1956         know of any practical examples).
1957
1958         * savedir.h (fdsavedir): New decl.
1959         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1960         contains most of the former guts of savedir.
1961         (savedir): Use savedirstream.
1962         Include "openat.h".
1963
1964 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1965
1966         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1967         coreutils no longer futzes with rounding modes.
1968
1969 2005-11-14  Jim Meyering  <jim@meyering.net>
1970
1971         * mkstemp-safer.c: Include <config.h>, required for possible
1972         replacement of mkstemp.
1973
1974 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1975
1976         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1977         business.
1978         (gethrxtime) [! (HAVE_NANOUPTIME
1979         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1980         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1981         our own approximation.
1982
1983 2005-11-10  Simon Josefsson  <jas@extundo.com>
1984
1985         * readline.c: Remove EOL.
1986
1987 2005-11-08  Eric Blake  <ebb9@byu.net>
1988
1989         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1990
1991 2005-11-08  Eric Blake  <ebb9@byu.net>
1992
1993         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1994
1995 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1996
1997         Fix porting problem reported by Theodoros V. Kalamatianos.
1998         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1999         Don't assume that futimes failing means we must fail.
2000
2001 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2002
2003         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2004         leave errno alone.  Problem reported by Dmitry V. Levin.
2005
2006 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2007
2008         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2009         errno alone.  Problem reported by Frederic Jolliton.
2010
2011 2005-10-28  Simon Josefsson  <jas@extundo.com>
2012
2013         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2014         "restrict" keywords, as per POSIX.  Protect the function
2015         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2016         Don't use K&R prototypes.  Check the sprintf return values.
2017         Re-define EAFNOSUPPORT if not present.  Indent.
2018
2019         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2020         suggested by Bruno Haible <bruno@clisp.org>.
2021
2022         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2023
2024         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2025
2026         * gc-libgcrypt.c: Add MD2 (which is not available through
2027         libgcrypt).
2028
2029         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2030
2031         * md2.h, md2.c: New files.
2032
2033 2005-10-24  Simon Josefsson  <jas@extundo.com>
2034
2035         * md4.h: Shrink buffer size, now that we changed the type.
2036
2037 2005-10-22  Simon Josefsson  <jas@extundo.com>
2038
2039         * arcfour.h, arcfour.c: Use fixed size indices in the
2040         arcfour_context struct (simplify test vector testing in GNU
2041         Shishi).
2042
2043 2005-10-22  Simon Josefsson  <jas@extundo.com>
2044
2045         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2046         suggested by Bruno Haible <bruno@clisp.org>.
2047
2048 2005-10-22  Simon Josefsson  <jas@extundo.com>
2049
2050         * crc.h: Include stddef.h, for size_t.
2051
2052 2005-10-21  Simon Josefsson  <jas@extundo.com>
2053
2054         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2055         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2056
2057 2005-10-21  Simon Josefsson  <jas@extundo.com>
2058
2059         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2060         block.
2061
2062 2005-10-21  Simon Josefsson  <jas@extundo.com>
2063
2064         * gc-gnulib.c: Support ARCTWO in CBC mode.
2065
2066 2005-10-21  Simon Josefsson  <jas@extundo.com>
2067
2068         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2069         <bruno@clisp.org>.
2070
2071         * hmac-sha1.c (hmac_sha1): Likewise.
2072
2073         * crc.c (crc32_update): Actually use crc parameter, suggested by
2074         Bruno Haible <bruno@clisp.org>.
2075
2076         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2077         <bruno@clisp.org>.
2078
2079 2005-10-21  Simon Josefsson  <jas@extundo.com>
2080
2081         * des.h, des.c: New files.
2082
2083         * gc-gnulib.c: Support DES.c
2084
2085 2005-10-21  Simon Josefsson  <jas@extundo.com>
2086
2087         * arctwo.h, arctwo.c: New files.
2088
2089         * gc-gnulib.c: Support ARCTWO.
2090
2091 2005-10-21  Simon Josefsson  <jas@extundo.com>
2092
2093         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2094
2095 2005-10-19  Simon Josefsson  <jas@extundo.com>
2096
2097         * gc-gnulib.c: Support ARCFOUR.
2098
2099 2005-10-19  Simon Josefsson  <jas@extundo.com>
2100
2101         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2102         support.
2103
2104         * gc.h: Add ECB enum type.
2105
2106         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2107
2108 2005-10-19  Simon Josefsson  <jas@extundo.com>
2109
2110         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2111
2112 2005-10-18  Simon Josefsson  <jas@extundo.com>
2113
2114         * md4.h, md4.c: New files, based on md5.?.
2115
2116 2005-10-17  Simon Josefsson  <jas@extundo.com>
2117
2118         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2119
2120         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2121
2122 2005-10-17  Simon Josefsson  <jas@extundo.com>
2123
2124         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2125
2126 2005-10-17  Simon Josefsson  <jas@extundo.com>
2127
2128         * gc.h, gc-libgcrypt.c: Add ciphers.
2129
2130 2005-10-17  Simon Josefsson  <jas@extundo.com>
2131
2132         * sha1.c: Use uint32_t instead of md5_uint32.t
2133
2134         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2135         md5.h.
2136
2137         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2138
2139         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2140
2141 2005-10-15  Simon Josefsson  <jas@extundo.com>
2142
2143         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2144
2145         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2146
2147 2005-10-14  Simon Josefsson  <jas@extundo.com>
2148
2149         * arcfour.h, arcfour.c: New files.
2150
2151 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2152
2153         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2154         include <wchar.h>; no longer needed.
2155
2156 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2157         and  Ulrich Drepper  <drepper@redhat.com>
2158
2159         Import from libc.
2160         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2161         instead of inline stream orientation test and two separate
2162         function calls.  Pay no attention to USE_IN_LIBIO.
2163
2164 2005-10-14  Roland McGrath  <roland@redhat.com>
2165
2166         Import from libc.  [BZ #1331]
2167         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2168         macro argument.
2169         Reported by Matej Vela <vela@debian.org>.
2170
2171 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2172
2173         * mkdir-p.c (make_dir_parents): Don't report an error if an
2174         intermediate directory is in a read-only file system.  Problem
2175         reported by Eric Blake.
2176
2177 2005-10-13  Simon Josefsson  <jas@extundo.com>
2178
2179         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2180         Move memory allocation outside of loop.
2181
2182 2005-10-12  Simon Josefsson  <jas@extundo.com>
2183
2184         * gc-pbkdf2-sha1.c: New file.
2185
2186         * gc.h: Add gc_pbkdf2_sha1 prototype.
2187
2188 2005-10-12  Simon Josefsson  <jas@extundo.com>
2189
2190         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2191         suggested by Bruno Haible <bruno@clisp.org>.
2192
2193 2005-10-12  Simon Josefsson  <jas@extundo.com>
2194
2195         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2196
2197         * gc-gnulib.c (gc_hmac_sha1): New function.
2198
2199 2005-10-12  Simon Josefsson  <jas@extundo.com>
2200
2201         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2202
2203 2005-10-12  Simon Josefsson  <jas@extundo.com>
2204
2205         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2206         GC_USE_HMAC_MD5, respectively.
2207
2208         * gc-libgcrypt.c (gc_md5): Fix assert call.
2209         (gc_md5): Fix typo.
2210
2211         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2212
2213         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2214
2215         * gc-gnulib.c (gc_hash_buffer): Ditto.
2216
2217 2005-10-11  Bruno Haible  <bruno@clisp.org>
2218
2219         * c-strcasestr.h: New file, from GNU gettext.
2220         * c-strcasestr.c: New file, from GNU gettext.
2221
2222 2005-10-11  Bruno Haible  <bruno@clisp.org>
2223
2224         * c-strcase.h: New file, from GNU gettext.
2225         * c-strcasecmp.c: New file, from GNU gettext.
2226         * c-strncasecmp.c: New file, from GNU gettext.
2227
2228 2005-10-11  Simon Josefsson  <jas@extundo.com>
2229
2230         * crc.h, crc.c: New files.
2231
2232         * gc.h (gc_hash_buffer): Add doc.
2233
2234 2005-10-08  Simon Josefsson  <jas@extundo.com>
2235
2236         * gc.h: Add gc_hash and gc_hash_buffer.
2237
2238         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2239
2240         * gc-libgcrypt.c (gc_hash_buffer): Add.
2241
2242 2005-10-11  Bruno Haible  <bruno@clisp.org>
2243
2244         * strcasecmp.c: Include limits.h.
2245         (strcasecmp): Avoid integer overflow on exotic platforms.
2246         * strncasecmp.c: Include limits.h.
2247         (strncasecmp): Avoid integer overflow on exotic platforms.
2248         Reported by Paul Eggert.
2249
2250 2005-10-06  Simon Josefsson  <jas@extundo.com>
2251
2252         * hmac-md5.c: New file.
2253
2254         * hmac.h: New file.
2255
2256 2005-10-06  Simon Josefsson  <jas@extundo.com>
2257
2258         * memxor.c (memxor): Avoid casts and warnings.
2259
2260 2005-10-05  Derek Price  <derek@ximbiot.com>
2261
2262         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2263
2264 2005-10-05  Simon Josefsson  <jas@extundo.com>
2265
2266         * memxor.c (memxor): Fix compiler error.
2267
2268         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2269         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2270
2271         * memxor.h, memxor.c: New files.
2272
2273         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2274         we assume all systems have it, suggested by Jim Meyering
2275         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2276         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2277         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2278         same reasons.
2279
2280 2005-10-04  Bruno Haible  <bruno@clisp.org>
2281
2282         * verify.h (verify_true): Provide alternative definition for C++.
2283
2284 2005-10-04  Simon Josefsson  <jas@extundo.com>
2285
2286         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2287         D. Baushke" <mdb@gnu.org>.
2288
2289 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2290
2291         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2292         (SSIZE_MAX): New macro, if not already defined.
2293         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2294         than 2 GiB.
2295
2296 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2297
2298         * exclude.c: Include verify.h.
2299         (verify): Remove.  All callers changed to use verify.h's version.
2300         * strtoimax.c: Likewise.
2301         * utimecmp.c: Likewis.e
2302
2303         Sync from coreutils.
2304         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2305         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2306         * .cvsignore: Add fts.h, search.h, t-fpending.
2307         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2308         bother returning ENOSYS if settimeofday or stime fails; just let
2309         them return whatever errno they want to return.
2310         * utimens.c: Include unistd.h, for dup2.
2311         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2312         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2313
2314 2005-10-02  Jim Meyering  <jim@meyering.net>
2315
2316         Sync from coreutils.
2317         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2318         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2319         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2320         Remove AT_FDCWD test.
2321         Do not consume the fd unless successful.
2322         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2323         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2324         block, so that we don't even try to compile it if settimeofday is
2325         available.  This works around a compilation failure on OSF1 V5.1,
2326         due to stime requiring a `long int*' while tv_sec is `int'.
2327
2328 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2329
2330         * getdelim.c (getdelim): Remove unused variables.
2331
2332 2005-10-01  Simon Josefsson  <jas@extundo.com>
2333
2334         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2335         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2336         AI_* and EAI_* definitions.  Protect function declarations.
2337
2338 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2339
2340         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2341         so that the code works even with ancient cpp.  Portability problem
2342         with GCC 2.7.2.1 reported by Thomas M.Ott.
2343
2344 2005-09-27  Jim Meyering  <jim@meyering.net>
2345
2346         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2347
2348         * intprops.h (signed_type_or_expr__): Define.
2349         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2350         for unsigned types.
2351
2352 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2353
2354         * verify.h (verify_expr): Remove, replacing with:
2355         (verify_true): New macro that returns true instead of void.
2356         (verify_type__): Remove.
2357         (verify): Use verify_true rather than verify_type__.
2358
2359 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2360
2361         * utimens.c (ENOSYS): Define if not already defined.
2362         (futimens): Support having a null PATH if the file descriptor
2363         is nonnegative.
2364
2365         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2366         Remove.
2367         (__attribute): Define to empty unless GCC 3.1 or later.
2368         This works around a core dump on OpenBSD 3.4, which has GCC
2369         2.95.3, which dumps core when given __attribute__(()).  It also
2370         simplifies other tests, since we really don't want to bother with
2371         worrying about which ancient version of GCC supported what.
2372         Original problem reported by Yoann Vandoorselaere, with part of
2373         the fix suggested by Derek Price.
2374
2375 2005-09-24  Jim Meyering  <jim@meyering.net>
2376
2377         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2378         so we can once again use a positive bitfield width of 1 -- now we
2379         don't have to explain why we were using a bitfield width of 2.
2380
2381 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2382
2383         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2384         Problem reported by Eric Blake.
2385         (getaddrinfo): Initialize se so that it's not garbage.
2386         Redo internal storage allocation so that it doesn't make unportable
2387         assumptions about alignment.
2388         Fix a memory leak.
2389
2390         * utimens.c (futimens): Use futimesat if available.
2391         Prefer it to futimes since it doesn't have the futimes bug.
2392
2393         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2394         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2395         Instead, declare a function that returns a pointer to an array,
2396         and use verify_type__ to declare the size of the array.
2397         Problem and germ of a solution reported by Bruno Haible.
2398         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2399         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2400
2401 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2402
2403         Sync from coreutils.
2404
2405         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2406         stat-time.h.
2407         * argmatch.h: Include verify.h
2408         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2409         (ARGMATCH_ASSERT): Remove; unused.
2410         * canonicalize.c: Assume STDC_HEADERS.
2411         * exclude.c: Include "strcase.h".
2412         * regex_internal.h [!defined _LIBC]: Likewise.
2413         * getusershell.c: Include stdio--.h rather than stdio.h
2414         and stdio-safer.h.
2415         (getusershell): Call fopen, not fopen_safer.
2416         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2417         Do not include unistd-safer.h.
2418         (save_cwd): Don't call fd_safer; no longer needed
2419         now that we include fcntl--.h.
2420
2421         * getdate.y (relative_time): New type.
2422         (RELATIVE_TIME_0): New constant.
2423         (parser_control): Use relative_time instead of doing it ourselves.
2424         (%union): Add new relative_time rel member.
2425         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2426         Now typeless.
2427         (relunit, relunit_snumber): Now of type rel.
2428         (zone, rel, relunit, get_date): Adjust to above changes.
2429
2430         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2431         Do not include unistd-safer.h.
2432         (getloadavg): Don't call fd_safer; no longer needed
2433         now that we include fcntl--.h.
2434
2435         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2436         (make_dir_parents): Treat ENOSYS like EEXIST.
2437
2438         Improve quality of diagnostics on restore_cwd failure.
2439         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2440         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2441         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2442         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2443         each time through the loop.  Do not diagnose restore_cwd failure;
2444         that is the caller's job (and perhaps the caller does not care).
2445
2446         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2447         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2448         If the file already exists but is not a directory, don't bother
2449         to try to make its parents.
2450         Close potential file descriptor leak if we can't chdir("/") (!).
2451         Don't always return true if chdir($PWD) fails; return true only
2452         if the requested action was done successfully (except for the
2453         chdir($PWD)).
2454         Don't log final directory unless we actually made it.
2455         Refactor to avoid duplicate code to fix up permissions.
2456         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2457
2458         * strftime.c (my_strftime): Rewrite the previous change slightly,
2459         to make it a bit faster and (I hope) clearer.
2460         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2461         Fix bug in formats like %2N.
2462
2463         * verify.h: New file.
2464
2465 2005-09-22  Jim Meyering  <jim@meyering.net>
2466
2467         Sync from coreutils.
2468
2469         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2470
2471         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2472         the .tm_year member, since otherwise gcc-4.0 would now warn about
2473         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2474
2475         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2476         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2477
2478         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2479         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2480         when run in a time zone for which daylight savings time is in effect
2481         for the starting date.
2482
2483         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2484         stop us from restricting permissions of just-created absolute-named
2485         directories.
2486         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2487         to restore initial working directory.
2488         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2489         to tell caller if/when we change the working directory and are
2490         unable to return to the initial one.
2491         * mkdir-p.h (make_dir_parents): Update prototype.
2492         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2493         `return false'.  This fixes a bug introduced on 2004-07-30.
2494
2495         * openat.c (fdopendir): Be sure to close the supplied
2496         file descriptor before returning.  This makes our replacement
2497         implementation a little closer to Solaris's, where fdopendir
2498         ties the file descriptor to the returned DIR* pointer.
2499         * openat.c (unlinkat): New function.
2500         * openat.h (unlinkat): Add prototype.
2501         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2502         (openat_restore_fail): Rename from openat_restore_die.
2503         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2504
2505         Provide an alternative to exiting immediately upon save_cwd or
2506         restore_cwd failure.  Now, an application can arrange e.g.,
2507         to perform a longjump in that case.
2508         * openat.c: Include dirname.h.
2509         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2510         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2511         and openat_restore_die rather than calling error directly.
2512         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2513
2514         * openat-die.c (openat_save_die, openat_restore_die): New file.
2515         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2516
2517         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2518         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2519                             int utc, int nanoseconds);
2520         Background:
2521         date should not have to allocate a megabyte of virtual memory to
2522         handle a format argument like +%1048575T.  When implemented with
2523         strftime, it must allocate such a buffer, use strftime to fill it
2524         in, print it, then free it.
2525         With fprintftime, it simply prints everything and exits.
2526         With no need for memory allocation, that's one fewer way to fail.
2527         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2528         optional field width, not before, so we accept %9:z, not %:9z.
2529         (my_strftime): Be sure to use L_('x') for literals.
2530
2531         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2532         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2533         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2534         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2535         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2536         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2537         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2538         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2539         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2540
2541         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2542         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2543         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2544         and don't include <sys/file.h>).
2545
2546 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2547
2548         Sync from coreutils.
2549
2550         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2551         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2552         [!LDAV_DONE]: Avoid unused variable warning.
2553
2554 2005-09-21  Bruno Haible  <bruno@clisp.org>
2555
2556         * unicodeio.h (unicode_to_mb): New declaration.
2557
2558 2005-09-20  Derek Price  <derek@ximbiot.com>
2559
2560         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2561
2562 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2563
2564         Use a consistent style for including <config.h>.
2565         * __fpending.c, acl.c, argmatch.c,
2566         argp-help.c, argp-parse.c,
2567         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2568         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2569         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2570         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2571         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2572         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2573         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2574         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2575         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2576         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2577         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2578         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2579         modechange.c, mountlist.c, open-safer.c, physmem.c,
2580         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2581         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2582         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2583         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2584         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2585         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2586         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2587         userspec.c, utimecmp.c, version-etc-fsf.c,
2588         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2589         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2590         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2591         Standardize inclusion of config.h.
2592         * __fpending.h, dirfd.h, getdate.h, human.h,
2593         inttostr.h:  Removed inclusion of config.h from header files.
2594         * inttostr.c:  Adjusted in-tree users.
2595         * timespec.h: Remove superfluous warning to include config.h.
2596         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2597         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2598         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2599         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2600
2601 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2602
2603         * stat-time.h: New file.
2604         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2605         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2606         in a different way.
2607         (timespec_cmp): New function.
2608         * utimecmp.c: Include stat-time.h.
2609         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2610         members exist, not on the obsolescent ST_MTIM_NSEC.
2611         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2612
2613 2005-09-15  Derek Price  <derek@ximbiot.com>
2614             Paul Eggert  <eggert@cs.ucla.edu>
2615
2616         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2617         changes, consolidating in...
2618         * regex_internal.h: ...this file.
2619
2620 2005-09-15  Derek Price  <derek@ximbiot.com>
2621
2622         * regex_internal.h: Blank `pure' for GNUC < 3.
2623         * regex_internal.c: Ditto, using this...
2624         (__GNUC_PREREQ): ...new macro.
2625         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2626         (__GNUC_PREREQ): ...this new macro.
2627
2628         * strstr.h: Include string.h. Define strstr as a macro here.
2629
2630 2005-09-13  Derek Price  <derek@ximbiot.com>
2631
2632         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2633         failure.
2634         Reported by Jim Meyering  <jim@meyering.net>.
2635
2636 2005-09-13  Jim Meyering  <jim@meyering.net>
2637
2638         * canon-host.c: Filter through gnu indent and reword comments slightly.
2639         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2640
2641 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2642
2643         * lib/base64.c: Typo.
2644         (base64_encode): Put b64str in initialized data section.
2645
2646 2005-09-12  Derek Price  <derek@ximbiot.com>
2647
2648         Return usable errors from canon-host.
2649         * canon-host.h: New file.
2650         * canon-host.c (canon_host): Wrap...
2651         (canon_host_r): ...this new function, which now relies exclusively on
2652         getaddrinfo.
2653         (ch_strerror): New function.
2654         (last_cherror): New global.
2655         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2656         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2657         void *.
2658         (freeaddrinfo): Free ai->ai_canonname when set.
2659
2660 2005-09-12  Derek Price  <derek@ximbiot.com>
2661             Paul Eggert  <eggert@cs.ucla.edu>
2662
2663         * glob-libc.h: Renamed from glob_.h.  The new version is
2664         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2665         protecting things that should be done only in gnulib contexts.
2666         * glob_.h: New file, containing only the glob things needed for
2667         gnulib.
2668         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2669         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2670         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2671         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2672         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2673         and to respect the namespace rules better.
2674
2675 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2676
2677         Merge glibc and coreutils changes into gnulib, plus a few
2678         extra fixes.
2679         * md5.c: Use #error rather than a string.
2680         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2681         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2682         (__attribute__): Define to empty for non recent-GCC.
2683         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2684         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2685         Renamed from their non-__ counterparts, with new macros replacing
2686         them if not _LIBC.  Add __THROW attribute.
2687         (rol): Remove.
2688         (struct md5_ctx): Align buffer if using GCC.
2689         * sha1.h (struct sha1_ctx): Likewise.
2690         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2691         The old name was backwards.
2692         (NOTSWAP): Remove; not used.
2693         (rol): New macro, moved here from md5.h.
2694         (sha1_process_block): Remove a FIXME that doesn't make sense.
2695
2696 2005-09-12  Derek Price  <derek@ximbiot.com>
2697
2698         * gai_strerror.c: Include config.h when available.  Include
2699         getaddrinfo.h before other headers to test interface.
2700         Reported by Larry Jones <lawrence.jones@ugs.com>.
2701
2702 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2703
2704         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2705         definitions, since that's the preferred style in glibc.
2706         Fix a minor spacing issue, and update copyright notice to match glibc's.
2707
2708 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2709
2710         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2711
2712 2005-09-06  Simon Josefsson  <jas@extundo.com>
2713
2714         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2715         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2716
2717 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2718
2719         Change bitset word type from unsigned int to unsigned long int,
2720         as this has better performance on typical 64-bit hosts.
2721         Port bitset code to hosts with unusual word sizes.
2722         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2723         (build_collating_symbol):
2724         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2725         argument is a bitset.  This is merely a style issue, but it makes
2726         it clearer that an entire array is expected.
2727         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2728         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2729         Port to the case where bitset_word is not the same as unsigned int.
2730         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2731         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2732         Likewise.
2733         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2734         (build_trtable, group_nodes_into_DFAstates):
2735         Likewise.
2736         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2737         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2738         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2739         * regexec.c (group_nodes_into_DFAstates): Likewise.
2740         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2741         * regcomp.c (optimize_subexps, lower_subexp):
2742         Work even if bitset_word has holes in its bitwise representation.
2743         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2744         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2745         Likewise.
2746         * regex_internal.c (re_string_reconstruct):
2747         Don't assume UCHAR_MAX == 255.
2748         * regex_internal.h (bitset_set_all): Likewise.
2749         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2750         All uses changed.
2751         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2752         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2753         All uses changed.
2754         (BITSET_WORD_MAX): New macro.
2755         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2756         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2757         (bitset_empty, bitset_copy):
2758         Prefer sizeof (bitset) to multiplying it out ourselves.
2759         (bitset_not_merge): Remove; unused.
2760         (bitset_contain): Return bool, not unsigned int with one bit on.
2761         All callers changed.
2762         * regexec.c (build_trtable): Don't assume bitset has no stricter
2763         alignment than re_node_set; do this by defining a new internal
2764         type struct dests_alloc and using it to allocate memory.
2765
2766 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2767
2768         Check for arithmetic overflow when calculating sizes, to prevent
2769         some buffer-overflow issues.  These patches are conservative, in the
2770         sense that when I couldn't determine whether an overflow was possible,
2771         I inserted a run-time check.
2772         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2773         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2774         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2775         (re_xnrealloc, re_x2nrealloc): New inline functions.
2776         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2777         (build_equiv_class, build_charclass): Check for arithmetic overflow
2778         in size expression calculations.
2779         * lib/regex_internal.c (re_string_realloc_buffers):
2780         (build_wcs_upper_buffer, re_node_set_add_intersect):
2781         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2782         (re_dfa_add_node, register_state): Likewise.
2783         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2784         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2785         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2786         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2787
2788 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2789
2790         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2791         to avoid a collision with bits/local_lim.h in glibc.
2792         All uses changed.  Problem reported by Dmitry V. Levin in
2793         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2794
2795         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2796         bugs in int versus size_t comparisons.
2797         (re_string_context_at): Fix bug where the code assumed that
2798         Idx is signed.
2799
2800         Use bool where appropriate.
2801         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2802         All callers changed.
2803         (calc_eclosure_iter): Likewise, for ROOT arg.
2804         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2805         (build_charclass_op): Likewise, for NON_MATCH arg.
2806         * regex_internal.c (re_string_allocate, re_string_construct):
2807         (re_string_construct_common): Likewise, for ICASE arg.
2808         * regexec.c (re_search_2_stub, re_search_stub):
2809         Likewise, for RET_LEN arg.
2810         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2811         (set_regs): Likewise, for FL_BACKTRACK arg.
2812         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2813         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2814         (calc_eclosure_iter, parse_bracket_exp):
2815         Use bool for internal variables that are booleans.
2816         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2817         (set_regs, build_sifted_states, sift_states_bkref):
2818         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2819         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2820         (find_collation_sequence_value):
2821         Likewise.
2822         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2823         (re_node_set_compare):
2824         Return bool, not int. All callers changed.
2825         * regexec.c (check_halt_node_context, check_dst_limits):
2826         (build_trtable, check_node_accept): Likewise.
2827         * regex_internal.h: Include stdbool.h.
2828
2829         Fix bugs uncovered when converting to bool.
2830         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2831         failure instead of charging ahead blindly.
2832         * regex_internal.c (register_state): Likewise.
2833         * regexec.c (re_search_2_stub): Use simpler method than boolean
2834         for freeing internal storage.
2835         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2836         bitset pieces used as boolean, to avoid undefined behavior
2837         on hosts that do int overflow checking.
2838
2839 2005-08-31  Derek Price  <derek@ximbiot.com>
2840
2841         * getdelim.c (getdelim): Return EOF on EOF.
2842         Reported by Larry Jones <lawrence.jones@ugs.com>.
2843
2844 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2845
2846         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2847         lengths fit in regoff_t; this isn't true if regoff_t is the same
2848         width as size_t.
2849         * regex.c (re_search_internal): 5th arg is LAST_START
2850         (= START + RANGE) instead of RANGE.  This avoids overflow
2851         problems when regoff_t is the same width as size_t.
2852         All callers changed.
2853         (re_search_2_stub): Check for overflow when adding the
2854         sizes of the two strings.
2855         (re_search_stub): Check for overflow when adding START
2856         to RANGE; if it occurs, substitute the extreme value.
2857
2858 2005-08-31  Jim Meyering  <jim@meyering.net>
2859
2860         * regcomp.c (search_duplicated_node): Make first pointer arg
2861         a pointer-to-const.
2862         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2863         (register_state): Likewise.
2864         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2865         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2866         (group_nodes_into_DFAstates): Likewise.
2867
2868 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2869
2870         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2871         old glibc regex code mishandles strings longer than 2**31 bytes.
2872         This patch fixes this when the regex code is used in gnulib
2873         (i.e., outside glibc).
2874
2875         This patch should not affect the use of the regex code inside
2876         glibc.  No doubt this problem also needs to be handled for glibc
2877         as well, but the result will be an incompatible change to the
2878         glibc ABI, and the old ABI will have to be supported too.  That
2879         can be the the subject for another patch.
2880
2881         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2882         governing whether the rest of this patch is active.  By default,
2883         the macro is disabled and the patch has no effect.
2884         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2885         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2886         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2887         (re_match_2, re_set_registers): Use the new types.
2888         * regex_internal.h (Idx, re_hashval_t): New types.
2889         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2890         New macros.
2891         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2892         (re_string_context_at, bin_tree_t, re_dfastate_t):
2893         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2894         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2895         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2896         (re_string_char_size_at, re_string_wchar_at):
2897         (re_string_elem_size_at):
2898         Use the new types and macros to port to 64-bit hosts.
2899         Use unsigned types for internal values, so that the code
2900         mostly works even for arrays larger than SSIZE_MAX.
2901         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2902         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2903         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2904         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2905         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2906         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2907         (calc_inveclosure, parse_dup_op, build_range_exp):
2908         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2909         (fetch_number, create_token_tree, mark_opt_subexp):
2910         Likewise.
2911         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2912         (create_cd_newstate, re_string_allocate, re_string_construct):
2913         (re_string_realloc_buffers, build_wcs_upper_buffer):
2914         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2915         (re_string_reconstruct, re_string_peek_byte_case):
2916         (re_string_fetch_byte_case, re_string_context_at):
2917         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2918         (re_node_set_init_copy, re_node_set_add_intersect):
2919         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2920         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2921         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2922         (re_acquire_state, re_acquire_state_context, register_state):
2923         Likewise.
2924         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2925         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2926         (re_search_internal, re_search_2_stub, re_search_stub)
2927         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2928         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2929         (update_cur_sifted_state, check_dst_limits):
2930         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2931         (check_subexp_limits, sift_states_bkref, merge_state_array):
2932         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2933         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2934         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2935         (expand_bkref_cache, check_node_accept_bytes):
2936         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2937         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2938         (acquire_init_state_context, check_halt_node_context):
2939         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2940         (sift_states_backward, clean_state_log_if_needed):
2941         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2942         (find_recover_state, transit_state_sb, transit_state_mb):
2943         (transit_state_bkref, build_trtable, match_ctx_clean):
2944         Likewise.
2945         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2946         to work around an assumption that REG_MISSING is negative.
2947
2948         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2949         (seek_collating_symbol_entry) [defined _LIBC]:
2950         (lookup_collation_sequence_value) [defined _LIBC]:
2951         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2952         Use prototypes rather than old-style function definitions.
2953         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2954         (transit_state_sb) [0]:
2955         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2956
2957         * regexec.c (re_search_internal): Simplify update of rm_so and
2958         rm_eo.
2959
2960         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2961         (optimize_subexps, lower_subexp):
2962         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2963         since the signed shift might overflow.  Use 1u<<31 instead.
2964         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2965         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2966         Likewise.
2967
2968         * regcomp.c (optimize_subexps, lower_subexp):
2969         Use CHAR_BIT rather than 8, for clarity.
2970         * regexec.c (check_dst_limits_calc_pos_1):
2971         (check_subexp_matching_top): Likewise.
2972         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2973         have to worry about portability issues when shifting it left.
2974         Remove no-longer-needed test for table_size > 0.
2975         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2976         in a word, as the resulting behavior is undefined.
2977         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2978         in one case, a <= should have been an <, and in another case the
2979         whole test was missing.
2980         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2981         the standard name CHAR_BIT.
2982         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2983         this is not true on one's complement and signed-magnitude hosts.
2984
2985         * regex_internal.h (re_sub_match_top_t): Remove unused member
2986         next_last_offset.
2987         (struct re_dfa_t): Remove unused member states_alloc.
2988         * regcomp.c (init_dfa): Don't initialize unused members.
2989
2990 2005-08-31  Bruno Haible  <bruno@clisp.org>
2991
2992         * strstr.c: Include <stddef.h>, for NULL.
2993         * strcasestr.c: Likewise.
2994         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2995
2996 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2997
2998         * iconvme.h: Add prototype for iconv_alloc.
2999
3000 2005-08-29  Simon Josefsson  <jas@extundo.com>
3001
3002         * iconvme.c: Fix errno.
3003
3004 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3005
3006         * iconvme.c: Split iconv_string into iconv_alloc.
3007
3008 2005-08-27  Jim Meyering  <jim@meyering.net>
3009
3010         * fopen-safer.c: Merge minor changes from coreutils.
3011         * dup-safer.c: Likewise.
3012         * fd-safer.c: Likewise.
3013
3014         Merge from coreutils.
3015         * stdio--.h: New file.
3016         * stdlib--.h: New file.
3017         * mkstemp-safer.c: New file.
3018
3019         GNU tar needs these.
3020         * pipe-safer.c: New file.
3021         * creat-safer.c: New file.
3022         * fcntl--.h (creat): Define to creat_safer.
3023         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3024         * unistd--.h (pipe): Define to pipe_safer.
3025         * unistd-safer.h: Declare pipe_safer.
3026
3027 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3028
3029         * regex_internal.h: Remove all references to
3030         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3031         or better.
3032         (bitset_not, bitset_merge, bitset_not_merge):
3033         (bitset_mask, re_string_allocate, re_string_construct):
3034         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3035         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3036         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3037         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3038         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3039         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3040         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3041         (re_acquire_state_context):
3042         Remove unnecessary forward decls.
3043         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3044         Put __attribute at function definition,
3045         now that the function decl has been removed.
3046         * lib/regex_internal.c (re_string_peek_byte_case):
3047         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3048         Likewise.
3049
3050 2005-08-26  Simon Josefsson  <jas@extundo.com>
3051
3052         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3053         Haible <bruno@clisp.org>.
3054
3055 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3056
3057         * regexec.c (set_regs): Don't alloca with an unbounded size.
3058
3059         alloca modernization/simplification for regex.
3060         * regex.c: Remove portability cruft for alloca.  This no longer
3061         needs to be at the start of the file, and can be moved into
3062         regex_internal.h and simplified.
3063         * regex_internal.h: Include <alloca.h>.
3064         (__libc_use_alloca) [!defined _LIBC]: New macro.
3065         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3066         now works outside glibc.
3067
3068 2005-08-24  Simon Josefsson  <jas@extundo.com>
3069
3070         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3071         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3072         GLIBC specific code.
3073
3074 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3075
3076         Make regex safe for g++.  This fixes one real bug (an "err"
3077         that should have been "*err").  g++ problem reported by
3078         Sam Steingold.
3079         * regex_internal.h (re_calloc): New macro, consistent with
3080         re_malloc etc.  All callers of calloc changed to use re_calloc.
3081         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3082         not int.  All callers changed.
3083         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3084         just use an array of size MB_LEN_MAX.
3085         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3086         (find_recover_state): Change "err" to "*err"; this fixes what
3087         appears to be a real bug.
3088         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3089         versus int.
3090
3091 2005-08-25  Jim Meyering  <jim@meyering.net>
3092
3093         * open-safer.c: Include <config.h>.
3094         Otherwise, we'd lose LARGEFILE support in any file using
3095         e.g. "fcntl--.h"
3096
3097 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3098
3099         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3100         * regex.h (regerror): Likewise.
3101
3102         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3103         requires this.  (The code never needed it.)
3104
3105         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3106         All uses of recently-renamed identifiers changed to use the new,
3107         POSIX-compliant names.  The code will build and run just fine
3108         without these changes, but it's better to eat our own dog food
3109         and use the standard-conforming names.
3110
3111         * regex.h: Fix a multitude of POSIX name space violations.
3112         These changes have an effect only for programs that define
3113         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3114         do not change anything for programs compiled in the normal way.
3115         Also, there is no effect on the ABI.
3116
3117         (_REGEX_SOURCE): New macro.
3118         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3119         defined and _GNU_SOURCE is not; this fixes a name space violation.
3120
3121         Rename the following macros to obey POSIX requirements.
3122         The old names are still visible as macros if _REGEX_SOURCE is defined.
3123         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3124         RE_BACKSLASH_ESCAPE_IN_LISTS.
3125         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3126         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3127         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3128         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3129         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3130         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3131         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3132         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3133         (REG_INTERVALS): renamed from RE_INTERVALS.
3134         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3135         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3136         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3137         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3138         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3139         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3140         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3141         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3142         RE_UNMATCHED_RIGHT_PAREN_ORD.
3143         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3144         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3145         (REG_DEBUG): renamed from RE_DEBUG.
3146         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3147         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3148         unusual, since we can't clash with the POSIX REG_ICASE.
3149         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3150         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3151         (REG_NO_SUB): renamed from RE_NO_SUB.
3152         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3153         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3154         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3155         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3156         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3157         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3158         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3159         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3160         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3161         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3162         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3163         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3164         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3165         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3166         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3167         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3168         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3169         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3170         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3171         (REG_FIXED): Renamed from REGS_FIXED.
3172         (REG_NREGS): Renamed from RE_NREGS.
3173
3174         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3175         of other REG_* macros, since POSIX says the user is allowed to
3176         #undef these macros selectively.
3177
3178         (reg_errcode_t): Update comment stating what other tables need
3179         to be consistent.
3180
3181         Rename the following enum values to obey POSIX requirements.
3182         The old names are still visible as macros.
3183         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3184         is not defined, since GNU is supposed to be a superset of POSIX as
3185         much as possible, and since we want reg_errcode_t to be a signed
3186         type for implementation consistency.
3187         (_REG_NOERROR): Renamed from REG_NOERROR.
3188         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3189         (_REG_BADPAT): Renamed from REG_BADPAT.
3190         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3191         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3192         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3193         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3194         (_REG_EBRACK): Renamed from REG_EBRACK.
3195         (_REG_EPAREN): Renamed from REG_EPAREN.
3196         (_REG_EBRACE): Renamed from REG_EBRACE.
3197         (_REG_BADBR): Renamed from REG_BADBR.
3198         (_REG_ERANGE): Renamed from REG_ERANGE.
3199         (_REG_ESPACE): Renamed from REG_ESPACE.
3200         (_REG_BADRPT): Renamed from REG_BADRPT.
3201         (_REG_EEND): Renamed from REG_EEND.
3202         (_REG_ESIZE): Renamed from REG_ESIZE.
3203         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3204         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3205         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3206         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3207         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3208
3209         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3210         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3211         changed.  But support the old name if the new one is not defined
3212         and if _REGEX_SOURCE.
3213
3214         Change the following member names in struct re_pattern_buffer.
3215         The old names are still supported if !_REGEX_SOURCE.
3216         The new names are always supported, regardless of _REGEX_SOURCE.
3217         (re_buffer): Renamed from buffer.
3218         (re_allocated): Renamed from allocated.
3219         (re_used): Renamed from used.
3220         (re_syntax): Renamed from syntax.
3221         (re_fastmap): Renamed from fastmap.
3222         (re_translate): Renamed from translate.
3223         (re_can_be_null): Renamed from can_be_null.
3224         (re_regs_allocated): Renamed from regs_allocated.
3225         (re_fastmap_accurate): Renamed from fastmap_accurate.
3226         (re_no_sub): Renamed from no_sub.
3227         (re_not_bol): Renamed from not_bol.
3228         (re_not_eol): Renamed from not_eol.
3229         (re_newline_anchor): Renamed from newline_anchor.
3230
3231         Change the following member names in struct re_registers.
3232         The old names are still supported if !_REGEX_SOURCE.
3233         The new names are always supported, regardless of _REGEX_SOURCE.
3234         (rm_num_regs): Renamed from num_regs.
3235         (rm_start): Renamed from start.
3236         (rm_end): Renamed from end.
3237
3238         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3239         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3240         Prepend __ to parameter names.
3241
3242         Undo yesterday's changes.
3243
3244 2005-08-24  Jim Meyering  <jim@meyering.net>
3245
3246         Sync from coreutils.
3247         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3248
3249 2005-08-21  Bruno Haible  <bruno@clisp.org>
3250
3251         * lock.h: Add multiple inclusion guard.
3252         * tls.h: Add multiple inclusion guard.
3253
3254 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3255
3256         * regex.h (REG_NOSYS)
3257         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3258         Define, since POSIX requires it as of 2001.
3259         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3260         New private symbol, used to keep the enum signed in all cases.
3261         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3262         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3263
3264         * regex_internal.c (re_string_skip_chars, register_state):
3265         (calc_state_hash):
3266         Remove forward decls; no longer needed now that we use prototypes.
3267         * regexec.c (acquire_init_state_context, check_halt_node_context):
3268         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3269         (clean_state_log_if_needed): Likewise.
3270
3271 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3272
3273         Fix problems reported by Sam Steingold in
3274         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3275         * regexec.c (sift_states_bkref): Fix portability bug: the code
3276         assumed that reg_errcode_t is a signed type, which is not
3277         necessarily true if _XOPEN_SOURCE is not defined.
3278         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3279         some compilers warn about it otherwise.
3280
3281 2005-08-20  Jim Meyering  <jim@meyering.net>
3282
3283         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3284         of unused local, dfa.
3285
3286 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3287
3288         * regcomp.c (create_initial_state): Remove duplicate decl.
3289         (init_word_char, create_initial_state, duplicate_node_closure):
3290         (fetch_token, peek_token_bracket, build_range_exp):
3291         (build_collating_symbol): Remove forward decls; no longer needed
3292         now that we use prototypes.
3293
3294         * regcomp.c:
3295         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3296         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3297         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3298         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3299         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3300         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3301         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3302         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3303         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3304         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3305         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3306         (build_charclass, build_charclass_op, fetch_number, create_tree):
3307         (create_token_tree, mark_opt_subexp, duplicate_tree):
3308         Use prototypes rather than old-style definitions.
3309
3310         * regex_internal.c:
3311         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3312         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3313         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3314         (re_string_reconstruct, re_string_peek_byte_case):
3315         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3316         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3317         (re_node_set_init_copy, re_node_set_add_intersect):
3318         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3319         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3320         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3321         (re_acquire_state, re_acquire_state_context, register_state):
3322         (create_ci_newstate, create_cd_newstate, free_state):
3323         Likewise.
3324         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3325         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3326         (re_search_internal, prune_impossible_nodes):
3327         (acquire_init_state_context, check_matching, static):
3328         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3329         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3330         (update_regs, sift_states_backward, build_sifted_states):
3331         (clean_state_log_if_needed, merge_state_array):
3332         (update_cur_sifted_state, add_epsilon_src_nodes):
3333         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3334         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3335         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3336         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3337         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3338         (check_arrival, check_arrival_add_next_nodes):
3339         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3340         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3341         (check_node_accept_bytes, check_node_accept, extend_buffers):
3342         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3343         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3344         (sift_ctx_init):
3345         Likewise.
3346
3347         * regex_internal.h:
3348         (re_string_allocate, re_string_construct, re_string_reconstruct):
3349         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3350         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3351         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3352         (re_string_context_at, re_string_peek_byte_case):
3353         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3354         is defined, since we now use prototypes always.
3355
3356         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3357         C89 or better.  All uses removed.
3358
3359 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3360
3361         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3362         [defined lint]: Suppress bogus uninitialized-variable warnings.
3363
3364         * regcomp.c (duplicate_node): Return new index, not an error code,
3365         and let the caller return REG_ESPACE if out of space.  This
3366         removes an uninitialied-variable warning with GCC 4.0.1, and also
3367         avoids taking the address of a local variable.  All callers
3368         changed.
3369
3370 2005-08-19  Jim Meyering  <jim@meyering.net>
3371
3372         * regexec.c (proceed_next_node): Redo local variables to
3373         avoid GCC shadowing warnings.
3374
3375 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3376
3377         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3378         (re_node_set_insert_last, re_dfa_add_node):
3379         Rename local variables to avoid GCC shadowing warnings.
3380
3381 2005-08-18  Bruno Haible  <bruno@clisp.org>
3382
3383         * strstr.c (strstr): Fix return value in multibyte case.
3384         * strcasestr.c (strcasestr): Likewise.
3385
3386 2005-08-17  Jim Meyering  <jim@meyering.net>
3387
3388         Make the %s format (seconds since the epoch) work for a negative
3389         number and when used with a zero-padded field width, e.g. %015s.
3390
3391         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3392         label so that it precedes the code to set `digits'.  Otherwise,
3393         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3394         print `00-22'.  Now, it prints `-0022', as it should.
3395
3396 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3397
3398         * regex.h: Remove useless space-before-tab.  From coreutils.
3399
3400 2005-08-17  Bruno Haible  <bruno@clisp.org>
3401
3402         * strcasestr.h: New file.
3403         * strcasestr.c: New file.
3404
3405 2005-08-17  Bruno Haible  <bruno@clisp.org>
3406
3407         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3408         * strstr.c: Completely rewritten, with multibyte locale support.
3409
3410 2005-08-17  Bruno Haible  <bruno@clisp.org>
3411
3412         * strcasecmp.c: Use mbuiter.h.
3413
3414 2005-08-17  Bruno Haible  <bruno@clisp.org>
3415
3416         * mbuiter.h: New file.
3417
3418 2005-08-16  Bruno Haible  <bruno@clisp.org>
3419
3420         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3421         (mbi_init): Update.
3422         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3423         NUL byte, not after it.
3424
3425 2005-08-16  Bruno Haible  <bruno@clisp.org>
3426
3427         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3428         the valid ones. Makes the comparison operations transitive:
3429         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3430         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3431
3432 2005-08-16  Bruno Haible  <bruno@clisp.org>
3433
3434         * strcase.h (strcasecmp): Add note in comments.
3435         * strncasecmp.c: Use code from strcasecmp.c.
3436         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3437         (strcasecmp): Work correctly in multibyte locales.
3438
3439 2005-08-16  Bruno Haible  <bruno@clisp.org>
3440
3441         * strnlen1.h: New file.
3442         * strnlen1.c: New file.
3443
3444 2005-08-16  Bruno Haible  <bruno@clisp.org>
3445
3446         * mbfile.h: New file.
3447
3448 2005-08-16  Bruno Haible  <bruno@clisp.org>
3449
3450         * mbiter.h: New file.
3451
3452 2005-08-16  Bruno Haible  <bruno@clisp.org>
3453
3454         * mbchar.h: New file.
3455         * mbchar.c: New file.
3456
3457 2005-08-16  Bruno Haible  <bruno@clisp.org>
3458
3459         * tls.h: New file, from GNU gettext.
3460         * tls.c: New file, from GNU gettext.
3461
3462 2005-08-15  Bruno Haible  <bruno@clisp.org>
3463
3464         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3465         is defined.
3466
3467 2005-08-14  Jim Meyering  <jim@meyering.net>
3468
3469         Sync from coreutils.
3470
3471         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3472         Use the hash-table-based cycle-detection code not just when
3473         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3474         Reported by James Youngman in
3475         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3476         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3477         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3478         This lets us compile with -DFTS_DEBUG, once again.
3479         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3480         * fts.c (fd_safer): Remove decl.
3481         Include fcntl--.h rather than unistd-safer.h
3482         (fts_safe_changedir): Don't call fd_safer; no longer needed
3483         now that we include fcntl--.h.
3484
3485 2005-08-11  Simon Josefsson  <jas@extundo.com>
3486
3487         * readline.h, readline.c: New file.
3488
3489 2005-08-11  Bruno Haible  <bruno@clisp.org>
3490
3491         * strnlen.h (strnlen): Change parameter name to match comment.
3492
3493 2005-08-10  Simon Josefsson  <jas@extundo.com>
3494
3495         * strndup.c: Use strnlen.h.
3496
3497         * strnlen.h: New file.
3498
3499 2005-08-02  Simon Josefsson  <jas@extundo.com>
3500
3501         * getline.h, getline.c: Rewrite.
3502
3503         * getdelim.h, getdelim.c: New files, ported from glibc.
3504
3505 2005-07-31  Bruno Haible  <bruno@clisp.org>
3506
3507         * lock.h (gl_lock_initializer): New macro.
3508         (gl_lock_define_initialized): Use it.
3509         (gl_rwlock_initializer): New macro.
3510         (gl_rwlock_define_initialized): Use it.
3511         (gl_recursive_lock_initializer): New macro.
3512         (gl_recursive_lock_define_initialized): Use it.
3513
3514 2005-07-26  Bruno Haible  <bruno@clisp.org>
3515
3516         * lock.h: Update from GNU gettext.
3517         * lock.c: Update from GNU gettext.
3518
3519 2005-07-18  Bruno Haible  <bruno@clisp.org>
3520
3521         * lock.h (gl_once_t): New type.
3522         (gl_once_define, gl_once): New macros.
3523         * lock.c (fresh_once): New variable.
3524         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3525         functions.
3526
3527 2005-07-18  Simon Josefsson  <jas@extundo.com>
3528
3529         * check-version.c (check_version): Accept identical versions too.
3530
3531 2005-07-18  Bruno Haible  <bruno@clisp.org>
3532
3533         * lock.h: New file, from GNU gettext.
3534         * lock.c: New file, from GNU gettext.
3535
3536 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3537
3538         * quotearg.c: Add translator comment suggested by Bruno Haible,
3539         with a minor change.
3540
3541 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3542
3543         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3544         copyright symbol and the year.
3545         * version-etc.c (COPYRIGHT_YEAR): New constant.
3546         (version_etc_va): Use parameterized copyright notice.
3547         Reword to conform to the current GNU coding standards.
3548
3549 2005-07-11  Simon Josefsson  <jas@extundo.com>
3550
3551         * size_max.h: New file.
3552
3553 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3554
3555         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3556         block of defines.
3557
3558 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3559        and  Paul Eggert  <eggert@cs.ucla.edu>
3560
3561         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3562         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3563
3564 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3565
3566         * regex.c, regex.h: Sync from libc.
3567         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3568         New files, synced from libc, except that regex_internal.h
3569         currently has a small porting fix.
3570
3571 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3572
3573         Remove the dependency of the strftime module on the tzset module.
3574         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3575         Copy the input structure, to work around some of the bug with
3576         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3577         Solaris releases, you should also use the tzset module, but we won't
3578         require it as a dependency any more since we don't want LGPLed code
3579         to depend on GPLed code.
3580
3581 2005-07-02  Jim Meyering  <jim@meyering.net>
3582
3583         * backupfile.c (backup_args): Change a `0' to NULL.
3584
3585 2005-07-01  Jim Meyering  <jim@meyering.net>
3586
3587         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3588         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3589         * save-cwd.c, tempname.c:
3590         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3591         and don't include <sys/file.h>).
3592
3593 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3594
3595         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3596         declares only 'struct timespec;' (!).
3597
3598 2005-06-29  Jim Meyering  <jim@meyering.net>
3599
3600         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3601         type name.  Use the variable name instead.
3602         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3603
3604 2005-06-28  Simon Josefsson  <jas@extundo.com>
3605
3606         * check-version.h, check-version.c: New files.
3607
3608 2005-06-28  Simon Josefsson  <jas@extundo.com>
3609
3610         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3611         collision with global variable.  Better indentation.  Don't
3612         increment buffer pointer beyond buffer end.  Based on comments
3613         from Paul Eggert <eggert@cs.ucla.edu>.
3614
3615         * base64.h: Indent.
3616
3617 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3618
3619         * canon-host.c (canon-host): Append trailing "," to 0 in
3620         initializer of struct addrinfo, as an indication that we don't
3621         care how many members the structure has.
3622
3623 2005-06-24  Derek Price  <derek@ximbiot.com>
3624         and Bruno Haible  <bruno@clisp.org>
3625
3626         Remove stat module & update lstat.
3627         * stat.c: Remove this file...
3628         (slash_aware_lstat): ...moving this content and its support...
3629         * lstat.c (rpl_lstat): ...into here.
3630         * lstat.h: New file.
3631
3632 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3633
3634         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3635         (ranged_convert): Don't save conversion in a temporary struct.
3636         This causes a warning with GCC 4.0.0, and anyway in the typical
3637         case it's not worth the extra 100 bytes or so of code.
3638         (ranged_convert, __mktime_internal): When calling a function via a
3639         pointer P, use P () rather than (*P) (), as we now assume C89 or
3640         better.
3641
3642 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3643
3644         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3645         "who -r" failed to give output.  Problem reported by Tim Waugh.
3646
3647         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3648         (xcalloc): Use it to avoid needless tests.
3649         Problem reported by Jim Meyering.
3650
3651 2005-06-16  Jim Meyering  <jim@meyering.net>
3652
3653         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3654         when either N or S is zero.
3655
3656 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3657
3658         * argp.h (__option_is_short): Check upper limit of
3659         __key. Isprint() requires its argument to have the value
3660         of an unsigned char or EOF.
3661
3662 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3663
3664         * fnmatch.c (fnmatch): If there is an encoding error in a
3665         multibyte string or pattern, fall back on unibyte matching.
3666         Problem reported by James Youngman.
3667
3668 2005-06-08  Bruno Haible  <bruno@clisp.org>
3669
3670         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3671         warning on mingw.
3672
3673 2005-06-08  Bruno Haible  <bruno@clisp.org>
3674
3675         * csharpcomp.h: New file, from GNU gettext.
3676         * csharpcomp.c: New file, from GNU gettext.
3677         * csharpcomp.sh.in: New file, from GNU gettext.
3678
3679 2005-06-07  Derek Price  <derek@ximbiot.com>
3680
3681         Sync from CVS.
3682         * glob_.h: Indent nested #ifdef.
3683
3684 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3685
3686         Sync from coreutils.
3687         Use "file name" when talking about file names, instead of "filename"
3688         or "path", as per the GNU coding standards.
3689         * mkdir-p.c: Renamed from makepath.c.
3690         (make_dir_parents): Renamed from make_path.  All callers changed.
3691         * mkdir-p.h: Likewise.  All includers changed.
3692         * filenamecat.c: Renamed from path-concat.c.
3693         (file_name_concat): Renamed from path_concat.  All callers changed.
3694         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3695         * filenamecat.h: Likewise.  All includers changed.
3696         * acl.c: Don't use "path" or "filename" to mean "file name"
3697         in comments or local variable names.
3698         * basename.c: Likewise.
3699         * canonicalize.c, canonicalize.h: Likewise.
3700         * dirname.c, dirname.h: Likewise.
3701         * euidaccess.c: Likewise.
3702         * exclude.c: Likewise
3703         * fnmatch_.h, fnmatch_loop.c: Likewise.
3704         * fsusage.c, fsuage.h: Likewise.
3705         * fts.c, fts_.h: Likewise.
3706         * getcwd.c: Likewise.
3707         * getloadavg.c: Likewise.
3708         * mkstemp.c: Likewise.
3709         * mountlist.c, mountlist.h: Likewise.
3710         * openat.c, openat.h: Likewise.
3711         * readlink-stub.c: Likewise.
3712         * readutmp.c, readutmp.h: Likewise.
3713         * rename.c: Likewise.
3714         * rmdir.c: Likewise.
3715         * same.c: Likewise.
3716         * savedir.c: Likewise.
3717         * stripslash.c: Likewise.
3718         * tempname.c: Likewise.
3719         * xreadlink.c: Likewise.
3720         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3721         All uses changed.
3722         * exclude.h: Likewise.
3723
3724         * euidaccess.c (getuid, getgid, getuid, getegid)
3725         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3726         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3727         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3728         * pathmax.h: Include <limits.h> unconditionally, since other
3729         files have been getting away with it for years (MORE/BSD 4.3
3730         is extinct now).
3731         * userspec.c (getpwnam, getgrnam, getgrgid)
3732         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3733
3734         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3735         Define to 256, not 255, as per modern POSIX.
3736
3737 2005-06-01  Bruno Haible  <bruno@clisp.org>
3738
3739         * csharpexec.h: New file, from GNU gettext.
3740         * csharpexec.c: New file, from GNU gettext.
3741         * csharpexec.sh.in: New file, from GNU gettext.
3742
3743 2005-05-31  Derek Price  <derek@ximbiot.com>
3744             Paul Eggert  <eggert@cs.ucla.edu>
3745
3746         Sync from cvs.
3747         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3748
3749 2005-05-29  Derek Price  <derek@ximbiot.com>
3750             Paul Eggert  <eggert@cs.ucla.edu>
3751
3752         * glob_.h, glob.c: New files.
3753
3754 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3755
3756         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3757
3758         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3759         the configuration hassle isn't worth it.
3760         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3761         (LONGEST_MODIFIER, PRIuMAX): Remove.
3762
3763 2005-05-27  Bruno Haible  <bruno@clisp.org>
3764
3765         * getlogin_r.h: Remove second include of <stddef.h>.
3766
3767 2005-05-25  Bruno Haible  <bruno@clisp.org>
3768             Derek Price  <derek@ximbiot.com>
3769
3770         * getlogin_r.h: Simplify API documentation.
3771
3772 2005-05-25  Derek Price  <derek@ximbiot.com>
3773             Paul Eggert  <eggert@cs.ucla.edu>
3774
3775         * getlogin_r.c, getlogin_r.h: New files.
3776
3777 2005-05-22  Bruno Haible  <bruno@clisp.org>
3778
3779         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3780         Also include <sys/param.h> if it defines MIN, MAX.
3781         Based on a patch by Derek Price <derek@ximbiot.com>.
3782
3783 2005-05-22  Bruno Haible  <bruno@clisp.org>
3784
3785         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3786         (INT64_MIN): Fix definition.
3787         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3788
3789         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3790         NEED_SIGNED_INT_TYPES.
3791
3792         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3793         HAVE_SYSTEM_INTTYPES.
3794
3795 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3796
3797         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3798         so that unistd-safer.h (GPL'ed code) need not be included.
3799
3800 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3801
3802         New fts module.
3803         * fts.c: Don't include "cycle-check.h" or "hash.h".
3804         (setup_dir, free_dir): New functions.
3805         (enter_dir, leave_dir): Define trivial
3806         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3807         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3808         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3809         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3810         Move to fts-cycle.c.
3811         (fts_open): Use setup_dir.
3812         (fts_close): Use free_dir.
3813         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3814         This adds a label and some gotos, but the alternatives were messier.
3815         Check for memory allocation failure when entering a dir.
3816         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3817         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3818         (FTS): New member fts_cycle, that is a union that contains the
3819         old active_dir_ht and cycle_state.  All uses changed to mention
3820         fts_cycle.ht and fts_cycle.state.
3821         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3822         fts.c, with the following changes:
3823         (setup_dir, free_dir): New functions.
3824         (enter_dir): Now returns bool.  Return true if successful, false
3825         if memory exhausted.  All callers changed.
3826         Do not bother partly cleaning up on
3827         memory allocation failure; that is free_dir's job.
3828         However, free ad if hash_insert fails, to avoid memory leak.
3829         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3830         fts->fts_options to see which union member to use.
3831
3832 2005-05-20  Jim Meyering  <jim@meyering.net>
3833
3834         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3835         Now a macro, to pacify GCC.
3836
3837 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3838
3839         * chown.c (rpl_chown): Return -1 on failure.
3840
3841 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3842
3843         * canonicalize.c: Include canonicalize.h first, to test interface.
3844         Include <stddef.h> unconditionally, since we assume C89 now.
3845         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3846         * fts.c: Include fts_.h first, to check interface.
3847         Do not include intprops.h; no longer needed.
3848         Include cycle-check.h and hash.h, since fts_.h no longer does.
3849         Remove unnecessary casts of closedir to void.
3850         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3851         decide whether to decrement nlinks.
3852         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3853         (FTS): Use struct hash_table * instead of Hash_table, so that
3854         we no longer need to include hash.h here.
3855
3856 2005-05-17  Jim Meyering  <jim@meyering.net>
3857
3858         * fts.c, fts_.h: New files, from coreutils.
3859
3860 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3861
3862         Sync from coreutils.
3863         * unlinkdir.c, unlinkdir.h: New files.
3864         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3865         regex.h, unlocked-io.h, xtime.h:
3866         White space changes only.
3867         * makepath.c (make_path): Port to hosts where leading "//" is special.
3868         * yesno.c: Include getline.h, not ctype.h.
3869         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3870         Use getline to remove arbitrary restriction on response length.
3871
3872 2005-05-13  Bruno Haible  <bruno@clisp.org>
3873
3874         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3875         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3876         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3877         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3878         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3879         Add support for 64-bit integers in the MSVC compiler.
3880
3881 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3882
3883         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3884         Change the initial comment to refer to GPL, not LGPL.
3885         gnulib-tool will change it to LGPL as needed.
3886
3887         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3888         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3889         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3890         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3891         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3892         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3893         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3894         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3895         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3896         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3897         concatpath.c, config.charset, copy-file.c, copy-file.h,
3898         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3899         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3900         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3901         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3902         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3903         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3904         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3905         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3906         full-read.c, full-read.h, full-write.c, full-write.h,
3907         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3908         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3909         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3910         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3911         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3912         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3913         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3914         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3915         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3916         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3917         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3918         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3919         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3920         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3921         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3922         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3923         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3924         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3925         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3926         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3927         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3928         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3929         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3930         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3931         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3932         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3933         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3934         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3935         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3936         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3937         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3938         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3939         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3940         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3941         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3942         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3943         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3944         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3945         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3946         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3947         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3948         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3949         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3950         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3951         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3952         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3953         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3954         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3955         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3956         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3957         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3958         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3959         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3960         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3961         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3962         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3963         Update FSF postal mail address.
3964
3965 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3966
3967         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3968         specified in ai_socktype. Fix invalid ai_protocol
3969         check. ai_protocol is usually set to 0 or depending on
3970         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3971         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3972         ai_socktype / ai_protocol in the returned addrinfo structure.
3973
3974 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3975             Bruno Haible  <bruno@clisp.org>
3976
3977         * inet_ntop.h: New file.
3978         * inet_ntop.c: New file, from glibc with modifications.
3979
3980 2005-05-08  Jim Meyering  <jim@meyering.net>
3981
3982         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3983
3984 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3985
3986         Merge from coreutils.  Among other things,
3987         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3988         * fd-safer.c: New file.
3989         * fcntl-safer.h, open-safer.c: Remove.
3990         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3991         * dup-safer.c: Include unistd-safer.h first.
3992         Don't include errno.h.
3993         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3994         * file-type.h: Don't assume invoker included sys/stat.h first.
3995         * file-type.c: Rely on file-type.h change.
3996         * getloadavg.c: Include unistd-safer.h.
3997         (getloadavg): Use safer open.
3998         * getusershell.c: Include "stdio-safer.h".
3999         (getusershell): Use safer fopen.
4000         * long-options.c (long_options): Use NULL rather than 0.
4001         * modechange.h (mode_free): Remove; all callers changed to invoke
4002         'free'.
4003         * modechange.c: Likewise.
4004         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4005         (MODE_DONE): New constant.
4006         (struct mode_change): Remove 'next' member.
4007         (make_node_op_equals): New function; like the old one of the
4008         same name, except it allocates an array.
4009         (mode_compile, mode_create_from_ref): Use it.
4010         (mode_compile): Allocate result as an array, not a linked list.
4011         Parse octal string ourself, so that we catch mistakes like "+0".
4012         (mode_adjust): Arg is an array, not a linked list.
4013         * modechange.c: Include stat-macros.h, xalloc.h.
4014         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4015         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4016         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4017         Remove.  This is now stat-macros.h's job.
4018         (talloc): Remove.  All callers replaced by xalloc, so that
4019         our invokers don't have to worry about reporting memory failures.
4020         (make_node_op_equals): Remove.
4021         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4022         New constants.
4023         (struct mode_change): Moved here from modechange.h.
4024         (mode_append_entry): Remove.
4025         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4026         apps to have incorrect behavior.  Use simpler algorithm for head
4027         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4028         Detect more invalid usages rather than having somewhat-random behavior.
4029         Don't insert an "a=" action, as that leads to incorrect behavior.
4030         (mode_compile, mode_create_from_ref): Return NULL on error instead
4031         of an enum, since now there's only one way to have an error.  All
4032         callers changed.
4033         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4034         at the correct time.  Simplify calculation of "+u" and its ilk.
4035         Don't mishandle "+X".
4036         (mode_free): Remove "register" and localize decls.
4037         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4038         (struct mode_change): Move to modechange.c; callers don't
4039         need to see this stuff.
4040         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4041         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4042         (mode_change, mode_adjust): Reflect the new signatures noted above.
4043         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4044         that might redefine system include files.
4045         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4046         (my_usleep): Use NULL rather than (void *) 0.
4047         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4048         Use siginterrupt to specify that system calls should be interrupted.
4049         (rpl_nanosleep): Move initialization of suspended closer to call of
4050         my_usleep.
4051         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4052         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4053         (desirable_utmp_entry): New function.
4054         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4055         using x2nrealloc, to simplify logic.
4056         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4057         size calculation.  Do not assume utmp file is a regular file.
4058         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4059         (READ_UTMP_CHECK_PIDS): New constant.
4060         * save-cwd.c: Include unistd-safer.h.
4061         (save_cwd): Use fd_safer.
4062         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4063         [!_LIBC] Include "stat-macros.h" instead.
4064         * unistd-safer.h (fd_safer): New decl.
4065
4066 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4067
4068         * byteswap_.h: New file.
4069
4070 2005-04-25  Albert Chin  <china@thewrittenword.com>
4071
4072         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4073         Toolkit C bug.
4074
4075 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4076
4077         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4078         that "UTC +1 second" continues to work.  Problem reported
4079         by Dmitry V. Levin.
4080         (relunit_snumber): New rule.
4081         (relunit): Use it.
4082
4083 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4084
4085         * getdate.y (universal_time_zone_table): New constant.
4086         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4087         universal_time_zone_table.
4088         (lookup_zone): Prefer universal_time_zone_table to
4089         local_time_zone_table, so that "GMT" time stamps are allowed in
4090         London during the summer.  Problem reported by Ian Abbott.
4091
4092 2005-04-12  Jim Meyering  <jim@meyering.net>
4093
4094         * human.c (humblock): Set *options even when returning due to
4095         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4096         warning from gcc-4.
4097
4098 2005-04-09  Jim Meyering  <jim@meyering.net>
4099
4100         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4101         -Wuninitialized: initialize tm0.tm_year.
4102
4103 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4104
4105         * getdate.y (parser_control): rels_seen is now a boolean, not a
4106         count, since there's no maximum.  All uses changed.
4107         Add member dsts_seen.
4108         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4109         not being INT_MAX.
4110         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4111         Use pc_rels_seen to decide whther a date is absolute.
4112
4113         * getdate.y (number): Don't overwrite year.
4114         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4115         check.
4116
4117 2005-04-02  Simon Josefsson  <jas@extundo.com>
4118
4119         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4120         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4121
4122 2005-03-27  Jim Meyering  <jim@meyering.net>
4123
4124         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4125
4126 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4127
4128         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4129         "one's complement" -> "ones' complement" in comment, as per Knuth.
4130         "value of type" -> "type or expression" in comment.
4131         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4132
4133 2005-03-26  Jim Meyering  <jim@meyering.net>
4134
4135         Comment nits.
4136         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4137         Correct typos: s/or/of/.
4138
4139 2005-03-23  Jim Meyering  <jim@meyering.net>
4140
4141         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4142
4143 2005-03-21  Jim Meyering  <jim@meyering.net>
4144
4145         Changes imported from coreutils.
4146
4147         * cycle-check.c: Don't include xalloc.h.
4148
4149         * path-concat.c: Don't include assert.h.
4150         (path_concat): Remove assertion that would have triggered
4151         for ABASE starting with more than one slash.
4152         Reported by Andreas Schwab.
4153
4154         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4155         properly when ABASE is an absolute file name.
4156         Correct the description of this function.
4157         Include <assert.h>.
4158         Add an assertion and a test driver.
4159         This fixes a bug introduced on 2004-07-02.
4160         Andreas Schwab reported the resulting failure of cp --parents:
4161         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4162
4163 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4164
4165         * strftime.c (my_strftime): If the underlying strftime returns 0
4166         (which shouldn't happen), generate nothing instead of returning 0
4167         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4168
4169 2005-03-16  Bruno Haible  <bruno@clisp.org>
4170
4171         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4172
4173 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4174
4175         * strftime.c (my_strftime): Prepend space to format so that we can
4176         reliably distinguish strftime failure from empty output on POSIX
4177         hosts.
4178
4179 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4180
4181         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4182         (iconv_string): Don't guess a size-zero buffer, as that might cause
4183         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4184         result would be 'too large', where 'too large' is (heuristically)
4185         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4186         overflow concerns.  This will prevent some unwanted malloc failures
4187         when the inputs are very large.
4188
4189 2005-03-15  Bruno Haible  <bruno@clisp.org>
4190
4191         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4192         'negate'.
4193
4194         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4195         variable.
4196
4197         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4198
4199 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4200
4201         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4202         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4203         intprops.h.
4204         * strtol.c: Likewise.
4205
4206 2005-03-14  Simon Josefsson  <jas@extundo.com>
4207
4208         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4209         <fx@gnu.org>.
4210
4211 2005-03-14  Jim Meyering  <jim@meyering.net>
4212
4213         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4214         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4215         to be nonzero so that we (and caller) can detect the difference
4216         between a valid zero-length expansion and an error return, even
4217         when the underlying strftime fails before writing anything into
4218         that location.
4219
4220 2005-03-10  Jim Meyering  <jim@meyering.net>
4221
4222         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4223         so that this module works on systems without fchdir.
4224
4225 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4226
4227         Factor int-properties macros into a single file, except for
4228         glibc-related files.
4229         * intprops.h: New file.
4230         * getloadavg.c: Include it instead of limits.h.
4231         (INT_STRLEN_BOUND): Remove.
4232         * human.c: Include intprops.h.
4233         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4234         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4235         * inttostr.h: Include intprops.h instead of limits.h.
4236         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4237         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4238         for consistency with intprops.h.
4239         (time_t_is_integer, twos_complement_arithmetic): Use them.
4240         * sig2str.h: Include <signal.h>, intprops.h.
4241         (INT_STRLEN_BOUND): Remove.
4242         * strftime.c (TYPE_SIGNED): Remove.
4243         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4244         * strtol.c: Adjust comments to match intprops.h.
4245         * userspec.c: Include intprops.h.
4246         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4247         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4248         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4249         instead of rolling our own expressions.
4250         * xstrtol.c: Include xstrtol.h first, to test interface.
4251
4252         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4253         instead of int.
4254         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4255         the right thing even if adding 1900 would overflow.  Similarly
4256         for tm_mon + 1 and tm_yday + 1.
4257         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4258         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4259         (DO_SIGNED_NUMBER): New macro.
4260         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4261
4262 2005-03-07  Bruno Haible  <bruno@clisp.org>
4263
4264         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4265
4266 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4267             Bruno Haible  <bruno@clisp.org>
4268
4269         * pagealign_alloc.h: New file.
4270         * pagealign_alloc.c: New file.
4271
4272 2005-01-28  Bruno Haible  <bruno@clisp.org>
4273
4274         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4275         stpncpy.c uses it.
4276
4277 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4278
4279         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4280         The workaround isn't strictly needed for POSIX conformance, and
4281         it's too much of a pain to configure and maintain.  We'll ask
4282         people to fix their kernels instead.
4283         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4284         (NANOSLEEP_BUG_WORKAROUND): Remove.
4285         (xnanosleep): Remove the workaround.
4286
4287 2005-02-12  Bruno Haible  <bruno@clisp.org>
4288
4289         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4290
4291 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4292
4293         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4294         * timespec.h (gettime): Return void, since it always
4295         succeeds now.  All uses changed.
4296         * gettime.c (gettime) Likewise.
4297         [HAVE_NANOTIME]: Prefer nanotime.
4298         Assume gettimeofday succeeds, as POSIX requires.
4299         Assime time () succeeds, since other code already does.
4300         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4301         (timespec_subtract): Remove.
4302         (NANOSLEEP_BUG_WORKAROUND): New constant.
4303         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4304         things considerably.  Use it only on GNU/Linux hosts, since the
4305         workaround shouldn't be needed elsewhere.
4306
4307 2005-02-24  Bruno Haible  <bruno@clisp.org>
4308
4309         * gettext.h: Update from GNU gettext 0.14.2.
4310
4311 2005-02-24  Bruno Haible  <bruno@clisp.org>
4312
4313         * localcharset.c: Update from GNU gettext 0.14.2.
4314         * config.charset: Update from GNU gettext 0.14.2.
4315
4316 2005-02-22  Simon Josefsson  <jas@extundo.com>
4317
4318         * iconvme.h, iconvme.c: New files, from libc.
4319
4320 2005-02-20  Neil Conway  <neilc@samurai.com>
4321
4322         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4323         returned by OSX/Darwin if the specified buffer is not large
4324         enough for the hostname.
4325
4326 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4327
4328         * memrchr.h: New file.
4329         * chdir-long.c: Include it.
4330         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4331         Don't bother including stddef.h.
4332
4333 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4334
4335         * argp-help.c (__argp_help): Create a fake struct argp_state and
4336         pass it to _help, otherwise the latter coredumps trying to
4337         dereference state.root_argp.
4338
4339 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4340
4341         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4342         inclusion.
4343         Include <sys/types.h>, for dev_t.
4344         (ME_DUMMY, ME_REMOTE): Move from here....
4345         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4346         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4347         Dmitry V. Levin.
4348         Include mountlist.h first, to test the interface.
4349
4350 2005-01-29  Bruno Haible  <bruno@clisp.org>
4351
4352         * progname.c (program_name): Initialize.
4353         Needed when linking statically on MacOS X.
4354
4355 2005-01-28  Bruno Haible  <bruno@clisp.org>
4356
4357         * javacomp.sh.in: New file, from GNU gettext.
4358         * javacomp.h: New file, from GNU gettext.
4359         * javacomp.c: New file, from GNU gettext.
4360
4361 2005-01-26  Bruno Haible  <bruno@clisp.org>
4362
4363         * javaexec.sh.in: New file, from GNU gettext.
4364         * javaexec.h: New file, from GNU gettext.
4365         * javaexec.c: New file, from GNU gettext.
4366
4367 2005-01-26  Simon Josefsson  <jas@extundo.com>
4368
4369         * gai_strerror.c: Use GPL in header.
4370
4371 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4372
4373         * argp-help.c (hol_entry_help): Avoid using non-constant
4374         initializers for struct pentry_state.
4375         (__argp_error): Check return value of __asprintf
4376         (__argp_failure): Translate error message
4377
4378         * argp-parse.c: Removed braces around the expansion of N_()
4379
4380 2005-01-21  Jim Meyering  <jim@meyering.net>
4381
4382         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4383         same value as for Solaris 9.
4384
4385         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4386         component length.  This included changing the parameter to be
4387         of type `char *' rather than `char const *'.
4388         * chdir-long.h (chdir_long): Update prototype.
4389
4390         * openat.c (fdopendir, fstatat): New functions.
4391         * openat.h: Include headers required for use of DIR and struct stat.
4392         [AT_SYMLINK_NOFOLLOW]: Define.
4393         (fdopendir, fstatat): Add prototypes.
4394
4395 2005-01-21  Bruno Haible  <bruno@clisp.org>
4396
4397         * classpath.h: New file, from GNU gettext.
4398         * classpath.c: New file, from GNU gettext.
4399
4400 2005-01-20  Simon Josefsson  <jas@extundo.com>
4401
4402         * version-etc-fsf.c: New file, with version_etc_copyright.
4403         * version-etc.c: Remove version_etc_copyright.
4404         * version-etc.h (version_etc_copyright): Use [] instead of * in
4405         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4406
4407 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4408
4409         * save-cwd.c (save_cwd): Remove code to support the case
4410         where fchdir is missing or flaky.
4411
4412 2005-01-20  Simon Josefsson  <jas@extundo.com>
4413
4414         * base64.h (isbase64): Add.
4415
4416         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4417         using a unsigned prototype, don't inline.
4418         (base64_decode): Use it.
4419
4420 2005-01-19  Bruno Haible  <bruno@clisp.org>
4421
4422         * sh-quote.h: New file, from GNU gettext.
4423         * sh-quote.c: New file, from GNU gettext.
4424
4425 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4426
4427         Merge changes from coreutils, as described below in several
4428         changelogs dated today.
4429
4430         * save-cwd.c: Include "save-cwd.h" before other include files.
4431         (O_DIRECTORY): Remove; not needed here, since "." must be
4432         a directory.  All uses removed.
4433         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4434         universal on Suns, and we also need to test for IRIX.
4435         Revamp code to use 'if' rather than '#if'.
4436         Avoid unnecessary comparison of cwd->desc to 0.
4437
4438         * utimens.c (futimens): Robustify the previous patch, by checking
4439         for known valid error numbers rather than observed invalid ones.
4440
4441 2005-01-18  Jim Meyering  <jim@meyering.net>
4442
4443         * version-etc.c (version_etc_copyright): Update copyright date.
4444
4445         * utimens.c (futimens): Account for the fact that futimes
4446         can also fail with errno == ENOSYS or errno == ENOENT.
4447         Patch from Dmitry V. Levin.
4448
4449         Change the name of the robust chdir function from chdir to chdir_long.
4450         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4451         (restore_cwd): Use chdir_long, not chdir.
4452         * chdir-long.c: Renamed from chdir.c.
4453         * chdir-long.h: Renamed from chdir.h.
4454         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4455         Hurd.
4456
4457 2005-01-18  Bob Proulx  <bob@proulx.com>
4458
4459         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4460         offsetof() macro construct to avoid compile failure with native HP-UX
4461         11.0 ANSI C compiler.
4462
4463 2005-01-06  Bruno Haible  <bruno@clisp.org>
4464
4465         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4466         because stpncpy.m4 takes care of it.
4467
4468 2004-01-24  Bruno Haible  <bruno@clisp.org>
4469
4470         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4471
4472 2003-10-09  Bruno Haible  <bruno@clisp.org>
4473
4474         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4475
4476 2005-01-06  Bruno Haible  <bruno@clisp.org>
4477
4478         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4479         * fwriteerror.c: Include <stdbool.h>.
4480         (fwriteerror): At the end, close the file stream. Record whether
4481         stdout was already closed.
4482
4483 2004-05-27  Bruno Haible  <bruno@clisp.org>
4484
4485         * execute.c (environ): Declare if needed.
4486         * pipe.c (environ): Likewise.
4487         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4488
4489 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4490
4491         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4492         definitions to be after all include files, to avoid collisions.
4493         Problem reported by Bob Proulx.
4494
4495 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4496
4497         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4498         not needed.  This removes a dependency on the gettext module.
4499         [defined _LIBC]: Do not include <libintl.h>; not needed.
4500
4501 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4502
4503         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4504         HAVE_DECL_STRTOLD.
4505
4506 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4507
4508         * argp-parse.c: Include <stddef.h>.
4509         (alignof, alignto): New macros.
4510         (parser_init): Don't assume that void * is aligned sufficiently
4511         for struct option.
4512
4513         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4514         need to extend the stack.
4515         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4516         large.
4517
4518 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4519
4520         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4521
4522 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4523
4524         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4525         Remove now-obsolete comment about AIX.
4526         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4527         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4528         (YYMAXDEPTH): New macro.
4529
4530 2004-12-18  Bruno Haible  <bruno@clisp.org>
4531
4532         * fatal-signal.c (fatal_signals): Make non-const.
4533         (init_fatal_signals): New function.
4534         (uninstall_handlers, install_handlers): Ignore signals that were set to
4535         SIG_IGN.
4536         (at_fatal_signal): Call init_fatal_signals.
4537         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4538         SIG_IGN.
4539         Reported by Paul Eggert.
4540
4541 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4542
4543         * getdate.y (textint): New member "negative".
4544         (time_zone_hhmm): New function.
4545         Expect 14 shift-reduce conflicts, not 13.
4546         (o_colon_minutes): New rule.
4547         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4548         (yylex): Set the "negative" member of signed numbers.
4549
4550 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4551
4552         Changes imported from coreutils.
4553         * hard-locale.c: Assume <locale.h> exists.
4554         Include "strdup.h".
4555         (GLIBC_VERSION): New macro.
4556         (hard_locale): Assume setlocale exists.
4557         Rewrite to avoid #ifdef.
4558         Use strdup rather than malloc + strcpy.
4559         * human.c: Assume <locale.h> exists.
4560         (human_readable): Assume localeconv exists.
4561
4562 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4563
4564         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4565         convert T2, not T.  (Imported from libc.)
4566
4567 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4568
4569         * getcwd.c (is_ENAMETOOLONG): New macro.
4570         (__getcwd.c): Don't restore errno; glibc doesn't.
4571         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4572         first, falling back to our code only if its results look suspicious.
4573         Ensure that the resulting buffer is only as large as necessary.
4574
4575         * readutmp.c: Include readutmp.h first.
4576         Include <errno.h>, since readutmp.h no longer does that.
4577         * readutmp.h: Don't include <errno.h>,
4578         <sys/param.h>, <time.h>; not needed to establish interface.
4579         (errno): Remove decl.
4580         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4581         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4582         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4583
4584 2004-11-28  Simon Josefsson  <jas@extundo.com>
4585
4586         * base64.h, base64.c: New file.
4587
4588 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4589
4590         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4591
4592 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4593
4594         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4595         HP's ANSI C compiler.
4596         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4597         Declaring int functions causes warnings on some modern systems and
4598         shouldn't be needed to compile on ancient ones.
4599         * same.c (MIN) [defined MIN]: Don't define, since it's already
4600         defined.
4601
4602         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4603         with the following changes.
4604         (__set_errno): Parenthesize properly.
4605         Include <stdbool.h>.
4606         (MIN, MAX, MATCHING_INO): New macros.
4607         (__getcwd): Define with prototype, not K&R form.
4608         Use heuristics to allocate default buffer on stack if possible.
4609         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4610         behavior, and to avoid the PATH_MAX limit when computing
4611         ../../../../...
4612         Use MATCHING_INO to compare inode number to file.
4613         Check for arithmetic overflow in size calculations.
4614         Fix bug in reallocation of dot array that caused getcwd to fail
4615         on directories nested deeper than 75.
4616         Be more careful about saving errno on error.
4617         Do not use realloc; use only free+malloc, as this is a bit
4618         more flexible and avoids a needless copy operation.
4619         Do not inspect st_dev and st_ino for symbolic links; POSIX
4620         doesn't specify the latter.
4621         Check for closedir errors.
4622         Avoid needless casts.
4623         Use "#ifdef weak_alias" around weak_alias, to be like other
4624         glibc code.
4625         The following changes to getcwd.c have effect only when used in
4626         gnulib; they have no effect inside glibc proper.
4627         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4628         as alloca isn't used.
4629         (alloca, __alloca): Likewise.
4630         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4631         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4632         unconditionally, as gnulib assumes C89 or better.
4633         Do not include <sys/param.h>.
4634         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4635         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4636         better.
4637         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4638         Include <dirent.h> in a way that is compatible with modern Autoconf.
4639         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4640         New macros, if not already defined.
4641         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4642         Use "_LIBC", not "defined _LIBC", for consistency.
4643         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4644         a mempcpy module.
4645         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4646         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4647         * xgetcwd.c: David MacKenzie's old code was removed, so give
4648         credit only to Jim Meyering and adjust the copyright dates.
4649         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4650         <stdlib.h>, <unistd.h>, "pathmax.h".
4651         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4652         (INITIAL_BUFFER_SIZE): Remove.
4653         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4654
4655 2004-11-23  Jim Meyering  <jim@meyering.net>
4656
4657         * getopt_.h: Remove trailing blanks.
4658
4659 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4660
4661         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4662         (futimens): New function, which uses futimes if available.
4663         (futimens, utimens): Support timespec==NULL, with same semantics
4664         as utime and utimens.
4665         * utimens.h (futimens): New decl.
4666
4667 2004-11-23  Jim Meyering  <jim@meyering.net>
4668
4669         * __fpending.c: Add comment.
4670
4671 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4672
4673         * getopt_.h: Re-addition of __getopt_argv_const caused
4674         redefinition warnings. To avoid them, include the defines
4675         in `#if !defined __need_getopt ... #endif'. The only place
4676         where __getopt_argv_const is used is in definitions
4677         of getopt_long and getopt_long_only below, which are as well
4678         protected by `#ifndef __need_getopt'.
4679         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4680         __need_getopt after including <stdio.h> and <unistd.h> These
4681         headers might have defined it.
4682
4683 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4684
4685         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4686         New macros.
4687         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4688         optopt): Use them instead of invoking ## directly; otherwise, the
4689         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4690
4691 2004-11-19  Bruno Haible  <bruno@clisp.org>
4692
4693         * strtok_r.c: Move comments from here...
4694         * strtok_r.h: ... to here.
4695
4696 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4697
4698         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4699         might fail.  Problem reported by Yoann Vandoorselaere.
4700         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4701         that mishandle size_t overflow.
4702
4703 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4704
4705         * canon-host.c: Include "strdup.h".
4706         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4707         Use strdup instead of malloc/strcpy to duplicate strings.
4708
4709         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4710         (human_space_before_unit): New constant.
4711         * human.c (human_readable): Support it.
4712
4713         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4714         (xgetcwd): Set errno correctly when failing.
4715         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4716         the failure is actually due to a PATH_MAX problem.
4717
4718         Further getopt changes to make it more likely that glibc will
4719         buy the changes back.
4720         * getopt.c (POSIXLY_CORRECT): New constant.
4721         (getopt): Use it, so to preserve glibc semantic
4722         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4723         when compiling for libc.
4724         * getopt_.h (__getopt_argv_const): Bring it back.
4725         (getopt_long, getopt_long_only): Use it.
4726
4727         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4728         New arg POSIXLY_CORRECT.  All callers changed.
4729         (getopt): Argv is now char * const *, as per standard.
4730         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4731         not char *__getopt_argv_const *.
4732         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4733         _getopt_long_only_r): Likewise.
4734         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4735         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4736         _getopt_long_r, _getopt_long_only_r): Likewise.
4737         * getopt_.h (__getopt_argv_const): Remove.
4738         (getopt): Argv is now char * const *, as per standard.
4739
4740         * getdate.y (tORDINAL): New token.
4741         (day, relunit): Allow it for relative times.
4742         (relative_time_table): Use tORDINAL for ordinals.
4743
4744 2004-11-15  Jim Meyering  <jim@meyering.net>
4745
4746         * closeout.c: Include "__fpending.h" once again.
4747         Include <stdbool.h>.
4748         (close_stdout): Don't fail just because stdout was closed initially,
4749         since some programs don't write to stdout in the normal course of
4750         operation (other than --version and --help), and we don't want this
4751         function to make e.g. `touch file >&-' fail.
4752         But do fail if it was closed and someone has tried to write to it.
4753         E.g., `printf foo >&-' must fail.
4754
4755 2004-11-11  Simon Josefsson  <jas@extundo.com>
4756
4757         * strtok_r.h, strtok_r.c: New file.
4758
4759 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4760
4761         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4762         we can stop lying to compilers about the constness of argv when we
4763         are compiled outside glibc.
4764         (getopt, getopt_long, getopt_long_only): Use it.
4765         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4766         getopt): Likewise.
4767         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4768         _getopt_long_only_r): Likewise.
4769         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4770         _getopt_long_only_r): Likewise.
4771
4772         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4773         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4774         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4775         the other external symbols.
4776         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4777         declaration, since the above renaming now works around collisions.
4778
4779 2004-11-11  Jim Meyering  <jim@meyering.net>
4780
4781         * linebreak.c: Remove trailing blanks.
4782         * alloca_.h: Likewise.
4783         * acosl.c: Likewise.
4784         * euidaccess.c: Likewise.
4785         * allocsa.h: Likewise.
4786
4787 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4788
4789         * mktime.c (SHR): New macro, which is a portable
4790         substitute for >> that should work even on Crays.
4791         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4792         Problem reported by Mark D. Baushke in
4793         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4794         * getdate.y (SHR): Likewise.
4795         (tm_diff): Use it.
4796         * strftime.c (SHR): Likewise.
4797         (tm_diff): Use it.
4798         * quotearg.c (struct quoting_options): Use unsigned int for
4799         quote_these_too, so that right shifts are well defined.  All uses
4800         changed.
4801
4802 2004-11-10  Simon Josefsson  <jas@extundo.com>
4803
4804         * getaddrinfo.h, getaddrinfo.c: New files.
4805
4806 2004-11-10  Jim Meyering  <jim@meyering.net>
4807
4808         Ensure that no close failure goes unreported.
4809         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4810         return early when it seems there's nothing to flush.
4811         Don't include __fpending.h.
4812
4813 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4814
4815         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4816
4817 2004-11-05  Bruno Haible  <bruno@clisp.org>
4818
4819         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4820         Reported by Mark D. Baushke <mdb@cvshome.org>.
4821
4822 2004-11-04  Bruno Haible  <bruno@clisp.org>
4823
4824         2004-09-11  Bruno Haible  <bruno@clisp.org>
4825                 * allocsa.valgrind: New file.
4826         2004-02-06  Bruno Haible  <bruno@clisp.org>
4827                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4828                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4829                 Reported by Christopher Seip <chris.seip@hp.com>.
4830
4831 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4832
4833         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4834         with errno == ERANGE if the buffer is too small.
4835         Problem reported by Mark D. Baushke.
4836
4837 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4838
4839         * xreadlink.c (MAXSIZE): New macro.
4840         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4841         size does not exceed MAXSIZE.  Avoid cast.
4842         As suggested by Mark D. Baushke in
4843         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4844         if readlink fails with buffer size just under MAXSIZE, try again
4845         with MAXSIZE.
4846
4847 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4848         and  Paul Eggert  <eggert@cs.ucla.edu>
4849
4850         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4851         (get_date): Overparenthesize to avoid GCC warning.
4852
4853 2004-11-02  Bruno Haible  <bruno@clisp.org>
4854
4855         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4856         function returns void.
4857
4858 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4859
4860         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4861         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4862         already declared.
4863
4864 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4865
4866         * getdate.y: Add support for TZ="foo" within a date string.
4867         Fix some bugs near time_t boundaries.  Reject dates with
4868         out-of-range components, e.g., "Sept 31".
4869         Include <stdlib.h>, "setenv.h", "xalloc.h".
4870         (ISDIGIT_LOCALE): Remove; unused.
4871         Note that the TZ and time functions used here are not reentrant.
4872         (mktime_ok, get_tz): New functions.
4873         (TZBUFSIZE): New constant.
4874         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4875         This requires that we sometimes generate our own TZ="XXX..." setting.
4876
4877 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4878
4879         * mktime.c (not_equal_tm): Remove redundant check.
4880
4881 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4882
4883         * getdate.y: Use Bison 1.875 features, and some minor
4884         code cleanups.  This change does not affect semantics.
4885         Don't include <stdlib.h>; no longer needed.
4886         Don't include unlocked-io.h; only the "#if TEST" code uses
4887         stdio, and performance isn't crucial there.
4888         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4889         Bison 1.875 features as described below.
4890         All uses of "PC." replaced by "pc->".
4891         (YYSTYPE): Add a forward declaration.
4892         (yylex, yyerror): Use full prototypes in forward decls.
4893         Use "%pure-parser" rather than obsolescent "%pure_parser".
4894         Use %parse-param and %lex-param instead of obsolescent
4895         YYPARSE_PARAM and YYLEX_PARAM.
4896         (meridian_table, month_and_day_table, time_units_table,
4897         relative_time_table, time_zone_table, military_table,
4898         lookup_zone, lookup_word, get_date):
4899         Use NULL instead of 0 where appropriate.
4900         (to_hour): Avoid abort (), to avoid a dependency on
4901         stdlib.h.
4902         (yyerror, yylex): Now accepts parser_control * arg.
4903         (main) [TEST]: Use '\0' rather than 0 for char.
4904
4905 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4906
4907         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4908         It's now the caller's responsibility to handle the case where
4909         !HAVE_GETPAGESIZE && !defined getpagesize.
4910
4911         * mktime.c (leapyear): Arg is long int, not int.
4912
4913 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4914
4915         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4916
4917 2004-10-12  Simon Josefsson  <jas@extundo.com>
4918
4919         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4920         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4921         to real functions.
4922
4923 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4924
4925         * vsnprintf.h: New file.
4926         * vsnprintf.c: New file.
4927
4928 2004-10-07  Bruno Haible  <bruno@clisp.org>
4929
4930         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4931         into the provided buffer.
4932
4933 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4934
4935         * diacrit.c, diacrit.h: Add GPL notice.
4936
4937         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4938         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4939         * logl.c (logl): Keep the code as similar to glibc as possible.
4940         This avoids a potential constant-folding bug.
4941
4942 2004-10-05  Bruno Haible  <bruno@clisp.org>
4943
4944         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4945
4946 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4947
4948         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4949         * xmalloc.c (xmemdup): Likewise.
4950         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4951         XFREE): Remove these long-obsolescent macros.
4952         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4953         * xstrdup.c: Remove.
4954
4955         * regex.c (re_comp): Cast gettext return value to char *,
4956         Problem reported by Martin Neitzel via Mark D. Baushke.
4957
4958 2004-10-04  Simon Josefsson  <jas@extundo.com>
4959
4960         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4961         '#ifdef USE_UNLOCKED_IO'.
4962
4963 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4964
4965         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4966         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4967         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4968         regex.c, sha1.c, version-etc.c, yesno.c:
4969         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4970         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4971         the includer's responsibility.
4972
4973         Sync from coreutils.
4974
4975         * modechange.c (mode_compile): Don't decrement a pointer that
4976         points to the start of a string, as the C Standard says the
4977         resulting behavior is undefined.
4978
4979         * backupfile.h (enum backuptype): Rename none -> no_backups,
4980         simple -> simple_backups, numbered_existing ->
4981         numbered_existing_backups, numbered -> numbered_backups
4982         to avoid shadowing problems.  All uses changed.
4983         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4984         * backupfile.c (check_extension, numbered_backup):
4985         Rename locals to avoid shadowing 'basename'.
4986         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4987         once.
4988
4989         * .cppi-disable: Add getopt_.h, getopt_int.h.
4990         * .cvsignore: Add getopt.h.
4991
4992 2004-10-04  Simon Josefsson  <jas@extundo.com>
4993
4994         * memmem.h: New file.
4995         * memmem.c: New file, taken from glibc.
4996
4997 2004-10-02  Jim Meyering  <jim@meyering.net>
4998
4999         * dirfd.h, getpagesize.h: Add copyright notice.
5000
5001 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5002
5003         * snprintf.c: Remove comments as to why each header is needed.
5004
5005 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5006
5007         * strsep.h: New file.
5008         * strsep.c: New file.
5009
5010 2004-10-01  Simon Josefsson  <jas@extundo.com>
5011
5012         * snprintf.c (snprintf): Handle size==0.
5013
5014 2004-10-01  Simon Josefsson  <jas@extundo.com>
5015             Bruno Haible  <bruno@clisp.org>
5016
5017         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5018         (snprintf): Declare 'args'.
5019
5020 2004-09-30  Simon Josefsson  <jas@extundo.com>
5021
5022         * snprintf.h, snprintf.c: New files.
5023
5024 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5025
5026         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5027         (hol_entry_help): Never translate an empty string.
5028         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5029         * argp.h (OPTION_NO_TRANS): New option.
5030
5031 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5032
5033         * xvasprintf.c: Include xalloc.h.
5034         (xvasprintf): Use xalloc_die, not xmalloc_die.
5035
5036 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5037
5038         * dummy.c: Change copyright notice to FSF, and license to GPL.
5039
5040 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5041
5042         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5043         Problem reported by Bruno Haible in:
5044         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5045
5046 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5047
5048         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5049         in case some system header has #define'd it.  Problem reported by
5050         Soeren D. Schulze in
5051         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5052
5053 2004-09-08  Bruno Haible  <bruno@clisp.org>
5054
5055         * stdint_.h: New file, taken from GNU clisp.
5056
5057 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5058
5059         * xvasprintf.h: New file.
5060         * xvasprintf.c: New file.
5061         * xasprintf.c: New file.
5062
5063 2004-09-08  Bruno Haible  <bruno@clisp.org>
5064
5065         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5066         is > INT_MAX.
5067         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5068
5069 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5070
5071         Import from coreutils.
5072         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5073         strings on unbounded length.  alloca's performance benefits aren't
5074         that important here.
5075         (V_STRDUP): Remove.
5076         (parse_with_separator): New function, with most of the internals
5077         of the old parse_user_spec.  Allow user to omit both user and group,
5078         for compatibility with FreeBSD.
5079         Clone only the user name, not the entire spec.
5080         Do not set *uid, *gid unless entirely successful.
5081         Avoid memory leak in some failing cases.
5082         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5083         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5084         (parse_user_spec): Rewrite to use parse_with_separator.
5085
5086 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5087
5088         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5089         its complicated substitute.
5090         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5091         and program_invocation_name.
5092         (__argp_basename) [!_LIBC]: Remove; the only use was
5093         replaced by its body.
5094         (__argp_short_program_name): Change condition from
5095         !defined __argp_short_program_name to
5096         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5097         to match argp-namefrob.h.
5098         (__argp_failure): Don't assume strerror_r returns char *.
5099         * argp-parse.c (N_): Define unconditionally.
5100         (argp_default_options): Fill out initializers with 0 to avoid
5101         gcc warnings.
5102
5103 2004-08-12  Simon Josefsson  <jas@extundo.com>
5104
5105         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5106         * getopt_.h: Renamed from getopt.h.
5107
5108 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5109
5110         Merge from coreutils.
5111
5112         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5113         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5114         for Reliant Unix 5.43.
5115
5116         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5117         (union fooround): Use uintmax_t, not long int.
5118         The rest is a merge from libc:
5119         [defined _LIBC]: Include <shlib-compat.h>.
5120         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5121
5122         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5123
5124         * strverscmp.c: Convert to UTF-8.
5125
5126 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5127
5128         * obstack.h (obstack_empty_p):
5129         Don't assume that chunk->contents is suitably aligned.
5130         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5131         Likewise. Problem reported by Benno in
5132         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5133
5134         * chown.c (rpl_chown): Work even if the file is writeable but not
5135         readable.  This could be improved further but it'd take some work.
5136
5137 2004-08-08  Simon Josefsson  <jas@extundo.com>
5138
5139         * xgethostname.c: Don't include error.h (not used).
5140
5141         * getpass.h: Add.
5142         * getpass.c: Include getpass.h first.
5143
5144 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5145
5146         * xalloc-die.c: New files.
5147         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5148         All uses removed.
5149         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5150         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5151         (_, N_, xalloc_die): Move to xalloc-die.c.
5152         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5153         so that we needn't mess with xalloc_msg_memory_exhausted.
5154
5155         * sha1.h: Renamed from sha.h.
5156         (SHA1_H): Renamed from _SHA_H.
5157         (sha1_ctx): Renamed from sha_ctx.
5158         (sha1_init_ctx): Renamed from sha_init_ctx.
5159         (sha1_process_block): Renamed from sha_process_block.
5160         (sha1_process_bytes): Renamed from sha_process_bytes.
5161         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5162         (sha1_read_ctx): Renamed from sha_read_ctx.
5163         (sha1_stream): Renamed from sha_stream.
5164         (sha1_buffer): Renamed from sha_buffer.
5165         * sha1.c: Likewise; renamed from sha.c.
5166         Do not include <sys/types.h>.
5167         Include <stddef.h> rather than <stdlib.h>.
5168
5169 2004-08-08  Bruno Haible  <bruno@clisp.org>
5170
5171         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5172         FILESYSTEM_PREFIX_LEN.
5173         * progreloc.c: Likewise.
5174         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5175
5176 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5177
5178         Merge from tar.
5179         * argp-help.c (make_hol, hol_append): Don't assume that
5180         SIZE_MAX is a valid preprocessor constant.
5181         (__argp_basename): Change from "#ifndef _LIBC"
5182         to "#ifndef __argp_short_program_name", so that
5183         we don't compile these functions for tar.
5184
5185         More merges from coreutils.
5186         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5187         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5188         yesno.h: New files.
5189         * addext.c: Remove; no longer needed.
5190         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5191         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5192         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5193         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5194         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5195         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5196         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5197         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5198         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5199         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5200         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5201         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5202         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5203         Import changes from coreutils.
5204
5205 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5206
5207         Merge from coreutils.
5208
5209         * .gdb-history: Remove; this doesn't belong here.
5210
5211         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5212         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5213         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5214
5215         * dirname.h: Include <stdbool.h>.
5216         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5217         for consistency with POSIX terminology.  All uses changed.
5218         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5219         (strip_trailing_slashes): Use bool for booleans.
5220         * stripslash.c (strip_trailing_slashes): Likewise.
5221
5222         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5223         sometimes returns a positive errno value even when it succeeds.
5224         (print_errno_message) [!LIBC]: Fall back on strerror if
5225         __strerror_r fails.
5226
5227         * path-concat.c (mempcpy): Don't define if a system header defines it.
5228         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5229         (longest_relative_suffix): New function.
5230         (path_concat): Use it.  Assume first argument is not NULL.
5231         Port to DOS.  Omit redundant separators.
5232         Report an error instead of returning NULL.
5233         Use mempcpy instead of memcpy.
5234         (xpath_concat): Remove: not declared or used.
5235
5236         * same.h: Include <stdbool.h>
5237         (same_name): Return bool, not int.
5238         * same.c (same_name): Likewise.
5239         (errno): Don't declare; we assume C89 or better now.
5240
5241         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5242         if not already defined.
5243
5244         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5245         * dup-safer.c (errno): Likewise.
5246
5247 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5248
5249         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5250         working.
5251
5252 2004-08-03  Simon Josefsson  <jas@extundo.com>
5253
5254         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5255         * progname.h: Don't include stdbool.h.
5256
5257 2004-08-02  Simon Josefsson  <jas@extundo.com>
5258
5259         * getsubopt.h: New file, with comments from Bruno Haible.
5260         * getsubopt.c: New file, from glibc, but slightly modified based on
5261         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5262
5263 2004-08-01  Simon Josefsson  <jas@extundo.com>
5264
5265         * xgetdomainname.c: Include stdlib.h, for free().
5266
5267 2004-07-16  Simon Josefsson  <jas@extundo.com>
5268
5269         * dummy.c: New file.
5270
5271 2004-07-16  Bruno Haible  <bruno@clisp.org>
5272
5273         * backupfile.h: Add extern "C" for C++.
5274         * closeout.h: Likewise.
5275         * copy-file.h: Likewise.
5276         * findprog.h: Likewise.
5277         * full-write.h: Likewise.
5278         * pathname.h: Likewise.
5279         * progname.h: Likewise.
5280         * stpcpy.h: Likewise.
5281         * stpncpy.h: Likewise.
5282         * strcase.h: Likewise.
5283         * strstr.h: Likewise.
5284         * xalloc.h: Likewise.
5285
5286         * mbswidth.h: Add extern "C" for C++.
5287         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5288
5289 2004-07-09  Simon Josefsson  <jas@extundo.com>
5290
5291         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5292         failed without this.)
5293
5294 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5295
5296         * fchown-stub.c: New file.
5297
5298 2004-06-24  Jim Meyering  <jim@meyering.net>
5299
5300         * obstack.h (obstack_base): Cast to (void *), per documentation.
5301
5302 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5303
5304         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5305
5306 2004-06-01  Jim Meyering  <jim@meyering.net>
5307
5308         * calloc.c: New file.
5309
5310 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5311
5312         * getdate.y (yylex): Allow space between sign and number.
5313         Problem reported by Dan Jacobson.
5314
5315 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5316         and  Jim Meyering  <jim@meyering.net>
5317
5318         Merge from coreutils CVS.
5319
5320         * stat-macros.h: New file, with contents from file-type.h
5321         and coreutils' system.h.
5322         * file-type.c: Include "stat-macros.h".
5323         * file-type.h (file_type): Move all macro definitions to new file,
5324         stat-macros.h.
5325
5326         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5327         Wrap old code with this conditional.
5328         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5329         function that does not dereference symlinks.
5330         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5331
5332         * xreadlink.c: Include xreadlink.h first, to catch .h file
5333         dependency problems.
5334         (xreadlink): Accept new arg SIZE, for efficiency.
5335         All decls and uses changed.
5336         * xreadlink.h: Include <stddef.h>, for size_t.
5337
5338         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5339         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5340
5341         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5342
5343 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5344
5345         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5346         macros to be defined.
5347         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5348         the allocator returns NULL because the requested size is zero.
5349
5350 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5351
5352         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5353         var.  Add comment explaining why libc still defines it.  This
5354         merges the following patch from glibc:
5355         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5356
5357 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5358
5359         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5360         present in glibc since revision 1.1 of this file.
5361         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5362         obstack_alignment_mask, obstack_alloc, obstack_base,
5363         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5364         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5365         obstack_grow0, obstack_init, obstack_int_grow,
5366         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5367         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5368         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5369         nonexistent functions.
5370
5371 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5372             Paul Eggert  <eggert@cs.ucla.edu>
5373
5374         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5375
5376 2004-05-14  Bruno Haible  <bruno@clisp.org>
5377
5378         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5379         that consists of a '.' followed by an empty digit string.
5380         Patch by Tor Lillqvist <tml@iki.fi>.
5381
5382 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5383
5384         Port obstack to the AS/400, where pointers are 16 bytes wide and
5385         you cannot cast an integer to a valid pointer.  This patch is
5386         currently waiting to be integrated into glibc; see
5387         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5388
5389         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5390         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5391         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5392         (struct obstack): temp member is now a union of a pointer and
5393         an integer, instead of an integer.  All integer uses changed.
5394         This does not affect the physical layout of struct obstack,
5395         except on hosts (like the AS/400) where the size or alignment of
5396         void * is greater than that of ptrdiff_t.
5397         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5398         __STDC__)]: Store temporary in pointer member of union, not
5399         integer member.
5400         * obstack.c: Include <stddef.h>, for offsetof.
5401         (struct fooalign): Remove; it doesn't need a name.
5402         (union fooround): Change double to long double, and add void *.
5403         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5404         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5405         not a macro.  Hence the values are always int; so remove all
5406         casts-to-int in uses.
5407
5408 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5409             Derek Price  <derek@ximbiot.com>
5410
5411         * alloca.c: Include <alloca.h>, to get our interface.
5412         * alloca_.h: Use __alloca on AIX, so that we don't have to
5413         include <alloca.h> first.  Use C89 prototype for alloca; this
5414         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5415         Use #elif for simplicity, since we can assume C89 now.
5416         Don't try to source the system alloca.h since it will not be found
5417         and to prevent recursively including its replacement.
5418         * fnmatch.c: Include <alloca.h> instead of opencoding.
5419         * regex.c: Likewise.
5420
5421 2004-05-16  Derek Price  <derek@ximbiot.com>
5422             Paul Eggert  <eggert@cs.ucla.edu>
5423
5424         getline cleanup.  This changes the getndelim2 API: both order of
5425         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5426         no delimiter).
5427
5428         * getline.c: Don't include stddef.h or stdio.h, since our
5429         interface does that.
5430         (getline): Always use getdelim, so that we don't have two
5431         copies of this code.
5432         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5433         if available.
5434         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5435         (GETNDELIM2_MAXIMUM): New macro.
5436         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5437         instead of the old practice of delim2==0.  All callers changed.
5438         Return -1 on overflow, instead of returning junk.
5439         Do not set *linesize unless allocation succeeds.
5440         * getndelim2.h: Do not include stddef.h; no longer needed, now
5441         that we include sys/types.h.
5442         * getnline.h: Likewise.
5443         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5444         (getndelim2): Reorder arguments.
5445         * getnline.c (getnline, getndelim):
5446         Don't discard the NMAX argument.
5447         (getnline): Invoke getndelim, to avoid code duplication.
5448         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5449         of (size_t) -1 by callers of the getnline family.
5450
5451 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5452
5453         * nanosleep.c (suspended): Change its type from int to
5454         sig_atomic_t volatile.
5455         (first_call): Make it private to rpl_nanosleep, and have it
5456         be zero initially as that's a bit faster.
5457         (my_usleep): Round up fractional times instead of truncating them,
5458         as this is the usual meaning for 'sleep'.
5459
5460         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5461         doesn't work.
5462         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5463         (ENOSYS): Define if not defined.
5464         (settime): Fall back on stime if it exists and settimeofday fails.
5465         But don't bother with fallbacks if a method fails with errno == EPERM.
5466
5467 2004-05-11  Jim Meyering  <jim@meyering.net>
5468
5469         Prior to this change, the save_cwd caller required read access to the
5470         current directory on most systems (ones with the fchdir function).
5471
5472         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5473         fails, try write-only, and finally, resort to using xgetcwd.
5474
5475 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5476
5477         * obstack.c, obstack.h: Import changes from libc.
5478
5479 2004-04-28  Bruno Haible  <bruno@clisp.org>
5480
5481         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5482         implicitly appends .exe to executables.
5483         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5484         accepts Windows pathnames.
5485         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5486         Cygwin like Windows, since it now accepts Windows pathnames.
5487         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5488         Cygwin like Windows, since it now accepts Windows pathnames.
5489         Reported by Derek Robert Price <derek@ximbiot.com>.
5490
5491 2004-04-20  Jim Meyering  <jim@meyering.net>
5492
5493         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5494
5495 2004-04-20  Jim Meyering  <jim@meyering.net>
5496             Bruno Haible  <bruno@clisp.org>
5497
5498         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5499         memory when realloc fails.
5500
5501 2004-04-18  Jim Meyering  <jim@meyering.net>
5502
5503         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5504         don't leak memory and do call END_UTMP_ENT.
5505
5506 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5507
5508         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5509         (CHAR_BIT): Remove, since we assume C89.
5510         Include <stdint.h> if available, as per current Autoconf CVS advice.
5511
5512 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5513
5514         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5515         not bool, to be more consistent with Unix conventions.
5516         Suggested by Bruno Haible.
5517
5518         Merge from coreutils.
5519
5520         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5521         New files.
5522
5523         * getdate.h: Include stdbool.h, and timespec.h instead of
5524         the usual <time.h> dance.
5525         (get_date): Change signature to support fractional time stamps.
5526         All callers changed.
5527         * getdate.y: Include "getdate.h" first, as we can now
5528         assume C89 and don't need to worry about 'const'.
5529         Similarly, include "unlocked-io.h" near start, not in middle.
5530         Include <limits.h>.
5531         (textint.value): Use long int rather than int.
5532         (textint.digits): Use size_t rather than int.
5533         (BILLION, LOG10_BILLION): New constants.
5534         (parser_control): New member rel_ns.  Members day_ordinal,
5535         time_zone, month, day, hour, minutes, rel_year, rel_month,
5536         rel_day, rel_hour, rel_minutes, rel_seconds
5537         are now long int, not int.  Member seconds is now struct timespec,
5538         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5539         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5540         not int.
5541         (%union.intval): Now long int, not int.
5542         New member timespec.
5543         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5544         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5545         (spec): Now is a timespec or an item list.
5546         (timespec, items): New nonterminals.
5547         (time, rel, relunit, number, get_date):
5548         Add support for fractional seconds.
5549         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5550         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5551         (to_hour): First arg is now long int, not int.
5552         (to_year): Returns long int, not int.
5553         Don't treat year -70 like 70.
5554         (tm_diff): Returns long int, not int.
5555         (lookup_word): Use bool instead of int when appropriate.
5556         (yylex): Use size_t for count, not int.
5557         Detect overflow when parsing large integer constants.
5558         Add support for fractions.
5559         (get_date): Make pointers 'const' if possible.
5560         Use more-portable code to detect integer overflow.
5561         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5562         Don't use ctime; it's not reliable if the year has >4 digits.
5563
5564         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5565         This is for compatibility with BSD.
5566
5567         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5568         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5569         From coreutils' system.h.
5570
5571         * userspec.c: Don't include "posixver.h".
5572         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5573         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5574         compatible extension.  Simplify code by removing a boolean int
5575         that was always nonzero if a string was nonnull.
5576
5577 2004-03-30  Jim Meyering  <jim@meyering.net>
5578
5579         Merge from coreutils.
5580
5581         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5582
5583         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5584         an empty input stream.
5585
5586         * readtokens.c: Include <stdbool.h>.
5587         (readtoken): Use `size_t' rather than int/long.
5588         All callers adjusted.
5589         Use `bool' rather than `int' where appropriate.
5590         Use memset rather than an explicit loop.
5591         Use x2nrealloc rather than xrealloc.
5592         Allow the use of `\0' as a delimiter.
5593         (readtokens): Likewise.
5594         * readtokens.h (readtoken, readtokens): Update prototypes.
5595
5596 2004-03-30  Bruno Haible  <bruno@clisp.org>
5597
5598         * getloadavg.c (getloadavg): Don't assume setlocale returns
5599         nonnull.
5600
5601 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5602
5603         Merge changes to getloadavg.c from coreutils and Emacs.
5604
5605         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5606         Define to an expression, not to the empty string.
5607         Include cloexec.h and xalloc.h.
5608         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5609         Use set_cloexec_flag rather than rolling our own.
5610         * cloexec.c, cloexec.h: New files.
5611
5612 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5613
5614         * getopt.h: Sync with libc CVS.
5615
5616 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5617             Bruno Haible  <bruno@clisp.org>
5618
5619         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5620         not on all platforms that have <wchar.h>.
5621         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5622
5623 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5624
5625         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5626         Sync with libc CVS.
5627         * getopt_int.h: New file, also synced from libc.
5628
5629 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5630
5631         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5632         '#if' expressions.  Unlike the code it replaces, it does not
5633         depend on (defined _SC_PAGESIZE).  However, it does depend on
5634         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5635         first reported by Jason Andrade in
5636         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5637
5638 2004-01-18  Simon Josefsson  <jas@extundo.com>
5639
5640         * strdup.h: New file.
5641         * strdup.c: Include it.
5642         * path-concat.c: Include strdup.h. Drop strdup declaration.
5643         * userspec.c: Include strdup.h. Drop strdup declaration.
5644
5645 2004-02-06  Karl Berry  <karl@gnu.org>
5646
5647         * config.charset: update from gettext 0.14.1.
5648
5649 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5650
5651         Add comments and code, prompted by suggestions from Bruno Haible
5652         for sh-quote.
5653         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5654         describing the enum quoting_style values.
5655         * quotearg.c (quotearg_alloc): New function.
5656         (quotearg_buffer_restyled): Treat lone { and } as special.
5657         Treat = as special.  Work around bug with older shells
5658         that "see" a '\' that is really the 2nd byte of a multibyte char.
5659         Quote empty string with shell_quoting_style.
5660
5661 2004-02-03  Bruno Haible  <bruno@clisp.org>
5662
5663         * pipe.h: New file, from GNU gettext.
5664         * pipe.c: New file, from GNU gettext.
5665
5666 2004-01-27  Bruno Haible  <bruno@clisp.org>
5667
5668         * execute.h: New file, from GNU gettext.
5669         * execute.c: New file, from GNU gettext.
5670         * w32spawn.h: New file, from GNU gettext.
5671
5672 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5673
5674         Exit-status fix from coreutils.
5675
5676         Use exit_failure consistently in place of EXIT_FAILURE,
5677         so that program exit statuses are consistent on failure.
5678
5679         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5680         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5681         * argmatch.h: Comment fix to match the above.
5682         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5683         Now a macro referring to exit_failure, instead of a separate
5684         variable.  Include "exitfail.h" to get it.
5685         * xstrtol.h: Include "exitfail.h".
5686         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5687
5688         * long-options.c (parse_long_options): Use prototype
5689         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5690         for clarity.
5691
5692 2004-01-21  Jim Meyering  <jim@meyering.net>
5693
5694         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5695         so as not to conflict with a different-sized __mktime_internal
5696         function in GNU libc.
5697         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5698         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5699
5700 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5701
5702         Merge from diffutils.
5703
5704         * file-type.c (file_type): Add typed memory objects.
5705         * file-type.h (S_TYPEISTMO): New macro.
5706
5707         * c-stack.h (c_stack_action): Remove argv argument.
5708         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5709         (die): Don't calculate message unless segv_action returns.
5710         (get_stack_location, min_address_from_argv, max_address_from_argv,
5711         volatile stack_base, volatile_stack_size): Remove.
5712         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5713         that every segmentation violation is a stack overflow.  (Ouch!)
5714         See Debian bug 136249 (still outstanding) for more info about why
5715         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5716
5717 2003-11-30  Bruno Haible  <bruno@clisp.org>
5718
5719         Safer stack allocation.
5720         * setenv.c: Include allocsa.h.
5721         (alloca): Remove fallback definition.
5722         (freea): Remove macro.
5723         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5724         instead of freea.
5725
5726 2003-10-17  Bruno Haible  <bruno@clisp.org>
5727
5728         * binary-io.h: Avoid warnings on Cygwin.
5729
5730 2003-12-28  Bruno Haible  <bruno@clisp.org>
5731
5732         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5733         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5734
5735 2003-11-28  Bruno Haible  <bruno@clisp.org>
5736
5737         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5738
5739 2003-11-27  Bruno Haible  <bruno@clisp.org>
5740
5741         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5742
5743 2003-11-17  Bruno Haible  <bruno@clisp.org>
5744
5745         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5746
5747 2003-11-24  Bruno Haible  <bruno@clisp.org>
5748
5749         * xallocsa.h: New file, from GNU gettext.
5750         * xallocsa.c: New file, from GNU gettext.
5751
5752 2003-11-24  Bruno Haible  <bruno@clisp.org>
5753
5754         * allocsa.h: New file, from GNU gettext.
5755         * allocsa.c: New file, from GNU gettext.
5756
5757 2003-11-24  Bruno Haible  <bruno@clisp.org>
5758
5759         * eealloc.h: New file.
5760
5761 2004-01-15  Jim Meyering  <jim@meyering.net>
5762
5763         Merge from coreutils.
5764
5765         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5766         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5767         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5768
5769         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5770         optional configure-time default.
5771
5772         * version-etc.c (version_etc_copyright): Update copyright date.
5773
5774         * xreadlink.c (xreadlink): Correct outdated comment.
5775
5776 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5777
5778         Merge from coreutils.
5779
5780         * posixver.c: Include posixver.h.
5781
5782         * same.c: Include <stdbool.h>, <limits.h>.
5783         (_POSIX_NAME_MAX): Define if not defined.
5784         (MIN): New macro.
5785         (same_name): If file names are silently truncated, report
5786         that the file names are the same if they are the same after
5787         the silent truncation.
5788
5789         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5790         conversion function.
5791         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5792         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5793         longer needed.
5794
5795 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5796
5797         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5798         with like-named macro in fnmatch.c.
5799         (EXT): Use an internal constant instead.
5800
5801         Merge fnmatch patches from glibc.
5802         * fnmatch.c (mbsinit): Remove define.
5803         Add libc_hidden_ver (__fnmatch, fnmatch).
5804         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5805         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5806
5807 2003-12-14  Karl Berry  <karl@gnu.org>
5808
5809         * config.charset: update from gettext-runtime.
5810
5811 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5812
5813         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5814         Bug reported by Alfred M. Szmidt.
5815
5816 2003-11-29  Karl Berry  <karl@gnu.org>
5817
5818         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5819
5820 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5821             Bruno Haible  <bruno@clisp.org>
5822
5823         * printf-parse.h: Don't include sys/types.h.
5824         (ARG_NONE): New macro.
5825         (char_directive): Change type of *arg_index fields to size_t.
5826         * printf-parse.c: Don't include sys/types.h.
5827         (SSIZE_MAX): Remove macro.
5828         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5829         Remove unnecessary overflow check.
5830         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5831         fields.
5832
5833 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5834
5835         * alloca.c: Remove dependency on xalloc module.
5836         (xalloc_die): Remove.
5837         (memory_full) [!defined emacs]: New macro.
5838         [!defined emacs]: Don't include xalloc.h.
5839         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5840         address arithmetic overflows.  Change datatypes a bit to avoid
5841         unnecessary casts.
5842
5843 2003-11-22  Jim Meyering  <jim@meyering.net>
5844
5845         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5846
5847 2003-11-17  Bruno Haible  <bruno@clisp.org>
5848
5849         * vasnprintf.c (alloca): Remove fallback definition.
5850         (freea): Remove definition.
5851         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5852         Reported by Paul Eggert.
5853
5854 2003-11-17  Jim Meyering  <jim@meyering.net>
5855
5856         On systems without utime and without a utimes function capable of
5857         dealing with a NULL struct utimbuf* argument, this utime replacement
5858         could -- in unusual circumstances -- leak a file descriptor.
5859         * utime.c: Include <unistd.h> and <errno.h>.
5860         (utime_null): Be sure to close `fd' and to preserve errno.
5861         Reported by Geoff Collyer via Arnold Robbins.
5862
5863 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5864             Bruno Haible  <bruno@clisp.org>
5865
5866         Protect against address arithmetic overflow.
5867         * printf-args.h: Include stddef.h.
5868         (arguments): Change type of field 'count' to size_t.
5869         * printf-args.c (printf_fetchargs): Use size_t instead of
5870         'unsigned int' where appropriate.
5871         * printf-parse.h: Include sys/types.h.
5872         (char_directive): Change type of *arg_index fields to ssize_t.
5873         (char_directives): Change type of fields 'count', max_*_length to
5874         size_t.
5875         * printf-parse.c: Include sys/types.h and xsize.h.
5876         (SSIZE_MAX): Define fallback value.
5877         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5878         instead of 'int' where appropriate. Check a_allocated, d_allocated
5879         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5880         * vasnprintf.c: Include xsize.h.
5881         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5882         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5883         overflow. Avoid wraparound when converting a width or precision from
5884         decimal to binary.
5885
5886 2003-11-16  Bruno Haible  <bruno@clisp.org>
5887
5888         Update from GNU gettext.
5889         * printf-parse.c: Generalize to it can be compiled for wide strings.
5890         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5891         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5892         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5893         SNPRINTF): New macros.
5894         Don't include <alloca.h> if the file is used inside libintl.
5895         (local_wcslen): New function, for Solaris 2.5.1.
5896         (VASNPRINTF): Use it instead of wcslen.
5897
5898 2003-11-16  Bruno Haible  <bruno@clisp.org>
5899
5900         * xsize.h (xmax): New function.
5901         (xsum, xsum3, xsum4): Declare as "pure" functions.
5902
5903 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5904
5905         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5906         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5907         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5908         heuristic is just as accurate as far as we know, and it removes a
5909         dependency on size_max.m4 and ptrdiff_max.m4.
5910
5911 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5912
5913         * xstrtol.c (__xstrtol): Remove "break" immediately after
5914         "return", to pacify some unknown compiler.  Problem reported
5915         by Joerg Schilling.
5916
5917 2003-11-11  Bruno Haible  <bruno@clisp.org>
5918
5919         * xsize.h (SIZE_MAX): Remove fallback definition.
5920         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5921         defined.
5922
5923 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5924
5925         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5926         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5927         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5928         From Bruno Haible.
5929         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5930         not (size_t) -1, since it's defined here.
5931
5932 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5933
5934         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5935         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5936         Reject sizes of exactly SIZE_MAX bytes.
5937         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5938         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5939
5940 2003-11-05  Bruno Haible  <bruno@clisp.org>
5941
5942         * xsize.h: Include limits.h, to avoid a possible collision with
5943         SIZE_MAX defined in <limits.h> on Solaris.
5944
5945 2003-11-04  Bruno Haible  <bruno@clisp.org>
5946
5947         * xsize.h: New file.
5948         * linebreak.c: Include xsize.h.
5949         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5950         argument for overflow.
5951         Suggested by Paul Eggert.
5952
5953 2003-10-31  Bruno Haible  <bruno@clisp.org>
5954
5955         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5956         to avoid (extremely rare) race condition.
5957         Suggested by Paul Eggert.
5958
5959 2003-11-03  Jim Meyering  <jim@meyering.net>
5960
5961         * userspec.c: Include "userspec.h".
5962         * userspec.h: New file.
5963
5964 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5965
5966         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5967         * mountlist.c (SIZE_MAX): Define if not defined already.
5968         (read_filesystem_list): Set and use me_type_malloced.
5969         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5970         whatever the type happens to be), for brevity and consistency.
5971         Check for size calculation overflow on Alphas running OSF/1.
5972
5973 2003-10-31  Jim Meyering  <jim@meyering.net>
5974
5975         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5976
5977         * linebuffer.c: Include <string.h> for declaration of memset.
5978
5979 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5980             Bruno Haible  <bruno@clisp.org>
5981
5982         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5983         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5984
5985 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5986
5987         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5988         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5989         no longer needed.
5990         * quotearg.c (quotearg_n_options): Use it.
5991         * group-member.c: Include <stdbool.h>.
5992         (free_group_info): Arg is now const *; don't free arg.
5993         (get_group_info): Now returns bool and accepts struct group_info *,
5994         rather than returning a malloc'ed struct group_info *.
5995         All uses changed.  Check for overflow in internal size calculation.
5996
5997         * getusershell.c (readname): Simplify the code by using x2nrealloc
5998         rather than xmalloc/xrealloc.
5999         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6000         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6001         conformance bug: the old code used a pointer after freeing the
6002         storage that it addressed.
6003         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6004         rather than doing it by hand.
6005         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6006         the buffer preserved.  Use free and xmalloc instead.
6007         * quotearg.c (quotearg_n_options): Likewise.
6008         Use a simpler test for size overflow.  Don't use xalloc_oversized
6009         because unsigned int might be wider than size_t (!); this suggests
6010         that we should switch from unsigned int to size_t for slot numbers.
6011
6012 2003-10-27  Bruno Haible  <bruno@clisp.org>
6013
6014         * stdbool_.h: Better support for BeOS.
6015
6016 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6017
6018         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6019         to allocate the returned structure.  Do not allocate a subarray,
6020         as x2nrealloc will do that.
6021         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6022         instead of xnrealloc.
6023         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6024
6025 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6026
6027         * xalloc.h (xalloc_oversized): New static inline function, for
6028         callers that want to do their own size-overflow checking.  Include
6029         <stdbool.h>, since xalloc_oversized returns bool.
6030         * xalloc.c (array_size_overflow): Remove.  All callers changed
6031         to use xalloc_oversized.
6032
6033         Add two functions x2realloc, x2nrealloc, for programs that grow
6034         arrays dynamically by doubling their sizes.
6035         * xalloc.h (x2realloc, x2nrealloc): New decls.
6036         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6037         New functions.
6038
6039         Port to C99 semantics for 'inline' of external functions.
6040         Bug reported by Bruno Haible.
6041         * xmalloc.c (xnmalloc_inline): New static inline function,
6042         with the old contents of xnmalloc.
6043         (xnmalloc, xmalloc): Use it.
6044         (xnrealloc_inline): New static inline function,
6045         with the old contents of xnrealloc.
6046         (xnrealloc, xrealloc): Use it.
6047
6048         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6049
6050 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6051
6052         Fix several address-calculation bugs in the hash modules,
6053         plus some minor code cleanup.
6054
6055         * hash.h: Include <stdbool.h>, for bool.
6056         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6057         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6058         hash_get_n_entries, hash_get_max_bucket_length,
6059         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6060         hash_rehash): Use size_t rather than unsigned.
6061         * hash.c (struct hash_table, hash_get_n_buckets,
6062         hash_get_n_buckets_used, hash_get_n_entries,
6063         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6064         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6065         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6066         Likewise.
6067         (SIZE_MAX): Define if not defined.
6068         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6069         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6070         hash_print):
6071         Use const * when possible.
6072         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6073         (check_tuning): Fix bug: if tuning parameters were very close to
6074         0 or 1, rounding errors could have caused subscript violations.
6075         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6076         (hash_initialize): Add 'fail:' label
6077         to free table and return NULL, and use it to simplify code.
6078         Use calloc rather than clearing the storage ourself.
6079         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6080         buffer size calculations.
6081         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6082         Include <stddef.h>, for size_t.
6083         * hash-pjw.c (hash_pjw): Likewise.
6084         Switch to method described by Bruno Haible.
6085         Include <limits.h>, for CHAR_BIT.
6086         (SIZE_BITS): New macro.
6087
6088 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6089
6090         * getndelim2.c (getndelim2): When size calculation overflows,
6091         ceiling the allocation at NMAX bytes rather than silently
6092         discarding input bytes before NMAX is reached.  This makes
6093         a difference only if NMAX exceeds SIZE_MAX / 2.
6094
6095         * obstack.c: Merge from glibc.
6096         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6097         Add libc_hidden_def (_obstack_newchunk).
6098         (_obstack_free) [! defined _LIBC]: Remove.
6099         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6100         a clone of the function body.
6101         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6102         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6103
6104         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6105         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6106         arg to memcpy.
6107
6108         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6109         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6110         Don't use lvalue casts, as GCC plans to remove support for them
6111         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6112         was also present in the non-GCC version, indicating that this
6113         code had always been buggy and had never been widely used.
6114         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6115         Use the fast variant of each macro, rather than copying the
6116         definiens of the fast variant; that way, we'll be more likely to
6117         catch future bugs in the fast variants.
6118
6119 2003-10-20  Bruno Haible  <bruno@clisp.org>
6120
6121         * wait-process.h: New file, from GNU gettext.
6122         * wait-process.c: New file, from GNU gettext.
6123
6124 2003-10-19  Jim Meyering  <jim@meyering.net>
6125
6126         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6127
6128 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6129
6130         * getgroups.c: Include <errno.h>, <stdlib.h>.
6131         (getgroups): First arg is int, not size_t.
6132         Don't let 'free' mangle errno.
6133
6134 2003-10-16  Jim Meyering  <jim@meyering.net>
6135
6136         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6137
6138 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6139
6140         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6141         (SIZE_MAX): Remove.
6142         (new_exclude, add_exclude_file): Initial size no longer needs to
6143         be a power of 2.
6144         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6145         our own address arithmetic overflow checking.
6146
6147         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6148         (fnmatch): Do not alloca more than 2000 wide characters;
6149         instead, use malloc for large buffers.
6150         Check for address arithmetic overflow, and return -1
6151         with errno set to ENOMEM in that case.
6152         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6153         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6154         instead, return -1.  Check for address arithmetic overflow.
6155
6156 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6157
6158         Handle invalid suffixes and overflow independently, so that
6159         callers can treat them independently as needed.  Fix some bugs in
6160         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6161         suffix for a human-readable blocksize.  The major caller-visible
6162         change is the addition of a new
6163         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6164         that both overflow and suffix chars were found.
6165
6166         * human.c (humblock): Don't check separately for invalid suffix
6167         char; that is xstrtoumax's job (now that its bug is fixed).
6168         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6169         INTMAX_MAX]: New macros.
6170         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6171         TYPE_MAXIMUM): New macros.
6172         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6173         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6174         if overflow occurs, as it's what __strtol does and it's more useful
6175         in practice.
6176         (__xstrtol): If __strtol reports some error other than ERANGE,
6177         reflect it to the caller as LONGINT_INVALID.  If it reports
6178         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6179         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6180         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6181         value.
6182         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6183         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6184         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6185         [defined UINTMAX_MAX]: New macros.
6186
6187 2003-10-14  Bruno Haible  <bruno@clisp.org>
6188
6189         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6190         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6191         Also use volatile where needed.
6192
6193 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6194
6195         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6196         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6197         and define in terms of the other primitives.
6198         * xmalloc.c: Include stdbool.h; do not include exit.h.
6199         (SIZE_MAX): Define if not already defined.
6200         (array_size_overflow): New function.
6201         (xalloc_die): Abort instead of exiting if 'error' returns.
6202         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6203         (xmalloc, xrealloc): Use them.
6204         (xcalloc): Check for address arithmetic overflow.
6205         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6206         a bit faster than strcpy.
6207
6208 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6209
6210         Merge getpass from libc, plus a few fixes.
6211
6212         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6213         Include <stdbool.h>.
6214         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6215         __fsetlocking to empty.
6216         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6217         do include <bits/libc-lock.h>.
6218         Do not include <fcntl.h>; not needed.
6219         [_LIBC]: Include <wchar.h>.
6220         (NOTCANCEL_MODE): New macro.
6221         (flockfile, funlockfile) [_LIBC]: New macros.
6222         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6223         [!_LIBC]: New macros.
6224         (call_fclose): New function.
6225         (getpass): Use it.  Save tty stream separately; this simplifies the
6226         code and makes it more reliable if stdin happens to equal stdout.
6227         Invoke __fsetlocking on tty.
6228         Handle thread cancellation if needed.
6229         Namespace cleanup (use __tcgetattr, __getline).
6230         Use bool for Booleans.
6231         [USE_IN_LIBIO]: Handle wide streams.
6232         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6233         stream might go where.
6234
6235         * unlocked-io.h: Include <stdio.h>, so that the caller
6236         doesn't have to include <stdio.h> before us.
6237         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6238         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6239         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6240         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6241         if not declared, so that we can use getpass.c code from libc without
6242         rewriting it.
6243         (flockfile, ftrylockfile, funlockfile): New macros.
6244
6245 2003-10-06  Bruno Haible  <bruno@clisp.org>
6246
6247         * version-etc-2.h: Remove file.
6248         * version-etc-2.c: Remove file.
6249
6250 2003-09-25  Jim Meyering  <jim@meyering.net>
6251             Bruno Haible  <bruno@clisp.org>
6252
6253         This lets translators provide better translations for the
6254         "Written by ..." part of --version output.
6255         * version-etc.h: Include stdarg.h.
6256         (version_etc_copyright): Declare as readonly.
6257         (version_etc): Make this function variadic with a NULL-terminated list
6258         of author name strings.
6259         (version_etc_va): New declaration.
6260         * version-etc.c: Include stdarg.h, stdlib.h.
6261         (version_etc_copyright): Declare as readonly.
6262         (version_etc_va): New function. Provide a different translatable string
6263         for each possible number of authors < 10. Abbreviate when there are 10
6264         authors or more.
6265         (version_etc): Make this function variadic. Call version_etc_va.
6266         Suggestion from Gary V. Vaughan.
6267
6268         * long-options.h (parse_long_options): Change prototype: the authors
6269         string is moved to the end and becomes variadic.
6270         * long-options.c: Include stdarg.h.
6271         (parse_long_options): Make this function variadic, too.
6272         Call version_etc_va, not version_etc.
6273
6274 2003-10-06  Bruno Haible  <bruno@clisp.org>
6275
6276         * fatal-signal.h: New file, from GNU gettext.
6277         * fatal-signal.c: New file, from GNU gettext.
6278
6279 2003-10-04  Karl Berry  <karl@gnu.org>
6280
6281         * argp*: update from libc.
6282
6283 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6284
6285         * getpass.c (getpass): Use a no-op fseek when switching from input to
6286         output mode on the same stream.
6287
6288 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6289
6290         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6291         Fix arg typo in previous patch.
6292
6293 2003-09-28  Jim Meyering  <jim@meyering.net>
6294
6295         * error.c: Correct cpp indentation.
6296
6297 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6298
6299         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6300         Omit the special code that used __typeof__, since we worry that
6301         it could be more trouble than it's worth.  See:
6302         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6303         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6304
6305         * free.c: New file.
6306
6307 2003-09-26  Jim Meyering  <jim@meyering.net>
6308
6309         * error.c (error_tail): Move some declarations
6310         into inner scope where the local variables are used.
6311
6312 2003-09-26  Bruno Haible  <bruno@clisp.org>
6313
6314         * stpncpy.h (gnu_stpncpy): New declaration.
6315         (stpncpy): Define as alias for gnu_stpncpy.
6316         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6317
6318 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6319
6320         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6321         (error_tail): Do not loop, reallocating temporary buffer, since
6322         the output cannot contain more wide characters than the input
6323         contains bytes, the size must be big enough already.  This avoids
6324         one potential size overflow calculation.  Check for size overflow
6325         when calculating temporary buffer size.  Free temporary buffer
6326         when done, if it was allocated with malloc; this plugs a memory
6327         leak.  Remove casts from void * to pointers, that are no longer
6328         needed now that we're assuming C89 or better.
6329
6330         Merge error changes from glibc.
6331
6332         * error.c, error.h: Update copyright notice header to match glibc.
6333         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6334         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6335         Disable cancellation while printing error.
6336         * error.h: Prepend __ to parameter names.
6337
6338 2003-09-25  Karl Berry  <karl@gnu.org>
6339
6340         * argp-fmtstream.c, argp-help.c: update from libc.
6341
6342 2003-09-25  Bruno Haible  <bruno@clisp.org>
6343
6344         * version-etc-2.h: New file, from version-etc.h with modifications.
6345         * version-etc-2.c: New file, from version-etc.c with modifications.
6346
6347 2003-09-25  Simon Josefsson  <jas@extundo.com>
6348
6349         * xgetdomainname.h: New file.
6350         * xgetdomainname.c: New file.
6351
6352 2003-09-25  Simon Josefsson  <jas@extundo.com>
6353             Bruno Haible  <bruno@clisp.org>
6354
6355         * getdomainname.h: New file.
6356         * getdomainname.c: New file.
6357
6358 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6359
6360         * linebuffer.c (freebuffer): Don't free the argument, just
6361         the buffer associated with the argument.  Bug reported by
6362         Simon Josefsson.
6363
6364 2003-09-19  Karl Berry  <karl@gnu.org>
6365
6366         * argp.h: update from libc.
6367
6368 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6369
6370         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6371         input error, instead of returning NULL the next time we are called
6372         (and therefore losing track of errno).
6373
6374 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6375
6376         * getndelim2.c (getndelim2): Don't trash errno when a read
6377         fails, so that the caller gets the proper errno.
6378
6379         * readutmp.c (read_utmp): Likewise.
6380         Check for fstat error.  Close stream and free storage
6381         when failing.
6382
6383 2003-09-14  Bruno Haible  <bruno@clisp.org>
6384
6385         * fwriteerror.h: New file.
6386         * fwriteerror.c: New file.
6387
6388 2003-09-14  Jim Meyering  <jim@meyering.net>
6389
6390         * getloadavg.c: Correct cpp indentation.
6391         * strdup.c: Likewise.
6392         * vasnprintf.c: Likewise.
6393
6394 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6395
6396         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6397         * obstack.c [!defined _LIBC]: Likewise.
6398         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6399         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6400         * exitfail.c: Don't include stdlib.h; no longer needed.
6401
6402         More changes to assume C89 or better.
6403
6404         * error.c (error_tail): Assume vprintf.
6405
6406         * argmatch.c (getenv): Remove decl.
6407         * progreloc.c (get_full_program_name): Define via prototype.
6408         * setenv.c (clearenv): Likewise.
6409         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6410         needed.
6411         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6412         (malloc, memcpy): Remove decls.
6413         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6414         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6415         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6416         (memcpy): Remove macro.
6417         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6418         (__P): Remove.  All uses removed.
6419         (PTR): Remove.  All uses changed to void *.
6420         (CHAR_BIT, NULL): Remove.
6421         (spaces, zeros, memset_space, memset_zero)
6422         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6423         Remove.
6424         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6425         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6426         Define with prototype.
6427         Remove now-unnecessary prototype decl.
6428         (extra_args_spec): Assume ANSI C.  All uses changed.
6429         (extra_args_spec_iso): Remove.
6430         (my_strftime, emacs_strftimeu): Define via prototype.
6431         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6432         unconditionally.
6433         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6434         * strtoimax.c: Include <stdlib.h> unconditionally.
6435         (strtoul, strtol): Remove decls.
6436         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6437         LONG_MAX): Remove.
6438         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6439         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6440         (LOCALE_PARAM_PROTO): New macro.
6441         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6442         (INTERNAL (strtol), strtol): Define with a prototype.
6443         (PARAMS): Remove.  All uses removed.
6444         * tempname.c: Include <string.h> unconditionally.
6445         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6446         * xgethostname.c (main): Define with a prototype.
6447         * xmalloc.c: Include "xalloc.h" first, to check interface.
6448         Include <stdlib.h> unconditionally.
6449         (calloc, malloc, realloc, free): Remove decls.
6450         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6451         Include <stdlib.h> unconditionally.  Sort include file names.
6452         (strtod): Remove.
6453         (xstrtod): Define with a prototype.
6454         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6455         (strtol, strtoul): Remove decls.
6456
6457 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6458
6459         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6460         Include <stdlib.h>, <string.h> unconditionally.
6461         Remove now-unnecessary cast to char *.
6462         * strnlen.c: Include <string.h> unconditionally.
6463         * yesno.c (yesno): Define with a prototype.
6464
6465 2003-09-10  Bruno Haible  <bruno@clisp.org>
6466
6467         * strcspn.c: Include <string.h> unconditionally.
6468         * strpbrk.c: Include <string.h> unconditionally.
6469         * strstr.c: Include <string.h> unconditionally.
6470         * unicodeio.c: Include <string.h> unconditionally.
6471         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6472         * unsetenv.c: Likewise.
6473         * xreadlink.c: Include <stdlib.h> unconditionally.
6474         * yesno.c: Include <stdlib.h> unconditionally.
6475         (rpmatch): Add prototype.
6476
6477 2003-09-10  Jim Meyering  <jim@meyering.net>
6478
6479         * error.c: Correct indentation of cpp directives.
6480
6481 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6482
6483         More K&R removal.
6484
6485         * acosl.c (main): Use a prototype.
6486         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6487         tanl.c: Likewise.
6488
6489         * getloadavg.c (getloadavg, main): Define via prototypes.
6490
6491         * getopt.h (struct option.name): Assume C89, and use 'const'.
6492         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6493         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6494         with a prototype.
6495         * getopt.c (const): Remove macro.
6496         Include <string.h> unconditionally.
6497         (my_index): Remove; all uses changed to strchr.
6498         (strlen): Remove decl.
6499         (exchange): Remove forward decl; no longer needed.
6500         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6501         Define with prototype.
6502         * getopt1.c (const): Remove macro.
6503         (getopt_long, getopt_long_only, main): Define with prototype.
6504
6505         * getugroups.c: Include <string.h> unconditionally.
6506
6507         * getusershell.c: Include <stdlib.h> unconditionally.
6508         (getusershell, setusershell, endusershell, readname, main):
6509         Define with prototypes.
6510
6511         * group-member.c: Include group-member.h first.
6512         Include <stdlib.h> unconditionally.
6513
6514         * hard-locale.c: Include hard-locale.h first.
6515         Include <stdlib.h>, <string.h> unconditionally.
6516
6517         * hash.c (free, malloc): Remove decls.
6518         Include <stdlib.h> unconditionally.
6519
6520         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6521         (getenv): Do not declare.
6522
6523         * idcache.c: Include <string.h> unconditionally.
6524
6525         * long-options.c: Include long-options.h first, to test interface.
6526         Include <stdlib.h> unconditionally.
6527
6528         * makepath.c: Include makepath.h first, to test interface.
6529         Include <stdlib.h> and <string.h> unconditionally.
6530
6531         * linebuffer.c: Include <stdlib.h>.
6532         (free): Remove decl.
6533
6534         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6535         rpl_malloc returns void *, not char *.
6536         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6537
6538         * md5.h: Include <limits.h> unconditionally.
6539         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6540         (__P): Remove; all uses removed.
6541         * md5.c: Include "md5.h" first.
6542         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6543         md5_buffer, md5_process_bytes, md5_process_block):
6544         Define with prototypes.
6545         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6546         * sha.c: Include "sha.h" first.
6547         Include <stdlib.h>, <string.h> unconditionally.
6548
6549         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6550         * memcmp.c (__ptr_t): Likewise.
6551         * memrchr.c (__ptr_t): Likewise.
6552         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6553         Include <string.h> unconditionally.
6554         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6555         * memchr.c: Include <stdlib.h> unconditionally.
6556         * memchr.c (LONG_MAX): Remove.
6557         * memrchr.c (LONG_MAX): Likewise.
6558         * memchr.c (__memchr): Define via a prototype.
6559         * memrchr.c (__memrchr): Likewise.
6560         * memcmp.c (__P): Remove, and remove all uses.
6561         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6562         Remove forward decls; no longer needed.
6563         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6564         Use types required by C89 in prototype.
6565
6566         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6567         * savedir.c: Likewise.
6568         * mkdir.c (free): Remove decl.
6569         * rmdir.c (rmdir): Define with a prototype.
6570         * savedir.c: Include savedir.h first, to test interface.
6571
6572         * mktime.c (STDC_HEADERS): Remove.
6573         Include <stdlib.h>, <string.h> unconditionally.
6574
6575         * modechange.c: Include <stdlib.h> unconditionally.
6576         (malloc): Remove decl.
6577
6578         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6579         (free): Remove decl.
6580
6581         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6582         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6583         (This type really should be intptr_t, but that's a C99ism.)
6584         (_obstack_memcpy): Remove: all uses changed to memcpy.
6585         Include <string.h> unconditionally.
6586         (struct obstack): Assume __STDC__ for types of members
6587         chunkfun, freefun, extra_arg.
6588         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6589         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6590         obstack_begin, obstack_specify_allocation,
6591         obstack_specify_allocation_with_arg, obstack_chunkfun,
6592         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6593         Remove unprototyped decls and the macros that use them.
6594         * obstack.c (POINTER): Remove.  All uses changed to void *.
6595         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6596         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6597         (defined __STDC__ && __STDC__)]:
6598         Remove nonprototyped code.
6599         Include <stdlib.h> unconditionally.
6600         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6601         _obstack_allocated_p, _obstack_free, obstack_free,
6602         _obstack_memory_used, print_and_abort):
6603         Define using prototypes.
6604         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6605         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6606         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6607         obstack_next_free, obstack_object_size, obstack_room) [0]:
6608         Remove unused, unprototyped code.
6609
6610         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6611
6612         * physmem.c (physmem_total, physmem_available, main): Define
6613         with prototypes.
6614
6615         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6616         (main): Define with a prototype.
6617
6618         * posixver.c (getenv): Remove decl.
6619
6620         * putenv.c (malloc): Returns void *, not char *.
6621         Include <string.h> unconditionally.
6622         (strchr, memcpy, NULL): Do not define.
6623
6624         * readtokens.c: Include readtokens.h first, to test interface.
6625         Include <stdlib.h>, <string.h> unconditionally.
6626         (init_tokenbuffer): Define with a prototype.
6627
6628         * regex.c (PARAMS): Remove.  All uses removed.
6629         All uses of _RE_ARGS removed, too.
6630         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6631         unconditionally.
6632         (bzero): Assume memset exists.
6633         (memcmp, memcpy, NULL): Remove.
6634         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6635         char, or assignments to local vars of type signed char.
6636         (init_syntax_once, PREFIX(extract_number_and_incr),
6637         PREFIX(print_partial_compiled_pattern),
6638         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6639         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6640         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6641         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6642         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6643         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6644         wcs_compile_range, byte_compile_range, truncate_wchar,
6645         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6646         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6647         count_mbs_length, wcs_re_match_2_internal,
6648         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6649         PREFIX(alt_match_null_string_p),
6650         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6651         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6652         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6653         now-unnecessary declaration, if any.
6654         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6655         regcomp, regexec):
6656         Remove now-unnecessary casts among pointer types.
6657         * regex.h (_RE_ARGS): Remove.  All uses removed.
6658
6659         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6660         (free): Remove decl.
6661
6662         * rpmatch.c: Include <stdlib.h> unconditionally.
6663
6664         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6665         (free): Remove decl.
6666
6667         * save-cwd.c: Include <stdlib.h> unconditionally.
6668         * xgetcwd.c: Likewise.
6669
6670         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6671         (free): Remove decl.
6672
6673         * strchrnul.c (strchrnul): Define with a prototype.
6674         Fix bug: c_in was not converted to char before searching.
6675
6676         The following changes are not K&R related:
6677
6678         * group-member.h: Include <sys/types.h>, so that this file is
6679         self-contained.
6680         * makepath.h: Likewise.
6681
6682         * getusershell.c (readname, default_index, line_size, readname):
6683         Use size_t, not int, for sizes.
6684         (readname): If the size overflows, report an error instead of
6685         looping forever.
6686
6687 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6688
6689         * getndelim2.c: Assume stdlib.h per the C89 spec.
6690
6691 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6692
6693         Assume C89 or better; remove K&R cruft.
6694         A few of these changes were first proposed by Derek Robert Price
6695         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6696
6697         * addext.c: Include <string.h> unconditionally.
6698         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6699         Don't declare getenv or malloc.
6700
6701         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6702         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6703         (NULL): Remove.
6704         (find_stack_direction, alloca): Use prototypes.
6705
6706         * atexit.c (atexit): Define using a prototype.
6707
6708         * basename.c, dirname.c, stripslash.c:
6709         Include <string.h> unconditionally.
6710
6711         * bcopy.c: Include <stddef.h>.
6712         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6713
6714         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6715
6716         * error.h (error, error_at_line, error_print_progname)
6717         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6718         * error.c: Include error.h first, to check interface.
6719         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6720         (VA_START): Remove; all uses changeed to va_start.
6721         (exit, strerror): Remove decls.
6722         (error_print_progname): Prototype uncondionally.
6723         Don't include <errno.h>; no longer needed.
6724         (private_strerror): Remove.
6725         (error_tail): Always define.
6726         (error, error_at_line): Assume C89 or better; always use prototypes.
6727         * fatal.c: Include "fatal.h" first, to test interface.
6728         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6729         (VA_START): Remove; all uses changed to va_start.
6730         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6731         this case.
6732         (exit): Remove decl.
6733         (fatal): Prototype unconditionally.  Assume va_start works.
6734         Abort at end, to pacify gcc.
6735
6736         * euidaccess.c (main): Define with a prototype.
6737
6738         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6739
6740         * exitfail.c: Include <stdlib.h> unconditionally.
6741
6742         * fnmatch_.h (__P): Remove.  All uses changed to assume
6743         prototypes.
6744         * fnmatch.c: Include fnmatch.h first, to test interface.
6745         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6746         (getenv): Remove decl.
6747         (fnmatch): Define using a prototype.
6748         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6749         (FCT): Define using a prototype.
6750
6751         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6752
6753         * gethostname.c: Include <stddef.h>.
6754         (gethostname): Define with prototype.  Length is size_t, not int.
6755
6756 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6757
6758         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6759         getversion.c should have been removed then, but was accidentally
6760         preserved.
6761
6762         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6763         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6764
6765 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6766
6767         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6768         copy_tm_result.  Bug reported by Simon Josefsson in
6769         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6770
6771 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6772
6773         * time_r.c, time_r.h: New files.
6774
6775         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6776         __localtime_r.
6777         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6778         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6779
6780         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6781         __gmtime_r.
6782         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6783         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6784         Include <time_r.h>.
6785
6786         * timegm.c: Switch to glibc implementation, with the following changes:
6787         [defined HAVE_CONFIG_H]: Include <config.h>.
6788         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6789         (__mktime_internal) [!defined _LIBC]: New decl.
6790         (__gmtime_r) [!defined _LIBC]: New macro and function.
6791         (timegm): Use a prototype, since gnulib assumes C89.
6792         Do not bother declaring tmp to be const, as it's not really usefu.
6793         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6794         (timegm): Declare only if HAVE_DECL_TIMEGM.
6795
6796 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6797
6798         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6799         Bug reported by Lute Kamstra in
6800         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6801
6802         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6803         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6804         course with correspondingly smaller numbers for tomorrow and
6805         yesterday.  From Tadayoshi Funaba.  Originally installed into
6806         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6807         coreutils merge?).
6808
6809 2003-08-31  Simon Josefsson  <jas@extundo.com>
6810
6811         * timegm.h: New file.
6812         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6813
6814 2003-08-31  Karl Berry  <karl@gnu.org>
6815
6816         * argp.h: update from libc.
6817
6818 2003-08-28  Bruno Haible  <bruno@clisp.org>
6819
6820         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6821         warning on QNX, which defines O_BINARY to 000000.
6822
6823 2003-08-24  Bruno Haible  <bruno@clisp.org>
6824
6825         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6826         MSVC7 <stdio.h> is included later.
6827
6828 2003-08-20  Bruno Haible  <bruno@clisp.org>
6829
6830         * progname.h: New file, from GNU gettext.
6831         * progname.c: New file, from GNU gettext.
6832         * progreloc.c: New file, from GNU gettext.
6833
6834 2003-08-19  Bruno Haible  <bruno@clisp.org>
6835
6836         * xstrdup.c: Assume <string.h> exists.
6837
6838 2003-08-18  Jim Meyering  <jim@meyering.net>
6839
6840         * setenv.h: Indent nested cpp directive.
6841         * vasnprintf.c: Remove trailing blanks.
6842
6843 2003-08-17  Simon Josefsson  <jas@extundo.com>
6844             Bruno Haible  <bruno@clisp.org>
6845
6846         * xstrndup.h: New file.
6847         * xstrndup.c: New file.
6848
6849 2003-08-17  Bruno Haible  <bruno@clisp.org>
6850
6851         * strndup.h: New file.
6852
6853 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6854
6855         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6856         space, undoing this 2003-08-12 change:
6857         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6858
6859 2003-08-16  Jim Meyering  <jim@meyering.net>
6860
6861         Merge from coreutils.
6862         * xstrtoimax.c: #else #if -> #elif.
6863         * xstrtoumax.c: Likewise.
6864
6865 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6866
6867         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6868         rather than tab, after '#' in shell-script copyright notices.
6869         Suggested by Bruno Haible.
6870
6871 2003-08-15  Jim Meyering  <jim@meyering.net>
6872         and Paul Eggert  <eggert@twinsun.com>
6873
6874         Merge from coreutils.
6875         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6876         member but strut utmpx does not.  Needed for AIX 4.3.3.
6877         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6878
6879 2003-08-15  Jim Meyering  <jim@meyering.net>
6880
6881         Merge from coreutils.
6882         * xgethostname.c: Include <stdlib.h>.
6883         (xghostname): Don't exit for anything other than memory-related
6884         failure; just return NULL.
6885         * userspec.c: Include "posixver.h".
6886         (parse_user_spec): Accept `.' as a separator only
6887         in pre-POSIX-200112 mode.
6888         * strtoimax.c: Use #elif rather than #else #if.
6889         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6890         Remove function, now that we can rely on a working tzset function.
6891         [!_LIBC]: Ensure that the required autoconf test has been run.
6892         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6893         Use underlying_strftime for %r.
6894         * sha.c: Merge in some clean-up and optimization changes from glibc.
6895         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6896         Ensure that it is a multiple of 64.
6897         Rearrange loop exit tests so as to avoid performing an
6898         additional fread after encountering an error or EOF.
6899         * realloc.c: Update copyright date.
6900
6901 2003-08-14  Jim Meyering  <jim@meyering.net>
6902
6903         Merge from coreutils.
6904         * obstack.h: Whitespace changes.
6905         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6906         and xcalloc return values.
6907         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6908         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6909         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6910         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6911         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6912         error from mntctl.
6913         Use mntctl's return value to drive the entry-processing loop, since
6914         we can't rely on the value of the vmt_length member in the last
6915         entry.  On some systems doing so could result in exhausting
6916         virtual memory.  Based in part on a patch from Mike Jetzer.
6917
6918 2003-08-14  Jim Meyering  <jim@meyering.net>
6919         and Paul Eggert  <eggert@twinsun.com>
6920
6921         Merges from coreutils, plus other fixes.
6922         * physmem.c: Merge in portability changes from gcc/libiberty
6923         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6924         for credits and details.  Thanks to Kaveh Ghazi for helping
6925         to keep these files in sync.
6926         (ARRAY_SIZE): Define it.
6927         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6928         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6929         (memcasecmp): Don't assume size_t fits in unsigned int.
6930         Remove casts and duplicate code.
6931         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6932         (memcpy): Remove definition.
6933         Merge in some clean-up and optimization changes from glibc.
6934         [BLOCKSIZE]: Move definition to top of file.
6935         Ensure that it is a multiple of 64.
6936         Rearrange loop exit tests so as to avoid performing an
6937         additional fread after encountering an error or EOF.
6938         * md5.h (md5_uintptr): Define.
6939         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6940         return to the initial working directory.  Preserve errno
6941         for caller.
6942         * idcache.c: Include "xalloc.h".
6943         (xmalloc, xrealloc): Remove decls.
6944         (getuser): Remove casts no longer required in C89.
6945         * human.c: Include stdio.h, for sprintf.
6946         * group-member.c: Include "xalloc.h".
6947         (xmalloc, xrealloc): Remove decls.
6948         (get_group_info): Remove casts no longer required in C89.
6949         * getusershell.c (readname): Remove casts no longer required in C89.
6950         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6951         * getline.c: Whitespace fix, from coreutils.
6952
6953 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6954
6955         * exclude.c: Include <ctype.h>
6956         (IN_CTYPE_DOMAIN): New macro.
6957         (is_space): New fn.
6958         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6959         and empty lines.
6960
6961         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6962         Undo previous (whitespace-only) change.
6963
6964 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6965
6966         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6967         Normalize leading white space and remove trailing white space.
6968         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6969         notice, as per ../config/srclist-update.
6970
6971         Merge from coreutils.
6972         * euidaccess.h: New file.
6973         * euidaccess.c: Include it.
6974         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6975         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6976         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6977
6978 2003-08-11  Bruno Haible  <bruno@clisp.org>
6979
6980         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6981         (vasnprintf): Use it instead of wcslen.
6982
6983 2003-08-11  Bruno Haible  <bruno@clisp.org>
6984
6985         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6986         value to ensure that _Bool promotes to int. Use #define for _Bool when
6987         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6988
6989 2003-08-10  Karl Berry  <karl@gnu.org>
6990
6991         * regex.h: update from libc (whitespace fix).
6992
6993 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6994
6995         Merge some files from coreutils.  These changes were
6996         originally made by Jim Meyering.
6997         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6998         many older Unixes require this.
6999         * alloca.c (alloca): Remove cast to argument of free;
7000         no longer needed in C89.
7001         * alloca_.h, regex.h: Fix white space to match
7002         what GNU indent does.
7003
7004 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7005
7006         * bumpalloc.h: Remove.
7007
7008 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7009
7010         * getloadavg.c: Change copyright notice and spacing to conform to
7011         GNU coding style.
7012
7013         Merge from coreutils.
7014         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7015         From glibc.
7016         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7017         from Karl Berry, implemented by Jim Meyering.
7018         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7019         from Dmitry V. Levin.
7020         Remove anachronistic cast of xrealloc.
7021         * fnmatch_.h (__const): Remove.  Use 'const'.
7022         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7023         type. Otherwise, it wouldn't compile with at least /bin/cc on
7024         ymp-cray-unicos9.0.2.X.
7025         Combine two mostly-identical uses of alloca into one.
7026         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7027
7028 2003-08-04  Dave Love <d.love@dl.ac.uk>
7029
7030         [From Emacs.]
7031
7032         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7033         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7034         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7035         obsolete NLIST_NAME_UNION.
7036         [__GNU__]: Undef BSD and FSCALE.
7037         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7038
7039 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7040
7041         * stdbool_.h (_Bool): Make it signed char, instead of
7042         an enum type, so that it's guaranteed to promote to int.  See:
7043         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7044
7045 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7046
7047         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7048         (strerror): Don't assume that a printable int fits in 14 bytes.
7049
7050 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7051             Bruno Haible  <bruno@clisp.org>
7052
7053         * getline.h (getline, getdelim): Change return type to ssize_t.
7054         * getline.c (getline, getdelim): Likewise.
7055         Remove _GNU_SOURCE define; now it's defined in config.h through
7056         m4/getline.m4.
7057
7058 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7059
7060         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7061         over-parenthesization in macros.
7062
7063         Sync with coreutils.
7064
7065         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7066         required by C99.
7067
7068         Use `exit_failure' for xalloc and xmemcoll instead of their own
7069         private exit-failure variables.
7070         * xalloc.h (xalloc_exit_failure): Remove.
7071         * xmalloc.c: Likewise.  Include exitfail.h.
7072         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7073         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7074         * xmemcoll.c: Likewise.  Include exitfail.h.
7075         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7076
7077 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7078
7079         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7080         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7081         to test that it can stand by itself.  Include "exitfail.h".
7082         Clients should set exit_failure instead.
7083         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7084
7085 2003-07-18  Andreas Schwab  <schwab@suse.de>
7086
7087         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7088
7089 2003-07-18  Bruno Haible  <bruno@clisp.org>
7090
7091         * getndelim2.h: New file.
7092         * getndelim2.c: Make into a module of its own. Include config.h,
7093         getndelim2.h.
7094         (getndelim2): Make non-static. Change return type to ssize_t.
7095         * getline.h: Change argument names.
7096         * getline.c: Include getndelim2.h instead of getndelim2.c.
7097         * getnline.c: Include getndelim2.h.
7098
7099 2003-07-17  Bruno Haible  <bruno@clisp.org>
7100
7101         * Makefile.am: Remove file.
7102         * Makefile.in: Remove file.
7103
7104 2003-07-17  Bruno Haible  <bruno@clisp.org>
7105
7106         * getnline.h: New file.
7107         * getnline.c: New file.
7108         * getndelim2.c: New file, extracted from getline.c.
7109         (getndelim2): Renamed from getdelim2, with added nmax argument.
7110         * getline.c: Include getndelim2.c.
7111         (getdelim2): Moved out to getndelim2.c.
7112         (getline, getdelim): Update.
7113
7114 2003-07-15    <karl@gnu.org>
7115
7116         * vasnprintf.c: update from gettext.
7117
7118 2003-07-15  Jim Meyering  <jim@meyering.net>
7119
7120         * makepath.c (make_path): Enclose diagnostic in _(...).
7121
7122 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7123
7124         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7125         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7126         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7127         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7128         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7129         updated automatically by ../config/srclist-update.  This changes
7130         their license from LPGL to GPL.
7131
7132 2003-07-14  Jim Meyering  <jim@meyering.net>
7133
7134         Don't emit diagnostics.  Let callers do that.
7135         * save-cwd.c: Don't include "error.h".
7136         (save_cwd): Don't call error.  Ensure that errno is valid
7137         when returning nonzero.
7138
7139         * save-cwd.h (restore_cwd): Update prototype.
7140         * save-cwd.c (restore_cwd): Remove two parameters.
7141         Simplify.  Don't call error upon failure.  Let callers do that.
7142         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7143         when auditing is enabled.  But don't bother updating the #if.
7144
7145 2003-07-14  Simon Josefsson  <jas@extundo.com>
7146
7147         * mempcpy.h: New file.
7148         * mempcpy.c: New file.
7149
7150 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7151
7152         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7153         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7154         unicodeio.c, unicodeio.h, unlocked-io.h:
7155         Switch from LGPL to GPL.
7156
7157 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7158
7159         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7160         it breaks C++ compilation.
7161         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7162
7163 2003-07-10  Jim Meyering  <jim@meyering.net>
7164
7165         * vasnprintf.c: Remove trailing blanks.
7166         Make cpp indentation consistent.
7167
7168 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7169
7170         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7171         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7172         Switch from LGPL to GPL.
7173
7174 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7175
7176         * mktime.c: Fix some boundary cases and remove need for floating point.
7177
7178         Issue a compile-time diagnostic if time_t is floating point, or if
7179         two's complement arithmetic is not in effect, or if arithmetic
7180         right shift does not propagate the sign.  These assumptions were
7181         all in the original code but they weren't checked.
7182
7183         (TIME_T_MIDPOINT, verify): New macros.
7184         (__isleap): Remove; it has integer overflow problems.
7185         (leapyear): New function, without those problems.
7186         (ydhms_tm_diff): Remove; splitting into two parts.
7187         (ydhms_diff): New function, containing the arithmetic part of
7188         the old ydhms_tm_diff function.  Issue a compile-time
7189         diagnostic if we are not using C99 integer division.
7190         Avoid casts when possible.
7191         (guess_time_tm): New function, containing the checking part of
7192         the old ydhms_tm_diff function.  Return the new value, rather than
7193         the difference between it and the old.  Accept a new argument T
7194         so that *T specifies the old value.  Check for overflow in the result.
7195
7196         (__mktime_internal): Use a time_t offset, not a long int offset.
7197         This undoes the 2003-06-04 change, which is no longer needed now
7198         that we have better overflow checking.
7199         (localtime_offset): Likewise.
7200
7201         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7202         and long are 64-bit but int is only 32-bit.
7203         (ydhms_diff): Use long int to store year1 and yday1.
7204         Issue a compile-time diagnostic if long int is not wide enough.
7205
7206         (__mktime_internal): Use long int to store adjusted year and yday.
7207         Use plain C rather than preprocessor commands, if that doesn't
7208         affect efficiency.
7209         Check for overflow (and try to repair) after each probe
7210         rather than checking only at the very end.  This avoids some bugs
7211         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7212         does not equal GMT offset at maximum time).
7213         Use integer to check for overflow rather than floating point; this
7214         is more portable to non-IEEE hosts, and is a tad faster.
7215         When we detect that we are oscillating between two values,
7216         don't check whether tm_isdst has the requested value, since
7217         we already know the answer.  When tm_isdst has the wrong value,
7218         use a different heuristic to find the right one, based on the
7219         extreme values actually observed in practice in tz2003a,
7220         rather than the (overly optimistic) "previous 3 calendar quarters".
7221
7222         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7223         "T const" to accommodate glibc style.
7224         (check_result): Use less-confusing report format.  "long" -> "long int.
7225         (main): Likewise.
7226         Don't loop if the iteration overflows time_t.
7227         Allow a negative step in the iteration.
7228
7229 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7230
7231         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7232         having it depend on HAVE_SYS_TYPES_H.
7233
7234 2003-06-25  Bruno Haible  <bruno@clisp.org>
7235
7236         * readlink.c: New file.
7237
7238 2003-06-20  Bruno Haible  <bruno@clisp.org>
7239
7240         Assume C89, so PARAMS isn't needed.
7241         * unicodeio.h (PARAMS): Remove.
7242         * unicodeio.c: Don't use PARAMS.
7243
7244 2003-06-18  Jim Meyering  <jim@meyering.net>
7245
7246         Merge changes from coreutils.
7247         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7248         Remove explicit declarations of xmalloc and realloc.
7249         Include xalloc.h.
7250         (read_utmp): Remove anachronistic cast of xmalloc.
7251
7252 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7253
7254         Assume C89, so PARAMS isn't needed.
7255         * backupfile.h (PARAMS): Remove.  All uses removed.
7256         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7257         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7258         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7259         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7260         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7261         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7262         xstrtol.h: Likewise.
7263         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7264         same.h, strverscmp.h: Do not include config.h; no longer needed.
7265         Anyway, config.h should always be included before any other file.
7266
7267 2003-06-11  Simon Josefsson  <jas@extundo.com>
7268
7269         * sysexit_.h: New file.
7270
7271 2003-05-20  Derek Price  <derek@ximbiot.com>
7272
7273         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7274
7275 2003-06-10  Simon Josefsson  <jas@extundo.com>
7276
7277         * strchrnul.h: New file.
7278         * strchrnul.c: New file.
7279
7280 2003-06-10  Simon Josefsson <jas@extundo.com>
7281
7282         * argp.h: New file, from glibc.
7283         * argp-ba.c: New file, from glibc.
7284         * argp-eexst.c: New file, from glibc.
7285         * argp-fmtstream.c: New file, from glibc.
7286         * argp-fmtstream.h: New file, from glibc.
7287         * argp-fs-xinl.c: New file, from glibc.
7288         * argp-help.c: New file, from glibc.
7289         * argp-namefrob.h: New file, from glibc.
7290         * argp-parse.c: New file, from glibc.
7291         * argp-pv.c: New file, from glibc.
7292         * argp-pvh.c: New file, from glibc.
7293         * argp-xinl.c: New file, from glibc.
7294
7295 2003-06-07  Jim Meyering  <jim@meyering.net>
7296
7297         * readtokens.h: Put `Free Software Foundation, Inc.'
7298         in place of my name in the copyright comment.
7299         Remove definition and uses of __P.
7300
7301         From coreutils.
7302         * stat.c: Don't declare xmalloc explicitly.
7303         Instead, include "xalloc.h".
7304         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7305         xrealloc, and xcalloc return values.
7306         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7307         Improve comment.
7308         * xgetcwd.h: Remove definition/uses of PARAMS.
7309
7310 2003-06-06  Jim Meyering  <jim@meyering.net>
7311
7312         * stdbool_.h: Renamed from stdbool.h.in.
7313
7314 2003-06-06  Jim Meyering  <jim@meyering.net>
7315
7316         Merge from coreutils.
7317         * same.c: (same_name): Declare *_basename locals to be `const'.
7318         Consolidate declarations and initializations of *_base* locals.
7319
7320         Merge from coreutils.
7321         This avoids a core dump on systems without GNU putenv,
7322         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7323         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7324         (unsetenv): New static function, from GNU libc.
7325         (rpl_putenv): Use it.
7326
7327         * modechange.c: Remove trailing blanks.
7328
7329         Merge from coreutils.
7330         * fsusage.c: Remove declaration of statfs.
7331         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7332
7333         * posixtm.c: Include <stdbool.h> unconditionally.
7334
7335 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7336
7337         * mktime.c (__mktime_internal): When resolving a tm_isdst
7338         mismatch, look in future quarters as well as past.  This fixes a
7339         bug when processing fall-backwards gaps immediately after a long
7340         period of daylight-saving time.
7341
7342         * mktime.c: Assume freestanding C89 or better.
7343         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7344         (__P): Remove; not used.
7345         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7346         (mktime, not_equal_tm, print_tm, check_result,
7347         main): Use prototypes.  Use const * where appropriate.
7348         (main): Fix typo in testing code that uncovered by above changes.
7349         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7350
7351 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7352
7353         * mktime.c: Fix Debian bug 177940
7354         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7355         (localtime_offset): Now long int, not time_t, because we want it
7356         to be guaranteed to be signed.  All uses changed.
7357         (__mktime_internal): If overflow would occur when adding offset,
7358         don't add it.
7359
7360         Merge 'human' changes from coreutils.  Rewrite to support
7361         locale-specific notations like thousands separators.
7362         * human.c: Simplify authorship notice.
7363         Include human.h immediately after config.h.
7364         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7365         <limits.h>: Do not include, since human.h does.
7366         (SIZE_MAX, UINTMAX_MAX): New macros.
7367         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7368         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7369         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7370         (power_letter): Renamed from suffixes.
7371         (generate_suffix_backwards): Remove.
7372         (adjust_value): Now takes int style (because of human.h changes)
7373         and long double value (for greater precision on some platforms).
7374         (group_number): New function.
7375         (human_readable): Use it.  Use integer options, not enum.
7376         Put the options before the sizes in the arg list.
7377         Support all the new options.
7378         The old human_readable function has been removed;
7379         use inttostr.h instead.
7380         (human_readable, default_block_size, humblock):
7381         Use uintmax_t, not int, for block sizes.
7382         (human_readable_inexact, block_size_types): Remove.
7383         (block_size_opts): New constant.
7384         (human_options): Renamed from human_block_size, with new signature
7385         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7386         * human.h: Add copyright and authorship notice.
7387         Include <limits.h> and <stdbool.h> unconditionally.
7388         (PARAMS): Remove.  All uses removed.
7389         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7390         (enum human_inexact_style): Remove tag; now a nameless enum.
7391         (human_floor, human_ceiling, human_round_to_even): Now have
7392         values 2, 0, 1 rather than -1, 1, 0.
7393         (human_group_digits, human_suppress_point_zero, human_autoscale,
7394         human_base_1024, human_SI, human_B): New constants.
7395         (human_readable_inexact, human_block_size): Remove.
7396         (human_readable): Size args are now uintmax_t, not int.
7397         (human_options): New decl.
7398
7399         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7400         unnecessary now that we assume C89 or better.  This change
7401         imported from coreutils.
7402
7403         * mktime.c (__mktime_internal): Do not reject negative timestamps
7404         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7405         in the 2003-05-30 sync from glibc.
7406
7407         .h files should stand alone, but we shouldn't include <sys/types.h>
7408         if we can get away with just <stddef.h>.
7409
7410         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7411         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7412         rather than <sys/types.h>, as we merely need size_t.
7413         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7414         to get size_t.
7415         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7416         Include <stdio.h>, to get FILE.
7417         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7418         memcasecmp.h has included <stddef.h> and all we need is size_t.
7419         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7420         our interface, instead of including <sys/types.h>
7421
7422 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7423
7424         [from coreutils]
7425         Fix some minor time-related bugs with POSIX time arguments.
7426         Some valid time stamps were being rejected (notably -1, and
7427         time stamps before 1900 on 64-bit hosts).  And some invalid
7428         time stamps were being accepted, e.g. September 31.
7429
7430         * posixtm.h (posixtime): Return bool instead of time_t, so
7431         that we can return (time_t) -1 successfully.
7432         * posixtm.c: Likewise.
7433         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7434         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7435         (t): Remove static var.
7436         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7437         of static var.  All uses changed.
7438         (year): Do not reject years before 1900; they can occur with
7439         64-bit time_t.
7440         (posix_time_parse): Do not check for out-of-range components;
7441         that is now the caller's responsibility, since our checks were
7442         only approximations.
7443         (posixtime): Use mktime to check for out-of-range components,
7444         since it knows them exactly.
7445         If mktime returns (time_t) -1, check whether an error actually occurred
7446         by invoking localtime on -1.
7447         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7448         posixtime failures better.
7449         Improve the test data (in comments only).
7450
7451 2003-05-30    <karl@gnu.org>
7452
7453         * mktime.c: update from libc.
7454
7455 2003-05-30  Bruno Haible  <bruno@clisp.org>
7456
7457         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7458         * localcharset.h: Likewise.
7459         * localcharset.c: Likewise.
7460
7461 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7462
7463         Assume the headers required for C89 freestanding compilers.
7464         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7465         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7466         without checking for HAVE_LIMITS_H.
7467         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7468         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7469         to do that.
7470         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7471         * exclude.c: Include <stdbool.h> unconditionally.
7472         * tempname.c: Include <stddef.h> unconditionally.
7473         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7474         * modechange.c, rpmatch.c (NULL): Don't define, since
7475         <stddef.h> does that.
7476         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7477         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7478         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7479         * xstrtol.c: Likewise.
7480         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7481         * savedir.c: Include <stddef.h> instead of defining NULL.
7482
7483         * addext.c (addext): Use assignment rather than cast, to avoid
7484         warnings on some platforms.
7485
7486         * mktime.c (__mktime_internal): Do not reject negative timestamps
7487         arbitrarily.
7488
7489 2003-05-10  Bruno Haible  <bruno@clisp.org>
7490
7491         * linebreak.c (iconv_string_length): Don't return -1 just because the
7492         string is longer than 4 KB.
7493
7494 2003-05-12  Jim Meyering  <jim@meyering.net>
7495
7496         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7497         the space-padded-by-default conversion specifiers, %e, %k, %l.
7498
7499 2003-05-03  Bruno Haible  <bruno@clisp.org>
7500
7501         Upgrade to Unicode-4.0.
7502         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7503         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7504         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7505         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7506         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7507         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7508         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7509         Change width of U+E0100..U+E01EF from 1 to 0.
7510
7511 2003-04-25  Bruno Haible  <bruno@clisp.org>
7512
7513         * copy-file.c: Include <stddef.h>, for size_t.
7514
7515 2003-04-25  Jim Meyering  <jim@meyering.net>
7516
7517         * copy-file.c (copy_file_preserving): Declare buf_size to be
7518         of type size_t, not int.
7519
7520 2003-04-11  Jim Meyering  <jim@meyering.net>
7521
7522         Merge changes from Coreutils.
7523
7524         2003-03-22  Jim Meyering  <jim@meyering.net>
7525
7526         * strftime.c (widen): Cast alloca return value to proper type.
7527
7528         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7529
7530         From GNU libc.
7531         * strftime.c (my_strftime): Handle very large width
7532         specifications for numeric values correctly.  Improve checks for
7533         overflow.
7534
7535         2003-01-19  Jim Meyering  <jim@meyering.net>
7536
7537         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7538         (nl_get_alt_digit) [! defined my_strftime]: Define.
7539         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7540         _nl_get_alt_digit and _nl_get_walt_digit.
7541
7542         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7543         These changes have no effect outside of _LIBC.
7544
7545 2003-04-10  Bruno Haible  <bruno@clisp.org>
7546
7547         * findprog.h: New file, from GNU gettext.
7548         * findprog.c: New file, from GNU gettext.
7549
7550 2003-04-05  Jim Meyering  <jim@meyering.net>
7551
7552         Merge changes from Coreutils.
7553
7554         * exclude.h (PARAMS): Remove definition and uses.
7555         * exclude.c: Remove uses of `PARAMS'.
7556
7557         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7558         Add test-cases for DOS filenames. Declare program_name.
7559         (main): Set up program_name.  Patch by Rich Dawe.
7560
7561         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7562         error from mntctl.
7563         Use mntctl's return value to drive the entry-processing loop, since
7564         we can't rely on the value of the vmt_length member in the last
7565         entry.  On some systems doing so could result in exhausting
7566         virtual memory.  Based in part on a patch from Mike Jetzer.
7567
7568 2003-04-04  Bruno Haible  <bruno@clisp.org>
7569
7570         * linebreak.h: New file, from GNU gettext.
7571         * linebreak.c: New file, from GNU gettext with slight modifications.
7572         * lbrkprop.h: New file, from GNU gettext.
7573
7574 2003-04-03  Bruno Haible  <bruno@clisp.org>
7575
7576         * utf8-ucs4.h: New file, from GNU gettext.
7577         * utf16-ucs4.h: New file, from GNU gettext.
7578         * ucs4-utf8.h: New file, from GNU gettext.
7579         * ucs4-utf16.h: New file, from GNU gettext.
7580
7581 2003-04-02  Bruno Haible  <bruno@clisp.org>
7582
7583         * binary-io.h: New file, from GNU gettext.
7584
7585 2003-04-01  Bruno Haible  <bruno@clisp.org>
7586
7587         * pathname.h: New file, from GNU gettext.
7588         * concatpath.c: New file, from GNU gettext.
7589
7590 2003-03-30  Bruno Haible  <bruno@clisp.org>
7591
7592         * copy-file.c (copy_file_preserving): Don't set owner if the function
7593         chown() doesn't exist.
7594
7595 2003-03-28  Bruno Haible  <bruno@clisp.org>
7596
7597         * copy-file.h: New file, from GNU gettext.
7598         * copy-file.c: New file, from GNU gettext.
7599
7600 2003-03-18  Jim Meyering  <jim@meyering.net>
7601
7602         * quote.c (quote_n): Fix typo in comment.
7603
7604 2003-03-14  Jim Meyering  <jim@meyering.net>
7605
7606         Merge changes from Coreutils.
7607         * obstack.h (obstack_object_size): Declare temporary, __o,
7608         to be const, in order to avoid warnings.
7609         (obstack_room): Likewise.
7610         (obstack_empty_p): Likewise.
7611
7612 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7613
7614         Merge changes from Bison.
7615         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7616         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7617         when compiling Bison 1.875's `bitset bset = obstack_alloc
7618         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7619         * hash.c: Include <stdbool.h> unconditionally.
7620
7621 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7622
7623         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7624         Reported by Bruce Becker; see:
7625         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7626
7627 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7628             Bruno Haible  <bruno@clisp.org>
7629
7630         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7631         Reported by John Hughes, see
7632         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7633
7634 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7635
7636         * poll_.h: New file.
7637         * poll.c: New file.
7638
7639 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7640
7641         * mathl.h: New file.
7642         * acosl.c: New file.
7643         * asinl.c: New file.
7644         * atanl.c: New file.
7645         * ceill.c: New file.
7646         * cosl.c: New file.
7647         * expl.c: New file.
7648         * floorl.c: New file.
7649         * frexpl.c: New file.
7650         * ldexpl.c: New file.
7651         * logl.c: New file.
7652         * sincosl.c: New file.
7653         * sinl.c: New file.
7654         * sqrtl.c: New file.
7655         * tanl.c: New file.
7656         * trigl.c: New file.
7657         * trigl.h: New file.
7658
7659 2003-02-17  Bruno Haible  <bruno@clisp.org>
7660
7661         * mkdtemp.h: New file, from GNU gettext.
7662         * mkdtemp.c: New file, from GNU gettext.
7663
7664 2003-01-31  Bruno Haible  <bruno@clisp.org>
7665
7666         * rename.c: #undef rename before defining rpl_rename.
7667         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7668
7669 2003-01-30  Bruno Haible  <bruno@clisp.org>
7670
7671         * printf-args.h: New file, from GNU gettext.
7672         * printf-args.c: New file, from GNU gettext.
7673         * printf-parse.h: New file, from GNU gettext.
7674         * printf-parse.c: New file, from GNU gettext.
7675         * vasnprintf.h: New file, from GNU gettext.
7676         * vasnprintf.c: New file, from GNU gettext.
7677         * asnprintf.c: New file, from GNU gettext.
7678         * vasprintf.h: New file, from GNU gettext with modifications.
7679         * vasprintf.c: New file, from GNU gettext.
7680         * asprintf.c: New file, from GNU gettext.
7681
7682 2003-01-29  Bruno Haible  <bruno@clisp.org>
7683
7684         * stpncpy.h: New file, from GNU gettext with modifications.
7685         * stpncpy.c: New file, from GNU gettext with modifications.
7686
7687 2003-01-28  Bruno Haible  <bruno@clisp.org>
7688
7689         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7690         Paul Eggert.
7691         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7692         Paul Eggert.
7693
7694 2003-01-27  Bruno Haible  <bruno@clisp.org>
7695
7696         * xsetenv.h: New file, from GNU gettext.
7697         * xsetenv.c: New file, from GNU gettext.
7698
7699 2003-01-23  Bruno Haible  <bruno@clisp.org>
7700
7701         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7702
7703 2003-01-22  Bruno Haible  <bruno@clisp.org>
7704
7705         * exit.h: New file, from GNU gettext.
7706
7707 2003-01-11  Bruno Haible  <bruno@clisp.org>
7708
7709         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7710         * strcase.h (strcasecmp, strncasecmp): Likewise.
7711
7712 2003-01-14  Jim Meyering  <jim@meyering.net>
7713
7714         * same.c (same_name): Tweak a comment.
7715
7716 2003-01-11  Bruno Haible  <bruno@clisp.org>
7717
7718         * same.c (same_name): Reorder tests so as to avoid calling stat()
7719         when a string comparison is sufficient.
7720
7721 2003-01-11  Bruno Haible  <bruno@clisp.org>
7722
7723         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7724         'unsigned int'.
7725
7726 2003-01-11  Bruno Haible  <bruno@clisp.org>
7727
7728         * hash-pjw.c: Add comment about low quality of this function.
7729
7730 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7731
7732         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7733         to avoid collisions with libcurses and libreadline.
7734
7735         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7736         * getstr.h, getstr.c: Remove.
7737         * getline.c: Include "getline.h", to check interface.
7738         Move body of old getstr.c here: this defines MIN_CHUNK and
7739         declares getdelim2, which is renamed from getstr.
7740         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7741
7742         * linebuffer.c (readlinebuffer): Renamed from readline.
7743         All uses changed.
7744         * linebuffer.h: Likewise.
7745         (readline): Remove backward-compatibility macro.
7746
7747 2003-01-12  Jim Meyering  <jim@meyering.net>
7748
7749         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7750
7751 2003-01-10  Bruno Haible  <bruno@clisp.org>
7752
7753         * alloca_.h: New file.
7754         * getdate.y: Unconditionally include alloca.h.
7755         * makepath.c: Likewise.
7756         * setenv.c: Likewise.
7757         * userspec.c: Likewise.
7758
7759 2003-01-09  Bruno Haible  <bruno@clisp.org>
7760
7761         * stdbool.h.in: New file.
7762
7763 2003-01-08  Bruno Haible  <bruno@clisp.org>
7764
7765         * safe-read.c: Include specification header first, to ensure its
7766         selfcontainedness.
7767         * full-write.c: Likewise.
7768
7769 2003-01-08  Jim Meyering  <jim@meyering.net>
7770
7771         * full-write.c: Undefine and define-away `const' after inclusion
7772         of errno.h, not before.  Suggestion from Bruno Haible.
7773
7774 2003-01-07  Jim Meyering  <jim@meyering.net>
7775
7776         * full-write.c: Rework so that it may serve to define full_read, too.
7777         * full-read.c: Simply #define FULL_READ and include full-write.c.
7778
7779 2003-01-06  Jim Meyering  <jim@meyering.net>
7780
7781         * version-etc.c: Update year in translatable copyright string.
7782
7783 2002-12-25  Bruno Haible  <bruno@clisp.org>
7784
7785         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7786         * xstrtol.h: Likewise.
7787         * xstrtoimax.c: Likewise.
7788         * xstrtoumax.c: Likewise.
7789         * human.h: Likewise.
7790
7791         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7792         on systems that have <inttypes.h> but not <stdint.h>.
7793
7794 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7795
7796         * memcoll.c (memcoll): Fall back on a simple algorithm using
7797         memcmp if strcoll doesn't work.
7798
7799 2002-12-23  Bruno Haible  <bruno@clisp.org>
7800
7801         * localcharset.h: New file.
7802         * localcharset.c: Include it.
7803         * unicodeio.c: Likewise.
7804
7805 2002-12-22  Bruno Haible  <bruno@clisp.org>
7806
7807         * utime.c (utime_null): No need to call ftruncate if the file was
7808         nonempty.
7809
7810 2002-12-23  Bruno Haible  <bruno@clisp.org>
7811
7812         * memcoll.c (STRCOLL): New macro.
7813         (memcoll): Use it.
7814
7815 2002-12-22  Bruno Haible  <bruno@clisp.org>
7816
7817         * getstr.h (getstr): Define, to avoid clash with libcurses.
7818         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7819
7820 2002-12-22  Bruno Haible  <bruno@clisp.org>
7821
7822         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7823
7824 2002-12-23  Bruno Haible  <bruno@clisp.org>
7825
7826         * getline.h: Include <stddef.h>, for size_t.
7827
7828         * unicodeio.h: Include <stddef.h>, for size_t.
7829         * unicodeio.c: Don't include <stddef.h>.
7830
7831 2002-12-17  Bruno Haible  <bruno@clisp.org>
7832
7833         * canon-host.c (strdup): Remove unused declaration.
7834
7835         * fsusage.c: Include full_read.h.
7836         (get_fs_usage): Use full_read instead of safe_read.
7837
7838         * utime.c (utime_null): Use SAFE_READ_ERROR.
7839
7840 2002-12-11  Bruno Haible  <bruno@clisp.org>
7841
7842         * setenv.h: Rewritten to cope with systems that have setenv() but not
7843         unsetenv().
7844         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7845         modifications:
7846
7847         2002-12-11  Bruno Haible  <bruno@clisp.org>
7848
7849                 * setenv.c (alloca): Fall back to malloc.
7850                 (freea): New macro.
7851                 (setenv): Use freea() to free memory allocated with alloca().
7852
7853         2002-11-13  Bruno Haible  <bruno@clisp.org>
7854
7855                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7856                 function declarations.
7857                 * unsetenv.c (unsetenv): Likewise.
7858
7859         2002-03-04  Bruno Haible  <bruno@clisp.org>
7860
7861                 Portability to AIX 4.3.3.
7862                 * unsetenv.c: New file, extracted from setenv.c.
7863                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7864
7865         2001-12-20  Bruno Haible  <bruno@clisp.org>
7866
7867                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7868                 use malloc instead. For SunOS 4.
7869
7870         2001-12-11  Bruno Haible  <bruno@clisp.org>
7871
7872                 * setenv.c: Declare alloca.
7873                 (compar_fn_t): New typedef.
7874                 (KNOWN_VALUE, STORE_VALUE): Use it.
7875
7876         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7877         setenv.h.
7878
7879 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7880
7881         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7882         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7883         Choose values that are less likely to collide with system fnmatch
7884         options.
7885         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7886         defined (e.g., a pure POSIX system).
7887         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7888         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7889
7890 2002-12-06  Jim Meyering  <jim@meyering.net>
7891
7892         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7893
7894         Merge in changes from libc's misc/error.c, in preparation
7895         for the merge of gnulib's changes back into libc.
7896
7897         * error.c (_): Define only if not already defined.
7898         Move definition to follow all #include directives.
7899         Include unlocked-io.h only if !_LIBC.
7900         [_LIBC]: Include <libio/libioP.h>.
7901         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7902         (fflush): Tweak definition to use INTUSE.
7903         (putc): Define.
7904
7905 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7906
7907         * alloca.c [defined emacs]: Include "lisp.h".
7908         (xalloc_die) [defined emacs]: New macro.
7909         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7910         [! defined emacs]: Include <xalloc.h>.
7911         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7912         (pointer): Typedef to POINTER_TYPE *.
7913         (malloc): Remove decl; we now always use xmalloc.
7914         (alloca): Use old-style definition, since Emacs needs this.
7915         Check for arithmetic overflow when computing combined size.
7916
7917 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7918
7919         Do not generate unlocked-io.h automatically, since it's easier to
7920         maintain it by hand.
7921
7922         * unlocked-io.h: New file, from GNU diffutils,
7923         but with proper copyright notice and attribution.
7924         * gen-uio: Remove.
7925         * Makefile.am: Add copyright notice.
7926         (libfetish_a_SOURCES): Add unlocked-io.h.
7927         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7928         (DISTCLEANFILES, io_functions): Remove macros.
7929         (EXTRA_DIST): Remove gen_uio.
7930         (unlocked-io.h): Remove rule.
7931
7932 2002-12-04  Jim Meyering  <jim@meyering.net>
7933
7934         Reflect the fact that stat.c and lstat.c are no longer generated.
7935         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7936         (DISTCLEANFILES): Likewise.
7937         (EXTRA_DIST): Likewise.
7938         (all_local): Don't depend on stat.c or lstat.c.
7939         (stat.c, lstat.c): Remove rules.
7940         (EXTRA_DIST): Remove xstat.in.
7941
7942         * xstat.in: Remove file.  Contents moved into stat.c.
7943         * stat.c: New file.  Contents mostly from xstat.in.
7944         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7945         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7946
7947         * safe-read.c: Rework so that it may serve to define safe_write, too.
7948         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7949
7950 2002-12-03  Jim Meyering  <jim@meyering.net>
7951
7952         * safe-read.c, safe-write.c: Change variable names and comments, but
7953         not semantics, to minimize the differences between these two files.
7954         (safe_read): Change comment to mention SAFE_READ_ERROR.
7955
7956         * safe-read.c (IS_EINTR): Define.
7957         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7958
7959 2002-12-02  Bruno Haible  <bruno@clisp.org>
7960
7961         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7962         Define, taken from safe-read.c.
7963         (INT_MAX): Provide fallback.
7964         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7965         * safe-write.h (SAFE_WRITE_ERROR): Define.
7966
7967         * safe-read.c (EINTR): Remove definition.
7968         (safe_read): Don't use EINTR if it is absent.
7969
7970 2002-12-02  Jim Meyering  <jim@meyering.net>
7971
7972         * safe-read.c (EINTR): Define.
7973         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7974         (INT_MAX): Provide fallback.
7975         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7976
7977         * safe-read.h (SAFE_READ_ERROR): Define.
7978
7979 2002-12-01  Jim Meyering  <jim@meyering.net>
7980
7981         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7982         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7983
7984 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7985
7986         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7987         hash_rehash): Replace `if (limit <= value) abort ();' with
7988         `if (! (value < limit)) abort ();', for readability.
7989
7990 2002-11-26    <karl@gnu.org>
7991
7992         * strdup.c: copy from libc again, with jim's ok.
7993         * .cppi-disable: re-add strdup.c
7994
7995 2002-11-25    <karl@gnu.org>
7996
7997         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7998         instead of "strtol.c".
7999
8000 2002-11-25  Jim Meyering  <jim@meyering.net>
8001
8002         * mktime.c: Sync from libc, now that it has the latest fix.
8003
8004 2002-11-24    <karl@gnu.org>
8005
8006         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8007         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8008
8009 2002-11-24  Jim Meyering  <jim@meyering.net>
8010
8011         Update from coreutils:
8012
8013         * mktime.c: Merge in changes from libc.
8014
8015         Avoid a link-time failure on some Linux systems.
8016         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8017         (__mon_yday): Declare with the STATIC attribute.
8018         (__mktime_internal): Likewise.
8019         Based on a report from Greg Schafer.
8020
8021 2002-11-23  Jim Meyering  <jim@meyering.net>
8022
8023         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8024         Use `unsigned', not `int', as type of index.
8025
8026         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8027
8028         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8029
8030 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8031
8032         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8033         hint that one should use `if (! x) abort ();' rather than `assert
8034         (x);', and anyway it's one less thing to worry about configuring.
8035         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8036         hash_rehash, hash_insert): Use abort rather than assert.
8037
8038 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8039
8040         * quotearg.h: Allow multiple inclusion by surrounding with
8041         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8042         so that we can be included first.
8043         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8044         * quotearg.c: Include quotearg.h immediately after config.h.
8045         No need to include stddef.h or sys/types.h any more.
8046         Surround local include files with "", not "<>".
8047         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8048         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8049         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8050         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8051         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8052         (ISPRINT): Remove; no longer needed now that we assume C89.
8053
8054         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8055         Preserve errno.
8056
8057         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8058         quotearg_char): Use SIZE_MAX rather than
8059         (size_t) -1 when we are talking about "infinity".
8060
8061         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8062
8063 2002-11-22  Bruno Haible  <bruno@clisp.org>
8064
8065         * safe-read.h: Assume C89. Add comments.
8066         (safe_read): Change return type to size_t.
8067         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8068         counts > SSIZE_MAX correctly.
8069         * safe-write.h: New file.
8070         * safe-write.c: New file.
8071         * full-read.h: New file.
8072         * full-read.c: New file.
8073         * full-write.h: Assume C89. Add comments.
8074         * full-write.c: Include safe-write.h.
8075         (full_write): Rewritten to use safe_write.
8076         Suggested by Jim Meyering and Paul Eggert.
8077
8078 2002-11-21  Bruno Haible  <bruno@clisp.org>
8079
8080         Remove case insensitive option matching.
8081         * argmatch.h (argcasematch): Remove declaration.
8082         (ARGCASEMATCH): Remove macro.
8083         (__xargmatch_internal): Remove case_sensitive argument.
8084         (XARGMATCH): Update.
8085         (XARGCASEMATCH): Remove macro.
8086         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8087         case_sensitive argument.
8088         (argcasematch): Remove function.
8089         (__xargmatch_internal): Remove case_sensitive argument.
8090         (main): Use XARGMATCH instead of XARGCASEMATCH.
8091
8092         * xmalloc.c: Change compile-time error message. Add comment about
8093         required autoconf version.
8094
8095 2002-11-21  Jim Meyering  <jim@meyering.net>
8096
8097         * strdup.c (strdup): Tweak comment and initial #if/#include.
8098
8099         Merge in changes from the coreutils.
8100
8101         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8102         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8103         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8104         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8105         int.  Work more efficiently if X is the same width as uintmax_t.
8106         Do not compare X to -1, to avoid bogus compiler warning.
8107         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8108         Don't assume that f_frsize and f_bsize are the same type.
8109
8110         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8111         on FreeBSD.
8112
8113         * makepath.c (make_path): Restore umask *before* creating the final
8114         component.
8115         (make_path): Minor reformatting.
8116
8117         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8118         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8119
8120         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8121         ones.  At least on GNU/Linux systems, `auto' means something else.
8122         From Michael Stone.
8123
8124 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8125
8126         Merge argmatch cleanups from Bison.  Assume C89.
8127
8128         * argmatch.c: Include config.h here, not in argmatch.h.
8129         Include stdlib.h, for EXIT_FAILURE.
8130         Always include <string.h>, since we assume C89.
8131         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8132         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8133         Include <stddef.h> instead, since it's all we need for size_t.
8134         (PARAMS): Remove.  All uses removed.
8135         (ARRAY_CARDINALITY): Do not bother to #undef.
8136         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8137         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8138         Remove unnecessary parentheses.
8139         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8140         Insert necessary parentheses.
8141         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8142         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8143
8144 2002-11-19  Bruno Haible  <bruno@clisp.org>
8145
8146         * mbswidth.c: Include mbswidth.h right at the beginning.
8147         * mbswidth.h: Include <stddef.h>, for size_t.
8148
8149         * mbswidth.h (PARAMS): Remove macro.
8150         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8151         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8152
8153         * gcd.h (PARAMS): Remove macro.
8154         (gcd): Use ANSI C function declarations.
8155         * gcd.c (gcd): Likewise.
8156
8157 2002-11-15  Bruno Haible  <bruno@clisp.org>
8158
8159         * strcspn.c: Include <stddef.h>.
8160         (strcspn): Use ANSI C function declaration. Change return type to
8161         size_t. Use NULL.
8162         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8163         (strpbrk): Use NULL.
8164         * strpbrk.h (PARAMS): Remove macro.
8165         (strpbrk): Use ANSI C function declaration.
8166         * strstr.c: Don't include <sys/types.h>.
8167         * strstr.h (PARAMS): Remove macro.
8168         (strstr): Use ANSI C function declarations.
8169
8170 2002-11-06  Bruno Haible  <bruno@clisp.org>
8171
8172         * gcd.h (gcd): Change argument type to 'unsigned long'.
8173         * gcd.c (gcd): Likewise.
8174
8175 2002-11-05  Bruno Haible  <bruno@clisp.org>
8176
8177         * gcd.h: New file, from gettext-0.11.5.
8178         * gcd.c: New file, from gettext-0.11.5.
8179
8180 2002-11-05  Bruno Haible  <bruno@clisp.org>
8181
8182         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8183         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8184         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8185         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8186
8187         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8188         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8189
8190         * closeout.c: Include gettext.h instead of <libintl.h>.
8191         * human.c: Include gettext.h instead of <libintl.h>.
8192         * quotearg.c: Include gettext.h instead of <libintl.h>.
8193         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8194         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8195         * userspec.c: Include gettext.h instead of <libintl.h>.
8196         * version-etc.c: Include gettext.h instead of <libintl.h>.
8197         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8198         (textdomain): Remove definition.
8199         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8200
8201         * long-options.c: Remove include of <libintl.h> and definition of _.
8202         * same.c: Remove include of <libintl.h> and definition of _.
8203
8204 2002-11-04  Bruno Haible  <bruno@clisp.org>
8205
8206         * stpcpy.h: New file, from GNU gettext-0.11.5.
8207         * strcase.h: New file, from GNU gettext-0.11.5.
8208         * strpbrk.h: New file, from GNU gettext-0.11.5.
8209         * strstr.h: New file, from GNU gettext-0.11.5.
8210         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8211
8212 2002-05-09  Bruno Haible  <bruno@clisp.org>
8213
8214         * config.charset: Update for newest glibc. Add canonical names
8215         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8216
8217 2002-05-09  Bruno Haible  <bruno@clisp.org>
8218
8219         * localcharset.c (get_charset_aliases): Add more Windows specific
8220         aliases.
8221
8222 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8223
8224         * config.charset: A few additions for Solaris.
8225
8226 2001-12-05  Bruno Haible  <bruno@clisp.org>
8227
8228         * localcharset.c (locale_charset): Don't return an empty string.
8229
8230 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8231
8232         * config.charset: msdos in uk_UA uses CP1125.
8233
8234 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8235
8236         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8237         * localcharset.c (locale_charset): Declare as extern "C".
8238
8239 2002-02-15  Bruno Haible  <bruno@clisp.org>
8240
8241         * config.charset [msdosdjgpp]: For Russian, use CP866.
8242
8243 2002-02-11  Bruno Haible  <bruno@clisp.org>
8244
8245         * config.charset: Add support for NetBSD.
8246
8247 2002-09-25    <karl@gnu.org>
8248
8249         * strdup.c: copy from libc/string (via ../config/srclist*).
8250         * getopt*: copy from libc/posix.
8251         * gettext.h: copy from gettext.
8252         * .cppi-disable: add strdup.c, gettext.h.
8253
8254 2002-07-01  Jim Meyering  <meyering@lucent.com>
8255
8256         * c-stack.c: Include sys/time.h.
8257         From Volker Borchert.
8258
8259 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8260
8261         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8262         New macro.  Use it uniformly instead of
8263         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8264         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8265         reported by Vin Shelton.
8266
8267 2002-06-22  Jim Meyering  <meyering@lucent.com>
8268
8269         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8270         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8271
8272 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8273
8274         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8275         Do not assume SA_SIGINFO behavior.
8276         Bug reported by Jim Meyering on NetBSD 1.5.2.
8277
8278 2002-06-22  Jim Meyering  <meyering@lucent.com>
8279
8280         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8281
8282         * exitfail.c, exitfail.h: Likewise.
8283         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8284
8285         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8286         of fnmatch.h.
8287         (EXTRA_DIST): Add fnmatch_loop.c.
8288         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8289
8290         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8291         * fnmatch.c: Update from diffutils-2.8.2.
8292         * fnmatch_.h: New file.  From diffutils-2.8.2.
8293         * fnmatch.h: Remove file.
8294
8295 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8296
8297         * file-type.h: Report an error if neither S_ISREG nor
8298         S_IFREG is defined, instead of using a test specific to glibc
8299         2.2.  This should be safe, since POSIX requires S_ISREG and
8300         Unix Version 7 had S_IFREG.  We don't need to check for
8301         <sys/types.h> since we don't use any symbols that it defines.
8302
8303 2002-06-15  Jim Meyering  <meyering@lucent.com>
8304
8305         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8306         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8307         have been included before this file.
8308
8309 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8310
8311         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8312         so that each temporary file name is unique and valid in the first
8313         8 characters, for operation under DOS.
8314
8315 2002-06-15  Jim Meyering  <meyering@lucent.com>
8316
8317         Work even with DJGPP 2.03, which lacks support for symlinks.
8318         From Richard Dawe.
8319         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8320         is defined.
8321         * lchown.c (S_ISLNK): Likewise.
8322
8323 2002-06-14  Jim Meyering  <meyering@lucent.com>
8324
8325         * file-type.h: Use the version from diffutils-2.8.2.
8326         * file-type.c: Likewise.
8327
8328 2002-05-27  Jim Meyering  <meyering@lucent.com>
8329
8330         Fix a problem seen only on nonconforming systems whereby ls.c's
8331         use of localtime, and then of gettimeofday would cause trouble:
8332         the localtime call used to initialize rpl_gettimeofday's save
8333         mechanism would clobber ls's current local time information so
8334         that in any long listing the first file would always be listed
8335         with date 1970-01-01.  Analysis by Volker Borchert.
8336
8337         * gettimeofday.c (localtime): Undefine.
8338         (rpl_localtime): New function.
8339
8340 2002-05-22  Jim Meyering  <meyering@lucent.com>
8341
8342         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8343         * file-type.h: New file.
8344         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8345
8346 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8347
8348         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8349
8350 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8351
8352         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8353         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8354         of 127, since 64 is the largest conceivable number for ancient
8355         nonstandard hosts.
8356         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8357
8358 2002-04-28  Jim Meyering  <meyering@lucent.com>
8359
8360         * sig2str.c (WTERMSIG): Remove definition (unused).
8361
8362 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8363
8364         * sig2str.h, sig2str.c: New files.
8365         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8366
8367 2002-04-24  Jim Meyering  <meyering@lucent.com>
8368
8369         * gettext.h: New file, from Gettext.
8370         * Makefile.am (INCLUDES): Remove -I../intl.
8371         (libfetish_a_SOURCES): Add gettext.h.
8372
8373 2002-04-16  Jim Meyering  <meyering@lucent.com>
8374
8375         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8376         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8377         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8378
8379 2002-04-12  Jim Meyering  <meyering@lucent.com>
8380
8381         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8382
8383 2002-03-10  Jim Meyering  <meyering@lucent.com>
8384
8385         * makepath.c (make_path): Remove a comma from a diagnostic.
8386         Suggestion from Santiago Vila.
8387
8388 2002-03-08  Jim Meyering  <meyering@lucent.com>
8389
8390         * rename.c: Mention that this wrapper is needed also on
8391         mips-dec-ultrix4.4 systems.
8392
8393 2002-03-02  Jim Meyering  <meyering@lucent.com>
8394
8395         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8396         not HAVE_CLOCK_SETTIME.
8397
8398 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8399
8400         * nanosleep.h: Rename to....
8401         * timespec.h: New name for nanosleep.h.  All uses changed.
8402
8403         * gettime.c: New file.
8404         * settime.c: New file.
8405         * stime.c: Remove.
8406
8407         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8408         timespec.h.  Remove nanosleep.h.
8409
8410 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8411
8412         * acl.c, acl.h: New files.
8413         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8414
8415 2002-02-24  Jim Meyering  <meyering@lucent.com>
8416
8417         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8418         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8419         cause trouble.  Reported by Nelson Beebe.
8420
8421 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8422
8423         * path-concat.c (xpath_concat): Reorder code to pacify
8424         compilers that don't know that xalloc_die never returns.
8425
8426 2002-02-20  Jim Meyering  <meyering@lucent.com>
8427
8428         * getdate.c: Regenerate using bison-1.33.
8429
8430 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8431
8432         * posixver.c, posixver.h: New files.
8433         * Makefile.am (libfetish_a_SOURCES): Add them.
8434
8435 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8436             Bruno Haible  <bruno@clisp.org>
8437
8438         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8439         (fwrite_success_callback): New declaration.
8440         * unicodeio.c (unicode_to_mb): New function, extracted from
8441         print_unicode_char. Call failure callback instead of error.
8442         (fwrite_success_callback): New function.
8443         (exit_failure_callback): New function.
8444         (fallback_failure_callback): New function.
8445         (print_unicode_char): Call unicode_to_mb.
8446
8447 2002-01-26  Jim Meyering  <meyering@lucent.com>
8448
8449         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8450
8451 2002-01-22  Jim Meyering  <meyering@lucent.com>
8452
8453         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8454         Otherwise, some versions of automake would omit the rule that makes
8455         Makefile from Makefile.in.
8456
8457 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8458
8459         * xmemcoll.h, xmemcoll.c: New files.
8460         * Makefile.am (libfetish_a_SOURCES): Add them.
8461         * memcoll.c: Include errno.h, and declare errno if not defined.
8462         (memcoll): Set errno to zero if there is no error.
8463
8464         * quotearg.c (quotearg_buffer_restyled):
8465         Fix bug with quoting buffers containing NUL when backslashing escapes.
8466         This bug was exposed by the other changes in this patch.
8467         (quotearg_n_options): New arg ARGSIZE.
8468         All callers changed.
8469         (quoting_options_from_style): New function.
8470         (quotearg_n_style): Use it.
8471         (quotearg_n_style_mem): New function.
8472
8473         * quotearg.h (quotearg_n_style_mem): New function.
8474
8475 2002-01-16  Jim Meyering  <meyering@lucent.com>
8476
8477         * getdate.y: Add three semicolons, each just before a closing brace.
8478         Bison (as of version 1.31) no longer papers over that mistake.
8479
8480 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8481
8482         * backupfile.c (ISDIGIT): Comment fix.
8483         * getdate.y (ISDIGIT): Likewise.
8484         * posixtm.c (ISDIGIT, year): Likewise.
8485         * strverscmp.c (ISDIGIT): Likewise.
8486         * userspec.c (ISDIGIT): Likewise.
8487
8488 2002-01-05  Jim Meyering  <meyering@lucent.com>
8489
8490         * version-etc.c (version_etc_copyright): Update copyright year.
8491
8492 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8493
8494         * closeout.c (close_stdout_status): If ferror (stdout), do
8495         not silently exit merely because the output buffer happens to
8496         have nothing pending.
8497
8498 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8499
8500         See the big note in ../ChangeLog.
8501         * human.c (suffixes): Prefer K to k for 1024.
8502         (generate_suffix_backwards): New function.
8503         (human_readable_inexact): Use it.
8504         * xstrtol.c (__xstrtol): If there is no number but there
8505         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8506         Accept 'K' as well as 'k'.
8507
8508 2001-12-15  Jim Meyering  <meyering@lucent.com>
8509
8510         * regex.h (__restrict_arr): Update from libc.
8511
8512         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8513         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8514         (STREQ): Define.
8515
8516 2001-12-10  Jim Meyering  <meyering@lucent.com>
8517
8518         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8519         Instead, include "xalloc.h".
8520         (initbuffer): Don't cast xmalloc return value to char*.
8521         (readline): Reword comment.
8522         Don't cast xrealloc return value to char*
8523         Return NULL, not 0.
8524
8525 2001-12-09  Jim Meyering  <meyering@lucent.com>
8526
8527         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8528         `signed and unsigned type in conditional expression'.
8529         * posixtm.c (posix_time_parse): Likewise.
8530
8531         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8532
8533         * readtokens.c (readtoken): Declare an index to be of type unsigned
8534         to avoid a pedantic warning.
8535
8536         * getstr.c: Don't include assert.h.
8537         (getstr): Remove warning-evoking assertions.
8538         Return -1 if offset parameter is out of bounds.
8539         Change the type of a local from int to size_t.
8540
8541         * strftime.c (my_strftime_localtime_r): Include this function
8542         definition in the `#if ! HAVE_TM_GMTOFF' block.
8543
8544         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8545         Include xalloc.h instead.
8546
8547 2001-12-02  Jim Meyering  <meyering@lucent.com>
8548
8549         * tempname.c: Don't declare getenv, thus reverting the change of
8550         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8551         included.
8552
8553         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8554         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8555
8556 2001-11-30  Akim Demaille  <akim@epita.fr>
8557
8558         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8559         before being defined.
8560
8561 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8562
8563         * quotearg.h (quotearg_n, quotearg_n_style):
8564         First arg is int, not unsigned.
8565         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8566         (SIZE_MAX, UINT_MAX): New macros.
8567         (quotearg_n_options): Abort if N is negative.
8568         Avoid overflow check on hosts where size_t is 64 bits and int
8569         is 32 bits, as overflow is impossible there.
8570         Fix off-by-one typo that caused unnecessary reallocation.
8571
8572 2001-11-27  Jim Meyering  <meyering@lucent.com>
8573
8574         * tempname.c: Merge with version from libc.
8575         * regex.c: Likewise.
8576
8577         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8578         for which STDC_HEADERS is 0, it was not included, resulting in a
8579         warning about an integer-to-pointer conversion problem with getenv.
8580         Reported by Volker Borchert.
8581
8582 2001-11-26  Jim Meyering  <meyering@lucent.com>
8583
8584         * gtod.h: Remove file.
8585         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8586         * gettimeofday.c: Don't include gtod.h.
8587         (GTOD_init): Remove function.
8588         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8589         Suggestion from Volker Borchert.
8590
8591 2001-11-23  Jim Meyering  <meyering@lucent.com>
8592
8593         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8594         * hash.c (struct hash_table): Define it here instead.
8595
8596 2001-11-22  Jim Meyering  <meyering@lucent.com>
8597
8598         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8599
8600 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8601
8602         * tempname.c (TMP_MAX): Remove; no longer needed.
8603         (TEMPORARIES): New macro.
8604         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8605         removes an artificial limitation (e.g. HP-UX 10.20, where
8606         TMP_MAX is 17576).
8607
8608 2001-11-18  Jim Meyering  <meyering@lucent.com>
8609
8610         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8611         on SunOS 4.
8612
8613         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8614         files will be created before anything else.
8615
8616 2001-11-17  Jim Meyering  <meyering@lucent.com>
8617
8618         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8619         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8620         rather than group writable.  Patch by Juan F. Codagnone.
8621
8622         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8623         Instead, include "xalloc.h".
8624
8625         * mountlist.c: Include unlocked-io.h after all system headers.
8626         Remove explicit declarations of xmalloc, xrealloc,
8627         and xstrdup.  Instead, include "xalloc.h".
8628
8629         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8630         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8631         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8632
8633         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8634         Reported by Padraig Brady.
8635
8636         * mkstemp.c: #undef mkstemp.
8637         Include config.h.
8638         (rpl_mkstemp): Rename from mkstemp.
8639         Protoize.
8640
8641 2001-11-16  Jim Meyering  <meyering@lucent.com>
8642
8643         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8644         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8645         determine the amount of total physical memory, use pstat_getstatic.
8646         HPUX-11 doesn't define _SC_PHYS_PAGES.
8647         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8648         If sysconf couldn't be used to determine the amount of available
8649         physical memory, use both pstat_getstatic and pstat_getdynamic.
8650         Based on a patch from Bob Proulx.
8651
8652 2001-11-05  Jim Meyering  <meyering@lucent.com>
8653
8654         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8655
8656 2001-11-03  Jim Meyering  <meyering@lucent.com>
8657
8658         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8659         in argmatch_to_argument call.
8660
8661         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8662         argument.
8663
8664         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8665         e.g., a fault due to an attempt to free a NULL pointer.
8666
8667 2001-11-01  Jim Meyering  <meyering@lucent.com>
8668
8669         * dirfd.c, dirfd.h: New files.
8670         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8671
8672         * hash.c (hash_print) [TESTING]: Clean up.
8673
8674 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8675
8676         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8677         to avoid a warning if -Wall.
8678
8679 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8680
8681         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8682
8683 2001-10-21  Jim Meyering  <meyering@lucent.com>
8684
8685         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8686         this code would end up calling gettext even in packages built
8687         with --disable-nls.
8688         * getopt.c (_): Likewise.
8689         * regex.c (_): Likewise.
8690
8691 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8692
8693         * error.c (strerror_r): Do not declare unless !_LIBC.
8694         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8695         Use strerror_r that is only a macro, even if it is not a function.
8696         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8697         (private_strerror): Use prototypes, not old-style function definition.
8698         (print_errno_message): New function.
8699         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8700         char*-flavored one.
8701         (error_tail, error, error_at_line): Use it.
8702
8703 2001-10-11  Jim Meyering  <meyering@lucent.com>
8704
8705         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8706         and quote_n (1, ... to avoid clobbering a buffer.
8707
8708 2001-10-05  Jim Meyering  <meyering@lucent.com>
8709
8710         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8711         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8712         * hash-pjw.h: New file.
8713
8714 2001-09-30  Jim Meyering  <meyering@lucent.com>
8715
8716         * mountlist.c [MOUNTED_GETFSSTAT]:
8717         Include <sys/ucred.h>, for Apple Darwin.
8718         Include sys/mount.h and sys/fs_types.h only if available.
8719         (FS_TYPE): Define.
8720         (read_filesystem_list): Use FS_TYPE.
8721
8722 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8723
8724         * exclude.c (excluded_filename): 0 -> false, since it's
8725         a boolean context.
8726
8727 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8728
8729         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8730         #defines strtoimax.  Also treat the other strto* functions
8731         like strtoimax.
8732
8733         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8734         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8735         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8736
8737 2001-09-26  Jim Meyering  <meyering@lucent.com>
8738
8739         Most macros in unlocked-io.h had the wrong number of arguments.
8740         * gen-uio: New script.
8741         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8742         * unlocked-io.hin: Remove file.
8743         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8744         rather than trying to embed it here.
8745         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8746         Reported by Padraig Brady.
8747
8748 2001-09-25  Volker Borchert  <bt@teknon.de>
8749
8750         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8751
8752 2001-09-23  Jim Meyering  <meyering@lucent.com>
8753
8754         * mountlist.c: Remove useless parentheses in #if directives.
8755         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8756         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8757
8758 2001-09-22  Jim Meyering  <meyering@lucent.com>
8759
8760         * localcharset.c: Update from latest gettext.
8761         * config.charset: Likewise.
8762
8763 2001-09-20  Jim Meyering  <meyering@lucent.com>
8764
8765         * xstrtol.c (strtoimax): Guard declaration with
8766         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8767         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8768         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8769         (strtoumax): Likewise, for completeness (it wasn't necessary).
8770
8771 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8772
8773         * strtoimax.c (HAVE_LONG_LONG):
8774         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8775         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8776         to work around bug in IBM C compiler.
8777
8778 2001-09-16  Jim Meyering  <meyering@lucent.com>
8779
8780         * mkdir.c: New file.
8781
8782 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8783
8784         * xgetcwd.c: Revert some of the previous change; intead,
8785         fix the HAVE_GETCWD_NULL code to behave more like the
8786         !HAVE_GETCWD_NULL code used to.
8787
8788         Include "xalloc.h".
8789         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8790         invoke xalloc_die.
8791
8792 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8793
8794         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8795         Use ssize_t, not int, to store result of readlink.
8796         Check for ssize_t overflow as well as size_t overflow,
8797         as POSIX says the result of readlink is implementation-defined
8798         when ssize_t overflows.
8799         Remove unnecessary cast to char*.
8800         Use free+malloc instead of realloc, as the storage doesn't need
8801         to be preserved and it's clearer and can be more efficient that way.
8802         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8803         * xreadlink.h (xreadlink): Update prototype.
8804
8805 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8806
8807         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8808         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8809         spotted by Jim Meyering.
8810
8811 2001-09-03  Jim Meyering  <meyering@lucent.com>
8812
8813         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8814
8815 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8816
8817         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8818         like the HAVE_GETCWD_NULL code.
8819         Include pathmax.h if not HAVE_GETCWD.
8820         Do not include xalloc.h.
8821         (INITIAL_BUFFER_SIZE): New symbol.
8822         Do not use xmalloc / xrealloc, since the caller is responsible for
8823         handling errors.  Preserve errno around `free' during failure.
8824         Do not overrun buffer when using getwd.
8825
8826 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8827
8828         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8829         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8830
8831 2001-09-02  Jim Meyering  <meyering@lucent.com>
8832
8833         * error.c: Update from GNU libc.
8834
8835 2001-09-01  Jim Meyering  <meyering@lucent.com>
8836
8837         * xreadlink.c: New file.
8838         * xreadlink.h: New file.
8839         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8840
8841         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8842         doesn't conflict with sparc Solaris 7's definition in
8843         /usr/include/sys/int_types.h.
8844
8845         * exclude.c: Use `""', not `<>' to #include non-system header files.
8846         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8847         and strncasecmp as r-values.  Unixware didn't have declarations.
8848
8849 2001-08-31  Jim Meyering  <meyering@lucent.com>
8850
8851         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8852         Use an initial, malloc'd, buffer of length 128 rather than
8853         a statically allocated one of length 1024.
8854
8855 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8856
8857         * xgetcwd.c: Don't include pathmax.h.
8858         Include stdlib.h and unistd.h if available.
8859         Include xalloc.h.
8860         (xmalloc, xstrdup, free): Remove decls.
8861         (xgetcwd): Don't assume sizes fit in unsigned.
8862         Check for overflow when computing sizes.
8863         Simplify reallocation code.
8864
8865 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8866
8867         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8868
8869         * strtoimax.c: Renamed from strtoxmax.c, removing the
8870         old strtoimax.c.
8871
8872         Also, make the following further changes to make this file's
8873         configuration more similar to that of strtol.c:
8874         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8875         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8876         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8877         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8878         changed to signed values.
8879
8880         And make the following changes as well:
8881         Fix copyright notice, as 1999 was missing.
8882         (verify): New macro.
8883         (strtoimax): Check sizes at compile-time, not run-time.
8884         Prefer strtol to strtoll if both work.
8885         (main): Remove; it was not that useful and was a pain to maintain.
8886
8887         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8888
8889 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8890
8891         * savedir.c (savedir): Remove size parameter, as POSIX says that
8892         a directory's st_size can have an arbitrary value, so the old
8893         usage could waste an arbitrary amount of memory.  All uses
8894         changed.
8895         * savedir.h: Update prototype.
8896
8897 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8898
8899         * xstrtol.c (strtoimax): New decl.
8900
8901 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8902
8903         * xstrtol.h: Add copyright notice.
8904         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8905         LONGINT_INVALID_SUFFIX_CHAR.
8906
8907 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8908
8909         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8910         tm to be declared.
8911
8912 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8913
8914         * hash.c: Remove '2001' from copyright notice.
8915
8916 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8917
8918         * full-write.h: New file.
8919         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8920         * full-write.c: Correct credits, as cccp.c no longer
8921         exists and anyway it was so heavily changed from the old cccp
8922         code as to be unrecognizable.  Include full-write.h.
8923         (full_write) Return size_t, with short writes meaning failure.
8924         All callers changed.  This fixes a bug with large buffers
8925         on 64-bit hosts.
8926         * utime.c: Include full-write.h.
8927
8928 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8929
8930         Merge 'exclude' changes from tar 1.13.22.
8931         This fixes one or two unlikely storage allocation overflow bugs,
8932         but doesn't change user-visible behavior otherwise.
8933
8934 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8935
8936         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8937         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8938         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8939         Include if available.
8940         (<xalloc.h>): Include
8941         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8942         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8943         collide with FNM macros.
8944         (struct patopts): New struct.
8945         (struct exclude): Use it, as exclude patterns now come with options.
8946         (new_exclude): Support above changes.
8947         (new_exclude, add_exclude_file):
8948         Initial size must now be a power of two to simplify overflow checking.
8949         (free_exclude, fnmatch_no_wildcards): New function.
8950         (excluded_filename): No longer requires options arg, as the options
8951         are determined by add_exclude.  Now returns bool, not int.
8952         (excluded_filename, add_exclude):
8953         Add support for the fancy new exclusion options.
8954         (add_exclude, add_exclude_file): Now takes int options arg.
8955         Check for arithmetic overflow when computing sizes.
8956         (add_exclude_file): xrealloc might modify errno, so don't
8957         realloc until after errno might be used.
8958
8959         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8960         New macros.
8961         (free_exclude): New decl.
8962         (add_exclude, add_exclude_file): Now takes int options arg.
8963         (excluded_filename): No longer requires options arg, as the options
8964         are determined by add_exclude.  Now returns bool, not int.
8965
8966 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8967
8968         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8969
8970 2001-08-27  Jim Meyering  <meyering@lucent.com>
8971
8972         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8973
8974         * version-etc.c (N_): Remove definition.
8975         Revert most of last change.
8976         Instead, simply don't mark the `Copyright...' string for translation.
8977         Based on advice from Paul Eggert.
8978
8979         * strtoxmax.c: Tweak comment.
8980
8981 2001-08-26  Jim Meyering  <meyering@lucent.com>
8982
8983         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8984         of copyright with `%s' so translators don't get an untranslated
8985         message in 2002.
8986         (COPYRIGHT_YEAR): Define.
8987         (version_etc): Use fprintf rather than fputs.
8988         Suggestion from Ulrich Drepper.
8989
8990         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8991
8992         * strtoll.c: New file, from GNU libc.
8993         * xstrtoimax.c: New file.
8994
8995         * xstrtol.h: Add xstrtoimax.
8996         * strtoumax.c: New file.  Simply include "strtoumax.c".
8997         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8998
8999         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9000         * strtoxmax.c: ... then renamed to this.
9001
9002 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9003
9004         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9005         Port to Solaris 8, where 'sed' requires a space after the 'r'
9006         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9007         Redirect output to $tmp just once.
9008
9009 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9010
9011         * addext.c (<errno.h>): Include.
9012         (errno): Declare if not defined.
9013         (addext): Work correctly when pathconf returns -1 and leaves
9014         errno alone because there is no limit.  Also, work even if
9015         pathconf returns a value greater than SIZE_MAX.
9016
9017 2001-08-12  Jim Meyering  <meyering@lucent.com>
9018
9019         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9020         Simply `return getcwd (NULL, 0);'.
9021         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9022         Use 1300 as initial value for length, not PATH_MAX.
9023
9024         * pathmax.h: Clean up cpp syntax.
9025
9026 2001-08-12  Jim Meyering  <meyering@lucent.com>
9027
9028         * gettimeofday.c: New file.
9029         * gtod.h: New file.
9030         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9031
9032 2001-08-04  Jim Meyering  <meyering@lucent.com>
9033
9034         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9035         to get in sync with glibc.
9036
9037 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9038
9039         The following changes are from gettext 0.10.39 as maintained by
9040         Bruno Haible.
9041
9042         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9043         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9044         with inverted sense.  All uses changed.
9045
9046         * mbswidth.c: Don't include <limits.h>.
9047         Include <stdlib.h> and <string.h> unconditionally.
9048         (iswcntrl, mbsinit, ISCNTRL): New macros.
9049         (mbsnwidth): Use K&R style function declarations.
9050         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9051         can optimize it when MB_CUR_MAX == 1.
9052         The width of control characters is zero, not 1.
9053
9054 2001-07-15  Jim Meyering  <meyering@lucent.com>
9055
9056         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9057         (BUILT_SOURCES): Add unlocked-io.h.
9058         (io_functions): Define.
9059         (unlocked-io.h): New rule.
9060         (DISTCLEANFILES): Add unlocked-io.h.
9061         (all-local): Depend on unlocked-io.h, to ensure it is created.
9062
9063         * unlocked-io.hin: New file
9064
9065         * regex.c: Update from glibc.
9066
9067 2001-07-05  Jim Meyering  <meyering@lucent.com>
9068
9069         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9070         recommendation.
9071         (libfetish_a_SOURCES): Put all .h files here instead.
9072         Remove a thus-exposed (better checks in automake) duplicate and
9073         two unnecessary .h files.
9074
9075 2001-06-11  Jim Meyering  <meyering@lucent.com>
9076
9077         * regex.c: Update from GNU libc.
9078
9079 2001-05-27  Jim Meyering  <meyering@lucent.com>
9080
9081         * readutmp.h (UT_TYPE): Define.
9082
9083 2001-05-24  Jim Meyering  <meyering@lucent.com>
9084
9085         * argmatch.c: Include "quote.h".
9086         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9087         quote function.  Reported by Göran Uddeborg.
9088
9089 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9090
9091         * dirname.c (dir_name): Compute append_dot using path, not newpath
9092         which is not yet declared.
9093
9094 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9095
9096         * Makefile.am (libfetish_a_SOURCES):
9097         Add strftime.c, since we now compile it on all hosts.
9098
9099         * strftime.c (my_strftime):
9100         Define to nstrftime if emacs, but only if my_strftime is not defined.
9101         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9102         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9103         Add one more extra argument: a nanoseconds value.
9104         All uses changed.
9105         (ns): New macro.
9106         (my_strftime function): Add %N format.
9107         (emacs_strftimeu): Renamed from emacs_strftime,
9108         with extra ut argument.
9109
9110 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9111
9112         dirname code cleanup.  base_name now behaves more compatibly
9113         with POSIX basename when given file names that have trailing
9114         slashes, and similarly for dir_name.  Add new primitives
9115         base_len and dir_len.  Put the directory-name-related decls
9116         into dirname.h.
9117
9118         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9119         * backupfile.c (base_name): Likewise.
9120         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9121         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9122         * makepath.c (strip_trailing_slashes): Likewise.
9123         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9124         Likewise.
9125         * rename.c (strip_trailing_slashes): Likewise.
9126         * same.c (base_name): Likewise.
9127         * stripslash.c (ISSLASH): Likewise.
9128
9129         * addext.c: Include <dirname.h> after size_t is defined.
9130         * backupfile.c: Likewise.
9131
9132         * addext.c (addext): Use base_len to trim redundant
9133         trailing slashes instead of doing it ourselves.
9134         But do not trim the last slash if it is not redundant.
9135
9136         * backupfile.c (find_backup_file_name,
9137         max_backup_version): Use base_len instead of rolling it ourselves.
9138         Handle the case of "" and (on DOS) "C:" correctly.
9139
9140         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9141         Include <string.h>, <dirname.h>.
9142         (base_name): Allow file names ending in slashes, other than names
9143         that are all slashes.  In this case, return the basename followed
9144         by the slashes.  This is more general, and can be used in places
9145         where the original base_name purposely had an assertion failure.
9146         (base_len): New function.
9147
9148         * dirname.c: Include <string.h> instead of <stdlib.h>.
9149         Do not include <assert.h>; no longer needed.
9150         Include xalloc.h.
9151         (memrchr): Remove decl.
9152         (dir_name_r): Remove.
9153         (dir_len): Renamed from dirlen.  All callers changed.
9154         Rewrite in terms of base_name, for simplicity and consistency.
9155         (dir_name): Never return NULL.  All callers changed.
9156         Do not include <stdlib.h> in test program; no longer needed.
9157         return 0; is fine for test program.
9158
9159         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9160         New macros.
9161         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9162
9163         * path-concat.c (path_concat): Use base_len to compute
9164         base length, not strlen; this means we cannot rely on memcpy
9165         to null-terminate.
9166
9167         * same.c (STREQ): Remove.
9168         (same_name): Handle the case where the basename ends in trailing '/'.
9169
9170         * stripslash.c (strip_trailing_slashes): Return nonzero if
9171         a slash was stripped.  Do not strip the last slash after a
9172         file system prefix.
9173
9174 2001-04-08  Jim Meyering  <meyering@lucent.com>
9175
9176         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9177         recomputed; that's necessary when the offset spans a DST transition.
9178         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9179
9180 2001-04-02  Jim Meyering  <meyering@lucent.com>
9181
9182         * regex.h, regex.c: Update from GNU libc.
9183
9184 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9185
9186         * version-etc.c (version_etc_copyright): Update to 2001.
9187
9188 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9189
9190         * tempname.c (uint64_t): Define to uintmax_t if
9191         not defined, and if UINT64_MAX is not defined.
9192         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9193         Reported by John David Anglin.
9194
9195 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9196
9197         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9198         alias if codeset is empty.
9199         * config.charset (BeOS): Use wildcard syntax.
9200
9201 2001-03-13  Jim Meyering  <meyering@lucent.com>
9202
9203         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9204         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9205         From Bruno Haible.
9206
9207 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9208
9209         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9210         Don't return NULL.
9211         * unicodeio.c (print_unicode_char): Simplify accordingly.
9212
9213 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9214
9215         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9216         support for DOS/DJGPP.
9217
9218 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9219
9220         * Makefile.am (libfetish_a_SOURCES):
9221         Add dup-safer.c, fopen-safer.c.
9222         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9223
9224         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9225
9226 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9227
9228         The mkstemp replacement is taken from glibc 2.2.2, with some
9229         portability fixes for use outside glibc, as follows:
9230
9231         * tempname.c (struct_stat64): New macro.
9232         (direxists, __gen_tempname): Use it.
9233         This avoids a portability problem with Solaris 8.
9234
9235         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9236         (<stddef.h>, <stdint.h>, <string.h>):
9237         Include only if STDC_HEADERS || _LIBC.
9238         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9239         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9240         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9241         (__set_errno): Define this macro if <errno.h> doesn't.
9242         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9243         Define these macros if <stdio.h> doesn't.
9244         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9245         Define these macros if <sys/stat.h>
9246         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9247         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9248         __xstat64): Define if not _LIBC.
9249         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9250         (__gen_tempname): Invoke gettimeofday only if
9251         HAVE_GETTIMEOFDAY || _LIBC;
9252         otherwise, fall back on plain "time".
9253         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9254
9255         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9256
9257         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9258
9259 2001-02-17  Jim Meyering  <meyering@lucent.com>
9260
9261         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9262         around included file name.
9263
9264         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9265
9266         * strftime.c: Update from GNU libc (the only changes were to comments).
9267
9268 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9269
9270         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9271
9272 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9273
9274         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9275         Remove workaround macros for hosts that have mbrtowc but not
9276         mbstate_t, as we now insist on proper declarations for both
9277         before using mbrtowc.
9278
9279 2001-02-17  Jim Meyering  <meyering@lucent.com>
9280
9281         * regex.c: Update from libc.
9282
9283 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9284
9285         * alloca.c (malloc): Undef before defining, since stdlib.h
9286         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9287         Reported by Mark Hounschell via Paul Eggert.
9288
9289 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9290
9291         * config.charset: Update for FreeBSD 4.2.
9292
9293 2001-01-26  Jim Meyering  <meyering@lucent.com>
9294
9295         * quotearg.c: Include stddef.h.
9296         * quote.c: Include stddef.h.
9297         Reported by Axel Kittenberger.
9298
9299         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9300         line in double quotes so that it evokes a better diagnostic.
9301         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9302         Reported by Axel Kittenberger.
9303
9304 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9305
9306         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9307         to avoid a warning.  Add back 'const' to inptr.
9308
9309 2001-01-16  Jim Meyering  <meyering@lucent.com>
9310
9311         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9312         From Bruno Haible.
9313
9314 2001-01-14  Jim Meyering  <meyering@lucent.com>
9315
9316         * rename.c: New file.  From Volker Borchert.
9317         Include stdlib.h, string.h or strings.h, and xalloc.h.
9318         Use strip_trailing_slashes rather than open-coding it.
9319
9320 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9321
9322         * strftime.c: Sync with glibc time/strftime.c 1.81.
9323
9324 2001-01-03  Jim Meyering  <meyering@lucent.com>
9325
9326         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9327         local `inptr' to avoid warning with some system declarations of iconv.
9328
9329 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9330
9331         * modechange.c: Do not assume that mode_t uses the
9332         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9333         the other-execute bit of FOO even if S_IXOTH != 1.
9334
9335         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9336         WOTH, XOTH, ALLM): New macros.
9337         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9338          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9339         Use them.
9340         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9341         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9342         (mode_compile):
9343         No need to use uintmax_t; unsigned long is long enough.
9344         Don't bother to get suffix since we don't use it.
9345
9346 2000-12-24  Jim Meyering  <meyering@lucent.com>
9347
9348         * hash.c (is_prime): Return explicit boolean values.
9349         (hash_get_first): Return NULL to appease Irix5.6's 89.
9350         Reported by Nelson Beebe.
9351
9352 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9353
9354         * localcharset.c (locale_charset): Add support for Win32.
9355
9356 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9357
9358         * physmem.h, physmem.c: New files.
9359
9360         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9361         (noinst_HEADERS): Add physmem.h.
9362
9363         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9364         't' for compatibility with Solaris 8 sort.
9365
9366 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9367
9368         * config.charset: Add support for BeOS.
9369
9370 2000-12-16  Jim Meyering  <meyering@lucent.com>
9371
9372         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9373         SHELLS_FILE to a file name that's useful on djgpp systems.
9374         Include stdlib.h.
9375         (ADDITIONAL_DEFAULT_SHELLS): Define.
9376         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9377         Based mostly on a patch from Prashant TR.
9378
9379 2000-12-16  Jim Meyering  <meyering@lucent.com>
9380
9381         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9382         N and M) would have treated it like `chown N:N FILE'.
9383
9384         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9385
9386 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9387
9388         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9389         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9390         to the list of canonical encodings. Rename EUC-CN to GB2312.
9391
9392 2000-12-08  Andreas Schwab  <schwab@suse.de>
9393
9394         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9395         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9396
9397 2000-12-07  Jim Meyering  <meyering@lucent.com>
9398
9399         * stripslash.c (ISSLASH): Define.
9400         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9401         From Prashant TR.
9402
9403         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9404         (dir_name_r): Declare this function as static.
9405         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9406         manifest itself on a name containing a mix of slashes and
9407         backslashes.
9408         Make this function work with names starting with a DOS-style
9409         drive letter and colon prefix.
9410         (dir_name): Append `.' if necessary.
9411         Based mostly on patches from Prashant TR and Eli Zaretskii.
9412
9413         * dirname.h (dir_name_r): Remove prototype.
9414
9415 2000-12-05  Jim Meyering  <meyering@lucent.com>
9416
9417         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9418
9419 2000-12-04  Jim Meyering  <meyering@lucent.com>
9420
9421         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9422         Also include memory.h, stdlib.h, unistd.h if appropriate.
9423         Reported by Andreas Jaeger (conflicting declaration of malloc).
9424
9425 2000-12-02  Jim Meyering  <meyering@lucent.com>
9426
9427         * closeout.h: Make idempotent, to avoid some obscure warnings.
9428
9429 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9430
9431         * memrchr.c: Include <config.h> before any system include file.
9432
9433 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9434
9435         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9436
9437 2000-11-26  Jim Meyering  <meyering@lucent.com>
9438
9439         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9440
9441 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9442
9443         * strftime.c (my_strftime): Do not invoke mbrlen with a
9444         size of (size_t) -1; it's not portable.
9445
9446 2000-11-17  Akim Demaille  <akim@epita.fr>
9447
9448         * obstack.h: Formatting changes.
9449         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9450         prevent type checking.
9451         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9452         cast the value to (void *): assigning a `foo *' to a `void *'
9453         variable is valid.
9454         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9455
9456 2000-11-17  Jim Meyering  <meyering@lucent.com>
9457
9458         * strstr.c: Update from GNU libc.
9459
9460 2000-11-16  Jim Meyering  <meyering@lucent.com>
9461
9462         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9463
9464 2000-11-11  Jim Meyering  <meyering@lucent.com>
9465
9466         * error.c: Add a couple #includes, merging from GNU libc version.
9467
9468 2000-11-10  Jim Meyering  <meyering@lucent.com>
9469
9470         * obstack.h: Update from GNU libc.
9471         * obstack.c: Likewise.
9472
9473 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9474
9475         * getusershell.c (setusershell): Use rewind rather than
9476         fseek/fseeko, to avoid configuration hassles with fseeko.
9477         Don't bother opening SHELLS_FILE if shellstream is NULL;
9478         it's not necessary.
9479
9480 2000-11-05  Jim Meyering  <meyering@lucent.com>
9481
9482         * makepath.h (make_dir): Declare.
9483         * makepath.c (make_dir): Remove `static' attribute.
9484         Tweak a comment.
9485
9486 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9487
9488         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9489         last one in a bucket, advance to the next bucket.
9490
9491 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9492
9493         * fnmatch.c: Do not comment out all the code if we are using
9494         the GNU C library, because in some cases we are replacing buggy
9495         code in the GNU C library itself.
9496
9497 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9498
9499         * error.h, getline.h, modechange.h:
9500         Remove "2000" from Copyright line, as the file hasn't been
9501         changed this year other than in the copyright notice.
9502
9503         * xalloc.h: Add "2000" to Copyright line, as this file
9504         was changed this year.
9505
9506 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9507
9508         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9509         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9510         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9511
9512 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9513
9514         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9515         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9516         doesn't define __restrict_arr.
9517
9518 2000-10-29  Jim Meyering  <meyering@lucent.com>
9519
9520         * xstat.in: Fix grammar in comment.
9521
9522 2000-10-28  Jim Meyering  <meyering@lucent.com>
9523
9524         * memchr.c: Update from libc.
9525         Adjust for portability:
9526         [HAVE_STDLIB_H]: Include stdlib.h.
9527         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9528         Undef __memchr, too.
9529         [!weak_alias]: Define __memchr to memchr.
9530
9531         * regex.c: Update from libc.
9532         * regex.h: Likewise.
9533         * getopt1.c: Likewise.
9534         * memcmp.c: Likewise.
9535
9536         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9537         Avoid using fseek, when possible -- it's broken by design.
9538         Patch by Ulrich Drepper.
9539
9540 2000-10-26  Jim Meyering  <meyering@lucent.com>
9541
9542         * strftime.c: Update from libc.
9543
9544 2000-10-25  Jim Meyering  <meyering@lucent.com>
9545
9546         * obstack.c: Update from libc.
9547
9548 2000-10-23  Jim Meyering  <meyering@lucent.com>
9549
9550         * hard-locale.c (hard_locale): Revert last change -- it was simply
9551         wrong.  That set_locale call must not have any side effects.
9552         From Paul Eggert.
9553
9554 2000-10-22  Jim Meyering  <meyering@lucent.com>
9555
9556         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9557         [CYCLIC]: Remove now-unused definition.
9558
9559         * save-cwd.c (O_DIRECTORY): Define, if needed.
9560         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9561         Suggestion from Ulrich Drepper.
9562
9563 2000-10-21  Jim Meyering  <meyering@lucent.com>
9564
9565         * dirname.c (dir_name_r): New function, factored out of dir_name.
9566         (dir_name): Use dir_name_r.
9567         * dirname.h (dir_name_r): Declare it.
9568
9569 2000-10-21  Jim Meyering  <meyering@lucent.com>
9570
9571         * dirname.c (memrchr): Declare if necessary.
9572         (dir_name): Remove the restriction that there be no
9573         trailing slashes.  Now, this code skips past them, effectively
9574         ignoring them.
9575         [TEST_DIRNAME] (main): New unit tests.
9576
9577         * memrchr.c: New file from GNU libc.
9578         Undef __memrchr, too.
9579         [!weak_alias]: Define __memrchr to memrchr.
9580         Guard weak_alias use with `#ifdef weak_alias'.
9581
9582 2000-10-17  Jim Meyering  <meyering@lucent.com>
9583
9584         * quote.h (PARAMS): Define and use.
9585         Reported by Akim Demaille.
9586
9587         * getopt.c: Update from libc.
9588
9589 2000-10-16  Jim Meyering  <meyering@lucent.com>
9590
9591         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9592         From Jan Fedak.
9593
9594 2000-09-25  Jim Meyering  <meyering@lucent.com>
9595
9596         * md5.h (rol): Define (from GnuPG).
9597
9598         * sha.c: Give credit (GnuPG) where due.
9599         (M): Use rol rather than open-coding it.
9600         Add a FIXME comment.
9601
9602 2000-09-21  Jim Meyering  <meyering@lucent.com>
9603
9604         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9605         Reported by Michael Stone.
9606
9607 2000-09-20  Jim Meyering  <meyering@lucent.com>
9608
9609         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9610         (noinst_HEADERS): Add sha.h.
9611         Based on code from Scott G. Miller and from GnuPG.
9612
9613 2000-09-15  Jim Meyering  <meyering@lucent.com>
9614
9615         * regex.c: Update from libc.
9616
9617 2000-09-10  Jim Meyering  <meyering@lucent.com>
9618
9619         * getopt.c (_getopt_internal): Update from glibc.
9620
9621 2000-09-09  Jim Meyering  <meyering@lucent.com>
9622
9623         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9624         think it should be used as a general replacement for isascii.
9625         * fnmatch.c: Likewise.
9626         * mbswidth.c: Likewise
9627         * regex.c: Likewise.
9628
9629         Don't use atoi.
9630         * userspec.c: Include sys/param.h and limits.h.
9631         Include xstrtol.h.
9632         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9633         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9634         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9635         UID, GID.  Check range.
9636
9637 2000-09-06  Jim Meyering  <meyering@lucent.com>
9638
9639         * getopt.c (_getopt_internal): Update from glibc.
9640
9641 2000-08-30  Jim Meyering  <meyering@lucent.com>
9642
9643         * strftime.c: Merge in changes from GNU libc.
9644
9645 2000-08-26  Jim Meyering  <meyering@lucent.com>
9646
9647         * closeout.c: Include "__fpending.h".
9648         (close_stdout_status): Return right away if there's nothing to flush.
9649
9650         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9651         * __fpending.c: New file.
9652         * __fpending.h: New file.
9653
9654 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9655
9656         Standardize on "memory exhausted" instead of "Memory exhausted"
9657         or "virtual memory exhausted".
9658         * obstack.c (print_and_abort): Use "memory exhausted", not
9659         "virtual memory exhausted".
9660         * same.c (same_name): Invoke xalloc_die instead of printing
9661         our own message.
9662         * userspec.c (parse_user_spec): Likewise.
9663         * bumpalloc.h: comment fix
9664         * same.c, userspec.c: Include xalloc.h.
9665
9666         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9667         not char *const and pointing to a constant array.
9668         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9669         (xrealloc): Comment fix.
9670
9671         * userspec.c (parse_user_spec):
9672         Don't translate a message until just before returning,
9673         to avoid unnecessary translation.
9674
9675 2000-08-07  Jim Meyering  <meyering@lucent.com>
9676
9677         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9678         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9679         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9680         getgroups.c, gethostname.c, getopt.h, group-member.c,
9681         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9682         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9683         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9684         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9685         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9686         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9687         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9688         yesno.c: Back out Copyright date changes for each file with no change
9689         this year.  This eases coordination with other programs using the same
9690         source code modules.  From Paul Eggert.
9691
9692 2000-08-03  Greg McGary  <greg@mcgary.org>
9693
9694         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9695         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9696         (EXTEND_BUFFER): Use them.
9697
9698 2000-08-01  Jim Meyering  <meyering@lucent.com>
9699
9700         * dirname.c (ISSLASH): Define.
9701         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9702         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9703         both `\' and `/' may be use as path separators.
9704         Based on a patch from Prashant TR.
9705
9706 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9707
9708         * quotearg.c (quotearg_n_options): Don't make the initial
9709         slot vector a constant, since it might get modified.
9710
9711 2000-07-31  Jim Meyering  <meyering@lucent.com>
9712
9713         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9714         * obstack.c (print_and_abort): Likewise.
9715
9716 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9717
9718         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9719         buffer, so that the caller can always quote one small
9720         component of a "memory exhausted" message in slot 0.
9721         From a suggestion by Jim Meyering.
9722
9723 2000-07-30  Jim Meyering  <meyering@lucent.com>
9724
9725         * makepath.c (make_path): Quote the other instance, too.
9726
9727         * quotearg.c (N_STATIC_SLOTVECS): Define.
9728         (STATIC_BUF_SIZE): Define.
9729         (quotearg_n_options): Use only statically allocated storage when
9730         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9731         than STATIC_BUF_SIZE.
9732
9733 2000-07-29  Jim Meyering  <meyering@lucent.com>
9734
9735         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9736         * dirname.c (dir_name): Likewise.
9737
9738         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9739
9740         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9741         (dir_name): Assert that there are no trailing slashes.
9742
9743 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9744
9745         * mbswidth.h (mbswidth): Add a flags argument.
9746         (mbswidth): New declaration.
9747         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9748         * mbswidth.c (mbswidth): Add a flags argument.
9749         (mbsnwidth): New function.
9750
9751 2000-07-24  Jim Meyering  <meyering@lucent.com>
9752
9753         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9754
9755 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9756
9757         * mbswidth.c (_XOPEN_SOURCE):
9758         Don't define; this causes problems on Solaris 7.
9759         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9760
9761 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9762
9763         * quotearg.c:
9764         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9765         so that mbstate_t is always defined.
9766
9767         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9768         be 1 in at least one GCC installation, and this configuration
9769         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9770         performance on hosts that have mbrtowc but have only unibyte
9771         locales, but I assume these hosts are rare.
9772
9773 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9774
9775         * quotearg.c: Streamline by invoking multibyte code only if needed.
9776         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9777         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9778         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9779         invoke multibyte primitives.
9780
9781 2000-07-23  Jim Meyering  <meyering@lucent.com>
9782
9783         * basename.c (base_name): Add an assertion.
9784
9785 2000-07-15  Bruno Haible  <clisp.cons.org>
9786
9787         * quotearg.c: When the system forces us to redefine mbstate_t,
9788         shadow its mbsinit function.
9789
9790 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9791
9792         * mbswidth.h: New file.
9793         * mbswidth.c: New file.
9794         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9795         (noinst_HEADERS): Add mbswidth.h.
9796
9797 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9798
9799         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9800         and IRIX 6.
9801
9802 2000-07-15  Jim Meyering  <meyering@lucent.com>
9803
9804         * makepath.c: Include quote.h.
9805         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9806         corresponding argument in a `quote (...)' call.
9807         Give better diagnostics.
9808
9809         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9810         (noinst_HEADERS): Add quote.h.
9811
9812         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9813         from tar's src/misc.c.
9814         * quote.h: New file.  Prototypes for same.
9815
9816 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9817
9818         From a suggestion by Bruno Haible.
9819         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9820         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9821         to decide whether to define the BeOS workaround macro;
9822         this adjusts to the change to AC_MBSTATE_T.
9823
9824 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9825
9826         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9827
9828         * quotearg.c (quoting_style_args, quoting_style_vals,
9829         quotearg_buffer_restyled): Add support for
9830         clocale_quoting_style.  Undo previous change to
9831         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9832         and "{RIGHT QUOTATION MARK}" msgids.
9833
9834 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9835
9836         The old behavior of quoting `like this' doesn't look good with
9837         newer, ISO-style fonts.  See:
9838         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9839
9840         Instead, quote "like this" by default.  Let the translator
9841         tailor the locale-specific quoting behavior by providing
9842         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9843
9844         * quotearg.c (N_): New macro.
9845         (gettext_default): New function.
9846         (quotearg_buffer_restyled): Use
9847         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9848         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9849
9850 2000-07-09  Jim Meyering  <meyering@lucent.com>
9851
9852         * Most files: Update copyright dates to include 2000.
9853
9854 2000-07-08  Jim Meyering  <meyering@lucent.com>
9855
9856         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9857         if not defined.
9858         (xgethostname): Remove now-unnecessary #ifdef.
9859         Move declaration of `err' into loop where it's used.
9860
9861 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9862
9863         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9864         by allocating a larger buffer. Test the gethostname return value for
9865         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9866         returns an error and ENAMETOOLONG isn't defined.
9867
9868 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9869         and Bruno Haible  <haible@clisp.cons.org>
9870
9871         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9872
9873 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9874
9875         * quotearg.c (struct quoting_options): Simplify quote_these_too
9876         dimension.
9877
9878 2000-07-03  Jim Meyering  <meyering@lucent.com>
9879
9880         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9881         Reported by Bruno Haible.
9882
9883 2000-07-04  Jim Meyering  <meyering@lucent.com>
9884
9885         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9886         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9887         lacks mbrtowc.
9888
9889 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9890         and Bruno Haible  <haible@clisp.cons.org>
9891
9892         * quotearg.c (mbrtowc):
9893         Assign to *pwc, and return 1 only if result is nonzero.
9894         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9895
9896 2000-07-03  Jim Meyering  <meyering@lucent.com>
9897
9898         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9899         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9900         From Bob Proulx.
9901
9902 2000-07-02  Jim Meyering  <meyering@lucent.com>
9903
9904         * quotearg.c (mbstate_t): Don't define here.
9905
9906 2000-07-02  Jim Meyering  <meyering@lucent.com>
9907
9908         * nanosleep.c (SIGCONT): Define if not already defined.
9909
9910 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9911
9912         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9913         per change in ../m4/ls-mntd-fs.m4.
9914         (read_filesystem_list): Ignore symbolic links.
9915
9916 2000-06-29  Jim Meyering  <meyering@lucent.com>
9917
9918         * same.c: Include <string.h> or <strings.h>, as appropriate,
9919         for declaration of strcmp.
9920
9921         * long-options.c: Include <stdlib.h>, for declaration of exit.
9922
9923         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9924         Avoid warning by casting result to `char *' to remove `const'.
9925
9926 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9927
9928         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9929
9930 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9931
9932         savedir now sets errno on failure and invokes xmalloc to get memory.
9933         Fix a couple of other minor bugs while we're at it.
9934
9935         * savedir.c (<unistd.h>): Do not include; there's no need.
9936         (NAMLEN): Remove macro.
9937         (malloc, realloc): Remove decls.
9938         (stpcpy): Likewise.
9939         ("xalloc.h"): Include.
9940         (NAME_SIZE_DEFAULT): New macro.
9941         (savedir): Use xmalloc / xrealloc to allocate memory.
9942         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9943         Skip "" directory entries.
9944         Use strlen to calculate directory entry length, since the old method
9945         is rarely used these days and isn't worth supporting.
9946         Don't use a pointer after freeing it.
9947         Check for integer overflow when calculating allocation size.
9948         Use memcpy to copy entries, instead of stpcpy.
9949         Set errno properly when returning NULL.
9950         Check for readdir error.
9951
9952 2000-06-26  Jim Meyering  <meyering@lucent.com>
9953
9954         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9955
9956 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9957
9958         * getusershell.c (xmalloc, xrealloc): Remove functions.
9959         Include xalloc.h.
9960         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9961
9962 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9963
9964         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9965
9966 2000-06-24  Jim Meyering  <meyering@lucent.com>
9967
9968         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9969
9970 2000-06-21  Jim Meyering  <meyering@lucent.com>
9971
9972         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9973
9974 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9975
9976         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9977         (mbrtowc, mbstate_t): Define substitutes if
9978         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9979         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9980         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9981
9982 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9983
9984         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9985         than 1024, return a memory chunk of least possible size, instead
9986         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9987         Use free/xmalloc instead of xrealloc to avoid copying for very long
9988         paths.
9989
9990 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9991
9992         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9993         address, not strdup.  Include <stdlib.h> and don't declare free().
9994
9995 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9996
9997         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9998         the empty string.
9999
10000 2000-06-21  Jim Meyering  <meyering@lucent.com>
10001
10002         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10003         (noinst_HEADERS): Add getstr.h.
10004
10005         * getline.c (getstr): Move into a separate file.
10006         * getstr.c (getstr): New file, extracted from getline.c, with
10007         the following changes: new parameter, delim2; both delim[12]
10008         parameters have type `int', not `char'.  The latter would lose
10009         with 8-bit delimiters.
10010         * getstr.h: New file.
10011
10012 2000-06-19  Jim Meyering  <meyering@lucent.com>
10013
10014         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10015
10016 2000-06-18  Jim Meyering  <meyering@lucent.com>
10017
10018         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10019         Besides, these days every porting target provides a mkdir function.
10020
10021         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10022         (this snippet comes from src/system.h).
10023
10024 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10025
10026         * human.c (adjust_value): New function.
10027         (human_readable_inexact): Apply rounding style even when
10028         printing approximate values.
10029
10030 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10031
10032         * human.c (human_readable_inexact): Allow an input block
10033         size that is not a multiple of the output block size, and vice versa.
10034         Reported by Piergiorgio Sartor.
10035
10036 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10037
10038         * getdate.y (get_date): Apply relative times after time
10039         zone indicator, not before.  Reported by Todd A. Jacobs.
10040
10041 2000-06-13  Jim Meyering  <meyering@lucent.com>
10042
10043         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10044
10045         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10046
10047 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10048
10049         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10050
10051 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10052
10053         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10054
10055 2000-06-04  Jim Meyering  <meyering@lucent.com>
10056
10057         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10058         SunOS 4.1.4 for which gid_t is an unsigned type.
10059
10060 2000-06-03  Jim Meyering  <meyering@lucent.com>
10061
10062         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10063
10064 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10065
10066         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10067         newer, don't install charset.alias.
10068         * config.charset: Change the Linux/glibc rules so they become empty
10069         on glibc-2.1 or newer.
10070
10071 2000-06-02  Jim Meyering  <meyering@lucent.com>
10072
10073         * mountlist.c: Back out last change.  Instead, do this...
10074         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10075         member using the same `ignore'-testing code.
10076         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10077         fs_type strings.
10078         From Mark D. Roth.
10079
10080 2000-05-29  Jim Meyering  <meyering@lucent.com>
10081
10082         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10083         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10084
10085 2000-05-22  Jim Meyering  <meyering@lucent.com>
10086
10087         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10088
10089 2000-05-18  Jim Meyering  <meyering@lucent.com>
10090
10091         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10092         back, too, since it may have been modified by allocate_entry.
10093         (hash_delete): Rewrite to use neither the assignment operator
10094         nor the comma operator in an if-expression.
10095
10096 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10097
10098         * closeout.c:
10099         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10100         Remove; no longer needed.
10101         "quotearg.h": Add include.
10102         (file_name): Do not bother to explicitly initialize to NULL; it's less
10103         efficient on some hosts.
10104         (close_stdout_status): Remove test as to whether stdout was already
10105         closed; it breaks for the case "echo x | sort >&-".
10106         Quote file name colons.
10107         Do not assume that _("write error") lacks format strings.
10108
10109 2000-05-15  Jim Meyering  <meyering@lucent.com>
10110
10111         * version-etc.c (version_etc_copyright): Update the copyright string
10112         used in all --version output.
10113
10114 2000-05-14  Jim Meyering  <meyering@lucent.com>
10115
10116         * closeout.c (close_stdout_set_file_name): New function.
10117         (close_stdout_status): Use new file-scoped global.
10118         Return right away if fstat says the stdout file descriptor is invalid.
10119         * closeout.h (close_stdout_set_file_name): Declare.
10120
10121 2000-05-10  Jim Meyering  <meyering@lucent.com>
10122
10123         * closeout.c [default_exit_status]: New file-scoped variable.
10124         (close_stdout_set_status): New function.
10125         * closeout.h (close_stdout_set_status): Declare.
10126
10127 2000-05-08  Jim Meyering  <meyering@lucent.com>
10128
10129         * long-options.c: Don't include closeout.h.
10130         (parse_long_options): Don't call close_stdout for --version.
10131
10132 2000-05-06  Jim Meyering  <meyering@lucent.com>
10133
10134         * strnlen.c: Undefine __strnlen and strnlen.
10135         [!weak_alias]: Define __strnlen to strnlen.
10136
10137         * atexit.c: New file, from libiberty.
10138
10139 2000-05-06  Jim Meyering  <meyering@lucent.com>
10140
10141         * closeout.c (close_stdout_status): Also check for errors on the
10142         stderr stream.
10143
10144 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10145
10146         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10147         instead of xmalloc, xrealloc, path_concat.
10148         (locale_charset): Treat empty environment variables as absent.
10149         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10150
10151 2000-05-04  Jim Meyering  <meyering@lucent.com>
10152
10153         * getopt.c: Update from glibc.
10154         * obstack.c: Likewise.
10155         * obstack.h: Likewise.
10156         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10157
10158         * regex.h: Likewise.
10159         * strndup.c: Likewise.
10160         * strnlen.c: New file, from glibc.
10161
10162 2000-05-01  Jim Meyering  <meyering@lucent.com>
10163
10164         * full-write.c (full_write): Remove `FIXME' part of comment.
10165
10166 2000-04-29  Jim Meyering  <meyering@lucent.com>
10167
10168         * path-concat.c: Declare strdup only if it's not defined.
10169         * canon-host.c: Likewise.
10170
10171 2000-04-28  Jim Meyering  <meyering@lucent.com>
10172
10173         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10174         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10175         included first, then limits.h is included by locale.h by libintl.h.
10176         From John David Anglin.
10177
10178 2000-04-25  Jim Meyering  <meyering@lucent.com>
10179
10180         * makepath.c (S_IRWXUGO): Define.
10181         (make_path): Always perform explicit chmod if MODE specifies any
10182         of the `special' permission bits.  Prompted by a bug report against
10183         install from Mate Wierdl and Joost van Baal.
10184
10185 2000-04-18  Jim Meyering  <meyering@lucent.com>
10186
10187         * README: New file.
10188
10189         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10190         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10191
10192 2000-04-17  Jim Meyering  <meyering@lucent.com>
10193
10194         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10195         the definition of it to rpl_strftime also defined-away the system's
10196         declaration.
10197
10198 2000-04-15  Jim Meyering  <meyering@lucent.com>
10199
10200         Use `C' to denote so-called `contiguous' files, the same way
10201         that tar does.
10202         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10203         (ftypelet): Use S_ISCTG.
10204         From Michael Deutschmann.
10205
10206 2000-04-14  Jim Meyering  <meyering@lucent.com>
10207
10208         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10209
10210 2000-04-08  Jim Meyering  <meyering@lucent.com>
10211
10212         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10213         names don't conflict.  Reported by Eli Zaretskii.
10214
10215 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10216
10217         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10218         bug.  Deal with the different error behavior of Irix iconv.
10219
10220 2000-04-07  Jim Meyering  <meyering@lucent.com>
10221
10222         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10223         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10224
10225 2000-04-05  Jim Meyering  <meyering@lucent.com>
10226
10227         Portability tweaks required for ultrix4.3.
10228         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10229         * readutmp.c: Include sys/types.h before sys/stat.h.
10230         * canon-host.c: Declare strdup.
10231         * path-concat.c: Likewise.
10232         From John David Anglin.
10233
10234 2000-04-04  Jim Meyering  <meyering@lucent.com>
10235
10236         Be more DOS 8.3-friendly.
10237         * ref-add.sin: Renamed from ref-add.sed.in.
10238         * ref-del.sin: Renamed from ref-del.sed.in.
10239         * Makefile.am: Reflect renaming.
10240         Reported by Eli Zaretskii.
10241
10242         Use a temporary file name that won't clash with `charset.alias'
10243         in the DOS 8.3 name space.
10244         * Makefile.am (charset_tmp): Define.
10245         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10246         (uninstall-local): Likewise.
10247         Reported by Eli Zaretskii.
10248
10249 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10250
10251         * time/strftime.c (my_strftime): Make sure we call the system
10252         strftime, not ourselves, when invoking the underlying strftime.
10253
10254 2000-03-24  Jim Meyering  <meyering@lucent.com>
10255
10256         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10257         (charset_alias): Define.
10258         (install-exec-local): Factor out common code.
10259         (uninstall-local): Split lines longer than 80.
10260         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10261         (SUFFIXES): Define.
10262         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10263         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10264
10265 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10266
10267         * config.charset: Output a line containing "Packages using this file".
10268         * ref-add.sed.in, ref-del.sed.in: New files.
10269         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10270         ref-del.sed): New rules.
10271
10272 2000-03-17  Jim Meyering  <meyering@lucent.com>
10273
10274         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10275         Otherwise, include <strings.h>
10276
10277 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10278
10279         * unicodeio.c (utf8_wctomb): New function.
10280         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10281         format instead of in UCS-4 with platform dependent endianness.
10282
10283 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10284
10285         * savedir.c (savedir): Work even if directory size is
10286         negative; this can happen with some screwy NFS configurations.
10287
10288 2000-03-06  Jim Meyering  <meyering@lucent.com>
10289
10290         * localcharset.c (get_charset_aliases): Don't try to free file_name
10291         if it's NULL (because we ran out of memory).  From Bruno Haible.
10292
10293 2000-03-05  Jim Meyering  <meyering@lucent.com>
10294
10295         * localcharset.c ("path-concat.h"): Include.
10296         (get_charset_aliases): Use path_concat instead of ANSI string
10297         concatenation.
10298
10299         * unicodeio.h (PARAMS): Define.
10300         Use it to guard prototype.
10301
10302 2000-03-04  Jim Meyering  <meyering@lucent.com>
10303
10304         * Makefile.am (install-exec-local): Create $(libdir) before installing
10305         into it.
10306         (uninstall-local): Uncomment this rule so `make distcheck' works
10307         once again.
10308
10309         * unicodeio.c (<errno.h>): Include it.
10310         (errno): Declare if not defined.
10311
10312         * localcharset.c: Add Bruno's comment justifying use of volatile.
10313
10314         * config.charset: New version, incorporating remarks from a linux
10315         i18n mailing list.  From Bruno Haible.
10316
10317 2000-03-02  Jim Meyering  <meyering@lucent.com>
10318
10319         * Makefile.am (EXTRA_DIST): Add config.charset.
10320
10321 2000-03-01  Jim Meyering  <meyering@lucent.com>
10322
10323         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10324         * unicodeio.c: Likewise.
10325
10326 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10327
10328         * config.charset: New file.
10329         * localcharset.c: New file.
10330         * unicodeio.h, unicodeio.c: New files.
10331         * Makefile.am (DEFS): Add -DLIBDIR=...
10332         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10333         (noinst_HEADERS): Add unicodeio.h.
10334         (all-local, install-exec-local, charset.alias): New targets.
10335
10336 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10337
10338         * quotearg.c (ALERT_CHAR): New macro.
10339         (quotearg_buffer_restyled): Use it.
10340
10341 2000-02-27  Jim Meyering  <meyering@lucent.com>
10342
10343         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10344         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10345
10346         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10347         not `#if STDC_HEADERS'.
10348         Declare malloc if needed.
10349
10350         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10351         now that autoconf always defines the HAVE_DECL_ symbols.
10352         * human.c: Likewise.
10353         * same.c: Likewise.
10354         * strtoumax.c: Likewise.
10355
10356         * backupfile.c: Arrange for cpp to fail if the configure-time
10357         declaration check was not run.
10358         * hash.c: Likewise.
10359         * human.c: Likewise.
10360         * same.c: Likewise.
10361         * strtoumax.c: Likewise.
10362
10363         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10364         then first look up the entire `.'-containing string as a login name.
10365
10366 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10367
10368         * getdate.y: Handle two-digit years with leading zeros correctly.
10369         (textint): New typedef.
10370         (parser_control): Member year changed from int to textint.
10371         All uses changed.
10372         (YYSTYPE): Removed; replaced by %union with int and textint members.
10373         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10374         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10375         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10376         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10377         (date, number, to_year): Use width of number in digits, not its value,
10378         to determine whether it's a 2-digit year, or a 2-digit time.
10379         (yylex): Store number of digits of numeric tokens.
10380         Reported by John Kendall.
10381
10382         (parser_control): Changed from struct parser_control to typedef (for
10383         consistency).  All uses changed.
10384
10385         (tID): Removed; not used.
10386         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10387
10388 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10389
10390         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10391         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10392
10393 2000-02-12  Jim Meyering  <meyering@lucent.com>
10394
10395         * userspec.c (ISDIGIT): Define it.
10396         (isdigit): Remove definition.
10397         (is_number): Use ISDIGIT, not isdigit.
10398         <libintl.h>: Include.
10399         (_ and N_): Define.
10400         (parse_user_spec): Mark translatable strings.
10401
10402 2000-02-10  Jim Meyering  <meyering@lucent.com>
10403
10404         With these changes, nanosleep.[ch] are finally enough like the other
10405         lib/* replacement files to compile on a few more losing systems.
10406
10407         * nanosleep.h: Don't include config.h.
10408         Remove prototype from declaration of nanosleep.
10409         (PARAMS): Remove now-unneeded definition.
10410         * nanosleep.c: #undef nanosleep.
10411         (rpl_nanosleep): Rename from nanosleep.
10412
10413 2000-02-03  Jim Meyering  <meyering@lucent.com>
10414
10415         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10416         rather than with `#if HAVE_UTMPNAME'.
10417
10418 2000-02-01  Jim Meyering  <meyering@lucent.com>
10419
10420         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10421
10422 2000-01-31  Jim Meyering  <meyering@lucent.com>
10423
10424         * nanosleep.h (nanosleep): Guard declaration with
10425         `#if ! HAVE_DECL_NANOSLEEP'.
10426         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10427         the declaration in that vendor's sys/timers.h.
10428         Reported by Christian Krackowizer.
10429
10430         * quotearg.c (ISASCII): Add #undef and move definition to follow
10431         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10432         (ISPRINT): Likewise.
10433         Reported by Tom Tromey.
10434
10435 2000-01-30  Jim Meyering  <meyering@lucent.com>
10436
10437         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10438         uses of ->ut_name.  The latter doesn't work with new Linux header files
10439         where only utmpx.ut_user is declared.
10440
10441         * readutmp.h (UT_USER): Define.
10442
10443 2000-01-23  Jim Meyering  <meyering@lucent.com>
10444
10445         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10446         obstack.c.
10447
10448 2000-01-22  Jim Meyering  <meyering@lucent.com>
10449
10450         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10451         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10452         Required for some AIX systems.  Reported by Christian Krackowizer.
10453         [TESTING] (main): New function.
10454
10455         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10456         * dirname.c (dir_name): Support for DOS-style file names with drive
10457         letters.
10458
10459         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10460
10461         * strverscmp.c (ISDIGIT): Define.
10462         (strverscmp): Use ISDIGIT, not isdigit.
10463
10464 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10465
10466         * nanosleep.c (nanosleep):
10467         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10468         POSIX.1 doesn't require SA_INTERRUPT and some systems
10469         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10470         it's been part of POSIX.1 since day 1 (in 1988).
10471
10472 2000-01-17  Jim Meyering  <meyering@lucent.com>
10473
10474         * interlock: Remove unused file.  Reported by François Pinard.
10475
10476 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10477
10478         * quotearg.c (quotearg_buffer_restyled): Do not quote
10479         alert, backslash, formfeed, and vertical tab unnecessarily in
10480         shell quoting style.
10481
10482
10483 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10484 Free Software Foundation, Inc.
10485 Copying and distribution of this file, with or without modification,
10486 are permitted provided the copyright notice and this notice are preserved.