32cd7675985d76bb763cc4fccdf793ece6bd6a95
[gnulib.git] / lib / ChangeLog
1 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * TODO: Remove; this belongs only in coreutils.
4
5 2006-08-14  Eric Blake  <ebb9@byu.net>
6
7         Import the following change from libc:
8
9         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
10
11         Upstream bug 2997.
12         * misc/error.c: Add space between program name and message if file
13         name is missing.
14
15 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
16
17         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
18         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
19
20         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
21         in wchar_t.  Problem reported by Eric Blake.
22
23         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
24         LEN is smaller than SIZE.  Suggested by Bruno Haible.
25         Also, help the compiler to keep LEN in a register.
26
27 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
28
29         * .cppi-disable: Add snprintf.h, socket_.h.
30         * snprintf.c: Include <errno.h> and <limits.h>.
31         (EOVERFLOW): Define if the system does not.
32         Do not include "minmax.h"; it wasn't used.
33         (snprintf): Don't assume size_t promotes to an unsigned type.
34         Fix bug when generated string was too long for the buffer: the
35         buffer's contents are supposed to be the initial prefix of the
36         output.  Don't assume vasnprintf returns EOVERFLOW if the size
37         exceeds INT_MAX; do the check ourselves.
38
39         Import the following changes from libc:
40
41         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
42
43         * posix/regex_internal.c (re_string_skip_chars): If no character has
44         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
45         to the byte which couldn't be converted.
46         (re_string_reconstruct): Don't clear valid_raw_len before calling
47         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
48         tip_context using re_string_context_at.
49
50         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
51
52         * posix/regex.h: g++ still cannot handled [restrict].
53
54         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
55
56         * posix/regex.h: Remove special handling for VMS.
57
58 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
59
60         Sync from coreutils.
61
62         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
63
64         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
65         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
66
67 2006-08-08  Eric Blake  <ebb9@byu.net>
68
69         * verror.c (verror_at_line): Work around glibc bug 2997, so that
70         verror_at_line output complies with GNU Coding Standards even when
71         file is NULL.
72
73 2006-08-08  Eric Blake  <ebb9@byu.net>
74
75         * verror.h, verror.c: New files.
76
77 2006-08-07  Bruno Haible  <bruno@clisp.org>
78
79         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
80         versions of AIX.
81         Reported by Ralf Wildenhues.
82
83 2006-08-06  Eric Blake  <ebb9@byu.net>
84
85         * error.h: Fold in some upstream changes from glibc.
86         * error.c: Likewise.
87
88 2006-07-29  Bruno Haible  <bruno@clisp.org>
89
90         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
91
92 2006-07-29  Bruno Haible  <bruno@clisp.org>
93
94         * setenv.c: Undo unintended modification done on 2006-02-27.
95
96 2006-07-28  Eric Blake  <ebb9@byu.net>
97
98         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
99         macro expansion.
100
101 2006-07-28  Simon Josefsson  <jas@extundo.com>
102
103         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
104         #include's.
105
106 2006-07-28  Simon Josefsson  <jas@extundo.com>
107
108         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
109         #include's.
110
111 2006-07-28  Bruno Haible <bruno@clisp.org>
112
113         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
114
115 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
116
117         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
118         arpa/inet.h.
119
120 2006-07-28  Bruno Haible  <bruno@clisp.org>
121
122         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
123         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
124         fallbacks.
125         Avoids link error on FreeBSD 4.x.
126         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
127
128         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
129         encoding.
130         * mbswidth.c (iswcntrl): Likewise.
131
132 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
133
134         * modechange.c (mode_compile): Numeric modes now affect setuid and
135         setgid on directories only if they set these bits.
136         * modechange.h: Remove obsolete comment about masks.
137
138 2006-07-27  Bruno Haible  <bruno@clisp.org>
139
140         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
141         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
142         defined.
143
144 2006-07-26  Eric Blake  <ebb9@byu.net>
145
146         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
147         like mingw that lack mkstemp.
148         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
149         avoid compilation warning on mingw.
150
151 2006-07-25  Bruno Haible  <bruno@clisp.org>
152
153         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
154         <stdarg.h> or config.h.
155
156 2006-07-24  Bruno Haible  <bruno@clisp.org>
157
158         * clean-temp.h: New file, from GNU gettext.
159         * clean-temp.c: New file, from GNU gettext.
160
161 2006-07-24  Bruno Haible  <bruno@clisp.org>
162
163         * tmpdir.h: New file, from GNU gettext.
164         * tmpdir.c: New file, from GNU gettext.
165
166 2006-07-23  Bruno Haible  <bruno@clisp.org>
167
168         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
169         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
170         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
171         gl_linked_remove_at): Use it.
172
173 2006-07-23  Eric Blake  <ebb9@byu.net>
174
175         * tmpfile-safer.c: New file.
176         * stdio-safer.h (fopen_safer): Add prototype.
177         * stdio--.h (tmpfile): Make safer.
178
179 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
180
181         * close-stream.c, close-stream.h: New files.
182
183 2006-07-22  Bruno Haible  <bruno@clisp.org>
184
185         Merge from GNU gettext 0.15.
186
187         2005-07-05  Bruno Haible  <bruno@clisp.org>
188
189                 * printf-args.c (printf_fetchargs): Work around broken
190                 definition of wint_t on mingw.
191
192         2005-02-12  Bruno Haible  <bruno@clisp.org>
193
194                 * xallocsa.h: Add extern "C" for C++.
195
196         2006-05-17  Bruno Haible  <bruno@clisp.org>
197
198                 Cygwin portability.
199                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
200
201         2006-04-30  Bruno Haible  <bruno@clisp.org>
202
203                 * progreloc.c: Include <mach-o/dyld.h> if available.
204                 (find_executable): Use _NSGetExecutablePath when possible.
205
206         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
207
208                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
209                 function.
210
211         2005-12-29  Bruno Haible  <bruno@clisp.org>
212
213                 * progreloc.c (set_program_name_and_installdir): Fix
214                 compilation error.
215
216         2005-12-04  Bruno Haible  <bruno@clisp.org>
217
218                 Cygwin portability.
219                 * progreloc.c: Include <windows.h> also on Cygwin.
220                 (find_executable): Add support for Cygwin.
221                 (set_program_name_and_installdir): Handle also platforms with
222                 nonempty EXEEXT.
223
224         2006-07-11  Bruno Haible  <bruno@clisp.org>
225
226                 * javacomp.c: Fix a comment.
227                 Reported by Jim Meyering.
228
229         2006-04-30  Bruno Haible  <bruno@clisp.org>
230
231                 * javacomp.h (compile_java_class): Add source_version,
232                 target_version arguments.
233                 * javacomp.c: Rewritten to choose only a compiler that
234                 respects the specified source_version and target_version.
235
236         2006-06-27  Bruno Haible  <bruno@clisp.org>
237
238                 Assume correct S_ISDIR macro.
239                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
240
241         2006-07-22  Bruno Haible  <bruno@clisp.org>
242
243                 * javaversion.h: New file, from GNU gettext.
244                 * javaversion.c: New file, from GNU gettext.
245                 * javaversion.java: New file, from GNU gettext.
246                 * javaversion.class: New file, from GNU gettext.
247
248         2006-05-17  Bruno Haible  <bruno@clisp.org>
249
250                 Cygwin portability.
251                 * javaexec.c (execute_java_class): Test for jview program
252                 also on Cygwin.
253
254         2006-04-09  Bruno Haible  <bruno@clisp.org>
255
256                 * fatal-signal.c: Don't include string.h.
257                 (at_fatal_signal): Use a copying loop instead of memcpy.
258
259         2005-12-04  Bruno Haible  <bruno@clisp.org>
260
261                 * csharpexec.c: Add support for 'clix' launcher (untested).
262                 (execute_csharp_using_sscli): New function.
263                 (execute_csharp_program): Call it.
264
265         2006-06-21  Bruno Haible  <bruno@clisp.org>
266
267                 Avoid warnings from recent versions of mcs.
268                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
269                 -o, -L, -r any more. Use options documented since mcs-1.0
270                 instead. Similarly for -g.
271
272         2005-07-09  Bruno Haible  <bruno@clisp.org>
273
274                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
275                 add a .dll suffix.
276                 Reported by Mark Junker <mjscod@gmx.de>.
277
278         2006-06-17  Bruno Haible  <bruno@clisp.org>
279
280                 * config.charset: Update for NetBSD 3.0.
281
282         2006-05-17  Bruno Haible  <bruno@clisp.org>
283
284                 Cygwin portability.
285                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
286
287         2006-05-16  Bruno Haible  <bruno@clisp.org>
288
289                 * localcharset.c [CYGWIN]: Include <windows.h>.
290                 (get_charset_aliases): For Cygwin, return the same CPxxx
291                 aliases list as under WIN32.
292                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
293                 the environment variables. Fall back to GetACP().
294
295         2006-04-05  Bruno Haible  <bruno@clisp.org>
296
297                 * config.charset: Update Juan Manuel Guerrero's address.
298
299         2005-02-12  Bruno Haible  <bruno@clisp.org>
300
301                 * allocsa.h: Add extern "C" for C++.
302
303         2005-02-10  Bruno Haible  <bruno@clisp.org>
304
305                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
306                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
307
308         2006-07-22  Bruno Haible  <bruno@clisp.org>
309
310                 * gettext.h: Update to GNU gettext-0.15.
311
312 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
313         and Simon Josefsson <jas@extundo.com>
314
315         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
316
317         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
318
319 2006-07-21  Eric Blake  <ebb9@byu.net>
320
321         * stdlib-safer.h: New file from coreutils, required by
322         stdlib--.h.
323
324 2006-07-19  Derek R. Price  <derek@ximbiot.com>
325
326         * getaddrinfo.h: Don't define unimplemented AI_* flags.
327         Reindent and repaginate.
328
329 2006-07-17  Bruno Haible  <bruno@clisp.org>
330
331         * gl_list.h: New file.
332         * gl_list.c: New file.
333         * gl_array_list.h: New file.
334         * gl_array_list.c: New file.
335         * gl_carray_list.h: New file.
336         * gl_carray_list.c: New file.
337         * gl_linked_list.h: New file.
338         * gl_linked_list.c: New file.
339         * gl_anylinked_list1.h: New file.
340         * gl_anylinked_list2.h: New file.
341         * gl_avltree_list.h: New file.
342         * gl_avltree_list.c: New file.
343         * gl_anyavltree_list1.h: New file.
344         * gl_anyavltree_list2.h: New file.
345         * gl_rbtree_list.h: New file.
346         * gl_rbtree_list.c: New file.
347         * gl_anyrbtree_list1.h: New file.
348         * gl_anyrbtree_list2.h: New file.
349         * gl_anytree_list1.h: New file.
350         * gl_anytree_list2.h: New file.
351         * gl_linkedhash_list.h: New file.
352         * gl_linkedhash_list.c: New file.
353         * gl_anyhash_list1.h: New file.
354         * gl_anyhash_list2.h: New file.
355         * gl_avltreehash_list.h: New file.
356         * gl_avltreehash_list.c: New file.
357         * gl_rbtreehash_list.h: New file.
358         * gl_rbtreehash_list.c: New file.
359         * gl_anytreehash_list1.h: New file.
360         * gl_anytreehash_list2.h: New file.
361
362         * gl_oset.h: New file.
363         * gl_oset.c: New file.
364         * gl_array_oset.h: New file.
365         * gl_array_oset.c: New file.
366         * gl_avltree_oset.h: New file.
367         * gl_avltree_oset.c: New file.
368         * gl_rbtree_oset.h: New file.
369         * gl_rbtree_oset.c: New file.
370         * gl_anytree_oset.h: New file.
371
372 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
373
374         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
375         New files.
376         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
377         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
378         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
379         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
380         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
381         callers changed.  Revamp internals significantly, by not
382         attempting to create directories that are temporarily more
383         permissive than the final results.  Do not attempt to use
384         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
385         This removes some race conditions, fixes some bugs, and simplifies
386         things.  Use new dirchownmod function to do owner and mode changes.
387         * mkdir-p.h: Likewise.
388         * modechange.c (octal_to_mode): New function.
389         (struct mode_change): New member mentioned.
390         (make_node_op_equals): New arg mentioned.  All callers changed.
391         (mode_compile): Keep track of which mode bits the user has explicitly
392         mentioned.
393         (mode_adjust): New arg DIR, so that we implement the X op correctly.
394         New arg PMODE_BITS, to keep track of which mode bits the user
395         mentioned; it treats S_ISUID and S_ISGID speciall.
396         All callers changed.
397         * modechange.h: Likewise.
398
399 2006-07-11  Derek R. Price  <derek@ximbiot.com>
400
401         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
402
403 2006-07-10  Derek R. Price  <derek@ximbiot.com>
404
405         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
406         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
407         macros into the GNU _D_EXACT_NAMLEN.
408         * savedir.c:  Likewise.
409         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
410
411 2006-07-09  Jim Meyering  <jim@meyering.net>
412
413         * argp-pv.c: Remove a doubled word in a comment.
414         * check-version.c (check_version): Likewise.
415         * javacomp.c (compile_java_class): Likewise.
416
417 2006-07-08  Jim Meyering  <jim@meyering.net>
418
419         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
420
421 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
422
423         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
424         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
425         brackets.  Other minor changes to suppress some compiler
426         warnings.
427
428 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
429
430         * getloadavg.c: Use __VMS, not VMS.
431         * getopt.c: Likewise.
432         * getpagesize.h: Likewise.
433         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
434         probably does not work.
435
436 2006-07-06  Derek R. Price  <derek@ximbiot.com>
437         and Paul Eggert  <eggert@cs.ucla.edu>
438
439         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
440         Don't worry about this obsolete case any more.
441         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
442         directories.
443         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
444         worry about this obsolete case any more.
445         * fts.c: Likewise.
446         * getcwd.c: Likewise.
447         * glob.h: Likewise.
448         * savedir.c: Likewise.
449
450 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
451
452         * .cppi-disable: Add wcwidth.
453         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
454         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
455         (ISGRAPH): Remove.  All uses changed to isgraph.
456         (FOLD) [!defined _LIBC]: Remove special case.
457         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
458         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
459         HAVE_ISBLANK.
460         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
461
462 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
463
464         * strtod.c (strtod): cast the argument of tolower to unsigned char.
465
466 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
467
468         * memcasecmp.c: Include <limits.h>.
469         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
470         * strtod.c (strtod): Don't assume isspace works on negative chars.
471         Don't assume isdigit succeeds only on '0' through '9'.
472
473 2006-07-05  Derek R. Price  <derek@ximbiot.com>
474
475         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
476         All uses of is_space replaced by isspace.
477         * exit.h: Don't talk about STDC_HEADERS.
478         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
479         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
480         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
481         replaced by isprint etc.
482         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
483         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
484         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
485         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
486         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
487         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
488
489 2006-07-05  Eric Blake  <ebb9@byu.net>
490
491         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
492         missing from netdb.h.
493         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
494
495 2006-06-27  Bruno Haible  <bruno@clisp.org>
496
497         Assume ANSI C header files and <ctype.h> functions.
498         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
499         (mbsnwidth): Use isprint, iscntrl instead.
500
501 2006-07-03  Jim Meyering  <jim@meyering.net>
502
503         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
504         macro is used before the first cycle_check call.
505
506 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
507
508         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
509         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
510         reported by Mark D. Baushke, one in
511         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
512
513         Merge from coreutils.
514
515         * .cppi-disable: Add stdint_.h.
516         * .cvsignore: Add stdint.h.
517
518         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
519
520         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
521         both double and long double versions.
522         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
523         * xstrtold.c: New file.
524         * xstrtod.h (xstrtold): New decl.
525
526         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
527
528         * filemode.c (setst): Remove.
529         (strmode): Rewrite to avoid setst.  This makes the code shorter,
530         (arguably) clearer, and the generated code is a bit smaller on my
531         Debian GNU/Linux stable x86 host.
532
533         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
534
535         * filemode.c: Include "filemode.h" first, to test the interface.
536         Assume that filemode.h includes sys/types.h and sys/stat.h.
537         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
538         (ftypelet): Reorder to put common cases first, for efficiency.
539         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
540         to do 'M'.
541         (strmode): Renamed from mode_string, and now stores 12 bytes instead
542         of 10, for compatibility with FreeBSD.  All callers changed.
543         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
544         that can't be deduced solely from st_mode.  First arg is now a const
545         pointer.
546         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
547         (strmode): Renamed from mode_string.
548         (filemodestring): New decl.
549         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
550         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
551         (S_ISPORT, S_ISWHT): New macros, if not already defined.
552
553         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
554
555         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
556         fsusage.h now does that.  Include fsusage.h first, to test interface.
557         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
558         at most one method (the old code could have generated decls that
559         didn't conform to C89, not that this was ever exercised).
560         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
561
562         2006-03-19  Jim Meyering  <jim@meyering.net>
563
564         Work even in a chroot where d_ino values for entries in "/"
565         don't match the stat.st_ino values for the same names.
566         * getcwd.c (__getcwd): When no d_ino value matches the target inode
567         number, iterate through all entries again, using lstat instead.
568         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
569         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
570
571         * getcwd.c (__getcwd): Clarify a comment.
572         Use memcpy in place of a call to strcpy.
573
574         2006-03-12  Jim Meyering  <jim@meyering.net>
575
576         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
577         that of the current directory (which we're about to chdir ".." out of),
578         then save the dev-ino of the parent, instead.
579
580         * same-inode.h (SAME_INODE): New file/macro.
581         * chdir-safer.c (SAME_INODE): Remove definition.
582         Include "same-inode.h", instead.
583         * same.c: Likewise.
584         * cycle-check.h: Include "same-inode.h".
585         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
586         * cycle-check.c (SAME_INODE): Remove definition.
587         * root-dev-ino.h: Include "same-inode.h".
588
589         2006-03-11  Eric Blake  <ebb9@byu.net>
590
591         * same.c (same_name): s/base_name/last_component/
592         * backupfile.c (check_extension, numbered_backup): Likewise.
593         * filenamecat.c (file_name_concat): Likewise.
594
595         2006-03-11  Eric Blake  <ebb9@byu.net>,
596                     Paul Eggert  <eggert@cs.ucla.edu>
597
598         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
599         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
600         drive prefix.
601         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
602         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
603         (last_component): New method.
604         * dirname.c (dir_len): Determine when drive letters need a
605         subsequent slash.  Preserve // when it is special.
606         (dir_name): Don't append dot when drive letter is absolute.
607         [TEST_DIRNAME]: Move into a full-blown gnulib test.
608         * basename.c (base_name): New semantics - malloc the result.
609         Preserve // when it is special.  Preserve relative files that look
610         like drive letters.
611         (base_len): Preserve // when it is special.
612         (last_component): New method, similar to old base_name semantics.
613         * stripslash.c (strip_trailing_slashes): Use last_component, not
614         base_name.  Strip redundant slashes from ///.
615
616 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
617
618         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
619         both are 64 bits, since this seems to be the tradition, and this
620         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
621         we ever run into a host that prefers long long to long in this
622         case, we'll need another configure-time test.  Problem reported by
623         Jim Meyering.
624
625 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
626
627         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
628         possible collision with system files.
629         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
630         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
631         WCHAR_MIN and WCHAR_MAX in this case.
632         (<stddef.h>): Do not include; no longer needed.
633         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
634         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
635         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
636         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
637         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
638         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
639         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
640         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
641         !defined(__c99))]: Include in this case too, since it's harmless
642         now.
643         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
644         dangerous to do so.
645         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
646         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
647         (_STDINT_MIN, _STDINT_MAX): New macros.
648         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
649         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
650         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
651         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
652         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
653         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
654         macros, not typedefs; this simplifies things quite a bit.
655         Use long int for all types narrower than int64_t.
656         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
657         Define in terms of long long int or int64_t or long int,
658         not int64_t or int32_t.  This saves some compile-time testing.
659         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
660         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
661         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
662         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
663         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
664         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
665         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
666         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
667         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
668         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
669         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
670         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
671         undef any previous version and define our own version, for
672         simplicity and consistency with the new macros for types.
673         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
674         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
675         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
676         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
677         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
678         @WINT_T_SUFFIX@ to keep things simple here.
679         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
680         Simplify by assuming typical 8/16/32/64 host, since we're
681         already doing that elsewhere anyway.
682         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
683         and assume long long int is 64 bits if available.  This
684         speeds up 'configure'.
685
686 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
687
688         * getaddrinfo.c: fixed typo
689
690 2006-06-29  Eric Blake  <ebb9@byu.net>
691
692         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
693         unused static function.
694
695 2006-06-29  Eric Blake  <ebb9@byu.net>
696
697         * stat_.h: New file.
698
699 2006-06-29  Derek R. Price  <derek@ximbiot.com>
700
701         * strftime.c: Assume strftime() exists.
702
703 2006-06-28  Bruno Haible  <bruno@clisp.org>
704
705         * getaddrinfo.h: Fix POSIX URL.
706         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
707         (use_win32_p): Make static.
708         (getaddrinfo): Reject service name if it is empty or does not consist
709         solely of decimal digits, or if its value is > 65535.
710         (getnameinfo): Remove useless casts.
711
712 2006-06-28  Derek R. Price  <derek@ximbiot.com>
713
714         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
715         Autoconf 2.60 says this stuff was obsolete.
716
717 2006-05-12  Bruno Haible  <bruno@clisp.org>
718
719         * mkdtemp.c [MINGW]: Include <io.h>.
720         (mkdir): Define using _mkdir.
721
722 2006-06-28  Bruno Haible  <bruno@clisp.org>
723
724         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
725         declaration for wcwidth.
726         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
727
728 2006-06-28  Eric Blake  <ebb9@byu.net>
729
730         * xvasprintf.h: Fix comments.
731
732 2006-06-28  Eric Blake  <ebb9@byu.net>
733
734         * mbchar.h (wcwidth): Include wcwidth.h.
735         * mbswidth.c (wcwidth): Move from here...
736         * wcwidth.h: ...to this new file.
737
738 2006-06-28  Simon Josefsson  <jas@extundo.com>
739
740         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
741         functions there.  It will succeed on Windows XP, but on Windows
742         2000 and (presumably) earlier, it will fail, and use the internal
743         re-implementation.
744         (use_win32_p): New function.
745         (getaddrinfo): Use strtoul on servname, to support numeric ports.
746         Support AI_NUMERICSERV to disable getservbyname.
747         (getnameinfo): New function, only supports
748         NI_NUMERICHOST|NI_NUMERICSERV for now.
749
750         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
751         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
752         getnameinfo.
753
754 2006-06-27  Bruno Haible  <bruno@clisp.org>
755
756         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
757
758 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
759
760         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
761         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
762         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
763
764 2006-06-26  Bruno Haible  <bruno@clisp.org>
765
766         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
767         WCHAR_MAX.
768         Reported by Mark D. Baushke and Larry Jones.
769
770 2006-06-26  Bruno Haible  <bruno@clisp.org>
771
772         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
773         in pre-C99 mode.
774         Suggested by Mark D. Baushke and Larry Jones.
775
776 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
777
778         * stdint_.h: Treat BSD/OS like OpenBSD.
779
780 2006-06-23  Bruno Haible  <bruno@clisp.org>
781
782         * stdint_.h: Treat IRIX like OpenBSD.
783
784 2006-06-23  Bruno Haible  <bruno@clisp.org>
785
786         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
787         ISO C 99 Technical Corrigendum 1.
788
789 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
790
791         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
792         Some compiler complained about some of them.  Problem reported by
793         Larry Jones in
794         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
795
796 2006-06-21  Simon Josefsson  <jas@extundo.com>
797
798         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
799         variable.
800
801         * socket_.h: Don't define WINVER.
802
803         * inet_pton.h, inet_pton.c: New file, taken from glibc but
804         slightly modified to work in gnulib.
805
806 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
807
808         * read-file.c (fread_file): Start with buffer allocation of
809         0 bytes rather than 1 byte; this simplifies the code.
810         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
811         code to free buffer and save/restore errno.
812         (internal_read_file): Remove unused local.
813
814 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
815
816         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
817         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
818         Problem reported by Denis Excoffier in
819         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
820
821 2006-06-19  Simon Josefsson  <jas@extundo.com>
822
823         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
824
825 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
826
827         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
828
829 2006-06-17  Bruno Haible  <bruno@clisp.org>
830
831         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
832
833 2006-06-17  Bruno Haible  <bruno@clisp.org>
834
835         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
836         problem on Solaris 2.5.1.
837
838 2006-06-16  Eric Blake  <ebb9@byu.net>
839
840         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
841         * unicodeio.c [!defined errno]: Likewise.
842         * strtol.c [!defined errno]: Likewise.
843         * strtod.c [!defined errno]: Likewise.
844
845 2006-06-15  Bruno Haible  <bruno@clisp.org>
846
847         * stdint_.h: Rewritten to be fully auto-configured.
848         Fixes bug on HP-UX/IA64.
849
850 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
851
852         * getdate.y (__attribute__): Don't define if already defined.
853         Problem reported by Larry Jones.
854         * utimens.c (__attribute__): Likewise.
855
856 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
857
858         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
859         reported by Andreas Schwab.
860
861 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
862             Bruno Haible  <bruno@clisp.org>
863
864         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
865
866 2006-05-26  Martin Lambers  <marlam@marlam.de>
867
868         * getpass.c: Updates the test for the native W32 API, and adds
869         missing includes, thus fixing compilation warnings.
870
871 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
872
873         * tempname.c (small_open, large_open): New macros.
874         (__open, __open64) [!_LIBC]: Remove.
875         (__gen_tempname): Use small_open and large_open instead of __open
876         and __open64.  This fixes a portability bug on HP-UX 11.11i
877         reported by Simon Wing-Tang in
878         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
879
880 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
881
882         * exclude.c (exclude_fnmatch): New function.
883         (excluded_file_name): Call exclude_fnmatch.
884         * exclude.h (excluded_file_name): New prototype
885
886 2006-05-24  Bruno Haible  <bruno@clisp.org>
887
888         * printf-args.c (printf_fetchargs): Turn NULL pointers for
889         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
890         Reported by Thorsten Maerz <torte@netztorte.de> via
891         Aaron Stone <aaron@serendipity.cx>.
892
893 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
894
895         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
896         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
897         (my_usleep): Don't mishandle maximum value.
898
899 2006-05-19  Jim Meyering  <jim@meyering.net>
900
901         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
902
903 2006-05-17  Bruno Haible  <bruno@clisp.org>
904
905         Cygwin portability.
906         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
907
908 2006-05-17  Bruno Haible  <bruno@clisp.org>
909
910         * stdint_.h: Fix recognition of Cygwin.
911
912 2006-05-11  Jim Meyering  <jim@meyering.net>
913
914         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
915
916 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
917
918         * crc.c (crc32_update): Remove unnecessary L suffix.
919         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
920         unwanted sign propagation, e.g., on hosts with 64-bit int.
921         There still are some problems with reeelly weird theoretical hosts
922         (e.g., 33-bit int) but it's not worth worrying about now.
923         * sha1.c (rol): Likewise.
924         (K1, K2, K3, K4): Remove unnecessary L suffix.
925
926 2006-05-10  Bruno Haible  <bruno@clisp.org>
927
928         * des.c: Cast to avoid warnings.
929
930 2006-05-10  Simon Josefsson  <jas@extundo.com>
931
932         * md4.c: Typo fix, update copyright years.
933         (K1, K2): Don't use L because it turn computations into 64-bit on
934         64-bit platforms.
935
936 2006-05-09  Bruno Haible  <bruno@clisp.org>
937
938         * xvasprintf.c: Include limits.h, string.h, xsize.h.
939         (EOVERFLOW): Define fallback value.
940         (xstrcat): New function.
941         (xvasprintf): Recognize the special case of a string concatenation.
942
943 2006-05-01  Bruno Haible  <bruno@clisp.org>
944
945         * stdint_.h: Shorter URL.
946         * inttypes.h: Likewise.
947
948 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
949
950         * verify.h: Document the internals better.  Most of this change
951         was written by Bruno Haible.
952
953 2006-04-29  Bruno Haible  <bruno@clisp.org>
954
955         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
956         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
957
958 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
959
960         * getdate.y (get_date): When adding relative date, start with the
961         initial time, not with the result of the first mktime call.
962
963 2006-04-23  Bruno Haible  <bruno@clisp.org>
964
965         * copy-file.c: Include <unistd.h> unconditionally.
966         * execute.c: Likewise.
967         * fatal-signal.c: Likewise.
968         * findprog.c: Likewise.
969         * mkdtemp.c: Likewise.
970         * pipe.h: Likewise.
971         * pipe.c: Likewise.
972         * wait-process.h: Likewise.
973
974 2006-04-23  Bruno Haible  <bruno@clisp.org>
975
976         * fwriteerror.c (fwriteerror): Call fclose also when an error
977         condition was already detected.
978         Reported by Ben Pfaff <blp@cs.stanford.edu>.
979
980 2006-04-19  Derek Price  <derek@ximbiot.com>
981             Eric Blake  <ebb9@byu.net>
982
983         * inttypes.h: Correct grammar in comment.
984
985 2006-04-18  Derek Price  <derek@ximbiot.com>
986             Paul Eggert  <eggert@cs.ucla.edu>
987
988         * inttypes.h: New file.
989         * strtoimax.c: Assume <inttypes.h>.
990
991 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
992
993         * utimens.c (futimens): glibc futimesat messes up if /proc
994         isn't mounted.  Problem reported by Kir Kolyshkin.
995
996 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
997
998         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
999         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1000         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1001
1002 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1003
1004         Merge regex changes from libc, removing some of our
1005         POSIX-conformance changes that were rejected and redoing them in a
1006         less-intrusive way.
1007
1008         * regcomp.c (re_compile_internal, init_dfa):
1009         Length arg is now size_t, not Idx.  All uses changed.
1010         (peek_token): Forward decl now says internal_function.
1011         (__re_error_msgid, __re_error_msgid_idx):
1012         Now static rather than extern with attribute_hidden.
1013         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1014         For some reason libc prefers K&R style defns for external functions.
1015         (regerror) [!defined _LIBC]: Likewise.
1016         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1017         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1018         (build_range_exp, build_collating_symbol):
1019         Use K&R-style defn.
1020         (re_compile_fastmap): Use '\0' to memset, not 0.
1021         (utf8_sb_map): Make the calculations more obvious.
1022         (init_dfa, parse_bracket_exp, build_charclass_op):
1023         Call calloc and cast result, as glibc does.
1024         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1025         (build_range_exp, build_collating_symbol):
1026         Now internal functions.
1027
1028         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1029
1030         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1031         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1032         Don't depend on VMS; depend on __VMS instead, for POSIX
1033         namespace cleanness.
1034         (regoff_t): Define to ssize_t, not long int.
1035
1036         Remove the REG_ macros named below.  Instead, make the old names
1037         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1038         __USE_GNU_REGEX.
1039         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1040         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1041         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1042         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1043         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1044         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1045         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1046         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1047         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1048         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1049         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1050         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1051         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1052         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1053         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1054         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1055         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1056         (REG_NREGS):
1057         Remove.  All uses replaced by the old RE_* names.
1058         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1059         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1060         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1061         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1062         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1063         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1064         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1065         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1066         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1067         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1068         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1069         Don't bother having these macros be independent of each others'
1070         values, since they no longer exist in the POSIX name space.
1071
1072         Rename the following member names back to their old names,
1073         unless !__USE_GNU_REGEX.  All uses changed back.
1074         (buffer): Renamed from re_buffer.
1075         (allocated): Renamed from re_allocated.
1076         (used): Renamed from re_used.
1077         (syntax): Renamed from re_syntax.
1078         (fastmap): Renamed from re_fastmap.
1079         (translate): Renamed from re_translate.
1080         (can_be_null): Renamed from re_can_be_null.
1081         (regs_allocated): Renamed from re_regs_allocated.
1082         (fastmap_accurate): Renamed from re_fastmap_accurate.
1083         (no_sub): Renamed from re_no_sub.
1084         (not_bol): Renamed from re_not_bol.
1085         (not_eol): Renamed from re_not_eol.
1086         (newline_anchor): Renamed from re_newline_anchor.
1087         (num_regs): Renamed from rm_num_regs.
1088         (start): Renamed from rm_start.
1089         (end): Renamed from rm_end.
1090
1091         (free_state): Move up a bit.
1092
1093         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1094         #define to be empty.
1095         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1096         when that is what is intended.
1097         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1098         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1099         (MAX): New macro.
1100         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1101         All uses changed back to re_malloc, etc.  It's now the caller's
1102         responsibility to check for overflow; all callers changed.
1103         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1104         (re_x2nrealloc): Remove.
1105         (free_state): Remove decl.
1106
1107         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1108         (re_set_registers, re_exec):
1109         Use K&R-style defn.
1110
1111         2006-01-31  Roland McGrath  <roland@redhat.com>
1112
1113         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1114         Reported by Mike Frysinger <vapier@gentoo.org>.
1115
1116         2006-01-15  Andreas Jaeger  <aj@suse.de>
1117
1118         [BZ #1950]
1119         * regex_internal.c (re_string_reconstruct): Adjust for
1120         build_wcs_upper_buffer change.
1121         (build_wcs_upper_buffer): Change return type.
1122
1123         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1124
1125         * regex_internal.h: Include <stdint.h> if available.
1126
1127         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1128
1129         * regex_internal.h (SIZE_MAX): Provide a default definition.
1130
1131         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1132
1133         * regcomp.c: Adjust for changed secondary hash function.
1134
1135         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1136
1137         * regex.h: Pretty printing.
1138         Clean up namespace a bit.
1139
1140         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1141
1142         * regexec.c (update_cur_sifted_state, check_arrival,
1143         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1144
1145         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1146                     Ulrich Drepper  <drepper@redhat.com>
1147
1148         [BZ #1302]
1149         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1150         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1151
1152         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1153
1154         [BZ #281]
1155         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1156         * regcomp.c: Remove unnecessary uses of
1157         unsigned RE_TRANSLATE_TYPE.
1158         * regex_internal.h: Likewise.
1159         * regex_internal.c: Likewise.
1160         * regexec.c: Likewise.
1161         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1162
1163         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1164
1165         * regexec.c (find_recover_state): Remove unnecessary
1166         initialization.
1167         (transit_state_bkref): Make DFA a const pointer.
1168         (get_subexp): Likewise.
1169         (check_arrival): Likewise.
1170         (update_cur_sifted_state): Likewise.
1171         (re_search_internal): Likewise.
1172         (prune_impossible_nodes): Likewise.
1173         (acquire_init_state_context): Likewise.
1174         (proceed_next_node): Likewise.
1175         (set_regs): Likewise.
1176         (free_fail_stack_return): Likewise.
1177         (check_arrival_expand_ecl): Mark DFA parameter as const.
1178         (check_arrival_expand_ecl_sub): Likewise.
1179         (check_subexp_limits): Likewise.
1180         (sub_epsilon_src_nodes):  Likewise.
1181         (add_epsilon_src_nodes):  Likewise.
1182         (merge_state_array): Likewise.
1183         (update_regs): Likewise.
1184         (build_trtable): Likewise.
1185         (sift_states_backward): Mark MCTX parameter as const.
1186         (build_sifted_states): Likewise.
1187         (update_cur_sifted_state): Likewise.
1188         (sift_states_mkref): Likewise.
1189         (check_arrival_expand_ecl): Mark eclosure as const.
1190         (check_dst_limits_calc_pos_1): Likewise.
1191         * regex_internal.h (re_match_context_t): Make dfa a const
1192         pointer.
1193
1194         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1195
1196         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1197         (transit_state_sb): Likewise.
1198         (transit_state_mb): Likewise.
1199         (sift_states_iter_mb): Likewise.
1200         (check_arrival_add_next_nodes): Likewise.
1201         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1202         [_LIBC] (re_search_2_stub): Use mempcpy.
1203
1204         * regex_internal.c (re_string_reconstruct): Avoid calling
1205         mbrtowc for very simple UTF-8 case.
1206
1207         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1208         a pointer-to-const.
1209         (re_acquire_state_context): Likewise.
1210         * regex_internal.h: Adjust prototypes.
1211
1212         * regex.c: Prevent using C++ compilers.
1213
1214         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1215         (re_acquire_state_context): Likewise.
1216
1217 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1218             Bruno Haible  <bruno@clisp.org>
1219
1220         * stdint_.h: On OpenBSD, don't redefine types already included in
1221         <sys/types.h> and <inttypes.h>.
1222
1223 2006-03-24  Eric Blake  <ebb9@byu.net>
1224
1225         * time_r.c (copy_string_result): Remove, as it is no longer used.
1226
1227 2006-03-24  Simon Josefsson  <jas@extundo.com>
1228
1229         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1230         including some doc fixes.
1231         (base64_encode_alloc): Fix +1 bug on allocation failures.
1232
1233 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1234
1235         * base64.c (base64_encode): Do not read past end of array with
1236         unsanitized input on systems with CHAR_BIT > 8.
1237
1238 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1239
1240         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1241         Typedef to long int, not to off_, as POSIX will likely change
1242         in that direction.
1243
1244 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1245
1246         * argp-help.c (validate_uparams): Fix typo
1247         * argp-parse.c (argp_default_options): Consistently begin help
1248         messages with a lowercase letter.
1249
1250 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1251
1252         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1253         overrun buffers and shouldn't be used (much as gets shouldn't be
1254         used).
1255         * time_r.c (asctime_r, ctime_r): Likewise.
1256
1257 2006-03-08  Simon Josefsson  <jas@extundo.com>
1258
1259         * gc-gnulib.c (randomize): Don't open files called 'no', they
1260         signal that configure disabled the device.
1261
1262 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1263
1264         * c-stack.c: Include unistd.h unconditionally, since we now assume
1265         the unistd module.
1266         * getlogin_r.c: Likewise.
1267         * getlogin_r.h: Likewise.
1268         * glob.c: Likewise.
1269         * pagealign_alloc.c: Likewise.
1270         * unistd_.h: Remove; no longer needed.
1271
1272 2006-03-07  Simon Josefsson  <jas@extundo.com>
1273
1274         * unistd_.h: New file.
1275
1276 2006-03-07  Simon Josefsson  <jas@extundo.com>
1277
1278         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1279
1280 2006-03-01  Simon Josefsson  <jas@extundo.com>
1281
1282         * readline.c: Fix typo, tiny patch from Stepan Kasal
1283         <kasal@ucw.cz>.
1284
1285 2006-02-28  Simon Josefsson  <jas@extundo.com>
1286
1287         * getopt.c: Protect #include of unistd.h, for MSVS.
1288
1289 2006-02-27  Simon Josefsson  <jas@extundo.com>
1290
1291         * base64.h: Indent #define's.  From Jim Meyering
1292         <jim@meyering.net>.
1293
1294 2006-02-27  Jim Meyering  <jim@meyering.net>
1295
1296         Revert the change of 2006-02-24, so these files can continue
1297         to be sync'd from gettext.
1298         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1299         of `config.h'.
1300
1301 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1302
1303         * glob.c: Say "invalid" rather than "illegal" in comments.
1304
1305 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1306
1307         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1308
1309 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1310
1311         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1312         AT_FDCWD exceeds INT_MAX.
1313         * openat.h (AT_FDCWD): Likewise.
1314
1315 2006-02-14  Jim Meyering  <jim@meyering.net>
1316
1317         Sync from coreutils.
1318
1319         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1320         failure on deficient systems, and simplify gnulib lgpl dependencies.
1321         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1322         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1323
1324         * xalloc-die.c: Remove unused definition of N_.
1325
1326 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1327
1328         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1329
1330 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1331
1332         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1333         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1334
1335 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1336
1337         * argp-namefrob.h: Restore changes accidentally lost during the
1338         "autoupdate" on 2005-12-12.
1339
1340 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1341
1342         * fnmatch.c (L_): Renamed from L, to work around a bug in
1343         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1344         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1345         All uses changed.
1346
1347 2006-01-26  Simon Josefsson  <jas@extundo.com>
1348
1349         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1350         prototype is visible on mingw32.
1351
1352         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1353         for mingw32.
1354
1355         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1356         mingw32).
1357
1358 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1359
1360         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1361         attempt to open for write; this always fails, at least on POSIX
1362         hosts.  This reinstates the 2006-01-09 change, which was
1363         inadvertently removed.
1364
1365 2006-01-26  Bruno Haible  <bruno@clisp.org>
1366             Paul Eggert  <eggert@cs.ucla.edu>
1367
1368         * stdbool_.h (_Bool)
1369         [(! (defined __cplusplus || defined __BEOS__)
1370           && !defined __GNUC__
1371           && !(defined __HP_cc || defined __xlc__
1372                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1373                || defined __sgi))]:
1374         #define to signed char in these cases too; this simplifies
1375         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1376         etc., separately) and makes it more conservative.
1377
1378 2006-01-21  Jim Meyering  <jim@meyering.net>
1379
1380         Sync from the stable (b5) branch of coreutils:
1381
1382         * fts.c (fts_children): Don't let close() clobber errno from
1383         failed fchdir().
1384
1385         * fts.c (fts_stat): When following a symlink-to-directory,
1386         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1387         a dangling symlink.  That can also happen at least for ELOOP.
1388         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1389         FYI, this bug predates the inclusion of fts.c in coreutils.
1390
1391         * fts.c (fts_open): Put new maxarglen declaration and uses
1392         in their own block, so pre-c99 compilers don't object.
1393
1394         Avoid the double-free (first in fts_read, second in fts_close) that
1395         would occur when an `active' directory is made inaccessible (e.g.,
1396         via chmod a-x) during a traversal.
1397         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1398         before returning.  Reproduce this failure by
1399         mkdir -p a/b; cd a; chmod a-x . b
1400         Reported by Stavros Passas.
1401
1402 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1403
1404         * argp-namefrob.h: Bugfix. Remove stray #
1405
1406 2006-01-25  Bruno Haible  <bruno@clisp.org>
1407
1408         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1409         warnings.
1410         Reported by Paul Eggert.
1411
1412 2006-01-25  Jim Meyering  <jim@meyering.net>
1413
1414         * fileblocks.c: Remove more useless parentheses.
1415         * readutmp.h: Likewise.
1416
1417 2006-01-24  Bruno Haible  <bruno@clisp.org>
1418
1419         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1420         has it.
1421         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1422         2005-11-26.
1423
1424         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1425         to avoid problems with the built-in _Bool type.
1426         Reported by Paul Eggert on 2005-11-26.
1427
1428 2006-01-24  Jim Meyering  <jim@meyering.net>
1429
1430         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1431
1432 2006-01-24  Simon Josefsson  <jas@extundo.com>
1433
1434         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1435         Bruno.
1436
1437 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1438
1439         Work around porting bugs reported by Dieter in
1440         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1441         * getopt.c (_NOPROTO): Remove; no longer needed.
1442         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1443         Include "getopt.h" first, to check interface.
1444         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1445         !HAVE_DECL_GETENV.
1446         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1447         (__strndup): Revert to K&R-style function dfns, the glibc style.
1448         * strnlen.c: Don't claim it's taken from glibc; it's not.
1449         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1450         Include strnlen.h first, to get prototype properly.
1451         (strnlen): Renamed from __strnlen.
1452         Remove weak alias.
1453
1454 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1455
1456         These changes imported from libc.
1457         * getopt.c: Use __fxprintf instead of inline stream orientation
1458         test and two separate function calls.
1459         * strndup.c (__strndup): Add libc_hidden_def.
1460
1461 2006-01-22  Bruno Haible  <bruno@clisp.org>
1462
1463         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1464         temporary buffer for sprintf, take into account the precision also
1465         for 'd', 'i', 'u', 'o', 'x', 'X'.
1466
1467 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1468
1469         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1470         to pacify gcc -Wswitch-default.
1471
1472 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1473
1474         * argp-help.c (usage_long_opt): Do not print DOC options.
1475         (__argp_base_name): Removed
1476         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1477         typo.
1478         (__argp_base_name): Provide macro definition or extern declaration
1479         depending on the configuration
1480
1481 2006-01-20  Simon Josefsson  <jas@extundo.com>
1482
1483         * inet_ntop.h: Unconditionally include sys/socket.h.
1484
1485 2006-01-19  Simon Josefsson  <jas@extundo.com>
1486
1487         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1488
1489 2006-01-12  Simon Josefsson  <jas@extundo.com>
1490
1491         * base64.c: Fix warning, reported by Bruno Haible
1492         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1493
1494 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1495
1496         Sync from coreutils.
1497         * md5.c: Fix commentary typos.
1498         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1499         * md5.h (__attribute__): Remove; unused.
1500         * sha1.c: Fix commentary to match md5 better.
1501         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1502         so that we don't need to worry about alignment.  All uses changed.
1503         This merges the 2005-10-28 md5 change into sha1.
1504
1505 2006-01-11  Jim Meyering  <jim@meyering.net>
1506
1507         Sync from coreutils.
1508         * md5.c (OP): Fix spacing.
1509
1510 2006-01-11  Simon Josefsson  <jas@extundo.com>
1511
1512         * stdint_.h (SIZE_MAX): Add missing (.
1513
1514 2006-01-10  Bruno Haible  <bruno@clisp.org>
1515
1516         * argp.h (__const): Remove macro. Use const instead.
1517         * argp-fmtstream.h (__const): Likewise.
1518         * glob_.h (__const): Remove macro.
1519         * glob-libc.h: Use const instead of __const.
1520
1521 2006-01-10  Jim Meyering  <jim@meyering.net>
1522
1523         Avoid the double-free (first in fts_read, second in fts_close) that
1524         would occur when an `active' directory is made inaccessible (e.g.,
1525         via chmod a-x) during a traversal.
1526         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1527         before returning.  Reproduce this failure by
1528         mkdir -p a/b; cd a; chmod a-x . b
1529         Reported by Stavros Passas.
1530
1531         Sync from coreutils.
1532         * sha1.c: Tweak grammar in a comment.
1533
1534 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1535
1536         * regex_internal.h (BITSET_WORD_BITS):
1537         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1538         preprocessor mishandles large unsigned values as if they were signed.
1539         Problem reported by Claudio Fontana in
1540         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1541
1542 2006-01-10  Simon Josefsson  <jas@extundo.com>
1543
1544         * socket_.h: New file.
1545
1546 2006-01-10  Bruno Haible  <bruno@clisp.org>
1547
1548         * localcharset.c: Update from GNU gettext.
1549
1550 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1551
1552         Sync from coreutils.
1553         * chdir-long.c (cdb_free): Don't bother trying to open directory
1554         for write access: POSIX says that must fail.
1555         * fts.c (diropen): Likewise.
1556         * save-cwd.c (save_cwd): Likewise.
1557         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1558         well, for minor improvements on hosts that lack O_DIRECTORY.
1559         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1560         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1561         Fall back on chown if open failed with EACCES.
1562
1563         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1564         Report an error at compile-time if only a 1-second nominal clock
1565         resolution is found.
1566
1567         * lchmod.h: New file.
1568         * mkdir-p.c: Include lchmod.h, lchown.h.
1569         (make_dir_parents): Use lchown rather than chown, and
1570         lchmod rather than chmod.
1571
1572         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1573         too.  Problem with "none" reported by Bob Proulx.  Problem with
1574         "proc" reported by n0dalus.
1575
1576         * mountlist.c: Include <limits.h>.
1577         (dev_from_mount_options)
1578         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1579         New function.  It no longer assumes "dev=" has the System V meaning
1580         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1581         (read_file_system_list)
1582         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1583         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1584         dev= in that case.
1585
1586         * posixtm.h (PDS_PRE_2000): New macro.
1587         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1588         All usages changed.  Reject dates outside the range 1969-1999 if
1589         PDS_PRE_2000 is used.
1590
1591 2006-01-09  Jim Meyering  <jim@meyering.net>
1592
1593         Sync from coreutils.
1594
1595         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1596
1597         * chdir-safer.h, chdir-safer.c: New files.
1598
1599         * modechange.c (mode_compile): Reject an invalid mode string
1600         that starts with an octal digit.  From Andreas Gruenbacher.
1601
1602         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1603         and dup to open_safer and dup_safer, respectively.
1604         (openat_permissive): Fix typo in comment.
1605
1606         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1607         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1608         (_): Remove; no longer needed.
1609         (openat): Renamed from rpl_openat; no need for rpl_openat
1610         since openat.h renames openat for us.
1611         Replace most of the body with a call to openat_permissive,
1612         to avoid duplicate code.
1613         Port to (probably hypothetical) environments were mode_t is
1614         wider than int.
1615         (openat_permissive): Require mode arg, so that we can check
1616         types better.  Put it just after flags.  Change cwd failure
1617         indicator from pointer-to-bool to pointer-to-errno-value.
1618         All callers changed.
1619         Invoke openat_save_fail and/or openat_restore_fail if
1620         cwd_errno is null, so that openat can call us.
1621         (openat_permissive, fdopendir, fstatat, unlinkat):
1622         Simplify errno handling to avoid some duplicate code,
1623         as it's OK to set errno on success.
1624         * openat.h: Revamp code so that function macros depend on
1625         __OPENAT_PREFIX only, not also on AT_FDCWD.
1626         (openat_ro): Remove.  Caller changed to use openat_permissive.
1627         (openat_permissive): Now a macro, if not a function.
1628         (openat_restore_fail, openat_save_fail): Now always functions,
1629         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1630
1631         * openat-priv.h: New file, defining macros used by mkdirat.c
1632         and openat.c.
1633         * mkdirat.c: Include openat-priv.h.
1634         Remove definitions of macros defined therein.
1635         * openat.c: Likewise.
1636
1637         * mkdirat.c (mkdirat): New file and function.
1638         * openat.h (mkdirat): Declare.
1639
1640         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1641
1642         * openat.h (openat_permissive): Declare.
1643         (openat_ro): Define.
1644
1645         * openat.c (EXPECTED_ERRNO): New macro.
1646         (openat_permissive): New function -- used in remove.c rewrite.
1647         (all functions): Set errno just before returning, only if there
1648         was an actual failure.
1649         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1650
1651         Emulate openat-family functions using Linux's procfs, if possible.
1652         Idea and some code based on Ulrich Drepper's glibc changes.
1653
1654         * openat.c: (BUILD_PROC_NAME): New macro.
1655         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1656         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1657         before falling back on save_cwd and restore_cwd.
1658         (fdopendir, fstatat, unlinkat): Likewise.
1659
1660         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1661         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1662
1663         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1664         as second argument to va_arg.  Otherwise, some versions of gcc
1665         warn that `if this code is reached, the program will abort'.
1666
1667 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1668
1669         Sync from coreutils.
1670
1671         Add POSIX ACL support
1672         * acl.h (copy_acl, set_acl): Add declarations.
1673         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1674         systems other than Linux.
1675         (chmod_or_fchmod): New function: use fchmod when possible,
1676         and chmod otherwise.
1677         (file_has_acl): Add a POSIX ACL implementation, with a
1678         Linux-specific subcase.
1679         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1680         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1681         acls are unsupported.
1682         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1683         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1684         are unsupported.
1685
1686 2006-01-09  Bruno Haible  <bruno@clisp.org>
1687
1688         * sysexit_.h (EX_OK): New macro.
1689         Suggested by Martin Lambers <marlam@marlam.de>.
1690
1691 2006-01-09  Bruno Haible  <bruno@clisp.org>
1692
1693         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1694         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1695         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1696         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1697
1698 2006-01-09  Bruno Haible  <bruno@clisp.org>
1699
1700         * stdint_.h (SIZE_MAX): Write the value without involving negative
1701         numbers.
1702
1703 2005-10-16  Bruno Haible  <bruno@clisp.org>
1704
1705         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1706         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1707
1708 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1709
1710         * strftime.c (tzname): Don't declare if it is already #defined.
1711         Problem reported for Mingw by Mark Junker.
1712
1713 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1714
1715         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1716         long int, not int, for nanosecond counts, so that people who are
1717         used to POSIX struct timespec won't be surprised.  Reported by Jim
1718         Meyering.
1719
1720 2005-12-16  Jim Meyering  <jim@meyering.net>
1721
1722         * fprintftime.c, fprintftime.h: New files.
1723
1724 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1725
1726         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1727         * argp-help.c (fill_in_uparams): Check if the constructed
1728         struct uparams is valid. Fall back to the default values if it is
1729         not.
1730
1731 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1732
1733         * argp-help.c (__argp_base_name): New function
1734         (__argp_short_program_name): Rewrite using __argp_base_name
1735         * argp-namefrob.h: Define program_invocation_name and
1736         program_invocation_short_name if requested
1737         (__argp_base_name): Add prototype
1738         * argp-parse.c (argp_def): Use gettext wrappers
1739         (argp_default_parser): Use __argp_base_name
1740         * argp-pin.c: New file. Defines program_invocation_name and
1741         program_invocation_short_name on systems that lack them.
1742
1743 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1744
1745         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1746         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1747         porting problem reported by Georg Schwarz in
1748         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1749
1750 2005-07-09  Bruno Haible  <bruno@clisp.org>
1751
1752         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1753         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1754         Reported by Mark Junker <mjscod@gmx.de>.
1755
1756 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1757
1758         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1759         (uintmax_t) [defined uintmax_t]: Do not declare.
1760         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1761         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1762         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1763         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1764         sake of portability to weird hosts that C allows (though we don't
1765         know of any practical examples).
1766
1767         * savedir.h (fdsavedir): New decl.
1768         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1769         contains most of the former guts of savedir.
1770         (savedir): Use savedirstream.
1771         Include "openat.h".
1772
1773 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1774
1775         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1776         coreutils no longer futzes with rounding modes.
1777
1778 2005-11-14  Jim Meyering  <jim@meyering.net>
1779
1780         * mkstemp-safer.c: Include <config.h>, required for possible
1781         replacement of mkstemp.
1782
1783 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1784
1785         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1786         business.
1787         (gethrxtime) [! (HAVE_NANOUPTIME
1788         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1789         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1790         our own approximation.
1791
1792 2005-11-10  Simon Josefsson  <jas@extundo.com>
1793
1794         * readline.c: Remove EOL.
1795
1796 2005-11-08  Eric Blake  <ebb9@byu.net>
1797
1798         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1799
1800 2005-11-08  Eric Blake  <ebb9@byu.net>
1801
1802         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1803
1804 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1805
1806         Fix porting problem reported by Theodoros V. Kalamatianos.
1807         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1808         Don't assume that futimes failing means we must fail.
1809
1810 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1811
1812         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1813         leave errno alone.  Problem reported by Dmitry V. Levin.
1814
1815 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1816
1817         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1818         errno alone.  Problem reported by Frederic Jolliton.
1819
1820 2005-10-28  Simon Josefsson  <jas@extundo.com>
1821
1822         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1823         "restrict" keywords, as per POSIX.  Protect the function
1824         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1825         Don't use K&R prototypes.  Check the sprintf return values.
1826         Re-define EAFNOSUPPORT if not present.  Indent.
1827
1828         * md5.h, md5.c: Simplify buffer handling visavi alignment,
1829         suggested by Bruno Haible <bruno@clisp.org>.
1830
1831         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1832
1833         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
1834
1835         * gc-libgcrypt.c: Add MD2 (which is not available through
1836         libgcrypt).
1837
1838         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
1839
1840         * md2.h, md2.c: New files.
1841
1842 2005-10-24  Simon Josefsson  <jas@extundo.com>
1843
1844         * md4.h: Shrink buffer size, now that we changed the type.
1845
1846 2005-10-22  Simon Josefsson  <jas@extundo.com>
1847
1848         * arcfour.h, arcfour.c: Use fixed size indices in the
1849         arcfour_context struct (simplify test vector testing in GNU
1850         Shishi).
1851
1852 2005-10-22  Simon Josefsson  <jas@extundo.com>
1853
1854         * md4.h, md4.c: Simplify buffer handling visavi alignment,
1855         suggested by Bruno Haible <bruno@clisp.org>.
1856
1857 2005-10-22  Simon Josefsson  <jas@extundo.com>
1858
1859         * crc.h: Include stddef.h, for size_t.
1860
1861 2005-10-21  Simon Josefsson  <jas@extundo.com>
1862
1863         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1864         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1865
1866 2005-10-21  Simon Josefsson  <jas@extundo.com>
1867
1868         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1869         block.
1870
1871 2005-10-21  Simon Josefsson  <jas@extundo.com>
1872
1873         * gc-gnulib.c: Support ARCTWO in CBC mode.
1874
1875 2005-10-21  Simon Josefsson  <jas@extundo.com>
1876
1877         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1878         <bruno@clisp.org>.
1879
1880         * hmac-sha1.c (hmac_sha1): Likewise.
1881
1882         * crc.c (crc32_update): Actually use crc parameter, suggested by
1883         Bruno Haible <bruno@clisp.org>.
1884
1885         * crc.h: Include stdint.h directly, suggested by Bruno Haible
1886         <bruno@clisp.org>.
1887
1888 2005-10-21  Simon Josefsson  <jas@extundo.com>
1889
1890         * des.h, des.c: New files.
1891
1892         * gc-gnulib.c: Support DES.c
1893
1894 2005-10-21  Simon Josefsson  <jas@extundo.com>
1895
1896         * arctwo.h, arctwo.c: New files.
1897
1898         * gc-gnulib.c: Support ARCTWO.
1899
1900 2005-10-21  Simon Josefsson  <jas@extundo.com>
1901
1902         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1903
1904 2005-10-19  Simon Josefsson  <jas@extundo.com>
1905
1906         * gc-gnulib.c: Support ARCFOUR.
1907
1908 2005-10-19  Simon Josefsson  <jas@extundo.com>
1909
1910         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1911         support.
1912
1913         * gc.h: Add ECB enum type.
1914
1915         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1916
1917 2005-10-19  Simon Josefsson  <jas@extundo.com>
1918
1919         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1920
1921 2005-10-18  Simon Josefsson  <jas@extundo.com>
1922
1923         * md4.h, md4.c: New files, based on md5.?.
1924
1925 2005-10-17  Simon Josefsson  <jas@extundo.com>
1926
1927         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1928
1929         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1930
1931 2005-10-17  Simon Josefsson  <jas@extundo.com>
1932
1933         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1934
1935 2005-10-17  Simon Josefsson  <jas@extundo.com>
1936
1937         * gc.h, gc-libgcrypt.c: Add ciphers.
1938
1939 2005-10-17  Simon Josefsson  <jas@extundo.com>
1940
1941         * sha1.c: Use uint32_t instead of md5_uint32.t
1942
1943         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1944         md5.h.
1945
1946         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
1947
1948         * md5.h: Use stdint.h and uint32_t.  Doc fix.
1949
1950 2005-10-15  Simon Josefsson  <jas@extundo.com>
1951
1952         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1953
1954         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1955
1956 2005-10-14  Simon Josefsson  <jas@extundo.com>
1957
1958         * arcfour.h, arcfour.c: New files.
1959
1960 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
1961
1962         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1963         include <wchar.h>; no longer needed.
1964
1965 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
1966         and  Ulrich Drepper  <drepper@redhat.com>
1967
1968         Import from libc.
1969         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1970         instead of inline stream orientation test and two separate
1971         function calls.  Pay no attention to USE_IN_LIBIO.
1972
1973 2005-10-14  Roland McGrath  <roland@redhat.com>
1974
1975         Import from libc.  [BZ #1331]
1976         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1977         macro argument.
1978         Reported by Matej Vela <vela@debian.org>.
1979
1980 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1981
1982         * mkdir-p.c (make_dir_parents): Don't report an error if an
1983         intermediate directory is in a read-only file system.  Problem
1984         reported by Eric Blake.
1985
1986 2005-10-13  Simon Josefsson  <jas@extundo.com>
1987
1988         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1989         Move memory allocation outside of loop.
1990
1991 2005-10-12  Simon Josefsson  <jas@extundo.com>
1992
1993         * gc-pbkdf2-sha1.c: New file.
1994
1995         * gc.h: Add gc_pbkdf2_sha1 prototype.
1996
1997 2005-10-12  Simon Josefsson  <jas@extundo.com>
1998
1999         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2000         suggested by Bruno Haible <bruno@clisp.org>.
2001
2002 2005-10-12  Simon Josefsson  <jas@extundo.com>
2003
2004         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2005
2006         * gc-gnulib.c (gc_hmac_sha1): New function.
2007
2008 2005-10-12  Simon Josefsson  <jas@extundo.com>
2009
2010         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2011
2012 2005-10-12  Simon Josefsson  <jas@extundo.com>
2013
2014         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2015         GC_USE_HMAC_MD5, respectively.
2016
2017         * gc-libgcrypt.c (gc_md5): Fix assert call.
2018         (gc_md5): Fix typo.
2019
2020         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2021
2022         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2023
2024         * gc-gnulib.c (gc_hash_buffer): Ditto.
2025
2026 2005-10-11  Bruno Haible  <bruno@clisp.org>
2027
2028         * c-strcasestr.h: New file, from GNU gettext.
2029         * c-strcasestr.c: New file, from GNU gettext.
2030
2031 2005-10-11  Bruno Haible  <bruno@clisp.org>
2032
2033         * c-strcase.h: New file, from GNU gettext.
2034         * c-strcasecmp.c: New file, from GNU gettext.
2035         * c-strncasecmp.c: New file, from GNU gettext.
2036
2037 2005-10-11  Simon Josefsson  <jas@extundo.com>
2038
2039         * crc.h, crc.c: New files.
2040
2041         * gc.h (gc_hash_buffer): Add doc.
2042
2043 2005-10-08  Simon Josefsson  <jas@extundo.com>
2044
2045         * gc.h: Add gc_hash and gc_hash_buffer.
2046
2047         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2048
2049         * gc-libgcrypt.c (gc_hash_buffer): Add.
2050
2051 2005-10-11  Bruno Haible  <bruno@clisp.org>
2052
2053         * strcasecmp.c: Include limits.h.
2054         (strcasecmp): Avoid integer overflow on exotic platforms.
2055         * strncasecmp.c: Include limits.h.
2056         (strncasecmp): Avoid integer overflow on exotic platforms.
2057         Reported by Paul Eggert.
2058
2059 2005-10-06  Simon Josefsson  <jas@extundo.com>
2060
2061         * hmac-md5.c: New file.
2062
2063         * hmac.h: New file.
2064
2065 2005-10-06  Simon Josefsson  <jas@extundo.com>
2066
2067         * memxor.c (memxor): Avoid casts and warnings.
2068
2069 2005-10-05  Derek Price  <derek@ximbiot.com>
2070
2071         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2072
2073 2005-10-05  Simon Josefsson  <jas@extundo.com>
2074
2075         * memxor.c (memxor): Fix compiler error.
2076
2077         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2078         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2079
2080         * memxor.h, memxor.c: New files.
2081
2082         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2083         we assume all systems have it, suggested by Jim Meyering
2084         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2085         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2086         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2087         same reasons.
2088
2089 2005-10-04  Bruno Haible  <bruno@clisp.org>
2090
2091         * verify.h (verify_true): Provide alternative definition for C++.
2092
2093 2005-10-04  Simon Josefsson  <jas@extundo.com>
2094
2095         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2096         D. Baushke" <mdb@gnu.org>.
2097
2098 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2099
2100         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2101         (SSIZE_MAX): New macro, if not already defined.
2102         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2103         than 2 GiB.
2104
2105 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2106
2107         * exclude.c: Include verify.h.
2108         (verify): Remove.  All callers changed to use verify.h's version.
2109         * strtoimax.c: Likewise.
2110         * utimecmp.c: Likewis.e
2111
2112         Sync from coreutils.
2113         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2114         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2115         * .cvsignore: Add fts.h, search.h, t-fpending.
2116         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2117         bother returning ENOSYS if settimeofday or stime fails; just let
2118         them return whatever errno they want to return.
2119         * utimens.c: Include unistd.h, for dup2.
2120         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2121         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2122
2123 2005-10-02  Jim Meyering  <jim@meyering.net>
2124
2125         Sync from coreutils.
2126         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2127         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2128         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2129         Remove AT_FDCWD test.
2130         Do not consume the fd unless successful.
2131         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2132         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2133         block, so that we don't even try to compile it if settimeofday is
2134         available.  This works around a compilation failure on OSF1 V5.1,
2135         due to stime requiring a `long int*' while tv_sec is `int'.
2136
2137 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2138
2139         * getdelim.c (getdelim): Remove unused variables.
2140
2141 2005-10-01  Simon Josefsson  <jas@extundo.com>
2142
2143         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2144         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2145         AI_* and EAI_* definitions.  Protect function declarations.
2146
2147 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2148
2149         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2150         so that the code works even with ancient cpp.  Portability problem
2151         with GCC 2.7.2.1 reported by Thomas M.Ott.
2152
2153 2005-09-27  Jim Meyering  <jim@meyering.net>
2154
2155         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2156
2157         * intprops.h (signed_type_or_expr__): Define.
2158         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2159         for unsigned types.
2160
2161 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2162
2163         * verify.h (verify_expr): Remove, replacing with:
2164         (verify_true): New macro that returns true instead of void.
2165         (verify_type__): Remove.
2166         (verify): Use verify_true rather than verify_type__.
2167
2168 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2169
2170         * utimens.c (ENOSYS): Define if not already defined.
2171         (futimens): Support having a null PATH if the file descriptor
2172         is nonnegative.
2173
2174         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2175         Remove.
2176         (__attribute): Define to empty unless GCC 3.1 or later.
2177         This works around a core dump on OpenBSD 3.4, which has GCC
2178         2.95.3, which dumps core when given __attribute__(()).  It also
2179         simplifies other tests, since we really don't want to bother with
2180         worrying about which ancient version of GCC supported what.
2181         Original problem reported by Yoann Vandoorselaere, with part of
2182         the fix suggested by Derek Price.
2183
2184 2005-09-24  Jim Meyering  <jim@meyering.net>
2185
2186         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2187         so we can once again use a positive bitfield width of 1 -- now we
2188         don't have to explain why we were using a bitfield width of 2.
2189
2190 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2191
2192         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2193         Problem reported by Eric Blake.
2194         (getaddrinfo): Initialize se so that it's not garbage.
2195         Redo internal storage allocation so that it doesn't make unportable
2196         assumptions about alignment.
2197         Fix a memory leak.
2198
2199         * utimens.c (futimens): Use futimesat if available.
2200         Prefer it to futimes since it doesn't have the futimes bug.
2201
2202         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2203         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2204         Instead, declare a function that returns a pointer to an array,
2205         and use verify_type__ to declare the size of the array.
2206         Problem and germ of a solution reported by Bruno Haible.
2207         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2208         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2209
2210 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2211
2212         Sync from coreutils.
2213
2214         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2215         stat-time.h.
2216         * argmatch.h: Include verify.h
2217         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2218         (ARGMATCH_ASSERT): Remove; unused.
2219         * canonicalize.c: Assume STDC_HEADERS.
2220         * exclude.c: Include "strcase.h".
2221         * regex_internal.h [!defined _LIBC]: Likewise.
2222         * getusershell.c: Include stdio--.h rather than stdio.h
2223         and stdio-safer.h.
2224         (getusershell): Call fopen, not fopen_safer.
2225         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2226         Do not include unistd-safer.h.
2227         (save_cwd): Don't call fd_safer; no longer needed
2228         now that we include fcntl--.h.
2229
2230         * getdate.y (relative_time): New type.
2231         (RELATIVE_TIME_0): New constant.
2232         (parser_control): Use relative_time instead of doing it ourselves.
2233         (%union): Add new relative_time rel member.
2234         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2235         Now typeless.
2236         (relunit, relunit_snumber): Now of type rel.
2237         (zone, rel, relunit, get_date): Adjust to above changes.
2238
2239         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2240         Do not include unistd-safer.h.
2241         (getloadavg): Don't call fd_safer; no longer needed
2242         now that we include fcntl--.h.
2243
2244         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2245         (make_dir_parents): Treat ENOSYS like EEXIST.
2246
2247         Improve quality of diagnostics on restore_cwd failure.
2248         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2249         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2250         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2251         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2252         each time through the loop.  Do not diagnose restore_cwd failure;
2253         that is the caller's job (and perhaps the caller does not care).
2254
2255         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2256         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2257         If the file already exists but is not a directory, don't bother
2258         to try to make its parents.
2259         Close potential file descriptor leak if we can't chdir("/") (!).
2260         Don't always return true if chdir($PWD) fails; return true only
2261         if the requested action was done successfully (except for the
2262         chdir($PWD)).
2263         Don't log final directory unless we actually made it.
2264         Refactor to avoid duplicate code to fix up permissions.
2265         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2266
2267         * strftime.c (my_strftime): Rewrite the previous change slightly,
2268         to make it a bit faster and (I hope) clearer.
2269         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2270         Fix bug in formats like %2N.
2271
2272         * verify.h: New file.
2273
2274 2005-09-22  Jim Meyering  <jim@meyering.net>
2275
2276         Sync from coreutils.
2277
2278         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2279
2280         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2281         the .tm_year member, since otherwise gcc-4.0 would now warn about
2282         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2283
2284         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2285         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2286
2287         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2288         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2289         when run in a time zone for which daylight savings time is in effect
2290         for the starting date.
2291
2292         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2293         stop us from restricting permissions of just-created absolute-named
2294         directories.
2295         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2296         to restore initial working directory.
2297         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2298         to tell caller if/when we change the working directory and are
2299         unable to return to the initial one.
2300         * mkdir-p.h (make_dir_parents): Update prototype.
2301         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2302         `return false'.  This fixes a bug introduced on 2004-07-30.
2303
2304         * openat.c (fdopendir): Be sure to close the supplied
2305         file descriptor before returning.  This makes our replacement
2306         implementation a little closer to Solaris's, where fdopendir
2307         ties the file descriptor to the returned DIR* pointer.
2308         * openat.c (unlinkat): New function.
2309         * openat.h (unlinkat): Add prototype.
2310         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2311         (openat_restore_fail): Rename from openat_restore_die.
2312         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2313
2314         Provide an alternative to exiting immediately upon save_cwd or
2315         restore_cwd failure.  Now, an application can arrange e.g.,
2316         to perform a longjump in that case.
2317         * openat.c: Include dirname.h.
2318         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2319         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2320         and openat_restore_die rather than calling error directly.
2321         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2322
2323         * openat-die.c (openat_save_die, openat_restore_die): New file.
2324         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2325
2326         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2327         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2328                             int utc, int nanoseconds);
2329         Background:
2330         date should not have to allocate a megabyte of virtual memory to
2331         handle a format argument like +%1048575T.  When implemented with
2332         strftime, it must allocate such a buffer, use strftime to fill it
2333         in, print it, then free it.
2334         With fprintftime, it simply prints everything and exits.
2335         With no need for memory allocation, that's one fewer way to fail.
2336         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2337         optional field width, not before, so we accept %9:z, not %:9z.
2338         (my_strftime): Be sure to use L_('x') for literals.
2339
2340         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2341         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2342         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2343         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2344         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2345         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2346         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2347         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2348         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2349
2350         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2351         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2352         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2353         and don't include <sys/file.h>).
2354
2355 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2356
2357         Sync from coreutils.
2358
2359         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2360         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2361         [!LDAV_DONE]: Avoid unused variable warning.
2362
2363 2005-09-21  Bruno Haible  <bruno@clisp.org>
2364
2365         * unicodeio.h (unicode_to_mb): New declaration.
2366
2367 2005-09-20  Derek Price  <derek@ximbiot.com>
2368
2369         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2370
2371 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2372
2373         Use a consistent style for including <config.h>.
2374         * __fpending.c, acl.c, argmatch.c,
2375         argp-help.c, argp-parse.c,
2376         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2377         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2378         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2379         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2380         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2381         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2382         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2383         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2384         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2385         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2386         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2387         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2388         modechange.c, mountlist.c, open-safer.c, physmem.c,
2389         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2390         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2391         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2392         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2393         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2394         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2395         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2396         userspec.c, utimecmp.c, version-etc-fsf.c,
2397         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2398         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2399         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2400         Standardize inclusion of config.h.
2401         * __fpending.h, dirfd.h, getdate.h, human.h,
2402         inttostr.h:  Removed inclusion of config.h from header files.
2403         * inttostr.c:  Adjusted in-tree users.
2404         * timespec.h: Remove superfluous warning to include config.h.
2405         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2406         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2407         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2408         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2409
2410 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2411
2412         * stat-time.h: New file.
2413         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2414         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2415         in a different way.
2416         (timespec_cmp): New function.
2417         * utimecmp.c: Include stat-time.h.
2418         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2419         members exist, not on the obsolescent ST_MTIM_NSEC.
2420         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2421
2422 2005-09-15  Derek Price  <derek@ximbiot.com>
2423             Paul Eggert  <eggert@cs.ucla.edu>
2424
2425         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2426         changes, consolidating in...
2427         * regex_internal.h: ...this file.
2428
2429 2005-09-15  Derek Price  <derek@ximbiot.com>
2430
2431         * regex_internal.h: Blank `pure' for GNUC < 3.
2432         * regex_internal.c: Ditto, using this...
2433         (__GNUC_PREREQ): ...new macro.
2434         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2435         (__GNUC_PREREQ): ...this new macro.
2436
2437         * strstr.h: Include string.h. Define strstr as a macro here.
2438
2439 2005-09-13  Derek Price  <derek@ximbiot.com>
2440
2441         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2442         failure.
2443         Reported by Jim Meyering  <jim@meyering.net>.
2444
2445 2005-09-13  Jim Meyering  <jim@meyering.net>
2446
2447         * canon-host.c: Filter through gnu indent and reword comments slightly.
2448         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2449
2450 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2451
2452         * lib/base64.c: Typo.
2453         (base64_encode): Put b64str in initialized data section.
2454
2455 2005-09-12  Derek Price  <derek@ximbiot.com>
2456
2457         Return usable errors from canon-host.
2458         * canon-host.h: New file.
2459         * canon-host.c (canon_host): Wrap...
2460         (canon_host_r): ...this new function, which now relies exclusively on
2461         getaddrinfo.
2462         (ch_strerror): New function.
2463         (last_cherror): New global.
2464         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2465         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2466         void *.
2467         (freeaddrinfo): Free ai->ai_canonname when set.
2468
2469 2005-09-12  Derek Price  <derek@ximbiot.com>
2470             Paul Eggert  <eggert@cs.ucla.edu>
2471
2472         * glob-libc.h: Renamed from glob_.h.  The new version is
2473         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2474         protecting things that should be done only in gnulib contexts.
2475         * glob_.h: New file, containing only the glob things needed for
2476         gnulib.
2477         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2478         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2479         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2480         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2481         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2482         and to respect the namespace rules better.
2483
2484 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2485
2486         Merge glibc and coreutils changes into gnulib, plus a few
2487         extra fixes.
2488         * md5.c: Use #error rather than a string.
2489         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2490         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2491         (__attribute__): Define to empty for non recent-GCC.
2492         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2493         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2494         Renamed from their non-__ counterparts, with new macros replacing
2495         them if not _LIBC.  Add __THROW attribute.
2496         (rol): Remove.
2497         (struct md5_ctx): Align buffer if using GCC.
2498         * sha1.h (struct sha1_ctx): Likewise.
2499         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2500         The old name was backwards.
2501         (NOTSWAP): Remove; not used.
2502         (rol): New macro, moved here from md5.h.
2503         (sha1_process_block): Remove a FIXME that doesn't make sense.
2504
2505 2005-09-12  Derek Price  <derek@ximbiot.com>
2506
2507         * gai_strerror.c: Include config.h when available.  Include
2508         getaddrinfo.h before other headers to test interface.
2509         Reported by Larry Jones <lawrence.jones@ugs.com>.
2510
2511 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2512
2513         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2514         definitions, since that's the preferred style in glibc.
2515         Fix a minor spacing issue, and update copyright notice to match glibc's.
2516
2517 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2518
2519         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2520
2521 2005-09-06  Simon Josefsson  <jas@extundo.com>
2522
2523         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2524         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2525
2526 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2527
2528         Change bitset word type from unsigned int to unsigned long int,
2529         as this has better performance on typical 64-bit hosts.
2530         Port bitset code to hosts with unusual word sizes.
2531         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2532         (build_collating_symbol):
2533         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2534         argument is a bitset.  This is merely a style issue, but it makes
2535         it clearer that an entire array is expected.
2536         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2537         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2538         Port to the case where bitset_word is not the same as unsigned int.
2539         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2540         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2541         Likewise.
2542         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2543         (build_trtable, group_nodes_into_DFAstates):
2544         Likewise.
2545         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2546         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2547         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2548         * regexec.c (group_nodes_into_DFAstates): Likewise.
2549         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2550         * regcomp.c (optimize_subexps, lower_subexp):
2551         Work even if bitset_word has holes in its bitwise representation.
2552         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2553         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2554         Likewise.
2555         * regex_internal.c (re_string_reconstruct):
2556         Don't assume UCHAR_MAX == 255.
2557         * regex_internal.h (bitset_set_all): Likewise.
2558         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2559         All uses changed.
2560         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2561         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2562         All uses changed.
2563         (BITSET_WORD_MAX): New macro.
2564         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2565         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2566         (bitset_empty, bitset_copy):
2567         Prefer sizeof (bitset) to multiplying it out ourselves.
2568         (bitset_not_merge): Remove; unused.
2569         (bitset_contain): Return bool, not unsigned int with one bit on.
2570         All callers changed.
2571         * regexec.c (build_trtable): Don't assume bitset has no stricter
2572         alignment than re_node_set; do this by defining a new internal
2573         type struct dests_alloc and using it to allocate memory.
2574
2575 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2576
2577         Check for arithmetic overflow when calculating sizes, to prevent
2578         some buffer-overflow issues.  These patches are conservative, in the
2579         sense that when I couldn't determine whether an overflow was possible,
2580         I inserted a run-time check.
2581         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2582         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2583         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2584         (re_xnrealloc, re_x2nrealloc): New inline functions.
2585         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2586         (build_equiv_class, build_charclass): Check for arithmetic overflow
2587         in size expression calculations.
2588         * lib/regex_internal.c (re_string_realloc_buffers):
2589         (build_wcs_upper_buffer, re_node_set_add_intersect):
2590         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2591         (re_dfa_add_node, register_state): Likewise.
2592         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2593         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2594         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2595         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2596
2597 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2598
2599         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2600         to avoid a collision with bits/local_lim.h in glibc.
2601         All uses changed.  Problem reported by Dmitry V. Levin in
2602         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2603
2604         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2605         bugs in int versus size_t comparisons.
2606         (re_string_context_at): Fix bug where the code assumed that
2607         Idx is signed.
2608
2609         Use bool where appropriate.
2610         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2611         All callers changed.
2612         (calc_eclosure_iter): Likewise, for ROOT arg.
2613         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2614         (build_charclass_op): Likewise, for NON_MATCH arg.
2615         * regex_internal.c (re_string_allocate, re_string_construct):
2616         (re_string_construct_common): Likewise, for ICASE arg.
2617         * regexec.c (re_search_2_stub, re_search_stub):
2618         Likewise, for RET_LEN arg.
2619         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2620         (set_regs): Likewise, for FL_BACKTRACK arg.
2621         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2622         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2623         (calc_eclosure_iter, parse_bracket_exp):
2624         Use bool for internal variables that are booleans.
2625         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2626         (set_regs, build_sifted_states, sift_states_bkref):
2627         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2628         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2629         (find_collation_sequence_value):
2630         Likewise.
2631         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2632         (re_node_set_compare):
2633         Return bool, not int. All callers changed.
2634         * regexec.c (check_halt_node_context, check_dst_limits):
2635         (build_trtable, check_node_accept): Likewise.
2636         * regex_internal.h: Include stdbool.h.
2637
2638         Fix bugs uncovered when converting to bool.
2639         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2640         failure instead of charging ahead blindly.
2641         * regex_internal.c (register_state): Likewise.
2642         * regexec.c (re_search_2_stub): Use simpler method than boolean
2643         for freeing internal storage.
2644         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2645         bitset pieces used as boolean, to avoid undefined behavior
2646         on hosts that do int overflow checking.
2647
2648 2005-08-31  Derek Price  <derek@ximbiot.com>
2649
2650         * getdelim.c (getdelim): Return EOF on EOF.
2651         Reported by Larry Jones <lawrence.jones@ugs.com>.
2652
2653 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2654
2655         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2656         lengths fit in regoff_t; this isn't true if regoff_t is the same
2657         width as size_t.
2658         * regex.c (re_search_internal): 5th arg is LAST_START
2659         (= START + RANGE) instead of RANGE.  This avoids overflow
2660         problems when regoff_t is the same width as size_t.
2661         All callers changed.
2662         (re_search_2_stub): Check for overflow when adding the
2663         sizes of the two strings.
2664         (re_search_stub): Check for overflow when adding START
2665         to RANGE; if it occurs, substitute the extreme value.
2666
2667 2005-08-31  Jim Meyering  <jim@meyering.net>
2668
2669         * regcomp.c (search_duplicated_node): Make first pointer arg
2670         a pointer-to-const.
2671         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2672         (register_state): Likewise.
2673         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2674         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2675         (group_nodes_into_DFAstates): Likewise.
2676
2677 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2678
2679         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2680         old glibc regex code mishandles strings longer than 2**31 bytes.
2681         This patch fixes this when the regex code is used in gnulib
2682         (i.e., outside glibc).
2683
2684         This patch should not affect the use of the regex code inside
2685         glibc.  No doubt this problem also needs to be handled for glibc
2686         as well, but the result will be an incompatible change to the
2687         glibc ABI, and the old ABI will have to be supported too.  That
2688         can be the the subject for another patch.
2689
2690         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2691         governing whether the rest of this patch is active.  By default,
2692         the macro is disabled and the patch has no effect.
2693         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2694         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2695         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2696         (re_match_2, re_set_registers): Use the new types.
2697         * regex_internal.h (Idx, re_hashval_t): New types.
2698         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2699         New macros.
2700         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2701         (re_string_context_at, bin_tree_t, re_dfastate_t):
2702         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2703         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2704         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2705         (re_string_char_size_at, re_string_wchar_at):
2706         (re_string_elem_size_at):
2707         Use the new types and macros to port to 64-bit hosts.
2708         Use unsigned types for internal values, so that the code
2709         mostly works even for arrays larger than SSIZE_MAX.
2710         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2711         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2712         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2713         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2714         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2715         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2716         (calc_inveclosure, parse_dup_op, build_range_exp):
2717         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2718         (fetch_number, create_token_tree, mark_opt_subexp):
2719         Likewise.
2720         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2721         (create_cd_newstate, re_string_allocate, re_string_construct):
2722         (re_string_realloc_buffers, build_wcs_upper_buffer):
2723         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2724         (re_string_reconstruct, re_string_peek_byte_case):
2725         (re_string_fetch_byte_case, re_string_context_at):
2726         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2727         (re_node_set_init_copy, re_node_set_add_intersect):
2728         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2729         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2730         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2731         (re_acquire_state, re_acquire_state_context, register_state):
2732         Likewise.
2733         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2734         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2735         (re_search_internal, re_search_2_stub, re_search_stub)
2736         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2737         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2738         (update_cur_sifted_state, check_dst_limits):
2739         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2740         (check_subexp_limits, sift_states_bkref, merge_state_array):
2741         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2742         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2743         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2744         (expand_bkref_cache, check_node_accept_bytes):
2745         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2746         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2747         (acquire_init_state_context, check_halt_node_context):
2748         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2749         (sift_states_backward, clean_state_log_if_needed):
2750         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2751         (find_recover_state, transit_state_sb, transit_state_mb):
2752         (transit_state_bkref, build_trtable, match_ctx_clean):
2753         Likewise.
2754         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2755         to work around an assumption that REG_MISSING is negative.
2756
2757         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2758         (seek_collating_symbol_entry) [defined _LIBC]:
2759         (lookup_collation_sequence_value) [defined _LIBC]:
2760         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2761         Use prototypes rather than old-style function definitions.
2762         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2763         (transit_state_sb) [0]:
2764         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2765
2766         * regexec.c (re_search_internal): Simplify update of rm_so and
2767         rm_eo.
2768
2769         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2770         (optimize_subexps, lower_subexp):
2771         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2772         since the signed shift might overflow.  Use 1u<<31 instead.
2773         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2774         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2775         Likewise.
2776
2777         * regcomp.c (optimize_subexps, lower_subexp):
2778         Use CHAR_BIT rather than 8, for clarity.
2779         * regexec.c (check_dst_limits_calc_pos_1):
2780         (check_subexp_matching_top): Likewise.
2781         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2782         have to worry about portability issues when shifting it left.
2783         Remove no-longer-needed test for table_size > 0.
2784         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2785         in a word, as the resulting behavior is undefined.
2786         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2787         in one case, a <= should have been an <, and in another case the
2788         whole test was missing.
2789         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2790         the standard name CHAR_BIT.
2791         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2792         this is not true on one's complement and signed-magnitude hosts.
2793
2794         * regex_internal.h (re_sub_match_top_t): Remove unused member
2795         next_last_offset.
2796         (struct re_dfa_t): Remove unused member states_alloc.
2797         * regcomp.c (init_dfa): Don't initialize unused members.
2798
2799 2005-08-31  Bruno Haible  <bruno@clisp.org>
2800
2801         * strstr.c: Include <stddef.h>, for NULL.
2802         * strcasestr.c: Likewise.
2803         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2804
2805 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2806
2807         * iconvme.h: Add prototype for iconv_alloc.
2808
2809 2005-08-29  Simon Josefsson  <jas@extundo.com>
2810
2811         * iconvme.c: Fix errno.
2812
2813 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
2814
2815         * iconvme.c: Split iconv_string into iconv_alloc.
2816
2817 2005-08-27  Jim Meyering  <jim@meyering.net>
2818
2819         * fopen-safer.c: Merge minor changes from coreutils.
2820         * dup-safer.c: Likewise.
2821         * fd-safer.c: Likewise.
2822
2823         Merge from coreutils.
2824         * stdio--.h: New file.
2825         * stdlib--.h: New file.
2826         * mkstemp-safer.c: New file.
2827
2828         GNU tar needs these.
2829         * pipe-safer.c: New file.
2830         * creat-safer.c: New file.
2831         * fcntl--.h (creat): Define to creat_safer.
2832         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2833         * unistd--.h (pipe): Define to pipe_safer.
2834         * unistd-safer.h: Declare pipe_safer.
2835
2836 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2837
2838         * regex_internal.h: Remove all references to
2839         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2840         or better.
2841         (bitset_not, bitset_merge, bitset_not_merge):
2842         (bitset_mask, re_string_allocate, re_string_construct):
2843         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2844         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2845         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2846         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2847         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2848         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2849         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2850         (re_acquire_state_context):
2851         Remove unnecessary forward decls.
2852         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2853         Put __attribute at function definition,
2854         now that the function decl has been removed.
2855         * lib/regex_internal.c (re_string_peek_byte_case):
2856         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2857         Likewise.
2858
2859 2005-08-26  Simon Josefsson  <jas@extundo.com>
2860
2861         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2862         Haible <bruno@clisp.org>.
2863
2864 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2865
2866         * regexec.c (set_regs): Don't alloca with an unbounded size.
2867
2868         alloca modernization/simplification for regex.
2869         * regex.c: Remove portability cruft for alloca.  This no longer
2870         needs to be at the start of the file, and can be moved into
2871         regex_internal.h and simplified.
2872         * regex_internal.h: Include <alloca.h>.
2873         (__libc_use_alloca) [!defined _LIBC]: New macro.
2874         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2875         now works outside glibc.
2876
2877 2005-08-24  Simon Josefsson  <jas@extundo.com>
2878
2879         * getpass.c: Add WIN32 implementation.  Conditionalize use of
2880         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
2881         GLIBC specific code.
2882
2883 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2884
2885         Make regex safe for g++.  This fixes one real bug (an "err"
2886         that should have been "*err").  g++ problem reported by
2887         Sam Steingold.
2888         * regex_internal.h (re_calloc): New macro, consistent with
2889         re_malloc etc.  All callers of calloc changed to use re_calloc.
2890         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2891         not int.  All callers changed.
2892         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2893         just use an array of size MB_LEN_MAX.
2894         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2895         (find_recover_state): Change "err" to "*err"; this fixes what
2896         appears to be a real bug.
2897         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2898         versus int.
2899
2900 2005-08-25  Jim Meyering  <jim@meyering.net>
2901
2902         * open-safer.c: Include <config.h>.
2903         Otherwise, we'd lose LARGEFILE support in any file using
2904         e.g. "fcntl--.h"
2905
2906 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2907
2908         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2909         * regex.h (regerror): Likewise.
2910
2911         * regex.c: Do not include <sys/types.h>, as POSIX no longer
2912         requires this.  (The code never needed it.)
2913
2914         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2915         All uses of recently-renamed identifiers changed to use the new,
2916         POSIX-compliant names.  The code will build and run just fine
2917         without these changes, but it's better to eat our own dog food
2918         and use the standard-conforming names.
2919
2920         * regex.h: Fix a multitude of POSIX name space violations.
2921         These changes have an effect only for programs that define
2922         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2923         do not change anything for programs compiled in the normal way.
2924         Also, there is no effect on the ABI.
2925
2926         (_REGEX_SOURCE): New macro.
2927         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2928         defined and _GNU_SOURCE is not; this fixes a name space violation.
2929
2930         Rename the following macros to obey POSIX requirements.
2931         The old names are still visible as macros if _REGEX_SOURCE is defined.
2932         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2933         RE_BACKSLASH_ESCAPE_IN_LISTS.
2934         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2935         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2936         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2937         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2938         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2939         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2940         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2941         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2942         (REG_INTERVALS): renamed from RE_INTERVALS.
2943         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2944         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2945         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2946         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2947         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2948         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2949         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2950         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2951         RE_UNMATCHED_RIGHT_PAREN_ORD.
2952         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2953         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2954         (REG_DEBUG): renamed from RE_DEBUG.
2955         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2956         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
2957         unusual, since we can't clash with the POSIX REG_ICASE.
2958         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2959         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2960         (REG_NO_SUB): renamed from RE_NO_SUB.
2961         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2962         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2963         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2964         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2965         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2966         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2967         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2968         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2969         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2970         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2971         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2972         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2973         RE_SYNTAX_POSIX_MINIMAL_BASIC.
2974         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2975         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2976         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2977         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
2978         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2979         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2980         (REG_FIXED): Renamed from REGS_FIXED.
2981         (REG_NREGS): Renamed from RE_NREGS.
2982
2983         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2984         of other REG_* macros, since POSIX says the user is allowed to
2985         #undef these macros selectively.
2986
2987         (reg_errcode_t): Update comment stating what other tables need
2988         to be consistent.
2989
2990         Rename the following enum values to obey POSIX requirements.
2991         The old names are still visible as macros.
2992         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
2993         is not defined, since GNU is supposed to be a superset of POSIX as
2994         much as possible, and since we want reg_errcode_t to be a signed
2995         type for implementation consistency.
2996         (_REG_NOERROR): Renamed from REG_NOERROR.
2997         (_REG_NOMATCH): Renamed from REG_NOMATCH.
2998         (_REG_BADPAT): Renamed from REG_BADPAT.
2999         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3000         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3001         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3002         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3003         (_REG_EBRACK): Renamed from REG_EBRACK.
3004         (_REG_EPAREN): Renamed from REG_EPAREN.
3005         (_REG_EBRACE): Renamed from REG_EBRACE.
3006         (_REG_BADBR): Renamed from REG_BADBR.
3007         (_REG_ERANGE): Renamed from REG_ERANGE.
3008         (_REG_ESPACE): Renamed from REG_ESPACE.
3009         (_REG_BADRPT): Renamed from REG_BADRPT.
3010         (_REG_EEND): Renamed from REG_EEND.
3011         (_REG_ESIZE): Renamed from REG_ESIZE.
3012         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3013         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3014         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3015         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3016         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3017
3018         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3019         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3020         changed.  But support the old name if the new one is not defined
3021         and if _REGEX_SOURCE.
3022
3023         Change the following member names in struct re_pattern_buffer.
3024         The old names are still supported if !_REGEX_SOURCE.
3025         The new names are always supported, regardless of _REGEX_SOURCE.
3026         (re_buffer): Renamed from buffer.
3027         (re_allocated): Renamed from allocated.
3028         (re_used): Renamed from used.
3029         (re_syntax): Renamed from syntax.
3030         (re_fastmap): Renamed from fastmap.
3031         (re_translate): Renamed from translate.
3032         (re_can_be_null): Renamed from can_be_null.
3033         (re_regs_allocated): Renamed from regs_allocated.
3034         (re_fastmap_accurate): Renamed from fastmap_accurate.
3035         (re_no_sub): Renamed from no_sub.
3036         (re_not_bol): Renamed from not_bol.
3037         (re_not_eol): Renamed from not_eol.
3038         (re_newline_anchor): Renamed from newline_anchor.
3039
3040         Change the following member names in struct re_registers.
3041         The old names are still supported if !_REGEX_SOURCE.
3042         The new names are always supported, regardless of _REGEX_SOURCE.
3043         (rm_num_regs): Renamed from num_regs.
3044         (rm_start): Renamed from start.
3045         (rm_end): Renamed from end.
3046
3047         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3048         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3049         Prepend __ to parameter names.
3050
3051         Undo yesterday's changes.
3052
3053 2005-08-24  Jim Meyering  <jim@meyering.net>
3054
3055         Sync from coreutils.
3056         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3057
3058 2005-08-21  Bruno Haible  <bruno@clisp.org>
3059
3060         * lock.h: Add multiple inclusion guard.
3061         * tls.h: Add multiple inclusion guard.
3062
3063 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3064
3065         * regex.h (REG_NOSYS)
3066         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3067         Define, since POSIX requires it as of 2001.
3068         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3069         New private symbol, used to keep the enum signed in all cases.
3070         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3071         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3072
3073         * regex_internal.c (re_string_skip_chars, register_state):
3074         (calc_state_hash):
3075         Remove forward decls; no longer needed now that we use prototypes.
3076         * regexec.c (acquire_init_state_context, check_halt_node_context):
3077         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3078         (clean_state_log_if_needed): Likewise.
3079
3080 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3081
3082         Fix problems reported by Sam Steingold in
3083         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3084         * regexec.c (sift_states_bkref): Fix portability bug: the code
3085         assumed that reg_errcode_t is a signed type, which is not
3086         necessarily true if _XOPEN_SOURCE is not defined.
3087         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3088         some compilers warn about it otherwise.
3089
3090 2005-08-20  Jim Meyering  <jim@meyering.net>
3091
3092         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3093         of unused local, dfa.
3094
3095 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3096
3097         * regcomp.c (create_initial_state): Remove duplicate decl.
3098         (init_word_char, create_initial_state, duplicate_node_closure):
3099         (fetch_token, peek_token_bracket, build_range_exp):
3100         (build_collating_symbol): Remove forward decls; no longer needed
3101         now that we use prototypes.
3102
3103         * regcomp.c:
3104         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3105         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3106         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3107         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3108         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3109         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3110         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3111         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3112         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3113         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3114         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3115         (build_charclass, build_charclass_op, fetch_number, create_tree):
3116         (create_token_tree, mark_opt_subexp, duplicate_tree):
3117         Use prototypes rather than old-style definitions.
3118
3119         * regex_internal.c:
3120         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3121         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3122         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3123         (re_string_reconstruct, re_string_peek_byte_case):
3124         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3125         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3126         (re_node_set_init_copy, re_node_set_add_intersect):
3127         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3128         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3129         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3130         (re_acquire_state, re_acquire_state_context, register_state):
3131         (create_ci_newstate, create_cd_newstate, free_state):
3132         Likewise.
3133         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3134         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3135         (re_search_internal, prune_impossible_nodes):
3136         (acquire_init_state_context, check_matching, static):
3137         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3138         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3139         (update_regs, sift_states_backward, build_sifted_states):
3140         (clean_state_log_if_needed, merge_state_array):
3141         (update_cur_sifted_state, add_epsilon_src_nodes):
3142         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3143         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3144         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3145         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3146         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3147         (check_arrival, check_arrival_add_next_nodes):
3148         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3149         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3150         (check_node_accept_bytes, check_node_accept, extend_buffers):
3151         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3152         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3153         (sift_ctx_init):
3154         Likewise.
3155
3156         * regex_internal.h:
3157         (re_string_allocate, re_string_construct, re_string_reconstruct):
3158         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3159         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3160         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3161         (re_string_context_at, re_string_peek_byte_case):
3162         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3163         is defined, since we now use prototypes always.
3164
3165         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3166         C89 or better.  All uses removed.
3167
3168 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3169
3170         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3171         [defined lint]: Suppress bogus uninitialized-variable warnings.
3172
3173         * regcomp.c (duplicate_node): Return new index, not an error code,
3174         and let the caller return REG_ESPACE if out of space.  This
3175         removes an uninitialied-variable warning with GCC 4.0.1, and also
3176         avoids taking the address of a local variable.  All callers
3177         changed.
3178
3179 2005-08-19  Jim Meyering  <jim@meyering.net>
3180
3181         * regexec.c (proceed_next_node): Redo local variables to
3182         avoid GCC shadowing warnings.
3183
3184 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3185
3186         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3187         (re_node_set_insert_last, re_dfa_add_node):
3188         Rename local variables to avoid GCC shadowing warnings.
3189
3190 2005-08-18  Bruno Haible  <bruno@clisp.org>
3191
3192         * strstr.c (strstr): Fix return value in multibyte case.
3193         * strcasestr.c (strcasestr): Likewise.
3194
3195 2005-08-17  Jim Meyering  <jim@meyering.net>
3196
3197         Make the %s format (seconds since the epoch) work for a negative
3198         number and when used with a zero-padded field width, e.g. %015s.
3199
3200         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3201         label so that it precedes the code to set `digits'.  Otherwise,
3202         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3203         print `00-22'.  Now, it prints `-0022', as it should.
3204
3205 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3206
3207         * regex.h: Remove useless space-before-tab.  From coreutils.
3208
3209 2005-08-17  Bruno Haible  <bruno@clisp.org>
3210
3211         * strcasestr.h: New file.
3212         * strcasestr.c: New file.
3213
3214 2005-08-17  Bruno Haible  <bruno@clisp.org>
3215
3216         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3217         * strstr.c: Completely rewritten, with multibyte locale support.
3218
3219 2005-08-17  Bruno Haible  <bruno@clisp.org>
3220
3221         * strcasecmp.c: Use mbuiter.h.
3222
3223 2005-08-17  Bruno Haible  <bruno@clisp.org>
3224
3225         * mbuiter.h: New file.
3226
3227 2005-08-16  Bruno Haible  <bruno@clisp.org>
3228
3229         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3230         (mbi_init): Update.
3231         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3232         NUL byte, not after it.
3233
3234 2005-08-16  Bruno Haible  <bruno@clisp.org>
3235
3236         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3237         the valid ones. Makes the comparison operations transitive:
3238         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3239         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3240
3241 2005-08-16  Bruno Haible  <bruno@clisp.org>
3242
3243         * strcase.h (strcasecmp): Add note in comments.
3244         * strncasecmp.c: Use code from strcasecmp.c.
3245         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3246         (strcasecmp): Work correctly in multibyte locales.
3247
3248 2005-08-16  Bruno Haible  <bruno@clisp.org>
3249
3250         * strnlen1.h: New file.
3251         * strnlen1.c: New file.
3252
3253 2005-08-16  Bruno Haible  <bruno@clisp.org>
3254
3255         * mbfile.h: New file.
3256
3257 2005-08-16  Bruno Haible  <bruno@clisp.org>
3258
3259         * mbiter.h: New file.
3260
3261 2005-08-16  Bruno Haible  <bruno@clisp.org>
3262
3263         * mbchar.h: New file.
3264         * mbchar.c: New file.
3265
3266 2005-08-16  Bruno Haible  <bruno@clisp.org>
3267
3268         * tls.h: New file, from GNU gettext.
3269         * tls.c: New file, from GNU gettext.
3270
3271 2005-08-15  Bruno Haible  <bruno@clisp.org>
3272
3273         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3274         is defined.
3275
3276 2005-08-14  Jim Meyering  <jim@meyering.net>
3277
3278         Sync from coreutils.
3279
3280         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3281         Use the hash-table-based cycle-detection code not just when
3282         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3283         Reported by James Youngman in
3284         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3285         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3286         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3287         This lets us compile with -DFTS_DEBUG, once again.
3288         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3289         * fts.c (fd_safer): Remove decl.
3290         Include fcntl--.h rather than unistd-safer.h
3291         (fts_safe_changedir): Don't call fd_safer; no longer needed
3292         now that we include fcntl--.h.
3293
3294 2005-08-11  Simon Josefsson  <jas@extundo.com>
3295
3296         * readline.h, readline.c: New file.
3297
3298 2005-08-11  Bruno Haible  <bruno@clisp.org>
3299
3300         * strnlen.h (strnlen): Change parameter name to match comment.
3301
3302 2005-08-10  Simon Josefsson  <jas@extundo.com>
3303
3304         * strndup.c: Use strnlen.h.
3305
3306         * strnlen.h: New file.
3307
3308 2005-08-02  Simon Josefsson  <jas@extundo.com>
3309
3310         * getline.h, getline.c: Rewrite.
3311
3312         * getdelim.h, getdelim.c: New files, ported from glibc.
3313
3314 2005-07-31  Bruno Haible  <bruno@clisp.org>
3315
3316         * lock.h (gl_lock_initializer): New macro.
3317         (gl_lock_define_initialized): Use it.
3318         (gl_rwlock_initializer): New macro.
3319         (gl_rwlock_define_initialized): Use it.
3320         (gl_recursive_lock_initializer): New macro.
3321         (gl_recursive_lock_define_initialized): Use it.
3322
3323 2005-07-26  Bruno Haible  <bruno@clisp.org>
3324
3325         * lock.h: Update from GNU gettext.
3326         * lock.c: Update from GNU gettext.
3327
3328 2005-07-18  Bruno Haible  <bruno@clisp.org>
3329
3330         * lock.h (gl_once_t): New type.
3331         (gl_once_define, gl_once): New macros.
3332         * lock.c (fresh_once): New variable.
3333         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3334         functions.
3335
3336 2005-07-18  Simon Josefsson  <jas@extundo.com>
3337
3338         * check-version.c (check_version): Accept identical versions too.
3339
3340 2005-07-18  Bruno Haible  <bruno@clisp.org>
3341
3342         * lock.h: New file, from GNU gettext.
3343         * lock.c: New file, from GNU gettext.
3344
3345 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3346
3347         * quotearg.c: Add translator comment suggested by Bruno Haible,
3348         with a minor change.
3349
3350 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3351
3352         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3353         copyright symbol and the year.
3354         * version-etc.c (COPYRIGHT_YEAR): New constant.
3355         (version_etc_va): Use parameterized copyright notice.
3356         Reword to conform to the current GNU coding standards.
3357
3358 2005-07-11  Simon Josefsson  <jas@extundo.com>
3359
3360         * size_max.h: New file.
3361
3362 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3363
3364         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3365         block of defines.
3366
3367 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3368        and  Paul Eggert  <eggert@cs.ucla.edu>
3369
3370         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3371         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3372
3373 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3374
3375         * regex.c, regex.h: Sync from libc.
3376         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3377         New files, synced from libc, except that regex_internal.h
3378         currently has a small porting fix.
3379
3380 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3381
3382         Remove the dependency of the strftime module on the tzset module.
3383         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3384         Copy the input structure, to work around some of the bug with
3385         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3386         Solaris releases, you should also use the tzset module, but we won't
3387         require it as a dependency any more since we don't want LGPLed code
3388         to depend on GPLed code.
3389
3390 2005-07-02  Jim Meyering  <jim@meyering.net>
3391
3392         * backupfile.c (backup_args): Change a `0' to NULL.
3393
3394 2005-07-01  Jim Meyering  <jim@meyering.net>
3395
3396         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3397         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3398         * save-cwd.c, tempname.c:
3399         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3400         and don't include <sys/file.h>).
3401
3402 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3403
3404         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3405         declares only 'struct timespec;' (!).
3406
3407 2005-06-29  Jim Meyering  <jim@meyering.net>
3408
3409         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3410         type name.  Use the variable name instead.
3411         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3412
3413 2005-06-28  Simon Josefsson  <jas@extundo.com>
3414
3415         * check-version.h, check-version.c: New files.
3416
3417 2005-06-28  Simon Josefsson  <jas@extundo.com>
3418
3419         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3420         collision with global variable.  Better indentation.  Don't
3421         increment buffer pointer beyond buffer end.  Based on comments
3422         from Paul Eggert <eggert@cs.ucla.edu>.
3423
3424         * base64.h: Indent.
3425
3426 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3427
3428         * canon-host.c (canon-host): Append trailing "," to 0 in
3429         initializer of struct addrinfo, as an indication that we don't
3430         care how many members the structure has.
3431
3432 2005-06-24  Derek Price  <derek@ximbiot.com>
3433         and Bruno Haible  <bruno@clisp.org>
3434
3435         Remove stat module & update lstat.
3436         * stat.c: Remove this file...
3437         (slash_aware_lstat): ...moving this content and its support...
3438         * lstat.c (rpl_lstat): ...into here.
3439         * lstat.h: New file.
3440
3441 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3442
3443         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3444         (ranged_convert): Don't save conversion in a temporary struct.
3445         This causes a warning with GCC 4.0.0, and anyway in the typical
3446         case it's not worth the extra 100 bytes or so of code.
3447         (ranged_convert, __mktime_internal): When calling a function via a
3448         pointer P, use P () rather than (*P) (), as we now assume C89 or
3449         better.
3450
3451 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3452
3453         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3454         "who -r" failed to give output.  Problem reported by Tim Waugh.
3455
3456         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3457         (xcalloc): Use it to avoid needless tests.
3458         Problem reported by Jim Meyering.
3459
3460 2005-06-16  Jim Meyering  <jim@meyering.net>
3461
3462         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3463         when either N or S is zero.
3464
3465 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3466
3467         * argp.h (__option_is_short): Check upper limit of
3468         __key. Isprint() requires its argument to have the value
3469         of an unsigned char or EOF.
3470
3471 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3472
3473         * fnmatch.c (fnmatch): If there is an encoding error in a
3474         multibyte string or pattern, fall back on unibyte matching.
3475         Problem reported by James Youngman.
3476
3477 2005-06-08  Bruno Haible  <bruno@clisp.org>
3478
3479         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3480         warning on mingw.
3481
3482 2005-06-08  Bruno Haible  <bruno@clisp.org>
3483
3484         * csharpcomp.h: New file, from GNU gettext.
3485         * csharpcomp.c: New file, from GNU gettext.
3486         * csharpcomp.sh.in: New file, from GNU gettext.
3487
3488 2005-06-07  Derek Price  <derek@ximbiot.com>
3489
3490         Sync from CVS.
3491         * glob_.h: Indent nested #ifdef.
3492
3493 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3494
3495         Sync from coreutils.
3496         Use "file name" when talking about file names, instead of "filename"
3497         or "path", as per the GNU coding standards.
3498         * mkdir-p.c: Renamed from makepath.c.
3499         (make_dir_parents): Renamed from make_path.  All callers changed.
3500         * mkdir-p.h: Likewise.  All includers changed.
3501         * filenamecat.c: Renamed from path-concat.c.
3502         (file_name_concat): Renamed from path_concat.  All callers changed.
3503         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3504         * filenamecat.h: Likewise.  All includers changed.
3505         * acl.c: Don't use "path" or "filename" to mean "file name"
3506         in comments or local variable names.
3507         * basename.c: Likewise.
3508         * canonicalize.c, canonicalize.h: Likewise.
3509         * dirname.c, dirname.h: Likewise.
3510         * euidaccess.c: Likewise.
3511         * exclude.c: Likewise
3512         * fnmatch_.h, fnmatch_loop.c: Likewise.
3513         * fsusage.c, fsuage.h: Likewise.
3514         * fts.c, fts_.h: Likewise.
3515         * getcwd.c: Likewise.
3516         * getloadavg.c: Likewise.
3517         * mkstemp.c: Likewise.
3518         * mountlist.c, mountlist.h: Likewise.
3519         * openat.c, openat.h: Likewise.
3520         * readlink-stub.c: Likewise.
3521         * readutmp.c, readutmp.h: Likewise.
3522         * rename.c: Likewise.
3523         * rmdir.c: Likewise.
3524         * same.c: Likewise.
3525         * savedir.c: Likewise.
3526         * stripslash.c: Likewise.
3527         * tempname.c: Likewise.
3528         * xreadlink.c: Likewise.
3529         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3530         All uses changed.
3531         * exclude.h: Likewise.
3532
3533         * euidaccess.c (getuid, getgid, getuid, getegid)
3534         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3535         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3536         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3537         * pathmax.h: Include <limits.h> unconditionally, since other
3538         files have been getting away with it for years (MORE/BSD 4.3
3539         is extinct now).
3540         * userspec.c (getpwnam, getgrnam, getgrgid)
3541         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3542
3543         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3544         Define to 256, not 255, as per modern POSIX.
3545
3546 2005-06-01  Bruno Haible  <bruno@clisp.org>
3547
3548         * csharpexec.h: New file, from GNU gettext.
3549         * csharpexec.c: New file, from GNU gettext.
3550         * csharpexec.sh.in: New file, from GNU gettext.
3551
3552 2005-05-31  Derek Price  <derek@ximbiot.com>
3553             Paul Eggert  <eggert@cs.ucla.edu>
3554
3555         Sync from cvs.
3556         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3557
3558 2005-05-29  Derek Price  <derek@ximbiot.com>
3559             Paul Eggert  <eggert@cs.ucla.edu>
3560
3561         * glob_.h, glob.c: New files.
3562
3563 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3564
3565         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3566
3567         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3568         the configuration hassle isn't worth it.
3569         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3570         (LONGEST_MODIFIER, PRIuMAX): Remove.
3571
3572 2005-05-27  Bruno Haible  <bruno@clisp.org>
3573
3574         * getlogin_r.h: Remove second include of <stddef.h>.
3575
3576 2005-05-25  Bruno Haible  <bruno@clisp.org>
3577             Derek Price  <derek@ximbiot.com>
3578
3579         * getlogin_r.h: Simplify API documentation.
3580
3581 2005-05-25  Derek Price  <derek@ximbiot.com>
3582             Paul Eggert  <eggert@cs.ucla.edu>
3583
3584         * getlogin_r.c, getlogin_r.h: New files.
3585
3586 2005-05-22  Bruno Haible  <bruno@clisp.org>
3587
3588         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3589         Also include <sys/param.h> if it defines MIN, MAX.
3590         Based on a patch by Derek Price <derek@ximbiot.com>.
3591
3592 2005-05-22  Bruno Haible  <bruno@clisp.org>
3593
3594         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3595         (INT64_MIN): Fix definition.
3596         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3597
3598         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3599         NEED_SIGNED_INT_TYPES.
3600
3601         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3602         HAVE_SYSTEM_INTTYPES.
3603
3604 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3605
3606         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3607         so that unistd-safer.h (GPL'ed code) need not be included.
3608
3609 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3610
3611         New fts module.
3612         * fts.c: Don't include "cycle-check.h" or "hash.h".
3613         (setup_dir, free_dir): New functions.
3614         (enter_dir, leave_dir): Define trivial
3615         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3616         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3617         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3618         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3619         Move to fts-cycle.c.
3620         (fts_open): Use setup_dir.
3621         (fts_close): Use free_dir.
3622         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3623         This adds a label and some gotos, but the alternatives were messier.
3624         Check for memory allocation failure when entering a dir.
3625         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3626         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3627         (FTS): New member fts_cycle, that is a union that contains the
3628         old active_dir_ht and cycle_state.  All uses changed to mention
3629         fts_cycle.ht and fts_cycle.state.
3630         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3631         fts.c, with the following changes:
3632         (setup_dir, free_dir): New functions.
3633         (enter_dir): Now returns bool.  Return true if successful, false
3634         if memory exhausted.  All callers changed.
3635         Do not bother partly cleaning up on
3636         memory allocation failure; that is free_dir's job.
3637         However, free ad if hash_insert fails, to avoid memory leak.
3638         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3639         fts->fts_options to see which union member to use.
3640
3641 2005-05-20  Jim Meyering  <jim@meyering.net>
3642
3643         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3644         Now a macro, to pacify GCC.
3645
3646 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3647
3648         * chown.c (rpl_chown): Return -1 on failure.
3649
3650 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3651
3652         * canonicalize.c: Include canonicalize.h first, to test interface.
3653         Include <stddef.h> unconditionally, since we assume C89 now.
3654         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3655         * fts.c: Include fts_.h first, to check interface.
3656         Do not include intprops.h; no longer needed.
3657         Include cycle-check.h and hash.h, since fts_.h no longer does.
3658         Remove unnecessary casts of closedir to void.
3659         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3660         decide whether to decrement nlinks.
3661         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3662         (FTS): Use struct hash_table * instead of Hash_table, so that
3663         we no longer need to include hash.h here.
3664
3665 2005-05-17  Jim Meyering  <jim@meyering.net>
3666
3667         * fts.c, fts_.h: New files, from coreutils.
3668
3669 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3670
3671         Sync from coreutils.
3672         * unlinkdir.c, unlinkdir.h: New files.
3673         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3674         regex.h, unlocked-io.h, xtime.h:
3675         White space changes only.
3676         * makepath.c (make_path): Port to hosts where leading "//" is special.
3677         * yesno.c: Include getline.h, not ctype.h.
3678         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3679         Use getline to remove arbitrary restriction on response length.
3680
3681 2005-05-13  Bruno Haible  <bruno@clisp.org>
3682
3683         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3684         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3685         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3686         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3687         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3688         Add support for 64-bit integers in the MSVC compiler.
3689
3690 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3691
3692         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3693         Change the initial comment to refer to GPL, not LGPL.
3694         gnulib-tool will change it to LGPL as needed.
3695
3696         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3697         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3698         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3699         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3700         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3701         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3702         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3703         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3704         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3705         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3706         concatpath.c, config.charset, copy-file.c, copy-file.h,
3707         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3708         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3709         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3710         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3711         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3712         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3713         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3714         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3715         full-read.c, full-read.h, full-write.c, full-write.h,
3716         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3717         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3718         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3719         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3720         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3721         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3722         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3723         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3724         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3725         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3726         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3727         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3728         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3729         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3730         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3731         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3732         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3733         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3734         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3735         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3736         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3737         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3738         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3739         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3740         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3741         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3742         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3743         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3744         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3745         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3746         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3747         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3748         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3749         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3750         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3751         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3752         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3753         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3754         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3755         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3756         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3757         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3758         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3759         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3760         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3761         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3762         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3763         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3764         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3765         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3766         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3767         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3768         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3769         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3770         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3771         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3772         Update FSF postal mail address.
3773
3774 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3775
3776         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3777         specified in ai_socktype. Fix invalid ai_protocol
3778         check. ai_protocol is usually set to 0 or depending on
3779         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3780         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3781         ai_socktype / ai_protocol in the returned addrinfo structure.
3782
3783 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3784             Bruno Haible  <bruno@clisp.org>
3785
3786         * inet_ntop.h: New file.
3787         * inet_ntop.c: New file, from glibc with modifications.
3788
3789 2005-05-08  Jim Meyering  <jim@meyering.net>
3790
3791         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3792
3793 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3794
3795         Merge from coreutils.  Among other things,
3796         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3797         * fd-safer.c: New file.
3798         * fcntl-safer.h, open-safer.c: Remove.
3799         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3800         * dup-safer.c: Include unistd-safer.h first.
3801         Don't include errno.h.
3802         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3803         * file-type.h: Don't assume invoker included sys/stat.h first.
3804         * file-type.c: Rely on file-type.h change.
3805         * getloadavg.c: Include unistd-safer.h.
3806         (getloadavg): Use safer open.
3807         * getusershell.c: Include "stdio-safer.h".
3808         (getusershell): Use safer fopen.
3809         * long-options.c (long_options): Use NULL rather than 0.
3810         * modechange.h (mode_free): Remove; all callers changed to invoke
3811         'free'.
3812         * modechange.c: Likewise.
3813         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3814         (MODE_DONE): New constant.
3815         (struct mode_change): Remove 'next' member.
3816         (make_node_op_equals): New function; like the old one of the
3817         same name, except it allocates an array.
3818         (mode_compile, mode_create_from_ref): Use it.
3819         (mode_compile): Allocate result as an array, not a linked list.
3820         Parse octal string ourself, so that we catch mistakes like "+0".
3821         (mode_adjust): Arg is an array, not a linked list.
3822         * modechange.c: Include stat-macros.h, xalloc.h.
3823         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3824         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3825         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3826         Remove.  This is now stat-macros.h's job.
3827         (talloc): Remove.  All callers replaced by xalloc, so that
3828         our invokers don't have to worry about reporting memory failures.
3829         (make_node_op_equals): Remove.
3830         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3831         New constants.
3832         (struct mode_change): Moved here from modechange.h.
3833         (mode_append_entry): Remove.
3834         (mode_compile): Remove MASKED_OPS arg, since it encouraged
3835         apps to have incorrect behavior.  Use simpler algorithm for head
3836         and tail.  Don't futz with umask; that's now the job of mode_adjust.
3837         Detect more invalid usages rather than having somewhat-random behavior.
3838         Don't insert an "a=" action, as that leads to incorrect behavior.
3839         (mode_compile, mode_create_from_ref): Return NULL on error instead
3840         of an enum, since now there's only one way to have an error.  All
3841         callers changed.
3842         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3843         at the correct time.  Simplify calculation of "+u" and its ilk.
3844         Don't mishandle "+X".
3845         (mode_free): Remove "register" and localize decls.
3846         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3847         (struct mode_change): Move to modechange.c; callers don't
3848         need to see this stuff.
3849         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3850         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3851         (mode_change, mode_adjust): Reflect the new signatures noted above.
3852         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3853         that might redefine system include files.
3854         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3855         (my_usleep): Use NULL rather than (void *) 0.
3856         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3857         Use siginterrupt to specify that system calls should be interrupted.
3858         (rpl_nanosleep): Move initialization of suspended closer to call of
3859         my_usleep.
3860         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
3861         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
3862         (desirable_utmp_entry): New function.
3863         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3864         using x2nrealloc, to simplify logic.
3865         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3866         size calculation.  Do not assume utmp file is a regular file.
3867         * readutmp.h (UT_PID): Moved here from ../src/who.c.
3868         (READ_UTMP_CHECK_PIDS): New constant.
3869         * save-cwd.c: Include unistd-safer.h.
3870         (save_cwd): Use fd_safer.
3871         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3872         [!_LIBC] Include "stat-macros.h" instead.
3873         * unistd-safer.h (fd_safer): New decl.
3874
3875 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
3876
3877         * byteswap_.h: New file.
3878
3879 2005-04-25  Albert Chin  <china@thewrittenword.com>
3880
3881         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3882         Toolkit C bug.
3883
3884 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
3885
3886         * getdate.y (zone): Allow relunit_snumber after tZONE, so
3887         that "UTC +1 second" continues to work.  Problem reported
3888         by Dmitry V. Levin.
3889         (relunit_snumber): New rule.
3890         (relunit): Use it.
3891
3892 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
3893
3894         * getdate.y (universal_time_zone_table): New constant.
3895         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3896         universal_time_zone_table.
3897         (lookup_zone): Prefer universal_time_zone_table to
3898         local_time_zone_table, so that "GMT" time stamps are allowed in
3899         London during the summer.  Problem reported by Ian Abbott.
3900
3901 2005-04-12  Jim Meyering  <jim@meyering.net>
3902
3903         * human.c (humblock): Set *options even when returning due to
3904         xstrtoumax conversion failure.  Thanks to a used-uninitialized
3905         warning from gcc-4.
3906
3907 2005-04-09  Jim Meyering  <jim@meyering.net>
3908
3909         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3910         -Wuninitialized: initialize tm0.tm_year.
3911
3912 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
3913
3914         * getdate.y (parser_control): rels_seen is now a boolean, not a
3915         count, since there's no maximum.  All uses changed.
3916         Add member dsts_seen.
3917         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3918         not being INT_MAX.
3919         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3920         Use pc_rels_seen to decide whther a date is absolute.
3921
3922         * getdate.y (number): Don't overwrite year.
3923         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3924         check.
3925
3926 2005-04-02  Simon Josefsson  <jas@extundo.com>
3927
3928         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3929         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3930
3931 2005-03-27  Jim Meyering  <jim@meyering.net>
3932
3933         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3934
3935 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
3936
3937         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3938         "one's complement" -> "ones' complement" in comment, as per Knuth.
3939         "value of type" -> "type or expression" in comment.
3940         * mktime.c, strftime.c: Propagate intprops.h comment nits.
3941
3942 2005-03-26  Jim Meyering  <jim@meyering.net>
3943
3944         Comment nits.
3945         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3946         Correct typos: s/or/of/.
3947
3948 2005-03-23  Jim Meyering  <jim@meyering.net>
3949
3950         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3951
3952 2005-03-21  Jim Meyering  <jim@meyering.net>
3953
3954         Changes imported from coreutils.
3955
3956         * cycle-check.c: Don't include xalloc.h.
3957
3958         * path-concat.c: Don't include assert.h.
3959         (path_concat): Remove assertion that would have triggered
3960         for ABASE starting with more than one slash.
3961         Reported by Andreas Schwab.
3962
3963         * path-concat.c (path_concat): Set *BASE_IN_RESULT
3964         properly when ABASE is an absolute file name.
3965         Correct the description of this function.
3966         Include <assert.h>.
3967         Add an assertion and a test driver.
3968         This fixes a bug introduced on 2004-07-02.
3969         Andreas Schwab reported the resulting failure of cp --parents:
3970         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3971
3972 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
3973
3974         * strftime.c (my_strftime): If the underlying strftime returns 0
3975         (which shouldn't happen), generate nothing instead of returning 0
3976         immediately, so that nstrftime (NULL, ...) doesn't return 0.
3977
3978 2005-03-16  Bruno Haible  <bruno@clisp.org>
3979
3980         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3981
3982 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
3983
3984         * strftime.c (my_strftime): Prepend space to format so that we can
3985         reliably distinguish strftime failure from empty output on POSIX
3986         hosts.
3987
3988 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3989
3990         * iconvme.c (SIZE_MAX): New macro, if not already defined.
3991         (iconv_string): Don't guess a size-zero buffer, as that might cause
3992         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
3993         result would be 'too large', where 'too large' is (heuristically)
3994         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3995         overflow concerns.  This will prevent some unwanted malloc failures
3996         when the inputs are very large.
3997
3998 2005-03-15  Bruno Haible  <bruno@clisp.org>
3999
4000         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4001         'negate'.
4002
4003         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4004         variable.
4005
4006         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4007
4008 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4009
4010         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4011         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4012         intprops.h.
4013         * strtol.c: Likewise.
4014
4015 2005-03-14  Simon Josefsson  <jas@extundo.com>
4016
4017         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4018         <fx@gnu.org>.
4019
4020 2005-03-14  Jim Meyering  <jim@meyering.net>
4021
4022         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4023         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4024         to be nonzero so that we (and caller) can detect the difference
4025         between a valid zero-length expansion and an error return, even
4026         when the underlying strftime fails before writing anything into
4027         that location.
4028
4029 2005-03-10  Jim Meyering  <jim@meyering.net>
4030
4031         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4032         so that this module works on systems without fchdir.
4033
4034 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4035
4036         Factor int-properties macros into a single file, except for
4037         glibc-related files.
4038         * intprops.h: New file.
4039         * getloadavg.c: Include it instead of limits.h.
4040         (INT_STRLEN_BOUND): Remove.
4041         * human.c: Include intprops.h.
4042         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4043         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4044         * inttostr.h: Include intprops.h instead of limits.h.
4045         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4046         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4047         for consistency with intprops.h.
4048         (time_t_is_integer, twos_complement_arithmetic): Use them.
4049         * sig2str.h: Include <signal.h>, intprops.h.
4050         (INT_STRLEN_BOUND): Remove.
4051         * strftime.c (TYPE_SIGNED): Remove.
4052         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4053         * strtol.c: Adjust comments to match intprops.h.
4054         * userspec.c: Include intprops.h.
4055         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4056         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4057         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4058         instead of rolling our own expressions.
4059         * xstrtol.c: Include xstrtol.h first, to test interface.
4060
4061         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4062         instead of int.
4063         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4064         the right thing even if adding 1900 would overflow.  Similarly
4065         for tm_mon + 1 and tm_yday + 1.
4066         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4067         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4068         (DO_SIGNED_NUMBER): New macro.
4069         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4070
4071 2005-03-07  Bruno Haible  <bruno@clisp.org>
4072
4073         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4074
4075 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4076             Bruno Haible  <bruno@clisp.org>
4077
4078         * pagealign_alloc.h: New file.
4079         * pagealign_alloc.c: New file.
4080
4081 2005-01-28  Bruno Haible  <bruno@clisp.org>
4082
4083         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4084         stpncpy.c uses it.
4085
4086 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4087
4088         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4089         The workaround isn't strictly needed for POSIX conformance, and
4090         it's too much of a pain to configure and maintain.  We'll ask
4091         people to fix their kernels instead.
4092         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4093         (NANOSLEEP_BUG_WORKAROUND): Remove.
4094         (xnanosleep): Remove the workaround.
4095
4096 2005-02-12  Bruno Haible  <bruno@clisp.org>
4097
4098         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4099
4100 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4101
4102         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4103         * timespec.h (gettime): Return void, since it always
4104         succeeds now.  All uses changed.
4105         * gettime.c (gettime) Likewise.
4106         [HAVE_NANOTIME]: Prefer nanotime.
4107         Assume gettimeofday succeeds, as POSIX requires.
4108         Assime time () succeeds, since other code already does.
4109         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4110         (timespec_subtract): Remove.
4111         (NANOSLEEP_BUG_WORKAROUND): New constant.
4112         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4113         things considerably.  Use it only on GNU/Linux hosts, since the
4114         workaround shouldn't be needed elsewhere.
4115
4116 2005-02-24  Bruno Haible  <bruno@clisp.org>
4117
4118         * gettext.h: Update from GNU gettext 0.14.2.
4119
4120 2005-02-24  Bruno Haible  <bruno@clisp.org>
4121
4122         * localcharset.c: Update from GNU gettext 0.14.2.
4123         * config.charset: Update from GNU gettext 0.14.2.
4124
4125 2005-02-22  Simon Josefsson  <jas@extundo.com>
4126
4127         * iconvme.h, iconvme.c: New files, from libc.
4128
4129 2005-02-20  Neil Conway  <neilc@samurai.com>
4130
4131         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4132         returned by OSX/Darwin if the specified buffer is not large
4133         enough for the hostname.
4134
4135 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4136
4137         * memrchr.h: New file.
4138         * chdir-long.c: Include it.
4139         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4140         Don't bother including stddef.h.
4141
4142 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4143
4144         * argp-help.c (__argp_help): Create a fake struct argp_state and
4145         pass it to _help, otherwise the latter coredumps trying to
4146         dereference state.root_argp.
4147
4148 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4149
4150         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4151         inclusion.
4152         Include <sys/types.h>, for dev_t.
4153         (ME_DUMMY, ME_REMOTE): Move from here....
4154         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4155         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4156         Dmitry V. Levin.
4157         Include mountlist.h first, to test the interface.
4158
4159 2005-01-29  Bruno Haible  <bruno@clisp.org>
4160
4161         * progname.c (program_name): Initialize.
4162         Needed when linking statically on MacOS X.
4163
4164 2005-01-28  Bruno Haible  <bruno@clisp.org>
4165
4166         * javacomp.sh.in: New file, from GNU gettext.
4167         * javacomp.h: New file, from GNU gettext.
4168         * javacomp.c: New file, from GNU gettext.
4169
4170 2005-01-26  Bruno Haible  <bruno@clisp.org>
4171
4172         * javaexec.sh.in: New file, from GNU gettext.
4173         * javaexec.h: New file, from GNU gettext.
4174         * javaexec.c: New file, from GNU gettext.
4175
4176 2005-01-26  Simon Josefsson  <jas@extundo.com>
4177
4178         * gai_strerror.c: Use GPL in header.
4179
4180 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4181
4182         * argp-help.c (hol_entry_help): Avoid using non-constant
4183         initializers for struct pentry_state.
4184         (__argp_error): Check return value of __asprintf
4185         (__argp_failure): Translate error message
4186
4187         * argp-parse.c: Removed braces around the expansion of N_()
4188
4189 2005-01-21  Jim Meyering  <jim@meyering.net>
4190
4191         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4192         same value as for Solaris 9.
4193
4194         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4195         component length.  This included changing the parameter to be
4196         of type `char *' rather than `char const *'.
4197         * chdir-long.h (chdir_long): Update prototype.
4198
4199         * openat.c (fdopendir, fstatat): New functions.
4200         * openat.h: Include headers required for use of DIR and struct stat.
4201         [AT_SYMLINK_NOFOLLOW]: Define.
4202         (fdopendir, fstatat): Add prototypes.
4203
4204 2005-01-21  Bruno Haible  <bruno@clisp.org>
4205
4206         * classpath.h: New file, from GNU gettext.
4207         * classpath.c: New file, from GNU gettext.
4208
4209 2005-01-20  Simon Josefsson  <jas@extundo.com>
4210
4211         * version-etc-fsf.c: New file, with version_etc_copyright.
4212         * version-etc.c: Remove version_etc_copyright.
4213         * version-etc.h (version_etc_copyright): Use [] instead of * in
4214         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4215
4216 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4217
4218         * save-cwd.c (save_cwd): Remove code to support the case
4219         where fchdir is missing or flaky.
4220
4221 2005-01-20  Simon Josefsson  <jas@extundo.com>
4222
4223         * base64.h (isbase64): Add.
4224
4225         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4226         using a unsigned prototype, don't inline.
4227         (base64_decode): Use it.
4228
4229 2005-01-19  Bruno Haible  <bruno@clisp.org>
4230
4231         * sh-quote.h: New file, from GNU gettext.
4232         * sh-quote.c: New file, from GNU gettext.
4233
4234 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4235
4236         Merge changes from coreutils, as described below in several
4237         changelogs dated today.
4238
4239         * save-cwd.c: Include "save-cwd.h" before other include files.
4240         (O_DIRECTORY): Remove; not needed here, since "." must be
4241         a directory.  All uses removed.
4242         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4243         universal on Suns, and we also need to test for IRIX.
4244         Revamp code to use 'if' rather than '#if'.
4245         Avoid unnecessary comparison of cwd->desc to 0.
4246
4247         * utimens.c (futimens): Robustify the previous patch, by checking
4248         for known valid error numbers rather than observed invalid ones.
4249
4250 2005-01-18  Jim Meyering  <jim@meyering.net>
4251
4252         * version-etc.c (version_etc_copyright): Update copyright date.
4253
4254         * utimens.c (futimens): Account for the fact that futimes
4255         can also fail with errno == ENOSYS or errno == ENOENT.
4256         Patch from Dmitry V. Levin.
4257
4258         Change the name of the robust chdir function from chdir to chdir_long.
4259         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4260         (restore_cwd): Use chdir_long, not chdir.
4261         * chdir-long.c: Renamed from chdir.c.
4262         * chdir-long.h: Renamed from chdir.h.
4263         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4264         Hurd.
4265
4266 2005-01-18  Bob Proulx  <bob@proulx.com>
4267
4268         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4269         offsetof() macro construct to avoid compile failure with native HP-UX
4270         11.0 ANSI C compiler.
4271
4272 2005-01-06  Bruno Haible  <bruno@clisp.org>
4273
4274         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4275         because stpncpy.m4 takes care of it.
4276
4277 2004-01-24  Bruno Haible  <bruno@clisp.org>
4278
4279         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4280
4281 2003-10-09  Bruno Haible  <bruno@clisp.org>
4282
4283         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4284
4285 2005-01-06  Bruno Haible  <bruno@clisp.org>
4286
4287         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4288         * fwriteerror.c: Include <stdbool.h>.
4289         (fwriteerror): At the end, close the file stream. Record whether
4290         stdout was already closed.
4291
4292 2004-05-27  Bruno Haible  <bruno@clisp.org>
4293
4294         * execute.c (environ): Declare if needed.
4295         * pipe.c (environ): Likewise.
4296         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4297
4298 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4299
4300         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4301         definitions to be after all include files, to avoid collisions.
4302         Problem reported by Bob Proulx.
4303
4304 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4305
4306         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4307         not needed.  This removes a dependency on the gettext module.
4308         [defined _LIBC]: Do not include <libintl.h>; not needed.
4309
4310 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4311
4312         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4313         HAVE_DECL_STRTOLD.
4314
4315 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4316
4317         * argp-parse.c: Include <stddef.h>.
4318         (alignof, alignto): New macros.
4319         (parser_init): Don't assume that void * is aligned sufficiently
4320         for struct option.
4321
4322         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4323         need to extend the stack.
4324         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4325         large.
4326
4327 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4328
4329         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4330
4331 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4332
4333         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4334         Remove now-obsolete comment about AIX.
4335         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4336         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4337         (YYMAXDEPTH): New macro.
4338
4339 2004-12-18  Bruno Haible  <bruno@clisp.org>
4340
4341         * fatal-signal.c (fatal_signals): Make non-const.
4342         (init_fatal_signals): New function.
4343         (uninstall_handlers, install_handlers): Ignore signals that were set to
4344         SIG_IGN.
4345         (at_fatal_signal): Call init_fatal_signals.
4346         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4347         SIG_IGN.
4348         Reported by Paul Eggert.
4349
4350 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4351
4352         * getdate.y (textint): New member "negative".
4353         (time_zone_hhmm): New function.
4354         Expect 14 shift-reduce conflicts, not 13.
4355         (o_colon_minutes): New rule.
4356         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4357         (yylex): Set the "negative" member of signed numbers.
4358
4359 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4360
4361         Changes imported from coreutils.
4362         * hard-locale.c: Assume <locale.h> exists.
4363         Include "strdup.h".
4364         (GLIBC_VERSION): New macro.
4365         (hard_locale): Assume setlocale exists.
4366         Rewrite to avoid #ifdef.
4367         Use strdup rather than malloc + strcpy.
4368         * human.c: Assume <locale.h> exists.
4369         (human_readable): Assume localeconv exists.
4370
4371 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4372
4373         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4374         convert T2, not T.  (Imported from libc.)
4375
4376 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4377
4378         * getcwd.c (is_ENAMETOOLONG): New macro.
4379         (__getcwd.c): Don't restore errno; glibc doesn't.
4380         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4381         first, falling back to our code only if its results look suspicious.
4382         Ensure that the resulting buffer is only as large as necessary.
4383
4384         * readutmp.c: Include readutmp.h first.
4385         Include <errno.h>, since readutmp.h no longer does that.
4386         * readutmp.h: Don't include <errno.h>,
4387         <sys/param.h>, <time.h>; not needed to establish interface.
4388         (errno): Remove decl.
4389         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4390         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4391         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4392
4393 2004-11-28  Simon Josefsson  <jas@extundo.com>
4394
4395         * base64.h, base64.c: New file.
4396
4397 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4398
4399         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4400
4401 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4402
4403         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4404         HP's ANSI C compiler.
4405         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4406         Declaring int functions causes warnings on some modern systems and
4407         shouldn't be needed to compile on ancient ones.
4408         * same.c (MIN) [defined MIN]: Don't define, since it's already
4409         defined.
4410
4411         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4412         with the following changes.
4413         (__set_errno): Parenthesize properly.
4414         Include <stdbool.h>.
4415         (MIN, MAX, MATCHING_INO): New macros.
4416         (__getcwd): Define with prototype, not K&R form.
4417         Use heuristics to allocate default buffer on stack if possible.
4418         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4419         behavior, and to avoid the PATH_MAX limit when computing
4420         ../../../../...
4421         Use MATCHING_INO to compare inode number to file.
4422         Check for arithmetic overflow in size calculations.
4423         Fix bug in reallocation of dot array that caused getcwd to fail
4424         on directories nested deeper than 75.
4425         Be more careful about saving errno on error.
4426         Do not use realloc; use only free+malloc, as this is a bit
4427         more flexible and avoids a needless copy operation.
4428         Do not inspect st_dev and st_ino for symbolic links; POSIX
4429         doesn't specify the latter.
4430         Check for closedir errors.
4431         Avoid needless casts.
4432         Use "#ifdef weak_alias" around weak_alias, to be like other
4433         glibc code.
4434         The following changes to getcwd.c have effect only when used in
4435         gnulib; they have no effect inside glibc proper.
4436         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4437         as alloca isn't used.
4438         (alloca, __alloca): Likewise.
4439         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4440         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4441         unconditionally, as gnulib assumes C89 or better.
4442         Do not include <sys/param.h>.
4443         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4444         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4445         better.
4446         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4447         Include <dirent.h> in a way that is compatible with modern Autoconf.
4448         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4449         New macros, if not already defined.
4450         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4451         Use "_LIBC", not "defined _LIBC", for consistency.
4452         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4453         a mempcpy module.
4454         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4455         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4456         * xgetcwd.c: David MacKenzie's old code was removed, so give
4457         credit only to Jim Meyering and adjust the copyright dates.
4458         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4459         <stdlib.h>, <unistd.h>, "pathmax.h".
4460         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4461         (INITIAL_BUFFER_SIZE): Remove.
4462         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4463
4464 2004-11-23  Jim Meyering  <jim@meyering.net>
4465
4466         * getopt_.h: Remove trailing blanks.
4467
4468 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4469
4470         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4471         (futimens): New function, which uses futimes if available.
4472         (futimens, utimens): Support timespec==NULL, with same semantics
4473         as utime and utimens.
4474         * utimens.h (futimens): New decl.
4475
4476 2004-11-23  Jim Meyering  <jim@meyering.net>
4477
4478         * __fpending.c: Add comment.
4479
4480 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4481
4482         * getopt_.h: Re-addition of __getopt_argv_const caused
4483         redefinition warnings. To avoid them, include the defines
4484         in `#if !defined __need_getopt ... #endif'. The only place
4485         where __getopt_argv_const is used is in definitions
4486         of getopt_long and getopt_long_only below, which are as well
4487         protected by `#ifndef __need_getopt'.
4488         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4489         __need_getopt after including <stdio.h> and <unistd.h> These
4490         headers might have defined it.
4491
4492 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4493
4494         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4495         New macros.
4496         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4497         optopt): Use them instead of invoking ## directly; otherwise, the
4498         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4499
4500 2004-11-19  Bruno Haible  <bruno@clisp.org>
4501
4502         * strtok_r.c: Move comments from here...
4503         * strtok_r.h: ... to here.
4504
4505 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4506
4507         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4508         might fail.  Problem reported by Yoann Vandoorselaere.
4509         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4510         that mishandle size_t overflow.
4511
4512 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4513
4514         * canon-host.c: Include "strdup.h".
4515         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4516         Use strdup instead of malloc/strcpy to duplicate strings.
4517
4518         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4519         (human_space_before_unit): New constant.
4520         * human.c (human_readable): Support it.
4521
4522         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4523         (xgetcwd): Set errno correctly when failing.
4524         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4525         the failure is actually due to a PATH_MAX problem.
4526
4527         Further getopt changes to make it more likely that glibc will
4528         buy the changes back.
4529         * getopt.c (POSIXLY_CORRECT): New constant.
4530         (getopt): Use it, so to preserve glibc semantic
4531         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4532         when compiling for libc.
4533         * getopt_.h (__getopt_argv_const): Bring it back.
4534         (getopt_long, getopt_long_only): Use it.
4535
4536         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4537         New arg POSIXLY_CORRECT.  All callers changed.
4538         (getopt): Argv is now char * const *, as per standard.
4539         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4540         not char *__getopt_argv_const *.
4541         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4542         _getopt_long_only_r): Likewise.
4543         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4544         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4545         _getopt_long_r, _getopt_long_only_r): Likewise.
4546         * getopt_.h (__getopt_argv_const): Remove.
4547         (getopt): Argv is now char * const *, as per standard.
4548
4549         * getdate.y (tORDINAL): New token.
4550         (day, relunit): Allow it for relative times.
4551         (relative_time_table): Use tORDINAL for ordinals.
4552
4553 2004-11-15  Jim Meyering  <jim@meyering.net>
4554
4555         * closeout.c: Include "__fpending.h" once again.
4556         Include <stdbool.h>.
4557         (close_stdout): Don't fail just because stdout was closed initially,
4558         since some programs don't write to stdout in the normal course of
4559         operation (other than --version and --help), and we don't want this
4560         function to make e.g. `touch file >&-' fail.
4561         But do fail if it was closed and someone has tried to write to it.
4562         E.g., `printf foo >&-' must fail.
4563
4564 2004-11-11  Simon Josefsson  <jas@extundo.com>
4565
4566         * strtok_r.h, strtok_r.c: New file.
4567
4568 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4569
4570         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4571         we can stop lying to compilers about the constness of argv when we
4572         are compiled outside glibc.
4573         (getopt, getopt_long, getopt_long_only): Use it.
4574         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4575         getopt): Likewise.
4576         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4577         _getopt_long_only_r): Likewise.
4578         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4579         _getopt_long_only_r): Likewise.
4580
4581         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4582         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4583         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4584         the other external symbols.
4585         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4586         declaration, since the above renaming now works around collisions.
4587
4588 2004-11-11  Jim Meyering  <jim@meyering.net>
4589
4590         * linebreak.c: Remove trailing blanks.
4591         * alloca_.h: Likewise.
4592         * acosl.c: Likewise.
4593         * euidaccess.c: Likewise.
4594         * allocsa.h: Likewise.
4595
4596 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4597
4598         * mktime.c (SHR): New macro, which is a portable
4599         substitute for >> that should work even on Crays.
4600         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4601         Problem reported by Mark D. Baushke in
4602         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4603         * getdate.y (SHR): Likewise.
4604         (tm_diff): Use it.
4605         * strftime.c (SHR): Likewise.
4606         (tm_diff): Use it.
4607         * quotearg.c (struct quoting_options): Use unsigned int for
4608         quote_these_too, so that right shifts are well defined.  All uses
4609         changed.
4610
4611 2004-11-10  Simon Josefsson  <jas@extundo.com>
4612
4613         * getaddrinfo.h, getaddrinfo.c: New files.
4614
4615 2004-11-10  Jim Meyering  <jim@meyering.net>
4616
4617         Ensure that no close failure goes unreported.
4618         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4619         return early when it seems there's nothing to flush.
4620         Don't include __fpending.h.
4621
4622 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4623
4624         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4625
4626 2004-11-05  Bruno Haible  <bruno@clisp.org>
4627
4628         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4629         Reported by Mark D. Baushke <mdb@cvshome.org>.
4630
4631 2004-11-04  Bruno Haible  <bruno@clisp.org>
4632
4633         2004-09-11  Bruno Haible  <bruno@clisp.org>
4634                 * allocsa.valgrind: New file.
4635         2004-02-06  Bruno Haible  <bruno@clisp.org>
4636                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4637                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4638                 Reported by Christopher Seip <chris.seip@hp.com>.
4639
4640 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4641
4642         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4643         with errno == ERANGE if the buffer is too small.
4644         Problem reported by Mark D. Baushke.
4645
4646 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4647
4648         * xreadlink.c (MAXSIZE): New macro.
4649         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4650         size does not exceed MAXSIZE.  Avoid cast.
4651         As suggested by Mark D. Baushke in
4652         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4653         if readlink fails with buffer size just under MAXSIZE, try again
4654         with MAXSIZE.
4655
4656 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4657         and  Paul Eggert  <eggert@cs.ucla.edu>
4658
4659         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4660         (get_date): Overparenthesize to avoid GCC warning.
4661
4662 2004-11-02  Bruno Haible  <bruno@clisp.org>
4663
4664         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4665         function returns void.
4666
4667 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4668
4669         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4670         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4671         already declared.
4672
4673 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4674
4675         * getdate.y: Add support for TZ="foo" within a date string.
4676         Fix some bugs near time_t boundaries.  Reject dates with
4677         out-of-range components, e.g., "Sept 31".
4678         Include <stdlib.h>, "setenv.h", "xalloc.h".
4679         (ISDIGIT_LOCALE): Remove; unused.
4680         Note that the TZ and time functions used here are not reentrant.
4681         (mktime_ok, get_tz): New functions.
4682         (TZBUFSIZE): New constant.
4683         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4684         This requires that we sometimes generate our own TZ="XXX..." setting.
4685
4686 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4687
4688         * mktime.c (not_equal_tm): Remove redundant check.
4689
4690 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4691
4692         * getdate.y: Use Bison 1.875 features, and some minor
4693         code cleanups.  This change does not affect semantics.
4694         Don't include <stdlib.h>; no longer needed.
4695         Don't include unlocked-io.h; only the "#if TEST" code uses
4696         stdio, and performance isn't crucial there.
4697         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4698         Bison 1.875 features as described below.
4699         All uses of "PC." replaced by "pc->".
4700         (YYSTYPE): Add a forward declaration.
4701         (yylex, yyerror): Use full prototypes in forward decls.
4702         Use "%pure-parser" rather than obsolescent "%pure_parser".
4703         Use %parse-param and %lex-param instead of obsolescent
4704         YYPARSE_PARAM and YYLEX_PARAM.
4705         (meridian_table, month_and_day_table, time_units_table,
4706         relative_time_table, time_zone_table, military_table,
4707         lookup_zone, lookup_word, get_date):
4708         Use NULL instead of 0 where appropriate.
4709         (to_hour): Avoid abort (), to avoid a dependency on
4710         stdlib.h.
4711         (yyerror, yylex): Now accepts parser_control * arg.
4712         (main) [TEST]: Use '\0' rather than 0 for char.
4713
4714 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4715
4716         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4717         It's now the caller's responsibility to handle the case where
4718         !HAVE_GETPAGESIZE && !defined getpagesize.
4719
4720         * mktime.c (leapyear): Arg is long int, not int.
4721
4722 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4723
4724         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4725
4726 2004-10-12  Simon Josefsson  <jas@extundo.com>
4727
4728         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4729         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4730         to real functions.
4731
4732 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4733
4734         * vsnprintf.h: New file.
4735         * vsnprintf.c: New file.
4736
4737 2004-10-07  Bruno Haible  <bruno@clisp.org>
4738
4739         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4740         into the provided buffer.
4741
4742 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4743
4744         * diacrit.c, diacrit.h: Add GPL notice.
4745
4746         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4747         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4748         * logl.c (logl): Keep the code as similar to glibc as possible.
4749         This avoids a potential constant-folding bug.
4750
4751 2004-10-05  Bruno Haible  <bruno@clisp.org>
4752
4753         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4754
4755 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4756
4757         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4758         * xmalloc.c (xmemdup): Likewise.
4759         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4760         XFREE): Remove these long-obsolescent macros.
4761         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4762         * xstrdup.c: Remove.
4763
4764         * regex.c (re_comp): Cast gettext return value to char *,
4765         Problem reported by Martin Neitzel via Mark D. Baushke.
4766
4767 2004-10-04  Simon Josefsson  <jas@extundo.com>
4768
4769         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4770         '#ifdef USE_UNLOCKED_IO'.
4771
4772 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4773
4774         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4775         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4776         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4777         regex.c, sha1.c, version-etc.c, yesno.c:
4778         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4779         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4780         the includer's responsibility.
4781
4782         Sync from coreutils.
4783
4784         * modechange.c (mode_compile): Don't decrement a pointer that
4785         points to the start of a string, as the C Standard says the
4786         resulting behavior is undefined.
4787
4788         * backupfile.h (enum backuptype): Rename none -> no_backups,
4789         simple -> simple_backups, numbered_existing ->
4790         numbered_existing_backups, numbered -> numbered_backups
4791         to avoid shadowing problems.  All uses changed.
4792         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4793         * backupfile.c (check_extension, numbered_backup):
4794         Rename locals to avoid shadowing 'basename'.
4795         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4796         once.
4797
4798         * .cppi-disable: Add getopt_.h, getopt_int.h.
4799         * .cvsignore: Add getopt.h.
4800
4801 2004-10-04  Simon Josefsson  <jas@extundo.com>
4802
4803         * memmem.h: New file.
4804         * memmem.c: New file, taken from glibc.
4805
4806 2004-10-02  Jim Meyering  <jim@meyering.net>
4807
4808         * dirfd.h, getpagesize.h: Add copyright notice.
4809
4810 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4811
4812         * snprintf.c: Remove comments as to why each header is needed.
4813
4814 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
4815
4816         * strsep.h: New file.
4817         * strsep.c: New file.
4818
4819 2004-10-01  Simon Josefsson  <jas@extundo.com>
4820
4821         * snprintf.c (snprintf): Handle size==0.
4822
4823 2004-10-01  Simon Josefsson  <jas@extundo.com>
4824             Bruno Haible  <bruno@clisp.org>
4825
4826         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4827         (snprintf): Declare 'args'.
4828
4829 2004-09-30  Simon Josefsson  <jas@extundo.com>
4830
4831         * snprintf.h, snprintf.c: New files.
4832
4833 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4834
4835         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4836         (hol_entry_help): Never translate an empty string.
4837         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4838         * argp.h (OPTION_NO_TRANS): New option.
4839
4840 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
4841
4842         * xvasprintf.c: Include xalloc.h.
4843         (xvasprintf): Use xalloc_die, not xmalloc_die.
4844
4845 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
4846
4847         * dummy.c: Change copyright notice to FSF, and license to GPL.
4848
4849 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
4850
4851         * argp-pvh.c (argp_program_version_hook): Provide initial value.
4852         Problem reported by Bruno Haible in:
4853         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4854
4855 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
4856
4857         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4858         in case some system header has #define'd it.  Problem reported by
4859         Soeren D. Schulze in
4860         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4861
4862 2004-09-08  Bruno Haible  <bruno@clisp.org>
4863
4864         * stdint_.h: New file, taken from GNU clisp.
4865
4866 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
4867
4868         * xvasprintf.h: New file.
4869         * xvasprintf.c: New file.
4870         * xasprintf.c: New file.
4871
4872 2004-09-08  Bruno Haible  <bruno@clisp.org>
4873
4874         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4875         is > INT_MAX.
4876         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4877
4878 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4879
4880         Import from coreutils.
4881         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4882         strings on unbounded length.  alloca's performance benefits aren't
4883         that important here.
4884         (V_STRDUP): Remove.
4885         (parse_with_separator): New function, with most of the internals
4886         of the old parse_user_spec.  Allow user to omit both user and group,
4887         for compatibility with FreeBSD.
4888         Clone only the user name, not the entire spec.
4889         Do not set *uid, *gid unless entirely successful.
4890         Avoid memory leak in some failing cases.
4891         Fix regression for USER.GROUP reported by Dmitry V. Levin in
4892         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4893         (parse_user_spec): Rewrite to use parse_with_separator.
4894
4895 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
4896
4897         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4898         its complicated substitute.
4899         * argp-help.c: Include <errno.h>, for program_invocation_short_name
4900         and program_invocation_name.
4901         (__argp_basename) [!_LIBC]: Remove; the only use was
4902         replaced by its body.
4903         (__argp_short_program_name): Change condition from
4904         !defined __argp_short_program_name to
4905         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4906         to match argp-namefrob.h.
4907         (__argp_failure): Don't assume strerror_r returns char *.
4908         * argp-parse.c (N_): Define unconditionally.
4909         (argp_default_options): Fill out initializers with 0 to avoid
4910         gcc warnings.
4911
4912 2004-08-12  Simon Josefsson  <jas@extundo.com>
4913
4914         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4915         * getopt_.h: Renamed from getopt.h.
4916
4917 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4918
4919         Merge from coreutils.
4920
4921         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4922         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
4923         for Reliant Unix 5.43.
4924
4925         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4926         (union fooround): Use uintmax_t, not long int.
4927         The rest is a merge from libc:
4928         [defined _LIBC]: Include <shlib-compat.h>.
4929         (_obstack) [defined _LIBC]: Remove after 2.3.4.
4930
4931         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4932
4933         * strverscmp.c: Convert to UTF-8.
4934
4935 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4936
4937         * obstack.h (obstack_empty_p):
4938         Don't assume that chunk->contents is suitably aligned.
4939         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4940         Likewise. Problem reported by Benno in
4941         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4942
4943         * chown.c (rpl_chown): Work even if the file is writeable but not
4944         readable.  This could be improved further but it'd take some work.
4945
4946 2004-08-08  Simon Josefsson  <jas@extundo.com>
4947
4948         * xgethostname.c: Don't include error.h (not used).
4949
4950         * getpass.h: Add.
4951         * getpass.c: Include getpass.h first.
4952
4953 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
4954
4955         * xalloc-die.c: New files.
4956         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4957         All uses removed.
4958         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4959         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4960         (_, N_, xalloc_die): Move to xalloc-die.c.
4961         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4962         so that we needn't mess with xalloc_msg_memory_exhausted.
4963
4964         * sha1.h: Renamed from sha.h.
4965         (SHA1_H): Renamed from _SHA_H.
4966         (sha1_ctx): Renamed from sha_ctx.
4967         (sha1_init_ctx): Renamed from sha_init_ctx.
4968         (sha1_process_block): Renamed from sha_process_block.
4969         (sha1_process_bytes): Renamed from sha_process_bytes.
4970         (sha1_finish_ctx): Renamed from sha_finish_ctx.
4971         (sha1_read_ctx): Renamed from sha_read_ctx.
4972         (sha1_stream): Renamed from sha_stream.
4973         (sha1_buffer): Renamed from sha_buffer.
4974         * sha1.c: Likewise; renamed from sha.c.
4975         Do not include <sys/types.h>.
4976         Include <stddef.h> rather than <stdlib.h>.
4977
4978 2004-08-08  Bruno Haible  <bruno@clisp.org>
4979
4980         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4981         FILESYSTEM_PREFIX_LEN.
4982         * progreloc.c: Likewise.
4983         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4984
4985 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
4986
4987         Merge from tar.
4988         * argp-help.c (make_hol, hol_append): Don't assume that
4989         SIZE_MAX is a valid preprocessor constant.
4990         (__argp_basename): Change from "#ifndef _LIBC"
4991         to "#ifndef __argp_short_program_name", so that
4992         we don't compile these functions for tar.
4993
4994         More merges from coreutils.
4995         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4996         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4997         yesno.h: New files.
4998         * addext.c: Remove; no longer needed.
4999         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5000         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5001         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5002         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5003         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5004         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5005         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5006         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5007         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5008         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5009         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5010         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5011         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5012         Import changes from coreutils.
5013
5014 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5015
5016         Merge from coreutils.
5017
5018         * .gdb-history: Remove; this doesn't belong here.
5019
5020         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5021         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5022         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5023
5024         * dirname.h: Include <stdbool.h>.
5025         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5026         for consistency with POSIX terminology.  All uses changed.
5027         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5028         (strip_trailing_slashes): Use bool for booleans.
5029         * stripslash.c (strip_trailing_slashes): Likewise.
5030
5031         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5032         sometimes returns a positive errno value even when it succeeds.
5033         (print_errno_message) [!LIBC]: Fall back on strerror if
5034         __strerror_r fails.
5035
5036         * path-concat.c (mempcpy): Don't define if a system header defines it.
5037         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5038         (longest_relative_suffix): New function.
5039         (path_concat): Use it.  Assume first argument is not NULL.
5040         Port to DOS.  Omit redundant separators.
5041         Report an error instead of returning NULL.
5042         Use mempcpy instead of memcpy.
5043         (xpath_concat): Remove: not declared or used.
5044
5045         * same.h: Include <stdbool.h>
5046         (same_name): Return bool, not int.
5047         * same.c (same_name): Likewise.
5048         (errno): Don't declare; we assume C89 or better now.
5049
5050         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5051         if not already defined.
5052
5053         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5054         * dup-safer.c (errno): Likewise.
5055
5056 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5057
5058         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5059         working.
5060
5061 2004-08-03  Simon Josefsson  <jas@extundo.com>
5062
5063         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5064         * progname.h: Don't include stdbool.h.
5065
5066 2004-08-02  Simon Josefsson  <jas@extundo.com>
5067
5068         * getsubopt.h: New file, with comments from Bruno Haible.
5069         * getsubopt.c: New file, from glibc, but slightly modified based on
5070         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5071
5072 2004-08-01  Simon Josefsson  <jas@extundo.com>
5073
5074         * xgetdomainname.c: Include stdlib.h, for free().
5075
5076 2004-07-16  Simon Josefsson  <jas@extundo.com>
5077
5078         * dummy.c: New file.
5079
5080 2004-07-16  Bruno Haible  <bruno@clisp.org>
5081
5082         * backupfile.h: Add extern "C" for C++.
5083         * closeout.h: Likewise.
5084         * copy-file.h: Likewise.
5085         * findprog.h: Likewise.
5086         * full-write.h: Likewise.
5087         * pathname.h: Likewise.
5088         * progname.h: Likewise.
5089         * stpcpy.h: Likewise.
5090         * stpncpy.h: Likewise.
5091         * strcase.h: Likewise.
5092         * strstr.h: Likewise.
5093         * xalloc.h: Likewise.
5094
5095         * mbswidth.h: Add extern "C" for C++.
5096         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5097
5098 2004-07-09  Simon Josefsson  <jas@extundo.com>
5099
5100         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5101         failed without this.)
5102
5103 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5104
5105         * fchown-stub.c: New file.
5106
5107 2004-06-24  Jim Meyering  <jim@meyering.net>
5108
5109         * obstack.h (obstack_base): Cast to (void *), per documentation.
5110
5111 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5112
5113         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5114
5115 2004-06-01  Jim Meyering  <jim@meyering.net>
5116
5117         * calloc.c: New file.
5118
5119 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5120
5121         * getdate.y (yylex): Allow space between sign and number.
5122         Problem reported by Dan Jacobson.
5123
5124 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5125         and  Jim Meyering  <jim@meyering.net>
5126
5127         Merge from coreutils CVS.
5128
5129         * stat-macros.h: New file, with contents from file-type.h
5130         and coreutils' system.h.
5131         * file-type.c: Include "stat-macros.h".
5132         * file-type.h (file_type): Move all macro definitions to new file,
5133         stat-macros.h.
5134
5135         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5136         Wrap old code with this conditional.
5137         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5138         function that does not dereference symlinks.
5139         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5140
5141         * xreadlink.c: Include xreadlink.h first, to catch .h file
5142         dependency problems.
5143         (xreadlink): Accept new arg SIZE, for efficiency.
5144         All decls and uses changed.
5145         * xreadlink.h: Include <stddef.h>, for size_t.
5146
5147         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5148         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5149
5150         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5151
5152 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5153
5154         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5155         macros to be defined.
5156         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5157         the allocator returns NULL because the requested size is zero.
5158
5159 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5160
5161         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5162         var.  Add comment explaining why libc still defines it.  This
5163         merges the following patch from glibc:
5164         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5165
5166 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5167
5168         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5169         present in glibc since revision 1.1 of this file.
5170         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5171         obstack_alignment_mask, obstack_alloc, obstack_base,
5172         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5173         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5174         obstack_grow0, obstack_init, obstack_int_grow,
5175         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5176         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5177         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5178         nonexistent functions.
5179
5180 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5181             Paul Eggert  <eggert@cs.ucla.edu>
5182
5183         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5184
5185 2004-05-14  Bruno Haible  <bruno@clisp.org>
5186
5187         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5188         that consists of a '.' followed by an empty digit string.
5189         Patch by Tor Lillqvist <tml@iki.fi>.
5190
5191 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5192
5193         Port obstack to the AS/400, where pointers are 16 bytes wide and
5194         you cannot cast an integer to a valid pointer.  This patch is
5195         currently waiting to be integrated into glibc; see
5196         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5197
5198         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5199         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5200         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5201         (struct obstack): temp member is now a union of a pointer and
5202         an integer, instead of an integer.  All integer uses changed.
5203         This does not affect the physical layout of struct obstack,
5204         except on hosts (like the AS/400) where the size or alignment of
5205         void * is greater than that of ptrdiff_t.
5206         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5207         __STDC__)]: Store temporary in pointer member of union, not
5208         integer member.
5209         * obstack.c: Include <stddef.h>, for offsetof.
5210         (struct fooalign): Remove; it doesn't need a name.
5211         (union fooround): Change double to long double, and add void *.
5212         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5213         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5214         not a macro.  Hence the values are always int; so remove all
5215         casts-to-int in uses.
5216
5217 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5218             Derek Price  <derek@ximbiot.com>
5219
5220         * alloca.c: Include <alloca.h>, to get our interface.
5221         * alloca_.h: Use __alloca on AIX, so that we don't have to
5222         include <alloca.h> first.  Use C89 prototype for alloca; this
5223         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5224         Use #elif for simplicity, since we can assume C89 now.
5225         Don't try to source the system alloca.h since it will not be found
5226         and to prevent recursively including its replacement.
5227         * fnmatch.c: Include <alloca.h> instead of opencoding.
5228         * regex.c: Likewise.
5229
5230 2004-05-16  Derek Price  <derek@ximbiot.com>
5231             Paul Eggert  <eggert@cs.ucla.edu>
5232
5233         getline cleanup.  This changes the getndelim2 API: both order of
5234         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5235         no delimiter).
5236
5237         * getline.c: Don't include stddef.h or stdio.h, since our
5238         interface does that.
5239         (getline): Always use getdelim, so that we don't have two
5240         copies of this code.
5241         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5242         if available.
5243         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5244         (GETNDELIM2_MAXIMUM): New macro.
5245         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5246         instead of the old practice of delim2==0.  All callers changed.
5247         Return -1 on overflow, instead of returning junk.
5248         Do not set *linesize unless allocation succeeds.
5249         * getndelim2.h: Do not include stddef.h; no longer needed, now
5250         that we include sys/types.h.
5251         * getnline.h: Likewise.
5252         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5253         (getndelim2): Reorder arguments.
5254         * getnline.c (getnline, getndelim):
5255         Don't discard the NMAX argument.
5256         (getnline): Invoke getndelim, to avoid code duplication.
5257         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5258         of (size_t) -1 by callers of the getnline family.
5259
5260 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5261
5262         * nanosleep.c (suspended): Change its type from int to
5263         sig_atomic_t volatile.
5264         (first_call): Make it private to rpl_nanosleep, and have it
5265         be zero initially as that's a bit faster.
5266         (my_usleep): Round up fractional times instead of truncating them,
5267         as this is the usual meaning for 'sleep'.
5268
5269         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5270         doesn't work.
5271         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5272         (ENOSYS): Define if not defined.
5273         (settime): Fall back on stime if it exists and settimeofday fails.
5274         But don't bother with fallbacks if a method fails with errno == EPERM.
5275
5276 2004-05-11  Jim Meyering  <jim@meyering.net>
5277
5278         Prior to this change, the save_cwd caller required read access to the
5279         current directory on most systems (ones with the fchdir function).
5280
5281         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5282         fails, try write-only, and finally, resort to using xgetcwd.
5283
5284 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5285
5286         * obstack.c, obstack.h: Import changes from libc.
5287
5288 2004-04-28  Bruno Haible  <bruno@clisp.org>
5289
5290         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5291         implicitly appends .exe to executables.
5292         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5293         accepts Windows pathnames.
5294         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5295         Cygwin like Windows, since it now accepts Windows pathnames.
5296         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5297         Cygwin like Windows, since it now accepts Windows pathnames.
5298         Reported by Derek Robert Price <derek@ximbiot.com>.
5299
5300 2004-04-20  Jim Meyering  <jim@meyering.net>
5301
5302         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5303
5304 2004-04-20  Jim Meyering  <jim@meyering.net>
5305             Bruno Haible  <bruno@clisp.org>
5306
5307         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5308         memory when realloc fails.
5309
5310 2004-04-18  Jim Meyering  <jim@meyering.net>
5311
5312         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5313         don't leak memory and do call END_UTMP_ENT.
5314
5315 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5316
5317         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5318         (CHAR_BIT): Remove, since we assume C89.
5319         Include <stdint.h> if available, as per current Autoconf CVS advice.
5320
5321 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5322
5323         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5324         not bool, to be more consistent with Unix conventions.
5325         Suggested by Bruno Haible.
5326
5327         Merge from coreutils.
5328
5329         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5330         New files.
5331
5332         * getdate.h: Include stdbool.h, and timespec.h instead of
5333         the usual <time.h> dance.
5334         (get_date): Change signature to support fractional time stamps.
5335         All callers changed.
5336         * getdate.y: Include "getdate.h" first, as we can now
5337         assume C89 and don't need to worry about 'const'.
5338         Similarly, include "unlocked-io.h" near start, not in middle.
5339         Include <limits.h>.
5340         (textint.value): Use long int rather than int.
5341         (textint.digits): Use size_t rather than int.
5342         (BILLION, LOG10_BILLION): New constants.
5343         (parser_control): New member rel_ns.  Members day_ordinal,
5344         time_zone, month, day, hour, minutes, rel_year, rel_month,
5345         rel_day, rel_hour, rel_minutes, rel_seconds
5346         are now long int, not int.  Member seconds is now struct timespec,
5347         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5348         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5349         not int.
5350         (%union.intval): Now long int, not int.
5351         New member timespec.
5352         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5353         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5354         (spec): Now is a timespec or an item list.
5355         (timespec, items): New nonterminals.
5356         (time, rel, relunit, number, get_date):
5357         Add support for fractional seconds.
5358         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5359         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5360         (to_hour): First arg is now long int, not int.
5361         (to_year): Returns long int, not int.
5362         Don't treat year -70 like 70.
5363         (tm_diff): Returns long int, not int.
5364         (lookup_word): Use bool instead of int when appropriate.
5365         (yylex): Use size_t for count, not int.
5366         Detect overflow when parsing large integer constants.
5367         Add support for fractions.
5368         (get_date): Make pointers 'const' if possible.
5369         Use more-portable code to detect integer overflow.
5370         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5371         Don't use ctime; it's not reliable if the year has >4 digits.
5372
5373         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5374         This is for compatibility with BSD.
5375
5376         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5377         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5378         From coreutils' system.h.
5379
5380         * userspec.c: Don't include "posixver.h".
5381         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5382         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5383         compatible extension.  Simplify code by removing a boolean int
5384         that was always nonzero if a string was nonnull.
5385
5386 2004-03-30  Jim Meyering  <jim@meyering.net>
5387
5388         Merge from coreutils.
5389
5390         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5391
5392         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5393         an empty input stream.
5394
5395         * readtokens.c: Include <stdbool.h>.
5396         (readtoken): Use `size_t' rather than int/long.
5397         All callers adjusted.
5398         Use `bool' rather than `int' where appropriate.
5399         Use memset rather than an explicit loop.
5400         Use x2nrealloc rather than xrealloc.
5401         Allow the use of `\0' as a delimiter.
5402         (readtokens): Likewise.
5403         * readtokens.h (readtoken, readtokens): Update prototypes.
5404
5405 2004-03-30  Bruno Haible  <bruno@clisp.org>
5406
5407         * getloadavg.c (getloadavg): Don't assume setlocale returns
5408         nonnull.
5409
5410 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5411
5412         Merge changes to getloadavg.c from coreutils and Emacs.
5413
5414         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5415         Define to an expression, not to the empty string.
5416         Include cloexec.h and xalloc.h.
5417         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5418         Use set_cloexec_flag rather than rolling our own.
5419         * cloexec.c, cloexec.h: New files.
5420
5421 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5422
5423         * getopt.h: Sync with libc CVS.
5424
5425 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5426             Bruno Haible  <bruno@clisp.org>
5427
5428         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5429         not on all platforms that have <wchar.h>.
5430         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5431
5432 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5433
5434         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5435         Sync with libc CVS.
5436         * getopt_int.h: New file, also synced from libc.
5437
5438 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5439
5440         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5441         '#if' expressions.  Unlike the code it replaces, it does not
5442         depend on (defined _SC_PAGESIZE).  However, it does depend on
5443         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5444         first reported by Jason Andrade in
5445         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5446
5447 2004-01-18  Simon Josefsson  <jas@extundo.com>
5448
5449         * strdup.h: New file.
5450         * strdup.c: Include it.
5451         * path-concat.c: Include strdup.h. Drop strdup declaration.
5452         * userspec.c: Include strdup.h. Drop strdup declaration.
5453
5454 2004-02-06  Karl Berry  <karl@gnu.org>
5455
5456         * config.charset: update from gettext 0.14.1.
5457
5458 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5459
5460         Add comments and code, prompted by suggestions from Bruno Haible
5461         for sh-quote.
5462         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5463         describing the enum quoting_style values.
5464         * quotearg.c (quotearg_alloc): New function.
5465         (quotearg_buffer_restyled): Treat lone { and } as special.
5466         Treat = as special.  Work around bug with older shells
5467         that "see" a '\' that is really the 2nd byte of a multibyte char.
5468         Quote empty string with shell_quoting_style.
5469
5470 2004-02-03  Bruno Haible  <bruno@clisp.org>
5471
5472         * pipe.h: New file, from GNU gettext.
5473         * pipe.c: New file, from GNU gettext.
5474
5475 2004-01-27  Bruno Haible  <bruno@clisp.org>
5476
5477         * execute.h: New file, from GNU gettext.
5478         * execute.c: New file, from GNU gettext.
5479         * w32spawn.h: New file, from GNU gettext.
5480
5481 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5482
5483         Exit-status fix from coreutils.
5484
5485         Use exit_failure consistently in place of EXIT_FAILURE,
5486         so that program exit statuses are consistent on failure.
5487
5488         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5489         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5490         * argmatch.h: Comment fix to match the above.
5491         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5492         Now a macro referring to exit_failure, instead of a separate
5493         variable.  Include "exitfail.h" to get it.
5494         * xstrtol.h: Include "exitfail.h".
5495         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5496
5497         * long-options.c (parse_long_options): Use prototype
5498         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5499         for clarity.
5500
5501 2004-01-21  Jim Meyering  <jim@meyering.net>
5502
5503         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5504         so as not to conflict with a different-sized __mktime_internal
5505         function in GNU libc.
5506         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5507         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5508
5509 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5510
5511         Merge from diffutils.
5512
5513         * file-type.c (file_type): Add typed memory objects.
5514         * file-type.h (S_TYPEISTMO): New macro.
5515
5516         * c-stack.h (c_stack_action): Remove argv argument.
5517         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5518         (die): Don't calculate message unless segv_action returns.
5519         (get_stack_location, min_address_from_argv, max_address_from_argv,
5520         volatile stack_base, volatile_stack_size): Remove.
5521         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5522         that every segmentation violation is a stack overflow.  (Ouch!)
5523         See Debian bug 136249 (still outstanding) for more info about why
5524         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5525
5526 2003-11-30  Bruno Haible  <bruno@clisp.org>
5527
5528         Safer stack allocation.
5529         * setenv.c: Include allocsa.h.
5530         (alloca): Remove fallback definition.
5531         (freea): Remove macro.
5532         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5533         instead of freea.
5534
5535 2003-10-17  Bruno Haible  <bruno@clisp.org>
5536
5537         * binary-io.h: Avoid warnings on Cygwin.
5538
5539 2003-12-28  Bruno Haible  <bruno@clisp.org>
5540
5541         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5542         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5543
5544 2003-11-28  Bruno Haible  <bruno@clisp.org>
5545
5546         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5547
5548 2003-11-27  Bruno Haible  <bruno@clisp.org>
5549
5550         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5551
5552 2003-11-17  Bruno Haible  <bruno@clisp.org>
5553
5554         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5555
5556 2003-11-24  Bruno Haible  <bruno@clisp.org>
5557
5558         * xallocsa.h: New file, from GNU gettext.
5559         * xallocsa.c: New file, from GNU gettext.
5560
5561 2003-11-24  Bruno Haible  <bruno@clisp.org>
5562
5563         * allocsa.h: New file, from GNU gettext.
5564         * allocsa.c: New file, from GNU gettext.
5565
5566 2003-11-24  Bruno Haible  <bruno@clisp.org>
5567
5568         * eealloc.h: New file.
5569
5570 2004-01-15  Jim Meyering  <jim@meyering.net>
5571
5572         Merge from coreutils.
5573
5574         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5575         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5576         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5577
5578         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5579         optional configure-time default.
5580
5581         * version-etc.c (version_etc_copyright): Update copyright date.
5582
5583         * xreadlink.c (xreadlink): Correct outdated comment.
5584
5585 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5586
5587         Merge from coreutils.
5588
5589         * posixver.c: Include posixver.h.
5590
5591         * same.c: Include <stdbool.h>, <limits.h>.
5592         (_POSIX_NAME_MAX): Define if not defined.
5593         (MIN): New macro.
5594         (same_name): If file names are silently truncated, report
5595         that the file names are the same if they are the same after
5596         the silent truncation.
5597
5598         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5599         conversion function.
5600         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5601         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5602         longer needed.
5603
5604 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5605
5606         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5607         with like-named macro in fnmatch.c.
5608         (EXT): Use an internal constant instead.
5609
5610         Merge fnmatch patches from glibc.
5611         * fnmatch.c (mbsinit): Remove define.
5612         Add libc_hidden_ver (__fnmatch, fnmatch).
5613         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5614         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5615
5616 2003-12-14  Karl Berry  <karl@gnu.org>
5617
5618         * config.charset: update from gettext-runtime.
5619
5620 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5621
5622         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5623         Bug reported by Alfred M. Szmidt.
5624
5625 2003-11-29  Karl Berry  <karl@gnu.org>
5626
5627         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5628
5629 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5630             Bruno Haible  <bruno@clisp.org>
5631
5632         * printf-parse.h: Don't include sys/types.h.
5633         (ARG_NONE): New macro.
5634         (char_directive): Change type of *arg_index fields to size_t.
5635         * printf-parse.c: Don't include sys/types.h.
5636         (SSIZE_MAX): Remove macro.
5637         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5638         Remove unnecessary overflow check.
5639         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5640         fields.
5641
5642 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5643
5644         * alloca.c: Remove dependency on xalloc module.
5645         (xalloc_die): Remove.
5646         (memory_full) [!defined emacs]: New macro.
5647         [!defined emacs]: Don't include xalloc.h.
5648         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5649         address arithmetic overflows.  Change datatypes a bit to avoid
5650         unnecessary casts.
5651
5652 2003-11-22  Jim Meyering  <jim@meyering.net>
5653
5654         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5655
5656 2003-11-17  Bruno Haible  <bruno@clisp.org>
5657
5658         * vasnprintf.c (alloca): Remove fallback definition.
5659         (freea): Remove definition.
5660         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5661         Reported by Paul Eggert.
5662
5663 2003-11-17  Jim Meyering  <jim@meyering.net>
5664
5665         On systems without utime and without a utimes function capable of
5666         dealing with a NULL struct utimbuf* argument, this utime replacement
5667         could -- in unusual circumstances -- leak a file descriptor.
5668         * utime.c: Include <unistd.h> and <errno.h>.
5669         (utime_null): Be sure to close `fd' and to preserve errno.
5670         Reported by Geoff Collyer via Arnold Robbins.
5671
5672 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5673             Bruno Haible  <bruno@clisp.org>
5674
5675         Protect against address arithmetic overflow.
5676         * printf-args.h: Include stddef.h.
5677         (arguments): Change type of field 'count' to size_t.
5678         * printf-args.c (printf_fetchargs): Use size_t instead of
5679         'unsigned int' where appropriate.
5680         * printf-parse.h: Include sys/types.h.
5681         (char_directive): Change type of *arg_index fields to ssize_t.
5682         (char_directives): Change type of fields 'count', max_*_length to
5683         size_t.
5684         * printf-parse.c: Include sys/types.h and xsize.h.
5685         (SSIZE_MAX): Define fallback value.
5686         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5687         instead of 'int' where appropriate. Check a_allocated, d_allocated
5688         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5689         * vasnprintf.c: Include xsize.h.
5690         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5691         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5692         overflow. Avoid wraparound when converting a width or precision from
5693         decimal to binary.
5694
5695 2003-11-16  Bruno Haible  <bruno@clisp.org>
5696
5697         Update from GNU gettext.
5698         * printf-parse.c: Generalize to it can be compiled for wide strings.
5699         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5700         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5701         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5702         SNPRINTF): New macros.
5703         Don't include <alloca.h> if the file is used inside libintl.
5704         (local_wcslen): New function, for Solaris 2.5.1.
5705         (VASNPRINTF): Use it instead of wcslen.
5706
5707 2003-11-16  Bruno Haible  <bruno@clisp.org>
5708
5709         * xsize.h (xmax): New function.
5710         (xsum, xsum3, xsum4): Declare as "pure" functions.
5711
5712 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5713
5714         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5715         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5716         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5717         heuristic is just as accurate as far as we know, and it removes a
5718         dependency on size_max.m4 and ptrdiff_max.m4.
5719
5720 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5721
5722         * xstrtol.c (__xstrtol): Remove "break" immediately after
5723         "return", to pacify some unknown compiler.  Problem reported
5724         by Joerg Schilling.
5725
5726 2003-11-11  Bruno Haible  <bruno@clisp.org>
5727
5728         * xsize.h (SIZE_MAX): Remove fallback definition.
5729         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5730         defined.
5731
5732 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5733
5734         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5735         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5736         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5737         From Bruno Haible.
5738         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5739         not (size_t) -1, since it's defined here.
5740
5741 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5742
5743         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5744         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5745         Reject sizes of exactly SIZE_MAX bytes.
5746         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5747         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5748
5749 2003-11-05  Bruno Haible  <bruno@clisp.org>
5750
5751         * xsize.h: Include limits.h, to avoid a possible collision with
5752         SIZE_MAX defined in <limits.h> on Solaris.
5753
5754 2003-11-04  Bruno Haible  <bruno@clisp.org>
5755
5756         * xsize.h: New file.
5757         * linebreak.c: Include xsize.h.
5758         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5759         argument for overflow.
5760         Suggested by Paul Eggert.
5761
5762 2003-10-31  Bruno Haible  <bruno@clisp.org>
5763
5764         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5765         to avoid (extremely rare) race condition.
5766         Suggested by Paul Eggert.
5767
5768 2003-11-03  Jim Meyering  <jim@meyering.net>
5769
5770         * userspec.c: Include "userspec.h".
5771         * userspec.h: New file.
5772
5773 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5774
5775         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5776         * mountlist.c (SIZE_MAX): Define if not defined already.
5777         (read_filesystem_list): Set and use me_type_malloced.
5778         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5779         whatever the type happens to be), for brevity and consistency.
5780         Check for size calculation overflow on Alphas running OSF/1.
5781
5782 2003-10-31  Jim Meyering  <jim@meyering.net>
5783
5784         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5785
5786         * linebuffer.c: Include <string.h> for declaration of memset.
5787
5788 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5789             Bruno Haible  <bruno@clisp.org>
5790
5791         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5792         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5793
5794 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5795
5796         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5797         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5798         no longer needed.
5799         * quotearg.c (quotearg_n_options): Use it.
5800         * group-member.c: Include <stdbool.h>.
5801         (free_group_info): Arg is now const *; don't free arg.
5802         (get_group_info): Now returns bool and accepts struct group_info *,
5803         rather than returning a malloc'ed struct group_info *.
5804         All uses changed.  Check for overflow in internal size calculation.
5805
5806         * getusershell.c (readname): Simplify the code by using x2nrealloc
5807         rather than xmalloc/xrealloc.
5808         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5809         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
5810         conformance bug: the old code used a pointer after freeing the
5811         storage that it addressed.
5812         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5813         rather than doing it by hand.
5814         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5815         the buffer preserved.  Use free and xmalloc instead.
5816         * quotearg.c (quotearg_n_options): Likewise.
5817         Use a simpler test for size overflow.  Don't use xalloc_oversized
5818         because unsigned int might be wider than size_t (!); this suggests
5819         that we should switch from unsigned int to size_t for slot numbers.
5820
5821 2003-10-27  Bruno Haible  <bruno@clisp.org>
5822
5823         * stdbool_.h: Better support for BeOS.
5824
5825 2003-10-27  Paul Eggert  <eggert@twinsun.com>
5826
5827         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5828         to allocate the returned structure.  Do not allocate a subarray,
5829         as x2nrealloc will do that.
5830         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5831         instead of xnrealloc.
5832         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5833
5834 2003-10-26  Paul Eggert  <eggert@twinsun.com>
5835
5836         * xalloc.h (xalloc_oversized): New static inline function, for
5837         callers that want to do their own size-overflow checking.  Include
5838         <stdbool.h>, since xalloc_oversized returns bool.
5839         * xalloc.c (array_size_overflow): Remove.  All callers changed
5840         to use xalloc_oversized.
5841
5842         Add two functions x2realloc, x2nrealloc, for programs that grow
5843         arrays dynamically by doubling their sizes.
5844         * xalloc.h (x2realloc, x2nrealloc): New decls.
5845         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5846         New functions.
5847
5848         Port to C99 semantics for 'inline' of external functions.
5849         Bug reported by Bruno Haible.
5850         * xmalloc.c (xnmalloc_inline): New static inline function,
5851         with the old contents of xnmalloc.
5852         (xnmalloc, xmalloc): Use it.
5853         (xnrealloc_inline): New static inline function,
5854         with the old contents of xnrealloc.
5855         (xnrealloc, xrealloc): Use it.
5856
5857         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5858
5859 2003-10-25  Paul Eggert  <eggert@twinsun.com>
5860
5861         Fix several address-calculation bugs in the hash modules,
5862         plus some minor code cleanup.
5863
5864         * hash.h: Include <stdbool.h>, for bool.
5865         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5866         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5867         hash_get_n_entries, hash_get_max_bucket_length,
5868         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5869         hash_rehash): Use size_t rather than unsigned.
5870         * hash.c (struct hash_table, hash_get_n_buckets,
5871         hash_get_n_buckets_used, hash_get_n_entries,
5872         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5873         hash_get_entries, hash_do_for_each, hash_string, is_prime,
5874         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5875         Likewise.
5876         (SIZE_MAX): Define if not defined.
5877         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5878         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5879         hash_print):
5880         Use const * when possible.
5881         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5882         (check_tuning): Fix bug: if tuning parameters were very close to
5883         0 or 1, rounding errors could have caused subscript violations.
5884         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5885         (hash_initialize): Add 'fail:' label
5886         to free table and return NULL, and use it to simplify code.
5887         Use calloc rather than clearing the storage ourself.
5888         (hash_initialize, hash_rehash): Check for arithmetic overflow in
5889         buffer size calculations.
5890         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5891         Include <stddef.h>, for size_t.
5892         * hash-pjw.c (hash_pjw): Likewise.
5893         Switch to method described by Bruno Haible.
5894         Include <limits.h>, for CHAR_BIT.
5895         (SIZE_BITS): New macro.
5896
5897 2003-10-21  Paul Eggert  <eggert@twinsun.com>
5898
5899         * getndelim2.c (getndelim2): When size calculation overflows,
5900         ceiling the allocation at NMAX bytes rather than silently
5901         discarding input bytes before NMAX is reached.  This makes
5902         a difference only if NMAX exceeds SIZE_MAX / 2.
5903
5904         * obstack.c: Merge from glibc.
5905         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5906         Add libc_hidden_def (_obstack_newchunk).
5907         (_obstack_free) [! defined _LIBC]: Remove.
5908         [defined _LIBC]: Make a strong alias from obstack_free, rather than
5909         a clone of the function body.
5910         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5911         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5912
5913         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5914         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5915         arg to memcpy.
5916
5917         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5918         (obstack_ptr_grow_fast, obstack_int_grow_fast):
5919         Don't use lvalue casts, as GCC plans to remove support for them
5920         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
5921         was also present in the non-GCC version, indicating that this
5922         code had always been buggy and had never been widely used.
5923         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5924         Use the fast variant of each macro, rather than copying the
5925         definiens of the fast variant; that way, we'll be more likely to
5926         catch future bugs in the fast variants.
5927
5928 2003-10-20  Bruno Haible  <bruno@clisp.org>
5929
5930         * wait-process.h: New file, from GNU gettext.
5931         * wait-process.c: New file, from GNU gettext.
5932
5933 2003-10-19  Jim Meyering  <jim@meyering.net>
5934
5935         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5936
5937 2003-10-16  Paul Eggert  <eggert@twinsun.com>
5938
5939         * getgroups.c: Include <errno.h>, <stdlib.h>.
5940         (getgroups): First arg is int, not size_t.
5941         Don't let 'free' mangle errno.
5942
5943 2003-10-16  Jim Meyering  <jim@meyering.net>
5944
5945         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5946
5947 2003-10-15  Paul Eggert  <eggert@twinsun.com>
5948
5949         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5950         (SIZE_MAX): Remove.
5951         (new_exclude, add_exclude_file): Initial size no longer needs to
5952         be a power of 2.
5953         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5954         our own address arithmetic overflow checking.
5955
5956         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5957         (fnmatch): Do not alloca more than 2000 wide characters;
5958         instead, use malloc for large buffers.
5959         Check for address arithmetic overflow, and return -1
5960         with errno set to ENOMEM in that case.
5961         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5962         (NEW_PATTERN): Do not alloca more than 8000 bytes;
5963         instead, return -1.  Check for address arithmetic overflow.
5964
5965 2003-10-14  Paul Eggert  <eggert@twinsun.com>
5966
5967         Handle invalid suffixes and overflow independently, so that
5968         callers can treat them independently as needed.  Fix some bugs in
5969         suffix handling, e.g., "100k@" was not diagnosed as an invalid
5970         suffix for a human-readable blocksize.  The major caller-visible
5971         change is the addition of a new
5972         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5973         that both overflow and suffix chars were found.
5974
5975         * human.c (humblock): Don't check separately for invalid suffix
5976         char; that is xstrtoumax's job (now that its bug is fixed).
5977         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5978         INTMAX_MAX]: New macros.
5979         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5980         TYPE_MAXIMUM): New macros.
5981         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5982         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5983         if overflow occurs, as it's what __strtol does and it's more useful
5984         in practice.
5985         (__xstrtol): If __strtol reports some error other than ERANGE,
5986         reflect it to the caller as LONGINT_INVALID.  If it reports
5987         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5988         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5989         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5990         value.
5991         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
5992         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5993         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5994         [defined UINTMAX_MAX]: New macros.
5995
5996 2003-10-14  Bruno Haible  <bruno@clisp.org>
5997
5998         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5999         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6000         Also use volatile where needed.
6001
6002 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6003
6004         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6005         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6006         and define in terms of the other primitives.
6007         * xmalloc.c: Include stdbool.h; do not include exit.h.
6008         (SIZE_MAX): Define if not already defined.
6009         (array_size_overflow): New function.
6010         (xalloc_die): Abort instead of exiting if 'error' returns.
6011         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6012         (xmalloc, xrealloc): Use them.
6013         (xcalloc): Check for address arithmetic overflow.
6014         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6015         a bit faster than strcpy.
6016
6017 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6018
6019         Merge getpass from libc, plus a few fixes.
6020
6021         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6022         Include <stdbool.h>.
6023         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6024         __fsetlocking to empty.
6025         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6026         do include <bits/libc-lock.h>.
6027         Do not include <fcntl.h>; not needed.
6028         [_LIBC]: Include <wchar.h>.
6029         (NOTCANCEL_MODE): New macro.
6030         (flockfile, funlockfile) [_LIBC]: New macros.
6031         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6032         [!_LIBC]: New macros.
6033         (call_fclose): New function.
6034         (getpass): Use it.  Save tty stream separately; this simplifies the
6035         code and makes it more reliable if stdin happens to equal stdout.
6036         Invoke __fsetlocking on tty.
6037         Handle thread cancellation if needed.
6038         Namespace cleanup (use __tcgetattr, __getline).
6039         Use bool for Booleans.
6040         [USE_IN_LIBIO]: Handle wide streams.
6041         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6042         stream might go where.
6043
6044         * unlocked-io.h: Include <stdio.h>, so that the caller
6045         doesn't have to include <stdio.h> before us.
6046         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6047         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6048         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6049         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6050         if not declared, so that we can use getpass.c code from libc without
6051         rewriting it.
6052         (flockfile, ftrylockfile, funlockfile): New macros.
6053
6054 2003-10-06  Bruno Haible  <bruno@clisp.org>
6055
6056         * version-etc-2.h: Remove file.
6057         * version-etc-2.c: Remove file.
6058
6059 2003-09-25  Jim Meyering  <jim@meyering.net>
6060             Bruno Haible  <bruno@clisp.org>
6061
6062         This lets translators provide better translations for the
6063         "Written by ..." part of --version output.
6064         * version-etc.h: Include stdarg.h.
6065         (version_etc_copyright): Declare as readonly.
6066         (version_etc): Make this function variadic with a NULL-terminated list
6067         of author name strings.
6068         (version_etc_va): New declaration.
6069         * version-etc.c: Include stdarg.h, stdlib.h.
6070         (version_etc_copyright): Declare as readonly.
6071         (version_etc_va): New function. Provide a different translatable string
6072         for each possible number of authors < 10. Abbreviate when there are 10
6073         authors or more.
6074         (version_etc): Make this function variadic. Call version_etc_va.
6075         Suggestion from Gary V. Vaughan.
6076
6077         * long-options.h (parse_long_options): Change prototype: the authors
6078         string is moved to the end and becomes variadic.
6079         * long-options.c: Include stdarg.h.
6080         (parse_long_options): Make this function variadic, too.
6081         Call version_etc_va, not version_etc.
6082
6083 2003-10-06  Bruno Haible  <bruno@clisp.org>
6084
6085         * fatal-signal.h: New file, from GNU gettext.
6086         * fatal-signal.c: New file, from GNU gettext.
6087
6088 2003-10-04  Karl Berry  <karl@gnu.org>
6089
6090         * argp*: update from libc.
6091
6092 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6093
6094         * getpass.c (getpass): Use a no-op fseek when switching from input to
6095         output mode on the same stream.
6096
6097 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6098
6099         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6100         Fix arg typo in previous patch.
6101
6102 2003-09-28  Jim Meyering  <jim@meyering.net>
6103
6104         * error.c: Correct cpp indentation.
6105
6106 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6107
6108         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6109         Omit the special code that used __typeof__, since we worry that
6110         it could be more trouble than it's worth.  See:
6111         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6112         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6113
6114         * free.c: New file.
6115
6116 2003-09-26  Jim Meyering  <jim@meyering.net>
6117
6118         * error.c (error_tail): Move some declarations
6119         into inner scope where the local variables are used.
6120
6121 2003-09-26  Bruno Haible  <bruno@clisp.org>
6122
6123         * stpncpy.h (gnu_stpncpy): New declaration.
6124         (stpncpy): Define as alias for gnu_stpncpy.
6125         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6126
6127 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6128
6129         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6130         (error_tail): Do not loop, reallocating temporary buffer, since
6131         the output cannot contain more wide characters than the input
6132         contains bytes, the size must be big enough already.  This avoids
6133         one potential size overflow calculation.  Check for size overflow
6134         when calculating temporary buffer size.  Free temporary buffer
6135         when done, if it was allocated with malloc; this plugs a memory
6136         leak.  Remove casts from void * to pointers, that are no longer
6137         needed now that we're assuming C89 or better.
6138
6139         Merge error changes from glibc.
6140
6141         * error.c, error.h: Update copyright notice header to match glibc.
6142         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6143         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6144         Disable cancellation while printing error.
6145         * error.h: Prepend __ to parameter names.
6146
6147 2003-09-25  Karl Berry  <karl@gnu.org>
6148
6149         * argp-fmtstream.c, argp-help.c: update from libc.
6150
6151 2003-09-25  Bruno Haible  <bruno@clisp.org>
6152
6153         * version-etc-2.h: New file, from version-etc.h with modifications.
6154         * version-etc-2.c: New file, from version-etc.c with modifications.
6155
6156 2003-09-25  Simon Josefsson  <jas@extundo.com>
6157
6158         * xgetdomainname.h: New file.
6159         * xgetdomainname.c: New file.
6160
6161 2003-09-25  Simon Josefsson  <jas@extundo.com>
6162             Bruno Haible  <bruno@clisp.org>
6163
6164         * getdomainname.h: New file.
6165         * getdomainname.c: New file.
6166
6167 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6168
6169         * linebuffer.c (freebuffer): Don't free the argument, just
6170         the buffer associated with the argument.  Bug reported by
6171         Simon Josefsson.
6172
6173 2003-09-19  Karl Berry  <karl@gnu.org>
6174
6175         * argp.h: update from libc.
6176
6177 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6178
6179         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6180         input error, instead of returning NULL the next time we are called
6181         (and therefore losing track of errno).
6182
6183 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6184
6185         * getndelim2.c (getndelim2): Don't trash errno when a read
6186         fails, so that the caller gets the proper errno.
6187
6188         * readutmp.c (read_utmp): Likewise.
6189         Check for fstat error.  Close stream and free storage
6190         when failing.
6191
6192 2003-09-14  Bruno Haible  <bruno@clisp.org>
6193
6194         * fwriteerror.h: New file.
6195         * fwriteerror.c: New file.
6196
6197 2003-09-14  Jim Meyering  <jim@meyering.net>
6198
6199         * getloadavg.c: Correct cpp indentation.
6200         * strdup.c: Likewise.
6201         * vasnprintf.c: Likewise.
6202
6203 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6204
6205         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6206         * obstack.c [!defined _LIBC]: Likewise.
6207         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6208         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6209         * exitfail.c: Don't include stdlib.h; no longer needed.
6210
6211         More changes to assume C89 or better.
6212
6213         * error.c (error_tail): Assume vprintf.
6214
6215         * argmatch.c (getenv): Remove decl.
6216         * progreloc.c (get_full_program_name): Define via prototype.
6217         * setenv.c (clearenv): Likewise.
6218         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6219         needed.
6220         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6221         (malloc, memcpy): Remove decls.
6222         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6223         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6224         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6225         (memcpy): Remove macro.
6226         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6227         (__P): Remove.  All uses removed.
6228         (PTR): Remove.  All uses changed to void *.
6229         (CHAR_BIT, NULL): Remove.
6230         (spaces, zeros, memset_space, memset_zero)
6231         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6232         Remove.
6233         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6234         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6235         Define with prototype.
6236         Remove now-unnecessary prototype decl.
6237         (extra_args_spec): Assume ANSI C.  All uses changed.
6238         (extra_args_spec_iso): Remove.
6239         (my_strftime, emacs_strftimeu): Define via prototype.
6240         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6241         unconditionally.
6242         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6243         * strtoimax.c: Include <stdlib.h> unconditionally.
6244         (strtoul, strtol): Remove decls.
6245         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6246         LONG_MAX): Remove.
6247         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6248         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6249         (LOCALE_PARAM_PROTO): New macro.
6250         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6251         (INTERNAL (strtol), strtol): Define with a prototype.
6252         (PARAMS): Remove.  All uses removed.
6253         * tempname.c: Include <string.h> unconditionally.
6254         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6255         * xgethostname.c (main): Define with a prototype.
6256         * xmalloc.c: Include "xalloc.h" first, to check interface.
6257         Include <stdlib.h> unconditionally.
6258         (calloc, malloc, realloc, free): Remove decls.
6259         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6260         Include <stdlib.h> unconditionally.  Sort include file names.
6261         (strtod): Remove.
6262         (xstrtod): Define with a prototype.
6263         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6264         (strtol, strtoul): Remove decls.
6265
6266 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6267
6268         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6269         Include <stdlib.h>, <string.h> unconditionally.
6270         Remove now-unnecessary cast to char *.
6271         * strnlen.c: Include <string.h> unconditionally.
6272         * yesno.c (yesno): Define with a prototype.
6273
6274 2003-09-10  Bruno Haible  <bruno@clisp.org>
6275
6276         * strcspn.c: Include <string.h> unconditionally.
6277         * strpbrk.c: Include <string.h> unconditionally.
6278         * strstr.c: Include <string.h> unconditionally.
6279         * unicodeio.c: Include <string.h> unconditionally.
6280         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6281         * unsetenv.c: Likewise.
6282         * xreadlink.c: Include <stdlib.h> unconditionally.
6283         * yesno.c: Include <stdlib.h> unconditionally.
6284         (rpmatch): Add prototype.
6285
6286 2003-09-10  Jim Meyering  <jim@meyering.net>
6287
6288         * error.c: Correct indentation of cpp directives.
6289
6290 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6291
6292         More K&R removal.
6293
6294         * acosl.c (main): Use a prototype.
6295         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6296         tanl.c: Likewise.
6297
6298         * getloadavg.c (getloadavg, main): Define via prototypes.
6299
6300         * getopt.h (struct option.name): Assume C89, and use 'const'.
6301         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6302         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6303         with a prototype.
6304         * getopt.c (const): Remove macro.
6305         Include <string.h> unconditionally.
6306         (my_index): Remove; all uses changed to strchr.
6307         (strlen): Remove decl.
6308         (exchange): Remove forward decl; no longer needed.
6309         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6310         Define with prototype.
6311         * getopt1.c (const): Remove macro.
6312         (getopt_long, getopt_long_only, main): Define with prototype.
6313
6314         * getugroups.c: Include <string.h> unconditionally.
6315
6316         * getusershell.c: Include <stdlib.h> unconditionally.
6317         (getusershell, setusershell, endusershell, readname, main):
6318         Define with prototypes.
6319
6320         * group-member.c: Include group-member.h first.
6321         Include <stdlib.h> unconditionally.
6322
6323         * hard-locale.c: Include hard-locale.h first.
6324         Include <stdlib.h>, <string.h> unconditionally.
6325
6326         * hash.c (free, malloc): Remove decls.
6327         Include <stdlib.h> unconditionally.
6328
6329         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6330         (getenv): Do not declare.
6331
6332         * idcache.c: Include <string.h> unconditionally.
6333
6334         * long-options.c: Include long-options.h first, to test interface.
6335         Include <stdlib.h> unconditionally.
6336
6337         * makepath.c: Include makepath.h first, to test interface.
6338         Include <stdlib.h> and <string.h> unconditionally.
6339
6340         * linebuffer.c: Include <stdlib.h>.
6341         (free): Remove decl.
6342
6343         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6344         rpl_malloc returns void *, not char *.
6345         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6346
6347         * md5.h: Include <limits.h> unconditionally.
6348         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6349         (__P): Remove; all uses removed.
6350         * md5.c: Include "md5.h" first.
6351         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6352         md5_buffer, md5_process_bytes, md5_process_block):
6353         Define with prototypes.
6354         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6355         * sha.c: Include "sha.h" first.
6356         Include <stdlib.h>, <string.h> unconditionally.
6357
6358         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6359         * memcmp.c (__ptr_t): Likewise.
6360         * memrchr.c (__ptr_t): Likewise.
6361         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6362         Include <string.h> unconditionally.
6363         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6364         * memchr.c: Include <stdlib.h> unconditionally.
6365         * memchr.c (LONG_MAX): Remove.
6366         * memrchr.c (LONG_MAX): Likewise.
6367         * memchr.c (__memchr): Define via a prototype.
6368         * memrchr.c (__memrchr): Likewise.
6369         * memcmp.c (__P): Remove, and remove all uses.
6370         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6371         Remove forward decls; no longer needed.
6372         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6373         Use types required by C89 in prototype.
6374
6375         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6376         * savedir.c: Likewise.
6377         * mkdir.c (free): Remove decl.
6378         * rmdir.c (rmdir): Define with a prototype.
6379         * savedir.c: Include savedir.h first, to test interface.
6380
6381         * mktime.c (STDC_HEADERS): Remove.
6382         Include <stdlib.h>, <string.h> unconditionally.
6383
6384         * modechange.c: Include <stdlib.h> unconditionally.
6385         (malloc): Remove decl.
6386
6387         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6388         (free): Remove decl.
6389
6390         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6391         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6392         (This type really should be intptr_t, but that's a C99ism.)
6393         (_obstack_memcpy): Remove: all uses changed to memcpy.
6394         Include <string.h> unconditionally.
6395         (struct obstack): Assume __STDC__ for types of members
6396         chunkfun, freefun, extra_arg.
6397         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6398         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6399         obstack_begin, obstack_specify_allocation,
6400         obstack_specify_allocation_with_arg, obstack_chunkfun,
6401         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6402         Remove unprototyped decls and the macros that use them.
6403         * obstack.c (POINTER): Remove.  All uses changed to void *.
6404         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6405         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6406         (defined __STDC__ && __STDC__)]:
6407         Remove nonprototyped code.
6408         Include <stdlib.h> unconditionally.
6409         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6410         _obstack_allocated_p, _obstack_free, obstack_free,
6411         _obstack_memory_used, print_and_abort):
6412         Define using prototypes.
6413         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6414         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6415         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6416         obstack_next_free, obstack_object_size, obstack_room) [0]:
6417         Remove unused, unprototyped code.
6418
6419         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6420
6421         * physmem.c (physmem_total, physmem_available, main): Define
6422         with prototypes.
6423
6424         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6425         (main): Define with a prototype.
6426
6427         * posixver.c (getenv): Remove decl.
6428
6429         * putenv.c (malloc): Returns void *, not char *.
6430         Include <string.h> unconditionally.
6431         (strchr, memcpy, NULL): Do not define.
6432
6433         * readtokens.c: Include readtokens.h first, to test interface.
6434         Include <stdlib.h>, <string.h> unconditionally.
6435         (init_tokenbuffer): Define with a prototype.
6436
6437         * regex.c (PARAMS): Remove.  All uses removed.
6438         All uses of _RE_ARGS removed, too.
6439         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6440         unconditionally.
6441         (bzero): Assume memset exists.
6442         (memcmp, memcpy, NULL): Remove.
6443         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6444         char, or assignments to local vars of type signed char.
6445         (init_syntax_once, PREFIX(extract_number_and_incr),
6446         PREFIX(print_partial_compiled_pattern),
6447         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6448         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6449         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6450         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6451         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6452         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6453         wcs_compile_range, byte_compile_range, truncate_wchar,
6454         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6455         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6456         count_mbs_length, wcs_re_match_2_internal,
6457         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6458         PREFIX(alt_match_null_string_p),
6459         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6460         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6461         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6462         now-unnecessary declaration, if any.
6463         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6464         regcomp, regexec):
6465         Remove now-unnecessary casts among pointer types.
6466         * regex.h (_RE_ARGS): Remove.  All uses removed.
6467
6468         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6469         (free): Remove decl.
6470
6471         * rpmatch.c: Include <stdlib.h> unconditionally.
6472
6473         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6474         (free): Remove decl.
6475
6476         * save-cwd.c: Include <stdlib.h> unconditionally.
6477         * xgetcwd.c: Likewise.
6478
6479         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6480         (free): Remove decl.
6481
6482         * strchrnul.c (strchrnul): Define with a prototype.
6483         Fix bug: c_in was not converted to char before searching.
6484
6485         The following changes are not K&R related:
6486
6487         * group-member.h: Include <sys/types.h>, so that this file is
6488         self-contained.
6489         * makepath.h: Likewise.
6490
6491         * getusershell.c (readname, default_index, line_size, readname):
6492         Use size_t, not int, for sizes.
6493         (readname): If the size overflows, report an error instead of
6494         looping forever.
6495
6496 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6497
6498         * getndelim2.c: Assume stdlib.h per the C89 spec.
6499
6500 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6501
6502         Assume C89 or better; remove K&R cruft.
6503         A few of these changes were first proposed by Derek Robert Price
6504         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6505
6506         * addext.c: Include <string.h> unconditionally.
6507         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6508         Don't declare getenv or malloc.
6509
6510         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6511         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6512         (NULL): Remove.
6513         (find_stack_direction, alloca): Use prototypes.
6514
6515         * atexit.c (atexit): Define using a prototype.
6516
6517         * basename.c, dirname.c, stripslash.c:
6518         Include <string.h> unconditionally.
6519
6520         * bcopy.c: Include <stddef.h>.
6521         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6522
6523         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6524
6525         * error.h (error, error_at_line, error_print_progname)
6526         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6527         * error.c: Include error.h first, to check interface.
6528         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6529         (VA_START): Remove; all uses changeed to va_start.
6530         (exit, strerror): Remove decls.
6531         (error_print_progname): Prototype uncondionally.
6532         Don't include <errno.h>; no longer needed.
6533         (private_strerror): Remove.
6534         (error_tail): Always define.
6535         (error, error_at_line): Assume C89 or better; always use prototypes.
6536         * fatal.c: Include "fatal.h" first, to test interface.
6537         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6538         (VA_START): Remove; all uses changed to va_start.
6539         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6540         this case.
6541         (exit): Remove decl.
6542         (fatal): Prototype unconditionally.  Assume va_start works.
6543         Abort at end, to pacify gcc.
6544
6545         * euidaccess.c (main): Define with a prototype.
6546
6547         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6548
6549         * exitfail.c: Include <stdlib.h> unconditionally.
6550
6551         * fnmatch_.h (__P): Remove.  All uses changed to assume
6552         prototypes.
6553         * fnmatch.c: Include fnmatch.h first, to test interface.
6554         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6555         (getenv): Remove decl.
6556         (fnmatch): Define using a prototype.
6557         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6558         (FCT): Define using a prototype.
6559
6560         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6561
6562         * gethostname.c: Include <stddef.h>.
6563         (gethostname): Define with prototype.  Length is size_t, not int.
6564
6565 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6566
6567         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6568         getversion.c should have been removed then, but was accidentally
6569         preserved.
6570
6571         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6572         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6573
6574 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6575
6576         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6577         copy_tm_result.  Bug reported by Simon Josefsson in
6578         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6579
6580 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6581
6582         * time_r.c, time_r.h: New files.
6583
6584         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6585         __localtime_r.
6586         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6587         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6588
6589         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6590         __gmtime_r.
6591         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6592         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6593         Include <time_r.h>.
6594
6595         * timegm.c: Switch to glibc implementation, with the following changes:
6596         [defined HAVE_CONFIG_H]: Include <config.h>.
6597         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6598         (__mktime_internal) [!defined _LIBC]: New decl.
6599         (__gmtime_r) [!defined _LIBC]: New macro and function.
6600         (timegm): Use a prototype, since gnulib assumes C89.
6601         Do not bother declaring tmp to be const, as it's not really usefu.
6602         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6603         (timegm): Declare only if HAVE_DECL_TIMEGM.
6604
6605 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6606
6607         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6608         Bug reported by Lute Kamstra in
6609         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6610
6611         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6612         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6613         course with correspondingly smaller numbers for tomorrow and
6614         yesterday.  From Tadayoshi Funaba.  Originally installed into
6615         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6616         coreutils merge?).
6617
6618 2003-08-31  Simon Josefsson  <jas@extundo.com>
6619
6620         * timegm.h: New file.
6621         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6622
6623 2003-08-31  Karl Berry  <karl@gnu.org>
6624
6625         * argp.h: update from libc.
6626
6627 2003-08-28  Bruno Haible  <bruno@clisp.org>
6628
6629         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6630         warning on QNX, which defines O_BINARY to 000000.
6631
6632 2003-08-24  Bruno Haible  <bruno@clisp.org>
6633
6634         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6635         MSVC7 <stdio.h> is included later.
6636
6637 2003-08-20  Bruno Haible  <bruno@clisp.org>
6638
6639         * progname.h: New file, from GNU gettext.
6640         * progname.c: New file, from GNU gettext.
6641         * progreloc.c: New file, from GNU gettext.
6642
6643 2003-08-19  Bruno Haible  <bruno@clisp.org>
6644
6645         * xstrdup.c: Assume <string.h> exists.
6646
6647 2003-08-18  Jim Meyering  <jim@meyering.net>
6648
6649         * setenv.h: Indent nested cpp directive.
6650         * vasnprintf.c: Remove trailing blanks.
6651
6652 2003-08-17  Simon Josefsson  <jas@extundo.com>
6653             Bruno Haible  <bruno@clisp.org>
6654
6655         * xstrndup.h: New file.
6656         * xstrndup.c: New file.
6657
6658 2003-08-17  Bruno Haible  <bruno@clisp.org>
6659
6660         * strndup.h: New file.
6661
6662 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6663
6664         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6665         space, undoing this 2003-08-12 change:
6666         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6667
6668 2003-08-16  Jim Meyering  <jim@meyering.net>
6669
6670         Merge from coreutils.
6671         * xstrtoimax.c: #else #if -> #elif.
6672         * xstrtoumax.c: Likewise.
6673
6674 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6675
6676         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6677         rather than tab, after '#' in shell-script copyright notices.
6678         Suggested by Bruno Haible.
6679
6680 2003-08-15  Jim Meyering  <jim@meyering.net>
6681         and Paul Eggert  <eggert@twinsun.com>
6682
6683         Merge from coreutils.
6684         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6685         member but strut utmpx does not.  Needed for AIX 4.3.3.
6686         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6687
6688 2003-08-15  Jim Meyering  <jim@meyering.net>
6689
6690         Merge from coreutils.
6691         * xgethostname.c: Include <stdlib.h>.
6692         (xghostname): Don't exit for anything other than memory-related
6693         failure; just return NULL.
6694         * userspec.c: Include "posixver.h".
6695         (parse_user_spec): Accept `.' as a separator only
6696         in pre-POSIX-200112 mode.
6697         * strtoimax.c: Use #elif rather than #else #if.
6698         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6699         Remove function, now that we can rely on a working tzset function.
6700         [!_LIBC]: Ensure that the required autoconf test has been run.
6701         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6702         Use underlying_strftime for %r.
6703         * sha.c: Merge in some clean-up and optimization changes from glibc.
6704         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6705         Ensure that it is a multiple of 64.
6706         Rearrange loop exit tests so as to avoid performing an
6707         additional fread after encountering an error or EOF.
6708         * realloc.c: Update copyright date.
6709
6710 2003-08-14  Jim Meyering  <jim@meyering.net>
6711
6712         Merge from coreutils.
6713         * obstack.h: Whitespace changes.
6714         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6715         and xcalloc return values.
6716         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6717         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6718         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6719         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6720         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6721         error from mntctl.
6722         Use mntctl's return value to drive the entry-processing loop, since
6723         we can't rely on the value of the vmt_length member in the last
6724         entry.  On some systems doing so could result in exhausting
6725         virtual memory.  Based in part on a patch from Mike Jetzer.
6726
6727 2003-08-14  Jim Meyering  <jim@meyering.net>
6728         and Paul Eggert  <eggert@twinsun.com>
6729
6730         Merges from coreutils, plus other fixes.
6731         * physmem.c: Merge in portability changes from gcc/libiberty
6732         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6733         for credits and details.  Thanks to Kaveh Ghazi for helping
6734         to keep these files in sync.
6735         (ARRAY_SIZE): Define it.
6736         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6737         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6738         (memcasecmp): Don't assume size_t fits in unsigned int.
6739         Remove casts and duplicate code.
6740         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6741         (memcpy): Remove definition.
6742         Merge in some clean-up and optimization changes from glibc.
6743         [BLOCKSIZE]: Move definition to top of file.
6744         Ensure that it is a multiple of 64.
6745         Rearrange loop exit tests so as to avoid performing an
6746         additional fread after encountering an error or EOF.
6747         * md5.h (md5_uintptr): Define.
6748         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6749         return to the initial working directory.  Preserve errno
6750         for caller.
6751         * idcache.c: Include "xalloc.h".
6752         (xmalloc, xrealloc): Remove decls.
6753         (getuser): Remove casts no longer required in C89.
6754         * human.c: Include stdio.h, for sprintf.
6755         * group-member.c: Include "xalloc.h".
6756         (xmalloc, xrealloc): Remove decls.
6757         (get_group_info): Remove casts no longer required in C89.
6758         * getusershell.c (readname): Remove casts no longer required in C89.
6759         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6760         * getline.c: Whitespace fix, from coreutils.
6761
6762 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6763
6764         * exclude.c: Include <ctype.h>
6765         (IN_CTYPE_DOMAIN): New macro.
6766         (is_space): New fn.
6767         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6768         and empty lines.
6769
6770         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6771         Undo previous (whitespace-only) change.
6772
6773 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6774
6775         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6776         Normalize leading white space and remove trailing white space.
6777         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6778         notice, as per ../config/srclist-update.
6779
6780         Merge from coreutils.
6781         * euidaccess.h: New file.
6782         * euidaccess.c: Include it.
6783         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6784         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6785         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6786
6787 2003-08-11  Bruno Haible  <bruno@clisp.org>
6788
6789         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6790         (vasnprintf): Use it instead of wcslen.
6791
6792 2003-08-11  Bruno Haible  <bruno@clisp.org>
6793
6794         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6795         value to ensure that _Bool promotes to int. Use #define for _Bool when
6796         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6797
6798 2003-08-10  Karl Berry  <karl@gnu.org>
6799
6800         * regex.h: update from libc (whitespace fix).
6801
6802 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6803
6804         Merge some files from coreutils.  These changes were
6805         originally made by Jim Meyering.
6806         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6807         many older Unixes require this.
6808         * alloca.c (alloca): Remove cast to argument of free;
6809         no longer needed in C89.
6810         * alloca_.h, regex.h: Fix white space to match
6811         what GNU indent does.
6812
6813 2003-08-05  Paul Eggert  <eggert@twinsun.com>
6814
6815         * bumpalloc.h: Remove.
6816
6817 2003-08-04  Paul Eggert  <eggert@twinsun.com>
6818
6819         * getloadavg.c: Change copyright notice and spacing to conform to
6820         GNU coding style.
6821
6822         Merge from coreutils.
6823         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6824         From glibc.
6825         * getdate.y (date): Also accept dates like May-23-2003; suggestion
6826         from Karl Berry, implemented by Jim Meyering.
6827         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6828         from Dmitry V. Levin.
6829         Remove anachronistic cast of xrealloc.
6830         * fnmatch_.h (__const): Remove.  Use 'const'.
6831         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6832         type. Otherwise, it wouldn't compile with at least /bin/cc on
6833         ymp-cray-unicos9.0.2.X.
6834         Combine two mostly-identical uses of alloca into one.
6835         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6836
6837 2003-08-04  Dave Love <d.love@dl.ac.uk>
6838
6839         [From Emacs.]
6840
6841         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
6842         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
6843         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6844         obsolete NLIST_NAME_UNION.
6845         [__GNU__]: Undef BSD and FSCALE.
6846         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6847
6848 2003-08-03  Paul Eggert  <eggert@twinsun.com>
6849
6850         * stdbool_.h (_Bool): Make it signed char, instead of
6851         an enum type, so that it's guaranteed to promote to int.  See:
6852         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6853
6854 2003-07-31  Paul Eggert  <eggert@twinsun.com>
6855
6856         * strerror.c: Include config.h, limits.h.  Declare sprintf.
6857         (strerror): Don't assume that a printable int fits in 14 bytes.
6858
6859 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
6860             Bruno Haible  <bruno@clisp.org>
6861
6862         * getline.h (getline, getdelim): Change return type to ssize_t.
6863         * getline.c (getline, getdelim): Likewise.
6864         Remove _GNU_SOURCE define; now it's defined in config.h through
6865         m4/getline.m4.
6866
6867 2003-07-22  Paul Eggert  <eggert@twinsun.com>
6868
6869         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6870         over-parenthesization in macros.
6871
6872         Sync with coreutils.
6873
6874         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6875         required by C99.
6876
6877         Use `exit_failure' for xalloc and xmemcoll instead of their own
6878         private exit-failure variables.
6879         * xalloc.h (xalloc_exit_failure): Remove.
6880         * xmalloc.c: Likewise.  Include exitfail.h.
6881         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6882         * xmemcoll.h (xmemcoll_exit_failure): Remove.
6883         * xmemcoll.c: Likewise.  Include exitfail.h.
6884         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6885
6886 2003-07-18  Paul Eggert  <eggert@twinsun.com>
6887
6888         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6889         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
6890         to test that it can stand by itself.  Include "exitfail.h".
6891         Clients should set exit_failure instead.
6892         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
6893
6894 2003-07-18  Andreas Schwab  <schwab@suse.de>
6895
6896         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6897
6898 2003-07-18  Bruno Haible  <bruno@clisp.org>
6899
6900         * getndelim2.h: New file.
6901         * getndelim2.c: Make into a module of its own. Include config.h,
6902         getndelim2.h.
6903         (getndelim2): Make non-static. Change return type to ssize_t.
6904         * getline.h: Change argument names.
6905         * getline.c: Include getndelim2.h instead of getndelim2.c.
6906         * getnline.c: Include getndelim2.h.
6907
6908 2003-07-17  Bruno Haible  <bruno@clisp.org>
6909
6910         * Makefile.am: Remove file.
6911         * Makefile.in: Remove file.
6912
6913 2003-07-17  Bruno Haible  <bruno@clisp.org>
6914
6915         * getnline.h: New file.
6916         * getnline.c: New file.
6917         * getndelim2.c: New file, extracted from getline.c.
6918         (getndelim2): Renamed from getdelim2, with added nmax argument.
6919         * getline.c: Include getndelim2.c.
6920         (getdelim2): Moved out to getndelim2.c.
6921         (getline, getdelim): Update.
6922
6923 2003-07-15    <karl@gnu.org>
6924
6925         * vasnprintf.c: update from gettext.
6926
6927 2003-07-15  Jim Meyering  <jim@meyering.net>
6928
6929         * makepath.c (make_path): Enclose diagnostic in _(...).
6930
6931 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6932
6933         * asnprintf.c, asprintf.c, config.charset, gettext.h,
6934         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6935         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6936         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6937         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
6938         updated automatically by ../config/srclist-update.  This changes
6939         their license from LPGL to GPL.
6940
6941 2003-07-14  Jim Meyering  <jim@meyering.net>
6942
6943         Don't emit diagnostics.  Let callers do that.
6944         * save-cwd.c: Don't include "error.h".
6945         (save_cwd): Don't call error.  Ensure that errno is valid
6946         when returning nonzero.
6947
6948         * save-cwd.h (restore_cwd): Update prototype.
6949         * save-cwd.c (restore_cwd): Remove two parameters.
6950         Simplify.  Don't call error upon failure.  Let callers do that.
6951         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6952         when auditing is enabled.  But don't bother updating the #if.
6953
6954 2003-07-14  Simon Josefsson  <jas@extundo.com>
6955
6956         * mempcpy.h: New file.
6957         * mempcpy.c: New file.
6958
6959 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6960
6961         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6962         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6963         unicodeio.c, unicodeio.h, unlocked-io.h:
6964         Switch from LGPL to GPL.
6965
6966 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
6967
6968         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6969         it breaks C++ compilation.
6970         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6971
6972 2003-07-10  Jim Meyering  <jim@meyering.net>
6973
6974         * vasnprintf.c: Remove trailing blanks.
6975         Make cpp indentation consistent.
6976
6977 2003-07-09  Paul Eggert  <eggert@twinsun.com>
6978
6979         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6980         posixver.c, strftime.c, strnlen.c, strverscmp.c:
6981         Switch from LGPL to GPL.
6982
6983 2003-07-07  Paul Eggert  <eggert@twinsun.com>
6984
6985         * mktime.c: Fix some boundary cases and remove need for floating point.
6986
6987         Issue a compile-time diagnostic if time_t is floating point, or if
6988         two's complement arithmetic is not in effect, or if arithmetic
6989         right shift does not propagate the sign.  These assumptions were
6990         all in the original code but they weren't checked.
6991
6992         (TIME_T_MIDPOINT, verify): New macros.
6993         (__isleap): Remove; it has integer overflow problems.
6994         (leapyear): New function, without those problems.
6995         (ydhms_tm_diff): Remove; splitting into two parts.
6996         (ydhms_diff): New function, containing the arithmetic part of
6997         the old ydhms_tm_diff function.  Issue a compile-time
6998         diagnostic if we are not using C99 integer division.
6999         Avoid casts when possible.
7000         (guess_time_tm): New function, containing the checking part of
7001         the old ydhms_tm_diff function.  Return the new value, rather than
7002         the difference between it and the old.  Accept a new argument T
7003         so that *T specifies the old value.  Check for overflow in the result.
7004
7005         (__mktime_internal): Use a time_t offset, not a long int offset.
7006         This undoes the 2003-06-04 change, which is no longer needed now
7007         that we have better overflow checking.
7008         (localtime_offset): Likewise.
7009
7010         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7011         and long are 64-bit but int is only 32-bit.
7012         (ydhms_diff): Use long int to store year1 and yday1.
7013         Issue a compile-time diagnostic if long int is not wide enough.
7014
7015         (__mktime_internal): Use long int to store adjusted year and yday.
7016         Use plain C rather than preprocessor commands, if that doesn't
7017         affect efficiency.
7018         Check for overflow (and try to repair) after each probe
7019         rather than checking only at the very end.  This avoids some bugs
7020         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7021         does not equal GMT offset at maximum time).
7022         Use integer to check for overflow rather than floating point; this
7023         is more portable to non-IEEE hosts, and is a tad faster.
7024         When we detect that we are oscillating between two values,
7025         don't check whether tm_isdst has the requested value, since
7026         we already know the answer.  When tm_isdst has the wrong value,
7027         use a different heuristic to find the right one, based on the
7028         extreme values actually observed in practice in tz2003a,
7029         rather than the (overly optimistic) "previous 3 calendar quarters".
7030
7031         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7032         "T const" to accommodate glibc style.
7033         (check_result): Use less-confusing report format.  "long" -> "long int.
7034         (main): Likewise.
7035         Don't loop if the iteration overflows time_t.
7036         Allow a negative step in the iteration.
7037
7038 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7039
7040         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7041         having it depend on HAVE_SYS_TYPES_H.
7042
7043 2003-06-25  Bruno Haible  <bruno@clisp.org>
7044
7045         * readlink.c: New file.
7046
7047 2003-06-20  Bruno Haible  <bruno@clisp.org>
7048
7049         Assume C89, so PARAMS isn't needed.
7050         * unicodeio.h (PARAMS): Remove.
7051         * unicodeio.c: Don't use PARAMS.
7052
7053 2003-06-18  Jim Meyering  <jim@meyering.net>
7054
7055         Merge changes from coreutils.
7056         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7057         Remove explicit declarations of xmalloc and realloc.
7058         Include xalloc.h.
7059         (read_utmp): Remove anachronistic cast of xmalloc.
7060
7061 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7062
7063         Assume C89, so PARAMS isn't needed.
7064         * backupfile.h (PARAMS): Remove.  All uses removed.
7065         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7066         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7067         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7068         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7069         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7070         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7071         xstrtol.h: Likewise.
7072         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7073         same.h, strverscmp.h: Do not include config.h; no longer needed.
7074         Anyway, config.h should always be included before any other file.
7075
7076 2003-06-11  Simon Josefsson  <jas@extundo.com>
7077
7078         * sysexit_.h: New file.
7079
7080 2003-05-20  Derek Price  <derek@ximbiot.com>
7081
7082         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7083
7084 2003-06-10  Simon Josefsson  <jas@extundo.com>
7085
7086         * strchrnul.h: New file.
7087         * strchrnul.c: New file.
7088
7089 2003-06-10  Simon Josefsson <jas@extundo.com>
7090
7091         * argp.h: New file, from glibc.
7092         * argp-ba.c: New file, from glibc.
7093         * argp-eexst.c: New file, from glibc.
7094         * argp-fmtstream.c: New file, from glibc.
7095         * argp-fmtstream.h: New file, from glibc.
7096         * argp-fs-xinl.c: New file, from glibc.
7097         * argp-help.c: New file, from glibc.
7098         * argp-namefrob.h: New file, from glibc.
7099         * argp-parse.c: New file, from glibc.
7100         * argp-pv.c: New file, from glibc.
7101         * argp-pvh.c: New file, from glibc.
7102         * argp-xinl.c: New file, from glibc.
7103
7104 2003-06-07  Jim Meyering  <jim@meyering.net>
7105
7106         * readtokens.h: Put `Free Software Foundation, Inc.'
7107         in place of my name in the copyright comment.
7108         Remove definition and uses of __P.
7109
7110         From coreutils.
7111         * stat.c: Don't declare xmalloc explicitly.
7112         Instead, include "xalloc.h".
7113         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7114         xrealloc, and xcalloc return values.
7115         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7116         Improve comment.
7117         * xgetcwd.h: Remove definition/uses of PARAMS.
7118
7119 2003-06-06  Jim Meyering  <jim@meyering.net>
7120
7121         * stdbool_.h: Renamed from stdbool.h.in.
7122
7123 2003-06-06  Jim Meyering  <jim@meyering.net>
7124
7125         Merge from coreutils.
7126         * same.c: (same_name): Declare *_basename locals to be `const'.
7127         Consolidate declarations and initializations of *_base* locals.
7128
7129         Merge from coreutils.
7130         This avoids a core dump on systems without GNU putenv,
7131         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7132         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7133         (unsetenv): New static function, from GNU libc.
7134         (rpl_putenv): Use it.
7135
7136         * modechange.c: Remove trailing blanks.
7137
7138         Merge from coreutils.
7139         * fsusage.c: Remove declaration of statfs.
7140         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7141
7142         * posixtm.c: Include <stdbool.h> unconditionally.
7143
7144 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7145
7146         * mktime.c (__mktime_internal): When resolving a tm_isdst
7147         mismatch, look in future quarters as well as past.  This fixes a
7148         bug when processing fall-backwards gaps immediately after a long
7149         period of daylight-saving time.
7150
7151         * mktime.c: Assume freestanding C89 or better.
7152         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7153         (__P): Remove; not used.
7154         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7155         (mktime, not_equal_tm, print_tm, check_result,
7156         main): Use prototypes.  Use const * where appropriate.
7157         (main): Fix typo in testing code that uncovered by above changes.
7158         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7159
7160 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7161
7162         * mktime.c: Fix Debian bug 177940
7163         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7164         (localtime_offset): Now long int, not time_t, because we want it
7165         to be guaranteed to be signed.  All uses changed.
7166         (__mktime_internal): If overflow would occur when adding offset,
7167         don't add it.
7168
7169         Merge 'human' changes from coreutils.  Rewrite to support
7170         locale-specific notations like thousands separators.
7171         * human.c: Simplify authorship notice.
7172         Include human.h immediately after config.h.
7173         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7174         <limits.h>: Do not include, since human.h does.
7175         (SIZE_MAX, UINTMAX_MAX): New macros.
7176         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7177         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7178         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7179         (power_letter): Renamed from suffixes.
7180         (generate_suffix_backwards): Remove.
7181         (adjust_value): Now takes int style (because of human.h changes)
7182         and long double value (for greater precision on some platforms).
7183         (group_number): New function.
7184         (human_readable): Use it.  Use integer options, not enum.
7185         Put the options before the sizes in the arg list.
7186         Support all the new options.
7187         The old human_readable function has been removed;
7188         use inttostr.h instead.
7189         (human_readable, default_block_size, humblock):
7190         Use uintmax_t, not int, for block sizes.
7191         (human_readable_inexact, block_size_types): Remove.
7192         (block_size_opts): New constant.
7193         (human_options): Renamed from human_block_size, with new signature
7194         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7195         * human.h: Add copyright and authorship notice.
7196         Include <limits.h> and <stdbool.h> unconditionally.
7197         (PARAMS): Remove.  All uses removed.
7198         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7199         (enum human_inexact_style): Remove tag; now a nameless enum.
7200         (human_floor, human_ceiling, human_round_to_even): Now have
7201         values 2, 0, 1 rather than -1, 1, 0.
7202         (human_group_digits, human_suppress_point_zero, human_autoscale,
7203         human_base_1024, human_SI, human_B): New constants.
7204         (human_readable_inexact, human_block_size): Remove.
7205         (human_readable): Size args are now uintmax_t, not int.
7206         (human_options): New decl.
7207
7208         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7209         unnecessary now that we assume C89 or better.  This change
7210         imported from coreutils.
7211
7212         * mktime.c (__mktime_internal): Do not reject negative timestamps
7213         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7214         in the 2003-05-30 sync from glibc.
7215
7216         .h files should stand alone, but we shouldn't include <sys/types.h>
7217         if we can get away with just <stddef.h>.
7218
7219         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7220         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7221         rather than <sys/types.h>, as we merely need size_t.
7222         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7223         to get size_t.
7224         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7225         Include <stdio.h>, to get FILE.
7226         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7227         memcasecmp.h has included <stddef.h> and all we need is size_t.
7228         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7229         our interface, instead of including <sys/types.h>
7230
7231 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7232
7233         [from coreutils]
7234         Fix some minor time-related bugs with POSIX time arguments.
7235         Some valid time stamps were being rejected (notably -1, and
7236         time stamps before 1900 on 64-bit hosts).  And some invalid
7237         time stamps were being accepted, e.g. September 31.
7238
7239         * posixtm.h (posixtime): Return bool instead of time_t, so
7240         that we can return (time_t) -1 successfully.
7241         * posixtm.c: Likewise.
7242         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7243         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7244         (t): Remove static var.
7245         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7246         of static var.  All uses changed.
7247         (year): Do not reject years before 1900; they can occur with
7248         64-bit time_t.
7249         (posix_time_parse): Do not check for out-of-range components;
7250         that is now the caller's responsibility, since our checks were
7251         only approximations.
7252         (posixtime): Use mktime to check for out-of-range components,
7253         since it knows them exactly.
7254         If mktime returns (time_t) -1, check whether an error actually occurred
7255         by invoking localtime on -1.
7256         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7257         posixtime failures better.
7258         Improve the test data (in comments only).
7259
7260 2003-05-30    <karl@gnu.org>
7261
7262         * mktime.c: update from libc.
7263
7264 2003-05-30  Bruno Haible  <bruno@clisp.org>
7265
7266         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7267         * localcharset.h: Likewise.
7268         * localcharset.c: Likewise.
7269
7270 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7271
7272         Assume the headers required for C89 freestanding compilers.
7273         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7274         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7275         without checking for HAVE_LIMITS_H.
7276         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7277         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7278         to do that.
7279         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7280         * exclude.c: Include <stdbool.h> unconditionally.
7281         * tempname.c: Include <stddef.h> unconditionally.
7282         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7283         * modechange.c, rpmatch.c (NULL): Don't define, since
7284         <stddef.h> does that.
7285         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7286         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7287         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7288         * xstrtol.c: Likewise.
7289         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7290         * savedir.c: Include <stddef.h> instead of defining NULL.
7291
7292         * addext.c (addext): Use assignment rather than cast, to avoid
7293         warnings on some platforms.
7294
7295         * mktime.c (__mktime_internal): Do not reject negative timestamps
7296         arbitrarily.
7297
7298 2003-05-10  Bruno Haible  <bruno@clisp.org>
7299
7300         * linebreak.c (iconv_string_length): Don't return -1 just because the
7301         string is longer than 4 KB.
7302
7303 2003-05-12  Jim Meyering  <jim@meyering.net>
7304
7305         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7306         the space-padded-by-default conversion specifiers, %e, %k, %l.
7307
7308 2003-05-03  Bruno Haible  <bruno@clisp.org>
7309
7310         Upgrade to Unicode-4.0.
7311         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7312         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7313         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7314         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7315         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7316         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7317         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7318         Change width of U+E0100..U+E01EF from 1 to 0.
7319
7320 2003-04-25  Bruno Haible  <bruno@clisp.org>
7321
7322         * copy-file.c: Include <stddef.h>, for size_t.
7323
7324 2003-04-25  Jim Meyering  <jim@meyering.net>
7325
7326         * copy-file.c (copy_file_preserving): Declare buf_size to be
7327         of type size_t, not int.
7328
7329 2003-04-11  Jim Meyering  <jim@meyering.net>
7330
7331         Merge changes from Coreutils.
7332
7333         2003-03-22  Jim Meyering  <jim@meyering.net>
7334
7335         * strftime.c (widen): Cast alloca return value to proper type.
7336
7337         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7338
7339         From GNU libc.
7340         * strftime.c (my_strftime): Handle very large width
7341         specifications for numeric values correctly.  Improve checks for
7342         overflow.
7343
7344         2003-01-19  Jim Meyering  <jim@meyering.net>
7345
7346         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7347         (nl_get_alt_digit) [! defined my_strftime]: Define.
7348         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7349         _nl_get_alt_digit and _nl_get_walt_digit.
7350
7351         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7352         These changes have no effect outside of _LIBC.
7353
7354 2003-04-10  Bruno Haible  <bruno@clisp.org>
7355
7356         * findprog.h: New file, from GNU gettext.
7357         * findprog.c: New file, from GNU gettext.
7358
7359 2003-04-05  Jim Meyering  <jim@meyering.net>
7360
7361         Merge changes from Coreutils.
7362
7363         * exclude.h (PARAMS): Remove definition and uses.
7364         * exclude.c: Remove uses of `PARAMS'.
7365
7366         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7367         Add test-cases for DOS filenames. Declare program_name.
7368         (main): Set up program_name.  Patch by Rich Dawe.
7369
7370         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7371         error from mntctl.
7372         Use mntctl's return value to drive the entry-processing loop, since
7373         we can't rely on the value of the vmt_length member in the last
7374         entry.  On some systems doing so could result in exhausting
7375         virtual memory.  Based in part on a patch from Mike Jetzer.
7376
7377 2003-04-04  Bruno Haible  <bruno@clisp.org>
7378
7379         * linebreak.h: New file, from GNU gettext.
7380         * linebreak.c: New file, from GNU gettext with slight modifications.
7381         * lbrkprop.h: New file, from GNU gettext.
7382
7383 2003-04-03  Bruno Haible  <bruno@clisp.org>
7384
7385         * utf8-ucs4.h: New file, from GNU gettext.
7386         * utf16-ucs4.h: New file, from GNU gettext.
7387         * ucs4-utf8.h: New file, from GNU gettext.
7388         * ucs4-utf16.h: New file, from GNU gettext.
7389
7390 2003-04-02  Bruno Haible  <bruno@clisp.org>
7391
7392         * binary-io.h: New file, from GNU gettext.
7393
7394 2003-04-01  Bruno Haible  <bruno@clisp.org>
7395
7396         * pathname.h: New file, from GNU gettext.
7397         * concatpath.c: New file, from GNU gettext.
7398
7399 2003-03-30  Bruno Haible  <bruno@clisp.org>
7400
7401         * copy-file.c (copy_file_preserving): Don't set owner if the function
7402         chown() doesn't exist.
7403
7404 2003-03-28  Bruno Haible  <bruno@clisp.org>
7405
7406         * copy-file.h: New file, from GNU gettext.
7407         * copy-file.c: New file, from GNU gettext.
7408
7409 2003-03-18  Jim Meyering  <jim@meyering.net>
7410
7411         * quote.c (quote_n): Fix typo in comment.
7412
7413 2003-03-14  Jim Meyering  <jim@meyering.net>
7414
7415         Merge changes from Coreutils.
7416         * obstack.h (obstack_object_size): Declare temporary, __o,
7417         to be const, in order to avoid warnings.
7418         (obstack_room): Likewise.
7419         (obstack_empty_p): Likewise.
7420
7421 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7422
7423         Merge changes from Bison.
7424         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7425         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7426         when compiling Bison 1.875's `bitset bset = obstack_alloc
7427         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7428         * hash.c: Include <stdbool.h> unconditionally.
7429
7430 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7431
7432         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7433         Reported by Bruce Becker; see:
7434         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7435
7436 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7437             Bruno Haible  <bruno@clisp.org>
7438
7439         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7440         Reported by John Hughes, see
7441         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7442
7443 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7444
7445         * poll_.h: New file.
7446         * poll.c: New file.
7447
7448 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7449
7450         * mathl.h: New file.
7451         * acosl.c: New file.
7452         * asinl.c: New file.
7453         * atanl.c: New file.
7454         * ceill.c: New file.
7455         * cosl.c: New file.
7456         * expl.c: New file.
7457         * floorl.c: New file.
7458         * frexpl.c: New file.
7459         * ldexpl.c: New file.
7460         * logl.c: New file.
7461         * sincosl.c: New file.
7462         * sinl.c: New file.
7463         * sqrtl.c: New file.
7464         * tanl.c: New file.
7465         * trigl.c: New file.
7466         * trigl.h: New file.
7467
7468 2003-02-17  Bruno Haible  <bruno@clisp.org>
7469
7470         * mkdtemp.h: New file, from GNU gettext.
7471         * mkdtemp.c: New file, from GNU gettext.
7472
7473 2003-01-31  Bruno Haible  <bruno@clisp.org>
7474
7475         * rename.c: #undef rename before defining rpl_rename.
7476         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7477
7478 2003-01-30  Bruno Haible  <bruno@clisp.org>
7479
7480         * printf-args.h: New file, from GNU gettext.
7481         * printf-args.c: New file, from GNU gettext.
7482         * printf-parse.h: New file, from GNU gettext.
7483         * printf-parse.c: New file, from GNU gettext.
7484         * vasnprintf.h: New file, from GNU gettext.
7485         * vasnprintf.c: New file, from GNU gettext.
7486         * asnprintf.c: New file, from GNU gettext.
7487         * vasprintf.h: New file, from GNU gettext with modifications.
7488         * vasprintf.c: New file, from GNU gettext.
7489         * asprintf.c: New file, from GNU gettext.
7490
7491 2003-01-29  Bruno Haible  <bruno@clisp.org>
7492
7493         * stpncpy.h: New file, from GNU gettext with modifications.
7494         * stpncpy.c: New file, from GNU gettext with modifications.
7495
7496 2003-01-28  Bruno Haible  <bruno@clisp.org>
7497
7498         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7499         Paul Eggert.
7500         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7501         Paul Eggert.
7502
7503 2003-01-27  Bruno Haible  <bruno@clisp.org>
7504
7505         * xsetenv.h: New file, from GNU gettext.
7506         * xsetenv.c: New file, from GNU gettext.
7507
7508 2003-01-23  Bruno Haible  <bruno@clisp.org>
7509
7510         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7511
7512 2003-01-22  Bruno Haible  <bruno@clisp.org>
7513
7514         * exit.h: New file, from GNU gettext.
7515
7516 2003-01-11  Bruno Haible  <bruno@clisp.org>
7517
7518         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7519         * strcase.h (strcasecmp, strncasecmp): Likewise.
7520
7521 2003-01-14  Jim Meyering  <jim@meyering.net>
7522
7523         * same.c (same_name): Tweak a comment.
7524
7525 2003-01-11  Bruno Haible  <bruno@clisp.org>
7526
7527         * same.c (same_name): Reorder tests so as to avoid calling stat()
7528         when a string comparison is sufficient.
7529
7530 2003-01-11  Bruno Haible  <bruno@clisp.org>
7531
7532         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7533         'unsigned int'.
7534
7535 2003-01-11  Bruno Haible  <bruno@clisp.org>
7536
7537         * hash-pjw.c: Add comment about low quality of this function.
7538
7539 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7540
7541         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7542         to avoid collisions with libcurses and libreadline.
7543
7544         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7545         * getstr.h, getstr.c: Remove.
7546         * getline.c: Include "getline.h", to check interface.
7547         Move body of old getstr.c here: this defines MIN_CHUNK and
7548         declares getdelim2, which is renamed from getstr.
7549         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7550
7551         * linebuffer.c (readlinebuffer): Renamed from readline.
7552         All uses changed.
7553         * linebuffer.h: Likewise.
7554         (readline): Remove backward-compatibility macro.
7555
7556 2003-01-12  Jim Meyering  <jim@meyering.net>
7557
7558         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7559
7560 2003-01-10  Bruno Haible  <bruno@clisp.org>
7561
7562         * alloca_.h: New file.
7563         * getdate.y: Unconditionally include alloca.h.
7564         * makepath.c: Likewise.
7565         * setenv.c: Likewise.
7566         * userspec.c: Likewise.
7567
7568 2003-01-09  Bruno Haible  <bruno@clisp.org>
7569
7570         * stdbool.h.in: New file.
7571
7572 2003-01-08  Bruno Haible  <bruno@clisp.org>
7573
7574         * safe-read.c: Include specification header first, to ensure its
7575         selfcontainedness.
7576         * full-write.c: Likewise.
7577
7578 2003-01-08  Jim Meyering  <jim@meyering.net>
7579
7580         * full-write.c: Undefine and define-away `const' after inclusion
7581         of errno.h, not before.  Suggestion from Bruno Haible.
7582
7583 2003-01-07  Jim Meyering  <jim@meyering.net>
7584
7585         * full-write.c: Rework so that it may serve to define full_read, too.
7586         * full-read.c: Simply #define FULL_READ and include full-write.c.
7587
7588 2003-01-06  Jim Meyering  <jim@meyering.net>
7589
7590         * version-etc.c: Update year in translatable copyright string.
7591
7592 2002-12-25  Bruno Haible  <bruno@clisp.org>
7593
7594         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7595         * xstrtol.h: Likewise.
7596         * xstrtoimax.c: Likewise.
7597         * xstrtoumax.c: Likewise.
7598         * human.h: Likewise.
7599
7600         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7601         on systems that have <inttypes.h> but not <stdint.h>.
7602
7603 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7604
7605         * memcoll.c (memcoll): Fall back on a simple algorithm using
7606         memcmp if strcoll doesn't work.
7607
7608 2002-12-23  Bruno Haible  <bruno@clisp.org>
7609
7610         * localcharset.h: New file.
7611         * localcharset.c: Include it.
7612         * unicodeio.c: Likewise.
7613
7614 2002-12-22  Bruno Haible  <bruno@clisp.org>
7615
7616         * utime.c (utime_null): No need to call ftruncate if the file was
7617         nonempty.
7618
7619 2002-12-23  Bruno Haible  <bruno@clisp.org>
7620
7621         * memcoll.c (STRCOLL): New macro.
7622         (memcoll): Use it.
7623
7624 2002-12-22  Bruno Haible  <bruno@clisp.org>
7625
7626         * getstr.h (getstr): Define, to avoid clash with libcurses.
7627         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7628
7629 2002-12-22  Bruno Haible  <bruno@clisp.org>
7630
7631         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7632
7633 2002-12-23  Bruno Haible  <bruno@clisp.org>
7634
7635         * getline.h: Include <stddef.h>, for size_t.
7636
7637         * unicodeio.h: Include <stddef.h>, for size_t.
7638         * unicodeio.c: Don't include <stddef.h>.
7639
7640 2002-12-17  Bruno Haible  <bruno@clisp.org>
7641
7642         * canon-host.c (strdup): Remove unused declaration.
7643
7644         * fsusage.c: Include full_read.h.
7645         (get_fs_usage): Use full_read instead of safe_read.
7646
7647         * utime.c (utime_null): Use SAFE_READ_ERROR.
7648
7649 2002-12-11  Bruno Haible  <bruno@clisp.org>
7650
7651         * setenv.h: Rewritten to cope with systems that have setenv() but not
7652         unsetenv().
7653         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7654         modifications:
7655
7656         2002-12-11  Bruno Haible  <bruno@clisp.org>
7657
7658                 * setenv.c (alloca): Fall back to malloc.
7659                 (freea): New macro.
7660                 (setenv): Use freea() to free memory allocated with alloca().
7661
7662         2002-11-13  Bruno Haible  <bruno@clisp.org>
7663
7664                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7665                 function declarations.
7666                 * unsetenv.c (unsetenv): Likewise.
7667
7668         2002-03-04  Bruno Haible  <bruno@clisp.org>
7669
7670                 Portability to AIX 4.3.3.
7671                 * unsetenv.c: New file, extracted from setenv.c.
7672                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7673
7674         2001-12-20  Bruno Haible  <bruno@clisp.org>
7675
7676                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7677                 use malloc instead. For SunOS 4.
7678
7679         2001-12-11  Bruno Haible  <bruno@clisp.org>
7680
7681                 * setenv.c: Declare alloca.
7682                 (compar_fn_t): New typedef.
7683                 (KNOWN_VALUE, STORE_VALUE): Use it.
7684
7685         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7686         setenv.h.
7687
7688 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7689
7690         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7691         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7692         Choose values that are less likely to collide with system fnmatch
7693         options.
7694         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7695         defined (e.g., a pure POSIX system).
7696         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7697         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7698
7699 2002-12-06  Jim Meyering  <jim@meyering.net>
7700
7701         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7702
7703         Merge in changes from libc's misc/error.c, in preparation
7704         for the merge of gnulib's changes back into libc.
7705
7706         * error.c (_): Define only if not already defined.
7707         Move definition to follow all #include directives.
7708         Include unlocked-io.h only if !_LIBC.
7709         [_LIBC]: Include <libio/libioP.h>.
7710         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7711         (fflush): Tweak definition to use INTUSE.
7712         (putc): Define.
7713
7714 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7715
7716         * alloca.c [defined emacs]: Include "lisp.h".
7717         (xalloc_die) [defined emacs]: New macro.
7718         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7719         [! defined emacs]: Include <xalloc.h>.
7720         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7721         (pointer): Typedef to POINTER_TYPE *.
7722         (malloc): Remove decl; we now always use xmalloc.
7723         (alloca): Use old-style definition, since Emacs needs this.
7724         Check for arithmetic overflow when computing combined size.
7725
7726 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7727
7728         Do not generate unlocked-io.h automatically, since it's easier to
7729         maintain it by hand.
7730
7731         * unlocked-io.h: New file, from GNU diffutils,
7732         but with proper copyright notice and attribution.
7733         * gen-uio: Remove.
7734         * Makefile.am: Add copyright notice.
7735         (libfetish_a_SOURCES): Add unlocked-io.h.
7736         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7737         (DISTCLEANFILES, io_functions): Remove macros.
7738         (EXTRA_DIST): Remove gen_uio.
7739         (unlocked-io.h): Remove rule.
7740
7741 2002-12-04  Jim Meyering  <jim@meyering.net>
7742
7743         Reflect the fact that stat.c and lstat.c are no longer generated.
7744         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7745         (DISTCLEANFILES): Likewise.
7746         (EXTRA_DIST): Likewise.
7747         (all_local): Don't depend on stat.c or lstat.c.
7748         (stat.c, lstat.c): Remove rules.
7749         (EXTRA_DIST): Remove xstat.in.
7750
7751         * xstat.in: Remove file.  Contents moved into stat.c.
7752         * stat.c: New file.  Contents mostly from xstat.in.
7753         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7754         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7755
7756         * safe-read.c: Rework so that it may serve to define safe_write, too.
7757         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7758
7759 2002-12-03  Jim Meyering  <jim@meyering.net>
7760
7761         * safe-read.c, safe-write.c: Change variable names and comments, but
7762         not semantics, to minimize the differences between these two files.
7763         (safe_read): Change comment to mention SAFE_READ_ERROR.
7764
7765         * safe-read.c (IS_EINTR): Define.
7766         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7767
7768 2002-12-02  Bruno Haible  <bruno@clisp.org>
7769
7770         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7771         Define, taken from safe-read.c.
7772         (INT_MAX): Provide fallback.
7773         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7774         * safe-write.h (SAFE_WRITE_ERROR): Define.
7775
7776         * safe-read.c (EINTR): Remove definition.
7777         (safe_read): Don't use EINTR if it is absent.
7778
7779 2002-12-02  Jim Meyering  <jim@meyering.net>
7780
7781         * safe-read.c (EINTR): Define.
7782         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7783         (INT_MAX): Provide fallback.
7784         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7785
7786         * safe-read.h (SAFE_READ_ERROR): Define.
7787
7788 2002-12-01  Jim Meyering  <jim@meyering.net>
7789
7790         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7791         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7792
7793 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7794
7795         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7796         hash_rehash): Replace `if (limit <= value) abort ();' with
7797         `if (! (value < limit)) abort ();', for readability.
7798
7799 2002-11-26    <karl@gnu.org>
7800
7801         * strdup.c: copy from libc again, with jim's ok.
7802         * .cppi-disable: re-add strdup.c
7803
7804 2002-11-25    <karl@gnu.org>
7805
7806         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7807         instead of "strtol.c".
7808
7809 2002-11-25  Jim Meyering  <jim@meyering.net>
7810
7811         * mktime.c: Sync from libc, now that it has the latest fix.
7812
7813 2002-11-24    <karl@gnu.org>
7814
7815         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7816         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7817
7818 2002-11-24  Jim Meyering  <jim@meyering.net>
7819
7820         Update from coreutils:
7821
7822         * mktime.c: Merge in changes from libc.
7823
7824         Avoid a link-time failure on some Linux systems.
7825         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7826         (__mon_yday): Declare with the STATIC attribute.
7827         (__mktime_internal): Likewise.
7828         Based on a report from Greg Schafer.
7829
7830 2002-11-23  Jim Meyering  <jim@meyering.net>
7831
7832         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7833         Use `unsigned', not `int', as type of index.
7834
7835         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7836
7837         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7838
7839 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7840
7841         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7842         hint that one should use `if (! x) abort ();' rather than `assert
7843         (x);', and anyway it's one less thing to worry about configuring.
7844         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7845         hash_rehash, hash_insert): Use abort rather than assert.
7846
7847 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7848
7849         * quotearg.h: Allow multiple inclusion by surrounding with
7850         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
7851         so that we can be included first.
7852         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
7853         * quotearg.c: Include quotearg.h immediately after config.h.
7854         No need to include stddef.h or sys/types.h any more.
7855         Surround local include files with "", not "<>".
7856         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7857         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7858         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7859         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7860         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7861         (ISPRINT): Remove; no longer needed now that we assume C89.
7862
7863         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7864         Preserve errno.
7865
7866         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7867         quotearg_char): Use SIZE_MAX rather than
7868         (size_t) -1 when we are talking about "infinity".
7869
7870         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7871
7872 2002-11-22  Bruno Haible  <bruno@clisp.org>
7873
7874         * safe-read.h: Assume C89. Add comments.
7875         (safe_read): Change return type to size_t.
7876         * safe-read.c (safe_read): Change return type to size_t. Handle byte
7877         counts > SSIZE_MAX correctly.
7878         * safe-write.h: New file.
7879         * safe-write.c: New file.
7880         * full-read.h: New file.
7881         * full-read.c: New file.
7882         * full-write.h: Assume C89. Add comments.
7883         * full-write.c: Include safe-write.h.
7884         (full_write): Rewritten to use safe_write.
7885         Suggested by Jim Meyering and Paul Eggert.
7886
7887 2002-11-21  Bruno Haible  <bruno@clisp.org>
7888
7889         Remove case insensitive option matching.
7890         * argmatch.h (argcasematch): Remove declaration.
7891         (ARGCASEMATCH): Remove macro.
7892         (__xargmatch_internal): Remove case_sensitive argument.
7893         (XARGMATCH): Update.
7894         (XARGCASEMATCH): Remove macro.
7895         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7896         case_sensitive argument.
7897         (argcasematch): Remove function.
7898         (__xargmatch_internal): Remove case_sensitive argument.
7899         (main): Use XARGMATCH instead of XARGCASEMATCH.
7900
7901         * xmalloc.c: Change compile-time error message. Add comment about
7902         required autoconf version.
7903
7904 2002-11-21  Jim Meyering  <jim@meyering.net>
7905
7906         * strdup.c (strdup): Tweak comment and initial #if/#include.
7907
7908         Merge in changes from the coreutils.
7909
7910         2002-09-25  Paul Eggert  <eggert@twinsun.com>
7911         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7912         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7913         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7914         int.  Work more efficiently if X is the same width as uintmax_t.
7915         Do not compare X to -1, to avoid bogus compiler warning.
7916         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7917         Don't assume that f_frsize and f_bsize are the same type.
7918
7919         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7920         on FreeBSD.
7921
7922         * makepath.c (make_path): Restore umask *before* creating the final
7923         component.
7924         (make_path): Minor reformatting.
7925
7926         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7927         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7928
7929         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7930         ones.  At least on GNU/Linux systems, `auto' means something else.
7931         From Michael Stone.
7932
7933 2002-11-20  Paul Eggert  <eggert@twinsun.com>
7934
7935         Merge argmatch cleanups from Bison.  Assume C89.
7936
7937         * argmatch.c: Include config.h here, not in argmatch.h.
7938         Include stdlib.h, for EXIT_FAILURE.
7939         Always include <string.h>, since we assume C89.
7940         (EXIT_FAILURE): Remove pre-C89 bug workaround.
7941         * argmatch.h: Do not include <config.h> or <sys/types.h>.
7942         Include <stddef.h> instead, since it's all we need for size_t.
7943         (PARAMS): Remove.  All uses removed.
7944         (ARRAY_CARDINALITY): Do not bother to #undef.
7945         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7946         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7947         Remove unnecessary parentheses.
7948         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7949         Insert necessary parentheses.
7950         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7951         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7952
7953 2002-11-19  Bruno Haible  <bruno@clisp.org>
7954
7955         * mbswidth.c: Include mbswidth.h right at the beginning.
7956         * mbswidth.h: Include <stddef.h>, for size_t.
7957
7958         * mbswidth.h (PARAMS): Remove macro.
7959         (mbswidth, mbsnwidth): Use ANSI C function declarations.
7960         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7961
7962         * gcd.h (PARAMS): Remove macro.
7963         (gcd): Use ANSI C function declarations.
7964         * gcd.c (gcd): Likewise.
7965
7966 2002-11-15  Bruno Haible  <bruno@clisp.org>
7967
7968         * strcspn.c: Include <stddef.h>.
7969         (strcspn): Use ANSI C function declaration. Change return type to
7970         size_t. Use NULL.
7971         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7972         (strpbrk): Use NULL.
7973         * strpbrk.h (PARAMS): Remove macro.
7974         (strpbrk): Use ANSI C function declaration.
7975         * strstr.c: Don't include <sys/types.h>.
7976         * strstr.h (PARAMS): Remove macro.
7977         (strstr): Use ANSI C function declarations.
7978
7979 2002-11-06  Bruno Haible  <bruno@clisp.org>
7980
7981         * gcd.h (gcd): Change argument type to 'unsigned long'.
7982         * gcd.c (gcd): Likewise.
7983
7984 2002-11-05  Bruno Haible  <bruno@clisp.org>
7985
7986         * gcd.h: New file, from gettext-0.11.5.
7987         * gcd.c: New file, from gettext-0.11.5.
7988
7989 2002-11-05  Bruno Haible  <bruno@clisp.org>
7990
7991         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7992         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7993         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7994         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7995
7996         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7997         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7998
7999         * closeout.c: Include gettext.h instead of <libintl.h>.
8000         * human.c: Include gettext.h instead of <libintl.h>.
8001         * quotearg.c: Include gettext.h instead of <libintl.h>.
8002         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8003         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8004         * userspec.c: Include gettext.h instead of <libintl.h>.
8005         * version-etc.c: Include gettext.h instead of <libintl.h>.
8006         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8007         (textdomain): Remove definition.
8008         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8009
8010         * long-options.c: Remove include of <libintl.h> and definition of _.
8011         * same.c: Remove include of <libintl.h> and definition of _.
8012
8013 2002-11-04  Bruno Haible  <bruno@clisp.org>
8014
8015         * stpcpy.h: New file, from GNU gettext-0.11.5.
8016         * strcase.h: New file, from GNU gettext-0.11.5.
8017         * strpbrk.h: New file, from GNU gettext-0.11.5.
8018         * strstr.h: New file, from GNU gettext-0.11.5.
8019         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8020
8021 2002-05-09  Bruno Haible  <bruno@clisp.org>
8022
8023         * config.charset: Update for newest glibc. Add canonical names
8024         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8025
8026 2002-05-09  Bruno Haible  <bruno@clisp.org>
8027
8028         * localcharset.c (get_charset_aliases): Add more Windows specific
8029         aliases.
8030
8031 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8032
8033         * config.charset: A few additions for Solaris.
8034
8035 2001-12-05  Bruno Haible  <bruno@clisp.org>
8036
8037         * localcharset.c (locale_charset): Don't return an empty string.
8038
8039 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8040
8041         * config.charset: msdos in uk_UA uses CP1125.
8042
8043 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8044
8045         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8046         * localcharset.c (locale_charset): Declare as extern "C".
8047
8048 2002-02-15  Bruno Haible  <bruno@clisp.org>
8049
8050         * config.charset [msdosdjgpp]: For Russian, use CP866.
8051
8052 2002-02-11  Bruno Haible  <bruno@clisp.org>
8053
8054         * config.charset: Add support for NetBSD.
8055
8056 2002-09-25    <karl@gnu.org>
8057
8058         * strdup.c: copy from libc/string (via ../config/srclist*).
8059         * getopt*: copy from libc/posix.
8060         * gettext.h: copy from gettext.
8061         * .cppi-disable: add strdup.c, gettext.h.
8062
8063 2002-07-01  Jim Meyering  <meyering@lucent.com>
8064
8065         * c-stack.c: Include sys/time.h.
8066         From Volker Borchert.
8067
8068 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8069
8070         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8071         New macro.  Use it uniformly instead of
8072         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8073         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8074         reported by Vin Shelton.
8075
8076 2002-06-22  Jim Meyering  <meyering@lucent.com>
8077
8078         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8079         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8080
8081 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8082
8083         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8084         Do not assume SA_SIGINFO behavior.
8085         Bug reported by Jim Meyering on NetBSD 1.5.2.
8086
8087 2002-06-22  Jim Meyering  <meyering@lucent.com>
8088
8089         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8090
8091         * exitfail.c, exitfail.h: Likewise.
8092         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8093
8094         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8095         of fnmatch.h.
8096         (EXTRA_DIST): Add fnmatch_loop.c.
8097         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8098
8099         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8100         * fnmatch.c: Update from diffutils-2.8.2.
8101         * fnmatch_.h: New file.  From diffutils-2.8.2.
8102         * fnmatch.h: Remove file.
8103
8104 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8105
8106         * file-type.h: Report an error if neither S_ISREG nor
8107         S_IFREG is defined, instead of using a test specific to glibc
8108         2.2.  This should be safe, since POSIX requires S_ISREG and
8109         Unix Version 7 had S_IFREG.  We don't need to check for
8110         <sys/types.h> since we don't use any symbols that it defines.
8111
8112 2002-06-15  Jim Meyering  <meyering@lucent.com>
8113
8114         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8115         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8116         have been included before this file.
8117
8118 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8119
8120         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8121         so that each temporary file name is unique and valid in the first
8122         8 characters, for operation under DOS.
8123
8124 2002-06-15  Jim Meyering  <meyering@lucent.com>
8125
8126         Work even with DJGPP 2.03, which lacks support for symlinks.
8127         From Richard Dawe.
8128         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8129         is defined.
8130         * lchown.c (S_ISLNK): Likewise.
8131
8132 2002-06-14  Jim Meyering  <meyering@lucent.com>
8133
8134         * file-type.h: Use the version from diffutils-2.8.2.
8135         * file-type.c: Likewise.
8136
8137 2002-05-27  Jim Meyering  <meyering@lucent.com>
8138
8139         Fix a problem seen only on nonconforming systems whereby ls.c's
8140         use of localtime, and then of gettimeofday would cause trouble:
8141         the localtime call used to initialize rpl_gettimeofday's save
8142         mechanism would clobber ls's current local time information so
8143         that in any long listing the first file would always be listed
8144         with date 1970-01-01.  Analysis by Volker Borchert.
8145
8146         * gettimeofday.c (localtime): Undefine.
8147         (rpl_localtime): New function.
8148
8149 2002-05-22  Jim Meyering  <meyering@lucent.com>
8150
8151         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8152         * file-type.h: New file.
8153         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8154
8155 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8156
8157         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8158
8159 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8160
8161         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8162         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8163         of 127, since 64 is the largest conceivable number for ancient
8164         nonstandard hosts.
8165         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8166
8167 2002-04-28  Jim Meyering  <meyering@lucent.com>
8168
8169         * sig2str.c (WTERMSIG): Remove definition (unused).
8170
8171 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8172
8173         * sig2str.h, sig2str.c: New files.
8174         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8175
8176 2002-04-24  Jim Meyering  <meyering@lucent.com>
8177
8178         * gettext.h: New file, from Gettext.
8179         * Makefile.am (INCLUDES): Remove -I../intl.
8180         (libfetish_a_SOURCES): Add gettext.h.
8181
8182 2002-04-16  Jim Meyering  <meyering@lucent.com>
8183
8184         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8185         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8186         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8187
8188 2002-04-12  Jim Meyering  <meyering@lucent.com>
8189
8190         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8191
8192 2002-03-10  Jim Meyering  <meyering@lucent.com>
8193
8194         * makepath.c (make_path): Remove a comma from a diagnostic.
8195         Suggestion from Santiago Vila.
8196
8197 2002-03-08  Jim Meyering  <meyering@lucent.com>
8198
8199         * rename.c: Mention that this wrapper is needed also on
8200         mips-dec-ultrix4.4 systems.
8201
8202 2002-03-02  Jim Meyering  <meyering@lucent.com>
8203
8204         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8205         not HAVE_CLOCK_SETTIME.
8206
8207 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8208
8209         * nanosleep.h: Rename to....
8210         * timespec.h: New name for nanosleep.h.  All uses changed.
8211
8212         * gettime.c: New file.
8213         * settime.c: New file.
8214         * stime.c: Remove.
8215
8216         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8217         timespec.h.  Remove nanosleep.h.
8218
8219 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8220
8221         * acl.c, acl.h: New files.
8222         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8223
8224 2002-02-24  Jim Meyering  <meyering@lucent.com>
8225
8226         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8227         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8228         cause trouble.  Reported by Nelson Beebe.
8229
8230 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8231
8232         * path-concat.c (xpath_concat): Reorder code to pacify
8233         compilers that don't know that xalloc_die never returns.
8234
8235 2002-02-20  Jim Meyering  <meyering@lucent.com>
8236
8237         * getdate.c: Regenerate using bison-1.33.
8238
8239 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8240
8241         * posixver.c, posixver.h: New files.
8242         * Makefile.am (libfetish_a_SOURCES): Add them.
8243
8244 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8245             Bruno Haible  <bruno@clisp.org>
8246
8247         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8248         (fwrite_success_callback): New declaration.
8249         * unicodeio.c (unicode_to_mb): New function, extracted from
8250         print_unicode_char. Call failure callback instead of error.
8251         (fwrite_success_callback): New function.
8252         (exit_failure_callback): New function.
8253         (fallback_failure_callback): New function.
8254         (print_unicode_char): Call unicode_to_mb.
8255
8256 2002-01-26  Jim Meyering  <meyering@lucent.com>
8257
8258         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8259
8260 2002-01-22  Jim Meyering  <meyering@lucent.com>
8261
8262         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8263         Otherwise, some versions of automake would omit the rule that makes
8264         Makefile from Makefile.in.
8265
8266 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8267
8268         * xmemcoll.h, xmemcoll.c: New files.
8269         * Makefile.am (libfetish_a_SOURCES): Add them.
8270         * memcoll.c: Include errno.h, and declare errno if not defined.
8271         (memcoll): Set errno to zero if there is no error.
8272
8273         * quotearg.c (quotearg_buffer_restyled):
8274         Fix bug with quoting buffers containing NUL when backslashing escapes.
8275         This bug was exposed by the other changes in this patch.
8276         (quotearg_n_options): New arg ARGSIZE.
8277         All callers changed.
8278         (quoting_options_from_style): New function.
8279         (quotearg_n_style): Use it.
8280         (quotearg_n_style_mem): New function.
8281
8282         * quotearg.h (quotearg_n_style_mem): New function.
8283
8284 2002-01-16  Jim Meyering  <meyering@lucent.com>
8285
8286         * getdate.y: Add three semicolons, each just before a closing brace.
8287         Bison (as of version 1.31) no longer papers over that mistake.
8288
8289 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8290
8291         * backupfile.c (ISDIGIT): Comment fix.
8292         * getdate.y (ISDIGIT): Likewise.
8293         * posixtm.c (ISDIGIT, year): Likewise.
8294         * strverscmp.c (ISDIGIT): Likewise.
8295         * userspec.c (ISDIGIT): Likewise.
8296
8297 2002-01-05  Jim Meyering  <meyering@lucent.com>
8298
8299         * version-etc.c (version_etc_copyright): Update copyright year.
8300
8301 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8302
8303         * closeout.c (close_stdout_status): If ferror (stdout), do
8304         not silently exit merely because the output buffer happens to
8305         have nothing pending.
8306
8307 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8308
8309         See the big note in ../ChangeLog.
8310         * human.c (suffixes): Prefer K to k for 1024.
8311         (generate_suffix_backwards): New function.
8312         (human_readable_inexact): Use it.
8313         * xstrtol.c (__xstrtol): If there is no number but there
8314         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8315         Accept 'K' as well as 'k'.
8316
8317 2001-12-15  Jim Meyering  <meyering@lucent.com>
8318
8319         * regex.h (__restrict_arr): Update from libc.
8320
8321         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8322         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8323         (STREQ): Define.
8324
8325 2001-12-10  Jim Meyering  <meyering@lucent.com>
8326
8327         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8328         Instead, include "xalloc.h".
8329         (initbuffer): Don't cast xmalloc return value to char*.
8330         (readline): Reword comment.
8331         Don't cast xrealloc return value to char*
8332         Return NULL, not 0.
8333
8334 2001-12-09  Jim Meyering  <meyering@lucent.com>
8335
8336         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8337         `signed and unsigned type in conditional expression'.
8338         * posixtm.c (posix_time_parse): Likewise.
8339
8340         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8341
8342         * readtokens.c (readtoken): Declare an index to be of type unsigned
8343         to avoid a pedantic warning.
8344
8345         * getstr.c: Don't include assert.h.
8346         (getstr): Remove warning-evoking assertions.
8347         Return -1 if offset parameter is out of bounds.
8348         Change the type of a local from int to size_t.
8349
8350         * strftime.c (my_strftime_localtime_r): Include this function
8351         definition in the `#if ! HAVE_TM_GMTOFF' block.
8352
8353         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8354         Include xalloc.h instead.
8355
8356 2001-12-02  Jim Meyering  <meyering@lucent.com>
8357
8358         * tempname.c: Don't declare getenv, thus reverting the change of
8359         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8360         included.
8361
8362         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8363         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8364
8365 2001-11-30  Akim Demaille  <akim@epita.fr>
8366
8367         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8368         before being defined.
8369
8370 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8371
8372         * quotearg.h (quotearg_n, quotearg_n_style):
8373         First arg is int, not unsigned.
8374         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8375         (SIZE_MAX, UINT_MAX): New macros.
8376         (quotearg_n_options): Abort if N is negative.
8377         Avoid overflow check on hosts where size_t is 64 bits and int
8378         is 32 bits, as overflow is impossible there.
8379         Fix off-by-one typo that caused unnecessary reallocation.
8380
8381 2001-11-27  Jim Meyering  <meyering@lucent.com>
8382
8383         * tempname.c: Merge with version from libc.
8384         * regex.c: Likewise.
8385
8386         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8387         for which STDC_HEADERS is 0, it was not included, resulting in a
8388         warning about an integer-to-pointer conversion problem with getenv.
8389         Reported by Volker Borchert.
8390
8391 2001-11-26  Jim Meyering  <meyering@lucent.com>
8392
8393         * gtod.h: Remove file.
8394         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8395         * gettimeofday.c: Don't include gtod.h.
8396         (GTOD_init): Remove function.
8397         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8398         Suggestion from Volker Borchert.
8399
8400 2001-11-23  Jim Meyering  <meyering@lucent.com>
8401
8402         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8403         * hash.c (struct hash_table): Define it here instead.
8404
8405 2001-11-22  Jim Meyering  <meyering@lucent.com>
8406
8407         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8408
8409 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8410
8411         * tempname.c (TMP_MAX): Remove; no longer needed.
8412         (TEMPORARIES): New macro.
8413         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8414         removes an artificial limitation (e.g. HP-UX 10.20, where
8415         TMP_MAX is 17576).
8416
8417 2001-11-18  Jim Meyering  <meyering@lucent.com>
8418
8419         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8420         on SunOS 4.
8421
8422         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8423         files will be created before anything else.
8424
8425 2001-11-17  Jim Meyering  <meyering@lucent.com>
8426
8427         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8428         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8429         rather than group writable.  Patch by Juan F. Codagnone.
8430
8431         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8432         Instead, include "xalloc.h".
8433
8434         * mountlist.c: Include unlocked-io.h after all system headers.
8435         Remove explicit declarations of xmalloc, xrealloc,
8436         and xstrdup.  Instead, include "xalloc.h".
8437
8438         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8439         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8440         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8441
8442         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8443         Reported by Padraig Brady.
8444
8445         * mkstemp.c: #undef mkstemp.
8446         Include config.h.
8447         (rpl_mkstemp): Rename from mkstemp.
8448         Protoize.
8449
8450 2001-11-16  Jim Meyering  <meyering@lucent.com>
8451
8452         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8453         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8454         determine the amount of total physical memory, use pstat_getstatic.
8455         HPUX-11 doesn't define _SC_PHYS_PAGES.
8456         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8457         If sysconf couldn't be used to determine the amount of available
8458         physical memory, use both pstat_getstatic and pstat_getdynamic.
8459         Based on a patch from Bob Proulx.
8460
8461 2001-11-05  Jim Meyering  <meyering@lucent.com>
8462
8463         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8464
8465 2001-11-03  Jim Meyering  <meyering@lucent.com>
8466
8467         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8468         in argmatch_to_argument call.
8469
8470         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8471         argument.
8472
8473         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8474         e.g., a fault due to an attempt to free a NULL pointer.
8475
8476 2001-11-01  Jim Meyering  <meyering@lucent.com>
8477
8478         * dirfd.c, dirfd.h: New files.
8479         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8480
8481         * hash.c (hash_print) [TESTING]: Clean up.
8482
8483 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8484
8485         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8486         to avoid a warning if -Wall.
8487
8488 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8489
8490         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8491
8492 2001-10-21  Jim Meyering  <meyering@lucent.com>
8493
8494         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8495         this code would end up calling gettext even in packages built
8496         with --disable-nls.
8497         * getopt.c (_): Likewise.
8498         * regex.c (_): Likewise.
8499
8500 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8501
8502         * error.c (strerror_r): Do not declare unless !_LIBC.
8503         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8504         Use strerror_r that is only a macro, even if it is not a function.
8505         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8506         (private_strerror): Use prototypes, not old-style function definition.
8507         (print_errno_message): New function.
8508         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8509         char*-flavored one.
8510         (error_tail, error, error_at_line): Use it.
8511
8512 2001-10-11  Jim Meyering  <meyering@lucent.com>
8513
8514         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8515         and quote_n (1, ... to avoid clobbering a buffer.
8516
8517 2001-10-05  Jim Meyering  <meyering@lucent.com>
8518
8519         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8520         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8521         * hash-pjw.h: New file.
8522
8523 2001-09-30  Jim Meyering  <meyering@lucent.com>
8524
8525         * mountlist.c [MOUNTED_GETFSSTAT]:
8526         Include <sys/ucred.h>, for Apple Darwin.
8527         Include sys/mount.h and sys/fs_types.h only if available.
8528         (FS_TYPE): Define.
8529         (read_filesystem_list): Use FS_TYPE.
8530
8531 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8532
8533         * exclude.c (excluded_filename): 0 -> false, since it's
8534         a boolean context.
8535
8536 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8537
8538         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8539         #defines strtoimax.  Also treat the other strto* functions
8540         like strtoimax.
8541
8542         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8543         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8544         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8545
8546 2001-09-26  Jim Meyering  <meyering@lucent.com>
8547
8548         Most macros in unlocked-io.h had the wrong number of arguments.
8549         * gen-uio: New script.
8550         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8551         * unlocked-io.hin: Remove file.
8552         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8553         rather than trying to embed it here.
8554         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8555         Reported by Padraig Brady.
8556
8557 2001-09-25  Volker Borchert  <bt@teknon.de>
8558
8559         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8560
8561 2001-09-23  Jim Meyering  <meyering@lucent.com>
8562
8563         * mountlist.c: Remove useless parentheses in #if directives.
8564         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8565         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8566
8567 2001-09-22  Jim Meyering  <meyering@lucent.com>
8568
8569         * localcharset.c: Update from latest gettext.
8570         * config.charset: Likewise.
8571
8572 2001-09-20  Jim Meyering  <meyering@lucent.com>
8573
8574         * xstrtol.c (strtoimax): Guard declaration with
8575         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8576         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8577         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8578         (strtoumax): Likewise, for completeness (it wasn't necessary).
8579
8580 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8581
8582         * strtoimax.c (HAVE_LONG_LONG):
8583         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8584         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8585         to work around bug in IBM C compiler.
8586
8587 2001-09-16  Jim Meyering  <meyering@lucent.com>
8588
8589         * mkdir.c: New file.
8590
8591 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8592
8593         * xgetcwd.c: Revert some of the previous change; intead,
8594         fix the HAVE_GETCWD_NULL code to behave more like the
8595         !HAVE_GETCWD_NULL code used to.
8596
8597         Include "xalloc.h".
8598         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8599         invoke xalloc_die.
8600
8601 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8602
8603         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8604         Use ssize_t, not int, to store result of readlink.
8605         Check for ssize_t overflow as well as size_t overflow,
8606         as POSIX says the result of readlink is implementation-defined
8607         when ssize_t overflows.
8608         Remove unnecessary cast to char*.
8609         Use free+malloc instead of realloc, as the storage doesn't need
8610         to be preserved and it's clearer and can be more efficient that way.
8611         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8612         * xreadlink.h (xreadlink): Update prototype.
8613
8614 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8615
8616         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8617         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8618         spotted by Jim Meyering.
8619
8620 2001-09-03  Jim Meyering  <meyering@lucent.com>
8621
8622         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8623
8624 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8625
8626         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8627         like the HAVE_GETCWD_NULL code.
8628         Include pathmax.h if not HAVE_GETCWD.
8629         Do not include xalloc.h.
8630         (INITIAL_BUFFER_SIZE): New symbol.
8631         Do not use xmalloc / xrealloc, since the caller is responsible for
8632         handling errors.  Preserve errno around `free' during failure.
8633         Do not overrun buffer when using getwd.
8634
8635 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8636
8637         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8638         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8639
8640 2001-09-02  Jim Meyering  <meyering@lucent.com>
8641
8642         * error.c: Update from GNU libc.
8643
8644 2001-09-01  Jim Meyering  <meyering@lucent.com>
8645
8646         * xreadlink.c: New file.
8647         * xreadlink.h: New file.
8648         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8649
8650         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8651         doesn't conflict with sparc Solaris 7's definition in
8652         /usr/include/sys/int_types.h.
8653
8654         * exclude.c: Use `""', not `<>' to #include non-system header files.
8655         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8656         and strncasecmp as r-values.  Unixware didn't have declarations.
8657
8658 2001-08-31  Jim Meyering  <meyering@lucent.com>
8659
8660         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8661         Use an initial, malloc'd, buffer of length 128 rather than
8662         a statically allocated one of length 1024.
8663
8664 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8665
8666         * xgetcwd.c: Don't include pathmax.h.
8667         Include stdlib.h and unistd.h if available.
8668         Include xalloc.h.
8669         (xmalloc, xstrdup, free): Remove decls.
8670         (xgetcwd): Don't assume sizes fit in unsigned.
8671         Check for overflow when computing sizes.
8672         Simplify reallocation code.
8673
8674 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8675
8676         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8677
8678         * strtoimax.c: Renamed from strtoxmax.c, removing the
8679         old strtoimax.c.
8680
8681         Also, make the following further changes to make this file's
8682         configuration more similar to that of strtol.c:
8683         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8684         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8685         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8686         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8687         changed to signed values.
8688
8689         And make the following changes as well:
8690         Fix copyright notice, as 1999 was missing.
8691         (verify): New macro.
8692         (strtoimax): Check sizes at compile-time, not run-time.
8693         Prefer strtol to strtoll if both work.
8694         (main): Remove; it was not that useful and was a pain to maintain.
8695
8696         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8697
8698 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8699
8700         * savedir.c (savedir): Remove size parameter, as POSIX says that
8701         a directory's st_size can have an arbitrary value, so the old
8702         usage could waste an arbitrary amount of memory.  All uses
8703         changed.
8704         * savedir.h: Update prototype.
8705
8706 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8707
8708         * xstrtol.c (strtoimax): New decl.
8709
8710 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8711
8712         * xstrtol.h: Add copyright notice.
8713         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8714         LONGINT_INVALID_SUFFIX_CHAR.
8715
8716 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8717
8718         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8719         tm to be declared.
8720
8721 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8722
8723         * hash.c: Remove '2001' from copyright notice.
8724
8725 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8726
8727         * full-write.h: New file.
8728         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8729         * full-write.c: Correct credits, as cccp.c no longer
8730         exists and anyway it was so heavily changed from the old cccp
8731         code as to be unrecognizable.  Include full-write.h.
8732         (full_write) Return size_t, with short writes meaning failure.
8733         All callers changed.  This fixes a bug with large buffers
8734         on 64-bit hosts.
8735         * utime.c: Include full-write.h.
8736
8737 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8738
8739         Merge 'exclude' changes from tar 1.13.22.
8740         This fixes one or two unlikely storage allocation overflow bugs,
8741         but doesn't change user-visible behavior otherwise.
8742
8743 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8744
8745         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8746         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8747         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8748         Include if available.
8749         (<xalloc.h>): Include
8750         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8751         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8752         collide with FNM macros.
8753         (struct patopts): New struct.
8754         (struct exclude): Use it, as exclude patterns now come with options.
8755         (new_exclude): Support above changes.
8756         (new_exclude, add_exclude_file):
8757         Initial size must now be a power of two to simplify overflow checking.
8758         (free_exclude, fnmatch_no_wildcards): New function.
8759         (excluded_filename): No longer requires options arg, as the options
8760         are determined by add_exclude.  Now returns bool, not int.
8761         (excluded_filename, add_exclude):
8762         Add support for the fancy new exclusion options.
8763         (add_exclude, add_exclude_file): Now takes int options arg.
8764         Check for arithmetic overflow when computing sizes.
8765         (add_exclude_file): xrealloc might modify errno, so don't
8766         realloc until after errno might be used.
8767
8768         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8769         New macros.
8770         (free_exclude): New decl.
8771         (add_exclude, add_exclude_file): Now takes int options arg.
8772         (excluded_filename): No longer requires options arg, as the options
8773         are determined by add_exclude.  Now returns bool, not int.
8774
8775 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8776
8777         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8778
8779 2001-08-27  Jim Meyering  <meyering@lucent.com>
8780
8781         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8782
8783         * version-etc.c (N_): Remove definition.
8784         Revert most of last change.
8785         Instead, simply don't mark the `Copyright...' string for translation.
8786         Based on advice from Paul Eggert.
8787
8788         * strtoxmax.c: Tweak comment.
8789
8790 2001-08-26  Jim Meyering  <meyering@lucent.com>
8791
8792         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8793         of copyright with `%s' so translators don't get an untranslated
8794         message in 2002.
8795         (COPYRIGHT_YEAR): Define.
8796         (version_etc): Use fprintf rather than fputs.
8797         Suggestion from Ulrich Drepper.
8798
8799         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8800
8801         * strtoll.c: New file, from GNU libc.
8802         * xstrtoimax.c: New file.
8803
8804         * xstrtol.h: Add xstrtoimax.
8805         * strtoumax.c: New file.  Simply include "strtoumax.c".
8806         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8807
8808         * strtoumax.c: Factor to work both for unsigned and signed types, ...
8809         * strtoxmax.c: ... then renamed to this.
8810
8811 2001-08-13  Paul Eggert  <eggert@twinsun.com>
8812
8813         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8814         Port to Solaris 8, where 'sed' requires a space after the 'r'
8815         command, and where sh dislikes "$/".  Clean up the spacing a bit.
8816         Redirect output to $tmp just once.
8817
8818 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
8819
8820         * addext.c (<errno.h>): Include.
8821         (errno): Declare if not defined.
8822         (addext): Work correctly when pathconf returns -1 and leaves
8823         errno alone because there is no limit.  Also, work even if
8824         pathconf returns a value greater than SIZE_MAX.
8825
8826 2001-08-12  Jim Meyering  <meyering@lucent.com>
8827
8828         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8829         Simply `return getcwd (NULL, 0);'.
8830         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8831         Use 1300 as initial value for length, not PATH_MAX.
8832
8833         * pathmax.h: Clean up cpp syntax.
8834
8835 2001-08-12  Jim Meyering  <meyering@lucent.com>
8836
8837         * gettimeofday.c: New file.
8838         * gtod.h: New file.
8839         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8840
8841 2001-08-04  Jim Meyering  <meyering@lucent.com>
8842
8843         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8844         to get in sync with glibc.
8845
8846 2001-08-03  Paul Eggert  <eggert@twinsun.com>
8847
8848         The following changes are from gettext 0.10.39 as maintained by
8849         Bruno Haible.
8850
8851         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8852         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8853         with inverted sense.  All uses changed.
8854
8855         * mbswidth.c: Don't include <limits.h>.
8856         Include <stdlib.h> and <string.h> unconditionally.
8857         (iswcntrl, mbsinit, ISCNTRL): New macros.
8858         (mbsnwidth): Use K&R style function declarations.
8859         Don't bother checking for MB_LEN_MAX == 1, since the compiler
8860         can optimize it when MB_CUR_MAX == 1.
8861         The width of control characters is zero, not 1.
8862
8863 2001-07-15  Jim Meyering  <meyering@lucent.com>
8864
8865         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8866         (BUILT_SOURCES): Add unlocked-io.h.
8867         (io_functions): Define.
8868         (unlocked-io.h): New rule.
8869         (DISTCLEANFILES): Add unlocked-io.h.
8870         (all-local): Depend on unlocked-io.h, to ensure it is created.
8871
8872         * unlocked-io.hin: New file
8873
8874         * regex.c: Update from glibc.
8875
8876 2001-07-05  Jim Meyering  <meyering@lucent.com>
8877
8878         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8879         recommendation.
8880         (libfetish_a_SOURCES): Put all .h files here instead.
8881         Remove a thus-exposed (better checks in automake) duplicate and
8882         two unnecessary .h files.
8883
8884 2001-06-11  Jim Meyering  <meyering@lucent.com>
8885
8886         * regex.c: Update from GNU libc.
8887
8888 2001-05-27  Jim Meyering  <meyering@lucent.com>
8889
8890         * readutmp.h (UT_TYPE): Define.
8891
8892 2001-05-24  Jim Meyering  <meyering@lucent.com>
8893
8894         * argmatch.c: Include "quote.h".
8895         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
8896         quote function.  Reported by Göran Uddeborg.
8897
8898 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
8899
8900         * dirname.c (dir_name): Compute append_dot using path, not newpath
8901         which is not yet declared.
8902
8903 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8904
8905         * Makefile.am (libfetish_a_SOURCES):
8906         Add strftime.c, since we now compile it on all hosts.
8907
8908         * strftime.c (my_strftime):
8909         Define to nstrftime if emacs, but only if my_strftime is not defined.
8910         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8911         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8912         Add one more extra argument: a nanoseconds value.
8913         All uses changed.
8914         (ns): New macro.
8915         (my_strftime function): Add %N format.
8916         (emacs_strftimeu): Renamed from emacs_strftime,
8917         with extra ut argument.
8918
8919 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8920
8921         dirname code cleanup.  base_name now behaves more compatibly
8922         with POSIX basename when given file names that have trailing
8923         slashes, and similarly for dir_name.  Add new primitives
8924         base_len and dir_len.  Put the directory-name-related decls
8925         into dirname.h.
8926
8927         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8928         * backupfile.c (base_name): Likewise.
8929         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8930         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8931         * makepath.c (strip_trailing_slashes): Likewise.
8932         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8933         Likewise.
8934         * rename.c (strip_trailing_slashes): Likewise.
8935         * same.c (base_name): Likewise.
8936         * stripslash.c (ISSLASH): Likewise.
8937
8938         * addext.c: Include <dirname.h> after size_t is defined.
8939         * backupfile.c: Likewise.
8940
8941         * addext.c (addext): Use base_len to trim redundant
8942         trailing slashes instead of doing it ourselves.
8943         But do not trim the last slash if it is not redundant.
8944
8945         * backupfile.c (find_backup_file_name,
8946         max_backup_version): Use base_len instead of rolling it ourselves.
8947         Handle the case of "" and (on DOS) "C:" correctly.
8948
8949         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8950         Include <string.h>, <dirname.h>.
8951         (base_name): Allow file names ending in slashes, other than names
8952         that are all slashes.  In this case, return the basename followed
8953         by the slashes.  This is more general, and can be used in places
8954         where the original base_name purposely had an assertion failure.
8955         (base_len): New function.
8956
8957         * dirname.c: Include <string.h> instead of <stdlib.h>.
8958         Do not include <assert.h>; no longer needed.
8959         Include xalloc.h.
8960         (memrchr): Remove decl.
8961         (dir_name_r): Remove.
8962         (dir_len): Renamed from dirlen.  All callers changed.
8963         Rewrite in terms of base_name, for simplicity and consistency.
8964         (dir_name): Never return NULL.  All callers changed.
8965         Do not include <stdlib.h> in test program; no longer needed.
8966         return 0; is fine for test program.
8967
8968         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8969         New macros.
8970         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8971
8972         * path-concat.c (path_concat): Use base_len to compute
8973         base length, not strlen; this means we cannot rely on memcpy
8974         to null-terminate.
8975
8976         * same.c (STREQ): Remove.
8977         (same_name): Handle the case where the basename ends in trailing '/'.
8978
8979         * stripslash.c (strip_trailing_slashes): Return nonzero if
8980         a slash was stripped.  Do not strip the last slash after a
8981         file system prefix.
8982
8983 2001-04-08  Jim Meyering  <meyering@lucent.com>
8984
8985         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8986         recomputed; that's necessary when the offset spans a DST transition.
8987         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
8988
8989 2001-04-02  Jim Meyering  <meyering@lucent.com>
8990
8991         * regex.h, regex.c: Update from GNU libc.
8992
8993 2001-03-19  Paul Eggert  <eggert@twinsun.com>
8994
8995         * version-etc.c (version_etc_copyright): Update to 2001.
8996
8997 2001-03-16  Paul Eggert  <eggert@twinsun.com>
8998
8999         * tempname.c (uint64_t): Define to uintmax_t if
9000         not defined, and if UINT64_MAX is not defined.
9001         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9002         Reported by John David Anglin.
9003
9004 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9005
9006         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9007         alias if codeset is empty.
9008         * config.charset (BeOS): Use wildcard syntax.
9009
9010 2001-03-13  Jim Meyering  <meyering@lucent.com>
9011
9012         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9013         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9014         From Bruno Haible.
9015
9016 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9017
9018         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9019         Don't return NULL.
9020         * unicodeio.c (print_unicode_char): Simplify accordingly.
9021
9022 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9023
9024         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9025         support for DOS/DJGPP.
9026
9027 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9028
9029         * Makefile.am (libfetish_a_SOURCES):
9030         Add dup-safer.c, fopen-safer.c.
9031         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9032
9033         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9034
9035 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9036
9037         The mkstemp replacement is taken from glibc 2.2.2, with some
9038         portability fixes for use outside glibc, as follows:
9039
9040         * tempname.c (struct_stat64): New macro.
9041         (direxists, __gen_tempname): Use it.
9042         This avoids a portability problem with Solaris 8.
9043
9044         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9045         (<stddef.h>, <stdint.h>, <string.h>):
9046         Include only if STDC_HEADERS || _LIBC.
9047         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9048         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9049         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9050         (__set_errno): Define this macro if <errno.h> doesn't.
9051         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9052         Define these macros if <stdio.h> doesn't.
9053         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9054         Define these macros if <sys/stat.h>
9055         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9056         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9057         __xstat64): Define if not _LIBC.
9058         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9059         (__gen_tempname): Invoke gettimeofday only if
9060         HAVE_GETTIMEOFDAY || _LIBC;
9061         otherwise, fall back on plain "time".
9062         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9063
9064         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9065
9066         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9067
9068 2001-02-17  Jim Meyering  <meyering@lucent.com>
9069
9070         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9071         around included file name.
9072
9073         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9074
9075         * strftime.c: Update from GNU libc (the only changes were to comments).
9076
9077 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9078
9079         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9080
9081 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9082
9083         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9084         Remove workaround macros for hosts that have mbrtowc but not
9085         mbstate_t, as we now insist on proper declarations for both
9086         before using mbrtowc.
9087
9088 2001-02-17  Jim Meyering  <meyering@lucent.com>
9089
9090         * regex.c: Update from libc.
9091
9092 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9093
9094         * alloca.c (malloc): Undef before defining, since stdlib.h
9095         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9096         Reported by Mark Hounschell via Paul Eggert.
9097
9098 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9099
9100         * config.charset: Update for FreeBSD 4.2.
9101
9102 2001-01-26  Jim Meyering  <meyering@lucent.com>
9103
9104         * quotearg.c: Include stddef.h.
9105         * quote.c: Include stddef.h.
9106         Reported by Axel Kittenberger.
9107
9108         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9109         line in double quotes so that it evokes a better diagnostic.
9110         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9111         Reported by Axel Kittenberger.
9112
9113 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9114
9115         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9116         to avoid a warning.  Add back 'const' to inptr.
9117
9118 2001-01-16  Jim Meyering  <meyering@lucent.com>
9119
9120         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9121         From Bruno Haible.
9122
9123 2001-01-14  Jim Meyering  <meyering@lucent.com>
9124
9125         * rename.c: New file.  From Volker Borchert.
9126         Include stdlib.h, string.h or strings.h, and xalloc.h.
9127         Use strip_trailing_slashes rather than open-coding it.
9128
9129 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9130
9131         * strftime.c: Sync with glibc time/strftime.c 1.81.
9132
9133 2001-01-03  Jim Meyering  <meyering@lucent.com>
9134
9135         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9136         local `inptr' to avoid warning with some system declarations of iconv.
9137
9138 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9139
9140         * modechange.c: Do not assume that mode_t uses the
9141         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9142         the other-execute bit of FOO even if S_IXOTH != 1.
9143
9144         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9145         WOTH, XOTH, ALLM): New macros.
9146         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9147          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9148         Use them.
9149         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9150         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9151         (mode_compile):
9152         No need to use uintmax_t; unsigned long is long enough.
9153         Don't bother to get suffix since we don't use it.
9154
9155 2000-12-24  Jim Meyering  <meyering@lucent.com>
9156
9157         * hash.c (is_prime): Return explicit boolean values.
9158         (hash_get_first): Return NULL to appease Irix5.6's 89.
9159         Reported by Nelson Beebe.
9160
9161 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9162
9163         * localcharset.c (locale_charset): Add support for Win32.
9164
9165 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9166
9167         * physmem.h, physmem.c: New files.
9168
9169         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9170         (noinst_HEADERS): Add physmem.h.
9171
9172         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9173         't' for compatibility with Solaris 8 sort.
9174
9175 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9176
9177         * config.charset: Add support for BeOS.
9178
9179 2000-12-16  Jim Meyering  <meyering@lucent.com>
9180
9181         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9182         SHELLS_FILE to a file name that's useful on djgpp systems.
9183         Include stdlib.h.
9184         (ADDITIONAL_DEFAULT_SHELLS): Define.
9185         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9186         Based mostly on a patch from Prashant TR.
9187
9188 2000-12-16  Jim Meyering  <meyering@lucent.com>
9189
9190         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9191         N and M) would have treated it like `chown N:N FILE'.
9192
9193         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9194
9195 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9196
9197         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9198         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9199         to the list of canonical encodings. Rename EUC-CN to GB2312.
9200
9201 2000-12-08  Andreas Schwab  <schwab@suse.de>
9202
9203         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9204         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9205
9206 2000-12-07  Jim Meyering  <meyering@lucent.com>
9207
9208         * stripslash.c (ISSLASH): Define.
9209         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9210         From Prashant TR.
9211
9212         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9213         (dir_name_r): Declare this function as static.
9214         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9215         manifest itself on a name containing a mix of slashes and
9216         backslashes.
9217         Make this function work with names starting with a DOS-style
9218         drive letter and colon prefix.
9219         (dir_name): Append `.' if necessary.
9220         Based mostly on patches from Prashant TR and Eli Zaretskii.
9221
9222         * dirname.h (dir_name_r): Remove prototype.
9223
9224 2000-12-05  Jim Meyering  <meyering@lucent.com>
9225
9226         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9227
9228 2000-12-04  Jim Meyering  <meyering@lucent.com>
9229
9230         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9231         Also include memory.h, stdlib.h, unistd.h if appropriate.
9232         Reported by Andreas Jaeger (conflicting declaration of malloc).
9233
9234 2000-12-02  Jim Meyering  <meyering@lucent.com>
9235
9236         * closeout.h: Make idempotent, to avoid some obscure warnings.
9237
9238 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9239
9240         * memrchr.c: Include <config.h> before any system include file.
9241
9242 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9243
9244         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9245
9246 2000-11-26  Jim Meyering  <meyering@lucent.com>
9247
9248         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9249
9250 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9251
9252         * strftime.c (my_strftime): Do not invoke mbrlen with a
9253         size of (size_t) -1; it's not portable.
9254
9255 2000-11-17  Akim Demaille  <akim@epita.fr>
9256
9257         * obstack.h: Formatting changes.
9258         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9259         prevent type checking.
9260         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9261         cast the value to (void *): assigning a `foo *' to a `void *'
9262         variable is valid.
9263         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9264
9265 2000-11-17  Jim Meyering  <meyering@lucent.com>
9266
9267         * strstr.c: Update from GNU libc.
9268
9269 2000-11-16  Jim Meyering  <meyering@lucent.com>
9270
9271         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9272
9273 2000-11-11  Jim Meyering  <meyering@lucent.com>
9274
9275         * error.c: Add a couple #includes, merging from GNU libc version.
9276
9277 2000-11-10  Jim Meyering  <meyering@lucent.com>
9278
9279         * obstack.h: Update from GNU libc.
9280         * obstack.c: Likewise.
9281
9282 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9283
9284         * getusershell.c (setusershell): Use rewind rather than
9285         fseek/fseeko, to avoid configuration hassles with fseeko.
9286         Don't bother opening SHELLS_FILE if shellstream is NULL;
9287         it's not necessary.
9288
9289 2000-11-05  Jim Meyering  <meyering@lucent.com>
9290
9291         * makepath.h (make_dir): Declare.
9292         * makepath.c (make_dir): Remove `static' attribute.
9293         Tweak a comment.
9294
9295 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9296
9297         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9298         last one in a bucket, advance to the next bucket.
9299
9300 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9301
9302         * fnmatch.c: Do not comment out all the code if we are using
9303         the GNU C library, because in some cases we are replacing buggy
9304         code in the GNU C library itself.
9305
9306 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9307
9308         * error.h, getline.h, modechange.h:
9309         Remove "2000" from Copyright line, as the file hasn't been
9310         changed this year other than in the copyright notice.
9311
9312         * xalloc.h: Add "2000" to Copyright line, as this file
9313         was changed this year.
9314
9315 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9316
9317         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9318         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9319         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9320
9321 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9322
9323         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9324         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9325         doesn't define __restrict_arr.
9326
9327 2000-10-29  Jim Meyering  <meyering@lucent.com>
9328
9329         * xstat.in: Fix grammar in comment.
9330
9331 2000-10-28  Jim Meyering  <meyering@lucent.com>
9332
9333         * memchr.c: Update from libc.
9334         Adjust for portability:
9335         [HAVE_STDLIB_H]: Include stdlib.h.
9336         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9337         Undef __memchr, too.
9338         [!weak_alias]: Define __memchr to memchr.
9339
9340         * regex.c: Update from libc.
9341         * regex.h: Likewise.
9342         * getopt1.c: Likewise.
9343         * memcmp.c: Likewise.
9344
9345         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9346         Avoid using fseek, when possible -- it's broken by design.
9347         Patch by Ulrich Drepper.
9348
9349 2000-10-26  Jim Meyering  <meyering@lucent.com>
9350
9351         * strftime.c: Update from libc.
9352
9353 2000-10-25  Jim Meyering  <meyering@lucent.com>
9354
9355         * obstack.c: Update from libc.
9356
9357 2000-10-23  Jim Meyering  <meyering@lucent.com>
9358
9359         * hard-locale.c (hard_locale): Revert last change -- it was simply
9360         wrong.  That set_locale call must not have any side effects.
9361         From Paul Eggert.
9362
9363 2000-10-22  Jim Meyering  <meyering@lucent.com>
9364
9365         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9366         [CYCLIC]: Remove now-unused definition.
9367
9368         * save-cwd.c (O_DIRECTORY): Define, if needed.
9369         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9370         Suggestion from Ulrich Drepper.
9371
9372 2000-10-21  Jim Meyering  <meyering@lucent.com>
9373
9374         * dirname.c (dir_name_r): New function, factored out of dir_name.
9375         (dir_name): Use dir_name_r.
9376         * dirname.h (dir_name_r): Declare it.
9377
9378 2000-10-21  Jim Meyering  <meyering@lucent.com>
9379
9380         * dirname.c (memrchr): Declare if necessary.
9381         (dir_name): Remove the restriction that there be no
9382         trailing slashes.  Now, this code skips past them, effectively
9383         ignoring them.
9384         [TEST_DIRNAME] (main): New unit tests.
9385
9386         * memrchr.c: New file from GNU libc.
9387         Undef __memrchr, too.
9388         [!weak_alias]: Define __memrchr to memrchr.
9389         Guard weak_alias use with `#ifdef weak_alias'.
9390
9391 2000-10-17  Jim Meyering  <meyering@lucent.com>
9392
9393         * quote.h (PARAMS): Define and use.
9394         Reported by Akim Demaille.
9395
9396         * getopt.c: Update from libc.
9397
9398 2000-10-16  Jim Meyering  <meyering@lucent.com>
9399
9400         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9401         From Jan Fedak.
9402
9403 2000-09-25  Jim Meyering  <meyering@lucent.com>
9404
9405         * md5.h (rol): Define (from GnuPG).
9406
9407         * sha.c: Give credit (GnuPG) where due.
9408         (M): Use rol rather than open-coding it.
9409         Add a FIXME comment.
9410
9411 2000-09-21  Jim Meyering  <meyering@lucent.com>
9412
9413         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9414         Reported by Michael Stone.
9415
9416 2000-09-20  Jim Meyering  <meyering@lucent.com>
9417
9418         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9419         (noinst_HEADERS): Add sha.h.
9420         Based on code from Scott G. Miller and from GnuPG.
9421
9422 2000-09-15  Jim Meyering  <meyering@lucent.com>
9423
9424         * regex.c: Update from libc.
9425
9426 2000-09-10  Jim Meyering  <meyering@lucent.com>
9427
9428         * getopt.c (_getopt_internal): Update from glibc.
9429
9430 2000-09-09  Jim Meyering  <meyering@lucent.com>
9431
9432         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9433         think it should be used as a general replacement for isascii.
9434         * fnmatch.c: Likewise.
9435         * mbswidth.c: Likewise
9436         * regex.c: Likewise.
9437
9438         Don't use atoi.
9439         * userspec.c: Include sys/param.h and limits.h.
9440         Include xstrtol.h.
9441         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9442         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9443         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9444         UID, GID.  Check range.
9445
9446 2000-09-06  Jim Meyering  <meyering@lucent.com>
9447
9448         * getopt.c (_getopt_internal): Update from glibc.
9449
9450 2000-08-30  Jim Meyering  <meyering@lucent.com>
9451
9452         * strftime.c: Merge in changes from GNU libc.
9453
9454 2000-08-26  Jim Meyering  <meyering@lucent.com>
9455
9456         * closeout.c: Include "__fpending.h".
9457         (close_stdout_status): Return right away if there's nothing to flush.
9458
9459         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9460         * __fpending.c: New file.
9461         * __fpending.h: New file.
9462
9463 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9464
9465         Standardize on "memory exhausted" instead of "Memory exhausted"
9466         or "virtual memory exhausted".
9467         * obstack.c (print_and_abort): Use "memory exhausted", not
9468         "virtual memory exhausted".
9469         * same.c (same_name): Invoke xalloc_die instead of printing
9470         our own message.
9471         * userspec.c (parse_user_spec): Likewise.
9472         * bumpalloc.h: comment fix
9473         * same.c, userspec.c: Include xalloc.h.
9474
9475         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9476         not char *const and pointing to a constant array.
9477         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9478         (xrealloc): Comment fix.
9479
9480         * userspec.c (parse_user_spec):
9481         Don't translate a message until just before returning,
9482         to avoid unnecessary translation.
9483
9484 2000-08-07  Jim Meyering  <meyering@lucent.com>
9485
9486         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9487         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9488         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9489         getgroups.c, gethostname.c, getopt.h, group-member.c,
9490         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9491         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9492         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9493         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9494         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9495         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9496         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9497         yesno.c: Back out Copyright date changes for each file with no change
9498         this year.  This eases coordination with other programs using the same
9499         source code modules.  From Paul Eggert.
9500
9501 2000-08-03  Greg McGary  <greg@mcgary.org>
9502
9503         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9504         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9505         (EXTEND_BUFFER): Use them.
9506
9507 2000-08-01  Jim Meyering  <meyering@lucent.com>
9508
9509         * dirname.c (ISSLASH): Define.
9510         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9511         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9512         both `\' and `/' may be use as path separators.
9513         Based on a patch from Prashant TR.
9514
9515 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9516
9517         * quotearg.c (quotearg_n_options): Don't make the initial
9518         slot vector a constant, since it might get modified.
9519
9520 2000-07-31  Jim Meyering  <meyering@lucent.com>
9521
9522         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9523         * obstack.c (print_and_abort): Likewise.
9524
9525 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9526
9527         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9528         buffer, so that the caller can always quote one small
9529         component of a "memory exhausted" message in slot 0.
9530         From a suggestion by Jim Meyering.
9531
9532 2000-07-30  Jim Meyering  <meyering@lucent.com>
9533
9534         * makepath.c (make_path): Quote the other instance, too.
9535
9536         * quotearg.c (N_STATIC_SLOTVECS): Define.
9537         (STATIC_BUF_SIZE): Define.
9538         (quotearg_n_options): Use only statically allocated storage when
9539         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9540         than STATIC_BUF_SIZE.
9541
9542 2000-07-29  Jim Meyering  <meyering@lucent.com>
9543
9544         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9545         * dirname.c (dir_name): Likewise.
9546
9547         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9548
9549         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9550         (dir_name): Assert that there are no trailing slashes.
9551
9552 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9553
9554         * mbswidth.h (mbswidth): Add a flags argument.
9555         (mbswidth): New declaration.
9556         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9557         * mbswidth.c (mbswidth): Add a flags argument.
9558         (mbsnwidth): New function.
9559
9560 2000-07-24  Jim Meyering  <meyering@lucent.com>
9561
9562         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9563
9564 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9565
9566         * mbswidth.c (_XOPEN_SOURCE):
9567         Don't define; this causes problems on Solaris 7.
9568         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9569
9570 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9571
9572         * quotearg.c:
9573         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9574         so that mbstate_t is always defined.
9575
9576         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9577         be 1 in at least one GCC installation, and this configuration
9578         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9579         performance on hosts that have mbrtowc but have only unibyte
9580         locales, but I assume these hosts are rare.
9581
9582 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9583
9584         * quotearg.c: Streamline by invoking multibyte code only if needed.
9585         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9586         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9587         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9588         invoke multibyte primitives.
9589
9590 2000-07-23  Jim Meyering  <meyering@lucent.com>
9591
9592         * basename.c (base_name): Add an assertion.
9593
9594 2000-07-15  Bruno Haible  <clisp.cons.org>
9595
9596         * quotearg.c: When the system forces us to redefine mbstate_t,
9597         shadow its mbsinit function.
9598
9599 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9600
9601         * mbswidth.h: New file.
9602         * mbswidth.c: New file.
9603         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9604         (noinst_HEADERS): Add mbswidth.h.
9605
9606 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9607
9608         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9609         and IRIX 6.
9610
9611 2000-07-15  Jim Meyering  <meyering@lucent.com>
9612
9613         * makepath.c: Include quote.h.
9614         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9615         corresponding argument in a `quote (...)' call.
9616         Give better diagnostics.
9617
9618         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9619         (noinst_HEADERS): Add quote.h.
9620
9621         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9622         from tar's src/misc.c.
9623         * quote.h: New file.  Prototypes for same.
9624
9625 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9626
9627         From a suggestion by Bruno Haible.
9628         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9629         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9630         to decide whether to define the BeOS workaround macro;
9631         this adjusts to the change to AC_MBSTATE_T.
9632
9633 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9634
9635         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9636
9637         * quotearg.c (quoting_style_args, quoting_style_vals,
9638         quotearg_buffer_restyled): Add support for
9639         clocale_quoting_style.  Undo previous change to
9640         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9641         and "{RIGHT QUOTATION MARK}" msgids.
9642
9643 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9644
9645         The old behavior of quoting `like this' doesn't look good with
9646         newer, ISO-style fonts.  See:
9647         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9648
9649         Instead, quote "like this" by default.  Let the translator
9650         tailor the locale-specific quoting behavior by providing
9651         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9652
9653         * quotearg.c (N_): New macro.
9654         (gettext_default): New function.
9655         (quotearg_buffer_restyled): Use
9656         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9657         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9658
9659 2000-07-09  Jim Meyering  <meyering@lucent.com>
9660
9661         * Most files: Update copyright dates to include 2000.
9662
9663 2000-07-08  Jim Meyering  <meyering@lucent.com>
9664
9665         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9666         if not defined.
9667         (xgethostname): Remove now-unnecessary #ifdef.
9668         Move declaration of `err' into loop where it's used.
9669
9670 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9671
9672         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9673         by allocating a larger buffer. Test the gethostname return value for
9674         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9675         returns an error and ENAMETOOLONG isn't defined.
9676
9677 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9678         and Bruno Haible  <haible@clisp.cons.org>
9679
9680         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9681
9682 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9683
9684         * quotearg.c (struct quoting_options): Simplify quote_these_too
9685         dimension.
9686
9687 2000-07-03  Jim Meyering  <meyering@lucent.com>
9688
9689         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9690         Reported by Bruno Haible.
9691
9692 2000-07-04  Jim Meyering  <meyering@lucent.com>
9693
9694         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9695         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9696         lacks mbrtowc.
9697
9698 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9699         and Bruno Haible  <haible@clisp.cons.org>
9700
9701         * quotearg.c (mbrtowc):
9702         Assign to *pwc, and return 1 only if result is nonzero.
9703         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9704
9705 2000-07-03  Jim Meyering  <meyering@lucent.com>
9706
9707         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9708         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9709         From Bob Proulx.
9710
9711 2000-07-02  Jim Meyering  <meyering@lucent.com>
9712
9713         * quotearg.c (mbstate_t): Don't define here.
9714
9715 2000-07-02  Jim Meyering  <meyering@lucent.com>
9716
9717         * nanosleep.c (SIGCONT): Define if not already defined.
9718
9719 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9720
9721         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9722         per change in ../m4/ls-mntd-fs.m4.
9723         (read_filesystem_list): Ignore symbolic links.
9724
9725 2000-06-29  Jim Meyering  <meyering@lucent.com>
9726
9727         * same.c: Include <string.h> or <strings.h>, as appropriate,
9728         for declaration of strcmp.
9729
9730         * long-options.c: Include <stdlib.h>, for declaration of exit.
9731
9732         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9733         Avoid warning by casting result to `char *' to remove `const'.
9734
9735 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9736
9737         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9738
9739 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9740
9741         savedir now sets errno on failure and invokes xmalloc to get memory.
9742         Fix a couple of other minor bugs while we're at it.
9743
9744         * savedir.c (<unistd.h>): Do not include; there's no need.
9745         (NAMLEN): Remove macro.
9746         (malloc, realloc): Remove decls.
9747         (stpcpy): Likewise.
9748         ("xalloc.h"): Include.
9749         (NAME_SIZE_DEFAULT): New macro.
9750         (savedir): Use xmalloc / xrealloc to allocate memory.
9751         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9752         Skip "" directory entries.
9753         Use strlen to calculate directory entry length, since the old method
9754         is rarely used these days and isn't worth supporting.
9755         Don't use a pointer after freeing it.
9756         Check for integer overflow when calculating allocation size.
9757         Use memcpy to copy entries, instead of stpcpy.
9758         Set errno properly when returning NULL.
9759         Check for readdir error.
9760
9761 2000-06-26  Jim Meyering  <meyering@lucent.com>
9762
9763         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9764
9765 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9766
9767         * getusershell.c (xmalloc, xrealloc): Remove functions.
9768         Include xalloc.h.
9769         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9770
9771 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9772
9773         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9774
9775 2000-06-24  Jim Meyering  <meyering@lucent.com>
9776
9777         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9778
9779 2000-06-21  Jim Meyering  <meyering@lucent.com>
9780
9781         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9782
9783 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9784
9785         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9786         (mbrtowc, mbstate_t): Define substitutes if
9787         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9788         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9789         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9790
9791 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9792
9793         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9794         than 1024, return a memory chunk of least possible size, instead
9795         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9796         Use free/xmalloc instead of xrealloc to avoid copying for very long
9797         paths.
9798
9799 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9800
9801         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9802         address, not strdup.  Include <stdlib.h> and don't declare free().
9803
9804 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9805
9806         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9807         the empty string.
9808
9809 2000-06-21  Jim Meyering  <meyering@lucent.com>
9810
9811         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9812         (noinst_HEADERS): Add getstr.h.
9813
9814         * getline.c (getstr): Move into a separate file.
9815         * getstr.c (getstr): New file, extracted from getline.c, with
9816         the following changes: new parameter, delim2; both delim[12]
9817         parameters have type `int', not `char'.  The latter would lose
9818         with 8-bit delimiters.
9819         * getstr.h: New file.
9820
9821 2000-06-19  Jim Meyering  <meyering@lucent.com>
9822
9823         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9824
9825 2000-06-18  Jim Meyering  <meyering@lucent.com>
9826
9827         * mkdir.c: Remove file, due mainly to copyright incompatibility.
9828         Besides, these days every porting target provides a mkdir function.
9829
9830         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9831         (this snippet comes from src/system.h).
9832
9833 2000-06-15  Paul Eggert  <eggert@twinsun.com>
9834
9835         * human.c (adjust_value): New function.
9836         (human_readable_inexact): Apply rounding style even when
9837         printing approximate values.
9838
9839 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9840
9841         * human.c (human_readable_inexact): Allow an input block
9842         size that is not a multiple of the output block size, and vice versa.
9843         Reported by Piergiorgio Sartor.
9844
9845 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9846
9847         * getdate.y (get_date): Apply relative times after time
9848         zone indicator, not before.  Reported by Todd A. Jacobs.
9849
9850 2000-06-13  Jim Meyering  <meyering@lucent.com>
9851
9852         * Makefile.am (all-local): Depend on lstat.c and stat.c.
9853
9854         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9855
9856 2000-06-12  Paul Eggert  <eggert@twinsun.com>
9857
9858         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9859
9860 2000-06-04  Paul Eggert  <eggert@twinsun.com>
9861
9862         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9863
9864 2000-06-04  Jim Meyering  <meyering@lucent.com>
9865
9866         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9867         SunOS 4.1.4 for which gid_t is an unsigned type.
9868
9869 2000-06-03  Jim Meyering  <meyering@lucent.com>
9870
9871         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9872
9873 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
9874
9875         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9876         newer, don't install charset.alias.
9877         * config.charset: Change the Linux/glibc rules so they become empty
9878         on glibc-2.1 or newer.
9879
9880 2000-06-02  Jim Meyering  <meyering@lucent.com>
9881
9882         * mountlist.c: Back out last change.  Instead, do this...
9883         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9884         member using the same `ignore'-testing code.
9885         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9886         fs_type strings.
9887         From Mark D. Roth.
9888
9889 2000-05-29  Jim Meyering  <meyering@lucent.com>
9890
9891         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9892         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
9893
9894 2000-05-22  Jim Meyering  <meyering@lucent.com>
9895
9896         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9897
9898 2000-05-18  Jim Meyering  <meyering@lucent.com>
9899
9900         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9901         back, too, since it may have been modified by allocate_entry.
9902         (hash_delete): Rewrite to use neither the assignment operator
9903         nor the comma operator in an if-expression.
9904
9905 2000-05-15  Paul Eggert  <eggert@twinsun.com>
9906
9907         * closeout.c:
9908         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9909         Remove; no longer needed.
9910         "quotearg.h": Add include.
9911         (file_name): Do not bother to explicitly initialize to NULL; it's less
9912         efficient on some hosts.
9913         (close_stdout_status): Remove test as to whether stdout was already
9914         closed; it breaks for the case "echo x | sort >&-".
9915         Quote file name colons.
9916         Do not assume that _("write error") lacks format strings.
9917
9918 2000-05-15  Jim Meyering  <meyering@lucent.com>
9919
9920         * version-etc.c (version_etc_copyright): Update the copyright string
9921         used in all --version output.
9922
9923 2000-05-14  Jim Meyering  <meyering@lucent.com>
9924
9925         * closeout.c (close_stdout_set_file_name): New function.
9926         (close_stdout_status): Use new file-scoped global.
9927         Return right away if fstat says the stdout file descriptor is invalid.
9928         * closeout.h (close_stdout_set_file_name): Declare.
9929
9930 2000-05-10  Jim Meyering  <meyering@lucent.com>
9931
9932         * closeout.c [default_exit_status]: New file-scoped variable.
9933         (close_stdout_set_status): New function.
9934         * closeout.h (close_stdout_set_status): Declare.
9935
9936 2000-05-08  Jim Meyering  <meyering@lucent.com>
9937
9938         * long-options.c: Don't include closeout.h.
9939         (parse_long_options): Don't call close_stdout for --version.
9940
9941 2000-05-06  Jim Meyering  <meyering@lucent.com>
9942
9943         * strnlen.c: Undefine __strnlen and strnlen.
9944         [!weak_alias]: Define __strnlen to strnlen.
9945
9946         * atexit.c: New file, from libiberty.
9947
9948 2000-05-06  Jim Meyering  <meyering@lucent.com>
9949
9950         * closeout.c (close_stdout_status): Also check for errors on the
9951         stderr stream.
9952
9953 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
9954
9955         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9956         instead of xmalloc, xrealloc, path_concat.
9957         (locale_charset): Treat empty environment variables as absent.
9958         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9959
9960 2000-05-04  Jim Meyering  <meyering@lucent.com>
9961
9962         * getopt.c: Update from glibc.
9963         * obstack.c: Likewise.
9964         * obstack.h: Likewise.
9965         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
9966
9967         * regex.h: Likewise.
9968         * strndup.c: Likewise.
9969         * strnlen.c: New file, from glibc.
9970
9971 2000-05-01  Jim Meyering  <meyering@lucent.com>
9972
9973         * full-write.c (full_write): Remove `FIXME' part of comment.
9974
9975 2000-04-29  Jim Meyering  <meyering@lucent.com>
9976
9977         * path-concat.c: Declare strdup only if it's not defined.
9978         * canon-host.c: Likewise.
9979
9980 2000-04-28  Jim Meyering  <meyering@lucent.com>
9981
9982         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9983         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
9984         included first, then limits.h is included by locale.h by libintl.h.
9985         From John David Anglin.
9986
9987 2000-04-25  Jim Meyering  <meyering@lucent.com>
9988
9989         * makepath.c (S_IRWXUGO): Define.
9990         (make_path): Always perform explicit chmod if MODE specifies any
9991         of the `special' permission bits.  Prompted by a bug report against
9992         install from Mate Wierdl and Joost van Baal.
9993
9994 2000-04-18  Jim Meyering  <meyering@lucent.com>
9995
9996         * README: New file.
9997
9998         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9999         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10000
10001 2000-04-17  Jim Meyering  <meyering@lucent.com>
10002
10003         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10004         the definition of it to rpl_strftime also defined-away the system's
10005         declaration.
10006
10007 2000-04-15  Jim Meyering  <meyering@lucent.com>
10008
10009         Use `C' to denote so-called `contiguous' files, the same way
10010         that tar does.
10011         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10012         (ftypelet): Use S_ISCTG.
10013         From Michael Deutschmann.
10014
10015 2000-04-14  Jim Meyering  <meyering@lucent.com>
10016
10017         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10018
10019 2000-04-08  Jim Meyering  <meyering@lucent.com>
10020
10021         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10022         names don't conflict.  Reported by Eli Zaretskii.
10023
10024 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10025
10026         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10027         bug.  Deal with the different error behavior of Irix iconv.
10028
10029 2000-04-07  Jim Meyering  <meyering@lucent.com>
10030
10031         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10032         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10033
10034 2000-04-05  Jim Meyering  <meyering@lucent.com>
10035
10036         Portability tweaks required for ultrix4.3.
10037         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10038         * readutmp.c: Include sys/types.h before sys/stat.h.
10039         * canon-host.c: Declare strdup.
10040         * path-concat.c: Likewise.
10041         From John David Anglin.
10042
10043 2000-04-04  Jim Meyering  <meyering@lucent.com>
10044
10045         Be more DOS 8.3-friendly.
10046         * ref-add.sin: Renamed from ref-add.sed.in.
10047         * ref-del.sin: Renamed from ref-del.sed.in.
10048         * Makefile.am: Reflect renaming.
10049         Reported by Eli Zaretskii.
10050
10051         Use a temporary file name that won't clash with `charset.alias'
10052         in the DOS 8.3 name space.
10053         * Makefile.am (charset_tmp): Define.
10054         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10055         (uninstall-local): Likewise.
10056         Reported by Eli Zaretskii.
10057
10058 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10059
10060         * time/strftime.c (my_strftime): Make sure we call the system
10061         strftime, not ourselves, when invoking the underlying strftime.
10062
10063 2000-03-24  Jim Meyering  <meyering@lucent.com>
10064
10065         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10066         (charset_alias): Define.
10067         (install-exec-local): Factor out common code.
10068         (uninstall-local): Split lines longer than 80.
10069         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10070         (SUFFIXES): Define.
10071         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10072         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10073
10074 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10075
10076         * config.charset: Output a line containing "Packages using this file".
10077         * ref-add.sed.in, ref-del.sed.in: New files.
10078         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10079         ref-del.sed): New rules.
10080
10081 2000-03-17  Jim Meyering  <meyering@lucent.com>
10082
10083         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10084         Otherwise, include <strings.h>
10085
10086 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10087
10088         * unicodeio.c (utf8_wctomb): New function.
10089         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10090         format instead of in UCS-4 with platform dependent endianness.
10091
10092 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10093
10094         * savedir.c (savedir): Work even if directory size is
10095         negative; this can happen with some screwy NFS configurations.
10096
10097 2000-03-06  Jim Meyering  <meyering@lucent.com>
10098
10099         * localcharset.c (get_charset_aliases): Don't try to free file_name
10100         if it's NULL (because we ran out of memory).  From Bruno Haible.
10101
10102 2000-03-05  Jim Meyering  <meyering@lucent.com>
10103
10104         * localcharset.c ("path-concat.h"): Include.
10105         (get_charset_aliases): Use path_concat instead of ANSI string
10106         concatenation.
10107
10108         * unicodeio.h (PARAMS): Define.
10109         Use it to guard prototype.
10110
10111 2000-03-04  Jim Meyering  <meyering@lucent.com>
10112
10113         * Makefile.am (install-exec-local): Create $(libdir) before installing
10114         into it.
10115         (uninstall-local): Uncomment this rule so `make distcheck' works
10116         once again.
10117
10118         * unicodeio.c (<errno.h>): Include it.
10119         (errno): Declare if not defined.
10120
10121         * localcharset.c: Add Bruno's comment justifying use of volatile.
10122
10123         * config.charset: New version, incorporating remarks from a linux
10124         i18n mailing list.  From Bruno Haible.
10125
10126 2000-03-02  Jim Meyering  <meyering@lucent.com>
10127
10128         * Makefile.am (EXTRA_DIST): Add config.charset.
10129
10130 2000-03-01  Jim Meyering  <meyering@lucent.com>
10131
10132         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10133         * unicodeio.c: Likewise.
10134
10135 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10136
10137         * config.charset: New file.
10138         * localcharset.c: New file.
10139         * unicodeio.h, unicodeio.c: New files.
10140         * Makefile.am (DEFS): Add -DLIBDIR=...
10141         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10142         (noinst_HEADERS): Add unicodeio.h.
10143         (all-local, install-exec-local, charset.alias): New targets.
10144
10145 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10146
10147         * quotearg.c (ALERT_CHAR): New macro.
10148         (quotearg_buffer_restyled): Use it.
10149
10150 2000-02-27  Jim Meyering  <meyering@lucent.com>
10151
10152         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10153         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10154
10155         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10156         not `#if STDC_HEADERS'.
10157         Declare malloc if needed.
10158
10159         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10160         now that autoconf always defines the HAVE_DECL_ symbols.
10161         * human.c: Likewise.
10162         * same.c: Likewise.
10163         * strtoumax.c: Likewise.
10164
10165         * backupfile.c: Arrange for cpp to fail if the configure-time
10166         declaration check was not run.
10167         * hash.c: Likewise.
10168         * human.c: Likewise.
10169         * same.c: Likewise.
10170         * strtoumax.c: Likewise.
10171
10172         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10173         then first look up the entire `.'-containing string as a login name.
10174
10175 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10176
10177         * getdate.y: Handle two-digit years with leading zeros correctly.
10178         (textint): New typedef.
10179         (parser_control): Member year changed from int to textint.
10180         All uses changed.
10181         (YYSTYPE): Removed; replaced by %union with int and textint members.
10182         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10183         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10184         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10185         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10186         (date, number, to_year): Use width of number in digits, not its value,
10187         to determine whether it's a 2-digit year, or a 2-digit time.
10188         (yylex): Store number of digits of numeric tokens.
10189         Reported by John Kendall.
10190
10191         (parser_control): Changed from struct parser_control to typedef (for
10192         consistency).  All uses changed.
10193
10194         (tID): Removed; not used.
10195         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10196
10197 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10198
10199         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10200         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10201
10202 2000-02-12  Jim Meyering  <meyering@lucent.com>
10203
10204         * userspec.c (ISDIGIT): Define it.
10205         (isdigit): Remove definition.
10206         (is_number): Use ISDIGIT, not isdigit.
10207         <libintl.h>: Include.
10208         (_ and N_): Define.
10209         (parse_user_spec): Mark translatable strings.
10210
10211 2000-02-10  Jim Meyering  <meyering@lucent.com>
10212
10213         With these changes, nanosleep.[ch] are finally enough like the other
10214         lib/* replacement files to compile on a few more losing systems.
10215
10216         * nanosleep.h: Don't include config.h.
10217         Remove prototype from declaration of nanosleep.
10218         (PARAMS): Remove now-unneeded definition.
10219         * nanosleep.c: #undef nanosleep.
10220         (rpl_nanosleep): Rename from nanosleep.
10221
10222 2000-02-03  Jim Meyering  <meyering@lucent.com>
10223
10224         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10225         rather than with `#if HAVE_UTMPNAME'.
10226
10227 2000-02-01  Jim Meyering  <meyering@lucent.com>
10228
10229         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10230
10231 2000-01-31  Jim Meyering  <meyering@lucent.com>
10232
10233         * nanosleep.h (nanosleep): Guard declaration with
10234         `#if ! HAVE_DECL_NANOSLEEP'.
10235         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10236         the declaration in that vendor's sys/timers.h.
10237         Reported by Christian Krackowizer.
10238
10239         * quotearg.c (ISASCII): Add #undef and move definition to follow
10240         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10241         (ISPRINT): Likewise.
10242         Reported by Tom Tromey.
10243
10244 2000-01-30  Jim Meyering  <meyering@lucent.com>
10245
10246         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10247         uses of ->ut_name.  The latter doesn't work with new Linux header files
10248         where only utmpx.ut_user is declared.
10249
10250         * readutmp.h (UT_USER): Define.
10251
10252 2000-01-23  Jim Meyering  <meyering@lucent.com>
10253
10254         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10255         obstack.c.
10256
10257 2000-01-22  Jim Meyering  <meyering@lucent.com>
10258
10259         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10260         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10261         Required for some AIX systems.  Reported by Christian Krackowizer.
10262         [TESTING] (main): New function.
10263
10264         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10265         * dirname.c (dir_name): Support for DOS-style file names with drive
10266         letters.
10267
10268         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10269
10270         * strverscmp.c (ISDIGIT): Define.
10271         (strverscmp): Use ISDIGIT, not isdigit.
10272
10273 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10274
10275         * nanosleep.c (nanosleep):
10276         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10277         POSIX.1 doesn't require SA_INTERRUPT and some systems
10278         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10279         it's been part of POSIX.1 since day 1 (in 1988).
10280
10281 2000-01-17  Jim Meyering  <meyering@lucent.com>
10282
10283         * interlock: Remove unused file.  Reported by François Pinard.
10284
10285 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10286
10287         * quotearg.c (quotearg_buffer_restyled): Do not quote
10288         alert, backslash, formfeed, and vertical tab unnecessarily in
10289         shell quoting style.
10290
10291
10292 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10293 Free Software Foundation, Inc.
10294 Copying and distribution of this file, with or without modification,
10295 are permitted provided the copyright notice and this notice are preserved.