ccb82bff5c3575e5df86707e8ef3a1800be85a4d
[pspp] / lib / ChangeLog
1 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * fcntl_.h: New file.
4         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
5         the fcntl module.
6         * dirchownmod.c: Likewise.
7         * fts.c: Likewise.
8
9         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
10         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
11         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
12         just before including <inttypes.h>, to avoid circular inclusion.
13
14 2006-08-28  Bruno Haible  <bruno@clisp.org>
15
16         * inttypes_.h (SCNX*): Remove definitions.
17         Reported by Eric Blake.
18
19 2006-08-26  Bruno Haible  <bruno@clisp.org>
20
21         * vasnprintf.c (EOVERFLOW): Remove definition.
22         (VASNPRINTF): Return a string of length > INT_MAX without failing.
23         * vasprintf.c: Include errno.h, limits.h.
24         (EOVERFLOW): New fallback definition.
25         (vasprintf): Test here whether the string length is > INT_MAX.
26         * vsnprintf.c: Include errno.h, limits.h.
27         (EOVERFLOW): New fallback definition.
28         (vsnprintf): Fix bug when generated string was too long for the buffer.
29         Test here whether the string length is > INT_MAX.
30
31 2006-08-26  Bruno Haible  <bruno@clisp.org>
32             Simon Josefsson  <jas@extundo.com>
33
34         BeOS portability.
35         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
36
37 2006-08-28  Bruno Haible  <bruno@clisp.org>
38
39         * c-strstr.h: New file, from GNU gettext.
40         * c-strstr.c: New file, from GNU gettext.
41
42 2006-08-26  Bruno Haible  <bruno@clisp.org>
43
44         * inttypes_.h: New file.
45         * inttypes.h: Remove file.
46         * stdint_.h: Include <inttypes.h> through its absolute filename.
47
48         * imaxabs.c: New file.
49
50         * imaxdiv.c: New file.
51
52 2006-08-22  Bruno Haible  <bruno@clisp.org>
53
54         * readutmp.h: Skip most definitions if neither <utmp.h> nor
55         <utmpx.h> exists.
56
57 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
58
59         BeOS portability.
60         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
61         Problem reported by Bruno Haible.
62
63 2006-08-21  Bruno Haible  <bruno@clisp.org>
64
65         BeOS portability.
66         * mbchar.h: Include <wctype.h> only if it exists.
67
68 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
69
70         * cycle-check.h: Include <stdint.h> unconditionally, since we
71         now assume the stdint module.  Do not include inttypes.h.
72         * fsusage.h: Likewise.
73         * getndelim2.c: Likewise.
74         * human.h: Likewise.
75         * inttostr.h: Likewise.
76         * obstack.c: Likewise.
77         * regex_internal.h: Likewise.
78         * tempname.c: Likewise.
79         * utimecmp.c: Likewise.
80         * xstrtol.h: Likewise.
81
82         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
83
84         * strtoimax.c: Adjust to macro name changes in Autoconf,
85         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
86         * xtime.h: Likewise.
87
88 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
89
90         * fchmodat.c: New file, from coreutils.  This was inadvertently
91         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
92
93 2006-08-18  Bruno Haible  <bruno@clisp.org>
94
95         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
96         (ME_DUMMY): Treat "kernfs" as a dummy.
97         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
98
99 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
100
101         Update from coreutils.
102
103         * __fpending.h: Add copyright notice.
104         * fprintftime.h: Likewise.
105         * savedir.c: Use (C) in copyright notice.
106         * savedir.h: Likewise.
107
108         2006-08-15  Jim Meyering  <jim@meyering.net>
109
110         * at-func.c: New file, with the logic of all emulated at-functions.
111         * openat-priv.h: Include <errno.h> and define ENOSYS,
112         in support of the EXPECTED_ERRNO macro.
113         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
114         Instead, define the appropriate symbols and include "at-func.c".
115         * mkdirat.c (mkdirat): Likewise.
116         * fchmodat.c (fchmodat): Likewise.
117         (ENOSYS): Remove definition.
118         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
119         Don't include "unistd--.h" -- it wasn't ever used.
120
121         2006-01-17  Jim Meyering  <jim@meyering.net>
122
123         Rewrite fts.c not to change the current working directory,
124         by using openat, fstatat, fdopendir, etc..
125
126         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
127         (HAVE_OPENAT_SUPPORT): Define.
128         [_LIBC] (fchdir): Don't undef or define; no longer used.
129         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
130         Now, this `function' always succeeds, and consumes its file descriptor
131         parameter -- so callers must not close such FDs.  Update callers.
132         (diropen_fd, opendirat, cwd_advance_fd): New functions.
133         (diropen): Add parameter, SP.  Adjust all callers.
134         Implement using diropen_fd, rather than open.
135         (fts_open): Initialize new member, fts_cwd_fd.
136         Remove fts_rft-setting code.
137         (fts_close): Close fts_cwd_fd, if necessary.
138         (__opendir2): Define in terms of opendir or opendirat,
139         depending on whether the FST_NOCHDIR flag is set.
140         (fts_build): Since fts_safe_changedir consumes its FD, and since
141         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
142         and close the dup'd file descriptor upon failure.
143         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
144         (fts_safe_changedir): Tweak semantics to reflect that this function
145         now calls cwd_advance_fd and hence consumes its FD argument.
146         * fts_.h [struct FTS] (fts_cwd_fd): New member.
147         [struct FTS] (fts_rft): Remove now-unused member.
148         [struct FTS] (fts_cycle.state): Improve comment.
149
150         * openat.c (openat_needs_fchdir): New function.
151         * openat.h (openat_needs_fchdir): Declare it.
152
153 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
154
155         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
156         Problem and fix reported by Pádraig Brady in
157         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
158
159 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
160
161         * memcoll.c (memcoll): Optimize for the common case where the
162         arguments are bytewise equal.
163
164 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
165
166         Change copyright notice from LGPL 2 to GPL 2, since that's the
167         standard form used in the gnulib repository.
168         * lock.c: LGPL -> GPL.
169         * lock.h: Likewise.
170         * strnlen1.c: Likewise.
171         * strnlen1.h: Likewise.
172         * tls.c: Likewise.
173         * tls.h: Likewise.
174         * tmpdir.c: Likewise.
175
176         * TODO: Remove; this belongs only in coreutils.
177
178 2006-08-14  Eric Blake  <ebb9@byu.net>
179
180         Import the following change from libc:
181
182         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
183
184         Upstream bug 2997.
185         * misc/error.c: Add space between program name and message if file
186         name is missing.
187
188 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
189
190         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
191         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
192
193         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
194         in wchar_t.  Problem reported by Eric Blake.
195
196         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
197         LEN is smaller than SIZE.  Suggested by Bruno Haible.
198         Also, help the compiler to keep LEN in a register.
199
200 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
201
202         * .cppi-disable: Add snprintf.h, socket_.h.
203         * snprintf.c: Include <errno.h> and <limits.h>.
204         (EOVERFLOW): Define if the system does not.
205         Do not include "minmax.h"; it wasn't used.
206         (snprintf): Don't assume size_t promotes to an unsigned type.
207         Fix bug when generated string was too long for the buffer: the
208         buffer's contents are supposed to be the initial prefix of the
209         output.  Don't assume vasnprintf returns EOVERFLOW if the size
210         exceeds INT_MAX; do the check ourselves.
211
212         Import the following changes from libc:
213
214         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
215
216         * posix/regex_internal.c (re_string_skip_chars): If no character has
217         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
218         to the byte which couldn't be converted.
219         (re_string_reconstruct): Don't clear valid_raw_len before calling
220         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
221         tip_context using re_string_context_at.
222
223         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
224
225         * posix/regex.h: g++ still cannot handled [restrict].
226
227         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
228
229         * posix/regex.h: Remove special handling for VMS.
230
231 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
232
233         Sync from coreutils.
234
235         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
236
237         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
238         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
239
240 2006-08-08  Eric Blake  <ebb9@byu.net>
241
242         * verror.c (verror_at_line): Work around glibc bug 2997, so that
243         verror_at_line output complies with GNU Coding Standards even when
244         file is NULL.
245
246 2006-08-08  Eric Blake  <ebb9@byu.net>
247
248         * verror.h, verror.c: New files.
249
250 2006-08-07  Bruno Haible  <bruno@clisp.org>
251
252         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
253         versions of AIX.
254         Reported by Ralf Wildenhues.
255
256 2006-08-06  Eric Blake  <ebb9@byu.net>
257
258         * error.h: Fold in some upstream changes from glibc.
259         * error.c: Likewise.
260
261 2006-07-29  Bruno Haible  <bruno@clisp.org>
262
263         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
264
265 2006-07-29  Bruno Haible  <bruno@clisp.org>
266
267         * setenv.c: Undo unintended modification done on 2006-02-27.
268
269 2006-07-28  Eric Blake  <ebb9@byu.net>
270
271         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
272         macro expansion.
273
274 2006-07-28  Simon Josefsson  <jas@extundo.com>
275
276         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
277         #include's.
278
279 2006-07-28  Simon Josefsson  <jas@extundo.com>
280
281         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
282         #include's.
283
284 2006-07-28  Bruno Haible <bruno@clisp.org>
285
286         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
287
288 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
289
290         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
291         arpa/inet.h.
292
293 2006-07-28  Bruno Haible  <bruno@clisp.org>
294
295         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
296         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
297         fallbacks.
298         Avoids link error on FreeBSD 4.x.
299         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
300
301         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
302         encoding.
303         * mbswidth.c (iswcntrl): Likewise.
304
305 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
306
307         * modechange.c (mode_compile): Numeric modes now affect setuid and
308         setgid on directories only if they set these bits.
309         * modechange.h: Remove obsolete comment about masks.
310
311 2006-07-27  Bruno Haible  <bruno@clisp.org>
312
313         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
314         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
315         defined.
316
317 2006-07-26  Eric Blake  <ebb9@byu.net>
318
319         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
320         like mingw that lack mkstemp.
321         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
322         avoid compilation warning on mingw.
323
324 2006-07-25  Bruno Haible  <bruno@clisp.org>
325
326         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
327         <stdarg.h> or config.h.
328
329 2006-07-24  Bruno Haible  <bruno@clisp.org>
330
331         * clean-temp.h: New file, from GNU gettext.
332         * clean-temp.c: New file, from GNU gettext.
333
334 2006-07-24  Bruno Haible  <bruno@clisp.org>
335
336         * tmpdir.h: New file, from GNU gettext.
337         * tmpdir.c: New file, from GNU gettext.
338
339 2006-07-23  Bruno Haible  <bruno@clisp.org>
340
341         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
342         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
343         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
344         gl_linked_remove_at): Use it.
345
346 2006-07-23  Eric Blake  <ebb9@byu.net>
347
348         * tmpfile-safer.c: New file.
349         * stdio-safer.h (fopen_safer): Add prototype.
350         * stdio--.h (tmpfile): Make safer.
351
352 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
353
354         * close-stream.c, close-stream.h: New files.
355
356 2006-07-22  Bruno Haible  <bruno@clisp.org>
357
358         Merge from GNU gettext 0.15.
359
360         2005-07-05  Bruno Haible  <bruno@clisp.org>
361
362                 * printf-args.c (printf_fetchargs): Work around broken
363                 definition of wint_t on mingw.
364
365         2005-02-12  Bruno Haible  <bruno@clisp.org>
366
367                 * xallocsa.h: Add extern "C" for C++.
368
369         2006-05-17  Bruno Haible  <bruno@clisp.org>
370
371                 Cygwin portability.
372                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
373
374         2006-04-30  Bruno Haible  <bruno@clisp.org>
375
376                 * progreloc.c: Include <mach-o/dyld.h> if available.
377                 (find_executable): Use _NSGetExecutablePath when possible.
378
379         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
380
381                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
382                 function.
383
384         2005-12-29  Bruno Haible  <bruno@clisp.org>
385
386                 * progreloc.c (set_program_name_and_installdir): Fix
387                 compilation error.
388
389         2005-12-04  Bruno Haible  <bruno@clisp.org>
390
391                 Cygwin portability.
392                 * progreloc.c: Include <windows.h> also on Cygwin.
393                 (find_executable): Add support for Cygwin.
394                 (set_program_name_and_installdir): Handle also platforms with
395                 nonempty EXEEXT.
396
397         2006-07-11  Bruno Haible  <bruno@clisp.org>
398
399                 * javacomp.c: Fix a comment.
400                 Reported by Jim Meyering.
401
402         2006-04-30  Bruno Haible  <bruno@clisp.org>
403
404                 * javacomp.h (compile_java_class): Add source_version,
405                 target_version arguments.
406                 * javacomp.c: Rewritten to choose only a compiler that
407                 respects the specified source_version and target_version.
408
409         2006-06-27  Bruno Haible  <bruno@clisp.org>
410
411                 Assume correct S_ISDIR macro.
412                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
413
414         2006-07-22  Bruno Haible  <bruno@clisp.org>
415
416                 * javaversion.h: New file, from GNU gettext.
417                 * javaversion.c: New file, from GNU gettext.
418                 * javaversion.java: New file, from GNU gettext.
419                 * javaversion.class: New file, from GNU gettext.
420
421         2006-05-17  Bruno Haible  <bruno@clisp.org>
422
423                 Cygwin portability.
424                 * javaexec.c (execute_java_class): Test for jview program
425                 also on Cygwin.
426
427         2006-04-09  Bruno Haible  <bruno@clisp.org>
428
429                 * fatal-signal.c: Don't include string.h.
430                 (at_fatal_signal): Use a copying loop instead of memcpy.
431
432         2005-12-04  Bruno Haible  <bruno@clisp.org>
433
434                 * csharpexec.c: Add support for 'clix' launcher (untested).
435                 (execute_csharp_using_sscli): New function.
436                 (execute_csharp_program): Call it.
437
438         2006-06-21  Bruno Haible  <bruno@clisp.org>
439
440                 Avoid warnings from recent versions of mcs.
441                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
442                 -o, -L, -r any more. Use options documented since mcs-1.0
443                 instead. Similarly for -g.
444
445         2005-07-09  Bruno Haible  <bruno@clisp.org>
446
447                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
448                 add a .dll suffix.
449                 Reported by Mark Junker <mjscod@gmx.de>.
450
451         2006-06-17  Bruno Haible  <bruno@clisp.org>
452
453                 * config.charset: Update for NetBSD 3.0.
454
455         2006-05-17  Bruno Haible  <bruno@clisp.org>
456
457                 Cygwin portability.
458                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
459
460         2006-05-16  Bruno Haible  <bruno@clisp.org>
461
462                 * localcharset.c [CYGWIN]: Include <windows.h>.
463                 (get_charset_aliases): For Cygwin, return the same CPxxx
464                 aliases list as under WIN32.
465                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
466                 the environment variables. Fall back to GetACP().
467
468         2006-04-05  Bruno Haible  <bruno@clisp.org>
469
470                 * config.charset: Update Juan Manuel Guerrero's address.
471
472         2005-02-12  Bruno Haible  <bruno@clisp.org>
473
474                 * allocsa.h: Add extern "C" for C++.
475
476         2005-02-10  Bruno Haible  <bruno@clisp.org>
477
478                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
479                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
480
481         2006-07-22  Bruno Haible  <bruno@clisp.org>
482
483                 * gettext.h: Update to GNU gettext-0.15.
484
485 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
486         and Simon Josefsson <jas@extundo.com>
487
488         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
489
490         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
491
492 2006-07-21  Eric Blake  <ebb9@byu.net>
493
494         * stdlib-safer.h: New file from coreutils, required by
495         stdlib--.h.
496
497 2006-07-19  Derek R. Price  <derek@ximbiot.com>
498
499         * getaddrinfo.h: Don't define unimplemented AI_* flags.
500         Reindent and repaginate.
501
502 2006-07-17  Bruno Haible  <bruno@clisp.org>
503
504         * gl_list.h: New file.
505         * gl_list.c: New file.
506         * gl_array_list.h: New file.
507         * gl_array_list.c: New file.
508         * gl_carray_list.h: New file.
509         * gl_carray_list.c: New file.
510         * gl_linked_list.h: New file.
511         * gl_linked_list.c: New file.
512         * gl_anylinked_list1.h: New file.
513         * gl_anylinked_list2.h: New file.
514         * gl_avltree_list.h: New file.
515         * gl_avltree_list.c: New file.
516         * gl_anyavltree_list1.h: New file.
517         * gl_anyavltree_list2.h: New file.
518         * gl_rbtree_list.h: New file.
519         * gl_rbtree_list.c: New file.
520         * gl_anyrbtree_list1.h: New file.
521         * gl_anyrbtree_list2.h: New file.
522         * gl_anytree_list1.h: New file.
523         * gl_anytree_list2.h: New file.
524         * gl_linkedhash_list.h: New file.
525         * gl_linkedhash_list.c: New file.
526         * gl_anyhash_list1.h: New file.
527         * gl_anyhash_list2.h: New file.
528         * gl_avltreehash_list.h: New file.
529         * gl_avltreehash_list.c: New file.
530         * gl_rbtreehash_list.h: New file.
531         * gl_rbtreehash_list.c: New file.
532         * gl_anytreehash_list1.h: New file.
533         * gl_anytreehash_list2.h: New file.
534
535         * gl_oset.h: New file.
536         * gl_oset.c: New file.
537         * gl_array_oset.h: New file.
538         * gl_array_oset.c: New file.
539         * gl_avltree_oset.h: New file.
540         * gl_avltree_oset.c: New file.
541         * gl_rbtree_oset.h: New file.
542         * gl_rbtree_oset.c: New file.
543         * gl_anytree_oset.h: New file.
544
545 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
546
547         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
548         New files.
549         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
550         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
551         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
552         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
553         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
554         callers changed.  Revamp internals significantly, by not
555         attempting to create directories that are temporarily more
556         permissive than the final results.  Do not attempt to use
557         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
558         This removes some race conditions, fixes some bugs, and simplifies
559         things.  Use new dirchownmod function to do owner and mode changes.
560         * mkdir-p.h: Likewise.
561         * modechange.c (octal_to_mode): New function.
562         (struct mode_change): New member mentioned.
563         (make_node_op_equals): New arg mentioned.  All callers changed.
564         (mode_compile): Keep track of which mode bits the user has explicitly
565         mentioned.
566         (mode_adjust): New arg DIR, so that we implement the X op correctly.
567         New arg PMODE_BITS, to keep track of which mode bits the user
568         mentioned; it treats S_ISUID and S_ISGID speciall.
569         All callers changed.
570         * modechange.h: Likewise.
571
572 2006-07-11  Derek R. Price  <derek@ximbiot.com>
573
574         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
575
576 2006-07-10  Derek R. Price  <derek@ximbiot.com>
577
578         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
579         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
580         macros into the GNU _D_EXACT_NAMLEN.
581         * savedir.c:  Likewise.
582         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
583
584 2006-07-09  Jim Meyering  <jim@meyering.net>
585
586         * argp-pv.c: Remove a doubled word in a comment.
587         * check-version.c (check_version): Likewise.
588         * javacomp.c (compile_java_class): Likewise.
589
590 2006-07-08  Jim Meyering  <jim@meyering.net>
591
592         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
593
594 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
595
596         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
597         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
598         brackets.  Other minor changes to suppress some compiler
599         warnings.
600
601 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
602
603         * getloadavg.c: Use __VMS, not VMS.
604         * getopt.c: Likewise.
605         * getpagesize.h: Likewise.
606         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
607         probably does not work.
608
609 2006-07-06  Derek R. Price  <derek@ximbiot.com>
610         and Paul Eggert  <eggert@cs.ucla.edu>
611
612         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
613         Don't worry about this obsolete case any more.
614         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
615         directories.
616         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
617         worry about this obsolete case any more.
618         * fts.c: Likewise.
619         * getcwd.c: Likewise.
620         * glob.h: Likewise.
621         * savedir.c: Likewise.
622
623 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
624
625         * .cppi-disable: Add wcwidth.
626         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
627         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
628         (ISGRAPH): Remove.  All uses changed to isgraph.
629         (FOLD) [!defined _LIBC]: Remove special case.
630         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
631         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
632         HAVE_ISBLANK.
633         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
634
635 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
636
637         * strtod.c (strtod): cast the argument of tolower to unsigned char.
638
639 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
640
641         * memcasecmp.c: Include <limits.h>.
642         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
643         * strtod.c (strtod): Don't assume isspace works on negative chars.
644         Don't assume isdigit succeeds only on '0' through '9'.
645
646 2006-07-05  Derek R. Price  <derek@ximbiot.com>
647
648         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
649         All uses of is_space replaced by isspace.
650         * exit.h: Don't talk about STDC_HEADERS.
651         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
652         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
653         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
654         replaced by isprint etc.
655         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
656         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
657         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
658         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
659         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
660         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
661
662 2006-07-05  Eric Blake  <ebb9@byu.net>
663
664         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
665         missing from netdb.h.
666         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
667
668 2006-06-27  Bruno Haible  <bruno@clisp.org>
669
670         Assume ANSI C header files and <ctype.h> functions.
671         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
672         (mbsnwidth): Use isprint, iscntrl instead.
673
674 2006-07-03  Jim Meyering  <jim@meyering.net>
675
676         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
677         macro is used before the first cycle_check call.
678
679 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
680
681         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
682         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
683         reported by Mark D. Baushke, one in
684         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
685
686         Merge from coreutils.
687
688         * .cppi-disable: Add stdint_.h.
689         * .cvsignore: Add stdint.h.
690
691         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
692
693         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
694         both double and long double versions.
695         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
696         * xstrtold.c: New file.
697         * xstrtod.h (xstrtold): New decl.
698
699         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
700
701         * filemode.c (setst): Remove.
702         (strmode): Rewrite to avoid setst.  This makes the code shorter,
703         (arguably) clearer, and the generated code is a bit smaller on my
704         Debian GNU/Linux stable x86 host.
705
706         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
707
708         * filemode.c: Include "filemode.h" first, to test the interface.
709         Assume that filemode.h includes sys/types.h and sys/stat.h.
710         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
711         (ftypelet): Reorder to put common cases first, for efficiency.
712         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
713         to do 'M'.
714         (strmode): Renamed from mode_string, and now stores 12 bytes instead
715         of 10, for compatibility with FreeBSD.  All callers changed.
716         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
717         that can't be deduced solely from st_mode.  First arg is now a const
718         pointer.
719         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
720         (strmode): Renamed from mode_string.
721         (filemodestring): New decl.
722         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
723         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
724         (S_ISPORT, S_ISWHT): New macros, if not already defined.
725
726         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
727
728         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
729         fsusage.h now does that.  Include fsusage.h first, to test interface.
730         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
731         at most one method (the old code could have generated decls that
732         didn't conform to C89, not that this was ever exercised).
733         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
734
735         2006-03-19  Jim Meyering  <jim@meyering.net>
736
737         Work even in a chroot where d_ino values for entries in "/"
738         don't match the stat.st_ino values for the same names.
739         * getcwd.c (__getcwd): When no d_ino value matches the target inode
740         number, iterate through all entries again, using lstat instead.
741         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
742         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
743
744         * getcwd.c (__getcwd): Clarify a comment.
745         Use memcpy in place of a call to strcpy.
746
747         2006-03-12  Jim Meyering  <jim@meyering.net>
748
749         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
750         that of the current directory (which we're about to chdir ".." out of),
751         then save the dev-ino of the parent, instead.
752
753         * same-inode.h (SAME_INODE): New file/macro.
754         * chdir-safer.c (SAME_INODE): Remove definition.
755         Include "same-inode.h", instead.
756         * same.c: Likewise.
757         * cycle-check.h: Include "same-inode.h".
758         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
759         * cycle-check.c (SAME_INODE): Remove definition.
760         * root-dev-ino.h: Include "same-inode.h".
761
762         2006-03-11  Eric Blake  <ebb9@byu.net>
763
764         * same.c (same_name): s/base_name/last_component/
765         * backupfile.c (check_extension, numbered_backup): Likewise.
766         * filenamecat.c (file_name_concat): Likewise.
767
768         2006-03-11  Eric Blake  <ebb9@byu.net>,
769                     Paul Eggert  <eggert@cs.ucla.edu>
770
771         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
772         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
773         drive prefix.
774         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
775         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
776         (last_component): New method.
777         * dirname.c (dir_len): Determine when drive letters need a
778         subsequent slash.  Preserve // when it is special.
779         (dir_name): Don't append dot when drive letter is absolute.
780         [TEST_DIRNAME]: Move into a full-blown gnulib test.
781         * basename.c (base_name): New semantics - malloc the result.
782         Preserve // when it is special.  Preserve relative files that look
783         like drive letters.
784         (base_len): Preserve // when it is special.
785         (last_component): New method, similar to old base_name semantics.
786         * stripslash.c (strip_trailing_slashes): Use last_component, not
787         base_name.  Strip redundant slashes from ///.
788
789 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
790
791         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
792         both are 64 bits, since this seems to be the tradition, and this
793         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
794         we ever run into a host that prefers long long to long in this
795         case, we'll need another configure-time test.  Problem reported by
796         Jim Meyering.
797
798 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
799
800         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
801         possible collision with system files.
802         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
803         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
804         WCHAR_MIN and WCHAR_MAX in this case.
805         (<stddef.h>): Do not include; no longer needed.
806         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
807         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
808         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
809         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
810         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
811         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
812         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
813         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
814         !defined(__c99))]: Include in this case too, since it's harmless
815         now.
816         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
817         dangerous to do so.
818         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
819         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
820         (_STDINT_MIN, _STDINT_MAX): New macros.
821         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
822         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
823         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
824         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
825         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
826         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
827         macros, not typedefs; this simplifies things quite a bit.
828         Use long int for all types narrower than int64_t.
829         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
830         Define in terms of long long int or int64_t or long int,
831         not int64_t or int32_t.  This saves some compile-time testing.
832         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
833         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
834         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
835         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
836         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
837         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
838         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
839         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
840         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
841         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
842         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
843         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
844         undef any previous version and define our own version, for
845         simplicity and consistency with the new macros for types.
846         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
847         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
848         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
849         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
850         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
851         @WINT_T_SUFFIX@ to keep things simple here.
852         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
853         Simplify by assuming typical 8/16/32/64 host, since we're
854         already doing that elsewhere anyway.
855         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
856         and assume long long int is 64 bits if available.  This
857         speeds up 'configure'.
858
859 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
860
861         * getaddrinfo.c: fixed typo
862
863 2006-06-29  Eric Blake  <ebb9@byu.net>
864
865         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
866         unused static function.
867
868 2006-06-29  Eric Blake  <ebb9@byu.net>
869
870         * stat_.h: New file.
871
872 2006-06-29  Derek R. Price  <derek@ximbiot.com>
873
874         * strftime.c: Assume strftime() exists.
875
876 2006-06-28  Bruno Haible  <bruno@clisp.org>
877
878         * getaddrinfo.h: Fix POSIX URL.
879         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
880         (use_win32_p): Make static.
881         (getaddrinfo): Reject service name if it is empty or does not consist
882         solely of decimal digits, or if its value is > 65535.
883         (getnameinfo): Remove useless casts.
884
885 2006-06-28  Derek R. Price  <derek@ximbiot.com>
886
887         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
888         Autoconf 2.60 says this stuff was obsolete.
889
890 2006-05-12  Bruno Haible  <bruno@clisp.org>
891
892         * mkdtemp.c [MINGW]: Include <io.h>.
893         (mkdir): Define using _mkdir.
894
895 2006-06-28  Bruno Haible  <bruno@clisp.org>
896
897         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
898         declaration for wcwidth.
899         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
900
901 2006-06-28  Eric Blake  <ebb9@byu.net>
902
903         * xvasprintf.h: Fix comments.
904
905 2006-06-28  Eric Blake  <ebb9@byu.net>
906
907         * mbchar.h (wcwidth): Include wcwidth.h.
908         * mbswidth.c (wcwidth): Move from here...
909         * wcwidth.h: ...to this new file.
910
911 2006-06-28  Simon Josefsson  <jas@extundo.com>
912
913         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
914         functions there.  It will succeed on Windows XP, but on Windows
915         2000 and (presumably) earlier, it will fail, and use the internal
916         re-implementation.
917         (use_win32_p): New function.
918         (getaddrinfo): Use strtoul on servname, to support numeric ports.
919         Support AI_NUMERICSERV to disable getservbyname.
920         (getnameinfo): New function, only supports
921         NI_NUMERICHOST|NI_NUMERICSERV for now.
922
923         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
924         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
925         getnameinfo.
926
927 2006-06-27  Bruno Haible  <bruno@clisp.org>
928
929         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
930
931 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
932
933         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
934         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
935         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
936
937 2006-06-26  Bruno Haible  <bruno@clisp.org>
938
939         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
940         WCHAR_MAX.
941         Reported by Mark D. Baushke and Larry Jones.
942
943 2006-06-26  Bruno Haible  <bruno@clisp.org>
944
945         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
946         in pre-C99 mode.
947         Suggested by Mark D. Baushke and Larry Jones.
948
949 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
950
951         * stdint_.h: Treat BSD/OS like OpenBSD.
952
953 2006-06-23  Bruno Haible  <bruno@clisp.org>
954
955         * stdint_.h: Treat IRIX like OpenBSD.
956
957 2006-06-23  Bruno Haible  <bruno@clisp.org>
958
959         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
960         ISO C 99 Technical Corrigendum 1.
961
962 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
963
964         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
965         Some compiler complained about some of them.  Problem reported by
966         Larry Jones in
967         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
968
969 2006-06-21  Simon Josefsson  <jas@extundo.com>
970
971         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
972         variable.
973
974         * socket_.h: Don't define WINVER.
975
976         * inet_pton.h, inet_pton.c: New file, taken from glibc but
977         slightly modified to work in gnulib.
978
979 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
980
981         * read-file.c (fread_file): Start with buffer allocation of
982         0 bytes rather than 1 byte; this simplifies the code.
983         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
984         code to free buffer and save/restore errno.
985         (internal_read_file): Remove unused local.
986
987 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
988
989         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
990         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
991         Problem reported by Denis Excoffier in
992         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
993
994 2006-06-19  Simon Josefsson  <jas@extundo.com>
995
996         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
997
998 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
999
1000         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1001
1002 2006-06-17  Bruno Haible  <bruno@clisp.org>
1003
1004         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1005
1006 2006-06-17  Bruno Haible  <bruno@clisp.org>
1007
1008         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1009         problem on Solaris 2.5.1.
1010
1011 2006-06-16  Eric Blake  <ebb9@byu.net>
1012
1013         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1014         * unicodeio.c [!defined errno]: Likewise.
1015         * strtol.c [!defined errno]: Likewise.
1016         * strtod.c [!defined errno]: Likewise.
1017
1018 2006-06-15  Bruno Haible  <bruno@clisp.org>
1019
1020         * stdint_.h: Rewritten to be fully auto-configured.
1021         Fixes bug on HP-UX/IA64.
1022
1023 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1024
1025         * getdate.y (__attribute__): Don't define if already defined.
1026         Problem reported by Larry Jones.
1027         * utimens.c (__attribute__): Likewise.
1028
1029 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1030
1031         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1032         reported by Andreas Schwab.
1033
1034 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1035             Bruno Haible  <bruno@clisp.org>
1036
1037         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1038
1039 2006-05-26  Martin Lambers  <marlam@marlam.de>
1040
1041         * getpass.c: Updates the test for the native W32 API, and adds
1042         missing includes, thus fixing compilation warnings.
1043
1044 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1045
1046         * tempname.c (small_open, large_open): New macros.
1047         (__open, __open64) [!_LIBC]: Remove.
1048         (__gen_tempname): Use small_open and large_open instead of __open
1049         and __open64.  This fixes a portability bug on HP-UX 11.11i
1050         reported by Simon Wing-Tang in
1051         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1052
1053 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1054
1055         * exclude.c (exclude_fnmatch): New function.
1056         (excluded_file_name): Call exclude_fnmatch.
1057         * exclude.h (excluded_file_name): New prototype
1058
1059 2006-05-24  Bruno Haible  <bruno@clisp.org>
1060
1061         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1062         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1063         Reported by Thorsten Maerz <torte@netztorte.de> via
1064         Aaron Stone <aaron@serendipity.cx>.
1065
1066 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1067
1068         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1069         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1070         (my_usleep): Don't mishandle maximum value.
1071
1072 2006-05-19  Jim Meyering  <jim@meyering.net>
1073
1074         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1075
1076 2006-05-17  Bruno Haible  <bruno@clisp.org>
1077
1078         Cygwin portability.
1079         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1080
1081 2006-05-17  Bruno Haible  <bruno@clisp.org>
1082
1083         * stdint_.h: Fix recognition of Cygwin.
1084
1085 2006-05-11  Jim Meyering  <jim@meyering.net>
1086
1087         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1088
1089 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1090
1091         * crc.c (crc32_update): Remove unnecessary L suffix.
1092         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1093         unwanted sign propagation, e.g., on hosts with 64-bit int.
1094         There still are some problems with reeelly weird theoretical hosts
1095         (e.g., 33-bit int) but it's not worth worrying about now.
1096         * sha1.c (rol): Likewise.
1097         (K1, K2, K3, K4): Remove unnecessary L suffix.
1098
1099 2006-05-10  Bruno Haible  <bruno@clisp.org>
1100
1101         * des.c: Cast to avoid warnings.
1102
1103 2006-05-10  Simon Josefsson  <jas@extundo.com>
1104
1105         * md4.c: Typo fix, update copyright years.
1106         (K1, K2): Don't use L because it turn computations into 64-bit on
1107         64-bit platforms.
1108
1109 2006-05-09  Bruno Haible  <bruno@clisp.org>
1110
1111         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1112         (EOVERFLOW): Define fallback value.
1113         (xstrcat): New function.
1114         (xvasprintf): Recognize the special case of a string concatenation.
1115
1116 2006-05-01  Bruno Haible  <bruno@clisp.org>
1117
1118         * stdint_.h: Shorter URL.
1119         * inttypes.h: Likewise.
1120
1121 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1122
1123         * verify.h: Document the internals better.  Most of this change
1124         was written by Bruno Haible.
1125
1126 2006-04-29  Bruno Haible  <bruno@clisp.org>
1127
1128         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1129         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1130
1131 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1132
1133         * getdate.y (get_date): When adding relative date, start with the
1134         initial time, not with the result of the first mktime call.
1135
1136 2006-04-23  Bruno Haible  <bruno@clisp.org>
1137
1138         * copy-file.c: Include <unistd.h> unconditionally.
1139         * execute.c: Likewise.
1140         * fatal-signal.c: Likewise.
1141         * findprog.c: Likewise.
1142         * mkdtemp.c: Likewise.
1143         * pipe.h: Likewise.
1144         * pipe.c: Likewise.
1145         * wait-process.h: Likewise.
1146
1147 2006-04-23  Bruno Haible  <bruno@clisp.org>
1148
1149         * fwriteerror.c (fwriteerror): Call fclose also when an error
1150         condition was already detected.
1151         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1152
1153 2006-04-19  Derek Price  <derek@ximbiot.com>
1154             Eric Blake  <ebb9@byu.net>
1155
1156         * inttypes.h: Correct grammar in comment.
1157
1158 2006-04-18  Derek Price  <derek@ximbiot.com>
1159             Paul Eggert  <eggert@cs.ucla.edu>
1160
1161         * inttypes.h: New file.
1162         * strtoimax.c: Assume <inttypes.h>.
1163
1164 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1165
1166         * utimens.c (futimens): glibc futimesat messes up if /proc
1167         isn't mounted.  Problem reported by Kir Kolyshkin.
1168
1169 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1170
1171         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1172         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1173         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1174
1175 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1176
1177         Merge regex changes from libc, removing some of our
1178         POSIX-conformance changes that were rejected and redoing them in a
1179         less-intrusive way.
1180
1181         * regcomp.c (re_compile_internal, init_dfa):
1182         Length arg is now size_t, not Idx.  All uses changed.
1183         (peek_token): Forward decl now says internal_function.
1184         (__re_error_msgid, __re_error_msgid_idx):
1185         Now static rather than extern with attribute_hidden.
1186         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1187         For some reason libc prefers K&R style defns for external functions.
1188         (regerror) [!defined _LIBC]: Likewise.
1189         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1190         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1191         (build_range_exp, build_collating_symbol):
1192         Use K&R-style defn.
1193         (re_compile_fastmap): Use '\0' to memset, not 0.
1194         (utf8_sb_map): Make the calculations more obvious.
1195         (init_dfa, parse_bracket_exp, build_charclass_op):
1196         Call calloc and cast result, as glibc does.
1197         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1198         (build_range_exp, build_collating_symbol):
1199         Now internal functions.
1200
1201         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1202
1203         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1204         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1205         Don't depend on VMS; depend on __VMS instead, for POSIX
1206         namespace cleanness.
1207         (regoff_t): Define to ssize_t, not long int.
1208
1209         Remove the REG_ macros named below.  Instead, make the old names
1210         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1211         __USE_GNU_REGEX.
1212         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1213         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1214         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1215         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1216         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1217         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1218         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1219         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1220         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1221         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1222         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1223         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1224         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1225         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1226         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1227         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1228         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1229         (REG_NREGS):
1230         Remove.  All uses replaced by the old RE_* names.
1231         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1232         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1233         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1234         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1235         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1236         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1237         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1238         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1239         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1240         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1241         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1242         Don't bother having these macros be independent of each others'
1243         values, since they no longer exist in the POSIX name space.
1244
1245         Rename the following member names back to their old names,
1246         unless !__USE_GNU_REGEX.  All uses changed back.
1247         (buffer): Renamed from re_buffer.
1248         (allocated): Renamed from re_allocated.
1249         (used): Renamed from re_used.
1250         (syntax): Renamed from re_syntax.
1251         (fastmap): Renamed from re_fastmap.
1252         (translate): Renamed from re_translate.
1253         (can_be_null): Renamed from re_can_be_null.
1254         (regs_allocated): Renamed from re_regs_allocated.
1255         (fastmap_accurate): Renamed from re_fastmap_accurate.
1256         (no_sub): Renamed from re_no_sub.
1257         (not_bol): Renamed from re_not_bol.
1258         (not_eol): Renamed from re_not_eol.
1259         (newline_anchor): Renamed from re_newline_anchor.
1260         (num_regs): Renamed from rm_num_regs.
1261         (start): Renamed from rm_start.
1262         (end): Renamed from rm_end.
1263
1264         (free_state): Move up a bit.
1265
1266         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1267         #define to be empty.
1268         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1269         when that is what is intended.
1270         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1271         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1272         (MAX): New macro.
1273         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1274         All uses changed back to re_malloc, etc.  It's now the caller's
1275         responsibility to check for overflow; all callers changed.
1276         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1277         (re_x2nrealloc): Remove.
1278         (free_state): Remove decl.
1279
1280         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1281         (re_set_registers, re_exec):
1282         Use K&R-style defn.
1283
1284         2006-01-31  Roland McGrath  <roland@redhat.com>
1285
1286         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1287         Reported by Mike Frysinger <vapier@gentoo.org>.
1288
1289         2006-01-15  Andreas Jaeger  <aj@suse.de>
1290
1291         [BZ #1950]
1292         * regex_internal.c (re_string_reconstruct): Adjust for
1293         build_wcs_upper_buffer change.
1294         (build_wcs_upper_buffer): Change return type.
1295
1296         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1297
1298         * regex_internal.h: Include <stdint.h> if available.
1299
1300         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1301
1302         * regex_internal.h (SIZE_MAX): Provide a default definition.
1303
1304         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1305
1306         * regcomp.c: Adjust for changed secondary hash function.
1307
1308         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1309
1310         * regex.h: Pretty printing.
1311         Clean up namespace a bit.
1312
1313         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1314
1315         * regexec.c (update_cur_sifted_state, check_arrival,
1316         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1317
1318         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1319                     Ulrich Drepper  <drepper@redhat.com>
1320
1321         [BZ #1302]
1322         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1323         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1324
1325         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1326
1327         [BZ #281]
1328         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1329         * regcomp.c: Remove unnecessary uses of
1330         unsigned RE_TRANSLATE_TYPE.
1331         * regex_internal.h: Likewise.
1332         * regex_internal.c: Likewise.
1333         * regexec.c: Likewise.
1334         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1335
1336         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1337
1338         * regexec.c (find_recover_state): Remove unnecessary
1339         initialization.
1340         (transit_state_bkref): Make DFA a const pointer.
1341         (get_subexp): Likewise.
1342         (check_arrival): Likewise.
1343         (update_cur_sifted_state): Likewise.
1344         (re_search_internal): Likewise.
1345         (prune_impossible_nodes): Likewise.
1346         (acquire_init_state_context): Likewise.
1347         (proceed_next_node): Likewise.
1348         (set_regs): Likewise.
1349         (free_fail_stack_return): Likewise.
1350         (check_arrival_expand_ecl): Mark DFA parameter as const.
1351         (check_arrival_expand_ecl_sub): Likewise.
1352         (check_subexp_limits): Likewise.
1353         (sub_epsilon_src_nodes):  Likewise.
1354         (add_epsilon_src_nodes):  Likewise.
1355         (merge_state_array): Likewise.
1356         (update_regs): Likewise.
1357         (build_trtable): Likewise.
1358         (sift_states_backward): Mark MCTX parameter as const.
1359         (build_sifted_states): Likewise.
1360         (update_cur_sifted_state): Likewise.
1361         (sift_states_mkref): Likewise.
1362         (check_arrival_expand_ecl): Mark eclosure as const.
1363         (check_dst_limits_calc_pos_1): Likewise.
1364         * regex_internal.h (re_match_context_t): Make dfa a const
1365         pointer.
1366
1367         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1368
1369         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1370         (transit_state_sb): Likewise.
1371         (transit_state_mb): Likewise.
1372         (sift_states_iter_mb): Likewise.
1373         (check_arrival_add_next_nodes): Likewise.
1374         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1375         [_LIBC] (re_search_2_stub): Use mempcpy.
1376
1377         * regex_internal.c (re_string_reconstruct): Avoid calling
1378         mbrtowc for very simple UTF-8 case.
1379
1380         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1381         a pointer-to-const.
1382         (re_acquire_state_context): Likewise.
1383         * regex_internal.h: Adjust prototypes.
1384
1385         * regex.c: Prevent using C++ compilers.
1386
1387         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1388         (re_acquire_state_context): Likewise.
1389
1390 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1391             Bruno Haible  <bruno@clisp.org>
1392
1393         * stdint_.h: On OpenBSD, don't redefine types already included in
1394         <sys/types.h> and <inttypes.h>.
1395
1396 2006-03-24  Eric Blake  <ebb9@byu.net>
1397
1398         * time_r.c (copy_string_result): Remove, as it is no longer used.
1399
1400 2006-03-24  Simon Josefsson  <jas@extundo.com>
1401
1402         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1403         including some doc fixes.
1404         (base64_encode_alloc): Fix +1 bug on allocation failures.
1405
1406 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1407
1408         * base64.c (base64_encode): Do not read past end of array with
1409         unsanitized input on systems with CHAR_BIT > 8.
1410
1411 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1412
1413         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1414         Typedef to long int, not to off_, as POSIX will likely change
1415         in that direction.
1416
1417 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1418
1419         * argp-help.c (validate_uparams): Fix typo
1420         * argp-parse.c (argp_default_options): Consistently begin help
1421         messages with a lowercase letter.
1422
1423 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1424
1425         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1426         overrun buffers and shouldn't be used (much as gets shouldn't be
1427         used).
1428         * time_r.c (asctime_r, ctime_r): Likewise.
1429
1430 2006-03-08  Simon Josefsson  <jas@extundo.com>
1431
1432         * gc-gnulib.c (randomize): Don't open files called 'no', they
1433         signal that configure disabled the device.
1434
1435 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1436
1437         * c-stack.c: Include unistd.h unconditionally, since we now assume
1438         the unistd module.
1439         * getlogin_r.c: Likewise.
1440         * getlogin_r.h: Likewise.
1441         * glob.c: Likewise.
1442         * pagealign_alloc.c: Likewise.
1443         * unistd_.h: Remove; no longer needed.
1444
1445 2006-03-07  Simon Josefsson  <jas@extundo.com>
1446
1447         * unistd_.h: New file.
1448
1449 2006-03-07  Simon Josefsson  <jas@extundo.com>
1450
1451         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1452
1453 2006-03-01  Simon Josefsson  <jas@extundo.com>
1454
1455         * readline.c: Fix typo, tiny patch from Stepan Kasal
1456         <kasal@ucw.cz>.
1457
1458 2006-02-28  Simon Josefsson  <jas@extundo.com>
1459
1460         * getopt.c: Protect #include of unistd.h, for MSVS.
1461
1462 2006-02-27  Simon Josefsson  <jas@extundo.com>
1463
1464         * base64.h: Indent #define's.  From Jim Meyering
1465         <jim@meyering.net>.
1466
1467 2006-02-27  Jim Meyering  <jim@meyering.net>
1468
1469         Revert the change of 2006-02-24, so these files can continue
1470         to be sync'd from gettext.
1471         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1472         of `config.h'.
1473
1474 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1475
1476         * glob.c: Say "invalid" rather than "illegal" in comments.
1477
1478 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1479
1480         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1481
1482 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1483
1484         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1485         AT_FDCWD exceeds INT_MAX.
1486         * openat.h (AT_FDCWD): Likewise.
1487
1488 2006-02-14  Jim Meyering  <jim@meyering.net>
1489
1490         Sync from coreutils.
1491
1492         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1493         failure on deficient systems, and simplify gnulib lgpl dependencies.
1494         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1495         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1496
1497         * xalloc-die.c: Remove unused definition of N_.
1498
1499 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1500
1501         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1502
1503 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1504
1505         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1506         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1507
1508 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1509
1510         * argp-namefrob.h: Restore changes accidentally lost during the
1511         "autoupdate" on 2005-12-12.
1512
1513 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1514
1515         * fnmatch.c (L_): Renamed from L, to work around a bug in
1516         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1517         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1518         All uses changed.
1519
1520 2006-01-26  Simon Josefsson  <jas@extundo.com>
1521
1522         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1523         prototype is visible on mingw32.
1524
1525         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1526         for mingw32.
1527
1528         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1529         mingw32).
1530
1531 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1532
1533         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1534         attempt to open for write; this always fails, at least on POSIX
1535         hosts.  This reinstates the 2006-01-09 change, which was
1536         inadvertently removed.
1537
1538 2006-01-26  Bruno Haible  <bruno@clisp.org>
1539             Paul Eggert  <eggert@cs.ucla.edu>
1540
1541         * stdbool_.h (_Bool)
1542         [(! (defined __cplusplus || defined __BEOS__)
1543           && !defined __GNUC__
1544           && !(defined __HP_cc || defined __xlc__
1545                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1546                || defined __sgi))]:
1547         #define to signed char in these cases too; this simplifies
1548         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1549         etc., separately) and makes it more conservative.
1550
1551 2006-01-21  Jim Meyering  <jim@meyering.net>
1552
1553         Sync from the stable (b5) branch of coreutils:
1554
1555         * fts.c (fts_children): Don't let close() clobber errno from
1556         failed fchdir().
1557
1558         * fts.c (fts_stat): When following a symlink-to-directory,
1559         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1560         a dangling symlink.  That can also happen at least for ELOOP.
1561         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1562         FYI, this bug predates the inclusion of fts.c in coreutils.
1563
1564         * fts.c (fts_open): Put new maxarglen declaration and uses
1565         in their own block, so pre-c99 compilers don't object.
1566
1567         Avoid the double-free (first in fts_read, second in fts_close) that
1568         would occur when an `active' directory is made inaccessible (e.g.,
1569         via chmod a-x) during a traversal.
1570         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1571         before returning.  Reproduce this failure by
1572         mkdir -p a/b; cd a; chmod a-x . b
1573         Reported by Stavros Passas.
1574
1575 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1576
1577         * argp-namefrob.h: Bugfix. Remove stray #
1578
1579 2006-01-25  Bruno Haible  <bruno@clisp.org>
1580
1581         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1582         warnings.
1583         Reported by Paul Eggert.
1584
1585 2006-01-25  Jim Meyering  <jim@meyering.net>
1586
1587         * fileblocks.c: Remove more useless parentheses.
1588         * readutmp.h: Likewise.
1589
1590 2006-01-24  Bruno Haible  <bruno@clisp.org>
1591
1592         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1593         has it.
1594         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1595         2005-11-26.
1596
1597         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1598         to avoid problems with the built-in _Bool type.
1599         Reported by Paul Eggert on 2005-11-26.
1600
1601 2006-01-24  Jim Meyering  <jim@meyering.net>
1602
1603         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1604
1605 2006-01-24  Simon Josefsson  <jas@extundo.com>
1606
1607         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1608         Bruno.
1609
1610 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1611
1612         Work around porting bugs reported by Dieter in
1613         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1614         * getopt.c (_NOPROTO): Remove; no longer needed.
1615         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1616         Include "getopt.h" first, to check interface.
1617         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1618         !HAVE_DECL_GETENV.
1619         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1620         (__strndup): Revert to K&R-style function dfns, the glibc style.
1621         * strnlen.c: Don't claim it's taken from glibc; it's not.
1622         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1623         Include strnlen.h first, to get prototype properly.
1624         (strnlen): Renamed from __strnlen.
1625         Remove weak alias.
1626
1627 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1628
1629         These changes imported from libc.
1630         * getopt.c: Use __fxprintf instead of inline stream orientation
1631         test and two separate function calls.
1632         * strndup.c (__strndup): Add libc_hidden_def.
1633
1634 2006-01-22  Bruno Haible  <bruno@clisp.org>
1635
1636         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1637         temporary buffer for sprintf, take into account the precision also
1638         for 'd', 'i', 'u', 'o', 'x', 'X'.
1639
1640 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1641
1642         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1643         to pacify gcc -Wswitch-default.
1644
1645 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1646
1647         * argp-help.c (usage_long_opt): Do not print DOC options.
1648         (__argp_base_name): Removed
1649         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1650         typo.
1651         (__argp_base_name): Provide macro definition or extern declaration
1652         depending on the configuration
1653
1654 2006-01-20  Simon Josefsson  <jas@extundo.com>
1655
1656         * inet_ntop.h: Unconditionally include sys/socket.h.
1657
1658 2006-01-19  Simon Josefsson  <jas@extundo.com>
1659
1660         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1661
1662 2006-01-12  Simon Josefsson  <jas@extundo.com>
1663
1664         * base64.c: Fix warning, reported by Bruno Haible
1665         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1666
1667 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1668
1669         Sync from coreutils.
1670         * md5.c: Fix commentary typos.
1671         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1672         * md5.h (__attribute__): Remove; unused.
1673         * sha1.c: Fix commentary to match md5 better.
1674         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1675         so that we don't need to worry about alignment.  All uses changed.
1676         This merges the 2005-10-28 md5 change into sha1.
1677
1678 2006-01-11  Jim Meyering  <jim@meyering.net>
1679
1680         Sync from coreutils.
1681         * md5.c (OP): Fix spacing.
1682
1683 2006-01-11  Simon Josefsson  <jas@extundo.com>
1684
1685         * stdint_.h (SIZE_MAX): Add missing (.
1686
1687 2006-01-10  Bruno Haible  <bruno@clisp.org>
1688
1689         * argp.h (__const): Remove macro. Use const instead.
1690         * argp-fmtstream.h (__const): Likewise.
1691         * glob_.h (__const): Remove macro.
1692         * glob-libc.h: Use const instead of __const.
1693
1694 2006-01-10  Jim Meyering  <jim@meyering.net>
1695
1696         Avoid the double-free (first in fts_read, second in fts_close) that
1697         would occur when an `active' directory is made inaccessible (e.g.,
1698         via chmod a-x) during a traversal.
1699         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1700         before returning.  Reproduce this failure by
1701         mkdir -p a/b; cd a; chmod a-x . b
1702         Reported by Stavros Passas.
1703
1704         Sync from coreutils.
1705         * sha1.c: Tweak grammar in a comment.
1706
1707 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1708
1709         * regex_internal.h (BITSET_WORD_BITS):
1710         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1711         preprocessor mishandles large unsigned values as if they were signed.
1712         Problem reported by Claudio Fontana in
1713         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1714
1715 2006-01-10  Simon Josefsson  <jas@extundo.com>
1716
1717         * socket_.h: New file.
1718
1719 2006-01-10  Bruno Haible  <bruno@clisp.org>
1720
1721         * localcharset.c: Update from GNU gettext.
1722
1723 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1724
1725         Sync from coreutils.
1726         * chdir-long.c (cdb_free): Don't bother trying to open directory
1727         for write access: POSIX says that must fail.
1728         * fts.c (diropen): Likewise.
1729         * save-cwd.c (save_cwd): Likewise.
1730         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1731         well, for minor improvements on hosts that lack O_DIRECTORY.
1732         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1733         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1734         Fall back on chown if open failed with EACCES.
1735
1736         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1737         Report an error at compile-time if only a 1-second nominal clock
1738         resolution is found.
1739
1740         * lchmod.h: New file.
1741         * mkdir-p.c: Include lchmod.h, lchown.h.
1742         (make_dir_parents): Use lchown rather than chown, and
1743         lchmod rather than chmod.
1744
1745         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1746         too.  Problem with "none" reported by Bob Proulx.  Problem with
1747         "proc" reported by n0dalus.
1748
1749         * mountlist.c: Include <limits.h>.
1750         (dev_from_mount_options)
1751         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1752         New function.  It no longer assumes "dev=" has the System V meaning
1753         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1754         (read_file_system_list)
1755         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1756         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1757         dev= in that case.
1758
1759         * posixtm.h (PDS_PRE_2000): New macro.
1760         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1761         All usages changed.  Reject dates outside the range 1969-1999 if
1762         PDS_PRE_2000 is used.
1763
1764 2006-01-09  Jim Meyering  <jim@meyering.net>
1765
1766         Sync from coreutils.
1767
1768         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1769
1770         * chdir-safer.h, chdir-safer.c: New files.
1771
1772         * modechange.c (mode_compile): Reject an invalid mode string
1773         that starts with an octal digit.  From Andreas Gruenbacher.
1774
1775         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1776         and dup to open_safer and dup_safer, respectively.
1777         (openat_permissive): Fix typo in comment.
1778
1779         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1780         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1781         (_): Remove; no longer needed.
1782         (openat): Renamed from rpl_openat; no need for rpl_openat
1783         since openat.h renames openat for us.
1784         Replace most of the body with a call to openat_permissive,
1785         to avoid duplicate code.
1786         Port to (probably hypothetical) environments were mode_t is
1787         wider than int.
1788         (openat_permissive): Require mode arg, so that we can check
1789         types better.  Put it just after flags.  Change cwd failure
1790         indicator from pointer-to-bool to pointer-to-errno-value.
1791         All callers changed.
1792         Invoke openat_save_fail and/or openat_restore_fail if
1793         cwd_errno is null, so that openat can call us.
1794         (openat_permissive, fdopendir, fstatat, unlinkat):
1795         Simplify errno handling to avoid some duplicate code,
1796         as it's OK to set errno on success.
1797         * openat.h: Revamp code so that function macros depend on
1798         __OPENAT_PREFIX only, not also on AT_FDCWD.
1799         (openat_ro): Remove.  Caller changed to use openat_permissive.
1800         (openat_permissive): Now a macro, if not a function.
1801         (openat_restore_fail, openat_save_fail): Now always functions,
1802         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1803
1804         * openat-priv.h: New file, defining macros used by mkdirat.c
1805         and openat.c.
1806         * mkdirat.c: Include openat-priv.h.
1807         Remove definitions of macros defined therein.
1808         * openat.c: Likewise.
1809
1810         * mkdirat.c (mkdirat): New file and function.
1811         * openat.h (mkdirat): Declare.
1812
1813         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1814
1815         * openat.h (openat_permissive): Declare.
1816         (openat_ro): Define.
1817
1818         * openat.c (EXPECTED_ERRNO): New macro.
1819         (openat_permissive): New function -- used in remove.c rewrite.
1820         (all functions): Set errno just before returning, only if there
1821         was an actual failure.
1822         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1823
1824         Emulate openat-family functions using Linux's procfs, if possible.
1825         Idea and some code based on Ulrich Drepper's glibc changes.
1826
1827         * openat.c: (BUILD_PROC_NAME): New macro.
1828         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1829         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1830         before falling back on save_cwd and restore_cwd.
1831         (fdopendir, fstatat, unlinkat): Likewise.
1832
1833         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1834         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1835
1836         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1837         as second argument to va_arg.  Otherwise, some versions of gcc
1838         warn that `if this code is reached, the program will abort'.
1839
1840 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1841
1842         Sync from coreutils.
1843
1844         Add POSIX ACL support
1845         * acl.h (copy_acl, set_acl): Add declarations.
1846         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1847         systems other than Linux.
1848         (chmod_or_fchmod): New function: use fchmod when possible,
1849         and chmod otherwise.
1850         (file_has_acl): Add a POSIX ACL implementation, with a
1851         Linux-specific subcase.
1852         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1853         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1854         acls are unsupported.
1855         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1856         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1857         are unsupported.
1858
1859 2006-01-09  Bruno Haible  <bruno@clisp.org>
1860
1861         * sysexit_.h (EX_OK): New macro.
1862         Suggested by Martin Lambers <marlam@marlam.de>.
1863
1864 2006-01-09  Bruno Haible  <bruno@clisp.org>
1865
1866         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1867         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1868         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1869         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1870
1871 2006-01-09  Bruno Haible  <bruno@clisp.org>
1872
1873         * stdint_.h (SIZE_MAX): Write the value without involving negative
1874         numbers.
1875
1876 2005-10-16  Bruno Haible  <bruno@clisp.org>
1877
1878         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1879         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1880
1881 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1882
1883         * strftime.c (tzname): Don't declare if it is already #defined.
1884         Problem reported for Mingw by Mark Junker.
1885
1886 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1887
1888         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1889         long int, not int, for nanosecond counts, so that people who are
1890         used to POSIX struct timespec won't be surprised.  Reported by Jim
1891         Meyering.
1892
1893 2005-12-16  Jim Meyering  <jim@meyering.net>
1894
1895         * fprintftime.c, fprintftime.h: New files.
1896
1897 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1898
1899         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1900         * argp-help.c (fill_in_uparams): Check if the constructed
1901         struct uparams is valid. Fall back to the default values if it is
1902         not.
1903
1904 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1905
1906         * argp-help.c (__argp_base_name): New function
1907         (__argp_short_program_name): Rewrite using __argp_base_name
1908         * argp-namefrob.h: Define program_invocation_name and
1909         program_invocation_short_name if requested
1910         (__argp_base_name): Add prototype
1911         * argp-parse.c (argp_def): Use gettext wrappers
1912         (argp_default_parser): Use __argp_base_name
1913         * argp-pin.c: New file. Defines program_invocation_name and
1914         program_invocation_short_name on systems that lack them.
1915
1916 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1917
1918         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1919         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1920         porting problem reported by Georg Schwarz in
1921         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1922
1923 2005-07-09  Bruno Haible  <bruno@clisp.org>
1924
1925         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1926         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1927         Reported by Mark Junker <mjscod@gmx.de>.
1928
1929 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1930
1931         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1932         (uintmax_t) [defined uintmax_t]: Do not declare.
1933         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1934         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1935         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1936         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1937         sake of portability to weird hosts that C allows (though we don't
1938         know of any practical examples).
1939
1940         * savedir.h (fdsavedir): New decl.
1941         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1942         contains most of the former guts of savedir.
1943         (savedir): Use savedirstream.
1944         Include "openat.h".
1945
1946 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1947
1948         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1949         coreutils no longer futzes with rounding modes.
1950
1951 2005-11-14  Jim Meyering  <jim@meyering.net>
1952
1953         * mkstemp-safer.c: Include <config.h>, required for possible
1954         replacement of mkstemp.
1955
1956 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1957
1958         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1959         business.
1960         (gethrxtime) [! (HAVE_NANOUPTIME
1961         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1962         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1963         our own approximation.
1964
1965 2005-11-10  Simon Josefsson  <jas@extundo.com>
1966
1967         * readline.c: Remove EOL.
1968
1969 2005-11-08  Eric Blake  <ebb9@byu.net>
1970
1971         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1972
1973 2005-11-08  Eric Blake  <ebb9@byu.net>
1974
1975         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1976
1977 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1978
1979         Fix porting problem reported by Theodoros V. Kalamatianos.
1980         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1981         Don't assume that futimes failing means we must fail.
1982
1983 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1984
1985         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1986         leave errno alone.  Problem reported by Dmitry V. Levin.
1987
1988 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1989
1990         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1991         errno alone.  Problem reported by Frederic Jolliton.
1992
1993 2005-10-28  Simon Josefsson  <jas@extundo.com>
1994
1995         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1996         "restrict" keywords, as per POSIX.  Protect the function
1997         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1998         Don't use K&R prototypes.  Check the sprintf return values.
1999         Re-define EAFNOSUPPORT if not present.  Indent.
2000
2001         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2002         suggested by Bruno Haible <bruno@clisp.org>.
2003
2004         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2005
2006         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2007
2008         * gc-libgcrypt.c: Add MD2 (which is not available through
2009         libgcrypt).
2010
2011         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2012
2013         * md2.h, md2.c: New files.
2014
2015 2005-10-24  Simon Josefsson  <jas@extundo.com>
2016
2017         * md4.h: Shrink buffer size, now that we changed the type.
2018
2019 2005-10-22  Simon Josefsson  <jas@extundo.com>
2020
2021         * arcfour.h, arcfour.c: Use fixed size indices in the
2022         arcfour_context struct (simplify test vector testing in GNU
2023         Shishi).
2024
2025 2005-10-22  Simon Josefsson  <jas@extundo.com>
2026
2027         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2028         suggested by Bruno Haible <bruno@clisp.org>.
2029
2030 2005-10-22  Simon Josefsson  <jas@extundo.com>
2031
2032         * crc.h: Include stddef.h, for size_t.
2033
2034 2005-10-21  Simon Josefsson  <jas@extundo.com>
2035
2036         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2037         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2038
2039 2005-10-21  Simon Josefsson  <jas@extundo.com>
2040
2041         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2042         block.
2043
2044 2005-10-21  Simon Josefsson  <jas@extundo.com>
2045
2046         * gc-gnulib.c: Support ARCTWO in CBC mode.
2047
2048 2005-10-21  Simon Josefsson  <jas@extundo.com>
2049
2050         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2051         <bruno@clisp.org>.
2052
2053         * hmac-sha1.c (hmac_sha1): Likewise.
2054
2055         * crc.c (crc32_update): Actually use crc parameter, suggested by
2056         Bruno Haible <bruno@clisp.org>.
2057
2058         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2059         <bruno@clisp.org>.
2060
2061 2005-10-21  Simon Josefsson  <jas@extundo.com>
2062
2063         * des.h, des.c: New files.
2064
2065         * gc-gnulib.c: Support DES.c
2066
2067 2005-10-21  Simon Josefsson  <jas@extundo.com>
2068
2069         * arctwo.h, arctwo.c: New files.
2070
2071         * gc-gnulib.c: Support ARCTWO.
2072
2073 2005-10-21  Simon Josefsson  <jas@extundo.com>
2074
2075         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2076
2077 2005-10-19  Simon Josefsson  <jas@extundo.com>
2078
2079         * gc-gnulib.c: Support ARCFOUR.
2080
2081 2005-10-19  Simon Josefsson  <jas@extundo.com>
2082
2083         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2084         support.
2085
2086         * gc.h: Add ECB enum type.
2087
2088         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2089
2090 2005-10-19  Simon Josefsson  <jas@extundo.com>
2091
2092         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2093
2094 2005-10-18  Simon Josefsson  <jas@extundo.com>
2095
2096         * md4.h, md4.c: New files, based on md5.?.
2097
2098 2005-10-17  Simon Josefsson  <jas@extundo.com>
2099
2100         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2101
2102         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2103
2104 2005-10-17  Simon Josefsson  <jas@extundo.com>
2105
2106         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2107
2108 2005-10-17  Simon Josefsson  <jas@extundo.com>
2109
2110         * gc.h, gc-libgcrypt.c: Add ciphers.
2111
2112 2005-10-17  Simon Josefsson  <jas@extundo.com>
2113
2114         * sha1.c: Use uint32_t instead of md5_uint32.t
2115
2116         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2117         md5.h.
2118
2119         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2120
2121         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2122
2123 2005-10-15  Simon Josefsson  <jas@extundo.com>
2124
2125         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2126
2127         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2128
2129 2005-10-14  Simon Josefsson  <jas@extundo.com>
2130
2131         * arcfour.h, arcfour.c: New files.
2132
2133 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2134
2135         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2136         include <wchar.h>; no longer needed.
2137
2138 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2139         and  Ulrich Drepper  <drepper@redhat.com>
2140
2141         Import from libc.
2142         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2143         instead of inline stream orientation test and two separate
2144         function calls.  Pay no attention to USE_IN_LIBIO.
2145
2146 2005-10-14  Roland McGrath  <roland@redhat.com>
2147
2148         Import from libc.  [BZ #1331]
2149         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2150         macro argument.
2151         Reported by Matej Vela <vela@debian.org>.
2152
2153 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2154
2155         * mkdir-p.c (make_dir_parents): Don't report an error if an
2156         intermediate directory is in a read-only file system.  Problem
2157         reported by Eric Blake.
2158
2159 2005-10-13  Simon Josefsson  <jas@extundo.com>
2160
2161         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2162         Move memory allocation outside of loop.
2163
2164 2005-10-12  Simon Josefsson  <jas@extundo.com>
2165
2166         * gc-pbkdf2-sha1.c: New file.
2167
2168         * gc.h: Add gc_pbkdf2_sha1 prototype.
2169
2170 2005-10-12  Simon Josefsson  <jas@extundo.com>
2171
2172         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2173         suggested by Bruno Haible <bruno@clisp.org>.
2174
2175 2005-10-12  Simon Josefsson  <jas@extundo.com>
2176
2177         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2178
2179         * gc-gnulib.c (gc_hmac_sha1): New function.
2180
2181 2005-10-12  Simon Josefsson  <jas@extundo.com>
2182
2183         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2184
2185 2005-10-12  Simon Josefsson  <jas@extundo.com>
2186
2187         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2188         GC_USE_HMAC_MD5, respectively.
2189
2190         * gc-libgcrypt.c (gc_md5): Fix assert call.
2191         (gc_md5): Fix typo.
2192
2193         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2194
2195         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2196
2197         * gc-gnulib.c (gc_hash_buffer): Ditto.
2198
2199 2005-10-11  Bruno Haible  <bruno@clisp.org>
2200
2201         * c-strcasestr.h: New file, from GNU gettext.
2202         * c-strcasestr.c: New file, from GNU gettext.
2203
2204 2005-10-11  Bruno Haible  <bruno@clisp.org>
2205
2206         * c-strcase.h: New file, from GNU gettext.
2207         * c-strcasecmp.c: New file, from GNU gettext.
2208         * c-strncasecmp.c: New file, from GNU gettext.
2209
2210 2005-10-11  Simon Josefsson  <jas@extundo.com>
2211
2212         * crc.h, crc.c: New files.
2213
2214         * gc.h (gc_hash_buffer): Add doc.
2215
2216 2005-10-08  Simon Josefsson  <jas@extundo.com>
2217
2218         * gc.h: Add gc_hash and gc_hash_buffer.
2219
2220         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2221
2222         * gc-libgcrypt.c (gc_hash_buffer): Add.
2223
2224 2005-10-11  Bruno Haible  <bruno@clisp.org>
2225
2226         * strcasecmp.c: Include limits.h.
2227         (strcasecmp): Avoid integer overflow on exotic platforms.
2228         * strncasecmp.c: Include limits.h.
2229         (strncasecmp): Avoid integer overflow on exotic platforms.
2230         Reported by Paul Eggert.
2231
2232 2005-10-06  Simon Josefsson  <jas@extundo.com>
2233
2234         * hmac-md5.c: New file.
2235
2236         * hmac.h: New file.
2237
2238 2005-10-06  Simon Josefsson  <jas@extundo.com>
2239
2240         * memxor.c (memxor): Avoid casts and warnings.
2241
2242 2005-10-05  Derek Price  <derek@ximbiot.com>
2243
2244         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2245
2246 2005-10-05  Simon Josefsson  <jas@extundo.com>
2247
2248         * memxor.c (memxor): Fix compiler error.
2249
2250         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2251         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2252
2253         * memxor.h, memxor.c: New files.
2254
2255         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2256         we assume all systems have it, suggested by Jim Meyering
2257         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2258         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2259         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2260         same reasons.
2261
2262 2005-10-04  Bruno Haible  <bruno@clisp.org>
2263
2264         * verify.h (verify_true): Provide alternative definition for C++.
2265
2266 2005-10-04  Simon Josefsson  <jas@extundo.com>
2267
2268         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2269         D. Baushke" <mdb@gnu.org>.
2270
2271 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2272
2273         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2274         (SSIZE_MAX): New macro, if not already defined.
2275         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2276         than 2 GiB.
2277
2278 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2279
2280         * exclude.c: Include verify.h.
2281         (verify): Remove.  All callers changed to use verify.h's version.
2282         * strtoimax.c: Likewise.
2283         * utimecmp.c: Likewis.e
2284
2285         Sync from coreutils.
2286         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2287         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2288         * .cvsignore: Add fts.h, search.h, t-fpending.
2289         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2290         bother returning ENOSYS if settimeofday or stime fails; just let
2291         them return whatever errno they want to return.
2292         * utimens.c: Include unistd.h, for dup2.
2293         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2294         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2295
2296 2005-10-02  Jim Meyering  <jim@meyering.net>
2297
2298         Sync from coreutils.
2299         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2300         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2301         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2302         Remove AT_FDCWD test.
2303         Do not consume the fd unless successful.
2304         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2305         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2306         block, so that we don't even try to compile it if settimeofday is
2307         available.  This works around a compilation failure on OSF1 V5.1,
2308         due to stime requiring a `long int*' while tv_sec is `int'.
2309
2310 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2311
2312         * getdelim.c (getdelim): Remove unused variables.
2313
2314 2005-10-01  Simon Josefsson  <jas@extundo.com>
2315
2316         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2317         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2318         AI_* and EAI_* definitions.  Protect function declarations.
2319
2320 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2321
2322         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2323         so that the code works even with ancient cpp.  Portability problem
2324         with GCC 2.7.2.1 reported by Thomas M.Ott.
2325
2326 2005-09-27  Jim Meyering  <jim@meyering.net>
2327
2328         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2329
2330         * intprops.h (signed_type_or_expr__): Define.
2331         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2332         for unsigned types.
2333
2334 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2335
2336         * verify.h (verify_expr): Remove, replacing with:
2337         (verify_true): New macro that returns true instead of void.
2338         (verify_type__): Remove.
2339         (verify): Use verify_true rather than verify_type__.
2340
2341 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2342
2343         * utimens.c (ENOSYS): Define if not already defined.
2344         (futimens): Support having a null PATH if the file descriptor
2345         is nonnegative.
2346
2347         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2348         Remove.
2349         (__attribute): Define to empty unless GCC 3.1 or later.
2350         This works around a core dump on OpenBSD 3.4, which has GCC
2351         2.95.3, which dumps core when given __attribute__(()).  It also
2352         simplifies other tests, since we really don't want to bother with
2353         worrying about which ancient version of GCC supported what.
2354         Original problem reported by Yoann Vandoorselaere, with part of
2355         the fix suggested by Derek Price.
2356
2357 2005-09-24  Jim Meyering  <jim@meyering.net>
2358
2359         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2360         so we can once again use a positive bitfield width of 1 -- now we
2361         don't have to explain why we were using a bitfield width of 2.
2362
2363 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2364
2365         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2366         Problem reported by Eric Blake.
2367         (getaddrinfo): Initialize se so that it's not garbage.
2368         Redo internal storage allocation so that it doesn't make unportable
2369         assumptions about alignment.
2370         Fix a memory leak.
2371
2372         * utimens.c (futimens): Use futimesat if available.
2373         Prefer it to futimes since it doesn't have the futimes bug.
2374
2375         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2376         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2377         Instead, declare a function that returns a pointer to an array,
2378         and use verify_type__ to declare the size of the array.
2379         Problem and germ of a solution reported by Bruno Haible.
2380         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2381         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2382
2383 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2384
2385         Sync from coreutils.
2386
2387         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2388         stat-time.h.
2389         * argmatch.h: Include verify.h
2390         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2391         (ARGMATCH_ASSERT): Remove; unused.
2392         * canonicalize.c: Assume STDC_HEADERS.
2393         * exclude.c: Include "strcase.h".
2394         * regex_internal.h [!defined _LIBC]: Likewise.
2395         * getusershell.c: Include stdio--.h rather than stdio.h
2396         and stdio-safer.h.
2397         (getusershell): Call fopen, not fopen_safer.
2398         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2399         Do not include unistd-safer.h.
2400         (save_cwd): Don't call fd_safer; no longer needed
2401         now that we include fcntl--.h.
2402
2403         * getdate.y (relative_time): New type.
2404         (RELATIVE_TIME_0): New constant.
2405         (parser_control): Use relative_time instead of doing it ourselves.
2406         (%union): Add new relative_time rel member.
2407         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2408         Now typeless.
2409         (relunit, relunit_snumber): Now of type rel.
2410         (zone, rel, relunit, get_date): Adjust to above changes.
2411
2412         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2413         Do not include unistd-safer.h.
2414         (getloadavg): Don't call fd_safer; no longer needed
2415         now that we include fcntl--.h.
2416
2417         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2418         (make_dir_parents): Treat ENOSYS like EEXIST.
2419
2420         Improve quality of diagnostics on restore_cwd failure.
2421         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2422         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2423         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2424         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2425         each time through the loop.  Do not diagnose restore_cwd failure;
2426         that is the caller's job (and perhaps the caller does not care).
2427
2428         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2429         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2430         If the file already exists but is not a directory, don't bother
2431         to try to make its parents.
2432         Close potential file descriptor leak if we can't chdir("/") (!).
2433         Don't always return true if chdir($PWD) fails; return true only
2434         if the requested action was done successfully (except for the
2435         chdir($PWD)).
2436         Don't log final directory unless we actually made it.
2437         Refactor to avoid duplicate code to fix up permissions.
2438         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2439
2440         * strftime.c (my_strftime): Rewrite the previous change slightly,
2441         to make it a bit faster and (I hope) clearer.
2442         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2443         Fix bug in formats like %2N.
2444
2445         * verify.h: New file.
2446
2447 2005-09-22  Jim Meyering  <jim@meyering.net>
2448
2449         Sync from coreutils.
2450
2451         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2452
2453         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2454         the .tm_year member, since otherwise gcc-4.0 would now warn about
2455         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2456
2457         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2458         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2459
2460         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2461         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2462         when run in a time zone for which daylight savings time is in effect
2463         for the starting date.
2464
2465         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2466         stop us from restricting permissions of just-created absolute-named
2467         directories.
2468         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2469         to restore initial working directory.
2470         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2471         to tell caller if/when we change the working directory and are
2472         unable to return to the initial one.
2473         * mkdir-p.h (make_dir_parents): Update prototype.
2474         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2475         `return false'.  This fixes a bug introduced on 2004-07-30.
2476
2477         * openat.c (fdopendir): Be sure to close the supplied
2478         file descriptor before returning.  This makes our replacement
2479         implementation a little closer to Solaris's, where fdopendir
2480         ties the file descriptor to the returned DIR* pointer.
2481         * openat.c (unlinkat): New function.
2482         * openat.h (unlinkat): Add prototype.
2483         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2484         (openat_restore_fail): Rename from openat_restore_die.
2485         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2486
2487         Provide an alternative to exiting immediately upon save_cwd or
2488         restore_cwd failure.  Now, an application can arrange e.g.,
2489         to perform a longjump in that case.
2490         * openat.c: Include dirname.h.
2491         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2492         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2493         and openat_restore_die rather than calling error directly.
2494         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2495
2496         * openat-die.c (openat_save_die, openat_restore_die): New file.
2497         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2498
2499         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2500         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2501                             int utc, int nanoseconds);
2502         Background:
2503         date should not have to allocate a megabyte of virtual memory to
2504         handle a format argument like +%1048575T.  When implemented with
2505         strftime, it must allocate such a buffer, use strftime to fill it
2506         in, print it, then free it.
2507         With fprintftime, it simply prints everything and exits.
2508         With no need for memory allocation, that's one fewer way to fail.
2509         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2510         optional field width, not before, so we accept %9:z, not %:9z.
2511         (my_strftime): Be sure to use L_('x') for literals.
2512
2513         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2514         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2515         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2516         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2517         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2518         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2519         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2520         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2521         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2522
2523         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2524         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2525         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2526         and don't include <sys/file.h>).
2527
2528 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2529
2530         Sync from coreutils.
2531
2532         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2533         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2534         [!LDAV_DONE]: Avoid unused variable warning.
2535
2536 2005-09-21  Bruno Haible  <bruno@clisp.org>
2537
2538         * unicodeio.h (unicode_to_mb): New declaration.
2539
2540 2005-09-20  Derek Price  <derek@ximbiot.com>
2541
2542         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2543
2544 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2545
2546         Use a consistent style for including <config.h>.
2547         * __fpending.c, acl.c, argmatch.c,
2548         argp-help.c, argp-parse.c,
2549         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2550         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2551         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2552         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2553         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2554         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2555         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2556         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2557         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2558         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2559         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2560         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2561         modechange.c, mountlist.c, open-safer.c, physmem.c,
2562         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2563         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2564         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2565         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2566         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2567         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2568         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2569         userspec.c, utimecmp.c, version-etc-fsf.c,
2570         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2571         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2572         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2573         Standardize inclusion of config.h.
2574         * __fpending.h, dirfd.h, getdate.h, human.h,
2575         inttostr.h:  Removed inclusion of config.h from header files.
2576         * inttostr.c:  Adjusted in-tree users.
2577         * timespec.h: Remove superfluous warning to include config.h.
2578         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2579         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2580         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2581         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2582
2583 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2584
2585         * stat-time.h: New file.
2586         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2587         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2588         in a different way.
2589         (timespec_cmp): New function.
2590         * utimecmp.c: Include stat-time.h.
2591         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2592         members exist, not on the obsolescent ST_MTIM_NSEC.
2593         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2594
2595 2005-09-15  Derek Price  <derek@ximbiot.com>
2596             Paul Eggert  <eggert@cs.ucla.edu>
2597
2598         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2599         changes, consolidating in...
2600         * regex_internal.h: ...this file.
2601
2602 2005-09-15  Derek Price  <derek@ximbiot.com>
2603
2604         * regex_internal.h: Blank `pure' for GNUC < 3.
2605         * regex_internal.c: Ditto, using this...
2606         (__GNUC_PREREQ): ...new macro.
2607         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2608         (__GNUC_PREREQ): ...this new macro.
2609
2610         * strstr.h: Include string.h. Define strstr as a macro here.
2611
2612 2005-09-13  Derek Price  <derek@ximbiot.com>
2613
2614         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2615         failure.
2616         Reported by Jim Meyering  <jim@meyering.net>.
2617
2618 2005-09-13  Jim Meyering  <jim@meyering.net>
2619
2620         * canon-host.c: Filter through gnu indent and reword comments slightly.
2621         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2622
2623 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2624
2625         * lib/base64.c: Typo.
2626         (base64_encode): Put b64str in initialized data section.
2627
2628 2005-09-12  Derek Price  <derek@ximbiot.com>
2629
2630         Return usable errors from canon-host.
2631         * canon-host.h: New file.
2632         * canon-host.c (canon_host): Wrap...
2633         (canon_host_r): ...this new function, which now relies exclusively on
2634         getaddrinfo.
2635         (ch_strerror): New function.
2636         (last_cherror): New global.
2637         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2638         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2639         void *.
2640         (freeaddrinfo): Free ai->ai_canonname when set.
2641
2642 2005-09-12  Derek Price  <derek@ximbiot.com>
2643             Paul Eggert  <eggert@cs.ucla.edu>
2644
2645         * glob-libc.h: Renamed from glob_.h.  The new version is
2646         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2647         protecting things that should be done only in gnulib contexts.
2648         * glob_.h: New file, containing only the glob things needed for
2649         gnulib.
2650         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2651         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2652         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2653         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2654         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2655         and to respect the namespace rules better.
2656
2657 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2658
2659         Merge glibc and coreutils changes into gnulib, plus a few
2660         extra fixes.
2661         * md5.c: Use #error rather than a string.
2662         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2663         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2664         (__attribute__): Define to empty for non recent-GCC.
2665         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2666         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2667         Renamed from their non-__ counterparts, with new macros replacing
2668         them if not _LIBC.  Add __THROW attribute.
2669         (rol): Remove.
2670         (struct md5_ctx): Align buffer if using GCC.
2671         * sha1.h (struct sha1_ctx): Likewise.
2672         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2673         The old name was backwards.
2674         (NOTSWAP): Remove; not used.
2675         (rol): New macro, moved here from md5.h.
2676         (sha1_process_block): Remove a FIXME that doesn't make sense.
2677
2678 2005-09-12  Derek Price  <derek@ximbiot.com>
2679
2680         * gai_strerror.c: Include config.h when available.  Include
2681         getaddrinfo.h before other headers to test interface.
2682         Reported by Larry Jones <lawrence.jones@ugs.com>.
2683
2684 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2685
2686         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2687         definitions, since that's the preferred style in glibc.
2688         Fix a minor spacing issue, and update copyright notice to match glibc's.
2689
2690 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2691
2692         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2693
2694 2005-09-06  Simon Josefsson  <jas@extundo.com>
2695
2696         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2697         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2698
2699 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2700
2701         Change bitset word type from unsigned int to unsigned long int,
2702         as this has better performance on typical 64-bit hosts.
2703         Port bitset code to hosts with unusual word sizes.
2704         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2705         (build_collating_symbol):
2706         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2707         argument is a bitset.  This is merely a style issue, but it makes
2708         it clearer that an entire array is expected.
2709         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2710         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2711         Port to the case where bitset_word is not the same as unsigned int.
2712         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2713         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2714         Likewise.
2715         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2716         (build_trtable, group_nodes_into_DFAstates):
2717         Likewise.
2718         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2719         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2720         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2721         * regexec.c (group_nodes_into_DFAstates): Likewise.
2722         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2723         * regcomp.c (optimize_subexps, lower_subexp):
2724         Work even if bitset_word has holes in its bitwise representation.
2725         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2726         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2727         Likewise.
2728         * regex_internal.c (re_string_reconstruct):
2729         Don't assume UCHAR_MAX == 255.
2730         * regex_internal.h (bitset_set_all): Likewise.
2731         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2732         All uses changed.
2733         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2734         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2735         All uses changed.
2736         (BITSET_WORD_MAX): New macro.
2737         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2738         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2739         (bitset_empty, bitset_copy):
2740         Prefer sizeof (bitset) to multiplying it out ourselves.
2741         (bitset_not_merge): Remove; unused.
2742         (bitset_contain): Return bool, not unsigned int with one bit on.
2743         All callers changed.
2744         * regexec.c (build_trtable): Don't assume bitset has no stricter
2745         alignment than re_node_set; do this by defining a new internal
2746         type struct dests_alloc and using it to allocate memory.
2747
2748 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2749
2750         Check for arithmetic overflow when calculating sizes, to prevent
2751         some buffer-overflow issues.  These patches are conservative, in the
2752         sense that when I couldn't determine whether an overflow was possible,
2753         I inserted a run-time check.
2754         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2755         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2756         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2757         (re_xnrealloc, re_x2nrealloc): New inline functions.
2758         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2759         (build_equiv_class, build_charclass): Check for arithmetic overflow
2760         in size expression calculations.
2761         * lib/regex_internal.c (re_string_realloc_buffers):
2762         (build_wcs_upper_buffer, re_node_set_add_intersect):
2763         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2764         (re_dfa_add_node, register_state): Likewise.
2765         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2766         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2767         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2768         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2769
2770 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2771
2772         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2773         to avoid a collision with bits/local_lim.h in glibc.
2774         All uses changed.  Problem reported by Dmitry V. Levin in
2775         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2776
2777         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2778         bugs in int versus size_t comparisons.
2779         (re_string_context_at): Fix bug where the code assumed that
2780         Idx is signed.
2781
2782         Use bool where appropriate.
2783         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2784         All callers changed.
2785         (calc_eclosure_iter): Likewise, for ROOT arg.
2786         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2787         (build_charclass_op): Likewise, for NON_MATCH arg.
2788         * regex_internal.c (re_string_allocate, re_string_construct):
2789         (re_string_construct_common): Likewise, for ICASE arg.
2790         * regexec.c (re_search_2_stub, re_search_stub):
2791         Likewise, for RET_LEN arg.
2792         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2793         (set_regs): Likewise, for FL_BACKTRACK arg.
2794         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2795         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2796         (calc_eclosure_iter, parse_bracket_exp):
2797         Use bool for internal variables that are booleans.
2798         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2799         (set_regs, build_sifted_states, sift_states_bkref):
2800         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2801         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2802         (find_collation_sequence_value):
2803         Likewise.
2804         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2805         (re_node_set_compare):
2806         Return bool, not int. All callers changed.
2807         * regexec.c (check_halt_node_context, check_dst_limits):
2808         (build_trtable, check_node_accept): Likewise.
2809         * regex_internal.h: Include stdbool.h.
2810
2811         Fix bugs uncovered when converting to bool.
2812         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2813         failure instead of charging ahead blindly.
2814         * regex_internal.c (register_state): Likewise.
2815         * regexec.c (re_search_2_stub): Use simpler method than boolean
2816         for freeing internal storage.
2817         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2818         bitset pieces used as boolean, to avoid undefined behavior
2819         on hosts that do int overflow checking.
2820
2821 2005-08-31  Derek Price  <derek@ximbiot.com>
2822
2823         * getdelim.c (getdelim): Return EOF on EOF.
2824         Reported by Larry Jones <lawrence.jones@ugs.com>.
2825
2826 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2827
2828         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2829         lengths fit in regoff_t; this isn't true if regoff_t is the same
2830         width as size_t.
2831         * regex.c (re_search_internal): 5th arg is LAST_START
2832         (= START + RANGE) instead of RANGE.  This avoids overflow
2833         problems when regoff_t is the same width as size_t.
2834         All callers changed.
2835         (re_search_2_stub): Check for overflow when adding the
2836         sizes of the two strings.
2837         (re_search_stub): Check for overflow when adding START
2838         to RANGE; if it occurs, substitute the extreme value.
2839
2840 2005-08-31  Jim Meyering  <jim@meyering.net>
2841
2842         * regcomp.c (search_duplicated_node): Make first pointer arg
2843         a pointer-to-const.
2844         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2845         (register_state): Likewise.
2846         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2847         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2848         (group_nodes_into_DFAstates): Likewise.
2849
2850 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2851
2852         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2853         old glibc regex code mishandles strings longer than 2**31 bytes.
2854         This patch fixes this when the regex code is used in gnulib
2855         (i.e., outside glibc).
2856
2857         This patch should not affect the use of the regex code inside
2858         glibc.  No doubt this problem also needs to be handled for glibc
2859         as well, but the result will be an incompatible change to the
2860         glibc ABI, and the old ABI will have to be supported too.  That
2861         can be the the subject for another patch.
2862
2863         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2864         governing whether the rest of this patch is active.  By default,
2865         the macro is disabled and the patch has no effect.
2866         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2867         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2868         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2869         (re_match_2, re_set_registers): Use the new types.
2870         * regex_internal.h (Idx, re_hashval_t): New types.
2871         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2872         New macros.
2873         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2874         (re_string_context_at, bin_tree_t, re_dfastate_t):
2875         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2876         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2877         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2878         (re_string_char_size_at, re_string_wchar_at):
2879         (re_string_elem_size_at):
2880         Use the new types and macros to port to 64-bit hosts.
2881         Use unsigned types for internal values, so that the code
2882         mostly works even for arrays larger than SSIZE_MAX.
2883         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2884         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2885         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2886         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2887         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2888         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2889         (calc_inveclosure, parse_dup_op, build_range_exp):
2890         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2891         (fetch_number, create_token_tree, mark_opt_subexp):
2892         Likewise.
2893         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2894         (create_cd_newstate, re_string_allocate, re_string_construct):
2895         (re_string_realloc_buffers, build_wcs_upper_buffer):
2896         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2897         (re_string_reconstruct, re_string_peek_byte_case):
2898         (re_string_fetch_byte_case, re_string_context_at):
2899         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2900         (re_node_set_init_copy, re_node_set_add_intersect):
2901         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2902         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2903         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2904         (re_acquire_state, re_acquire_state_context, register_state):
2905         Likewise.
2906         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2907         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2908         (re_search_internal, re_search_2_stub, re_search_stub)
2909         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2910         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2911         (update_cur_sifted_state, check_dst_limits):
2912         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2913         (check_subexp_limits, sift_states_bkref, merge_state_array):
2914         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2915         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2916         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2917         (expand_bkref_cache, check_node_accept_bytes):
2918         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2919         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2920         (acquire_init_state_context, check_halt_node_context):
2921         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2922         (sift_states_backward, clean_state_log_if_needed):
2923         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2924         (find_recover_state, transit_state_sb, transit_state_mb):
2925         (transit_state_bkref, build_trtable, match_ctx_clean):
2926         Likewise.
2927         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2928         to work around an assumption that REG_MISSING is negative.
2929
2930         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2931         (seek_collating_symbol_entry) [defined _LIBC]:
2932         (lookup_collation_sequence_value) [defined _LIBC]:
2933         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2934         Use prototypes rather than old-style function definitions.
2935         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2936         (transit_state_sb) [0]:
2937         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2938
2939         * regexec.c (re_search_internal): Simplify update of rm_so and
2940         rm_eo.
2941
2942         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2943         (optimize_subexps, lower_subexp):
2944         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2945         since the signed shift might overflow.  Use 1u<<31 instead.
2946         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2947         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2948         Likewise.
2949
2950         * regcomp.c (optimize_subexps, lower_subexp):
2951         Use CHAR_BIT rather than 8, for clarity.
2952         * regexec.c (check_dst_limits_calc_pos_1):
2953         (check_subexp_matching_top): Likewise.
2954         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2955         have to worry about portability issues when shifting it left.
2956         Remove no-longer-needed test for table_size > 0.
2957         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2958         in a word, as the resulting behavior is undefined.
2959         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2960         in one case, a <= should have been an <, and in another case the
2961         whole test was missing.
2962         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2963         the standard name CHAR_BIT.
2964         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2965         this is not true on one's complement and signed-magnitude hosts.
2966
2967         * regex_internal.h (re_sub_match_top_t): Remove unused member
2968         next_last_offset.
2969         (struct re_dfa_t): Remove unused member states_alloc.
2970         * regcomp.c (init_dfa): Don't initialize unused members.
2971
2972 2005-08-31  Bruno Haible  <bruno@clisp.org>
2973
2974         * strstr.c: Include <stddef.h>, for NULL.
2975         * strcasestr.c: Likewise.
2976         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2977
2978 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2979
2980         * iconvme.h: Add prototype for iconv_alloc.
2981
2982 2005-08-29  Simon Josefsson  <jas@extundo.com>
2983
2984         * iconvme.c: Fix errno.
2985
2986 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
2987
2988         * iconvme.c: Split iconv_string into iconv_alloc.
2989
2990 2005-08-27  Jim Meyering  <jim@meyering.net>
2991
2992         * fopen-safer.c: Merge minor changes from coreutils.
2993         * dup-safer.c: Likewise.
2994         * fd-safer.c: Likewise.
2995
2996         Merge from coreutils.
2997         * stdio--.h: New file.
2998         * stdlib--.h: New file.
2999         * mkstemp-safer.c: New file.
3000
3001         GNU tar needs these.
3002         * pipe-safer.c: New file.
3003         * creat-safer.c: New file.
3004         * fcntl--.h (creat): Define to creat_safer.
3005         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3006         * unistd--.h (pipe): Define to pipe_safer.
3007         * unistd-safer.h: Declare pipe_safer.
3008
3009 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3010
3011         * regex_internal.h: Remove all references to
3012         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3013         or better.
3014         (bitset_not, bitset_merge, bitset_not_merge):
3015         (bitset_mask, re_string_allocate, re_string_construct):
3016         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3017         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3018         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3019         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3020         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3021         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3022         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3023         (re_acquire_state_context):
3024         Remove unnecessary forward decls.
3025         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3026         Put __attribute at function definition,
3027         now that the function decl has been removed.
3028         * lib/regex_internal.c (re_string_peek_byte_case):
3029         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3030         Likewise.
3031
3032 2005-08-26  Simon Josefsson  <jas@extundo.com>
3033
3034         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3035         Haible <bruno@clisp.org>.
3036
3037 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3038
3039         * regexec.c (set_regs): Don't alloca with an unbounded size.
3040
3041         alloca modernization/simplification for regex.
3042         * regex.c: Remove portability cruft for alloca.  This no longer
3043         needs to be at the start of the file, and can be moved into
3044         regex_internal.h and simplified.
3045         * regex_internal.h: Include <alloca.h>.
3046         (__libc_use_alloca) [!defined _LIBC]: New macro.
3047         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3048         now works outside glibc.
3049
3050 2005-08-24  Simon Josefsson  <jas@extundo.com>
3051
3052         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3053         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3054         GLIBC specific code.
3055
3056 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3057
3058         Make regex safe for g++.  This fixes one real bug (an "err"
3059         that should have been "*err").  g++ problem reported by
3060         Sam Steingold.
3061         * regex_internal.h (re_calloc): New macro, consistent with
3062         re_malloc etc.  All callers of calloc changed to use re_calloc.
3063         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3064         not int.  All callers changed.
3065         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3066         just use an array of size MB_LEN_MAX.
3067         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3068         (find_recover_state): Change "err" to "*err"; this fixes what
3069         appears to be a real bug.
3070         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3071         versus int.
3072
3073 2005-08-25  Jim Meyering  <jim@meyering.net>
3074
3075         * open-safer.c: Include <config.h>.
3076         Otherwise, we'd lose LARGEFILE support in any file using
3077         e.g. "fcntl--.h"
3078
3079 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3080
3081         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3082         * regex.h (regerror): Likewise.
3083
3084         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3085         requires this.  (The code never needed it.)
3086
3087         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3088         All uses of recently-renamed identifiers changed to use the new,
3089         POSIX-compliant names.  The code will build and run just fine
3090         without these changes, but it's better to eat our own dog food
3091         and use the standard-conforming names.
3092
3093         * regex.h: Fix a multitude of POSIX name space violations.
3094         These changes have an effect only for programs that define
3095         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3096         do not change anything for programs compiled in the normal way.
3097         Also, there is no effect on the ABI.
3098
3099         (_REGEX_SOURCE): New macro.
3100         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3101         defined and _GNU_SOURCE is not; this fixes a name space violation.
3102
3103         Rename the following macros to obey POSIX requirements.
3104         The old names are still visible as macros if _REGEX_SOURCE is defined.
3105         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3106         RE_BACKSLASH_ESCAPE_IN_LISTS.
3107         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3108         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3109         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3110         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3111         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3112         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3113         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3114         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3115         (REG_INTERVALS): renamed from RE_INTERVALS.
3116         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3117         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3118         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3119         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3120         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3121         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3122         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3123         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3124         RE_UNMATCHED_RIGHT_PAREN_ORD.
3125         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3126         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3127         (REG_DEBUG): renamed from RE_DEBUG.
3128         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3129         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3130         unusual, since we can't clash with the POSIX REG_ICASE.
3131         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3132         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3133         (REG_NO_SUB): renamed from RE_NO_SUB.
3134         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3135         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3136         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3137         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3138         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3139         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3140         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3141         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3142         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3143         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3144         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3145         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3146         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3147         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3148         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3149         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3150         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3151         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3152         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3153         (REG_FIXED): Renamed from REGS_FIXED.
3154         (REG_NREGS): Renamed from RE_NREGS.
3155
3156         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3157         of other REG_* macros, since POSIX says the user is allowed to
3158         #undef these macros selectively.
3159
3160         (reg_errcode_t): Update comment stating what other tables need
3161         to be consistent.
3162
3163         Rename the following enum values to obey POSIX requirements.
3164         The old names are still visible as macros.
3165         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3166         is not defined, since GNU is supposed to be a superset of POSIX as
3167         much as possible, and since we want reg_errcode_t to be a signed
3168         type for implementation consistency.
3169         (_REG_NOERROR): Renamed from REG_NOERROR.
3170         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3171         (_REG_BADPAT): Renamed from REG_BADPAT.
3172         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3173         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3174         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3175         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3176         (_REG_EBRACK): Renamed from REG_EBRACK.
3177         (_REG_EPAREN): Renamed from REG_EPAREN.
3178         (_REG_EBRACE): Renamed from REG_EBRACE.
3179         (_REG_BADBR): Renamed from REG_BADBR.
3180         (_REG_ERANGE): Renamed from REG_ERANGE.
3181         (_REG_ESPACE): Renamed from REG_ESPACE.
3182         (_REG_BADRPT): Renamed from REG_BADRPT.
3183         (_REG_EEND): Renamed from REG_EEND.
3184         (_REG_ESIZE): Renamed from REG_ESIZE.
3185         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3186         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3187         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3188         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3189         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3190
3191         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3192         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3193         changed.  But support the old name if the new one is not defined
3194         and if _REGEX_SOURCE.
3195
3196         Change the following member names in struct re_pattern_buffer.
3197         The old names are still supported if !_REGEX_SOURCE.
3198         The new names are always supported, regardless of _REGEX_SOURCE.
3199         (re_buffer): Renamed from buffer.
3200         (re_allocated): Renamed from allocated.
3201         (re_used): Renamed from used.
3202         (re_syntax): Renamed from syntax.
3203         (re_fastmap): Renamed from fastmap.
3204         (re_translate): Renamed from translate.
3205         (re_can_be_null): Renamed from can_be_null.
3206         (re_regs_allocated): Renamed from regs_allocated.
3207         (re_fastmap_accurate): Renamed from fastmap_accurate.
3208         (re_no_sub): Renamed from no_sub.
3209         (re_not_bol): Renamed from not_bol.
3210         (re_not_eol): Renamed from not_eol.
3211         (re_newline_anchor): Renamed from newline_anchor.
3212
3213         Change the following member names in struct re_registers.
3214         The old names are still supported if !_REGEX_SOURCE.
3215         The new names are always supported, regardless of _REGEX_SOURCE.
3216         (rm_num_regs): Renamed from num_regs.
3217         (rm_start): Renamed from start.
3218         (rm_end): Renamed from end.
3219
3220         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3221         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3222         Prepend __ to parameter names.
3223
3224         Undo yesterday's changes.
3225
3226 2005-08-24  Jim Meyering  <jim@meyering.net>
3227
3228         Sync from coreutils.
3229         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3230
3231 2005-08-21  Bruno Haible  <bruno@clisp.org>
3232
3233         * lock.h: Add multiple inclusion guard.
3234         * tls.h: Add multiple inclusion guard.
3235
3236 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3237
3238         * regex.h (REG_NOSYS)
3239         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3240         Define, since POSIX requires it as of 2001.
3241         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3242         New private symbol, used to keep the enum signed in all cases.
3243         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3244         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3245
3246         * regex_internal.c (re_string_skip_chars, register_state):
3247         (calc_state_hash):
3248         Remove forward decls; no longer needed now that we use prototypes.
3249         * regexec.c (acquire_init_state_context, check_halt_node_context):
3250         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3251         (clean_state_log_if_needed): Likewise.
3252
3253 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3254
3255         Fix problems reported by Sam Steingold in
3256         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3257         * regexec.c (sift_states_bkref): Fix portability bug: the code
3258         assumed that reg_errcode_t is a signed type, which is not
3259         necessarily true if _XOPEN_SOURCE is not defined.
3260         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3261         some compilers warn about it otherwise.
3262
3263 2005-08-20  Jim Meyering  <jim@meyering.net>
3264
3265         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3266         of unused local, dfa.
3267
3268 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3269
3270         * regcomp.c (create_initial_state): Remove duplicate decl.
3271         (init_word_char, create_initial_state, duplicate_node_closure):
3272         (fetch_token, peek_token_bracket, build_range_exp):
3273         (build_collating_symbol): Remove forward decls; no longer needed
3274         now that we use prototypes.
3275
3276         * regcomp.c:
3277         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3278         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3279         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3280         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3281         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3282         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3283         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3284         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3285         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3286         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3287         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3288         (build_charclass, build_charclass_op, fetch_number, create_tree):
3289         (create_token_tree, mark_opt_subexp, duplicate_tree):
3290         Use prototypes rather than old-style definitions.
3291
3292         * regex_internal.c:
3293         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3294         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3295         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3296         (re_string_reconstruct, re_string_peek_byte_case):
3297         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3298         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3299         (re_node_set_init_copy, re_node_set_add_intersect):
3300         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3301         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3302         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3303         (re_acquire_state, re_acquire_state_context, register_state):
3304         (create_ci_newstate, create_cd_newstate, free_state):
3305         Likewise.
3306         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3307         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3308         (re_search_internal, prune_impossible_nodes):
3309         (acquire_init_state_context, check_matching, static):
3310         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3311         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3312         (update_regs, sift_states_backward, build_sifted_states):
3313         (clean_state_log_if_needed, merge_state_array):
3314         (update_cur_sifted_state, add_epsilon_src_nodes):
3315         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3316         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3317         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3318         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3319         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3320         (check_arrival, check_arrival_add_next_nodes):
3321         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3322         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3323         (check_node_accept_bytes, check_node_accept, extend_buffers):
3324         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3325         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3326         (sift_ctx_init):
3327         Likewise.
3328
3329         * regex_internal.h:
3330         (re_string_allocate, re_string_construct, re_string_reconstruct):
3331         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3332         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3333         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3334         (re_string_context_at, re_string_peek_byte_case):
3335         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3336         is defined, since we now use prototypes always.
3337
3338         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3339         C89 or better.  All uses removed.
3340
3341 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3342
3343         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3344         [defined lint]: Suppress bogus uninitialized-variable warnings.
3345
3346         * regcomp.c (duplicate_node): Return new index, not an error code,
3347         and let the caller return REG_ESPACE if out of space.  This
3348         removes an uninitialied-variable warning with GCC 4.0.1, and also
3349         avoids taking the address of a local variable.  All callers
3350         changed.
3351
3352 2005-08-19  Jim Meyering  <jim@meyering.net>
3353
3354         * regexec.c (proceed_next_node): Redo local variables to
3355         avoid GCC shadowing warnings.
3356
3357 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3358
3359         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3360         (re_node_set_insert_last, re_dfa_add_node):
3361         Rename local variables to avoid GCC shadowing warnings.
3362
3363 2005-08-18  Bruno Haible  <bruno@clisp.org>
3364
3365         * strstr.c (strstr): Fix return value in multibyte case.
3366         * strcasestr.c (strcasestr): Likewise.
3367
3368 2005-08-17  Jim Meyering  <jim@meyering.net>
3369
3370         Make the %s format (seconds since the epoch) work for a negative
3371         number and when used with a zero-padded field width, e.g. %015s.
3372
3373         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3374         label so that it precedes the code to set `digits'.  Otherwise,
3375         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3376         print `00-22'.  Now, it prints `-0022', as it should.
3377
3378 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3379
3380         * regex.h: Remove useless space-before-tab.  From coreutils.
3381
3382 2005-08-17  Bruno Haible  <bruno@clisp.org>
3383
3384         * strcasestr.h: New file.
3385         * strcasestr.c: New file.
3386
3387 2005-08-17  Bruno Haible  <bruno@clisp.org>
3388
3389         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3390         * strstr.c: Completely rewritten, with multibyte locale support.
3391
3392 2005-08-17  Bruno Haible  <bruno@clisp.org>
3393
3394         * strcasecmp.c: Use mbuiter.h.
3395
3396 2005-08-17  Bruno Haible  <bruno@clisp.org>
3397
3398         * mbuiter.h: New file.
3399
3400 2005-08-16  Bruno Haible  <bruno@clisp.org>
3401
3402         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3403         (mbi_init): Update.
3404         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3405         NUL byte, not after it.
3406
3407 2005-08-16  Bruno Haible  <bruno@clisp.org>
3408
3409         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3410         the valid ones. Makes the comparison operations transitive:
3411         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3412         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3413
3414 2005-08-16  Bruno Haible  <bruno@clisp.org>
3415
3416         * strcase.h (strcasecmp): Add note in comments.
3417         * strncasecmp.c: Use code from strcasecmp.c.
3418         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3419         (strcasecmp): Work correctly in multibyte locales.
3420
3421 2005-08-16  Bruno Haible  <bruno@clisp.org>
3422
3423         * strnlen1.h: New file.
3424         * strnlen1.c: New file.
3425
3426 2005-08-16  Bruno Haible  <bruno@clisp.org>
3427
3428         * mbfile.h: New file.
3429
3430 2005-08-16  Bruno Haible  <bruno@clisp.org>
3431
3432         * mbiter.h: New file.
3433
3434 2005-08-16  Bruno Haible  <bruno@clisp.org>
3435
3436         * mbchar.h: New file.
3437         * mbchar.c: New file.
3438
3439 2005-08-16  Bruno Haible  <bruno@clisp.org>
3440
3441         * tls.h: New file, from GNU gettext.
3442         * tls.c: New file, from GNU gettext.
3443
3444 2005-08-15  Bruno Haible  <bruno@clisp.org>
3445
3446         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3447         is defined.
3448
3449 2005-08-14  Jim Meyering  <jim@meyering.net>
3450
3451         Sync from coreutils.
3452
3453         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3454         Use the hash-table-based cycle-detection code not just when
3455         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3456         Reported by James Youngman in
3457         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3458         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3459         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3460         This lets us compile with -DFTS_DEBUG, once again.
3461         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3462         * fts.c (fd_safer): Remove decl.
3463         Include fcntl--.h rather than unistd-safer.h
3464         (fts_safe_changedir): Don't call fd_safer; no longer needed
3465         now that we include fcntl--.h.
3466
3467 2005-08-11  Simon Josefsson  <jas@extundo.com>
3468
3469         * readline.h, readline.c: New file.
3470
3471 2005-08-11  Bruno Haible  <bruno@clisp.org>
3472
3473         * strnlen.h (strnlen): Change parameter name to match comment.
3474
3475 2005-08-10  Simon Josefsson  <jas@extundo.com>
3476
3477         * strndup.c: Use strnlen.h.
3478
3479         * strnlen.h: New file.
3480
3481 2005-08-02  Simon Josefsson  <jas@extundo.com>
3482
3483         * getline.h, getline.c: Rewrite.
3484
3485         * getdelim.h, getdelim.c: New files, ported from glibc.
3486
3487 2005-07-31  Bruno Haible  <bruno@clisp.org>
3488
3489         * lock.h (gl_lock_initializer): New macro.
3490         (gl_lock_define_initialized): Use it.
3491         (gl_rwlock_initializer): New macro.
3492         (gl_rwlock_define_initialized): Use it.
3493         (gl_recursive_lock_initializer): New macro.
3494         (gl_recursive_lock_define_initialized): Use it.
3495
3496 2005-07-26  Bruno Haible  <bruno@clisp.org>
3497
3498         * lock.h: Update from GNU gettext.
3499         * lock.c: Update from GNU gettext.
3500
3501 2005-07-18  Bruno Haible  <bruno@clisp.org>
3502
3503         * lock.h (gl_once_t): New type.
3504         (gl_once_define, gl_once): New macros.
3505         * lock.c (fresh_once): New variable.
3506         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3507         functions.
3508
3509 2005-07-18  Simon Josefsson  <jas@extundo.com>
3510
3511         * check-version.c (check_version): Accept identical versions too.
3512
3513 2005-07-18  Bruno Haible  <bruno@clisp.org>
3514
3515         * lock.h: New file, from GNU gettext.
3516         * lock.c: New file, from GNU gettext.
3517
3518 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3519
3520         * quotearg.c: Add translator comment suggested by Bruno Haible,
3521         with a minor change.
3522
3523 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3524
3525         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3526         copyright symbol and the year.
3527         * version-etc.c (COPYRIGHT_YEAR): New constant.
3528         (version_etc_va): Use parameterized copyright notice.
3529         Reword to conform to the current GNU coding standards.
3530
3531 2005-07-11  Simon Josefsson  <jas@extundo.com>
3532
3533         * size_max.h: New file.
3534
3535 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3536
3537         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3538         block of defines.
3539
3540 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3541        and  Paul Eggert  <eggert@cs.ucla.edu>
3542
3543         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3544         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3545
3546 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3547
3548         * regex.c, regex.h: Sync from libc.
3549         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3550         New files, synced from libc, except that regex_internal.h
3551         currently has a small porting fix.
3552
3553 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3554
3555         Remove the dependency of the strftime module on the tzset module.
3556         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3557         Copy the input structure, to work around some of the bug with
3558         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3559         Solaris releases, you should also use the tzset module, but we won't
3560         require it as a dependency any more since we don't want LGPLed code
3561         to depend on GPLed code.
3562
3563 2005-07-02  Jim Meyering  <jim@meyering.net>
3564
3565         * backupfile.c (backup_args): Change a `0' to NULL.
3566
3567 2005-07-01  Jim Meyering  <jim@meyering.net>
3568
3569         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3570         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3571         * save-cwd.c, tempname.c:
3572         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3573         and don't include <sys/file.h>).
3574
3575 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3576
3577         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3578         declares only 'struct timespec;' (!).
3579
3580 2005-06-29  Jim Meyering  <jim@meyering.net>
3581
3582         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3583         type name.  Use the variable name instead.
3584         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3585
3586 2005-06-28  Simon Josefsson  <jas@extundo.com>
3587
3588         * check-version.h, check-version.c: New files.
3589
3590 2005-06-28  Simon Josefsson  <jas@extundo.com>
3591
3592         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3593         collision with global variable.  Better indentation.  Don't
3594         increment buffer pointer beyond buffer end.  Based on comments
3595         from Paul Eggert <eggert@cs.ucla.edu>.
3596
3597         * base64.h: Indent.
3598
3599 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3600
3601         * canon-host.c (canon-host): Append trailing "," to 0 in
3602         initializer of struct addrinfo, as an indication that we don't
3603         care how many members the structure has.
3604
3605 2005-06-24  Derek Price  <derek@ximbiot.com>
3606         and Bruno Haible  <bruno@clisp.org>
3607
3608         Remove stat module & update lstat.
3609         * stat.c: Remove this file...
3610         (slash_aware_lstat): ...moving this content and its support...
3611         * lstat.c (rpl_lstat): ...into here.
3612         * lstat.h: New file.
3613
3614 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3615
3616         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3617         (ranged_convert): Don't save conversion in a temporary struct.
3618         This causes a warning with GCC 4.0.0, and anyway in the typical
3619         case it's not worth the extra 100 bytes or so of code.
3620         (ranged_convert, __mktime_internal): When calling a function via a
3621         pointer P, use P () rather than (*P) (), as we now assume C89 or
3622         better.
3623
3624 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3625
3626         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3627         "who -r" failed to give output.  Problem reported by Tim Waugh.
3628
3629         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3630         (xcalloc): Use it to avoid needless tests.
3631         Problem reported by Jim Meyering.
3632
3633 2005-06-16  Jim Meyering  <jim@meyering.net>
3634
3635         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3636         when either N or S is zero.
3637
3638 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3639
3640         * argp.h (__option_is_short): Check upper limit of
3641         __key. Isprint() requires its argument to have the value
3642         of an unsigned char or EOF.
3643
3644 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3645
3646         * fnmatch.c (fnmatch): If there is an encoding error in a
3647         multibyte string or pattern, fall back on unibyte matching.
3648         Problem reported by James Youngman.
3649
3650 2005-06-08  Bruno Haible  <bruno@clisp.org>
3651
3652         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3653         warning on mingw.
3654
3655 2005-06-08  Bruno Haible  <bruno@clisp.org>
3656
3657         * csharpcomp.h: New file, from GNU gettext.
3658         * csharpcomp.c: New file, from GNU gettext.
3659         * csharpcomp.sh.in: New file, from GNU gettext.
3660
3661 2005-06-07  Derek Price  <derek@ximbiot.com>
3662
3663         Sync from CVS.
3664         * glob_.h: Indent nested #ifdef.
3665
3666 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3667
3668         Sync from coreutils.
3669         Use "file name" when talking about file names, instead of "filename"
3670         or "path", as per the GNU coding standards.
3671         * mkdir-p.c: Renamed from makepath.c.
3672         (make_dir_parents): Renamed from make_path.  All callers changed.
3673         * mkdir-p.h: Likewise.  All includers changed.
3674         * filenamecat.c: Renamed from path-concat.c.
3675         (file_name_concat): Renamed from path_concat.  All callers changed.
3676         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3677         * filenamecat.h: Likewise.  All includers changed.
3678         * acl.c: Don't use "path" or "filename" to mean "file name"
3679         in comments or local variable names.
3680         * basename.c: Likewise.
3681         * canonicalize.c, canonicalize.h: Likewise.
3682         * dirname.c, dirname.h: Likewise.
3683         * euidaccess.c: Likewise.
3684         * exclude.c: Likewise
3685         * fnmatch_.h, fnmatch_loop.c: Likewise.
3686         * fsusage.c, fsuage.h: Likewise.
3687         * fts.c, fts_.h: Likewise.
3688         * getcwd.c: Likewise.
3689         * getloadavg.c: Likewise.
3690         * mkstemp.c: Likewise.
3691         * mountlist.c, mountlist.h: Likewise.
3692         * openat.c, openat.h: Likewise.
3693         * readlink-stub.c: Likewise.
3694         * readutmp.c, readutmp.h: Likewise.
3695         * rename.c: Likewise.
3696         * rmdir.c: Likewise.
3697         * same.c: Likewise.
3698         * savedir.c: Likewise.
3699         * stripslash.c: Likewise.
3700         * tempname.c: Likewise.
3701         * xreadlink.c: Likewise.
3702         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3703         All uses changed.
3704         * exclude.h: Likewise.
3705
3706         * euidaccess.c (getuid, getgid, getuid, getegid)
3707         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3708         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3709         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3710         * pathmax.h: Include <limits.h> unconditionally, since other
3711         files have been getting away with it for years (MORE/BSD 4.3
3712         is extinct now).
3713         * userspec.c (getpwnam, getgrnam, getgrgid)
3714         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3715
3716         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3717         Define to 256, not 255, as per modern POSIX.
3718
3719 2005-06-01  Bruno Haible  <bruno@clisp.org>
3720
3721         * csharpexec.h: New file, from GNU gettext.
3722         * csharpexec.c: New file, from GNU gettext.
3723         * csharpexec.sh.in: New file, from GNU gettext.
3724
3725 2005-05-31  Derek Price  <derek@ximbiot.com>
3726             Paul Eggert  <eggert@cs.ucla.edu>
3727
3728         Sync from cvs.
3729         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3730
3731 2005-05-29  Derek Price  <derek@ximbiot.com>
3732             Paul Eggert  <eggert@cs.ucla.edu>
3733
3734         * glob_.h, glob.c: New files.
3735
3736 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3737
3738         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3739
3740         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3741         the configuration hassle isn't worth it.
3742         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3743         (LONGEST_MODIFIER, PRIuMAX): Remove.
3744
3745 2005-05-27  Bruno Haible  <bruno@clisp.org>
3746
3747         * getlogin_r.h: Remove second include of <stddef.h>.
3748
3749 2005-05-25  Bruno Haible  <bruno@clisp.org>
3750             Derek Price  <derek@ximbiot.com>
3751
3752         * getlogin_r.h: Simplify API documentation.
3753
3754 2005-05-25  Derek Price  <derek@ximbiot.com>
3755             Paul Eggert  <eggert@cs.ucla.edu>
3756
3757         * getlogin_r.c, getlogin_r.h: New files.
3758
3759 2005-05-22  Bruno Haible  <bruno@clisp.org>
3760
3761         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3762         Also include <sys/param.h> if it defines MIN, MAX.
3763         Based on a patch by Derek Price <derek@ximbiot.com>.
3764
3765 2005-05-22  Bruno Haible  <bruno@clisp.org>
3766
3767         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3768         (INT64_MIN): Fix definition.
3769         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3770
3771         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3772         NEED_SIGNED_INT_TYPES.
3773
3774         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3775         HAVE_SYSTEM_INTTYPES.
3776
3777 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3778
3779         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3780         so that unistd-safer.h (GPL'ed code) need not be included.
3781
3782 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3783
3784         New fts module.
3785         * fts.c: Don't include "cycle-check.h" or "hash.h".
3786         (setup_dir, free_dir): New functions.
3787         (enter_dir, leave_dir): Define trivial
3788         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3789         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3790         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3791         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3792         Move to fts-cycle.c.
3793         (fts_open): Use setup_dir.
3794         (fts_close): Use free_dir.
3795         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3796         This adds a label and some gotos, but the alternatives were messier.
3797         Check for memory allocation failure when entering a dir.
3798         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3799         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3800         (FTS): New member fts_cycle, that is a union that contains the
3801         old active_dir_ht and cycle_state.  All uses changed to mention
3802         fts_cycle.ht and fts_cycle.state.
3803         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3804         fts.c, with the following changes:
3805         (setup_dir, free_dir): New functions.
3806         (enter_dir): Now returns bool.  Return true if successful, false
3807         if memory exhausted.  All callers changed.
3808         Do not bother partly cleaning up on
3809         memory allocation failure; that is free_dir's job.
3810         However, free ad if hash_insert fails, to avoid memory leak.
3811         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3812         fts->fts_options to see which union member to use.
3813
3814 2005-05-20  Jim Meyering  <jim@meyering.net>
3815
3816         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3817         Now a macro, to pacify GCC.
3818
3819 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3820
3821         * chown.c (rpl_chown): Return -1 on failure.
3822
3823 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3824
3825         * canonicalize.c: Include canonicalize.h first, to test interface.
3826         Include <stddef.h> unconditionally, since we assume C89 now.
3827         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3828         * fts.c: Include fts_.h first, to check interface.
3829         Do not include intprops.h; no longer needed.
3830         Include cycle-check.h and hash.h, since fts_.h no longer does.
3831         Remove unnecessary casts of closedir to void.
3832         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3833         decide whether to decrement nlinks.
3834         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3835         (FTS): Use struct hash_table * instead of Hash_table, so that
3836         we no longer need to include hash.h here.
3837
3838 2005-05-17  Jim Meyering  <jim@meyering.net>
3839
3840         * fts.c, fts_.h: New files, from coreutils.
3841
3842 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3843
3844         Sync from coreutils.
3845         * unlinkdir.c, unlinkdir.h: New files.
3846         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3847         regex.h, unlocked-io.h, xtime.h:
3848         White space changes only.
3849         * makepath.c (make_path): Port to hosts where leading "//" is special.
3850         * yesno.c: Include getline.h, not ctype.h.
3851         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3852         Use getline to remove arbitrary restriction on response length.
3853
3854 2005-05-13  Bruno Haible  <bruno@clisp.org>
3855
3856         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3857         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3858         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3859         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3860         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3861         Add support for 64-bit integers in the MSVC compiler.
3862
3863 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3864
3865         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3866         Change the initial comment to refer to GPL, not LGPL.
3867         gnulib-tool will change it to LGPL as needed.
3868
3869         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3870         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3871         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3872         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3873         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3874         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3875         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3876         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3877         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3878         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3879         concatpath.c, config.charset, copy-file.c, copy-file.h,
3880         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3881         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3882         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3883         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3884         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3885         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3886         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3887         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3888         full-read.c, full-read.h, full-write.c, full-write.h,
3889         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3890         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3891         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3892         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3893         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3894         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3895         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3896         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3897         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3898         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3899         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3900         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3901         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3902         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3903         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3904         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3905         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3906         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3907         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3908         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3909         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3910         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3911         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3912         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3913         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3914         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3915         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3916         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3917         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3918         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3919         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3920         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3921         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3922         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3923         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3924         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3925         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3926         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3927         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3928         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3929         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3930         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3931         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3932         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3933         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3934         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3935         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3936         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3937         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3938         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3939         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3940         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3941         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3942         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3943         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3944         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3945         Update FSF postal mail address.
3946
3947 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3948
3949         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3950         specified in ai_socktype. Fix invalid ai_protocol
3951         check. ai_protocol is usually set to 0 or depending on
3952         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3953         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3954         ai_socktype / ai_protocol in the returned addrinfo structure.
3955
3956 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3957             Bruno Haible  <bruno@clisp.org>
3958
3959         * inet_ntop.h: New file.
3960         * inet_ntop.c: New file, from glibc with modifications.
3961
3962 2005-05-08  Jim Meyering  <jim@meyering.net>
3963
3964         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3965
3966 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3967
3968         Merge from coreutils.  Among other things,
3969         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3970         * fd-safer.c: New file.
3971         * fcntl-safer.h, open-safer.c: Remove.
3972         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3973         * dup-safer.c: Include unistd-safer.h first.
3974         Don't include errno.h.
3975         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3976         * file-type.h: Don't assume invoker included sys/stat.h first.
3977         * file-type.c: Rely on file-type.h change.
3978         * getloadavg.c: Include unistd-safer.h.
3979         (getloadavg): Use safer open.
3980         * getusershell.c: Include "stdio-safer.h".
3981         (getusershell): Use safer fopen.
3982         * long-options.c (long_options): Use NULL rather than 0.
3983         * modechange.h (mode_free): Remove; all callers changed to invoke
3984         'free'.
3985         * modechange.c: Likewise.
3986         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3987         (MODE_DONE): New constant.
3988         (struct mode_change): Remove 'next' member.
3989         (make_node_op_equals): New function; like the old one of the
3990         same name, except it allocates an array.
3991         (mode_compile, mode_create_from_ref): Use it.
3992         (mode_compile): Allocate result as an array, not a linked list.
3993         Parse octal string ourself, so that we catch mistakes like "+0".
3994         (mode_adjust): Arg is an array, not a linked list.
3995         * modechange.c: Include stat-macros.h, xalloc.h.
3996         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3997         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3998         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3999         Remove.  This is now stat-macros.h's job.
4000         (talloc): Remove.  All callers replaced by xalloc, so that
4001         our invokers don't have to worry about reporting memory failures.
4002         (make_node_op_equals): Remove.
4003         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4004         New constants.
4005         (struct mode_change): Moved here from modechange.h.
4006         (mode_append_entry): Remove.
4007         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4008         apps to have incorrect behavior.  Use simpler algorithm for head
4009         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4010         Detect more invalid usages rather than having somewhat-random behavior.
4011         Don't insert an "a=" action, as that leads to incorrect behavior.
4012         (mode_compile, mode_create_from_ref): Return NULL on error instead
4013         of an enum, since now there's only one way to have an error.  All
4014         callers changed.
4015         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4016         at the correct time.  Simplify calculation of "+u" and its ilk.
4017         Don't mishandle "+X".
4018         (mode_free): Remove "register" and localize decls.
4019         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4020         (struct mode_change): Move to modechange.c; callers don't
4021         need to see this stuff.
4022         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4023         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4024         (mode_change, mode_adjust): Reflect the new signatures noted above.
4025         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4026         that might redefine system include files.
4027         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4028         (my_usleep): Use NULL rather than (void *) 0.
4029         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4030         Use siginterrupt to specify that system calls should be interrupted.
4031         (rpl_nanosleep): Move initialization of suspended closer to call of
4032         my_usleep.
4033         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4034         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4035         (desirable_utmp_entry): New function.
4036         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4037         using x2nrealloc, to simplify logic.
4038         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4039         size calculation.  Do not assume utmp file is a regular file.
4040         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4041         (READ_UTMP_CHECK_PIDS): New constant.
4042         * save-cwd.c: Include unistd-safer.h.
4043         (save_cwd): Use fd_safer.
4044         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4045         [!_LIBC] Include "stat-macros.h" instead.
4046         * unistd-safer.h (fd_safer): New decl.
4047
4048 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4049
4050         * byteswap_.h: New file.
4051
4052 2005-04-25  Albert Chin  <china@thewrittenword.com>
4053
4054         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4055         Toolkit C bug.
4056
4057 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4058
4059         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4060         that "UTC +1 second" continues to work.  Problem reported
4061         by Dmitry V. Levin.
4062         (relunit_snumber): New rule.
4063         (relunit): Use it.
4064
4065 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4066
4067         * getdate.y (universal_time_zone_table): New constant.
4068         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4069         universal_time_zone_table.
4070         (lookup_zone): Prefer universal_time_zone_table to
4071         local_time_zone_table, so that "GMT" time stamps are allowed in
4072         London during the summer.  Problem reported by Ian Abbott.
4073
4074 2005-04-12  Jim Meyering  <jim@meyering.net>
4075
4076         * human.c (humblock): Set *options even when returning due to
4077         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4078         warning from gcc-4.
4079
4080 2005-04-09  Jim Meyering  <jim@meyering.net>
4081
4082         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4083         -Wuninitialized: initialize tm0.tm_year.
4084
4085 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4086
4087         * getdate.y (parser_control): rels_seen is now a boolean, not a
4088         count, since there's no maximum.  All uses changed.
4089         Add member dsts_seen.
4090         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4091         not being INT_MAX.
4092         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4093         Use pc_rels_seen to decide whther a date is absolute.
4094
4095         * getdate.y (number): Don't overwrite year.
4096         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4097         check.
4098
4099 2005-04-02  Simon Josefsson  <jas@extundo.com>
4100
4101         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4102         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4103
4104 2005-03-27  Jim Meyering  <jim@meyering.net>
4105
4106         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4107
4108 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4109
4110         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4111         "one's complement" -> "ones' complement" in comment, as per Knuth.
4112         "value of type" -> "type or expression" in comment.
4113         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4114
4115 2005-03-26  Jim Meyering  <jim@meyering.net>
4116
4117         Comment nits.
4118         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4119         Correct typos: s/or/of/.
4120
4121 2005-03-23  Jim Meyering  <jim@meyering.net>
4122
4123         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4124
4125 2005-03-21  Jim Meyering  <jim@meyering.net>
4126
4127         Changes imported from coreutils.
4128
4129         * cycle-check.c: Don't include xalloc.h.
4130
4131         * path-concat.c: Don't include assert.h.
4132         (path_concat): Remove assertion that would have triggered
4133         for ABASE starting with more than one slash.
4134         Reported by Andreas Schwab.
4135
4136         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4137         properly when ABASE is an absolute file name.
4138         Correct the description of this function.
4139         Include <assert.h>.
4140         Add an assertion and a test driver.
4141         This fixes a bug introduced on 2004-07-02.
4142         Andreas Schwab reported the resulting failure of cp --parents:
4143         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4144
4145 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4146
4147         * strftime.c (my_strftime): If the underlying strftime returns 0
4148         (which shouldn't happen), generate nothing instead of returning 0
4149         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4150
4151 2005-03-16  Bruno Haible  <bruno@clisp.org>
4152
4153         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4154
4155 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4156
4157         * strftime.c (my_strftime): Prepend space to format so that we can
4158         reliably distinguish strftime failure from empty output on POSIX
4159         hosts.
4160
4161 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4162
4163         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4164         (iconv_string): Don't guess a size-zero buffer, as that might cause
4165         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4166         result would be 'too large', where 'too large' is (heuristically)
4167         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4168         overflow concerns.  This will prevent some unwanted malloc failures
4169         when the inputs are very large.
4170
4171 2005-03-15  Bruno Haible  <bruno@clisp.org>
4172
4173         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4174         'negate'.
4175
4176         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4177         variable.
4178
4179         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4180
4181 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4182
4183         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4184         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4185         intprops.h.
4186         * strtol.c: Likewise.
4187
4188 2005-03-14  Simon Josefsson  <jas@extundo.com>
4189
4190         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4191         <fx@gnu.org>.
4192
4193 2005-03-14  Jim Meyering  <jim@meyering.net>
4194
4195         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4196         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4197         to be nonzero so that we (and caller) can detect the difference
4198         between a valid zero-length expansion and an error return, even
4199         when the underlying strftime fails before writing anything into
4200         that location.
4201
4202 2005-03-10  Jim Meyering  <jim@meyering.net>
4203
4204         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4205         so that this module works on systems without fchdir.
4206
4207 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4208
4209         Factor int-properties macros into a single file, except for
4210         glibc-related files.
4211         * intprops.h: New file.
4212         * getloadavg.c: Include it instead of limits.h.
4213         (INT_STRLEN_BOUND): Remove.
4214         * human.c: Include intprops.h.
4215         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4216         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4217         * inttostr.h: Include intprops.h instead of limits.h.
4218         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4219         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4220         for consistency with intprops.h.
4221         (time_t_is_integer, twos_complement_arithmetic): Use them.
4222         * sig2str.h: Include <signal.h>, intprops.h.
4223         (INT_STRLEN_BOUND): Remove.
4224         * strftime.c (TYPE_SIGNED): Remove.
4225         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4226         * strtol.c: Adjust comments to match intprops.h.
4227         * userspec.c: Include intprops.h.
4228         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4229         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4230         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4231         instead of rolling our own expressions.
4232         * xstrtol.c: Include xstrtol.h first, to test interface.
4233
4234         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4235         instead of int.
4236         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4237         the right thing even if adding 1900 would overflow.  Similarly
4238         for tm_mon + 1 and tm_yday + 1.
4239         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4240         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4241         (DO_SIGNED_NUMBER): New macro.
4242         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4243
4244 2005-03-07  Bruno Haible  <bruno@clisp.org>
4245
4246         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4247
4248 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4249             Bruno Haible  <bruno@clisp.org>
4250
4251         * pagealign_alloc.h: New file.
4252         * pagealign_alloc.c: New file.
4253
4254 2005-01-28  Bruno Haible  <bruno@clisp.org>
4255
4256         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4257         stpncpy.c uses it.
4258
4259 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4260
4261         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4262         The workaround isn't strictly needed for POSIX conformance, and
4263         it's too much of a pain to configure and maintain.  We'll ask
4264         people to fix their kernels instead.
4265         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4266         (NANOSLEEP_BUG_WORKAROUND): Remove.
4267         (xnanosleep): Remove the workaround.
4268
4269 2005-02-12  Bruno Haible  <bruno@clisp.org>
4270
4271         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4272
4273 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4274
4275         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4276         * timespec.h (gettime): Return void, since it always
4277         succeeds now.  All uses changed.
4278         * gettime.c (gettime) Likewise.
4279         [HAVE_NANOTIME]: Prefer nanotime.
4280         Assume gettimeofday succeeds, as POSIX requires.
4281         Assime time () succeeds, since other code already does.
4282         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4283         (timespec_subtract): Remove.
4284         (NANOSLEEP_BUG_WORKAROUND): New constant.
4285         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4286         things considerably.  Use it only on GNU/Linux hosts, since the
4287         workaround shouldn't be needed elsewhere.
4288
4289 2005-02-24  Bruno Haible  <bruno@clisp.org>
4290
4291         * gettext.h: Update from GNU gettext 0.14.2.
4292
4293 2005-02-24  Bruno Haible  <bruno@clisp.org>
4294
4295         * localcharset.c: Update from GNU gettext 0.14.2.
4296         * config.charset: Update from GNU gettext 0.14.2.
4297
4298 2005-02-22  Simon Josefsson  <jas@extundo.com>
4299
4300         * iconvme.h, iconvme.c: New files, from libc.
4301
4302 2005-02-20  Neil Conway  <neilc@samurai.com>
4303
4304         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4305         returned by OSX/Darwin if the specified buffer is not large
4306         enough for the hostname.
4307
4308 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4309
4310         * memrchr.h: New file.
4311         * chdir-long.c: Include it.
4312         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4313         Don't bother including stddef.h.
4314
4315 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4316
4317         * argp-help.c (__argp_help): Create a fake struct argp_state and
4318         pass it to _help, otherwise the latter coredumps trying to
4319         dereference state.root_argp.
4320
4321 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4322
4323         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4324         inclusion.
4325         Include <sys/types.h>, for dev_t.
4326         (ME_DUMMY, ME_REMOTE): Move from here....
4327         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4328         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4329         Dmitry V. Levin.
4330         Include mountlist.h first, to test the interface.
4331
4332 2005-01-29  Bruno Haible  <bruno@clisp.org>
4333
4334         * progname.c (program_name): Initialize.
4335         Needed when linking statically on MacOS X.
4336
4337 2005-01-28  Bruno Haible  <bruno@clisp.org>
4338
4339         * javacomp.sh.in: New file, from GNU gettext.
4340         * javacomp.h: New file, from GNU gettext.
4341         * javacomp.c: New file, from GNU gettext.
4342
4343 2005-01-26  Bruno Haible  <bruno@clisp.org>
4344
4345         * javaexec.sh.in: New file, from GNU gettext.
4346         * javaexec.h: New file, from GNU gettext.
4347         * javaexec.c: New file, from GNU gettext.
4348
4349 2005-01-26  Simon Josefsson  <jas@extundo.com>
4350
4351         * gai_strerror.c: Use GPL in header.
4352
4353 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4354
4355         * argp-help.c (hol_entry_help): Avoid using non-constant
4356         initializers for struct pentry_state.
4357         (__argp_error): Check return value of __asprintf
4358         (__argp_failure): Translate error message
4359
4360         * argp-parse.c: Removed braces around the expansion of N_()
4361
4362 2005-01-21  Jim Meyering  <jim@meyering.net>
4363
4364         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4365         same value as for Solaris 9.
4366
4367         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4368         component length.  This included changing the parameter to be
4369         of type `char *' rather than `char const *'.
4370         * chdir-long.h (chdir_long): Update prototype.
4371
4372         * openat.c (fdopendir, fstatat): New functions.
4373         * openat.h: Include headers required for use of DIR and struct stat.
4374         [AT_SYMLINK_NOFOLLOW]: Define.
4375         (fdopendir, fstatat): Add prototypes.
4376
4377 2005-01-21  Bruno Haible  <bruno@clisp.org>
4378
4379         * classpath.h: New file, from GNU gettext.
4380         * classpath.c: New file, from GNU gettext.
4381
4382 2005-01-20  Simon Josefsson  <jas@extundo.com>
4383
4384         * version-etc-fsf.c: New file, with version_etc_copyright.
4385         * version-etc.c: Remove version_etc_copyright.
4386         * version-etc.h (version_etc_copyright): Use [] instead of * in
4387         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4388
4389 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4390
4391         * save-cwd.c (save_cwd): Remove code to support the case
4392         where fchdir is missing or flaky.
4393
4394 2005-01-20  Simon Josefsson  <jas@extundo.com>
4395
4396         * base64.h (isbase64): Add.
4397
4398         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4399         using a unsigned prototype, don't inline.
4400         (base64_decode): Use it.
4401
4402 2005-01-19  Bruno Haible  <bruno@clisp.org>
4403
4404         * sh-quote.h: New file, from GNU gettext.
4405         * sh-quote.c: New file, from GNU gettext.
4406
4407 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4408
4409         Merge changes from coreutils, as described below in several
4410         changelogs dated today.
4411
4412         * save-cwd.c: Include "save-cwd.h" before other include files.
4413         (O_DIRECTORY): Remove; not needed here, since "." must be
4414         a directory.  All uses removed.
4415         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4416         universal on Suns, and we also need to test for IRIX.
4417         Revamp code to use 'if' rather than '#if'.
4418         Avoid unnecessary comparison of cwd->desc to 0.
4419
4420         * utimens.c (futimens): Robustify the previous patch, by checking
4421         for known valid error numbers rather than observed invalid ones.
4422
4423 2005-01-18  Jim Meyering  <jim@meyering.net>
4424
4425         * version-etc.c (version_etc_copyright): Update copyright date.
4426
4427         * utimens.c (futimens): Account for the fact that futimes
4428         can also fail with errno == ENOSYS or errno == ENOENT.
4429         Patch from Dmitry V. Levin.
4430
4431         Change the name of the robust chdir function from chdir to chdir_long.
4432         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4433         (restore_cwd): Use chdir_long, not chdir.
4434         * chdir-long.c: Renamed from chdir.c.
4435         * chdir-long.h: Renamed from chdir.h.
4436         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4437         Hurd.
4438
4439 2005-01-18  Bob Proulx  <bob@proulx.com>
4440
4441         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4442         offsetof() macro construct to avoid compile failure with native HP-UX
4443         11.0 ANSI C compiler.
4444
4445 2005-01-06  Bruno Haible  <bruno@clisp.org>
4446
4447         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4448         because stpncpy.m4 takes care of it.
4449
4450 2004-01-24  Bruno Haible  <bruno@clisp.org>
4451
4452         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4453
4454 2003-10-09  Bruno Haible  <bruno@clisp.org>
4455
4456         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4457
4458 2005-01-06  Bruno Haible  <bruno@clisp.org>
4459
4460         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4461         * fwriteerror.c: Include <stdbool.h>.
4462         (fwriteerror): At the end, close the file stream. Record whether
4463         stdout was already closed.
4464
4465 2004-05-27  Bruno Haible  <bruno@clisp.org>
4466
4467         * execute.c (environ): Declare if needed.
4468         * pipe.c (environ): Likewise.
4469         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4470
4471 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4472
4473         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4474         definitions to be after all include files, to avoid collisions.
4475         Problem reported by Bob Proulx.
4476
4477 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4478
4479         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4480         not needed.  This removes a dependency on the gettext module.
4481         [defined _LIBC]: Do not include <libintl.h>; not needed.
4482
4483 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4484
4485         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4486         HAVE_DECL_STRTOLD.
4487
4488 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4489
4490         * argp-parse.c: Include <stddef.h>.
4491         (alignof, alignto): New macros.
4492         (parser_init): Don't assume that void * is aligned sufficiently
4493         for struct option.
4494
4495         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4496         need to extend the stack.
4497         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4498         large.
4499
4500 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4501
4502         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4503
4504 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4505
4506         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4507         Remove now-obsolete comment about AIX.
4508         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4509         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4510         (YYMAXDEPTH): New macro.
4511
4512 2004-12-18  Bruno Haible  <bruno@clisp.org>
4513
4514         * fatal-signal.c (fatal_signals): Make non-const.
4515         (init_fatal_signals): New function.
4516         (uninstall_handlers, install_handlers): Ignore signals that were set to
4517         SIG_IGN.
4518         (at_fatal_signal): Call init_fatal_signals.
4519         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4520         SIG_IGN.
4521         Reported by Paul Eggert.
4522
4523 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4524
4525         * getdate.y (textint): New member "negative".
4526         (time_zone_hhmm): New function.
4527         Expect 14 shift-reduce conflicts, not 13.
4528         (o_colon_minutes): New rule.
4529         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4530         (yylex): Set the "negative" member of signed numbers.
4531
4532 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4533
4534         Changes imported from coreutils.
4535         * hard-locale.c: Assume <locale.h> exists.
4536         Include "strdup.h".
4537         (GLIBC_VERSION): New macro.
4538         (hard_locale): Assume setlocale exists.
4539         Rewrite to avoid #ifdef.
4540         Use strdup rather than malloc + strcpy.
4541         * human.c: Assume <locale.h> exists.
4542         (human_readable): Assume localeconv exists.
4543
4544 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4545
4546         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4547         convert T2, not T.  (Imported from libc.)
4548
4549 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4550
4551         * getcwd.c (is_ENAMETOOLONG): New macro.
4552         (__getcwd.c): Don't restore errno; glibc doesn't.
4553         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4554         first, falling back to our code only if its results look suspicious.
4555         Ensure that the resulting buffer is only as large as necessary.
4556
4557         * readutmp.c: Include readutmp.h first.
4558         Include <errno.h>, since readutmp.h no longer does that.
4559         * readutmp.h: Don't include <errno.h>,
4560         <sys/param.h>, <time.h>; not needed to establish interface.
4561         (errno): Remove decl.
4562         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4563         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4564         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4565
4566 2004-11-28  Simon Josefsson  <jas@extundo.com>
4567
4568         * base64.h, base64.c: New file.
4569
4570 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4571
4572         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4573
4574 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4575
4576         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4577         HP's ANSI C compiler.
4578         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4579         Declaring int functions causes warnings on some modern systems and
4580         shouldn't be needed to compile on ancient ones.
4581         * same.c (MIN) [defined MIN]: Don't define, since it's already
4582         defined.
4583
4584         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4585         with the following changes.
4586         (__set_errno): Parenthesize properly.
4587         Include <stdbool.h>.
4588         (MIN, MAX, MATCHING_INO): New macros.
4589         (__getcwd): Define with prototype, not K&R form.
4590         Use heuristics to allocate default buffer on stack if possible.
4591         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4592         behavior, and to avoid the PATH_MAX limit when computing
4593         ../../../../...
4594         Use MATCHING_INO to compare inode number to file.
4595         Check for arithmetic overflow in size calculations.
4596         Fix bug in reallocation of dot array that caused getcwd to fail
4597         on directories nested deeper than 75.
4598         Be more careful about saving errno on error.
4599         Do not use realloc; use only free+malloc, as this is a bit
4600         more flexible and avoids a needless copy operation.
4601         Do not inspect st_dev and st_ino for symbolic links; POSIX
4602         doesn't specify the latter.
4603         Check for closedir errors.
4604         Avoid needless casts.
4605         Use "#ifdef weak_alias" around weak_alias, to be like other
4606         glibc code.
4607         The following changes to getcwd.c have effect only when used in
4608         gnulib; they have no effect inside glibc proper.
4609         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4610         as alloca isn't used.
4611         (alloca, __alloca): Likewise.
4612         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4613         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4614         unconditionally, as gnulib assumes C89 or better.
4615         Do not include <sys/param.h>.
4616         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4617         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4618         better.
4619         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4620         Include <dirent.h> in a way that is compatible with modern Autoconf.
4621         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4622         New macros, if not already defined.
4623         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4624         Use "_LIBC", not "defined _LIBC", for consistency.
4625         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4626         a mempcpy module.
4627         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4628         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4629         * xgetcwd.c: David MacKenzie's old code was removed, so give
4630         credit only to Jim Meyering and adjust the copyright dates.
4631         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4632         <stdlib.h>, <unistd.h>, "pathmax.h".
4633         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4634         (INITIAL_BUFFER_SIZE): Remove.
4635         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4636
4637 2004-11-23  Jim Meyering  <jim@meyering.net>
4638
4639         * getopt_.h: Remove trailing blanks.
4640
4641 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4642
4643         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4644         (futimens): New function, which uses futimes if available.
4645         (futimens, utimens): Support timespec==NULL, with same semantics
4646         as utime and utimens.
4647         * utimens.h (futimens): New decl.
4648
4649 2004-11-23  Jim Meyering  <jim@meyering.net>
4650
4651         * __fpending.c: Add comment.
4652
4653 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4654
4655         * getopt_.h: Re-addition of __getopt_argv_const caused
4656         redefinition warnings. To avoid them, include the defines
4657         in `#if !defined __need_getopt ... #endif'. The only place
4658         where __getopt_argv_const is used is in definitions
4659         of getopt_long and getopt_long_only below, which are as well
4660         protected by `#ifndef __need_getopt'.
4661         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4662         __need_getopt after including <stdio.h> and <unistd.h> These
4663         headers might have defined it.
4664
4665 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4666
4667         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4668         New macros.
4669         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4670         optopt): Use them instead of invoking ## directly; otherwise, the
4671         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4672
4673 2004-11-19  Bruno Haible  <bruno@clisp.org>
4674
4675         * strtok_r.c: Move comments from here...
4676         * strtok_r.h: ... to here.
4677
4678 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4679
4680         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4681         might fail.  Problem reported by Yoann Vandoorselaere.
4682         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4683         that mishandle size_t overflow.
4684
4685 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4686
4687         * canon-host.c: Include "strdup.h".
4688         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4689         Use strdup instead of malloc/strcpy to duplicate strings.
4690
4691         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4692         (human_space_before_unit): New constant.
4693         * human.c (human_readable): Support it.
4694
4695         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4696         (xgetcwd): Set errno correctly when failing.
4697         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4698         the failure is actually due to a PATH_MAX problem.
4699
4700         Further getopt changes to make it more likely that glibc will
4701         buy the changes back.
4702         * getopt.c (POSIXLY_CORRECT): New constant.
4703         (getopt): Use it, so to preserve glibc semantic
4704         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4705         when compiling for libc.
4706         * getopt_.h (__getopt_argv_const): Bring it back.
4707         (getopt_long, getopt_long_only): Use it.
4708
4709         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4710         New arg POSIXLY_CORRECT.  All callers changed.
4711         (getopt): Argv is now char * const *, as per standard.
4712         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4713         not char *__getopt_argv_const *.
4714         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4715         _getopt_long_only_r): Likewise.
4716         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4717         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4718         _getopt_long_r, _getopt_long_only_r): Likewise.
4719         * getopt_.h (__getopt_argv_const): Remove.
4720         (getopt): Argv is now char * const *, as per standard.
4721
4722         * getdate.y (tORDINAL): New token.
4723         (day, relunit): Allow it for relative times.
4724         (relative_time_table): Use tORDINAL for ordinals.
4725
4726 2004-11-15  Jim Meyering  <jim@meyering.net>
4727
4728         * closeout.c: Include "__fpending.h" once again.
4729         Include <stdbool.h>.
4730         (close_stdout): Don't fail just because stdout was closed initially,
4731         since some programs don't write to stdout in the normal course of
4732         operation (other than --version and --help), and we don't want this
4733         function to make e.g. `touch file >&-' fail.
4734         But do fail if it was closed and someone has tried to write to it.
4735         E.g., `printf foo >&-' must fail.
4736
4737 2004-11-11  Simon Josefsson  <jas@extundo.com>
4738
4739         * strtok_r.h, strtok_r.c: New file.
4740
4741 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4742
4743         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4744         we can stop lying to compilers about the constness of argv when we
4745         are compiled outside glibc.
4746         (getopt, getopt_long, getopt_long_only): Use it.
4747         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4748         getopt): Likewise.
4749         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4750         _getopt_long_only_r): Likewise.
4751         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4752         _getopt_long_only_r): Likewise.
4753
4754         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4755         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4756         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4757         the other external symbols.
4758         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4759         declaration, since the above renaming now works around collisions.
4760
4761 2004-11-11  Jim Meyering  <jim@meyering.net>
4762
4763         * linebreak.c: Remove trailing blanks.
4764         * alloca_.h: Likewise.
4765         * acosl.c: Likewise.
4766         * euidaccess.c: Likewise.
4767         * allocsa.h: Likewise.
4768
4769 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4770
4771         * mktime.c (SHR): New macro, which is a portable
4772         substitute for >> that should work even on Crays.
4773         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4774         Problem reported by Mark D. Baushke in
4775         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4776         * getdate.y (SHR): Likewise.
4777         (tm_diff): Use it.
4778         * strftime.c (SHR): Likewise.
4779         (tm_diff): Use it.
4780         * quotearg.c (struct quoting_options): Use unsigned int for
4781         quote_these_too, so that right shifts are well defined.  All uses
4782         changed.
4783
4784 2004-11-10  Simon Josefsson  <jas@extundo.com>
4785
4786         * getaddrinfo.h, getaddrinfo.c: New files.
4787
4788 2004-11-10  Jim Meyering  <jim@meyering.net>
4789
4790         Ensure that no close failure goes unreported.
4791         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4792         return early when it seems there's nothing to flush.
4793         Don't include __fpending.h.
4794
4795 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4796
4797         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4798
4799 2004-11-05  Bruno Haible  <bruno@clisp.org>
4800
4801         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4802         Reported by Mark D. Baushke <mdb@cvshome.org>.
4803
4804 2004-11-04  Bruno Haible  <bruno@clisp.org>
4805
4806         2004-09-11  Bruno Haible  <bruno@clisp.org>
4807                 * allocsa.valgrind: New file.
4808         2004-02-06  Bruno Haible  <bruno@clisp.org>
4809                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4810                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4811                 Reported by Christopher Seip <chris.seip@hp.com>.
4812
4813 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4814
4815         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4816         with errno == ERANGE if the buffer is too small.
4817         Problem reported by Mark D. Baushke.
4818
4819 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4820
4821         * xreadlink.c (MAXSIZE): New macro.
4822         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4823         size does not exceed MAXSIZE.  Avoid cast.
4824         As suggested by Mark D. Baushke in
4825         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4826         if readlink fails with buffer size just under MAXSIZE, try again
4827         with MAXSIZE.
4828
4829 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4830         and  Paul Eggert  <eggert@cs.ucla.edu>
4831
4832         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4833         (get_date): Overparenthesize to avoid GCC warning.
4834
4835 2004-11-02  Bruno Haible  <bruno@clisp.org>
4836
4837         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4838         function returns void.
4839
4840 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4841
4842         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4843         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4844         already declared.
4845
4846 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4847
4848         * getdate.y: Add support for TZ="foo" within a date string.
4849         Fix some bugs near time_t boundaries.  Reject dates with
4850         out-of-range components, e.g., "Sept 31".
4851         Include <stdlib.h>, "setenv.h", "xalloc.h".
4852         (ISDIGIT_LOCALE): Remove; unused.
4853         Note that the TZ and time functions used here are not reentrant.
4854         (mktime_ok, get_tz): New functions.
4855         (TZBUFSIZE): New constant.
4856         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4857         This requires that we sometimes generate our own TZ="XXX..." setting.
4858
4859 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4860
4861         * mktime.c (not_equal_tm): Remove redundant check.
4862
4863 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4864
4865         * getdate.y: Use Bison 1.875 features, and some minor
4866         code cleanups.  This change does not affect semantics.
4867         Don't include <stdlib.h>; no longer needed.
4868         Don't include unlocked-io.h; only the "#if TEST" code uses
4869         stdio, and performance isn't crucial there.
4870         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4871         Bison 1.875 features as described below.
4872         All uses of "PC." replaced by "pc->".
4873         (YYSTYPE): Add a forward declaration.
4874         (yylex, yyerror): Use full prototypes in forward decls.
4875         Use "%pure-parser" rather than obsolescent "%pure_parser".
4876         Use %parse-param and %lex-param instead of obsolescent
4877         YYPARSE_PARAM and YYLEX_PARAM.
4878         (meridian_table, month_and_day_table, time_units_table,
4879         relative_time_table, time_zone_table, military_table,
4880         lookup_zone, lookup_word, get_date):
4881         Use NULL instead of 0 where appropriate.
4882         (to_hour): Avoid abort (), to avoid a dependency on
4883         stdlib.h.
4884         (yyerror, yylex): Now accepts parser_control * arg.
4885         (main) [TEST]: Use '\0' rather than 0 for char.
4886
4887 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4888
4889         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4890         It's now the caller's responsibility to handle the case where
4891         !HAVE_GETPAGESIZE && !defined getpagesize.
4892
4893         * mktime.c (leapyear): Arg is long int, not int.
4894
4895 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4896
4897         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4898
4899 2004-10-12  Simon Josefsson  <jas@extundo.com>
4900
4901         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4902         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4903         to real functions.
4904
4905 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4906
4907         * vsnprintf.h: New file.
4908         * vsnprintf.c: New file.
4909
4910 2004-10-07  Bruno Haible  <bruno@clisp.org>
4911
4912         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4913         into the provided buffer.
4914
4915 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4916
4917         * diacrit.c, diacrit.h: Add GPL notice.
4918
4919         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4920         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4921         * logl.c (logl): Keep the code as similar to glibc as possible.
4922         This avoids a potential constant-folding bug.
4923
4924 2004-10-05  Bruno Haible  <bruno@clisp.org>
4925
4926         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4927
4928 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4929
4930         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4931         * xmalloc.c (xmemdup): Likewise.
4932         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4933         XFREE): Remove these long-obsolescent macros.
4934         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4935         * xstrdup.c: Remove.
4936
4937         * regex.c (re_comp): Cast gettext return value to char *,
4938         Problem reported by Martin Neitzel via Mark D. Baushke.
4939
4940 2004-10-04  Simon Josefsson  <jas@extundo.com>
4941
4942         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4943         '#ifdef USE_UNLOCKED_IO'.
4944
4945 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4946
4947         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4948         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4949         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4950         regex.c, sha1.c, version-etc.c, yesno.c:
4951         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4952         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4953         the includer's responsibility.
4954
4955         Sync from coreutils.
4956
4957         * modechange.c (mode_compile): Don't decrement a pointer that
4958         points to the start of a string, as the C Standard says the
4959         resulting behavior is undefined.
4960
4961         * backupfile.h (enum backuptype): Rename none -> no_backups,
4962         simple -> simple_backups, numbered_existing ->
4963         numbered_existing_backups, numbered -> numbered_backups
4964         to avoid shadowing problems.  All uses changed.
4965         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4966         * backupfile.c (check_extension, numbered_backup):
4967         Rename locals to avoid shadowing 'basename'.
4968         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4969         once.
4970
4971         * .cppi-disable: Add getopt_.h, getopt_int.h.
4972         * .cvsignore: Add getopt.h.
4973
4974 2004-10-04  Simon Josefsson  <jas@extundo.com>
4975
4976         * memmem.h: New file.
4977         * memmem.c: New file, taken from glibc.
4978
4979 2004-10-02  Jim Meyering  <jim@meyering.net>
4980
4981         * dirfd.h, getpagesize.h: Add copyright notice.
4982
4983 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4984
4985         * snprintf.c: Remove comments as to why each header is needed.
4986
4987 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
4988
4989         * strsep.h: New file.
4990         * strsep.c: New file.
4991
4992 2004-10-01  Simon Josefsson  <jas@extundo.com>
4993
4994         * snprintf.c (snprintf): Handle size==0.
4995
4996 2004-10-01  Simon Josefsson  <jas@extundo.com>
4997             Bruno Haible  <bruno@clisp.org>
4998
4999         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5000         (snprintf): Declare 'args'.
5001
5002 2004-09-30  Simon Josefsson  <jas@extundo.com>
5003
5004         * snprintf.h, snprintf.c: New files.
5005
5006 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5007
5008         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5009         (hol_entry_help): Never translate an empty string.
5010         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5011         * argp.h (OPTION_NO_TRANS): New option.
5012
5013 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5014
5015         * xvasprintf.c: Include xalloc.h.
5016         (xvasprintf): Use xalloc_die, not xmalloc_die.
5017
5018 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5019
5020         * dummy.c: Change copyright notice to FSF, and license to GPL.
5021
5022 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5023
5024         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5025         Problem reported by Bruno Haible in:
5026         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5027
5028 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5029
5030         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5031         in case some system header has #define'd it.  Problem reported by
5032         Soeren D. Schulze in
5033         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5034
5035 2004-09-08  Bruno Haible  <bruno@clisp.org>
5036
5037         * stdint_.h: New file, taken from GNU clisp.
5038
5039 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5040
5041         * xvasprintf.h: New file.
5042         * xvasprintf.c: New file.
5043         * xasprintf.c: New file.
5044
5045 2004-09-08  Bruno Haible  <bruno@clisp.org>
5046
5047         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5048         is > INT_MAX.
5049         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5050
5051 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5052
5053         Import from coreutils.
5054         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5055         strings on unbounded length.  alloca's performance benefits aren't
5056         that important here.
5057         (V_STRDUP): Remove.
5058         (parse_with_separator): New function, with most of the internals
5059         of the old parse_user_spec.  Allow user to omit both user and group,
5060         for compatibility with FreeBSD.
5061         Clone only the user name, not the entire spec.
5062         Do not set *uid, *gid unless entirely successful.
5063         Avoid memory leak in some failing cases.
5064         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5065         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5066         (parse_user_spec): Rewrite to use parse_with_separator.
5067
5068 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5069
5070         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5071         its complicated substitute.
5072         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5073         and program_invocation_name.
5074         (__argp_basename) [!_LIBC]: Remove; the only use was
5075         replaced by its body.
5076         (__argp_short_program_name): Change condition from
5077         !defined __argp_short_program_name to
5078         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5079         to match argp-namefrob.h.
5080         (__argp_failure): Don't assume strerror_r returns char *.
5081         * argp-parse.c (N_): Define unconditionally.
5082         (argp_default_options): Fill out initializers with 0 to avoid
5083         gcc warnings.
5084
5085 2004-08-12  Simon Josefsson  <jas@extundo.com>
5086
5087         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5088         * getopt_.h: Renamed from getopt.h.
5089
5090 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5091
5092         Merge from coreutils.
5093
5094         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5095         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5096         for Reliant Unix 5.43.
5097
5098         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5099         (union fooround): Use uintmax_t, not long int.
5100         The rest is a merge from libc:
5101         [defined _LIBC]: Include <shlib-compat.h>.
5102         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5103
5104         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5105
5106         * strverscmp.c: Convert to UTF-8.
5107
5108 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5109
5110         * obstack.h (obstack_empty_p):
5111         Don't assume that chunk->contents is suitably aligned.
5112         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5113         Likewise. Problem reported by Benno in
5114         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5115
5116         * chown.c (rpl_chown): Work even if the file is writeable but not
5117         readable.  This could be improved further but it'd take some work.
5118
5119 2004-08-08  Simon Josefsson  <jas@extundo.com>
5120
5121         * xgethostname.c: Don't include error.h (not used).
5122
5123         * getpass.h: Add.
5124         * getpass.c: Include getpass.h first.
5125
5126 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5127
5128         * xalloc-die.c: New files.
5129         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5130         All uses removed.
5131         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5132         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5133         (_, N_, xalloc_die): Move to xalloc-die.c.
5134         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5135         so that we needn't mess with xalloc_msg_memory_exhausted.
5136
5137         * sha1.h: Renamed from sha.h.
5138         (SHA1_H): Renamed from _SHA_H.
5139         (sha1_ctx): Renamed from sha_ctx.
5140         (sha1_init_ctx): Renamed from sha_init_ctx.
5141         (sha1_process_block): Renamed from sha_process_block.
5142         (sha1_process_bytes): Renamed from sha_process_bytes.
5143         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5144         (sha1_read_ctx): Renamed from sha_read_ctx.
5145         (sha1_stream): Renamed from sha_stream.
5146         (sha1_buffer): Renamed from sha_buffer.
5147         * sha1.c: Likewise; renamed from sha.c.
5148         Do not include <sys/types.h>.
5149         Include <stddef.h> rather than <stdlib.h>.
5150
5151 2004-08-08  Bruno Haible  <bruno@clisp.org>
5152
5153         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5154         FILESYSTEM_PREFIX_LEN.
5155         * progreloc.c: Likewise.
5156         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5157
5158 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5159
5160         Merge from tar.
5161         * argp-help.c (make_hol, hol_append): Don't assume that
5162         SIZE_MAX is a valid preprocessor constant.
5163         (__argp_basename): Change from "#ifndef _LIBC"
5164         to "#ifndef __argp_short_program_name", so that
5165         we don't compile these functions for tar.
5166
5167         More merges from coreutils.
5168         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5169         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5170         yesno.h: New files.
5171         * addext.c: Remove; no longer needed.
5172         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5173         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5174         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5175         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5176         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5177         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5178         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5179         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5180         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5181         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5182         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5183         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5184         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5185         Import changes from coreutils.
5186
5187 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5188
5189         Merge from coreutils.
5190
5191         * .gdb-history: Remove; this doesn't belong here.
5192
5193         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5194         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5195         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5196
5197         * dirname.h: Include <stdbool.h>.
5198         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5199         for consistency with POSIX terminology.  All uses changed.
5200         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5201         (strip_trailing_slashes): Use bool for booleans.
5202         * stripslash.c (strip_trailing_slashes): Likewise.
5203
5204         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5205         sometimes returns a positive errno value even when it succeeds.
5206         (print_errno_message) [!LIBC]: Fall back on strerror if
5207         __strerror_r fails.
5208
5209         * path-concat.c (mempcpy): Don't define if a system header defines it.
5210         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5211         (longest_relative_suffix): New function.
5212         (path_concat): Use it.  Assume first argument is not NULL.
5213         Port to DOS.  Omit redundant separators.
5214         Report an error instead of returning NULL.
5215         Use mempcpy instead of memcpy.
5216         (xpath_concat): Remove: not declared or used.
5217
5218         * same.h: Include <stdbool.h>
5219         (same_name): Return bool, not int.
5220         * same.c (same_name): Likewise.
5221         (errno): Don't declare; we assume C89 or better now.
5222
5223         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5224         if not already defined.
5225
5226         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5227         * dup-safer.c (errno): Likewise.
5228
5229 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5230
5231         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5232         working.
5233
5234 2004-08-03  Simon Josefsson  <jas@extundo.com>
5235
5236         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5237         * progname.h: Don't include stdbool.h.
5238
5239 2004-08-02  Simon Josefsson  <jas@extundo.com>
5240
5241         * getsubopt.h: New file, with comments from Bruno Haible.
5242         * getsubopt.c: New file, from glibc, but slightly modified based on
5243         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5244
5245 2004-08-01  Simon Josefsson  <jas@extundo.com>
5246
5247         * xgetdomainname.c: Include stdlib.h, for free().
5248
5249 2004-07-16  Simon Josefsson  <jas@extundo.com>
5250
5251         * dummy.c: New file.
5252
5253 2004-07-16  Bruno Haible  <bruno@clisp.org>
5254
5255         * backupfile.h: Add extern "C" for C++.
5256         * closeout.h: Likewise.
5257         * copy-file.h: Likewise.
5258         * findprog.h: Likewise.
5259         * full-write.h: Likewise.
5260         * pathname.h: Likewise.
5261         * progname.h: Likewise.
5262         * stpcpy.h: Likewise.
5263         * stpncpy.h: Likewise.
5264         * strcase.h: Likewise.
5265         * strstr.h: Likewise.
5266         * xalloc.h: Likewise.
5267
5268         * mbswidth.h: Add extern "C" for C++.
5269         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5270
5271 2004-07-09  Simon Josefsson  <jas@extundo.com>
5272
5273         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5274         failed without this.)
5275
5276 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5277
5278         * fchown-stub.c: New file.
5279
5280 2004-06-24  Jim Meyering  <jim@meyering.net>
5281
5282         * obstack.h (obstack_base): Cast to (void *), per documentation.
5283
5284 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5285
5286         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5287
5288 2004-06-01  Jim Meyering  <jim@meyering.net>
5289
5290         * calloc.c: New file.
5291
5292 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5293
5294         * getdate.y (yylex): Allow space between sign and number.
5295         Problem reported by Dan Jacobson.
5296
5297 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5298         and  Jim Meyering  <jim@meyering.net>
5299
5300         Merge from coreutils CVS.
5301
5302         * stat-macros.h: New file, with contents from file-type.h
5303         and coreutils' system.h.
5304         * file-type.c: Include "stat-macros.h".
5305         * file-type.h (file_type): Move all macro definitions to new file,
5306         stat-macros.h.
5307
5308         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5309         Wrap old code with this conditional.
5310         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5311         function that does not dereference symlinks.
5312         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5313
5314         * xreadlink.c: Include xreadlink.h first, to catch .h file
5315         dependency problems.
5316         (xreadlink): Accept new arg SIZE, for efficiency.
5317         All decls and uses changed.
5318         * xreadlink.h: Include <stddef.h>, for size_t.
5319
5320         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5321         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5322
5323         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5324
5325 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5326
5327         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5328         macros to be defined.
5329         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5330         the allocator returns NULL because the requested size is zero.
5331
5332 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5333
5334         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5335         var.  Add comment explaining why libc still defines it.  This
5336         merges the following patch from glibc:
5337         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5338
5339 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5340
5341         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5342         present in glibc since revision 1.1 of this file.
5343         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5344         obstack_alignment_mask, obstack_alloc, obstack_base,
5345         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5346         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5347         obstack_grow0, obstack_init, obstack_int_grow,
5348         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5349         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5350         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5351         nonexistent functions.
5352
5353 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5354             Paul Eggert  <eggert@cs.ucla.edu>
5355
5356         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5357
5358 2004-05-14  Bruno Haible  <bruno@clisp.org>
5359
5360         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5361         that consists of a '.' followed by an empty digit string.
5362         Patch by Tor Lillqvist <tml@iki.fi>.
5363
5364 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5365
5366         Port obstack to the AS/400, where pointers are 16 bytes wide and
5367         you cannot cast an integer to a valid pointer.  This patch is
5368         currently waiting to be integrated into glibc; see
5369         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5370
5371         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5372         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5373         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5374         (struct obstack): temp member is now a union of a pointer and
5375         an integer, instead of an integer.  All integer uses changed.
5376         This does not affect the physical layout of struct obstack,
5377         except on hosts (like the AS/400) where the size or alignment of
5378         void * is greater than that of ptrdiff_t.
5379         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5380         __STDC__)]: Store temporary in pointer member of union, not
5381         integer member.
5382         * obstack.c: Include <stddef.h>, for offsetof.
5383         (struct fooalign): Remove; it doesn't need a name.
5384         (union fooround): Change double to long double, and add void *.
5385         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5386         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5387         not a macro.  Hence the values are always int; so remove all
5388         casts-to-int in uses.
5389
5390 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5391             Derek Price  <derek@ximbiot.com>
5392
5393         * alloca.c: Include <alloca.h>, to get our interface.
5394         * alloca_.h: Use __alloca on AIX, so that we don't have to
5395         include <alloca.h> first.  Use C89 prototype for alloca; this
5396         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5397         Use #elif for simplicity, since we can assume C89 now.
5398         Don't try to source the system alloca.h since it will not be found
5399         and to prevent recursively including its replacement.
5400         * fnmatch.c: Include <alloca.h> instead of opencoding.
5401         * regex.c: Likewise.
5402
5403 2004-05-16  Derek Price  <derek@ximbiot.com>
5404             Paul Eggert  <eggert@cs.ucla.edu>
5405
5406         getline cleanup.  This changes the getndelim2 API: both order of
5407         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5408         no delimiter).
5409
5410         * getline.c: Don't include stddef.h or stdio.h, since our
5411         interface does that.
5412         (getline): Always use getdelim, so that we don't have two
5413         copies of this code.
5414         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5415         if available.
5416         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5417         (GETNDELIM2_MAXIMUM): New macro.
5418         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5419         instead of the old practice of delim2==0.  All callers changed.
5420         Return -1 on overflow, instead of returning junk.
5421         Do not set *linesize unless allocation succeeds.
5422         * getndelim2.h: Do not include stddef.h; no longer needed, now
5423         that we include sys/types.h.
5424         * getnline.h: Likewise.
5425         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5426         (getndelim2): Reorder arguments.
5427         * getnline.c (getnline, getndelim):
5428         Don't discard the NMAX argument.
5429         (getnline): Invoke getndelim, to avoid code duplication.
5430         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5431         of (size_t) -1 by callers of the getnline family.
5432
5433 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5434
5435         * nanosleep.c (suspended): Change its type from int to
5436         sig_atomic_t volatile.
5437         (first_call): Make it private to rpl_nanosleep, and have it
5438         be zero initially as that's a bit faster.
5439         (my_usleep): Round up fractional times instead of truncating them,
5440         as this is the usual meaning for 'sleep'.
5441
5442         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5443         doesn't work.
5444         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5445         (ENOSYS): Define if not defined.
5446         (settime): Fall back on stime if it exists and settimeofday fails.
5447         But don't bother with fallbacks if a method fails with errno == EPERM.
5448
5449 2004-05-11  Jim Meyering  <jim@meyering.net>
5450
5451         Prior to this change, the save_cwd caller required read access to the
5452         current directory on most systems (ones with the fchdir function).
5453
5454         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5455         fails, try write-only, and finally, resort to using xgetcwd.
5456
5457 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5458
5459         * obstack.c, obstack.h: Import changes from libc.
5460
5461 2004-04-28  Bruno Haible  <bruno@clisp.org>
5462
5463         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5464         implicitly appends .exe to executables.
5465         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5466         accepts Windows pathnames.
5467         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5468         Cygwin like Windows, since it now accepts Windows pathnames.
5469         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5470         Cygwin like Windows, since it now accepts Windows pathnames.
5471         Reported by Derek Robert Price <derek@ximbiot.com>.
5472
5473 2004-04-20  Jim Meyering  <jim@meyering.net>
5474
5475         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5476
5477 2004-04-20  Jim Meyering  <jim@meyering.net>
5478             Bruno Haible  <bruno@clisp.org>
5479
5480         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5481         memory when realloc fails.
5482
5483 2004-04-18  Jim Meyering  <jim@meyering.net>
5484
5485         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5486         don't leak memory and do call END_UTMP_ENT.
5487
5488 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5489
5490         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5491         (CHAR_BIT): Remove, since we assume C89.
5492         Include <stdint.h> if available, as per current Autoconf CVS advice.
5493
5494 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5495
5496         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5497         not bool, to be more consistent with Unix conventions.
5498         Suggested by Bruno Haible.
5499
5500         Merge from coreutils.
5501
5502         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5503         New files.
5504
5505         * getdate.h: Include stdbool.h, and timespec.h instead of
5506         the usual <time.h> dance.
5507         (get_date): Change signature to support fractional time stamps.
5508         All callers changed.
5509         * getdate.y: Include "getdate.h" first, as we can now
5510         assume C89 and don't need to worry about 'const'.
5511         Similarly, include "unlocked-io.h" near start, not in middle.
5512         Include <limits.h>.
5513         (textint.value): Use long int rather than int.
5514         (textint.digits): Use size_t rather than int.
5515         (BILLION, LOG10_BILLION): New constants.
5516         (parser_control): New member rel_ns.  Members day_ordinal,
5517         time_zone, month, day, hour, minutes, rel_year, rel_month,
5518         rel_day, rel_hour, rel_minutes, rel_seconds
5519         are now long int, not int.  Member seconds is now struct timespec,
5520         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5521         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5522         not int.
5523         (%union.intval): Now long int, not int.
5524         New member timespec.
5525         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5526         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5527         (spec): Now is a timespec or an item list.
5528         (timespec, items): New nonterminals.
5529         (time, rel, relunit, number, get_date):
5530         Add support for fractional seconds.
5531         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5532         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5533         (to_hour): First arg is now long int, not int.
5534         (to_year): Returns long int, not int.
5535         Don't treat year -70 like 70.
5536         (tm_diff): Returns long int, not int.
5537         (lookup_word): Use bool instead of int when appropriate.
5538         (yylex): Use size_t for count, not int.
5539         Detect overflow when parsing large integer constants.
5540         Add support for fractions.
5541         (get_date): Make pointers 'const' if possible.
5542         Use more-portable code to detect integer overflow.
5543         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5544         Don't use ctime; it's not reliable if the year has >4 digits.
5545
5546         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5547         This is for compatibility with BSD.
5548
5549         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5550         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5551         From coreutils' system.h.
5552
5553         * userspec.c: Don't include "posixver.h".
5554         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5555         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5556         compatible extension.  Simplify code by removing a boolean int
5557         that was always nonzero if a string was nonnull.
5558
5559 2004-03-30  Jim Meyering  <jim@meyering.net>
5560
5561         Merge from coreutils.
5562
5563         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5564
5565         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5566         an empty input stream.
5567
5568         * readtokens.c: Include <stdbool.h>.
5569         (readtoken): Use `size_t' rather than int/long.
5570         All callers adjusted.
5571         Use `bool' rather than `int' where appropriate.
5572         Use memset rather than an explicit loop.
5573         Use x2nrealloc rather than xrealloc.
5574         Allow the use of `\0' as a delimiter.
5575         (readtokens): Likewise.
5576         * readtokens.h (readtoken, readtokens): Update prototypes.
5577
5578 2004-03-30  Bruno Haible  <bruno@clisp.org>
5579
5580         * getloadavg.c (getloadavg): Don't assume setlocale returns
5581         nonnull.
5582
5583 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5584
5585         Merge changes to getloadavg.c from coreutils and Emacs.
5586
5587         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5588         Define to an expression, not to the empty string.
5589         Include cloexec.h and xalloc.h.
5590         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5591         Use set_cloexec_flag rather than rolling our own.
5592         * cloexec.c, cloexec.h: New files.
5593
5594 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5595
5596         * getopt.h: Sync with libc CVS.
5597
5598 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5599             Bruno Haible  <bruno@clisp.org>
5600
5601         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5602         not on all platforms that have <wchar.h>.
5603         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5604
5605 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5606
5607         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5608         Sync with libc CVS.
5609         * getopt_int.h: New file, also synced from libc.
5610
5611 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5612
5613         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5614         '#if' expressions.  Unlike the code it replaces, it does not
5615         depend on (defined _SC_PAGESIZE).  However, it does depend on
5616         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5617         first reported by Jason Andrade in
5618         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5619
5620 2004-01-18  Simon Josefsson  <jas@extundo.com>
5621
5622         * strdup.h: New file.
5623         * strdup.c: Include it.
5624         * path-concat.c: Include strdup.h. Drop strdup declaration.
5625         * userspec.c: Include strdup.h. Drop strdup declaration.
5626
5627 2004-02-06  Karl Berry  <karl@gnu.org>
5628
5629         * config.charset: update from gettext 0.14.1.
5630
5631 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5632
5633         Add comments and code, prompted by suggestions from Bruno Haible
5634         for sh-quote.
5635         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5636         describing the enum quoting_style values.
5637         * quotearg.c (quotearg_alloc): New function.
5638         (quotearg_buffer_restyled): Treat lone { and } as special.
5639         Treat = as special.  Work around bug with older shells
5640         that "see" a '\' that is really the 2nd byte of a multibyte char.
5641         Quote empty string with shell_quoting_style.
5642
5643 2004-02-03  Bruno Haible  <bruno@clisp.org>
5644
5645         * pipe.h: New file, from GNU gettext.
5646         * pipe.c: New file, from GNU gettext.
5647
5648 2004-01-27  Bruno Haible  <bruno@clisp.org>
5649
5650         * execute.h: New file, from GNU gettext.
5651         * execute.c: New file, from GNU gettext.
5652         * w32spawn.h: New file, from GNU gettext.
5653
5654 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5655
5656         Exit-status fix from coreutils.
5657
5658         Use exit_failure consistently in place of EXIT_FAILURE,
5659         so that program exit statuses are consistent on failure.
5660
5661         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5662         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5663         * argmatch.h: Comment fix to match the above.
5664         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5665         Now a macro referring to exit_failure, instead of a separate
5666         variable.  Include "exitfail.h" to get it.
5667         * xstrtol.h: Include "exitfail.h".
5668         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5669
5670         * long-options.c (parse_long_options): Use prototype
5671         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5672         for clarity.
5673
5674 2004-01-21  Jim Meyering  <jim@meyering.net>
5675
5676         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5677         so as not to conflict with a different-sized __mktime_internal
5678         function in GNU libc.
5679         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5680         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5681
5682 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5683
5684         Merge from diffutils.
5685
5686         * file-type.c (file_type): Add typed memory objects.
5687         * file-type.h (S_TYPEISTMO): New macro.
5688
5689         * c-stack.h (c_stack_action): Remove argv argument.
5690         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5691         (die): Don't calculate message unless segv_action returns.
5692         (get_stack_location, min_address_from_argv, max_address_from_argv,
5693         volatile stack_base, volatile_stack_size): Remove.
5694         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5695         that every segmentation violation is a stack overflow.  (Ouch!)
5696         See Debian bug 136249 (still outstanding) for more info about why
5697         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5698
5699 2003-11-30  Bruno Haible  <bruno@clisp.org>
5700
5701         Safer stack allocation.
5702         * setenv.c: Include allocsa.h.
5703         (alloca): Remove fallback definition.
5704         (freea): Remove macro.
5705         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5706         instead of freea.
5707
5708 2003-10-17  Bruno Haible  <bruno@clisp.org>
5709
5710         * binary-io.h: Avoid warnings on Cygwin.
5711
5712 2003-12-28  Bruno Haible  <bruno@clisp.org>
5713
5714         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5715         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5716
5717 2003-11-28  Bruno Haible  <bruno@clisp.org>
5718
5719         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5720
5721 2003-11-27  Bruno Haible  <bruno@clisp.org>
5722
5723         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5724
5725 2003-11-17  Bruno Haible  <bruno@clisp.org>
5726
5727         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5728
5729 2003-11-24  Bruno Haible  <bruno@clisp.org>
5730
5731         * xallocsa.h: New file, from GNU gettext.
5732         * xallocsa.c: New file, from GNU gettext.
5733
5734 2003-11-24  Bruno Haible  <bruno@clisp.org>
5735
5736         * allocsa.h: New file, from GNU gettext.
5737         * allocsa.c: New file, from GNU gettext.
5738
5739 2003-11-24  Bruno Haible  <bruno@clisp.org>
5740
5741         * eealloc.h: New file.
5742
5743 2004-01-15  Jim Meyering  <jim@meyering.net>
5744
5745         Merge from coreutils.
5746
5747         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5748         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5749         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5750
5751         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5752         optional configure-time default.
5753
5754         * version-etc.c (version_etc_copyright): Update copyright date.
5755
5756         * xreadlink.c (xreadlink): Correct outdated comment.
5757
5758 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5759
5760         Merge from coreutils.
5761
5762         * posixver.c: Include posixver.h.
5763
5764         * same.c: Include <stdbool.h>, <limits.h>.
5765         (_POSIX_NAME_MAX): Define if not defined.
5766         (MIN): New macro.
5767         (same_name): If file names are silently truncated, report
5768         that the file names are the same if they are the same after
5769         the silent truncation.
5770
5771         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5772         conversion function.
5773         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5774         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5775         longer needed.
5776
5777 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5778
5779         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5780         with like-named macro in fnmatch.c.
5781         (EXT): Use an internal constant instead.
5782
5783         Merge fnmatch patches from glibc.
5784         * fnmatch.c (mbsinit): Remove define.
5785         Add libc_hidden_ver (__fnmatch, fnmatch).
5786         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5787         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5788
5789 2003-12-14  Karl Berry  <karl@gnu.org>
5790
5791         * config.charset: update from gettext-runtime.
5792
5793 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5794
5795         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5796         Bug reported by Alfred M. Szmidt.
5797
5798 2003-11-29  Karl Berry  <karl@gnu.org>
5799
5800         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5801
5802 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5803             Bruno Haible  <bruno@clisp.org>
5804
5805         * printf-parse.h: Don't include sys/types.h.
5806         (ARG_NONE): New macro.
5807         (char_directive): Change type of *arg_index fields to size_t.
5808         * printf-parse.c: Don't include sys/types.h.
5809         (SSIZE_MAX): Remove macro.
5810         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5811         Remove unnecessary overflow check.
5812         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5813         fields.
5814
5815 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5816
5817         * alloca.c: Remove dependency on xalloc module.
5818         (xalloc_die): Remove.
5819         (memory_full) [!defined emacs]: New macro.
5820         [!defined emacs]: Don't include xalloc.h.
5821         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5822         address arithmetic overflows.  Change datatypes a bit to avoid
5823         unnecessary casts.
5824
5825 2003-11-22  Jim Meyering  <jim@meyering.net>
5826
5827         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5828
5829 2003-11-17  Bruno Haible  <bruno@clisp.org>
5830
5831         * vasnprintf.c (alloca): Remove fallback definition.
5832         (freea): Remove definition.
5833         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5834         Reported by Paul Eggert.
5835
5836 2003-11-17  Jim Meyering  <jim@meyering.net>
5837
5838         On systems without utime and without a utimes function capable of
5839         dealing with a NULL struct utimbuf* argument, this utime replacement
5840         could -- in unusual circumstances -- leak a file descriptor.
5841         * utime.c: Include <unistd.h> and <errno.h>.
5842         (utime_null): Be sure to close `fd' and to preserve errno.
5843         Reported by Geoff Collyer via Arnold Robbins.
5844
5845 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5846             Bruno Haible  <bruno@clisp.org>
5847
5848         Protect against address arithmetic overflow.
5849         * printf-args.h: Include stddef.h.
5850         (arguments): Change type of field 'count' to size_t.
5851         * printf-args.c (printf_fetchargs): Use size_t instead of
5852         'unsigned int' where appropriate.
5853         * printf-parse.h: Include sys/types.h.
5854         (char_directive): Change type of *arg_index fields to ssize_t.
5855         (char_directives): Change type of fields 'count', max_*_length to
5856         size_t.
5857         * printf-parse.c: Include sys/types.h and xsize.h.
5858         (SSIZE_MAX): Define fallback value.
5859         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5860         instead of 'int' where appropriate. Check a_allocated, d_allocated
5861         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5862         * vasnprintf.c: Include xsize.h.
5863         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5864         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5865         overflow. Avoid wraparound when converting a width or precision from
5866         decimal to binary.
5867
5868 2003-11-16  Bruno Haible  <bruno@clisp.org>
5869
5870         Update from GNU gettext.
5871         * printf-parse.c: Generalize to it can be compiled for wide strings.
5872         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5873         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5874         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5875         SNPRINTF): New macros.
5876         Don't include <alloca.h> if the file is used inside libintl.
5877         (local_wcslen): New function, for Solaris 2.5.1.
5878         (VASNPRINTF): Use it instead of wcslen.
5879
5880 2003-11-16  Bruno Haible  <bruno@clisp.org>
5881
5882         * xsize.h (xmax): New function.
5883         (xsum, xsum3, xsum4): Declare as "pure" functions.
5884
5885 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5886
5887         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5888         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5889         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5890         heuristic is just as accurate as far as we know, and it removes a
5891         dependency on size_max.m4 and ptrdiff_max.m4.
5892
5893 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5894
5895         * xstrtol.c (__xstrtol): Remove "break" immediately after
5896         "return", to pacify some unknown compiler.  Problem reported
5897         by Joerg Schilling.
5898
5899 2003-11-11  Bruno Haible  <bruno@clisp.org>
5900
5901         * xsize.h (SIZE_MAX): Remove fallback definition.
5902         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5903         defined.
5904
5905 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5906
5907         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5908         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5909         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5910         From Bruno Haible.
5911         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5912         not (size_t) -1, since it's defined here.
5913
5914 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5915
5916         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5917         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5918         Reject sizes of exactly SIZE_MAX bytes.
5919         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5920         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5921
5922 2003-11-05  Bruno Haible  <bruno@clisp.org>
5923
5924         * xsize.h: Include limits.h, to avoid a possible collision with
5925         SIZE_MAX defined in <limits.h> on Solaris.
5926
5927 2003-11-04  Bruno Haible  <bruno@clisp.org>
5928
5929         * xsize.h: New file.
5930         * linebreak.c: Include xsize.h.
5931         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5932         argument for overflow.
5933         Suggested by Paul Eggert.
5934
5935 2003-10-31  Bruno Haible  <bruno@clisp.org>
5936
5937         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5938         to avoid (extremely rare) race condition.
5939         Suggested by Paul Eggert.
5940
5941 2003-11-03  Jim Meyering  <jim@meyering.net>
5942
5943         * userspec.c: Include "userspec.h".
5944         * userspec.h: New file.
5945
5946 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5947
5948         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5949         * mountlist.c (SIZE_MAX): Define if not defined already.
5950         (read_filesystem_list): Set and use me_type_malloced.
5951         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5952         whatever the type happens to be), for brevity and consistency.
5953         Check for size calculation overflow on Alphas running OSF/1.
5954
5955 2003-10-31  Jim Meyering  <jim@meyering.net>
5956
5957         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5958
5959         * linebuffer.c: Include <string.h> for declaration of memset.
5960
5961 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5962             Bruno Haible  <bruno@clisp.org>
5963
5964         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5965         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5966
5967 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5968
5969         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5970         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5971         no longer needed.
5972         * quotearg.c (quotearg_n_options): Use it.
5973         * group-member.c: Include <stdbool.h>.
5974         (free_group_info): Arg is now const *; don't free arg.
5975         (get_group_info): Now returns bool and accepts struct group_info *,
5976         rather than returning a malloc'ed struct group_info *.
5977         All uses changed.  Check for overflow in internal size calculation.
5978
5979         * getusershell.c (readname): Simplify the code by using x2nrealloc
5980         rather than xmalloc/xrealloc.
5981         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5982         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
5983         conformance bug: the old code used a pointer after freeing the
5984         storage that it addressed.
5985         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5986         rather than doing it by hand.
5987         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5988         the buffer preserved.  Use free and xmalloc instead.
5989         * quotearg.c (quotearg_n_options): Likewise.
5990         Use a simpler test for size overflow.  Don't use xalloc_oversized
5991         because unsigned int might be wider than size_t (!); this suggests
5992         that we should switch from unsigned int to size_t for slot numbers.
5993
5994 2003-10-27  Bruno Haible  <bruno@clisp.org>
5995
5996         * stdbool_.h: Better support for BeOS.
5997
5998 2003-10-27  Paul Eggert  <eggert@twinsun.com>
5999
6000         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6001         to allocate the returned structure.  Do not allocate a subarray,
6002         as x2nrealloc will do that.
6003         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6004         instead of xnrealloc.
6005         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6006
6007 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6008
6009         * xalloc.h (xalloc_oversized): New static inline function, for
6010         callers that want to do their own size-overflow checking.  Include
6011         <stdbool.h>, since xalloc_oversized returns bool.
6012         * xalloc.c (array_size_overflow): Remove.  All callers changed
6013         to use xalloc_oversized.
6014
6015         Add two functions x2realloc, x2nrealloc, for programs that grow
6016         arrays dynamically by doubling their sizes.
6017         * xalloc.h (x2realloc, x2nrealloc): New decls.
6018         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6019         New functions.
6020
6021         Port to C99 semantics for 'inline' of external functions.
6022         Bug reported by Bruno Haible.
6023         * xmalloc.c (xnmalloc_inline): New static inline function,
6024         with the old contents of xnmalloc.
6025         (xnmalloc, xmalloc): Use it.
6026         (xnrealloc_inline): New static inline function,
6027         with the old contents of xnrealloc.
6028         (xnrealloc, xrealloc): Use it.
6029
6030         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6031
6032 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6033
6034         Fix several address-calculation bugs in the hash modules,
6035         plus some minor code cleanup.
6036
6037         * hash.h: Include <stdbool.h>, for bool.
6038         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6039         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6040         hash_get_n_entries, hash_get_max_bucket_length,
6041         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6042         hash_rehash): Use size_t rather than unsigned.
6043         * hash.c (struct hash_table, hash_get_n_buckets,
6044         hash_get_n_buckets_used, hash_get_n_entries,
6045         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6046         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6047         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6048         Likewise.
6049         (SIZE_MAX): Define if not defined.
6050         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6051         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6052         hash_print):
6053         Use const * when possible.
6054         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6055         (check_tuning): Fix bug: if tuning parameters were very close to
6056         0 or 1, rounding errors could have caused subscript violations.
6057         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6058         (hash_initialize): Add 'fail:' label
6059         to free table and return NULL, and use it to simplify code.
6060         Use calloc rather than clearing the storage ourself.
6061         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6062         buffer size calculations.
6063         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6064         Include <stddef.h>, for size_t.
6065         * hash-pjw.c (hash_pjw): Likewise.
6066         Switch to method described by Bruno Haible.
6067         Include <limits.h>, for CHAR_BIT.
6068         (SIZE_BITS): New macro.
6069
6070 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6071
6072         * getndelim2.c (getndelim2): When size calculation overflows,
6073         ceiling the allocation at NMAX bytes rather than silently
6074         discarding input bytes before NMAX is reached.  This makes
6075         a difference only if NMAX exceeds SIZE_MAX / 2.
6076
6077         * obstack.c: Merge from glibc.
6078         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6079         Add libc_hidden_def (_obstack_newchunk).
6080         (_obstack_free) [! defined _LIBC]: Remove.
6081         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6082         a clone of the function body.
6083         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6084         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6085
6086         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6087         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6088         arg to memcpy.
6089
6090         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6091         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6092         Don't use lvalue casts, as GCC plans to remove support for them
6093         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6094         was also present in the non-GCC version, indicating that this
6095         code had always been buggy and had never been widely used.
6096         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6097         Use the fast variant of each macro, rather than copying the
6098         definiens of the fast variant; that way, we'll be more likely to
6099         catch future bugs in the fast variants.
6100
6101 2003-10-20  Bruno Haible  <bruno@clisp.org>
6102
6103         * wait-process.h: New file, from GNU gettext.
6104         * wait-process.c: New file, from GNU gettext.
6105
6106 2003-10-19  Jim Meyering  <jim@meyering.net>
6107
6108         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6109
6110 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6111
6112         * getgroups.c: Include <errno.h>, <stdlib.h>.
6113         (getgroups): First arg is int, not size_t.
6114         Don't let 'free' mangle errno.
6115
6116 2003-10-16  Jim Meyering  <jim@meyering.net>
6117
6118         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6119
6120 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6121
6122         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6123         (SIZE_MAX): Remove.
6124         (new_exclude, add_exclude_file): Initial size no longer needs to
6125         be a power of 2.
6126         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6127         our own address arithmetic overflow checking.
6128
6129         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6130         (fnmatch): Do not alloca more than 2000 wide characters;
6131         instead, use malloc for large buffers.
6132         Check for address arithmetic overflow, and return -1
6133         with errno set to ENOMEM in that case.
6134         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6135         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6136         instead, return -1.  Check for address arithmetic overflow.
6137
6138 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6139
6140         Handle invalid suffixes and overflow independently, so that
6141         callers can treat them independently as needed.  Fix some bugs in
6142         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6143         suffix for a human-readable blocksize.  The major caller-visible
6144         change is the addition of a new
6145         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6146         that both overflow and suffix chars were found.
6147
6148         * human.c (humblock): Don't check separately for invalid suffix
6149         char; that is xstrtoumax's job (now that its bug is fixed).
6150         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6151         INTMAX_MAX]: New macros.
6152         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6153         TYPE_MAXIMUM): New macros.
6154         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6155         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6156         if overflow occurs, as it's what __strtol does and it's more useful
6157         in practice.
6158         (__xstrtol): If __strtol reports some error other than ERANGE,
6159         reflect it to the caller as LONGINT_INVALID.  If it reports
6160         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6161         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6162         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6163         value.
6164         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6165         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6166         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6167         [defined UINTMAX_MAX]: New macros.
6168
6169 2003-10-14  Bruno Haible  <bruno@clisp.org>
6170
6171         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6172         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6173         Also use volatile where needed.
6174
6175 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6176
6177         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6178         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6179         and define in terms of the other primitives.
6180         * xmalloc.c: Include stdbool.h; do not include exit.h.
6181         (SIZE_MAX): Define if not already defined.
6182         (array_size_overflow): New function.
6183         (xalloc_die): Abort instead of exiting if 'error' returns.
6184         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6185         (xmalloc, xrealloc): Use them.
6186         (xcalloc): Check for address arithmetic overflow.
6187         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6188         a bit faster than strcpy.
6189
6190 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6191
6192         Merge getpass from libc, plus a few fixes.
6193
6194         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6195         Include <stdbool.h>.
6196         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6197         __fsetlocking to empty.
6198         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6199         do include <bits/libc-lock.h>.
6200         Do not include <fcntl.h>; not needed.
6201         [_LIBC]: Include <wchar.h>.
6202         (NOTCANCEL_MODE): New macro.
6203         (flockfile, funlockfile) [_LIBC]: New macros.
6204         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6205         [!_LIBC]: New macros.
6206         (call_fclose): New function.
6207         (getpass): Use it.  Save tty stream separately; this simplifies the
6208         code and makes it more reliable if stdin happens to equal stdout.
6209         Invoke __fsetlocking on tty.
6210         Handle thread cancellation if needed.
6211         Namespace cleanup (use __tcgetattr, __getline).
6212         Use bool for Booleans.
6213         [USE_IN_LIBIO]: Handle wide streams.
6214         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6215         stream might go where.
6216
6217         * unlocked-io.h: Include <stdio.h>, so that the caller
6218         doesn't have to include <stdio.h> before us.
6219         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6220         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6221         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6222         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6223         if not declared, so that we can use getpass.c code from libc without
6224         rewriting it.
6225         (flockfile, ftrylockfile, funlockfile): New macros.
6226
6227 2003-10-06  Bruno Haible  <bruno@clisp.org>
6228
6229         * version-etc-2.h: Remove file.
6230         * version-etc-2.c: Remove file.
6231
6232 2003-09-25  Jim Meyering  <jim@meyering.net>
6233             Bruno Haible  <bruno@clisp.org>
6234
6235         This lets translators provide better translations for the
6236         "Written by ..." part of --version output.
6237         * version-etc.h: Include stdarg.h.
6238         (version_etc_copyright): Declare as readonly.
6239         (version_etc): Make this function variadic with a NULL-terminated list
6240         of author name strings.
6241         (version_etc_va): New declaration.
6242         * version-etc.c: Include stdarg.h, stdlib.h.
6243         (version_etc_copyright): Declare as readonly.
6244         (version_etc_va): New function. Provide a different translatable string
6245         for each possible number of authors < 10. Abbreviate when there are 10
6246         authors or more.
6247         (version_etc): Make this function variadic. Call version_etc_va.
6248         Suggestion from Gary V. Vaughan.
6249
6250         * long-options.h (parse_long_options): Change prototype: the authors
6251         string is moved to the end and becomes variadic.
6252         * long-options.c: Include stdarg.h.
6253         (parse_long_options): Make this function variadic, too.
6254         Call version_etc_va, not version_etc.
6255
6256 2003-10-06  Bruno Haible  <bruno@clisp.org>
6257
6258         * fatal-signal.h: New file, from GNU gettext.
6259         * fatal-signal.c: New file, from GNU gettext.
6260
6261 2003-10-04  Karl Berry  <karl@gnu.org>
6262
6263         * argp*: update from libc.
6264
6265 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6266
6267         * getpass.c (getpass): Use a no-op fseek when switching from input to
6268         output mode on the same stream.
6269
6270 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6271
6272         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6273         Fix arg typo in previous patch.
6274
6275 2003-09-28  Jim Meyering  <jim@meyering.net>
6276
6277         * error.c: Correct cpp indentation.
6278
6279 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6280
6281         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6282         Omit the special code that used __typeof__, since we worry that
6283         it could be more trouble than it's worth.  See:
6284         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6285         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6286
6287         * free.c: New file.
6288
6289 2003-09-26  Jim Meyering  <jim@meyering.net>
6290
6291         * error.c (error_tail): Move some declarations
6292         into inner scope where the local variables are used.
6293
6294 2003-09-26  Bruno Haible  <bruno@clisp.org>
6295
6296         * stpncpy.h (gnu_stpncpy): New declaration.
6297         (stpncpy): Define as alias for gnu_stpncpy.
6298         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6299
6300 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6301
6302         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6303         (error_tail): Do not loop, reallocating temporary buffer, since
6304         the output cannot contain more wide characters than the input
6305         contains bytes, the size must be big enough already.  This avoids
6306         one potential size overflow calculation.  Check for size overflow
6307         when calculating temporary buffer size.  Free temporary buffer
6308         when done, if it was allocated with malloc; this plugs a memory
6309         leak.  Remove casts from void * to pointers, that are no longer
6310         needed now that we're assuming C89 or better.
6311
6312         Merge error changes from glibc.
6313
6314         * error.c, error.h: Update copyright notice header to match glibc.
6315         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6316         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6317         Disable cancellation while printing error.
6318         * error.h: Prepend __ to parameter names.
6319
6320 2003-09-25  Karl Berry  <karl@gnu.org>
6321
6322         * argp-fmtstream.c, argp-help.c: update from libc.
6323
6324 2003-09-25  Bruno Haible  <bruno@clisp.org>
6325
6326         * version-etc-2.h: New file, from version-etc.h with modifications.
6327         * version-etc-2.c: New file, from version-etc.c with modifications.
6328
6329 2003-09-25  Simon Josefsson  <jas@extundo.com>
6330
6331         * xgetdomainname.h: New file.
6332         * xgetdomainname.c: New file.
6333
6334 2003-09-25  Simon Josefsson  <jas@extundo.com>
6335             Bruno Haible  <bruno@clisp.org>
6336
6337         * getdomainname.h: New file.
6338         * getdomainname.c: New file.
6339
6340 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6341
6342         * linebuffer.c (freebuffer): Don't free the argument, just
6343         the buffer associated with the argument.  Bug reported by
6344         Simon Josefsson.
6345
6346 2003-09-19  Karl Berry  <karl@gnu.org>
6347
6348         * argp.h: update from libc.
6349
6350 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6351
6352         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6353         input error, instead of returning NULL the next time we are called
6354         (and therefore losing track of errno).
6355
6356 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6357
6358         * getndelim2.c (getndelim2): Don't trash errno when a read
6359         fails, so that the caller gets the proper errno.
6360
6361         * readutmp.c (read_utmp): Likewise.
6362         Check for fstat error.  Close stream and free storage
6363         when failing.
6364
6365 2003-09-14  Bruno Haible  <bruno@clisp.org>
6366
6367         * fwriteerror.h: New file.
6368         * fwriteerror.c: New file.
6369
6370 2003-09-14  Jim Meyering  <jim@meyering.net>
6371
6372         * getloadavg.c: Correct cpp indentation.
6373         * strdup.c: Likewise.
6374         * vasnprintf.c: Likewise.
6375
6376 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6377
6378         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6379         * obstack.c [!defined _LIBC]: Likewise.
6380         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6381         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6382         * exitfail.c: Don't include stdlib.h; no longer needed.
6383
6384         More changes to assume C89 or better.
6385
6386         * error.c (error_tail): Assume vprintf.
6387
6388         * argmatch.c (getenv): Remove decl.
6389         * progreloc.c (get_full_program_name): Define via prototype.
6390         * setenv.c (clearenv): Likewise.
6391         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6392         needed.
6393         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6394         (malloc, memcpy): Remove decls.
6395         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6396         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6397         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6398         (memcpy): Remove macro.
6399         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6400         (__P): Remove.  All uses removed.
6401         (PTR): Remove.  All uses changed to void *.
6402         (CHAR_BIT, NULL): Remove.
6403         (spaces, zeros, memset_space, memset_zero)
6404         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6405         Remove.
6406         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6407         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6408         Define with prototype.
6409         Remove now-unnecessary prototype decl.
6410         (extra_args_spec): Assume ANSI C.  All uses changed.
6411         (extra_args_spec_iso): Remove.
6412         (my_strftime, emacs_strftimeu): Define via prototype.
6413         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6414         unconditionally.
6415         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6416         * strtoimax.c: Include <stdlib.h> unconditionally.
6417         (strtoul, strtol): Remove decls.
6418         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6419         LONG_MAX): Remove.
6420         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6421         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6422         (LOCALE_PARAM_PROTO): New macro.
6423         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6424         (INTERNAL (strtol), strtol): Define with a prototype.
6425         (PARAMS): Remove.  All uses removed.
6426         * tempname.c: Include <string.h> unconditionally.
6427         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6428         * xgethostname.c (main): Define with a prototype.
6429         * xmalloc.c: Include "xalloc.h" first, to check interface.
6430         Include <stdlib.h> unconditionally.
6431         (calloc, malloc, realloc, free): Remove decls.
6432         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6433         Include <stdlib.h> unconditionally.  Sort include file names.
6434         (strtod): Remove.
6435         (xstrtod): Define with a prototype.
6436         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6437         (strtol, strtoul): Remove decls.
6438
6439 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6440
6441         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6442         Include <stdlib.h>, <string.h> unconditionally.
6443         Remove now-unnecessary cast to char *.
6444         * strnlen.c: Include <string.h> unconditionally.
6445         * yesno.c (yesno): Define with a prototype.
6446
6447 2003-09-10  Bruno Haible  <bruno@clisp.org>
6448
6449         * strcspn.c: Include <string.h> unconditionally.
6450         * strpbrk.c: Include <string.h> unconditionally.
6451         * strstr.c: Include <string.h> unconditionally.
6452         * unicodeio.c: Include <string.h> unconditionally.
6453         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6454         * unsetenv.c: Likewise.
6455         * xreadlink.c: Include <stdlib.h> unconditionally.
6456         * yesno.c: Include <stdlib.h> unconditionally.
6457         (rpmatch): Add prototype.
6458
6459 2003-09-10  Jim Meyering  <jim@meyering.net>
6460
6461         * error.c: Correct indentation of cpp directives.
6462
6463 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6464
6465         More K&R removal.
6466
6467         * acosl.c (main): Use a prototype.
6468         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6469         tanl.c: Likewise.
6470
6471         * getloadavg.c (getloadavg, main): Define via prototypes.
6472
6473         * getopt.h (struct option.name): Assume C89, and use 'const'.
6474         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6475         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6476         with a prototype.
6477         * getopt.c (const): Remove macro.
6478         Include <string.h> unconditionally.
6479         (my_index): Remove; all uses changed to strchr.
6480         (strlen): Remove decl.
6481         (exchange): Remove forward decl; no longer needed.
6482         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6483         Define with prototype.
6484         * getopt1.c (const): Remove macro.
6485         (getopt_long, getopt_long_only, main): Define with prototype.
6486
6487         * getugroups.c: Include <string.h> unconditionally.
6488
6489         * getusershell.c: Include <stdlib.h> unconditionally.
6490         (getusershell, setusershell, endusershell, readname, main):
6491         Define with prototypes.
6492
6493         * group-member.c: Include group-member.h first.
6494         Include <stdlib.h> unconditionally.
6495
6496         * hard-locale.c: Include hard-locale.h first.
6497         Include <stdlib.h>, <string.h> unconditionally.
6498
6499         * hash.c (free, malloc): Remove decls.
6500         Include <stdlib.h> unconditionally.
6501
6502         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6503         (getenv): Do not declare.
6504
6505         * idcache.c: Include <string.h> unconditionally.
6506
6507         * long-options.c: Include long-options.h first, to test interface.
6508         Include <stdlib.h> unconditionally.
6509
6510         * makepath.c: Include makepath.h first, to test interface.
6511         Include <stdlib.h> and <string.h> unconditionally.
6512
6513         * linebuffer.c: Include <stdlib.h>.
6514         (free): Remove decl.
6515
6516         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6517         rpl_malloc returns void *, not char *.
6518         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6519
6520         * md5.h: Include <limits.h> unconditionally.
6521         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6522         (__P): Remove; all uses removed.
6523         * md5.c: Include "md5.h" first.
6524         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6525         md5_buffer, md5_process_bytes, md5_process_block):
6526         Define with prototypes.
6527         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6528         * sha.c: Include "sha.h" first.
6529         Include <stdlib.h>, <string.h> unconditionally.
6530
6531         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6532         * memcmp.c (__ptr_t): Likewise.
6533         * memrchr.c (__ptr_t): Likewise.
6534         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6535         Include <string.h> unconditionally.
6536         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6537         * memchr.c: Include <stdlib.h> unconditionally.
6538         * memchr.c (LONG_MAX): Remove.
6539         * memrchr.c (LONG_MAX): Likewise.
6540         * memchr.c (__memchr): Define via a prototype.
6541         * memrchr.c (__memrchr): Likewise.
6542         * memcmp.c (__P): Remove, and remove all uses.
6543         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6544         Remove forward decls; no longer needed.
6545         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6546         Use types required by C89 in prototype.
6547
6548         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6549         * savedir.c: Likewise.
6550         * mkdir.c (free): Remove decl.
6551         * rmdir.c (rmdir): Define with a prototype.
6552         * savedir.c: Include savedir.h first, to test interface.
6553
6554         * mktime.c (STDC_HEADERS): Remove.
6555         Include <stdlib.h>, <string.h> unconditionally.
6556
6557         * modechange.c: Include <stdlib.h> unconditionally.
6558         (malloc): Remove decl.
6559
6560         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6561         (free): Remove decl.
6562
6563         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6564         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6565         (This type really should be intptr_t, but that's a C99ism.)
6566         (_obstack_memcpy): Remove: all uses changed to memcpy.
6567         Include <string.h> unconditionally.
6568         (struct obstack): Assume __STDC__ for types of members
6569         chunkfun, freefun, extra_arg.
6570         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6571         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6572         obstack_begin, obstack_specify_allocation,
6573         obstack_specify_allocation_with_arg, obstack_chunkfun,
6574         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6575         Remove unprototyped decls and the macros that use them.
6576         * obstack.c (POINTER): Remove.  All uses changed to void *.
6577         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6578         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6579         (defined __STDC__ && __STDC__)]:
6580         Remove nonprototyped code.
6581         Include <stdlib.h> unconditionally.
6582         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6583         _obstack_allocated_p, _obstack_free, obstack_free,
6584         _obstack_memory_used, print_and_abort):
6585         Define using prototypes.
6586         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6587         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6588         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6589         obstack_next_free, obstack_object_size, obstack_room) [0]:
6590         Remove unused, unprototyped code.
6591
6592         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6593
6594         * physmem.c (physmem_total, physmem_available, main): Define
6595         with prototypes.
6596
6597         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6598         (main): Define with a prototype.
6599
6600         * posixver.c (getenv): Remove decl.
6601
6602         * putenv.c (malloc): Returns void *, not char *.
6603         Include <string.h> unconditionally.
6604         (strchr, memcpy, NULL): Do not define.
6605
6606         * readtokens.c: Include readtokens.h first, to test interface.
6607         Include <stdlib.h>, <string.h> unconditionally.
6608         (init_tokenbuffer): Define with a prototype.
6609
6610         * regex.c (PARAMS): Remove.  All uses removed.
6611         All uses of _RE_ARGS removed, too.
6612         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6613         unconditionally.
6614         (bzero): Assume memset exists.
6615         (memcmp, memcpy, NULL): Remove.
6616         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6617         char, or assignments to local vars of type signed char.
6618         (init_syntax_once, PREFIX(extract_number_and_incr),
6619         PREFIX(print_partial_compiled_pattern),
6620         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6621         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6622         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6623         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6624         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6625         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6626         wcs_compile_range, byte_compile_range, truncate_wchar,
6627         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6628         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6629         count_mbs_length, wcs_re_match_2_internal,
6630         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6631         PREFIX(alt_match_null_string_p),
6632         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6633         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6634         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6635         now-unnecessary declaration, if any.
6636         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6637         regcomp, regexec):
6638         Remove now-unnecessary casts among pointer types.
6639         * regex.h (_RE_ARGS): Remove.  All uses removed.
6640
6641         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6642         (free): Remove decl.
6643
6644         * rpmatch.c: Include <stdlib.h> unconditionally.
6645
6646         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6647         (free): Remove decl.
6648
6649         * save-cwd.c: Include <stdlib.h> unconditionally.
6650         * xgetcwd.c: Likewise.
6651
6652         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6653         (free): Remove decl.
6654
6655         * strchrnul.c (strchrnul): Define with a prototype.
6656         Fix bug: c_in was not converted to char before searching.
6657
6658         The following changes are not K&R related:
6659
6660         * group-member.h: Include <sys/types.h>, so that this file is
6661         self-contained.
6662         * makepath.h: Likewise.
6663
6664         * getusershell.c (readname, default_index, line_size, readname):
6665         Use size_t, not int, for sizes.
6666         (readname): If the size overflows, report an error instead of
6667         looping forever.
6668
6669 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6670
6671         * getndelim2.c: Assume stdlib.h per the C89 spec.
6672
6673 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6674
6675         Assume C89 or better; remove K&R cruft.
6676         A few of these changes were first proposed by Derek Robert Price
6677         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6678
6679         * addext.c: Include <string.h> unconditionally.
6680         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6681         Don't declare getenv or malloc.
6682
6683         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6684         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6685         (NULL): Remove.
6686         (find_stack_direction, alloca): Use prototypes.
6687
6688         * atexit.c (atexit): Define using a prototype.
6689
6690         * basename.c, dirname.c, stripslash.c:
6691         Include <string.h> unconditionally.
6692
6693         * bcopy.c: Include <stddef.h>.
6694         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6695
6696         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6697
6698         * error.h (error, error_at_line, error_print_progname)
6699         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6700         * error.c: Include error.h first, to check interface.
6701         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6702         (VA_START): Remove; all uses changeed to va_start.
6703         (exit, strerror): Remove decls.
6704         (error_print_progname): Prototype uncondionally.
6705         Don't include <errno.h>; no longer needed.
6706         (private_strerror): Remove.
6707         (error_tail): Always define.
6708         (error, error_at_line): Assume C89 or better; always use prototypes.
6709         * fatal.c: Include "fatal.h" first, to test interface.
6710         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6711         (VA_START): Remove; all uses changed to va_start.
6712         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6713         this case.
6714         (exit): Remove decl.
6715         (fatal): Prototype unconditionally.  Assume va_start works.
6716         Abort at end, to pacify gcc.
6717
6718         * euidaccess.c (main): Define with a prototype.
6719
6720         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6721
6722         * exitfail.c: Include <stdlib.h> unconditionally.
6723
6724         * fnmatch_.h (__P): Remove.  All uses changed to assume
6725         prototypes.
6726         * fnmatch.c: Include fnmatch.h first, to test interface.
6727         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6728         (getenv): Remove decl.
6729         (fnmatch): Define using a prototype.
6730         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6731         (FCT): Define using a prototype.
6732
6733         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6734
6735         * gethostname.c: Include <stddef.h>.
6736         (gethostname): Define with prototype.  Length is size_t, not int.
6737
6738 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6739
6740         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6741         getversion.c should have been removed then, but was accidentally
6742         preserved.
6743
6744         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6745         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6746
6747 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6748
6749         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6750         copy_tm_result.  Bug reported by Simon Josefsson in
6751         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6752
6753 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6754
6755         * time_r.c, time_r.h: New files.
6756
6757         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6758         __localtime_r.
6759         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6760         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6761
6762         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6763         __gmtime_r.
6764         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6765         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6766         Include <time_r.h>.
6767
6768         * timegm.c: Switch to glibc implementation, with the following changes:
6769         [defined HAVE_CONFIG_H]: Include <config.h>.
6770         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6771         (__mktime_internal) [!defined _LIBC]: New decl.
6772         (__gmtime_r) [!defined _LIBC]: New macro and function.
6773         (timegm): Use a prototype, since gnulib assumes C89.
6774         Do not bother declaring tmp to be const, as it's not really usefu.
6775         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6776         (timegm): Declare only if HAVE_DECL_TIMEGM.
6777
6778 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6779
6780         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6781         Bug reported by Lute Kamstra in
6782         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6783
6784         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6785         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6786         course with correspondingly smaller numbers for tomorrow and
6787         yesterday.  From Tadayoshi Funaba.  Originally installed into
6788         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6789         coreutils merge?).
6790
6791 2003-08-31  Simon Josefsson  <jas@extundo.com>
6792
6793         * timegm.h: New file.
6794         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6795
6796 2003-08-31  Karl Berry  <karl@gnu.org>
6797
6798         * argp.h: update from libc.
6799
6800 2003-08-28  Bruno Haible  <bruno@clisp.org>
6801
6802         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6803         warning on QNX, which defines O_BINARY to 000000.
6804
6805 2003-08-24  Bruno Haible  <bruno@clisp.org>
6806
6807         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6808         MSVC7 <stdio.h> is included later.
6809
6810 2003-08-20  Bruno Haible  <bruno@clisp.org>
6811
6812         * progname.h: New file, from GNU gettext.
6813         * progname.c: New file, from GNU gettext.
6814         * progreloc.c: New file, from GNU gettext.
6815
6816 2003-08-19  Bruno Haible  <bruno@clisp.org>
6817
6818         * xstrdup.c: Assume <string.h> exists.
6819
6820 2003-08-18  Jim Meyering  <jim@meyering.net>
6821
6822         * setenv.h: Indent nested cpp directive.
6823         * vasnprintf.c: Remove trailing blanks.
6824
6825 2003-08-17  Simon Josefsson  <jas@extundo.com>
6826             Bruno Haible  <bruno@clisp.org>
6827
6828         * xstrndup.h: New file.
6829         * xstrndup.c: New file.
6830
6831 2003-08-17  Bruno Haible  <bruno@clisp.org>
6832
6833         * strndup.h: New file.
6834
6835 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6836
6837         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6838         space, undoing this 2003-08-12 change:
6839         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6840
6841 2003-08-16  Jim Meyering  <jim@meyering.net>
6842
6843         Merge from coreutils.
6844         * xstrtoimax.c: #else #if -> #elif.
6845         * xstrtoumax.c: Likewise.
6846
6847 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6848
6849         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6850         rather than tab, after '#' in shell-script copyright notices.
6851         Suggested by Bruno Haible.
6852
6853 2003-08-15  Jim Meyering  <jim@meyering.net>
6854         and Paul Eggert  <eggert@twinsun.com>
6855
6856         Merge from coreutils.
6857         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6858         member but strut utmpx does not.  Needed for AIX 4.3.3.
6859         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6860
6861 2003-08-15  Jim Meyering  <jim@meyering.net>
6862
6863         Merge from coreutils.
6864         * xgethostname.c: Include <stdlib.h>.
6865         (xghostname): Don't exit for anything other than memory-related
6866         failure; just return NULL.
6867         * userspec.c: Include "posixver.h".
6868         (parse_user_spec): Accept `.' as a separator only
6869         in pre-POSIX-200112 mode.
6870         * strtoimax.c: Use #elif rather than #else #if.
6871         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6872         Remove function, now that we can rely on a working tzset function.
6873         [!_LIBC]: Ensure that the required autoconf test has been run.
6874         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6875         Use underlying_strftime for %r.
6876         * sha.c: Merge in some clean-up and optimization changes from glibc.
6877         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6878         Ensure that it is a multiple of 64.
6879         Rearrange loop exit tests so as to avoid performing an
6880         additional fread after encountering an error or EOF.
6881         * realloc.c: Update copyright date.
6882
6883 2003-08-14  Jim Meyering  <jim@meyering.net>
6884
6885         Merge from coreutils.
6886         * obstack.h: Whitespace changes.
6887         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6888         and xcalloc return values.
6889         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6890         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6891         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6892         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6893         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6894         error from mntctl.
6895         Use mntctl's return value to drive the entry-processing loop, since
6896         we can't rely on the value of the vmt_length member in the last
6897         entry.  On some systems doing so could result in exhausting
6898         virtual memory.  Based in part on a patch from Mike Jetzer.
6899
6900 2003-08-14  Jim Meyering  <jim@meyering.net>
6901         and Paul Eggert  <eggert@twinsun.com>
6902
6903         Merges from coreutils, plus other fixes.
6904         * physmem.c: Merge in portability changes from gcc/libiberty
6905         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6906         for credits and details.  Thanks to Kaveh Ghazi for helping
6907         to keep these files in sync.
6908         (ARRAY_SIZE): Define it.
6909         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6910         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6911         (memcasecmp): Don't assume size_t fits in unsigned int.
6912         Remove casts and duplicate code.
6913         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6914         (memcpy): Remove definition.
6915         Merge in some clean-up and optimization changes from glibc.
6916         [BLOCKSIZE]: Move definition to top of file.
6917         Ensure that it is a multiple of 64.
6918         Rearrange loop exit tests so as to avoid performing an
6919         additional fread after encountering an error or EOF.
6920         * md5.h (md5_uintptr): Define.
6921         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6922         return to the initial working directory.  Preserve errno
6923         for caller.
6924         * idcache.c: Include "xalloc.h".
6925         (xmalloc, xrealloc): Remove decls.
6926         (getuser): Remove casts no longer required in C89.
6927         * human.c: Include stdio.h, for sprintf.
6928         * group-member.c: Include "xalloc.h".
6929         (xmalloc, xrealloc): Remove decls.
6930         (get_group_info): Remove casts no longer required in C89.
6931         * getusershell.c (readname): Remove casts no longer required in C89.
6932         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6933         * getline.c: Whitespace fix, from coreutils.
6934
6935 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6936
6937         * exclude.c: Include <ctype.h>
6938         (IN_CTYPE_DOMAIN): New macro.
6939         (is_space): New fn.
6940         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6941         and empty lines.
6942
6943         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6944         Undo previous (whitespace-only) change.
6945
6946 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6947
6948         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6949         Normalize leading white space and remove trailing white space.
6950         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6951         notice, as per ../config/srclist-update.
6952
6953         Merge from coreutils.
6954         * euidaccess.h: New file.
6955         * euidaccess.c: Include it.
6956         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6957         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6958         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6959
6960 2003-08-11  Bruno Haible  <bruno@clisp.org>
6961
6962         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6963         (vasnprintf): Use it instead of wcslen.
6964
6965 2003-08-11  Bruno Haible  <bruno@clisp.org>
6966
6967         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6968         value to ensure that _Bool promotes to int. Use #define for _Bool when
6969         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6970
6971 2003-08-10  Karl Berry  <karl@gnu.org>
6972
6973         * regex.h: update from libc (whitespace fix).
6974
6975 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6976
6977         Merge some files from coreutils.  These changes were
6978         originally made by Jim Meyering.
6979         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6980         many older Unixes require this.
6981         * alloca.c (alloca): Remove cast to argument of free;
6982         no longer needed in C89.
6983         * alloca_.h, regex.h: Fix white space to match
6984         what GNU indent does.
6985
6986 2003-08-05  Paul Eggert  <eggert@twinsun.com>
6987
6988         * bumpalloc.h: Remove.
6989
6990 2003-08-04  Paul Eggert  <eggert@twinsun.com>
6991
6992         * getloadavg.c: Change copyright notice and spacing to conform to
6993         GNU coding style.
6994
6995         Merge from coreutils.
6996         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6997         From glibc.
6998         * getdate.y (date): Also accept dates like May-23-2003; suggestion
6999         from Karl Berry, implemented by Jim Meyering.
7000         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7001         from Dmitry V. Levin.
7002         Remove anachronistic cast of xrealloc.
7003         * fnmatch_.h (__const): Remove.  Use 'const'.
7004         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7005         type. Otherwise, it wouldn't compile with at least /bin/cc on
7006         ymp-cray-unicos9.0.2.X.
7007         Combine two mostly-identical uses of alloca into one.
7008         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7009
7010 2003-08-04  Dave Love <d.love@dl.ac.uk>
7011
7012         [From Emacs.]
7013
7014         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7015         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7016         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7017         obsolete NLIST_NAME_UNION.
7018         [__GNU__]: Undef BSD and FSCALE.
7019         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7020
7021 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7022
7023         * stdbool_.h (_Bool): Make it signed char, instead of
7024         an enum type, so that it's guaranteed to promote to int.  See:
7025         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7026
7027 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7028
7029         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7030         (strerror): Don't assume that a printable int fits in 14 bytes.
7031
7032 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7033             Bruno Haible  <bruno@clisp.org>
7034
7035         * getline.h (getline, getdelim): Change return type to ssize_t.
7036         * getline.c (getline, getdelim): Likewise.
7037         Remove _GNU_SOURCE define; now it's defined in config.h through
7038         m4/getline.m4.
7039
7040 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7041
7042         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7043         over-parenthesization in macros.
7044
7045         Sync with coreutils.
7046
7047         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7048         required by C99.
7049
7050         Use `exit_failure' for xalloc and xmemcoll instead of their own
7051         private exit-failure variables.
7052         * xalloc.h (xalloc_exit_failure): Remove.
7053         * xmalloc.c: Likewise.  Include exitfail.h.
7054         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7055         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7056         * xmemcoll.c: Likewise.  Include exitfail.h.
7057         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7058
7059 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7060
7061         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7062         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7063         to test that it can stand by itself.  Include "exitfail.h".
7064         Clients should set exit_failure instead.
7065         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7066
7067 2003-07-18  Andreas Schwab  <schwab@suse.de>
7068
7069         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7070
7071 2003-07-18  Bruno Haible  <bruno@clisp.org>
7072
7073         * getndelim2.h: New file.
7074         * getndelim2.c: Make into a module of its own. Include config.h,
7075         getndelim2.h.
7076         (getndelim2): Make non-static. Change return type to ssize_t.
7077         * getline.h: Change argument names.
7078         * getline.c: Include getndelim2.h instead of getndelim2.c.
7079         * getnline.c: Include getndelim2.h.
7080
7081 2003-07-17  Bruno Haible  <bruno@clisp.org>
7082
7083         * Makefile.am: Remove file.
7084         * Makefile.in: Remove file.
7085
7086 2003-07-17  Bruno Haible  <bruno@clisp.org>
7087
7088         * getnline.h: New file.
7089         * getnline.c: New file.
7090         * getndelim2.c: New file, extracted from getline.c.
7091         (getndelim2): Renamed from getdelim2, with added nmax argument.
7092         * getline.c: Include getndelim2.c.
7093         (getdelim2): Moved out to getndelim2.c.
7094         (getline, getdelim): Update.
7095
7096 2003-07-15    <karl@gnu.org>
7097
7098         * vasnprintf.c: update from gettext.
7099
7100 2003-07-15  Jim Meyering  <jim@meyering.net>
7101
7102         * makepath.c (make_path): Enclose diagnostic in _(...).
7103
7104 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7105
7106         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7107         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7108         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7109         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7110         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7111         updated automatically by ../config/srclist-update.  This changes
7112         their license from LPGL to GPL.
7113
7114 2003-07-14  Jim Meyering  <jim@meyering.net>
7115
7116         Don't emit diagnostics.  Let callers do that.
7117         * save-cwd.c: Don't include "error.h".
7118         (save_cwd): Don't call error.  Ensure that errno is valid
7119         when returning nonzero.
7120
7121         * save-cwd.h (restore_cwd): Update prototype.
7122         * save-cwd.c (restore_cwd): Remove two parameters.
7123         Simplify.  Don't call error upon failure.  Let callers do that.
7124         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7125         when auditing is enabled.  But don't bother updating the #if.
7126
7127 2003-07-14  Simon Josefsson  <jas@extundo.com>
7128
7129         * mempcpy.h: New file.
7130         * mempcpy.c: New file.
7131
7132 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7133
7134         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7135         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7136         unicodeio.c, unicodeio.h, unlocked-io.h:
7137         Switch from LGPL to GPL.
7138
7139 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7140
7141         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7142         it breaks C++ compilation.
7143         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7144
7145 2003-07-10  Jim Meyering  <jim@meyering.net>
7146
7147         * vasnprintf.c: Remove trailing blanks.
7148         Make cpp indentation consistent.
7149
7150 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7151
7152         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7153         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7154         Switch from LGPL to GPL.
7155
7156 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7157
7158         * mktime.c: Fix some boundary cases and remove need for floating point.
7159
7160         Issue a compile-time diagnostic if time_t is floating point, or if
7161         two's complement arithmetic is not in effect, or if arithmetic
7162         right shift does not propagate the sign.  These assumptions were
7163         all in the original code but they weren't checked.
7164
7165         (TIME_T_MIDPOINT, verify): New macros.
7166         (__isleap): Remove; it has integer overflow problems.
7167         (leapyear): New function, without those problems.
7168         (ydhms_tm_diff): Remove; splitting into two parts.
7169         (ydhms_diff): New function, containing the arithmetic part of
7170         the old ydhms_tm_diff function.  Issue a compile-time
7171         diagnostic if we are not using C99 integer division.
7172         Avoid casts when possible.
7173         (guess_time_tm): New function, containing the checking part of
7174         the old ydhms_tm_diff function.  Return the new value, rather than
7175         the difference between it and the old.  Accept a new argument T
7176         so that *T specifies the old value.  Check for overflow in the result.
7177
7178         (__mktime_internal): Use a time_t offset, not a long int offset.
7179         This undoes the 2003-06-04 change, which is no longer needed now
7180         that we have better overflow checking.
7181         (localtime_offset): Likewise.
7182
7183         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7184         and long are 64-bit but int is only 32-bit.
7185         (ydhms_diff): Use long int to store year1 and yday1.
7186         Issue a compile-time diagnostic if long int is not wide enough.
7187
7188         (__mktime_internal): Use long int to store adjusted year and yday.
7189         Use plain C rather than preprocessor commands, if that doesn't
7190         affect efficiency.
7191         Check for overflow (and try to repair) after each probe
7192         rather than checking only at the very end.  This avoids some bugs
7193         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7194         does not equal GMT offset at maximum time).
7195         Use integer to check for overflow rather than floating point; this
7196         is more portable to non-IEEE hosts, and is a tad faster.
7197         When we detect that we are oscillating between two values,
7198         don't check whether tm_isdst has the requested value, since
7199         we already know the answer.  When tm_isdst has the wrong value,
7200         use a different heuristic to find the right one, based on the
7201         extreme values actually observed in practice in tz2003a,
7202         rather than the (overly optimistic) "previous 3 calendar quarters".
7203
7204         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7205         "T const" to accommodate glibc style.
7206         (check_result): Use less-confusing report format.  "long" -> "long int.
7207         (main): Likewise.
7208         Don't loop if the iteration overflows time_t.
7209         Allow a negative step in the iteration.
7210
7211 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7212
7213         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7214         having it depend on HAVE_SYS_TYPES_H.
7215
7216 2003-06-25  Bruno Haible  <bruno@clisp.org>
7217
7218         * readlink.c: New file.
7219
7220 2003-06-20  Bruno Haible  <bruno@clisp.org>
7221
7222         Assume C89, so PARAMS isn't needed.
7223         * unicodeio.h (PARAMS): Remove.
7224         * unicodeio.c: Don't use PARAMS.
7225
7226 2003-06-18  Jim Meyering  <jim@meyering.net>
7227
7228         Merge changes from coreutils.
7229         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7230         Remove explicit declarations of xmalloc and realloc.
7231         Include xalloc.h.
7232         (read_utmp): Remove anachronistic cast of xmalloc.
7233
7234 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7235
7236         Assume C89, so PARAMS isn't needed.
7237         * backupfile.h (PARAMS): Remove.  All uses removed.
7238         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7239         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7240         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7241         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7242         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7243         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7244         xstrtol.h: Likewise.
7245         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7246         same.h, strverscmp.h: Do not include config.h; no longer needed.
7247         Anyway, config.h should always be included before any other file.
7248
7249 2003-06-11  Simon Josefsson  <jas@extundo.com>
7250
7251         * sysexit_.h: New file.
7252
7253 2003-05-20  Derek Price  <derek@ximbiot.com>
7254
7255         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7256
7257 2003-06-10  Simon Josefsson  <jas@extundo.com>
7258
7259         * strchrnul.h: New file.
7260         * strchrnul.c: New file.
7261
7262 2003-06-10  Simon Josefsson <jas@extundo.com>
7263
7264         * argp.h: New file, from glibc.
7265         * argp-ba.c: New file, from glibc.
7266         * argp-eexst.c: New file, from glibc.
7267         * argp-fmtstream.c: New file, from glibc.
7268         * argp-fmtstream.h: New file, from glibc.
7269         * argp-fs-xinl.c: New file, from glibc.
7270         * argp-help.c: New file, from glibc.
7271         * argp-namefrob.h: New file, from glibc.
7272         * argp-parse.c: New file, from glibc.
7273         * argp-pv.c: New file, from glibc.
7274         * argp-pvh.c: New file, from glibc.
7275         * argp-xinl.c: New file, from glibc.
7276
7277 2003-06-07  Jim Meyering  <jim@meyering.net>
7278
7279         * readtokens.h: Put `Free Software Foundation, Inc.'
7280         in place of my name in the copyright comment.
7281         Remove definition and uses of __P.
7282
7283         From coreutils.
7284         * stat.c: Don't declare xmalloc explicitly.
7285         Instead, include "xalloc.h".
7286         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7287         xrealloc, and xcalloc return values.
7288         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7289         Improve comment.
7290         * xgetcwd.h: Remove definition/uses of PARAMS.
7291
7292 2003-06-06  Jim Meyering  <jim@meyering.net>
7293
7294         * stdbool_.h: Renamed from stdbool.h.in.
7295
7296 2003-06-06  Jim Meyering  <jim@meyering.net>
7297
7298         Merge from coreutils.
7299         * same.c: (same_name): Declare *_basename locals to be `const'.
7300         Consolidate declarations and initializations of *_base* locals.
7301
7302         Merge from coreutils.
7303         This avoids a core dump on systems without GNU putenv,
7304         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7305         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7306         (unsetenv): New static function, from GNU libc.
7307         (rpl_putenv): Use it.
7308
7309         * modechange.c: Remove trailing blanks.
7310
7311         Merge from coreutils.
7312         * fsusage.c: Remove declaration of statfs.
7313         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7314
7315         * posixtm.c: Include <stdbool.h> unconditionally.
7316
7317 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7318
7319         * mktime.c (__mktime_internal): When resolving a tm_isdst
7320         mismatch, look in future quarters as well as past.  This fixes a
7321         bug when processing fall-backwards gaps immediately after a long
7322         period of daylight-saving time.
7323
7324         * mktime.c: Assume freestanding C89 or better.
7325         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7326         (__P): Remove; not used.
7327         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7328         (mktime, not_equal_tm, print_tm, check_result,
7329         main): Use prototypes.  Use const * where appropriate.
7330         (main): Fix typo in testing code that uncovered by above changes.
7331         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7332
7333 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7334
7335         * mktime.c: Fix Debian bug 177940
7336         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7337         (localtime_offset): Now long int, not time_t, because we want it
7338         to be guaranteed to be signed.  All uses changed.
7339         (__mktime_internal): If overflow would occur when adding offset,
7340         don't add it.
7341
7342         Merge 'human' changes from coreutils.  Rewrite to support
7343         locale-specific notations like thousands separators.
7344         * human.c: Simplify authorship notice.
7345         Include human.h immediately after config.h.
7346         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7347         <limits.h>: Do not include, since human.h does.
7348         (SIZE_MAX, UINTMAX_MAX): New macros.
7349         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7350         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7351         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7352         (power_letter): Renamed from suffixes.
7353         (generate_suffix_backwards): Remove.
7354         (adjust_value): Now takes int style (because of human.h changes)
7355         and long double value (for greater precision on some platforms).
7356         (group_number): New function.
7357         (human_readable): Use it.  Use integer options, not enum.
7358         Put the options before the sizes in the arg list.
7359         Support all the new options.
7360         The old human_readable function has been removed;
7361         use inttostr.h instead.
7362         (human_readable, default_block_size, humblock):
7363         Use uintmax_t, not int, for block sizes.
7364         (human_readable_inexact, block_size_types): Remove.
7365         (block_size_opts): New constant.
7366         (human_options): Renamed from human_block_size, with new signature
7367         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7368         * human.h: Add copyright and authorship notice.
7369         Include <limits.h> and <stdbool.h> unconditionally.
7370         (PARAMS): Remove.  All uses removed.
7371         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7372         (enum human_inexact_style): Remove tag; now a nameless enum.
7373         (human_floor, human_ceiling, human_round_to_even): Now have
7374         values 2, 0, 1 rather than -1, 1, 0.
7375         (human_group_digits, human_suppress_point_zero, human_autoscale,
7376         human_base_1024, human_SI, human_B): New constants.
7377         (human_readable_inexact, human_block_size): Remove.
7378         (human_readable): Size args are now uintmax_t, not int.
7379         (human_options): New decl.
7380
7381         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7382         unnecessary now that we assume C89 or better.  This change
7383         imported from coreutils.
7384
7385         * mktime.c (__mktime_internal): Do not reject negative timestamps
7386         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7387         in the 2003-05-30 sync from glibc.
7388
7389         .h files should stand alone, but we shouldn't include <sys/types.h>
7390         if we can get away with just <stddef.h>.
7391
7392         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7393         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7394         rather than <sys/types.h>, as we merely need size_t.
7395         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7396         to get size_t.
7397         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7398         Include <stdio.h>, to get FILE.
7399         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7400         memcasecmp.h has included <stddef.h> and all we need is size_t.
7401         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7402         our interface, instead of including <sys/types.h>
7403
7404 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7405
7406         [from coreutils]
7407         Fix some minor time-related bugs with POSIX time arguments.
7408         Some valid time stamps were being rejected (notably -1, and
7409         time stamps before 1900 on 64-bit hosts).  And some invalid
7410         time stamps were being accepted, e.g. September 31.
7411
7412         * posixtm.h (posixtime): Return bool instead of time_t, so
7413         that we can return (time_t) -1 successfully.
7414         * posixtm.c: Likewise.
7415         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7416         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7417         (t): Remove static var.
7418         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7419         of static var.  All uses changed.
7420         (year): Do not reject years before 1900; they can occur with
7421         64-bit time_t.
7422         (posix_time_parse): Do not check for out-of-range components;
7423         that is now the caller's responsibility, since our checks were
7424         only approximations.
7425         (posixtime): Use mktime to check for out-of-range components,
7426         since it knows them exactly.
7427         If mktime returns (time_t) -1, check whether an error actually occurred
7428         by invoking localtime on -1.
7429         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7430         posixtime failures better.
7431         Improve the test data (in comments only).
7432
7433 2003-05-30    <karl@gnu.org>
7434
7435         * mktime.c: update from libc.
7436
7437 2003-05-30  Bruno Haible  <bruno@clisp.org>
7438
7439         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7440         * localcharset.h: Likewise.
7441         * localcharset.c: Likewise.
7442
7443 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7444
7445         Assume the headers required for C89 freestanding compilers.
7446         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7447         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7448         without checking for HAVE_LIMITS_H.
7449         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7450         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7451         to do that.
7452         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7453         * exclude.c: Include <stdbool.h> unconditionally.
7454         * tempname.c: Include <stddef.h> unconditionally.
7455         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7456         * modechange.c, rpmatch.c (NULL): Don't define, since
7457         <stddef.h> does that.
7458         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7459         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7460         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7461         * xstrtol.c: Likewise.
7462         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7463         * savedir.c: Include <stddef.h> instead of defining NULL.
7464
7465         * addext.c (addext): Use assignment rather than cast, to avoid
7466         warnings on some platforms.
7467
7468         * mktime.c (__mktime_internal): Do not reject negative timestamps
7469         arbitrarily.
7470
7471 2003-05-10  Bruno Haible  <bruno@clisp.org>
7472
7473         * linebreak.c (iconv_string_length): Don't return -1 just because the
7474         string is longer than 4 KB.
7475
7476 2003-05-12  Jim Meyering  <jim@meyering.net>
7477
7478         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7479         the space-padded-by-default conversion specifiers, %e, %k, %l.
7480
7481 2003-05-03  Bruno Haible  <bruno@clisp.org>
7482
7483         Upgrade to Unicode-4.0.
7484         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7485         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7486         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7487         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7488         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7489         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7490         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7491         Change width of U+E0100..U+E01EF from 1 to 0.
7492
7493 2003-04-25  Bruno Haible  <bruno@clisp.org>
7494
7495         * copy-file.c: Include <stddef.h>, for size_t.
7496
7497 2003-04-25  Jim Meyering  <jim@meyering.net>
7498
7499         * copy-file.c (copy_file_preserving): Declare buf_size to be
7500         of type size_t, not int.
7501
7502 2003-04-11  Jim Meyering  <jim@meyering.net>
7503
7504         Merge changes from Coreutils.
7505
7506         2003-03-22  Jim Meyering  <jim@meyering.net>
7507
7508         * strftime.c (widen): Cast alloca return value to proper type.
7509
7510         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7511
7512         From GNU libc.
7513         * strftime.c (my_strftime): Handle very large width
7514         specifications for numeric values correctly.  Improve checks for
7515         overflow.
7516
7517         2003-01-19  Jim Meyering  <jim@meyering.net>
7518
7519         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7520         (nl_get_alt_digit) [! defined my_strftime]: Define.
7521         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7522         _nl_get_alt_digit and _nl_get_walt_digit.
7523
7524         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7525         These changes have no effect outside of _LIBC.
7526
7527 2003-04-10  Bruno Haible  <bruno@clisp.org>
7528
7529         * findprog.h: New file, from GNU gettext.
7530         * findprog.c: New file, from GNU gettext.
7531
7532 2003-04-05  Jim Meyering  <jim@meyering.net>
7533
7534         Merge changes from Coreutils.
7535
7536         * exclude.h (PARAMS): Remove definition and uses.
7537         * exclude.c: Remove uses of `PARAMS'.
7538
7539         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7540         Add test-cases for DOS filenames. Declare program_name.
7541         (main): Set up program_name.  Patch by Rich Dawe.
7542
7543         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7544         error from mntctl.
7545         Use mntctl's return value to drive the entry-processing loop, since
7546         we can't rely on the value of the vmt_length member in the last
7547         entry.  On some systems doing so could result in exhausting
7548         virtual memory.  Based in part on a patch from Mike Jetzer.
7549
7550 2003-04-04  Bruno Haible  <bruno@clisp.org>
7551
7552         * linebreak.h: New file, from GNU gettext.
7553         * linebreak.c: New file, from GNU gettext with slight modifications.
7554         * lbrkprop.h: New file, from GNU gettext.
7555
7556 2003-04-03  Bruno Haible  <bruno@clisp.org>
7557
7558         * utf8-ucs4.h: New file, from GNU gettext.
7559         * utf16-ucs4.h: New file, from GNU gettext.
7560         * ucs4-utf8.h: New file, from GNU gettext.
7561         * ucs4-utf16.h: New file, from GNU gettext.
7562
7563 2003-04-02  Bruno Haible  <bruno@clisp.org>
7564
7565         * binary-io.h: New file, from GNU gettext.
7566
7567 2003-04-01  Bruno Haible  <bruno@clisp.org>
7568
7569         * pathname.h: New file, from GNU gettext.
7570         * concatpath.c: New file, from GNU gettext.
7571
7572 2003-03-30  Bruno Haible  <bruno@clisp.org>
7573
7574         * copy-file.c (copy_file_preserving): Don't set owner if the function
7575         chown() doesn't exist.
7576
7577 2003-03-28  Bruno Haible  <bruno@clisp.org>
7578
7579         * copy-file.h: New file, from GNU gettext.
7580         * copy-file.c: New file, from GNU gettext.
7581
7582 2003-03-18  Jim Meyering  <jim@meyering.net>
7583
7584         * quote.c (quote_n): Fix typo in comment.
7585
7586 2003-03-14  Jim Meyering  <jim@meyering.net>
7587
7588         Merge changes from Coreutils.
7589         * obstack.h (obstack_object_size): Declare temporary, __o,
7590         to be const, in order to avoid warnings.
7591         (obstack_room): Likewise.
7592         (obstack_empty_p): Likewise.
7593
7594 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7595
7596         Merge changes from Bison.
7597         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7598         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7599         when compiling Bison 1.875's `bitset bset = obstack_alloc
7600         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7601         * hash.c: Include <stdbool.h> unconditionally.
7602
7603 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7604
7605         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7606         Reported by Bruce Becker; see:
7607         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7608
7609 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7610             Bruno Haible  <bruno@clisp.org>
7611
7612         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7613         Reported by John Hughes, see
7614         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7615
7616 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7617
7618         * poll_.h: New file.
7619         * poll.c: New file.
7620
7621 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7622
7623         * mathl.h: New file.
7624         * acosl.c: New file.
7625         * asinl.c: New file.
7626         * atanl.c: New file.
7627         * ceill.c: New file.
7628         * cosl.c: New file.
7629         * expl.c: New file.
7630         * floorl.c: New file.
7631         * frexpl.c: New file.
7632         * ldexpl.c: New file.
7633         * logl.c: New file.
7634         * sincosl.c: New file.
7635         * sinl.c: New file.
7636         * sqrtl.c: New file.
7637         * tanl.c: New file.
7638         * trigl.c: New file.
7639         * trigl.h: New file.
7640
7641 2003-02-17  Bruno Haible  <bruno@clisp.org>
7642
7643         * mkdtemp.h: New file, from GNU gettext.
7644         * mkdtemp.c: New file, from GNU gettext.
7645
7646 2003-01-31  Bruno Haible  <bruno@clisp.org>
7647
7648         * rename.c: #undef rename before defining rpl_rename.
7649         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7650
7651 2003-01-30  Bruno Haible  <bruno@clisp.org>
7652
7653         * printf-args.h: New file, from GNU gettext.
7654         * printf-args.c: New file, from GNU gettext.
7655         * printf-parse.h: New file, from GNU gettext.
7656         * printf-parse.c: New file, from GNU gettext.
7657         * vasnprintf.h: New file, from GNU gettext.
7658         * vasnprintf.c: New file, from GNU gettext.
7659         * asnprintf.c: New file, from GNU gettext.
7660         * vasprintf.h: New file, from GNU gettext with modifications.
7661         * vasprintf.c: New file, from GNU gettext.
7662         * asprintf.c: New file, from GNU gettext.
7663
7664 2003-01-29  Bruno Haible  <bruno@clisp.org>
7665
7666         * stpncpy.h: New file, from GNU gettext with modifications.
7667         * stpncpy.c: New file, from GNU gettext with modifications.
7668
7669 2003-01-28  Bruno Haible  <bruno@clisp.org>
7670
7671         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7672         Paul Eggert.
7673         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7674         Paul Eggert.
7675
7676 2003-01-27  Bruno Haible  <bruno@clisp.org>
7677
7678         * xsetenv.h: New file, from GNU gettext.
7679         * xsetenv.c: New file, from GNU gettext.
7680
7681 2003-01-23  Bruno Haible  <bruno@clisp.org>
7682
7683         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7684
7685 2003-01-22  Bruno Haible  <bruno@clisp.org>
7686
7687         * exit.h: New file, from GNU gettext.
7688
7689 2003-01-11  Bruno Haible  <bruno@clisp.org>
7690
7691         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7692         * strcase.h (strcasecmp, strncasecmp): Likewise.
7693
7694 2003-01-14  Jim Meyering  <jim@meyering.net>
7695
7696         * same.c (same_name): Tweak a comment.
7697
7698 2003-01-11  Bruno Haible  <bruno@clisp.org>
7699
7700         * same.c (same_name): Reorder tests so as to avoid calling stat()
7701         when a string comparison is sufficient.
7702
7703 2003-01-11  Bruno Haible  <bruno@clisp.org>
7704
7705         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7706         'unsigned int'.
7707
7708 2003-01-11  Bruno Haible  <bruno@clisp.org>
7709
7710         * hash-pjw.c: Add comment about low quality of this function.
7711
7712 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7713
7714         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7715         to avoid collisions with libcurses and libreadline.
7716
7717         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7718         * getstr.h, getstr.c: Remove.
7719         * getline.c: Include "getline.h", to check interface.
7720         Move body of old getstr.c here: this defines MIN_CHUNK and
7721         declares getdelim2, which is renamed from getstr.
7722         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7723
7724         * linebuffer.c (readlinebuffer): Renamed from readline.
7725         All uses changed.
7726         * linebuffer.h: Likewise.
7727         (readline): Remove backward-compatibility macro.
7728
7729 2003-01-12  Jim Meyering  <jim@meyering.net>
7730
7731         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7732
7733 2003-01-10  Bruno Haible  <bruno@clisp.org>
7734
7735         * alloca_.h: New file.
7736         * getdate.y: Unconditionally include alloca.h.
7737         * makepath.c: Likewise.
7738         * setenv.c: Likewise.
7739         * userspec.c: Likewise.
7740
7741 2003-01-09  Bruno Haible  <bruno@clisp.org>
7742
7743         * stdbool.h.in: New file.
7744
7745 2003-01-08  Bruno Haible  <bruno@clisp.org>
7746
7747         * safe-read.c: Include specification header first, to ensure its
7748         selfcontainedness.
7749         * full-write.c: Likewise.
7750
7751 2003-01-08  Jim Meyering  <jim@meyering.net>
7752
7753         * full-write.c: Undefine and define-away `const' after inclusion
7754         of errno.h, not before.  Suggestion from Bruno Haible.
7755
7756 2003-01-07  Jim Meyering  <jim@meyering.net>
7757
7758         * full-write.c: Rework so that it may serve to define full_read, too.
7759         * full-read.c: Simply #define FULL_READ and include full-write.c.
7760
7761 2003-01-06  Jim Meyering  <jim@meyering.net>
7762
7763         * version-etc.c: Update year in translatable copyright string.
7764
7765 2002-12-25  Bruno Haible  <bruno@clisp.org>
7766
7767         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7768         * xstrtol.h: Likewise.
7769         * xstrtoimax.c: Likewise.
7770         * xstrtoumax.c: Likewise.
7771         * human.h: Likewise.
7772
7773         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7774         on systems that have <inttypes.h> but not <stdint.h>.
7775
7776 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7777
7778         * memcoll.c (memcoll): Fall back on a simple algorithm using
7779         memcmp if strcoll doesn't work.
7780
7781 2002-12-23  Bruno Haible  <bruno@clisp.org>
7782
7783         * localcharset.h: New file.
7784         * localcharset.c: Include it.
7785         * unicodeio.c: Likewise.
7786
7787 2002-12-22  Bruno Haible  <bruno@clisp.org>
7788
7789         * utime.c (utime_null): No need to call ftruncate if the file was
7790         nonempty.
7791
7792 2002-12-23  Bruno Haible  <bruno@clisp.org>
7793
7794         * memcoll.c (STRCOLL): New macro.
7795         (memcoll): Use it.
7796
7797 2002-12-22  Bruno Haible  <bruno@clisp.org>
7798
7799         * getstr.h (getstr): Define, to avoid clash with libcurses.
7800         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7801
7802 2002-12-22  Bruno Haible  <bruno@clisp.org>
7803
7804         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7805
7806 2002-12-23  Bruno Haible  <bruno@clisp.org>
7807
7808         * getline.h: Include <stddef.h>, for size_t.
7809
7810         * unicodeio.h: Include <stddef.h>, for size_t.
7811         * unicodeio.c: Don't include <stddef.h>.
7812
7813 2002-12-17  Bruno Haible  <bruno@clisp.org>
7814
7815         * canon-host.c (strdup): Remove unused declaration.
7816
7817         * fsusage.c: Include full_read.h.
7818         (get_fs_usage): Use full_read instead of safe_read.
7819
7820         * utime.c (utime_null): Use SAFE_READ_ERROR.
7821
7822 2002-12-11  Bruno Haible  <bruno@clisp.org>
7823
7824         * setenv.h: Rewritten to cope with systems that have setenv() but not
7825         unsetenv().
7826         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7827         modifications:
7828
7829         2002-12-11  Bruno Haible  <bruno@clisp.org>
7830
7831                 * setenv.c (alloca): Fall back to malloc.
7832                 (freea): New macro.
7833                 (setenv): Use freea() to free memory allocated with alloca().
7834
7835         2002-11-13  Bruno Haible  <bruno@clisp.org>
7836
7837                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7838                 function declarations.
7839                 * unsetenv.c (unsetenv): Likewise.
7840
7841         2002-03-04  Bruno Haible  <bruno@clisp.org>
7842
7843                 Portability to AIX 4.3.3.
7844                 * unsetenv.c: New file, extracted from setenv.c.
7845                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7846
7847         2001-12-20  Bruno Haible  <bruno@clisp.org>
7848
7849                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7850                 use malloc instead. For SunOS 4.
7851
7852         2001-12-11  Bruno Haible  <bruno@clisp.org>
7853
7854                 * setenv.c: Declare alloca.
7855                 (compar_fn_t): New typedef.
7856                 (KNOWN_VALUE, STORE_VALUE): Use it.
7857
7858         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7859         setenv.h.
7860
7861 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7862
7863         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7864         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7865         Choose values that are less likely to collide with system fnmatch
7866         options.
7867         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7868         defined (e.g., a pure POSIX system).
7869         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7870         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7871
7872 2002-12-06  Jim Meyering  <jim@meyering.net>
7873
7874         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7875
7876         Merge in changes from libc's misc/error.c, in preparation
7877         for the merge of gnulib's changes back into libc.
7878
7879         * error.c (_): Define only if not already defined.
7880         Move definition to follow all #include directives.
7881         Include unlocked-io.h only if !_LIBC.
7882         [_LIBC]: Include <libio/libioP.h>.
7883         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7884         (fflush): Tweak definition to use INTUSE.
7885         (putc): Define.
7886
7887 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7888
7889         * alloca.c [defined emacs]: Include "lisp.h".
7890         (xalloc_die) [defined emacs]: New macro.
7891         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7892         [! defined emacs]: Include <xalloc.h>.
7893         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7894         (pointer): Typedef to POINTER_TYPE *.
7895         (malloc): Remove decl; we now always use xmalloc.
7896         (alloca): Use old-style definition, since Emacs needs this.
7897         Check for arithmetic overflow when computing combined size.
7898
7899 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7900
7901         Do not generate unlocked-io.h automatically, since it's easier to
7902         maintain it by hand.
7903
7904         * unlocked-io.h: New file, from GNU diffutils,
7905         but with proper copyright notice and attribution.
7906         * gen-uio: Remove.
7907         * Makefile.am: Add copyright notice.
7908         (libfetish_a_SOURCES): Add unlocked-io.h.
7909         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7910         (DISTCLEANFILES, io_functions): Remove macros.
7911         (EXTRA_DIST): Remove gen_uio.
7912         (unlocked-io.h): Remove rule.
7913
7914 2002-12-04  Jim Meyering  <jim@meyering.net>
7915
7916         Reflect the fact that stat.c and lstat.c are no longer generated.
7917         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7918         (DISTCLEANFILES): Likewise.
7919         (EXTRA_DIST): Likewise.
7920         (all_local): Don't depend on stat.c or lstat.c.
7921         (stat.c, lstat.c): Remove rules.
7922         (EXTRA_DIST): Remove xstat.in.
7923
7924         * xstat.in: Remove file.  Contents moved into stat.c.
7925         * stat.c: New file.  Contents mostly from xstat.in.
7926         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7927         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7928
7929         * safe-read.c: Rework so that it may serve to define safe_write, too.
7930         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7931
7932 2002-12-03  Jim Meyering  <jim@meyering.net>
7933
7934         * safe-read.c, safe-write.c: Change variable names and comments, but
7935         not semantics, to minimize the differences between these two files.
7936         (safe_read): Change comment to mention SAFE_READ_ERROR.
7937
7938         * safe-read.c (IS_EINTR): Define.
7939         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7940
7941 2002-12-02  Bruno Haible  <bruno@clisp.org>
7942
7943         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7944         Define, taken from safe-read.c.
7945         (INT_MAX): Provide fallback.
7946         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7947         * safe-write.h (SAFE_WRITE_ERROR): Define.
7948
7949         * safe-read.c (EINTR): Remove definition.
7950         (safe_read): Don't use EINTR if it is absent.
7951
7952 2002-12-02  Jim Meyering  <jim@meyering.net>
7953
7954         * safe-read.c (EINTR): Define.
7955         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7956         (INT_MAX): Provide fallback.
7957         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7958
7959         * safe-read.h (SAFE_READ_ERROR): Define.
7960
7961 2002-12-01  Jim Meyering  <jim@meyering.net>
7962
7963         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7964         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7965
7966 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7967
7968         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7969         hash_rehash): Replace `if (limit <= value) abort ();' with
7970         `if (! (value < limit)) abort ();', for readability.
7971
7972 2002-11-26    <karl@gnu.org>
7973
7974         * strdup.c: copy from libc again, with jim's ok.
7975         * .cppi-disable: re-add strdup.c
7976
7977 2002-11-25    <karl@gnu.org>
7978
7979         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7980         instead of "strtol.c".
7981
7982 2002-11-25  Jim Meyering  <jim@meyering.net>
7983
7984         * mktime.c: Sync from libc, now that it has the latest fix.
7985
7986 2002-11-24    <karl@gnu.org>
7987
7988         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7989         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7990
7991 2002-11-24  Jim Meyering  <jim@meyering.net>
7992
7993         Update from coreutils:
7994
7995         * mktime.c: Merge in changes from libc.
7996
7997         Avoid a link-time failure on some Linux systems.
7998         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7999         (__mon_yday): Declare with the STATIC attribute.
8000         (__mktime_internal): Likewise.
8001         Based on a report from Greg Schafer.
8002
8003 2002-11-23  Jim Meyering  <jim@meyering.net>
8004
8005         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8006         Use `unsigned', not `int', as type of index.
8007
8008         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8009
8010         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8011
8012 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8013
8014         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8015         hint that one should use `if (! x) abort ();' rather than `assert
8016         (x);', and anyway it's one less thing to worry about configuring.
8017         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8018         hash_rehash, hash_insert): Use abort rather than assert.
8019
8020 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8021
8022         * quotearg.h: Allow multiple inclusion by surrounding with
8023         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8024         so that we can be included first.
8025         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8026         * quotearg.c: Include quotearg.h immediately after config.h.
8027         No need to include stddef.h or sys/types.h any more.
8028         Surround local include files with "", not "<>".
8029         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8030         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8031         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8032         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8033         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8034         (ISPRINT): Remove; no longer needed now that we assume C89.
8035
8036         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8037         Preserve errno.
8038
8039         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8040         quotearg_char): Use SIZE_MAX rather than
8041         (size_t) -1 when we are talking about "infinity".
8042
8043         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8044
8045 2002-11-22  Bruno Haible  <bruno@clisp.org>
8046
8047         * safe-read.h: Assume C89. Add comments.
8048         (safe_read): Change return type to size_t.
8049         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8050         counts > SSIZE_MAX correctly.
8051         * safe-write.h: New file.
8052         * safe-write.c: New file.
8053         * full-read.h: New file.
8054         * full-read.c: New file.
8055         * full-write.h: Assume C89. Add comments.
8056         * full-write.c: Include safe-write.h.
8057         (full_write): Rewritten to use safe_write.
8058         Suggested by Jim Meyering and Paul Eggert.
8059
8060 2002-11-21  Bruno Haible  <bruno@clisp.org>
8061
8062         Remove case insensitive option matching.
8063         * argmatch.h (argcasematch): Remove declaration.
8064         (ARGCASEMATCH): Remove macro.
8065         (__xargmatch_internal): Remove case_sensitive argument.
8066         (XARGMATCH): Update.
8067         (XARGCASEMATCH): Remove macro.
8068         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8069         case_sensitive argument.
8070         (argcasematch): Remove function.
8071         (__xargmatch_internal): Remove case_sensitive argument.
8072         (main): Use XARGMATCH instead of XARGCASEMATCH.
8073
8074         * xmalloc.c: Change compile-time error message. Add comment about
8075         required autoconf version.
8076
8077 2002-11-21  Jim Meyering  <jim@meyering.net>
8078
8079         * strdup.c (strdup): Tweak comment and initial #if/#include.
8080
8081         Merge in changes from the coreutils.
8082
8083         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8084         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8085         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8086         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8087         int.  Work more efficiently if X is the same width as uintmax_t.
8088         Do not compare X to -1, to avoid bogus compiler warning.
8089         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8090         Don't assume that f_frsize and f_bsize are the same type.
8091
8092         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8093         on FreeBSD.
8094
8095         * makepath.c (make_path): Restore umask *before* creating the final
8096         component.
8097         (make_path): Minor reformatting.
8098
8099         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8100         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8101
8102         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8103         ones.  At least on GNU/Linux systems, `auto' means something else.
8104         From Michael Stone.
8105
8106 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8107
8108         Merge argmatch cleanups from Bison.  Assume C89.
8109
8110         * argmatch.c: Include config.h here, not in argmatch.h.
8111         Include stdlib.h, for EXIT_FAILURE.
8112         Always include <string.h>, since we assume C89.
8113         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8114         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8115         Include <stddef.h> instead, since it's all we need for size_t.
8116         (PARAMS): Remove.  All uses removed.
8117         (ARRAY_CARDINALITY): Do not bother to #undef.
8118         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8119         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8120         Remove unnecessary parentheses.
8121         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8122         Insert necessary parentheses.
8123         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8124         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8125
8126 2002-11-19  Bruno Haible  <bruno@clisp.org>
8127
8128         * mbswidth.c: Include mbswidth.h right at the beginning.
8129         * mbswidth.h: Include <stddef.h>, for size_t.
8130
8131         * mbswidth.h (PARAMS): Remove macro.
8132         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8133         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8134
8135         * gcd.h (PARAMS): Remove macro.
8136         (gcd): Use ANSI C function declarations.
8137         * gcd.c (gcd): Likewise.
8138
8139 2002-11-15  Bruno Haible  <bruno@clisp.org>
8140
8141         * strcspn.c: Include <stddef.h>.
8142         (strcspn): Use ANSI C function declaration. Change return type to
8143         size_t. Use NULL.
8144         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8145         (strpbrk): Use NULL.
8146         * strpbrk.h (PARAMS): Remove macro.
8147         (strpbrk): Use ANSI C function declaration.
8148         * strstr.c: Don't include <sys/types.h>.
8149         * strstr.h (PARAMS): Remove macro.
8150         (strstr): Use ANSI C function declarations.
8151
8152 2002-11-06  Bruno Haible  <bruno@clisp.org>
8153
8154         * gcd.h (gcd): Change argument type to 'unsigned long'.
8155         * gcd.c (gcd): Likewise.
8156
8157 2002-11-05  Bruno Haible  <bruno@clisp.org>
8158
8159         * gcd.h: New file, from gettext-0.11.5.
8160         * gcd.c: New file, from gettext-0.11.5.
8161
8162 2002-11-05  Bruno Haible  <bruno@clisp.org>
8163
8164         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8165         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8166         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8167         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8168
8169         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8170         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8171
8172         * closeout.c: Include gettext.h instead of <libintl.h>.
8173         * human.c: Include gettext.h instead of <libintl.h>.
8174         * quotearg.c: Include gettext.h instead of <libintl.h>.
8175         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8176         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8177         * userspec.c: Include gettext.h instead of <libintl.h>.
8178         * version-etc.c: Include gettext.h instead of <libintl.h>.
8179         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8180         (textdomain): Remove definition.
8181         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8182
8183         * long-options.c: Remove include of <libintl.h> and definition of _.
8184         * same.c: Remove include of <libintl.h> and definition of _.
8185
8186 2002-11-04  Bruno Haible  <bruno@clisp.org>
8187
8188         * stpcpy.h: New file, from GNU gettext-0.11.5.
8189         * strcase.h: New file, from GNU gettext-0.11.5.
8190         * strpbrk.h: New file, from GNU gettext-0.11.5.
8191         * strstr.h: New file, from GNU gettext-0.11.5.
8192         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8193
8194 2002-05-09  Bruno Haible  <bruno@clisp.org>
8195
8196         * config.charset: Update for newest glibc. Add canonical names
8197         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8198
8199 2002-05-09  Bruno Haible  <bruno@clisp.org>
8200
8201         * localcharset.c (get_charset_aliases): Add more Windows specific
8202         aliases.
8203
8204 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8205
8206         * config.charset: A few additions for Solaris.
8207
8208 2001-12-05  Bruno Haible  <bruno@clisp.org>
8209
8210         * localcharset.c (locale_charset): Don't return an empty string.
8211
8212 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8213
8214         * config.charset: msdos in uk_UA uses CP1125.
8215
8216 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8217
8218         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8219         * localcharset.c (locale_charset): Declare as extern "C".
8220
8221 2002-02-15  Bruno Haible  <bruno@clisp.org>
8222
8223         * config.charset [msdosdjgpp]: For Russian, use CP866.
8224
8225 2002-02-11  Bruno Haible  <bruno@clisp.org>
8226
8227         * config.charset: Add support for NetBSD.
8228
8229 2002-09-25    <karl@gnu.org>
8230
8231         * strdup.c: copy from libc/string (via ../config/srclist*).
8232         * getopt*: copy from libc/posix.
8233         * gettext.h: copy from gettext.
8234         * .cppi-disable: add strdup.c, gettext.h.
8235
8236 2002-07-01  Jim Meyering  <meyering@lucent.com>
8237
8238         * c-stack.c: Include sys/time.h.
8239         From Volker Borchert.
8240
8241 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8242
8243         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8244         New macro.  Use it uniformly instead of
8245         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8246         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8247         reported by Vin Shelton.
8248
8249 2002-06-22  Jim Meyering  <meyering@lucent.com>
8250
8251         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8252         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8253
8254 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8255
8256         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8257         Do not assume SA_SIGINFO behavior.
8258         Bug reported by Jim Meyering on NetBSD 1.5.2.
8259
8260 2002-06-22  Jim Meyering  <meyering@lucent.com>
8261
8262         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8263
8264         * exitfail.c, exitfail.h: Likewise.
8265         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8266
8267         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8268         of fnmatch.h.
8269         (EXTRA_DIST): Add fnmatch_loop.c.
8270         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8271
8272         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8273         * fnmatch.c: Update from diffutils-2.8.2.
8274         * fnmatch_.h: New file.  From diffutils-2.8.2.
8275         * fnmatch.h: Remove file.
8276
8277 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8278
8279         * file-type.h: Report an error if neither S_ISREG nor
8280         S_IFREG is defined, instead of using a test specific to glibc
8281         2.2.  This should be safe, since POSIX requires S_ISREG and
8282         Unix Version 7 had S_IFREG.  We don't need to check for
8283         <sys/types.h> since we don't use any symbols that it defines.
8284
8285 2002-06-15  Jim Meyering  <meyering@lucent.com>
8286
8287         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8288         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8289         have been included before this file.
8290
8291 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8292
8293         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8294         so that each temporary file name is unique and valid in the first
8295         8 characters, for operation under DOS.
8296
8297 2002-06-15  Jim Meyering  <meyering@lucent.com>
8298
8299         Work even with DJGPP 2.03, which lacks support for symlinks.
8300         From Richard Dawe.
8301         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8302         is defined.
8303         * lchown.c (S_ISLNK): Likewise.
8304
8305 2002-06-14  Jim Meyering  <meyering@lucent.com>
8306
8307         * file-type.h: Use the version from diffutils-2.8.2.
8308         * file-type.c: Likewise.
8309
8310 2002-05-27  Jim Meyering  <meyering@lucent.com>
8311
8312         Fix a problem seen only on nonconforming systems whereby ls.c's
8313         use of localtime, and then of gettimeofday would cause trouble:
8314         the localtime call used to initialize rpl_gettimeofday's save
8315         mechanism would clobber ls's current local time information so
8316         that in any long listing the first file would always be listed
8317         with date 1970-01-01.  Analysis by Volker Borchert.
8318
8319         * gettimeofday.c (localtime): Undefine.
8320         (rpl_localtime): New function.
8321
8322 2002-05-22  Jim Meyering  <meyering@lucent.com>
8323
8324         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8325         * file-type.h: New file.
8326         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8327
8328 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8329
8330         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8331
8332 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8333
8334         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8335         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8336         of 127, since 64 is the largest conceivable number for ancient
8337         nonstandard hosts.
8338         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8339
8340 2002-04-28  Jim Meyering  <meyering@lucent.com>
8341
8342         * sig2str.c (WTERMSIG): Remove definition (unused).
8343
8344 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8345
8346         * sig2str.h, sig2str.c: New files.
8347         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8348
8349 2002-04-24  Jim Meyering  <meyering@lucent.com>
8350
8351         * gettext.h: New file, from Gettext.
8352         * Makefile.am (INCLUDES): Remove -I../intl.
8353         (libfetish_a_SOURCES): Add gettext.h.
8354
8355 2002-04-16  Jim Meyering  <meyering@lucent.com>
8356
8357         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8358         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8359         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8360
8361 2002-04-12  Jim Meyering  <meyering@lucent.com>
8362
8363         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8364
8365 2002-03-10  Jim Meyering  <meyering@lucent.com>
8366
8367         * makepath.c (make_path): Remove a comma from a diagnostic.
8368         Suggestion from Santiago Vila.
8369
8370 2002-03-08  Jim Meyering  <meyering@lucent.com>
8371
8372         * rename.c: Mention that this wrapper is needed also on
8373         mips-dec-ultrix4.4 systems.
8374
8375 2002-03-02  Jim Meyering  <meyering@lucent.com>
8376
8377         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8378         not HAVE_CLOCK_SETTIME.
8379
8380 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8381
8382         * nanosleep.h: Rename to....
8383         * timespec.h: New name for nanosleep.h.  All uses changed.
8384
8385         * gettime.c: New file.
8386         * settime.c: New file.
8387         * stime.c: Remove.
8388
8389         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8390         timespec.h.  Remove nanosleep.h.
8391
8392 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8393
8394         * acl.c, acl.h: New files.
8395         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8396
8397 2002-02-24  Jim Meyering  <meyering@lucent.com>
8398
8399         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8400         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8401         cause trouble.  Reported by Nelson Beebe.
8402
8403 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8404
8405         * path-concat.c (xpath_concat): Reorder code to pacify
8406         compilers that don't know that xalloc_die never returns.
8407
8408 2002-02-20  Jim Meyering  <meyering@lucent.com>
8409
8410         * getdate.c: Regenerate using bison-1.33.
8411
8412 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8413
8414         * posixver.c, posixver.h: New files.
8415         * Makefile.am (libfetish_a_SOURCES): Add them.
8416
8417 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8418             Bruno Haible  <bruno@clisp.org>
8419
8420         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8421         (fwrite_success_callback): New declaration.
8422         * unicodeio.c (unicode_to_mb): New function, extracted from
8423         print_unicode_char. Call failure callback instead of error.
8424         (fwrite_success_callback): New function.
8425         (exit_failure_callback): New function.
8426         (fallback_failure_callback): New function.
8427         (print_unicode_char): Call unicode_to_mb.
8428
8429 2002-01-26  Jim Meyering  <meyering@lucent.com>
8430
8431         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8432
8433 2002-01-22  Jim Meyering  <meyering@lucent.com>
8434
8435         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8436         Otherwise, some versions of automake would omit the rule that makes
8437         Makefile from Makefile.in.
8438
8439 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8440
8441         * xmemcoll.h, xmemcoll.c: New files.
8442         * Makefile.am (libfetish_a_SOURCES): Add them.
8443         * memcoll.c: Include errno.h, and declare errno if not defined.
8444         (memcoll): Set errno to zero if there is no error.
8445
8446         * quotearg.c (quotearg_buffer_restyled):
8447         Fix bug with quoting buffers containing NUL when backslashing escapes.
8448         This bug was exposed by the other changes in this patch.
8449         (quotearg_n_options): New arg ARGSIZE.
8450         All callers changed.
8451         (quoting_options_from_style): New function.
8452         (quotearg_n_style): Use it.
8453         (quotearg_n_style_mem): New function.
8454
8455         * quotearg.h (quotearg_n_style_mem): New function.
8456
8457 2002-01-16  Jim Meyering  <meyering@lucent.com>
8458
8459         * getdate.y: Add three semicolons, each just before a closing brace.
8460         Bison (as of version 1.31) no longer papers over that mistake.
8461
8462 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8463
8464         * backupfile.c (ISDIGIT): Comment fix.
8465         * getdate.y (ISDIGIT): Likewise.
8466         * posixtm.c (ISDIGIT, year): Likewise.
8467         * strverscmp.c (ISDIGIT): Likewise.
8468         * userspec.c (ISDIGIT): Likewise.
8469
8470 2002-01-05  Jim Meyering  <meyering@lucent.com>
8471
8472         * version-etc.c (version_etc_copyright): Update copyright year.
8473
8474 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8475
8476         * closeout.c (close_stdout_status): If ferror (stdout), do
8477         not silently exit merely because the output buffer happens to
8478         have nothing pending.
8479
8480 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8481
8482         See the big note in ../ChangeLog.
8483         * human.c (suffixes): Prefer K to k for 1024.
8484         (generate_suffix_backwards): New function.
8485         (human_readable_inexact): Use it.
8486         * xstrtol.c (__xstrtol): If there is no number but there
8487         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8488         Accept 'K' as well as 'k'.
8489
8490 2001-12-15  Jim Meyering  <meyering@lucent.com>
8491
8492         * regex.h (__restrict_arr): Update from libc.
8493
8494         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8495         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8496         (STREQ): Define.
8497
8498 2001-12-10  Jim Meyering  <meyering@lucent.com>
8499
8500         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8501         Instead, include "xalloc.h".
8502         (initbuffer): Don't cast xmalloc return value to char*.
8503         (readline): Reword comment.
8504         Don't cast xrealloc return value to char*
8505         Return NULL, not 0.
8506
8507 2001-12-09  Jim Meyering  <meyering@lucent.com>
8508
8509         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8510         `signed and unsigned type in conditional expression'.
8511         * posixtm.c (posix_time_parse): Likewise.
8512
8513         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8514
8515         * readtokens.c (readtoken): Declare an index to be of type unsigned
8516         to avoid a pedantic warning.
8517
8518         * getstr.c: Don't include assert.h.
8519         (getstr): Remove warning-evoking assertions.
8520         Return -1 if offset parameter is out of bounds.
8521         Change the type of a local from int to size_t.
8522
8523         * strftime.c (my_strftime_localtime_r): Include this function
8524         definition in the `#if ! HAVE_TM_GMTOFF' block.
8525
8526         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8527         Include xalloc.h instead.
8528
8529 2001-12-02  Jim Meyering  <meyering@lucent.com>
8530
8531         * tempname.c: Don't declare getenv, thus reverting the change of
8532         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8533         included.
8534
8535         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8536         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8537
8538 2001-11-30  Akim Demaille  <akim@epita.fr>
8539
8540         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8541         before being defined.
8542
8543 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8544
8545         * quotearg.h (quotearg_n, quotearg_n_style):
8546         First arg is int, not unsigned.
8547         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8548         (SIZE_MAX, UINT_MAX): New macros.
8549         (quotearg_n_options): Abort if N is negative.
8550         Avoid overflow check on hosts where size_t is 64 bits and int
8551         is 32 bits, as overflow is impossible there.
8552         Fix off-by-one typo that caused unnecessary reallocation.
8553
8554 2001-11-27  Jim Meyering  <meyering@lucent.com>
8555
8556         * tempname.c: Merge with version from libc.
8557         * regex.c: Likewise.
8558
8559         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8560         for which STDC_HEADERS is 0, it was not included, resulting in a
8561         warning about an integer-to-pointer conversion problem with getenv.
8562         Reported by Volker Borchert.
8563
8564 2001-11-26  Jim Meyering  <meyering@lucent.com>
8565
8566         * gtod.h: Remove file.
8567         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8568         * gettimeofday.c: Don't include gtod.h.
8569         (GTOD_init): Remove function.
8570         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8571         Suggestion from Volker Borchert.
8572
8573 2001-11-23  Jim Meyering  <meyering@lucent.com>
8574
8575         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8576         * hash.c (struct hash_table): Define it here instead.
8577
8578 2001-11-22  Jim Meyering  <meyering@lucent.com>
8579
8580         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8581
8582 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8583
8584         * tempname.c (TMP_MAX): Remove; no longer needed.
8585         (TEMPORARIES): New macro.
8586         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8587         removes an artificial limitation (e.g. HP-UX 10.20, where
8588         TMP_MAX is 17576).
8589
8590 2001-11-18  Jim Meyering  <meyering@lucent.com>
8591
8592         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8593         on SunOS 4.
8594
8595         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8596         files will be created before anything else.
8597
8598 2001-11-17  Jim Meyering  <meyering@lucent.com>
8599
8600         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8601         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8602         rather than group writable.  Patch by Juan F. Codagnone.
8603
8604         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8605         Instead, include "xalloc.h".
8606
8607         * mountlist.c: Include unlocked-io.h after all system headers.
8608         Remove explicit declarations of xmalloc, xrealloc,
8609         and xstrdup.  Instead, include "xalloc.h".
8610
8611         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8612         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8613         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8614
8615         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8616         Reported by Padraig Brady.
8617
8618         * mkstemp.c: #undef mkstemp.
8619         Include config.h.
8620         (rpl_mkstemp): Rename from mkstemp.
8621         Protoize.
8622
8623 2001-11-16  Jim Meyering  <meyering@lucent.com>
8624
8625         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8626         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8627         determine the amount of total physical memory, use pstat_getstatic.
8628         HPUX-11 doesn't define _SC_PHYS_PAGES.
8629         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8630         If sysconf couldn't be used to determine the amount of available
8631         physical memory, use both pstat_getstatic and pstat_getdynamic.
8632         Based on a patch from Bob Proulx.
8633
8634 2001-11-05  Jim Meyering  <meyering@lucent.com>
8635
8636         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8637
8638 2001-11-03  Jim Meyering  <meyering@lucent.com>
8639
8640         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8641         in argmatch_to_argument call.
8642
8643         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8644         argument.
8645
8646         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8647         e.g., a fault due to an attempt to free a NULL pointer.
8648
8649 2001-11-01  Jim Meyering  <meyering@lucent.com>
8650
8651         * dirfd.c, dirfd.h: New files.
8652         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8653
8654         * hash.c (hash_print) [TESTING]: Clean up.
8655
8656 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8657
8658         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8659         to avoid a warning if -Wall.
8660
8661 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8662
8663         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8664
8665 2001-10-21  Jim Meyering  <meyering@lucent.com>
8666
8667         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8668         this code would end up calling gettext even in packages built
8669         with --disable-nls.
8670         * getopt.c (_): Likewise.
8671         * regex.c (_): Likewise.
8672
8673 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8674
8675         * error.c (strerror_r): Do not declare unless !_LIBC.
8676         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8677         Use strerror_r that is only a macro, even if it is not a function.
8678         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8679         (private_strerror): Use prototypes, not old-style function definition.
8680         (print_errno_message): New function.
8681         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8682         char*-flavored one.
8683         (error_tail, error, error_at_line): Use it.
8684
8685 2001-10-11  Jim Meyering  <meyering@lucent.com>
8686
8687         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8688         and quote_n (1, ... to avoid clobbering a buffer.
8689
8690 2001-10-05  Jim Meyering  <meyering@lucent.com>
8691
8692         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8693         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8694         * hash-pjw.h: New file.
8695
8696 2001-09-30  Jim Meyering  <meyering@lucent.com>
8697
8698         * mountlist.c [MOUNTED_GETFSSTAT]:
8699         Include <sys/ucred.h>, for Apple Darwin.
8700         Include sys/mount.h and sys/fs_types.h only if available.
8701         (FS_TYPE): Define.
8702         (read_filesystem_list): Use FS_TYPE.
8703
8704 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8705
8706         * exclude.c (excluded_filename): 0 -> false, since it's
8707         a boolean context.
8708
8709 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8710
8711         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8712         #defines strtoimax.  Also treat the other strto* functions
8713         like strtoimax.
8714
8715         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8716         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8717         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8718
8719 2001-09-26  Jim Meyering  <meyering@lucent.com>
8720
8721         Most macros in unlocked-io.h had the wrong number of arguments.
8722         * gen-uio: New script.
8723         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8724         * unlocked-io.hin: Remove file.
8725         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8726         rather than trying to embed it here.
8727         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8728         Reported by Padraig Brady.
8729
8730 2001-09-25  Volker Borchert  <bt@teknon.de>
8731
8732         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8733
8734 2001-09-23  Jim Meyering  <meyering@lucent.com>
8735
8736         * mountlist.c: Remove useless parentheses in #if directives.
8737         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8738         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8739
8740 2001-09-22  Jim Meyering  <meyering@lucent.com>
8741
8742         * localcharset.c: Update from latest gettext.
8743         * config.charset: Likewise.
8744
8745 2001-09-20  Jim Meyering  <meyering@lucent.com>
8746
8747         * xstrtol.c (strtoimax): Guard declaration with
8748         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8749         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8750         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8751         (strtoumax): Likewise, for completeness (it wasn't necessary).
8752
8753 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8754
8755         * strtoimax.c (HAVE_LONG_LONG):
8756         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8757         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8758         to work around bug in IBM C compiler.
8759
8760 2001-09-16  Jim Meyering  <meyering@lucent.com>
8761
8762         * mkdir.c: New file.
8763
8764 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8765
8766         * xgetcwd.c: Revert some of the previous change; intead,
8767         fix the HAVE_GETCWD_NULL code to behave more like the
8768         !HAVE_GETCWD_NULL code used to.
8769
8770         Include "xalloc.h".
8771         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8772         invoke xalloc_die.
8773
8774 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8775
8776         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8777         Use ssize_t, not int, to store result of readlink.
8778         Check for ssize_t overflow as well as size_t overflow,
8779         as POSIX says the result of readlink is implementation-defined
8780         when ssize_t overflows.
8781         Remove unnecessary cast to char*.
8782         Use free+malloc instead of realloc, as the storage doesn't need
8783         to be preserved and it's clearer and can be more efficient that way.
8784         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8785         * xreadlink.h (xreadlink): Update prototype.
8786
8787 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8788
8789         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8790         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8791         spotted by Jim Meyering.
8792
8793 2001-09-03  Jim Meyering  <meyering@lucent.com>
8794
8795         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8796
8797 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8798
8799         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8800         like the HAVE_GETCWD_NULL code.
8801         Include pathmax.h if not HAVE_GETCWD.
8802         Do not include xalloc.h.
8803         (INITIAL_BUFFER_SIZE): New symbol.
8804         Do not use xmalloc / xrealloc, since the caller is responsible for
8805         handling errors.  Preserve errno around `free' during failure.
8806         Do not overrun buffer when using getwd.
8807
8808 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8809
8810         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8811         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8812
8813 2001-09-02  Jim Meyering  <meyering@lucent.com>
8814
8815         * error.c: Update from GNU libc.
8816
8817 2001-09-01  Jim Meyering  <meyering@lucent.com>
8818
8819         * xreadlink.c: New file.
8820         * xreadlink.h: New file.
8821         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8822
8823         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8824         doesn't conflict with sparc Solaris 7's definition in
8825         /usr/include/sys/int_types.h.
8826
8827         * exclude.c: Use `""', not `<>' to #include non-system header files.
8828         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8829         and strncasecmp as r-values.  Unixware didn't have declarations.
8830
8831 2001-08-31  Jim Meyering  <meyering@lucent.com>
8832
8833         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8834         Use an initial, malloc'd, buffer of length 128 rather than
8835         a statically allocated one of length 1024.
8836
8837 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8838
8839         * xgetcwd.c: Don't include pathmax.h.
8840         Include stdlib.h and unistd.h if available.
8841         Include xalloc.h.
8842         (xmalloc, xstrdup, free): Remove decls.
8843         (xgetcwd): Don't assume sizes fit in unsigned.
8844         Check for overflow when computing sizes.
8845         Simplify reallocation code.
8846
8847 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8848
8849         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8850
8851         * strtoimax.c: Renamed from strtoxmax.c, removing the
8852         old strtoimax.c.
8853
8854         Also, make the following further changes to make this file's
8855         configuration more similar to that of strtol.c:
8856         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8857         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8858         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8859         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8860         changed to signed values.
8861
8862         And make the following changes as well:
8863         Fix copyright notice, as 1999 was missing.
8864         (verify): New macro.
8865         (strtoimax): Check sizes at compile-time, not run-time.
8866         Prefer strtol to strtoll if both work.
8867         (main): Remove; it was not that useful and was a pain to maintain.
8868
8869         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8870
8871 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8872
8873         * savedir.c (savedir): Remove size parameter, as POSIX says that
8874         a directory's st_size can have an arbitrary value, so the old
8875         usage could waste an arbitrary amount of memory.  All uses
8876         changed.
8877         * savedir.h: Update prototype.
8878
8879 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8880
8881         * xstrtol.c (strtoimax): New decl.
8882
8883 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8884
8885         * xstrtol.h: Add copyright notice.
8886         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8887         LONGINT_INVALID_SUFFIX_CHAR.
8888
8889 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8890
8891         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8892         tm to be declared.
8893
8894 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8895
8896         * hash.c: Remove '2001' from copyright notice.
8897
8898 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8899
8900         * full-write.h: New file.
8901         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8902         * full-write.c: Correct credits, as cccp.c no longer
8903         exists and anyway it was so heavily changed from the old cccp
8904         code as to be unrecognizable.  Include full-write.h.
8905         (full_write) Return size_t, with short writes meaning failure.
8906         All callers changed.  This fixes a bug with large buffers
8907         on 64-bit hosts.
8908         * utime.c: Include full-write.h.
8909
8910 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8911
8912         Merge 'exclude' changes from tar 1.13.22.
8913         This fixes one or two unlikely storage allocation overflow bugs,
8914         but doesn't change user-visible behavior otherwise.
8915
8916 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8917
8918         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8919         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8920         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8921         Include if available.
8922         (<xalloc.h>): Include
8923         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8924         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8925         collide with FNM macros.
8926         (struct patopts): New struct.
8927         (struct exclude): Use it, as exclude patterns now come with options.
8928         (new_exclude): Support above changes.
8929         (new_exclude, add_exclude_file):
8930         Initial size must now be a power of two to simplify overflow checking.
8931         (free_exclude, fnmatch_no_wildcards): New function.
8932         (excluded_filename): No longer requires options arg, as the options
8933         are determined by add_exclude.  Now returns bool, not int.
8934         (excluded_filename, add_exclude):
8935         Add support for the fancy new exclusion options.
8936         (add_exclude, add_exclude_file): Now takes int options arg.
8937         Check for arithmetic overflow when computing sizes.
8938         (add_exclude_file): xrealloc might modify errno, so don't
8939         realloc until after errno might be used.
8940
8941         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8942         New macros.
8943         (free_exclude): New decl.
8944         (add_exclude, add_exclude_file): Now takes int options arg.
8945         (excluded_filename): No longer requires options arg, as the options
8946         are determined by add_exclude.  Now returns bool, not int.
8947
8948 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8949
8950         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8951
8952 2001-08-27  Jim Meyering  <meyering@lucent.com>
8953
8954         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8955
8956         * version-etc.c (N_): Remove definition.
8957         Revert most of last change.
8958         Instead, simply don't mark the `Copyright...' string for translation.
8959         Based on advice from Paul Eggert.
8960
8961         * strtoxmax.c: Tweak comment.
8962
8963 2001-08-26  Jim Meyering  <meyering@lucent.com>
8964
8965         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8966         of copyright with `%s' so translators don't get an untranslated
8967         message in 2002.
8968         (COPYRIGHT_YEAR): Define.
8969         (version_etc): Use fprintf rather than fputs.
8970         Suggestion from Ulrich Drepper.
8971
8972         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8973
8974         * strtoll.c: New file, from GNU libc.
8975         * xstrtoimax.c: New file.
8976
8977         * xstrtol.h: Add xstrtoimax.
8978         * strtoumax.c: New file.  Simply include "strtoumax.c".
8979         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8980
8981         * strtoumax.c: Factor to work both for unsigned and signed types, ...
8982         * strtoxmax.c: ... then renamed to this.
8983
8984 2001-08-13  Paul Eggert  <eggert@twinsun.com>
8985
8986         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8987         Port to Solaris 8, where 'sed' requires a space after the 'r'
8988         command, and where sh dislikes "$/".  Clean up the spacing a bit.
8989         Redirect output to $tmp just once.
8990
8991 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
8992
8993         * addext.c (<errno.h>): Include.
8994         (errno): Declare if not defined.
8995         (addext): Work correctly when pathconf returns -1 and leaves
8996         errno alone because there is no limit.  Also, work even if
8997         pathconf returns a value greater than SIZE_MAX.
8998
8999 2001-08-12  Jim Meyering  <meyering@lucent.com>
9000
9001         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9002         Simply `return getcwd (NULL, 0);'.
9003         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9004         Use 1300 as initial value for length, not PATH_MAX.
9005
9006         * pathmax.h: Clean up cpp syntax.
9007
9008 2001-08-12  Jim Meyering  <meyering@lucent.com>
9009
9010         * gettimeofday.c: New file.
9011         * gtod.h: New file.
9012         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9013
9014 2001-08-04  Jim Meyering  <meyering@lucent.com>
9015
9016         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9017         to get in sync with glibc.
9018
9019 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9020
9021         The following changes are from gettext 0.10.39 as maintained by
9022         Bruno Haible.
9023
9024         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9025         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9026         with inverted sense.  All uses changed.
9027
9028         * mbswidth.c: Don't include <limits.h>.
9029         Include <stdlib.h> and <string.h> unconditionally.
9030         (iswcntrl, mbsinit, ISCNTRL): New macros.
9031         (mbsnwidth): Use K&R style function declarations.
9032         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9033         can optimize it when MB_CUR_MAX == 1.
9034         The width of control characters is zero, not 1.
9035
9036 2001-07-15  Jim Meyering  <meyering@lucent.com>
9037
9038         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9039         (BUILT_SOURCES): Add unlocked-io.h.
9040         (io_functions): Define.
9041         (unlocked-io.h): New rule.
9042         (DISTCLEANFILES): Add unlocked-io.h.
9043         (all-local): Depend on unlocked-io.h, to ensure it is created.
9044
9045         * unlocked-io.hin: New file
9046
9047         * regex.c: Update from glibc.
9048
9049 2001-07-05  Jim Meyering  <meyering@lucent.com>
9050
9051         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9052         recommendation.
9053         (libfetish_a_SOURCES): Put all .h files here instead.
9054         Remove a thus-exposed (better checks in automake) duplicate and
9055         two unnecessary .h files.
9056
9057 2001-06-11  Jim Meyering  <meyering@lucent.com>
9058
9059         * regex.c: Update from GNU libc.
9060
9061 2001-05-27  Jim Meyering  <meyering@lucent.com>
9062
9063         * readutmp.h (UT_TYPE): Define.
9064
9065 2001-05-24  Jim Meyering  <meyering@lucent.com>
9066
9067         * argmatch.c: Include "quote.h".
9068         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9069         quote function.  Reported by Göran Uddeborg.
9070
9071 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9072
9073         * dirname.c (dir_name): Compute append_dot using path, not newpath
9074         which is not yet declared.
9075
9076 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9077
9078         * Makefile.am (libfetish_a_SOURCES):
9079         Add strftime.c, since we now compile it on all hosts.
9080
9081         * strftime.c (my_strftime):
9082         Define to nstrftime if emacs, but only if my_strftime is not defined.
9083         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9084         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9085         Add one more extra argument: a nanoseconds value.
9086         All uses changed.
9087         (ns): New macro.
9088         (my_strftime function): Add %N format.
9089         (emacs_strftimeu): Renamed from emacs_strftime,
9090         with extra ut argument.
9091
9092 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9093
9094         dirname code cleanup.  base_name now behaves more compatibly
9095         with POSIX basename when given file names that have trailing
9096         slashes, and similarly for dir_name.  Add new primitives
9097         base_len and dir_len.  Put the directory-name-related decls
9098         into dirname.h.
9099
9100         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9101         * backupfile.c (base_name): Likewise.
9102         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9103         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9104         * makepath.c (strip_trailing_slashes): Likewise.
9105         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9106         Likewise.
9107         * rename.c (strip_trailing_slashes): Likewise.
9108         * same.c (base_name): Likewise.
9109         * stripslash.c (ISSLASH): Likewise.
9110
9111         * addext.c: Include <dirname.h> after size_t is defined.
9112         * backupfile.c: Likewise.
9113
9114         * addext.c (addext): Use base_len to trim redundant
9115         trailing slashes instead of doing it ourselves.
9116         But do not trim the last slash if it is not redundant.
9117
9118         * backupfile.c (find_backup_file_name,
9119         max_backup_version): Use base_len instead of rolling it ourselves.
9120         Handle the case of "" and (on DOS) "C:" correctly.
9121
9122         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9123         Include <string.h>, <dirname.h>.
9124         (base_name): Allow file names ending in slashes, other than names
9125         that are all slashes.  In this case, return the basename followed
9126         by the slashes.  This is more general, and can be used in places
9127         where the original base_name purposely had an assertion failure.
9128         (base_len): New function.
9129
9130         * dirname.c: Include <string.h> instead of <stdlib.h>.
9131         Do not include <assert.h>; no longer needed.
9132         Include xalloc.h.
9133         (memrchr): Remove decl.
9134         (dir_name_r): Remove.
9135         (dir_len): Renamed from dirlen.  All callers changed.
9136         Rewrite in terms of base_name, for simplicity and consistency.
9137         (dir_name): Never return NULL.  All callers changed.
9138         Do not include <stdlib.h> in test program; no longer needed.
9139         return 0; is fine for test program.
9140
9141         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9142         New macros.
9143         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9144
9145         * path-concat.c (path_concat): Use base_len to compute
9146         base length, not strlen; this means we cannot rely on memcpy
9147         to null-terminate.
9148
9149         * same.c (STREQ): Remove.
9150         (same_name): Handle the case where the basename ends in trailing '/'.
9151
9152         * stripslash.c (strip_trailing_slashes): Return nonzero if
9153         a slash was stripped.  Do not strip the last slash after a
9154         file system prefix.
9155
9156 2001-04-08  Jim Meyering  <meyering@lucent.com>
9157
9158         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9159         recomputed; that's necessary when the offset spans a DST transition.
9160         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9161
9162 2001-04-02  Jim Meyering  <meyering@lucent.com>
9163
9164         * regex.h, regex.c: Update from GNU libc.
9165
9166 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9167
9168         * version-etc.c (version_etc_copyright): Update to 2001.
9169
9170 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9171
9172         * tempname.c (uint64_t): Define to uintmax_t if
9173         not defined, and if UINT64_MAX is not defined.
9174         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9175         Reported by John David Anglin.
9176
9177 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9178
9179         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9180         alias if codeset is empty.
9181         * config.charset (BeOS): Use wildcard syntax.
9182
9183 2001-03-13  Jim Meyering  <meyering@lucent.com>
9184
9185         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9186         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9187         From Bruno Haible.
9188
9189 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9190
9191         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9192         Don't return NULL.
9193         * unicodeio.c (print_unicode_char): Simplify accordingly.
9194
9195 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9196
9197         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9198         support for DOS/DJGPP.
9199
9200 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9201
9202         * Makefile.am (libfetish_a_SOURCES):
9203         Add dup-safer.c, fopen-safer.c.
9204         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9205
9206         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9207
9208 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9209
9210         The mkstemp replacement is taken from glibc 2.2.2, with some
9211         portability fixes for use outside glibc, as follows:
9212
9213         * tempname.c (struct_stat64): New macro.
9214         (direxists, __gen_tempname): Use it.
9215         This avoids a portability problem with Solaris 8.
9216
9217         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9218         (<stddef.h>, <stdint.h>, <string.h>):
9219         Include only if STDC_HEADERS || _LIBC.
9220         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9221         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9222         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9223         (__set_errno): Define this macro if <errno.h> doesn't.
9224         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9225         Define these macros if <stdio.h> doesn't.
9226         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9227         Define these macros if <sys/stat.h>
9228         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9229         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9230         __xstat64): Define if not _LIBC.
9231         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9232         (__gen_tempname): Invoke gettimeofday only if
9233         HAVE_GETTIMEOFDAY || _LIBC;
9234         otherwise, fall back on plain "time".
9235         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9236
9237         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9238
9239         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9240
9241 2001-02-17  Jim Meyering  <meyering@lucent.com>
9242
9243         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9244         around included file name.
9245
9246         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9247
9248         * strftime.c: Update from GNU libc (the only changes were to comments).
9249
9250 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9251
9252         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9253
9254 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9255
9256         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9257         Remove workaround macros for hosts that have mbrtowc but not
9258         mbstate_t, as we now insist on proper declarations for both
9259         before using mbrtowc.
9260
9261 2001-02-17  Jim Meyering  <meyering@lucent.com>
9262
9263         * regex.c: Update from libc.
9264
9265 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9266
9267         * alloca.c (malloc): Undef before defining, since stdlib.h
9268         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9269         Reported by Mark Hounschell via Paul Eggert.
9270
9271 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9272
9273         * config.charset: Update for FreeBSD 4.2.
9274
9275 2001-01-26  Jim Meyering  <meyering@lucent.com>
9276
9277         * quotearg.c: Include stddef.h.
9278         * quote.c: Include stddef.h.
9279         Reported by Axel Kittenberger.
9280
9281         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9282         line in double quotes so that it evokes a better diagnostic.
9283         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9284         Reported by Axel Kittenberger.
9285
9286 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9287
9288         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9289         to avoid a warning.  Add back 'const' to inptr.
9290
9291 2001-01-16  Jim Meyering  <meyering@lucent.com>
9292
9293         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9294         From Bruno Haible.
9295
9296 2001-01-14  Jim Meyering  <meyering@lucent.com>
9297
9298         * rename.c: New file.  From Volker Borchert.
9299         Include stdlib.h, string.h or strings.h, and xalloc.h.
9300         Use strip_trailing_slashes rather than open-coding it.
9301
9302 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9303
9304         * strftime.c: Sync with glibc time/strftime.c 1.81.
9305
9306 2001-01-03  Jim Meyering  <meyering@lucent.com>
9307
9308         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9309         local `inptr' to avoid warning with some system declarations of iconv.
9310
9311 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9312
9313         * modechange.c: Do not assume that mode_t uses the
9314         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9315         the other-execute bit of FOO even if S_IXOTH != 1.
9316
9317         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9318         WOTH, XOTH, ALLM): New macros.
9319         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9320          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9321         Use them.
9322         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9323         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9324         (mode_compile):
9325         No need to use uintmax_t; unsigned long is long enough.
9326         Don't bother to get suffix since we don't use it.
9327
9328 2000-12-24  Jim Meyering  <meyering@lucent.com>
9329
9330         * hash.c (is_prime): Return explicit boolean values.
9331         (hash_get_first): Return NULL to appease Irix5.6's 89.
9332         Reported by Nelson Beebe.
9333
9334 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9335
9336         * localcharset.c (locale_charset): Add support for Win32.
9337
9338 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9339
9340         * physmem.h, physmem.c: New files.
9341
9342         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9343         (noinst_HEADERS): Add physmem.h.
9344
9345         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9346         't' for compatibility with Solaris 8 sort.
9347
9348 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9349
9350         * config.charset: Add support for BeOS.
9351
9352 2000-12-16  Jim Meyering  <meyering@lucent.com>
9353
9354         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9355         SHELLS_FILE to a file name that's useful on djgpp systems.
9356         Include stdlib.h.
9357         (ADDITIONAL_DEFAULT_SHELLS): Define.
9358         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9359         Based mostly on a patch from Prashant TR.
9360
9361 2000-12-16  Jim Meyering  <meyering@lucent.com>
9362
9363         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9364         N and M) would have treated it like `chown N:N FILE'.
9365
9366         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9367
9368 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9369
9370         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9371         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9372         to the list of canonical encodings. Rename EUC-CN to GB2312.
9373
9374 2000-12-08  Andreas Schwab  <schwab@suse.de>
9375
9376         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9377         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9378
9379 2000-12-07  Jim Meyering  <meyering@lucent.com>
9380
9381         * stripslash.c (ISSLASH): Define.
9382         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9383         From Prashant TR.
9384
9385         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9386         (dir_name_r): Declare this function as static.
9387         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9388         manifest itself on a name containing a mix of slashes and
9389         backslashes.
9390         Make this function work with names starting with a DOS-style
9391         drive letter and colon prefix.
9392         (dir_name): Append `.' if necessary.
9393         Based mostly on patches from Prashant TR and Eli Zaretskii.
9394
9395         * dirname.h (dir_name_r): Remove prototype.
9396
9397 2000-12-05  Jim Meyering  <meyering@lucent.com>
9398
9399         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9400
9401 2000-12-04  Jim Meyering  <meyering@lucent.com>
9402
9403         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9404         Also include memory.h, stdlib.h, unistd.h if appropriate.
9405         Reported by Andreas Jaeger (conflicting declaration of malloc).
9406
9407 2000-12-02  Jim Meyering  <meyering@lucent.com>
9408
9409         * closeout.h: Make idempotent, to avoid some obscure warnings.
9410
9411 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9412
9413         * memrchr.c: Include <config.h> before any system include file.
9414
9415 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9416
9417         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9418
9419 2000-11-26  Jim Meyering  <meyering@lucent.com>
9420
9421         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9422
9423 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9424
9425         * strftime.c (my_strftime): Do not invoke mbrlen with a
9426         size of (size_t) -1; it's not portable.
9427
9428 2000-11-17  Akim Demaille  <akim@epita.fr>
9429
9430         * obstack.h: Formatting changes.
9431         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9432         prevent type checking.
9433         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9434         cast the value to (void *): assigning a `foo *' to a `void *'
9435         variable is valid.
9436         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9437
9438 2000-11-17  Jim Meyering  <meyering@lucent.com>
9439
9440         * strstr.c: Update from GNU libc.
9441
9442 2000-11-16  Jim Meyering  <meyering@lucent.com>
9443
9444         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9445
9446 2000-11-11  Jim Meyering  <meyering@lucent.com>
9447
9448         * error.c: Add a couple #includes, merging from GNU libc version.
9449
9450 2000-11-10  Jim Meyering  <meyering@lucent.com>
9451
9452         * obstack.h: Update from GNU libc.
9453         * obstack.c: Likewise.
9454
9455 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9456
9457         * getusershell.c (setusershell): Use rewind rather than
9458         fseek/fseeko, to avoid configuration hassles with fseeko.
9459         Don't bother opening SHELLS_FILE if shellstream is NULL;
9460         it's not necessary.
9461
9462 2000-11-05  Jim Meyering  <meyering@lucent.com>
9463
9464         * makepath.h (make_dir): Declare.
9465         * makepath.c (make_dir): Remove `static' attribute.
9466         Tweak a comment.
9467
9468 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9469
9470         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9471         last one in a bucket, advance to the next bucket.
9472
9473 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9474
9475         * fnmatch.c: Do not comment out all the code if we are using
9476         the GNU C library, because in some cases we are replacing buggy
9477         code in the GNU C library itself.
9478
9479 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9480
9481         * error.h, getline.h, modechange.h:
9482         Remove "2000" from Copyright line, as the file hasn't been
9483         changed this year other than in the copyright notice.
9484
9485         * xalloc.h: Add "2000" to Copyright line, as this file
9486         was changed this year.
9487
9488 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9489
9490         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9491         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9492         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9493
9494 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9495
9496         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9497         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9498         doesn't define __restrict_arr.
9499
9500 2000-10-29  Jim Meyering  <meyering@lucent.com>
9501
9502         * xstat.in: Fix grammar in comment.
9503
9504 2000-10-28  Jim Meyering  <meyering@lucent.com>
9505
9506         * memchr.c: Update from libc.
9507         Adjust for portability:
9508         [HAVE_STDLIB_H]: Include stdlib.h.
9509         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9510         Undef __memchr, too.
9511         [!weak_alias]: Define __memchr to memchr.
9512
9513         * regex.c: Update from libc.
9514         * regex.h: Likewise.
9515         * getopt1.c: Likewise.
9516         * memcmp.c: Likewise.
9517
9518         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9519         Avoid using fseek, when possible -- it's broken by design.
9520         Patch by Ulrich Drepper.
9521
9522 2000-10-26  Jim Meyering  <meyering@lucent.com>
9523
9524         * strftime.c: Update from libc.
9525
9526 2000-10-25  Jim Meyering  <meyering@lucent.com>
9527
9528         * obstack.c: Update from libc.
9529
9530 2000-10-23  Jim Meyering  <meyering@lucent.com>
9531
9532         * hard-locale.c (hard_locale): Revert last change -- it was simply
9533         wrong.  That set_locale call must not have any side effects.
9534         From Paul Eggert.
9535
9536 2000-10-22  Jim Meyering  <meyering@lucent.com>
9537
9538         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9539         [CYCLIC]: Remove now-unused definition.
9540
9541         * save-cwd.c (O_DIRECTORY): Define, if needed.
9542         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9543         Suggestion from Ulrich Drepper.
9544
9545 2000-10-21  Jim Meyering  <meyering@lucent.com>
9546
9547         * dirname.c (dir_name_r): New function, factored out of dir_name.
9548         (dir_name): Use dir_name_r.
9549         * dirname.h (dir_name_r): Declare it.
9550
9551 2000-10-21  Jim Meyering  <meyering@lucent.com>
9552
9553         * dirname.c (memrchr): Declare if necessary.
9554         (dir_name): Remove the restriction that there be no
9555         trailing slashes.  Now, this code skips past them, effectively
9556         ignoring them.
9557         [TEST_DIRNAME] (main): New unit tests.
9558
9559         * memrchr.c: New file from GNU libc.
9560         Undef __memrchr, too.
9561         [!weak_alias]: Define __memrchr to memrchr.
9562         Guard weak_alias use with `#ifdef weak_alias'.
9563
9564 2000-10-17  Jim Meyering  <meyering@lucent.com>
9565
9566         * quote.h (PARAMS): Define and use.
9567         Reported by Akim Demaille.
9568
9569         * getopt.c: Update from libc.
9570
9571 2000-10-16  Jim Meyering  <meyering@lucent.com>
9572
9573         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9574         From Jan Fedak.
9575
9576 2000-09-25  Jim Meyering  <meyering@lucent.com>
9577
9578         * md5.h (rol): Define (from GnuPG).
9579
9580         * sha.c: Give credit (GnuPG) where due.
9581         (M): Use rol rather than open-coding it.
9582         Add a FIXME comment.
9583
9584 2000-09-21  Jim Meyering  <meyering@lucent.com>
9585
9586         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9587         Reported by Michael Stone.
9588
9589 2000-09-20  Jim Meyering  <meyering@lucent.com>
9590
9591         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9592         (noinst_HEADERS): Add sha.h.
9593         Based on code from Scott G. Miller and from GnuPG.
9594
9595 2000-09-15  Jim Meyering  <meyering@lucent.com>
9596
9597         * regex.c: Update from libc.
9598
9599 2000-09-10  Jim Meyering  <meyering@lucent.com>
9600
9601         * getopt.c (_getopt_internal): Update from glibc.
9602
9603 2000-09-09  Jim Meyering  <meyering@lucent.com>
9604
9605         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9606         think it should be used as a general replacement for isascii.
9607         * fnmatch.c: Likewise.
9608         * mbswidth.c: Likewise
9609         * regex.c: Likewise.
9610
9611         Don't use atoi.
9612         * userspec.c: Include sys/param.h and limits.h.
9613         Include xstrtol.h.
9614         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9615         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9616         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9617         UID, GID.  Check range.
9618
9619 2000-09-06  Jim Meyering  <meyering@lucent.com>
9620
9621         * getopt.c (_getopt_internal): Update from glibc.
9622
9623 2000-08-30  Jim Meyering  <meyering@lucent.com>
9624
9625         * strftime.c: Merge in changes from GNU libc.
9626
9627 2000-08-26  Jim Meyering  <meyering@lucent.com>
9628
9629         * closeout.c: Include "__fpending.h".
9630         (close_stdout_status): Return right away if there's nothing to flush.
9631
9632         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9633         * __fpending.c: New file.
9634         * __fpending.h: New file.
9635
9636 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9637
9638         Standardize on "memory exhausted" instead of "Memory exhausted"
9639         or "virtual memory exhausted".
9640         * obstack.c (print_and_abort): Use "memory exhausted", not
9641         "virtual memory exhausted".
9642         * same.c (same_name): Invoke xalloc_die instead of printing
9643         our own message.
9644         * userspec.c (parse_user_spec): Likewise.
9645         * bumpalloc.h: comment fix
9646         * same.c, userspec.c: Include xalloc.h.
9647
9648         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9649         not char *const and pointing to a constant array.
9650         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9651         (xrealloc): Comment fix.
9652
9653         * userspec.c (parse_user_spec):
9654         Don't translate a message until just before returning,
9655         to avoid unnecessary translation.
9656
9657 2000-08-07  Jim Meyering  <meyering@lucent.com>
9658
9659         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9660         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9661         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9662         getgroups.c, gethostname.c, getopt.h, group-member.c,
9663         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9664         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9665         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9666         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9667         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9668         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9669         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9670         yesno.c: Back out Copyright date changes for each file with no change
9671         this year.  This eases coordination with other programs using the same
9672         source code modules.  From Paul Eggert.
9673
9674 2000-08-03  Greg McGary  <greg@mcgary.org>
9675
9676         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9677         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9678         (EXTEND_BUFFER): Use them.
9679
9680 2000-08-01  Jim Meyering  <meyering@lucent.com>
9681
9682         * dirname.c (ISSLASH): Define.
9683         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9684         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9685         both `\' and `/' may be use as path separators.
9686         Based on a patch from Prashant TR.
9687
9688 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9689
9690         * quotearg.c (quotearg_n_options): Don't make the initial
9691         slot vector a constant, since it might get modified.
9692
9693 2000-07-31  Jim Meyering  <meyering@lucent.com>
9694
9695         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9696         * obstack.c (print_and_abort): Likewise.
9697
9698 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9699
9700         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9701         buffer, so that the caller can always quote one small
9702         component of a "memory exhausted" message in slot 0.
9703         From a suggestion by Jim Meyering.
9704
9705 2000-07-30  Jim Meyering  <meyering@lucent.com>
9706
9707         * makepath.c (make_path): Quote the other instance, too.
9708
9709         * quotearg.c (N_STATIC_SLOTVECS): Define.
9710         (STATIC_BUF_SIZE): Define.
9711         (quotearg_n_options): Use only statically allocated storage when
9712         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9713         than STATIC_BUF_SIZE.
9714
9715 2000-07-29  Jim Meyering  <meyering@lucent.com>
9716
9717         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9718         * dirname.c (dir_name): Likewise.
9719
9720         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9721
9722         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9723         (dir_name): Assert that there are no trailing slashes.
9724
9725 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9726
9727         * mbswidth.h (mbswidth): Add a flags argument.
9728         (mbswidth): New declaration.
9729         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9730         * mbswidth.c (mbswidth): Add a flags argument.
9731         (mbsnwidth): New function.
9732
9733 2000-07-24  Jim Meyering  <meyering@lucent.com>
9734
9735         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9736
9737 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9738
9739         * mbswidth.c (_XOPEN_SOURCE):
9740         Don't define; this causes problems on Solaris 7.
9741         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9742
9743 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9744
9745         * quotearg.c:
9746         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9747         so that mbstate_t is always defined.
9748
9749         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9750         be 1 in at least one GCC installation, and this configuration
9751         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9752         performance on hosts that have mbrtowc but have only unibyte
9753         locales, but I assume these hosts are rare.
9754
9755 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9756
9757         * quotearg.c: Streamline by invoking multibyte code only if needed.
9758         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9759         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9760         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9761         invoke multibyte primitives.
9762
9763 2000-07-23  Jim Meyering  <meyering@lucent.com>
9764
9765         * basename.c (base_name): Add an assertion.
9766
9767 2000-07-15  Bruno Haible  <clisp.cons.org>
9768
9769         * quotearg.c: When the system forces us to redefine mbstate_t,
9770         shadow its mbsinit function.
9771
9772 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9773
9774         * mbswidth.h: New file.
9775         * mbswidth.c: New file.
9776         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9777         (noinst_HEADERS): Add mbswidth.h.
9778
9779 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9780
9781         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9782         and IRIX 6.
9783
9784 2000-07-15  Jim Meyering  <meyering@lucent.com>
9785
9786         * makepath.c: Include quote.h.
9787         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9788         corresponding argument in a `quote (...)' call.
9789         Give better diagnostics.
9790
9791         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9792         (noinst_HEADERS): Add quote.h.
9793
9794         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9795         from tar's src/misc.c.
9796         * quote.h: New file.  Prototypes for same.
9797
9798 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9799
9800         From a suggestion by Bruno Haible.
9801         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9802         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9803         to decide whether to define the BeOS workaround macro;
9804         this adjusts to the change to AC_MBSTATE_T.
9805
9806 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9807
9808         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9809
9810         * quotearg.c (quoting_style_args, quoting_style_vals,
9811         quotearg_buffer_restyled): Add support for
9812         clocale_quoting_style.  Undo previous change to
9813         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9814         and "{RIGHT QUOTATION MARK}" msgids.
9815
9816 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9817
9818         The old behavior of quoting `like this' doesn't look good with
9819         newer, ISO-style fonts.  See:
9820         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9821
9822         Instead, quote "like this" by default.  Let the translator
9823         tailor the locale-specific quoting behavior by providing
9824         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9825
9826         * quotearg.c (N_): New macro.
9827         (gettext_default): New function.
9828         (quotearg_buffer_restyled): Use
9829         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9830         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9831
9832 2000-07-09  Jim Meyering  <meyering@lucent.com>
9833
9834         * Most files: Update copyright dates to include 2000.
9835
9836 2000-07-08  Jim Meyering  <meyering@lucent.com>
9837
9838         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9839         if not defined.
9840         (xgethostname): Remove now-unnecessary #ifdef.
9841         Move declaration of `err' into loop where it's used.
9842
9843 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9844
9845         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9846         by allocating a larger buffer. Test the gethostname return value for
9847         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9848         returns an error and ENAMETOOLONG isn't defined.
9849
9850 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9851         and Bruno Haible  <haible@clisp.cons.org>
9852
9853         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9854
9855 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9856
9857         * quotearg.c (struct quoting_options): Simplify quote_these_too
9858         dimension.
9859
9860 2000-07-03  Jim Meyering  <meyering@lucent.com>
9861
9862         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9863         Reported by Bruno Haible.
9864
9865 2000-07-04  Jim Meyering  <meyering@lucent.com>
9866
9867         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9868         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9869         lacks mbrtowc.
9870
9871 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9872         and Bruno Haible  <haible@clisp.cons.org>
9873
9874         * quotearg.c (mbrtowc):
9875         Assign to *pwc, and return 1 only if result is nonzero.
9876         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9877
9878 2000-07-03  Jim Meyering  <meyering@lucent.com>
9879
9880         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9881         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9882         From Bob Proulx.
9883
9884 2000-07-02  Jim Meyering  <meyering@lucent.com>
9885
9886         * quotearg.c (mbstate_t): Don't define here.
9887
9888 2000-07-02  Jim Meyering  <meyering@lucent.com>
9889
9890         * nanosleep.c (SIGCONT): Define if not already defined.
9891
9892 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9893
9894         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9895         per change in ../m4/ls-mntd-fs.m4.
9896         (read_filesystem_list): Ignore symbolic links.
9897
9898 2000-06-29  Jim Meyering  <meyering@lucent.com>
9899
9900         * same.c: Include <string.h> or <strings.h>, as appropriate,
9901         for declaration of strcmp.
9902
9903         * long-options.c: Include <stdlib.h>, for declaration of exit.
9904
9905         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9906         Avoid warning by casting result to `char *' to remove `const'.
9907
9908 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9909
9910         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9911
9912 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9913
9914         savedir now sets errno on failure and invokes xmalloc to get memory.
9915         Fix a couple of other minor bugs while we're at it.
9916
9917         * savedir.c (<unistd.h>): Do not include; there's no need.
9918         (NAMLEN): Remove macro.
9919         (malloc, realloc): Remove decls.
9920         (stpcpy): Likewise.
9921         ("xalloc.h"): Include.
9922         (NAME_SIZE_DEFAULT): New macro.
9923         (savedir): Use xmalloc / xrealloc to allocate memory.
9924         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9925         Skip "" directory entries.
9926         Use strlen to calculate directory entry length, since the old method
9927         is rarely used these days and isn't worth supporting.
9928         Don't use a pointer after freeing it.
9929         Check for integer overflow when calculating allocation size.
9930         Use memcpy to copy entries, instead of stpcpy.
9931         Set errno properly when returning NULL.
9932         Check for readdir error.
9933
9934 2000-06-26  Jim Meyering  <meyering@lucent.com>
9935
9936         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9937
9938 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9939
9940         * getusershell.c (xmalloc, xrealloc): Remove functions.
9941         Include xalloc.h.
9942         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9943
9944 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9945
9946         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9947
9948 2000-06-24  Jim Meyering  <meyering@lucent.com>
9949
9950         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9951
9952 2000-06-21  Jim Meyering  <meyering@lucent.com>
9953
9954         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9955
9956 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9957
9958         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9959         (mbrtowc, mbstate_t): Define substitutes if
9960         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9961         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9962         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9963
9964 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9965
9966         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9967         than 1024, return a memory chunk of least possible size, instead
9968         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9969         Use free/xmalloc instead of xrealloc to avoid copying for very long
9970         paths.
9971
9972 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9973
9974         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9975         address, not strdup.  Include <stdlib.h> and don't declare free().
9976
9977 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9978
9979         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9980         the empty string.
9981
9982 2000-06-21  Jim Meyering  <meyering@lucent.com>
9983
9984         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9985         (noinst_HEADERS): Add getstr.h.
9986
9987         * getline.c (getstr): Move into a separate file.
9988         * getstr.c (getstr): New file, extracted from getline.c, with
9989         the following changes: new parameter, delim2; both delim[12]
9990         parameters have type `int', not `char'.  The latter would lose
9991         with 8-bit delimiters.
9992         * getstr.h: New file.
9993
9994 2000-06-19  Jim Meyering  <meyering@lucent.com>
9995
9996         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9997
9998 2000-06-18  Jim Meyering  <meyering@lucent.com>
9999
10000         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10001         Besides, these days every porting target provides a mkdir function.
10002
10003         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10004         (this snippet comes from src/system.h).
10005
10006 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10007
10008         * human.c (adjust_value): New function.
10009         (human_readable_inexact): Apply rounding style even when
10010         printing approximate values.
10011
10012 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10013
10014         * human.c (human_readable_inexact): Allow an input block
10015         size that is not a multiple of the output block size, and vice versa.
10016         Reported by Piergiorgio Sartor.
10017
10018 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10019
10020         * getdate.y (get_date): Apply relative times after time
10021         zone indicator, not before.  Reported by Todd A. Jacobs.
10022
10023 2000-06-13  Jim Meyering  <meyering@lucent.com>
10024
10025         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10026
10027         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10028
10029 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10030
10031         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10032
10033 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10034
10035         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10036
10037 2000-06-04  Jim Meyering  <meyering@lucent.com>
10038
10039         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10040         SunOS 4.1.4 for which gid_t is an unsigned type.
10041
10042 2000-06-03  Jim Meyering  <meyering@lucent.com>
10043
10044         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10045
10046 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10047
10048         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10049         newer, don't install charset.alias.
10050         * config.charset: Change the Linux/glibc rules so they become empty
10051         on glibc-2.1 or newer.
10052
10053 2000-06-02  Jim Meyering  <meyering@lucent.com>
10054
10055         * mountlist.c: Back out last change.  Instead, do this...
10056         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10057         member using the same `ignore'-testing code.
10058         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10059         fs_type strings.
10060         From Mark D. Roth.
10061
10062 2000-05-29  Jim Meyering  <meyering@lucent.com>
10063
10064         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10065         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10066
10067 2000-05-22  Jim Meyering  <meyering@lucent.com>
10068
10069         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10070
10071 2000-05-18  Jim Meyering  <meyering@lucent.com>
10072
10073         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10074         back, too, since it may have been modified by allocate_entry.
10075         (hash_delete): Rewrite to use neither the assignment operator
10076         nor the comma operator in an if-expression.
10077
10078 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10079
10080         * closeout.c:
10081         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10082         Remove; no longer needed.
10083         "quotearg.h": Add include.
10084         (file_name): Do not bother to explicitly initialize to NULL; it's less
10085         efficient on some hosts.
10086         (close_stdout_status): Remove test as to whether stdout was already
10087         closed; it breaks for the case "echo x | sort >&-".
10088         Quote file name colons.
10089         Do not assume that _("write error") lacks format strings.
10090
10091 2000-05-15  Jim Meyering  <meyering@lucent.com>
10092
10093         * version-etc.c (version_etc_copyright): Update the copyright string
10094         used in all --version output.
10095
10096 2000-05-14  Jim Meyering  <meyering@lucent.com>
10097
10098         * closeout.c (close_stdout_set_file_name): New function.
10099         (close_stdout_status): Use new file-scoped global.
10100         Return right away if fstat says the stdout file descriptor is invalid.
10101         * closeout.h (close_stdout_set_file_name): Declare.
10102
10103 2000-05-10  Jim Meyering  <meyering@lucent.com>
10104
10105         * closeout.c [default_exit_status]: New file-scoped variable.
10106         (close_stdout_set_status): New function.
10107         * closeout.h (close_stdout_set_status): Declare.
10108
10109 2000-05-08  Jim Meyering  <meyering@lucent.com>
10110
10111         * long-options.c: Don't include closeout.h.
10112         (parse_long_options): Don't call close_stdout for --version.
10113
10114 2000-05-06  Jim Meyering  <meyering@lucent.com>
10115
10116         * strnlen.c: Undefine __strnlen and strnlen.
10117         [!weak_alias]: Define __strnlen to strnlen.
10118
10119         * atexit.c: New file, from libiberty.
10120
10121 2000-05-06  Jim Meyering  <meyering@lucent.com>
10122
10123         * closeout.c (close_stdout_status): Also check for errors on the
10124         stderr stream.
10125
10126 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10127
10128         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10129         instead of xmalloc, xrealloc, path_concat.
10130         (locale_charset): Treat empty environment variables as absent.
10131         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10132
10133 2000-05-04  Jim Meyering  <meyering@lucent.com>
10134
10135         * getopt.c: Update from glibc.
10136         * obstack.c: Likewise.
10137         * obstack.h: Likewise.
10138         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10139
10140         * regex.h: Likewise.
10141         * strndup.c: Likewise.
10142         * strnlen.c: New file, from glibc.
10143
10144 2000-05-01  Jim Meyering  <meyering@lucent.com>
10145
10146         * full-write.c (full_write): Remove `FIXME' part of comment.
10147
10148 2000-04-29  Jim Meyering  <meyering@lucent.com>
10149
10150         * path-concat.c: Declare strdup only if it's not defined.
10151         * canon-host.c: Likewise.
10152
10153 2000-04-28  Jim Meyering  <meyering@lucent.com>
10154
10155         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10156         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10157         included first, then limits.h is included by locale.h by libintl.h.
10158         From John David Anglin.
10159
10160 2000-04-25  Jim Meyering  <meyering@lucent.com>
10161
10162         * makepath.c (S_IRWXUGO): Define.
10163         (make_path): Always perform explicit chmod if MODE specifies any
10164         of the `special' permission bits.  Prompted by a bug report against
10165         install from Mate Wierdl and Joost van Baal.
10166
10167 2000-04-18  Jim Meyering  <meyering@lucent.com>
10168
10169         * README: New file.
10170
10171         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10172         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10173
10174 2000-04-17  Jim Meyering  <meyering@lucent.com>
10175
10176         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10177         the definition of it to rpl_strftime also defined-away the system's
10178         declaration.
10179
10180 2000-04-15  Jim Meyering  <meyering@lucent.com>
10181
10182         Use `C' to denote so-called `contiguous' files, the same way
10183         that tar does.
10184         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10185         (ftypelet): Use S_ISCTG.
10186         From Michael Deutschmann.
10187
10188 2000-04-14  Jim Meyering  <meyering@lucent.com>
10189
10190         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10191
10192 2000-04-08  Jim Meyering  <meyering@lucent.com>
10193
10194         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10195         names don't conflict.  Reported by Eli Zaretskii.
10196
10197 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10198
10199         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10200         bug.  Deal with the different error behavior of Irix iconv.
10201
10202 2000-04-07  Jim Meyering  <meyering@lucent.com>
10203
10204         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10205         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10206
10207 2000-04-05  Jim Meyering  <meyering@lucent.com>
10208
10209         Portability tweaks required for ultrix4.3.
10210         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10211         * readutmp.c: Include sys/types.h before sys/stat.h.
10212         * canon-host.c: Declare strdup.
10213         * path-concat.c: Likewise.
10214         From John David Anglin.
10215
10216 2000-04-04  Jim Meyering  <meyering@lucent.com>
10217
10218         Be more DOS 8.3-friendly.
10219         * ref-add.sin: Renamed from ref-add.sed.in.
10220         * ref-del.sin: Renamed from ref-del.sed.in.
10221         * Makefile.am: Reflect renaming.
10222         Reported by Eli Zaretskii.
10223
10224         Use a temporary file name that won't clash with `charset.alias'
10225         in the DOS 8.3 name space.
10226         * Makefile.am (charset_tmp): Define.
10227         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10228         (uninstall-local): Likewise.
10229         Reported by Eli Zaretskii.
10230
10231 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10232
10233         * time/strftime.c (my_strftime): Make sure we call the system
10234         strftime, not ourselves, when invoking the underlying strftime.
10235
10236 2000-03-24  Jim Meyering  <meyering@lucent.com>
10237
10238         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10239         (charset_alias): Define.
10240         (install-exec-local): Factor out common code.
10241         (uninstall-local): Split lines longer than 80.
10242         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10243         (SUFFIXES): Define.
10244         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10245         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10246
10247 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10248
10249         * config.charset: Output a line containing "Packages using this file".
10250         * ref-add.sed.in, ref-del.sed.in: New files.
10251         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10252         ref-del.sed): New rules.
10253
10254 2000-03-17  Jim Meyering  <meyering@lucent.com>
10255
10256         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10257         Otherwise, include <strings.h>
10258
10259 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10260
10261         * unicodeio.c (utf8_wctomb): New function.
10262         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10263         format instead of in UCS-4 with platform dependent endianness.
10264
10265 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10266
10267         * savedir.c (savedir): Work even if directory size is
10268         negative; this can happen with some screwy NFS configurations.
10269
10270 2000-03-06  Jim Meyering  <meyering@lucent.com>
10271
10272         * localcharset.c (get_charset_aliases): Don't try to free file_name
10273         if it's NULL (because we ran out of memory).  From Bruno Haible.
10274
10275 2000-03-05  Jim Meyering  <meyering@lucent.com>
10276
10277         * localcharset.c ("path-concat.h"): Include.
10278         (get_charset_aliases): Use path_concat instead of ANSI string
10279         concatenation.
10280
10281         * unicodeio.h (PARAMS): Define.
10282         Use it to guard prototype.
10283
10284 2000-03-04  Jim Meyering  <meyering@lucent.com>
10285
10286         * Makefile.am (install-exec-local): Create $(libdir) before installing
10287         into it.
10288         (uninstall-local): Uncomment this rule so `make distcheck' works
10289         once again.
10290
10291         * unicodeio.c (<errno.h>): Include it.
10292         (errno): Declare if not defined.
10293
10294         * localcharset.c: Add Bruno's comment justifying use of volatile.
10295
10296         * config.charset: New version, incorporating remarks from a linux
10297         i18n mailing list.  From Bruno Haible.
10298
10299 2000-03-02  Jim Meyering  <meyering@lucent.com>
10300
10301         * Makefile.am (EXTRA_DIST): Add config.charset.
10302
10303 2000-03-01  Jim Meyering  <meyering@lucent.com>
10304
10305         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10306         * unicodeio.c: Likewise.
10307
10308 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10309
10310         * config.charset: New file.
10311         * localcharset.c: New file.
10312         * unicodeio.h, unicodeio.c: New files.
10313         * Makefile.am (DEFS): Add -DLIBDIR=...
10314         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10315         (noinst_HEADERS): Add unicodeio.h.
10316         (all-local, install-exec-local, charset.alias): New targets.
10317
10318 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10319
10320         * quotearg.c (ALERT_CHAR): New macro.
10321         (quotearg_buffer_restyled): Use it.
10322
10323 2000-02-27  Jim Meyering  <meyering@lucent.com>
10324
10325         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10326         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10327
10328         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10329         not `#if STDC_HEADERS'.
10330         Declare malloc if needed.
10331
10332         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10333         now that autoconf always defines the HAVE_DECL_ symbols.
10334         * human.c: Likewise.
10335         * same.c: Likewise.
10336         * strtoumax.c: Likewise.
10337
10338         * backupfile.c: Arrange for cpp to fail if the configure-time
10339         declaration check was not run.
10340         * hash.c: Likewise.
10341         * human.c: Likewise.
10342         * same.c: Likewise.
10343         * strtoumax.c: Likewise.
10344
10345         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10346         then first look up the entire `.'-containing string as a login name.
10347
10348 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10349
10350         * getdate.y: Handle two-digit years with leading zeros correctly.
10351         (textint): New typedef.
10352         (parser_control): Member year changed from int to textint.
10353         All uses changed.
10354         (YYSTYPE): Removed; replaced by %union with int and textint members.
10355         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10356         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10357         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10358         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10359         (date, number, to_year): Use width of number in digits, not its value,
10360         to determine whether it's a 2-digit year, or a 2-digit time.
10361         (yylex): Store number of digits of numeric tokens.
10362         Reported by John Kendall.
10363
10364         (parser_control): Changed from struct parser_control to typedef (for
10365         consistency).  All uses changed.
10366
10367         (tID): Removed; not used.
10368         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10369
10370 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10371
10372         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10373         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10374
10375 2000-02-12  Jim Meyering  <meyering@lucent.com>
10376
10377         * userspec.c (ISDIGIT): Define it.
10378         (isdigit): Remove definition.
10379         (is_number): Use ISDIGIT, not isdigit.
10380         <libintl.h>: Include.
10381         (_ and N_): Define.
10382         (parse_user_spec): Mark translatable strings.
10383
10384 2000-02-10  Jim Meyering  <meyering@lucent.com>
10385
10386         With these changes, nanosleep.[ch] are finally enough like the other
10387         lib/* replacement files to compile on a few more losing systems.
10388
10389         * nanosleep.h: Don't include config.h.
10390         Remove prototype from declaration of nanosleep.
10391         (PARAMS): Remove now-unneeded definition.
10392         * nanosleep.c: #undef nanosleep.
10393         (rpl_nanosleep): Rename from nanosleep.
10394
10395 2000-02-03  Jim Meyering  <meyering@lucent.com>
10396
10397         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10398         rather than with `#if HAVE_UTMPNAME'.
10399
10400 2000-02-01  Jim Meyering  <meyering@lucent.com>
10401
10402         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10403
10404 2000-01-31  Jim Meyering  <meyering@lucent.com>
10405
10406         * nanosleep.h (nanosleep): Guard declaration with
10407         `#if ! HAVE_DECL_NANOSLEEP'.
10408         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10409         the declaration in that vendor's sys/timers.h.
10410         Reported by Christian Krackowizer.
10411
10412         * quotearg.c (ISASCII): Add #undef and move definition to follow
10413         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10414         (ISPRINT): Likewise.
10415         Reported by Tom Tromey.
10416
10417 2000-01-30  Jim Meyering  <meyering@lucent.com>
10418
10419         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10420         uses of ->ut_name.  The latter doesn't work with new Linux header files
10421         where only utmpx.ut_user is declared.
10422
10423         * readutmp.h (UT_USER): Define.
10424
10425 2000-01-23  Jim Meyering  <meyering@lucent.com>
10426
10427         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10428         obstack.c.
10429
10430 2000-01-22  Jim Meyering  <meyering@lucent.com>
10431
10432         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10433         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10434         Required for some AIX systems.  Reported by Christian Krackowizer.
10435         [TESTING] (main): New function.
10436
10437         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10438         * dirname.c (dir_name): Support for DOS-style file names with drive
10439         letters.
10440
10441         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10442
10443         * strverscmp.c (ISDIGIT): Define.
10444         (strverscmp): Use ISDIGIT, not isdigit.
10445
10446 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10447
10448         * nanosleep.c (nanosleep):
10449         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10450         POSIX.1 doesn't require SA_INTERRUPT and some systems
10451         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10452         it's been part of POSIX.1 since day 1 (in 1988).
10453
10454 2000-01-17  Jim Meyering  <meyering@lucent.com>
10455
10456         * interlock: Remove unused file.  Reported by François Pinard.
10457
10458 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10459
10460         * quotearg.c (quotearg_buffer_restyled): Do not quote
10461         alert, backslash, formfeed, and vertical tab unnecessarily in
10462         shell quoting style.
10463
10464
10465 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10466 Free Software Foundation, Inc.
10467 Copying and distribution of this file, with or without modification,
10468 are permitted provided the copyright notice and this notice are preserved.