Use arpa_inet in inet_?to?.
[pspp] / lib / ChangeLog
1 2006-07-28  Simon Josefsson  <jas@extundo.com>
2
3         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
4         #include's.
5
6 2006-07-28  Bruno Haible <bruno@clisp.org>
7
8         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
9
10 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
11
12         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
13         arpa/inet.h.
14
15 2006-07-28  Bruno Haible  <bruno@clisp.org>
16
17         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
18         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
19         fallbacks.
20         Avoids link error on FreeBSD 4.x.
21         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
22
23         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
24         encoding.
25         * mbswidth.c (iswcntrl): Likewise.
26
27 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
28
29         * modechange.c (mode_compile): Numeric modes now affect setuid and
30         setgid on directories only if they set these bits.
31         * modechange.h: Remove obsolete comment about masks.
32
33 2006-07-27  Bruno Haible  <bruno@clisp.org>
34
35         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
36         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
37         defined.
38
39 2006-07-26  Eric Blake  <ebb9@byu.net>
40
41         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
42         like mingw that lack mkstemp.
43         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
44         avoid compilation warning on mingw.
45
46 2006-07-25  Bruno Haible  <bruno@clisp.org>
47
48         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
49         <stdarg.h> or config.h.
50
51 2006-07-24  Bruno Haible  <bruno@clisp.org>
52
53         * clean-temp.h: New file, from GNU gettext.
54         * clean-temp.c: New file, from GNU gettext.
55
56 2006-07-24  Bruno Haible  <bruno@clisp.org>
57
58         * tmpdir.h: New file, from GNU gettext.
59         * tmpdir.c: New file, from GNU gettext.
60
61 2006-07-23  Bruno Haible  <bruno@clisp.org>
62
63         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
64         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
65         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
66         gl_linked_remove_at): Use it.
67
68 2006-07-23  Eric Blake  <ebb9@byu.net>
69
70         * tmpfile-safer.c: New file.
71         * stdio-safer.h (fopen_safer): Add prototype.
72         * stdio--.h (tmpfile): Make safer.
73
74 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
75
76         * close-stream.c, close-stream.h: New files.
77
78 2006-07-22  Bruno Haible  <bruno@clisp.org>
79
80         Merge from GNU gettext 0.15.
81
82         2005-07-05  Bruno Haible  <bruno@clisp.org>
83
84                 * printf-args.c (printf_fetchargs): Work around broken
85                 definition of wint_t on mingw.
86
87         2005-02-12  Bruno Haible  <bruno@clisp.org>
88
89                 * xallocsa.h: Add extern "C" for C++.
90
91         2006-05-17  Bruno Haible  <bruno@clisp.org>
92
93                 Cygwin portability.
94                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
95
96         2006-04-30  Bruno Haible  <bruno@clisp.org>
97
98                 * progreloc.c: Include <mach-o/dyld.h> if available.
99                 (find_executable): Use _NSGetExecutablePath when possible.
100
101         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
102
103                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
104                 function.
105
106         2005-12-29  Bruno Haible  <bruno@clisp.org>
107
108                 * progreloc.c (set_program_name_and_installdir): Fix
109                 compilation error.
110
111         2005-12-04  Bruno Haible  <bruno@clisp.org>
112
113                 Cygwin portability.
114                 * progreloc.c: Include <windows.h> also on Cygwin.
115                 (find_executable): Add support for Cygwin.
116                 (set_program_name_and_installdir): Handle also platforms with
117                 nonempty EXEEXT.
118
119         2006-07-11  Bruno Haible  <bruno@clisp.org>
120
121                 * javacomp.c: Fix a comment.
122                 Reported by Jim Meyering.
123
124         2006-04-30  Bruno Haible  <bruno@clisp.org>
125
126                 * javacomp.h (compile_java_class): Add source_version,
127                 target_version arguments.
128                 * javacomp.c: Rewritten to choose only a compiler that
129                 respects the specified source_version and target_version.
130
131         2006-06-27  Bruno Haible  <bruno@clisp.org>
132
133                 Assume correct S_ISDIR macro.
134                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
135
136         2006-07-22  Bruno Haible  <bruno@clisp.org>
137
138                 * javaversion.h: New file, from GNU gettext.
139                 * javaversion.c: New file, from GNU gettext.
140                 * javaversion.java: New file, from GNU gettext.
141                 * javaversion.class: New file, from GNU gettext.
142
143         2006-05-17  Bruno Haible  <bruno@clisp.org>
144
145                 Cygwin portability.
146                 * javaexec.c (execute_java_class): Test for jview program
147                 also on Cygwin.
148
149         2006-04-09  Bruno Haible  <bruno@clisp.org>
150
151                 * fatal-signal.c: Don't include string.h.
152                 (at_fatal_signal): Use a copying loop instead of memcpy.
153
154         2005-12-04  Bruno Haible  <bruno@clisp.org>
155
156                 * csharpexec.c: Add support for 'clix' launcher (untested).
157                 (execute_csharp_using_sscli): New function.
158                 (execute_csharp_program): Call it.
159
160         2006-06-21  Bruno Haible  <bruno@clisp.org>
161
162                 Avoid warnings from recent versions of mcs.
163                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
164                 -o, -L, -r any more. Use options documented since mcs-1.0
165                 instead. Similarly for -g.
166
167         2005-07-09  Bruno Haible  <bruno@clisp.org>
168
169                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
170                 add a .dll suffix.
171                 Reported by Mark Junker <mjscod@gmx.de>.
172
173         2006-06-17  Bruno Haible  <bruno@clisp.org>
174
175                 * config.charset: Update for NetBSD 3.0.
176
177         2006-05-17  Bruno Haible  <bruno@clisp.org>
178
179                 Cygwin portability.
180                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
181
182         2006-05-16  Bruno Haible  <bruno@clisp.org>
183
184                 * localcharset.c [CYGWIN]: Include <windows.h>.
185                 (get_charset_aliases): For Cygwin, return the same CPxxx
186                 aliases list as under WIN32.
187                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
188                 the environment variables. Fall back to GetACP().
189
190         2006-04-05  Bruno Haible  <bruno@clisp.org>
191
192                 * config.charset: Update Juan Manuel Guerrero's address.
193
194         2005-02-12  Bruno Haible  <bruno@clisp.org>
195
196                 * allocsa.h: Add extern "C" for C++.
197
198         2005-02-10  Bruno Haible  <bruno@clisp.org>
199
200                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
201                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
202
203         2006-07-22  Bruno Haible  <bruno@clisp.org>
204
205                 * gettext.h: Update to GNU gettext-0.15.
206
207 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
208         and Simon Josefsson <jas@extundo.com>
209
210         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
211
212         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
213
214 2006-07-21  Eric Blake  <ebb9@byu.net>
215
216         * stdlib-safer.h: New file from coreutils, required by
217         stdlib--.h.
218
219 2006-07-19  Derek R. Price  <derek@ximbiot.com>
220
221         * getaddrinfo.h: Don't define unimplemented AI_* flags.
222         Reindent and repaginate.
223
224 2006-07-17  Bruno Haible  <bruno@clisp.org>
225
226         * gl_list.h: New file.
227         * gl_list.c: New file.
228         * gl_array_list.h: New file.
229         * gl_array_list.c: New file.
230         * gl_carray_list.h: New file.
231         * gl_carray_list.c: New file.
232         * gl_linked_list.h: New file.
233         * gl_linked_list.c: New file.
234         * gl_anylinked_list1.h: New file.
235         * gl_anylinked_list2.h: New file.
236         * gl_avltree_list.h: New file.
237         * gl_avltree_list.c: New file.
238         * gl_anyavltree_list1.h: New file.
239         * gl_anyavltree_list2.h: New file.
240         * gl_rbtree_list.h: New file.
241         * gl_rbtree_list.c: New file.
242         * gl_anyrbtree_list1.h: New file.
243         * gl_anyrbtree_list2.h: New file.
244         * gl_anytree_list1.h: New file.
245         * gl_anytree_list2.h: New file.
246         * gl_linkedhash_list.h: New file.
247         * gl_linkedhash_list.c: New file.
248         * gl_anyhash_list1.h: New file.
249         * gl_anyhash_list2.h: New file.
250         * gl_avltreehash_list.h: New file.
251         * gl_avltreehash_list.c: New file.
252         * gl_rbtreehash_list.h: New file.
253         * gl_rbtreehash_list.c: New file.
254         * gl_anytreehash_list1.h: New file.
255         * gl_anytreehash_list2.h: New file.
256
257         * gl_oset.h: New file.
258         * gl_oset.c: New file.
259         * gl_array_oset.h: New file.
260         * gl_array_oset.c: New file.
261         * gl_avltree_oset.h: New file.
262         * gl_avltree_oset.c: New file.
263         * gl_rbtree_oset.h: New file.
264         * gl_rbtree_oset.c: New file.
265         * gl_anytree_oset.h: New file.
266
267 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
268
269         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
270         New files.
271         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
272         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
273         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
274         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
275         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
276         callers changed.  Revamp internals significantly, by not
277         attempting to create directories that are temporarily more
278         permissive than the final results.  Do not attempt to use
279         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
280         This removes some race conditions, fixes some bugs, and simplifies
281         things.  Use new dirchownmod function to do owner and mode changes.
282         * mkdir-p.h: Likewise.
283         * modechange.c (octal_to_mode): New function.
284         (struct mode_change): New member mentioned.
285         (make_node_op_equals): New arg mentioned.  All callers changed.
286         (mode_compile): Keep track of which mode bits the user has explicitly
287         mentioned.
288         (mode_adjust): New arg DIR, so that we implement the X op correctly.
289         New arg PMODE_BITS, to keep track of which mode bits the user
290         mentioned; it treats S_ISUID and S_ISGID speciall.
291         All callers changed.
292         * modechange.h: Likewise.
293
294 2006-07-11  Derek R. Price  <derek@ximbiot.com>
295
296         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
297
298 2006-07-10  Derek R. Price  <derek@ximbiot.com>
299
300         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
301         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
302         macros into the GNU _D_EXACT_NAMLEN.
303         * savedir.c:  Likewise.
304         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
305
306 2006-07-09  Jim Meyering  <jim@meyering.net>
307
308         * argp-pv.c: Remove a doubled word in a comment.
309         * check-version.c (check_version): Likewise.
310         * javacomp.c (compile_java_class): Likewise.
311
312 2006-07-08  Jim Meyering  <jim@meyering.net>
313
314         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
315
316 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
317
318         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
319         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
320         brackets.  Other minor changes to suppress some compiler
321         warnings.
322
323 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
324
325         * getloadavg.c: Use __VMS, not VMS.
326         * getopt.c: Likewise.
327         * getpagesize.h: Likewise.
328         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
329         probably does not work.
330
331 2006-07-06  Derek R. Price  <derek@ximbiot.com>
332         and Paul Eggert  <eggert@cs.ucla.edu>
333
334         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
335         Don't worry about this obsolete case any more.
336         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
337         directories.
338         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
339         worry about this obsolete case any more.
340         * fts.c: Likewise.
341         * getcwd.c: Likewise.
342         * glob.h: Likewise.
343         * savedir.c: Likewise.
344
345 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
346
347         * .cppi-disable: Add wcwidth.
348         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
349         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
350         (ISGRAPH): Remove.  All uses changed to isgraph.
351         (FOLD) [!defined _LIBC]: Remove special case.
352         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
353         * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
354         HAVE_ISBLANK.
355         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
356
357 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
358
359         * strtod.c (strtod): cast the argument of tolower to unsigned char.
360
361 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
362
363         * memcasecmp.c: Include <limits.h>.
364         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
365         * strtod.c (strtod): Don't assume isspace works on negative chars.
366         Don't assume isdigit succeeds only on '0' through '9'.
367
368 2006-07-05  Derek R. Price  <derek@ximbiot.com>
369
370         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
371         All uses of is_space replaced by isspace.
372         * exit.h: Don't talk about STDC_HEADERS.
373         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
374         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
375         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
376         replaced by isprint etc.
377         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
378         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
379         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
380         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
381         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
382         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
383
384 2006-07-05  Eric Blake  <ebb9@byu.net>
385
386         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
387         missing from netdb.h.
388         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
389
390 2006-06-27  Bruno Haible  <bruno@clisp.org>
391
392         Assume ANSI C header files and <ctype.h> functions.
393         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
394         (mbsnwidth): Use isprint, iscntrl instead.
395
396 2006-07-03  Jim Meyering  <jim@meyering.net>
397
398         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
399         macro is used before the first cycle_check call.
400
401 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
402
403         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
404         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
405         reported by Mark D. Baushke, one in
406         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
407
408         Merge from coreutils.
409
410         * .cppi-disable: Add stdint_.h.
411         * .cvsignore: Add stdint.h.
412
413         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
414
415         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
416         both double and long double versions.
417         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
418         * xstrtold.c: New file.
419         * xstrtod.h (xstrtold): New decl.
420
421         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
422
423         * filemode.c (setst): Remove.
424         (strmode): Rewrite to avoid setst.  This makes the code shorter,
425         (arguably) clearer, and the generated code is a bit smaller on my
426         Debian GNU/Linux stable x86 host.
427
428         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
429
430         * filemode.c: Include "filemode.h" first, to test the interface.
431         Assume that filemode.h includes sys/types.h and sys/stat.h.
432         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
433         (ftypelet): Reorder to put common cases first, for efficiency.
434         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
435         to do 'M'.
436         (strmode): Renamed from mode_string, and now stores 12 bytes instead
437         of 10, for compatibility with FreeBSD.  All callers changed.
438         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
439         that can't be deduced solely from st_mode.  First arg is now a const
440         pointer.
441         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
442         (strmode): Renamed from mode_string.
443         (filemodestring): New decl.
444         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
445         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
446         (S_ISPORT, S_ISWHT): New macros, if not already defined.
447
448         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
449
450         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
451         fsusage.h now does that.  Include fsusage.h first, to test interface.
452         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
453         at most one method (the old code could have generated decls that
454         didn't conform to C89, not that this was ever exercised).
455         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
456
457         2006-03-19  Jim Meyering  <jim@meyering.net>
458
459         Work even in a chroot where d_ino values for entries in "/"
460         don't match the stat.st_ino values for the same names.
461         * getcwd.c (__getcwd): When no d_ino value matches the target inode
462         number, iterate through all entries again, using lstat instead.
463         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
464         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
465
466         * getcwd.c (__getcwd): Clarify a comment.
467         Use memcpy in place of a call to strcpy.
468
469         2006-03-12  Jim Meyering  <jim@meyering.net>
470
471         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
472         that of the current directory (which we're about to chdir ".." out of),
473         then save the dev-ino of the parent, instead.
474
475         * same-inode.h (SAME_INODE): New file/macro.
476         * chdir-safer.c (SAME_INODE): Remove definition.
477         Include "same-inode.h", instead.
478         * same.c: Likewise.
479         * cycle-check.h: Include "same-inode.h".
480         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
481         * cycle-check.c (SAME_INODE): Remove definition.
482         * root-dev-ino.h: Include "same-inode.h".
483
484         2006-03-11  Eric Blake  <ebb9@byu.net>
485
486         * same.c (same_name): s/base_name/last_component/
487         * backupfile.c (check_extension, numbered_backup): Likewise.
488         * filenamecat.c (file_name_concat): Likewise.
489
490         2006-03-11  Eric Blake  <ebb9@byu.net>,
491                     Paul Eggert  <eggert@cs.ucla.edu>
492
493         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
494         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
495         drive prefix.
496         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
497         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
498         (last_component): New method.
499         * dirname.c (dir_len): Determine when drive letters need a
500         subsequent slash.  Preserve // when it is special.
501         (dir_name): Don't append dot when drive letter is absolute.
502         [TEST_DIRNAME]: Move into a full-blown gnulib test.
503         * basename.c (base_name): New semantics - malloc the result.
504         Preserve // when it is special.  Preserve relative files that look
505         like drive letters.
506         (base_len): Preserve // when it is special.
507         (last_component): New method, similar to old base_name semantics.
508         * stripslash.c (strip_trailing_slashes): Use last_component, not
509         base_name.  Strip redundant slashes from ///.
510
511 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
512
513         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
514         both are 64 bits, since this seems to be the tradition, and this
515         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
516         we ever run into a host that prefers long long to long in this
517         case, we'll need another configure-time test.  Problem reported by
518         Jim Meyering.
519
520 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
521
522         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
523         possible collision with system files.
524         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
525         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
526         WCHAR_MIN and WCHAR_MAX in this case.
527         (<stddef.h>): Do not include; no longer needed.
528         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
529         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
530         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
531         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
532         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
533         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
534         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
535         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
536         !defined(__c99))]: Include in this case too, since it's harmless
537         now.
538         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
539         dangerous to do so.
540         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
541         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
542         (_STDINT_MIN, _STDINT_MAX): New macros.
543         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
544         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
545         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
546         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
547         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
548         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
549         macros, not typedefs; this simplifies things quite a bit.
550         Use long int for all types narrower than int64_t.
551         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
552         Define in terms of long long int or int64_t or long int,
553         not int64_t or int32_t.  This saves some compile-time testing.
554         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
555         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
556         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
557         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
558         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
559         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
560         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
561         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
562         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
563         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
564         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
565         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
566         undef any previous version and define our own version, for
567         simplicity and consistency with the new macros for types.
568         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
569         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
570         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
571         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
572         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
573         @WINT_T_SUFFIX@ to keep things simple here.
574         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
575         Simplify by assuming typical 8/16/32/64 host, since we're
576         already doing that elsewhere anyway.
577         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
578         and assume long long int is 64 bits if available.  This
579         speeds up 'configure'.
580
581 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
582
583         * getaddrinfo.c: fixed typo
584
585 2006-06-29  Eric Blake  <ebb9@byu.net>
586
587         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
588         unused static function.
589
590 2006-06-29  Eric Blake  <ebb9@byu.net>
591
592         * stat_.h: New file.
593
594 2006-06-29  Derek R. Price  <derek@ximbiot.com>
595
596         * strftime.c: Assume strftime() exists.
597
598 2006-06-28  Bruno Haible  <bruno@clisp.org>
599
600         * getaddrinfo.h: Fix POSIX URL.
601         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
602         (use_win32_p): Make static.
603         (getaddrinfo): Reject service name if it is empty or does not consist
604         solely of decimal digits, or if its value is > 65535.
605         (getnameinfo): Remove useless casts.
606
607 2006-06-28  Derek R. Price  <derek@ximbiot.com>
608
609         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
610         Autoconf 2.60 says this stuff was obsolete.
611
612 2006-05-12  Bruno Haible  <bruno@clisp.org>
613
614         * mkdtemp.c [MINGW]: Include <io.h>.
615         (mkdir): Define using _mkdir.
616
617 2006-06-28  Bruno Haible  <bruno@clisp.org>
618
619         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
620         declaration for wcwidth.
621         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
622
623 2006-06-28  Eric Blake  <ebb9@byu.net>
624
625         * xvasprintf.h: Fix comments.
626
627 2006-06-28  Eric Blake  <ebb9@byu.net>
628
629         * mbchar.h (wcwidth): Include wcwidth.h.
630         * mbswidth.c (wcwidth): Move from here...
631         * wcwidth.h: ...to this new file.
632
633 2006-06-28  Simon Josefsson  <jas@extundo.com>
634
635         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
636         functions there.  It will succeed on Windows XP, but on Windows
637         2000 and (presumably) earlier, it will fail, and use the internal
638         re-implementation.
639         (use_win32_p): New function.
640         (getaddrinfo): Use strtoul on servname, to support numeric ports.
641         Support AI_NUMERICSERV to disable getservbyname.
642         (getnameinfo): New function, only supports
643         NI_NUMERICHOST|NI_NUMERICSERV for now.
644
645         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
646         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
647         getnameinfo.
648
649 2006-06-27  Bruno Haible  <bruno@clisp.org>
650
651         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
652
653 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
654
655         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
656         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
657         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
658
659 2006-06-26  Bruno Haible  <bruno@clisp.org>
660
661         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
662         WCHAR_MAX.
663         Reported by Mark D. Baushke and Larry Jones.
664
665 2006-06-26  Bruno Haible  <bruno@clisp.org>
666
667         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
668         in pre-C99 mode.
669         Suggested by Mark D. Baushke and Larry Jones.
670
671 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
672
673         * stdint_.h: Treat BSD/OS like OpenBSD.
674
675 2006-06-23  Bruno Haible  <bruno@clisp.org>
676
677         * stdint_.h: Treat IRIX like OpenBSD.
678
679 2006-06-23  Bruno Haible  <bruno@clisp.org>
680
681         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
682         ISO C 99 Technical Corrigendum 1.
683
684 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
685
686         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
687         Some compiler complained about some of them.  Problem reported by
688         Larry Jones in
689         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
690
691 2006-06-21  Simon Josefsson  <jas@extundo.com>
692
693         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
694         variable.
695
696         * socket_.h: Don't define WINVER.
697
698         * inet_pton.h, inet_pton.c: New file, taken from glibc but
699         slightly modified to work in gnulib.
700
701 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
702
703         * read-file.c (fread_file): Start with buffer allocation of
704         0 bytes rather than 1 byte; this simplifies the code.
705         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
706         code to free buffer and save/restore errno.
707         (internal_read_file): Remove unused local.
708
709 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
710
711         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
712         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
713         Problem reported by Denis Excoffier in
714         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
715
716 2006-06-19  Simon Josefsson  <jas@extundo.com>
717
718         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
719
720 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
721
722         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
723
724 2006-06-17  Bruno Haible  <bruno@clisp.org>
725
726         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
727
728 2006-06-17  Bruno Haible  <bruno@clisp.org>
729
730         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
731         problem on Solaris 2.5.1.
732
733 2006-06-16  Eric Blake  <ebb9@byu.net>
734
735         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
736         * unicodeio.c [!defined errno]: Likewise.
737         * strtol.c [!defined errno]: Likewise.
738         * strtod.c [!defined errno]: Likewise.
739
740 2006-06-15  Bruno Haible  <bruno@clisp.org>
741
742         * stdint_.h: Rewritten to be fully auto-configured.
743         Fixes bug on HP-UX/IA64.
744
745 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
746
747         * getdate.y (__attribute__): Don't define if already defined.
748         Problem reported by Larry Jones.
749         * utimens.c (__attribute__): Likewise.
750
751 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
752
753         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
754         reported by Andreas Schwab.
755
756 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
757             Bruno Haible  <bruno@clisp.org>
758
759         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
760
761 2006-05-26  Martin Lambers  <marlam@marlam.de>
762
763         * getpass.c: Updates the test for the native W32 API, and adds
764         missing includes, thus fixing compilation warnings.
765
766 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
767
768         * tempname.c (small_open, large_open): New macros.
769         (__open, __open64) [!_LIBC]: Remove.
770         (__gen_tempname): Use small_open and large_open instead of __open
771         and __open64.  This fixes a portability bug on HP-UX 11.11i
772         reported by Simon Wing-Tang in
773         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
774
775 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
776
777         * exclude.c (exclude_fnmatch): New function.
778         (excluded_file_name): Call exclude_fnmatch.
779         * exclude.h (excluded_file_name): New prototype
780
781 2006-05-24  Bruno Haible  <bruno@clisp.org>
782
783         * printf-args.c (printf_fetchargs): Turn NULL pointers for
784         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
785         Reported by Thorsten Maerz <torte@netztorte.de> via
786         Aaron Stone <aaron@serendipity.cx>.
787
788 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
789
790         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
791         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
792         (my_usleep): Don't mishandle maximum value.
793
794 2006-05-19  Jim Meyering  <jim@meyering.net>
795
796         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
797
798 2006-05-17  Bruno Haible  <bruno@clisp.org>
799
800         Cygwin portability.
801         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
802
803 2006-05-17  Bruno Haible  <bruno@clisp.org>
804
805         * stdint_.h: Fix recognition of Cygwin.
806
807 2006-05-11  Jim Meyering  <jim@meyering.net>
808
809         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
810
811 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
812
813         * crc.c (crc32_update): Remove unnecessary L suffix.
814         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
815         unwanted sign propagation, e.g., on hosts with 64-bit int.
816         There still are some problems with reeelly weird theoretical hosts
817         (e.g., 33-bit int) but it's not worth worrying about now.
818         * sha1.c (rol): Likewise.
819         (K1, K2, K3, K4): Remove unnecessary L suffix.
820
821 2006-05-10  Bruno Haible  <bruno@clisp.org>
822
823         * des.c: Cast to avoid warnings.
824
825 2006-05-10  Simon Josefsson  <jas@extundo.com>
826
827         * md4.c: Typo fix, update copyright years.
828         (K1, K2): Don't use L because it turn computations into 64-bit on
829         64-bit platforms.
830
831 2006-05-09  Bruno Haible  <bruno@clisp.org>
832
833         * xvasprintf.c: Include limits.h, string.h, xsize.h.
834         (EOVERFLOW): Define fallback value.
835         (xstrcat): New function.
836         (xvasprintf): Recognize the special case of a string concatenation.
837
838 2006-05-01  Bruno Haible  <bruno@clisp.org>
839
840         * stdint_.h: Shorter URL.
841         * inttypes.h: Likewise.
842
843 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
844
845         * verify.h: Document the internals better.  Most of this change
846         was written by Bruno Haible.
847
848 2006-04-29  Bruno Haible  <bruno@clisp.org>
849
850         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
851         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
852
853 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
854
855         * getdate.y (get_date): When adding relative date, start with the
856         initial time, not with the result of the first mktime call.
857
858 2006-04-23  Bruno Haible  <bruno@clisp.org>
859
860         * copy-file.c: Include <unistd.h> unconditionally.
861         * execute.c: Likewise.
862         * fatal-signal.c: Likewise.
863         * findprog.c: Likewise.
864         * mkdtemp.c: Likewise.
865         * pipe.h: Likewise.
866         * pipe.c: Likewise.
867         * wait-process.h: Likewise.
868
869 2006-04-23  Bruno Haible  <bruno@clisp.org>
870
871         * fwriteerror.c (fwriteerror): Call fclose also when an error
872         condition was already detected.
873         Reported by Ben Pfaff <blp@cs.stanford.edu>.
874
875 2006-04-19  Derek Price  <derek@ximbiot.com>
876             Eric Blake  <ebb9@byu.net>
877
878         * inttypes.h: Correct grammar in comment.
879
880 2006-04-18  Derek Price  <derek@ximbiot.com>
881             Paul Eggert  <eggert@cs.ucla.edu>
882
883         * inttypes.h: New file.
884         * strtoimax.c: Assume <inttypes.h>.
885
886 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
887
888         * utimens.c (futimens): glibc futimesat messes up if /proc
889         isn't mounted.  Problem reported by Kir Kolyshkin.
890
891 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
892
893         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
894         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
895         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
896
897 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
898
899         Merge regex changes from libc, removing some of our
900         POSIX-conformance changes that were rejected and redoing them in a
901         less-intrusive way.
902
903         * regcomp.c (re_compile_internal, init_dfa):
904         Length arg is now size_t, not Idx.  All uses changed.
905         (peek_token): Forward decl now says internal_function.
906         (__re_error_msgid, __re_error_msgid_idx):
907         Now static rather than extern with attribute_hidden.
908         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
909         For some reason libc prefers K&R style defns for external functions.
910         (regerror) [!defined _LIBC]: Likewise.
911         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
912         (seek_collating_symbol_entry, lookup_collation_sequence_value):
913         (build_range_exp, build_collating_symbol):
914         Use K&R-style defn.
915         (re_compile_fastmap): Use '\0' to memset, not 0.
916         (utf8_sb_map): Make the calculations more obvious.
917         (init_dfa, parse_bracket_exp, build_charclass_op):
918         Call calloc and cast result, as glibc does.
919         (init_word_char, fetch_token, peek_token, peek_token_bracket):
920         (build_range_exp, build_collating_symbol):
921         Now internal functions.
922
923         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
924
925         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
926         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
927         Don't depend on VMS; depend on __VMS instead, for POSIX
928         namespace cleanness.
929         (regoff_t): Define to ssize_t, not long int.
930
931         Remove the REG_ macros named below.  Instead, make the old names
932         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
933         __USE_GNU_REGEX.
934         (REG_BACKSLASH_ESCAPE_IN_LISTS):
935         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
936         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
937         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
938         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
939         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
940         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
941         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
942         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
943         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
944         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
945         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
946         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
947         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
948         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
949         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
950         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
951         (REG_NREGS):
952         Remove.  All uses replaced by the old RE_* names.
953         (RE_BACKSLASH_ESCAPE_IN_LISTS):
954         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
955         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
956         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
957         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
958         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
959         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
960         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
961         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
962         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
963         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
964         Don't bother having these macros be independent of each others'
965         values, since they no longer exist in the POSIX name space.
966
967         Rename the following member names back to their old names,
968         unless !__USE_GNU_REGEX.  All uses changed back.
969         (buffer): Renamed from re_buffer.
970         (allocated): Renamed from re_allocated.
971         (used): Renamed from re_used.
972         (syntax): Renamed from re_syntax.
973         (fastmap): Renamed from re_fastmap.
974         (translate): Renamed from re_translate.
975         (can_be_null): Renamed from re_can_be_null.
976         (regs_allocated): Renamed from re_regs_allocated.
977         (fastmap_accurate): Renamed from re_fastmap_accurate.
978         (no_sub): Renamed from re_no_sub.
979         (not_bol): Renamed from re_not_bol.
980         (not_eol): Renamed from re_not_eol.
981         (newline_anchor): Renamed from re_newline_anchor.
982         (num_regs): Renamed from rm_num_regs.
983         (start): Renamed from rm_start.
984         (end): Renamed from rm_end.
985
986         (free_state): Move up a bit.
987
988         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
989         #define to be empty.
990         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
991         when that is what is intended.
992         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
993         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
994         (MAX): New macro.
995         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
996         All uses changed back to re_malloc, etc.  It's now the caller's
997         responsibility to check for overflow; all callers changed.
998         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
999         (re_x2nrealloc): Remove.
1000         (free_state): Remove decl.
1001
1002         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1003         (re_set_registers, re_exec):
1004         Use K&R-style defn.
1005
1006         2006-01-31  Roland McGrath  <roland@redhat.com>
1007
1008         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1009         Reported by Mike Frysinger <vapier@gentoo.org>.
1010
1011         2006-01-15  Andreas Jaeger  <aj@suse.de>
1012
1013         [BZ #1950]
1014         * regex_internal.c (re_string_reconstruct): Adjust for
1015         build_wcs_upper_buffer change.
1016         (build_wcs_upper_buffer): Change return type.
1017
1018         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1019
1020         * regex_internal.h: Include <stdint.h> if available.
1021
1022         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1023
1024         * regex_internal.h (SIZE_MAX): Provide a default definition.
1025
1026         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1027
1028         * regcomp.c: Adjust for changed secondary hash function.
1029
1030         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1031
1032         * regex.h: Pretty printing.
1033         Clean up namespace a bit.
1034
1035         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1036
1037         * regexec.c (update_cur_sifted_state, check_arrival,
1038         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1039
1040         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1041                     Ulrich Drepper  <drepper@redhat.com>
1042
1043         [BZ #1302]
1044         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1045         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1046
1047         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1048
1049         [BZ #281]
1050         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1051         * regcomp.c: Remove unnecessary uses of
1052         unsigned RE_TRANSLATE_TYPE.
1053         * regex_internal.h: Likewise.
1054         * regex_internal.c: Likewise.
1055         * regexec.c: Likewise.
1056         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1057
1058         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1059
1060         * regexec.c (find_recover_state): Remove unnecessary
1061         initialization.
1062         (transit_state_bkref): Make DFA a const pointer.
1063         (get_subexp): Likewise.
1064         (check_arrival): Likewise.
1065         (update_cur_sifted_state): Likewise.
1066         (re_search_internal): Likewise.
1067         (prune_impossible_nodes): Likewise.
1068         (acquire_init_state_context): Likewise.
1069         (proceed_next_node): Likewise.
1070         (set_regs): Likewise.
1071         (free_fail_stack_return): Likewise.
1072         (check_arrival_expand_ecl): Mark DFA parameter as const.
1073         (check_arrival_expand_ecl_sub): Likewise.
1074         (check_subexp_limits): Likewise.
1075         (sub_epsilon_src_nodes):  Likewise.
1076         (add_epsilon_src_nodes):  Likewise.
1077         (merge_state_array): Likewise.
1078         (update_regs): Likewise.
1079         (build_trtable): Likewise.
1080         (sift_states_backward): Mark MCTX parameter as const.
1081         (build_sifted_states): Likewise.
1082         (update_cur_sifted_state): Likewise.
1083         (sift_states_mkref): Likewise.
1084         (check_arrival_expand_ecl): Mark eclosure as const.
1085         (check_dst_limits_calc_pos_1): Likewise.
1086         * regex_internal.h (re_match_context_t): Make dfa a const
1087         pointer.
1088
1089         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1090
1091         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1092         (transit_state_sb): Likewise.
1093         (transit_state_mb): Likewise.
1094         (sift_states_iter_mb): Likewise.
1095         (check_arrival_add_next_nodes): Likewise.
1096         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1097         [_LIBC] (re_search_2_stub): Use mempcpy.
1098
1099         * regex_internal.c (re_string_reconstruct): Avoid calling
1100         mbrtowc for very simple UTF-8 case.
1101
1102         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1103         a pointer-to-const.
1104         (re_acquire_state_context): Likewise.
1105         * regex_internal.h: Adjust prototypes.
1106
1107         * regex.c: Prevent using C++ compilers.
1108
1109         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1110         (re_acquire_state_context): Likewise.
1111
1112 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1113             Bruno Haible  <bruno@clisp.org>
1114
1115         * stdint_.h: On OpenBSD, don't redefine types already included in
1116         <sys/types.h> and <inttypes.h>.
1117
1118 2006-03-24  Eric Blake  <ebb9@byu.net>
1119
1120         * time_r.c (copy_string_result): Remove, as it is no longer used.
1121
1122 2006-03-24  Simon Josefsson  <jas@extundo.com>
1123
1124         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1125         including some doc fixes.
1126         (base64_encode_alloc): Fix +1 bug on allocation failures.
1127
1128 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1129
1130         * base64.c (base64_encode): Do not read past end of array with
1131         unsanitized input on systems with CHAR_BIT > 8.
1132
1133 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1134
1135         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1136         Typedef to long int, not to off_, as POSIX will likely change
1137         in that direction.
1138
1139 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1140
1141         * argp-help.c (validate_uparams): Fix typo
1142         * argp-parse.c (argp_default_options): Consistently begin help
1143         messages with a lowercase letter.
1144
1145 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1146
1147         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1148         overrun buffers and shouldn't be used (much as gets shouldn't be
1149         used).
1150         * time_r.c (asctime_r, ctime_r): Likewise.
1151
1152 2006-03-08  Simon Josefsson  <jas@extundo.com>
1153
1154         * gc-gnulib.c (randomize): Don't open files called 'no', they
1155         signal that configure disabled the device.
1156
1157 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1158
1159         * c-stack.c: Include unistd.h unconditionally, since we now assume
1160         the unistd module.
1161         * getlogin_r.c: Likewise.
1162         * getlogin_r.h: Likewise.
1163         * glob.c: Likewise.
1164         * pagealign_alloc.c: Likewise.
1165         * unistd_.h: Remove; no longer needed.
1166
1167 2006-03-07  Simon Josefsson  <jas@extundo.com>
1168
1169         * unistd_.h: New file.
1170
1171 2006-03-07  Simon Josefsson  <jas@extundo.com>
1172
1173         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1174
1175 2006-03-01  Simon Josefsson  <jas@extundo.com>
1176
1177         * readline.c: Fix typo, tiny patch from Stepan Kasal
1178         <kasal@ucw.cz>.
1179
1180 2006-02-28  Simon Josefsson  <jas@extundo.com>
1181
1182         * getopt.c: Protect #include of unistd.h, for MSVS.
1183
1184 2006-02-27  Simon Josefsson  <jas@extundo.com>
1185
1186         * base64.h: Indent #define's.  From Jim Meyering
1187         <jim@meyering.net>.
1188
1189 2006-02-27  Jim Meyering  <jim@meyering.net>
1190
1191         Revert the change of 2006-02-24, so these files can continue
1192         to be sync'd from gettext.
1193         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1194         of `config.h'.
1195
1196 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1197
1198         * glob.c: Say "invalid" rather than "illegal" in comments.
1199
1200 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1201
1202         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1203
1204 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1205
1206         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1207         AT_FDCWD exceeds INT_MAX.
1208         * openat.h (AT_FDCWD): Likewise.
1209
1210 2006-02-14  Jim Meyering  <jim@meyering.net>
1211
1212         Sync from coreutils.
1213
1214         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1215         failure on deficient systems, and simplify gnulib lgpl dependencies.
1216         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1217         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1218
1219         * xalloc-die.c: Remove unused definition of N_.
1220
1221 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1222
1223         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1224
1225 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1226
1227         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1228         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1229
1230 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1231
1232         * argp-namefrob.h: Restore changes accidentally lost during the
1233         "autoupdate" on 2005-12-12.
1234
1235 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1236
1237         * fnmatch.c (L_): Renamed from L, to work around a bug in
1238         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1239         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1240         All uses changed.
1241
1242 2006-01-26  Simon Josefsson  <jas@extundo.com>
1243
1244         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1245         prototype is visible on mingw32.
1246
1247         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1248         for mingw32.
1249
1250         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1251         mingw32).
1252
1253 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1254
1255         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1256         attempt to open for write; this always fails, at least on POSIX
1257         hosts.  This reinstates the 2006-01-09 change, which was
1258         inadvertently removed.
1259
1260 2006-01-26  Bruno Haible  <bruno@clisp.org>
1261             Paul Eggert  <eggert@cs.ucla.edu>
1262
1263         * stdbool_.h (_Bool)
1264         [(! (defined __cplusplus || defined __BEOS__)
1265           && !defined __GNUC__
1266           && !(defined __HP_cc || defined __xlc__
1267                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1268                || defined __sgi))]:
1269         #define to signed char in these cases too; this simplifies
1270         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1271         etc., separately) and makes it more conservative.
1272
1273 2006-01-21  Jim Meyering  <jim@meyering.net>
1274
1275         Sync from the stable (b5) branch of coreutils:
1276
1277         * fts.c (fts_children): Don't let close() clobber errno from
1278         failed fchdir().
1279
1280         * fts.c (fts_stat): When following a symlink-to-directory,
1281         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1282         a dangling symlink.  That can also happen at least for ELOOP.
1283         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1284         FYI, this bug predates the inclusion of fts.c in coreutils.
1285
1286         * fts.c (fts_open): Put new maxarglen declaration and uses
1287         in their own block, so pre-c99 compilers don't object.
1288
1289         Avoid the double-free (first in fts_read, second in fts_close) that
1290         would occur when an `active' directory is made inaccessible (e.g.,
1291         via chmod a-x) during a traversal.
1292         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1293         before returning.  Reproduce this failure by
1294         mkdir -p a/b; cd a; chmod a-x . b
1295         Reported by Stavros Passas.
1296
1297 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1298
1299         * argp-namefrob.h: Bugfix. Remove stray #
1300
1301 2006-01-25  Bruno Haible  <bruno@clisp.org>
1302
1303         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1304         warnings.
1305         Reported by Paul Eggert.
1306
1307 2006-01-25  Jim Meyering  <jim@meyering.net>
1308
1309         * fileblocks.c: Remove more useless parentheses.
1310         * readutmp.h: Likewise.
1311
1312 2006-01-24  Bruno Haible  <bruno@clisp.org>
1313
1314         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1315         has it.
1316         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1317         2005-11-26.
1318
1319         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1320         to avoid problems with the built-in _Bool type.
1321         Reported by Paul Eggert on 2005-11-26.
1322
1323 2006-01-24  Jim Meyering  <jim@meyering.net>
1324
1325         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1326
1327 2006-01-24  Simon Josefsson  <jas@extundo.com>
1328
1329         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1330         Bruno.
1331
1332 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1333
1334         Work around porting bugs reported by Dieter in
1335         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1336         * getopt.c (_NOPROTO): Remove; no longer needed.
1337         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1338         Include "getopt.h" first, to check interface.
1339         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1340         !HAVE_DECL_GETENV.
1341         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1342         (__strndup): Revert to K&R-style function dfns, the glibc style.
1343         * strnlen.c: Don't claim it's taken from glibc; it's not.
1344         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1345         Include strnlen.h first, to get prototype properly.
1346         (strnlen): Renamed from __strnlen.
1347         Remove weak alias.
1348
1349 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1350
1351         These changes imported from libc.
1352         * getopt.c: Use __fxprintf instead of inline stream orientation
1353         test and two separate function calls.
1354         * strndup.c (__strndup): Add libc_hidden_def.
1355
1356 2006-01-22  Bruno Haible  <bruno@clisp.org>
1357
1358         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1359         temporary buffer for sprintf, take into account the precision also
1360         for 'd', 'i', 'u', 'o', 'x', 'X'.
1361
1362 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1363
1364         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1365         to pacify gcc -Wswitch-default.
1366
1367 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1368
1369         * argp-help.c (usage_long_opt): Do not print DOC options.
1370         (__argp_base_name): Removed
1371         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1372         typo.
1373         (__argp_base_name): Provide macro definition or extern declaration
1374         depending on the configuration
1375
1376 2006-01-20  Simon Josefsson  <jas@extundo.com>
1377
1378         * inet_ntop.h: Unconditionally include sys/socket.h.
1379
1380 2006-01-19  Simon Josefsson  <jas@extundo.com>
1381
1382         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1383
1384 2006-01-12  Simon Josefsson  <jas@extundo.com>
1385
1386         * base64.c: Fix warning, reported by Bruno Haible
1387         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1388
1389 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1390
1391         Sync from coreutils.
1392         * md5.c: Fix commentary typos.
1393         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1394         * md5.h (__attribute__): Remove; unused.
1395         * sha1.c: Fix commentary to match md5 better.
1396         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1397         so that we don't need to worry about alignment.  All uses changed.
1398         This merges the 2005-10-28 md5 change into sha1.
1399
1400 2006-01-11  Jim Meyering  <jim@meyering.net>
1401
1402         Sync from coreutils.
1403         * md5.c (OP): Fix spacing.
1404
1405 2006-01-11  Simon Josefsson  <jas@extundo.com>
1406
1407         * stdint_.h (SIZE_MAX): Add missing (.
1408
1409 2006-01-10  Bruno Haible  <bruno@clisp.org>
1410
1411         * argp.h (__const): Remove macro. Use const instead.
1412         * argp-fmtstream.h (__const): Likewise.
1413         * glob_.h (__const): Remove macro.
1414         * glob-libc.h: Use const instead of __const.
1415
1416 2006-01-10  Jim Meyering  <jim@meyering.net>
1417
1418         Avoid the double-free (first in fts_read, second in fts_close) that
1419         would occur when an `active' directory is made inaccessible (e.g.,
1420         via chmod a-x) during a traversal.
1421         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1422         before returning.  Reproduce this failure by
1423         mkdir -p a/b; cd a; chmod a-x . b
1424         Reported by Stavros Passas.
1425
1426         Sync from coreutils.
1427         * sha1.c: Tweak grammar in a comment.
1428
1429 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1430
1431         * regex_internal.h (BITSET_WORD_BITS):
1432         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1433         preprocessor mishandles large unsigned values as if they were signed.
1434         Problem reported by Claudio Fontana in
1435         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1436
1437 2006-01-10  Simon Josefsson  <jas@extundo.com>
1438
1439         * socket_.h: New file.
1440
1441 2006-01-10  Bruno Haible  <bruno@clisp.org>
1442
1443         * localcharset.c: Update from GNU gettext.
1444
1445 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1446
1447         Sync from coreutils.
1448         * chdir-long.c (cdb_free): Don't bother trying to open directory
1449         for write access: POSIX says that must fail.
1450         * fts.c (diropen): Likewise.
1451         * save-cwd.c (save_cwd): Likewise.
1452         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1453         well, for minor improvements on hosts that lack O_DIRECTORY.
1454         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1455         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1456         Fall back on chown if open failed with EACCES.
1457
1458         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1459         Report an error at compile-time if only a 1-second nominal clock
1460         resolution is found.
1461
1462         * lchmod.h: New file.
1463         * mkdir-p.c: Include lchmod.h, lchown.h.
1464         (make_dir_parents): Use lchown rather than chown, and
1465         lchmod rather than chmod.
1466
1467         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1468         too.  Problem with "none" reported by Bob Proulx.  Problem with
1469         "proc" reported by n0dalus.
1470
1471         * mountlist.c: Include <limits.h>.
1472         (dev_from_mount_options)
1473         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1474         New function.  It no longer assumes "dev=" has the System V meaning
1475         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1476         (read_file_system_list)
1477         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1478         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1479         dev= in that case.
1480
1481         * posixtm.h (PDS_PRE_2000): New macro.
1482         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1483         All usages changed.  Reject dates outside the range 1969-1999 if
1484         PDS_PRE_2000 is used.
1485
1486 2006-01-09  Jim Meyering  <jim@meyering.net>
1487
1488         Sync from coreutils.
1489
1490         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1491
1492         * chdir-safer.h, chdir-safer.c: New files.
1493
1494         * modechange.c (mode_compile): Reject an invalid mode string
1495         that starts with an octal digit.  From Andreas Gruenbacher.
1496
1497         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1498         and dup to open_safer and dup_safer, respectively.
1499         (openat_permissive): Fix typo in comment.
1500
1501         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1502         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1503         (_): Remove; no longer needed.
1504         (openat): Renamed from rpl_openat; no need for rpl_openat
1505         since openat.h renames openat for us.
1506         Replace most of the body with a call to openat_permissive,
1507         to avoid duplicate code.
1508         Port to (probably hypothetical) environments were mode_t is
1509         wider than int.
1510         (openat_permissive): Require mode arg, so that we can check
1511         types better.  Put it just after flags.  Change cwd failure
1512         indicator from pointer-to-bool to pointer-to-errno-value.
1513         All callers changed.
1514         Invoke openat_save_fail and/or openat_restore_fail if
1515         cwd_errno is null, so that openat can call us.
1516         (openat_permissive, fdopendir, fstatat, unlinkat):
1517         Simplify errno handling to avoid some duplicate code,
1518         as it's OK to set errno on success.
1519         * openat.h: Revamp code so that function macros depend on
1520         __OPENAT_PREFIX only, not also on AT_FDCWD.
1521         (openat_ro): Remove.  Caller changed to use openat_permissive.
1522         (openat_permissive): Now a macro, if not a function.
1523         (openat_restore_fail, openat_save_fail): Now always functions,
1524         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1525
1526         * openat-priv.h: New file, defining macros used by mkdirat.c
1527         and openat.c.
1528         * mkdirat.c: Include openat-priv.h.
1529         Remove definitions of macros defined therein.
1530         * openat.c: Likewise.
1531
1532         * mkdirat.c (mkdirat): New file and function.
1533         * openat.h (mkdirat): Declare.
1534
1535         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1536
1537         * openat.h (openat_permissive): Declare.
1538         (openat_ro): Define.
1539
1540         * openat.c (EXPECTED_ERRNO): New macro.
1541         (openat_permissive): New function -- used in remove.c rewrite.
1542         (all functions): Set errno just before returning, only if there
1543         was an actual failure.
1544         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1545
1546         Emulate openat-family functions using Linux's procfs, if possible.
1547         Idea and some code based on Ulrich Drepper's glibc changes.
1548
1549         * openat.c: (BUILD_PROC_NAME): New macro.
1550         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1551         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1552         before falling back on save_cwd and restore_cwd.
1553         (fdopendir, fstatat, unlinkat): Likewise.
1554
1555         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1556         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1557
1558         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1559         as second argument to va_arg.  Otherwise, some versions of gcc
1560         warn that `if this code is reached, the program will abort'.
1561
1562 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1563
1564         Sync from coreutils.
1565
1566         Add POSIX ACL support
1567         * acl.h (copy_acl, set_acl): Add declarations.
1568         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1569         systems other than Linux.
1570         (chmod_or_fchmod): New function: use fchmod when possible,
1571         and chmod otherwise.
1572         (file_has_acl): Add a POSIX ACL implementation, with a
1573         Linux-specific subcase.
1574         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1575         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1576         acls are unsupported.
1577         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1578         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1579         are unsupported.
1580
1581 2006-01-09  Bruno Haible  <bruno@clisp.org>
1582
1583         * sysexit_.h (EX_OK): New macro.
1584         Suggested by Martin Lambers <marlam@marlam.de>.
1585
1586 2006-01-09  Bruno Haible  <bruno@clisp.org>
1587
1588         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1589         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1590         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1591         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1592
1593 2006-01-09  Bruno Haible  <bruno@clisp.org>
1594
1595         * stdint_.h (SIZE_MAX): Write the value without involving negative
1596         numbers.
1597
1598 2005-10-16  Bruno Haible  <bruno@clisp.org>
1599
1600         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1601         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1602
1603 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1604
1605         * strftime.c (tzname): Don't declare if it is already #defined.
1606         Problem reported for Mingw by Mark Junker.
1607
1608 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1609
1610         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1611         long int, not int, for nanosecond counts, so that people who are
1612         used to POSIX struct timespec won't be surprised.  Reported by Jim
1613         Meyering.
1614
1615 2005-12-16  Jim Meyering  <jim@meyering.net>
1616
1617         * fprintftime.c, fprintftime.h: New files.
1618
1619 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1620
1621         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1622         * argp-help.c (fill_in_uparams): Check if the constructed
1623         struct uparams is valid. Fall back to the default values if it is
1624         not.
1625
1626 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1627
1628         * argp-help.c (__argp_base_name): New function
1629         (__argp_short_program_name): Rewrite using __argp_base_name
1630         * argp-namefrob.h: Define program_invocation_name and
1631         program_invocation_short_name if requested
1632         (__argp_base_name): Add prototype
1633         * argp-parse.c (argp_def): Use gettext wrappers
1634         (argp_default_parser): Use __argp_base_name
1635         * argp-pin.c: New file. Defines program_invocation_name and
1636         program_invocation_short_name on systems that lack them.
1637
1638 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1639
1640         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1641         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1642         porting problem reported by Georg Schwarz in
1643         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1644
1645 2005-07-09  Bruno Haible  <bruno@clisp.org>
1646
1647         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1648         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1649         Reported by Mark Junker <mjscod@gmx.de>.
1650
1651 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1652
1653         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1654         (uintmax_t) [defined uintmax_t]: Do not declare.
1655         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1656         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1657         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1658         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1659         sake of portability to weird hosts that C allows (though we don't
1660         know of any practical examples).
1661
1662         * savedir.h (fdsavedir): New decl.
1663         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1664         contains most of the former guts of savedir.
1665         (savedir): Use savedirstream.
1666         Include "openat.h".
1667
1668 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1669
1670         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1671         coreutils no longer futzes with rounding modes.
1672
1673 2005-11-14  Jim Meyering  <jim@meyering.net>
1674
1675         * mkstemp-safer.c: Include <config.h>, required for possible
1676         replacement of mkstemp.
1677
1678 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1679
1680         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1681         business.
1682         (gethrxtime) [! (HAVE_NANOUPTIME
1683         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1684         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1685         our own approximation.
1686
1687 2005-11-10  Simon Josefsson  <jas@extundo.com>
1688
1689         * readline.c: Remove EOL.
1690
1691 2005-11-08  Eric Blake  <ebb9@byu.net>
1692
1693         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1694
1695 2005-11-08  Eric Blake  <ebb9@byu.net>
1696
1697         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1698
1699 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1700
1701         Fix porting problem reported by Theodoros V. Kalamatianos.
1702         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1703         Don't assume that futimes failing means we must fail.
1704
1705 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1706
1707         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1708         leave errno alone.  Problem reported by Dmitry V. Levin.
1709
1710 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1711
1712         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1713         errno alone.  Problem reported by Frederic Jolliton.
1714
1715 2005-10-28  Simon Josefsson  <jas@extundo.com>
1716
1717         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1718         "restrict" keywords, as per POSIX.  Protect the function
1719         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1720         Don't use K&R prototypes.  Check the sprintf return values.
1721         Re-define EAFNOSUPPORT if not present.  Indent.
1722
1723         * md5.h, md5.c: Simplify buffer handling visavi alignment,
1724         suggested by Bruno Haible <bruno@clisp.org>.
1725
1726         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1727
1728         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
1729
1730         * gc-libgcrypt.c: Add MD2 (which is not available through
1731         libgcrypt).
1732
1733         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
1734
1735         * md2.h, md2.c: New files.
1736
1737 2005-10-24  Simon Josefsson  <jas@extundo.com>
1738
1739         * md4.h: Shrink buffer size, now that we changed the type.
1740
1741 2005-10-22  Simon Josefsson  <jas@extundo.com>
1742
1743         * arcfour.h, arcfour.c: Use fixed size indices in the
1744         arcfour_context struct (simplify test vector testing in GNU
1745         Shishi).
1746
1747 2005-10-22  Simon Josefsson  <jas@extundo.com>
1748
1749         * md4.h, md4.c: Simplify buffer handling visavi alignment,
1750         suggested by Bruno Haible <bruno@clisp.org>.
1751
1752 2005-10-22  Simon Josefsson  <jas@extundo.com>
1753
1754         * crc.h: Include stddef.h, for size_t.
1755
1756 2005-10-21  Simon Josefsson  <jas@extundo.com>
1757
1758         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1759         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1760
1761 2005-10-21  Simon Josefsson  <jas@extundo.com>
1762
1763         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1764         block.
1765
1766 2005-10-21  Simon Josefsson  <jas@extundo.com>
1767
1768         * gc-gnulib.c: Support ARCTWO in CBC mode.
1769
1770 2005-10-21  Simon Josefsson  <jas@extundo.com>
1771
1772         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1773         <bruno@clisp.org>.
1774
1775         * hmac-sha1.c (hmac_sha1): Likewise.
1776
1777         * crc.c (crc32_update): Actually use crc parameter, suggested by
1778         Bruno Haible <bruno@clisp.org>.
1779
1780         * crc.h: Include stdint.h directly, suggested by Bruno Haible
1781         <bruno@clisp.org>.
1782
1783 2005-10-21  Simon Josefsson  <jas@extundo.com>
1784
1785         * des.h, des.c: New files.
1786
1787         * gc-gnulib.c: Support DES.c
1788
1789 2005-10-21  Simon Josefsson  <jas@extundo.com>
1790
1791         * arctwo.h, arctwo.c: New files.
1792
1793         * gc-gnulib.c: Support ARCTWO.
1794
1795 2005-10-21  Simon Josefsson  <jas@extundo.com>
1796
1797         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1798
1799 2005-10-19  Simon Josefsson  <jas@extundo.com>
1800
1801         * gc-gnulib.c: Support ARCFOUR.
1802
1803 2005-10-19  Simon Josefsson  <jas@extundo.com>
1804
1805         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1806         support.
1807
1808         * gc.h: Add ECB enum type.
1809
1810         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1811
1812 2005-10-19  Simon Josefsson  <jas@extundo.com>
1813
1814         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1815
1816 2005-10-18  Simon Josefsson  <jas@extundo.com>
1817
1818         * md4.h, md4.c: New files, based on md5.?.
1819
1820 2005-10-17  Simon Josefsson  <jas@extundo.com>
1821
1822         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1823
1824         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1825
1826 2005-10-17  Simon Josefsson  <jas@extundo.com>
1827
1828         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1829
1830 2005-10-17  Simon Josefsson  <jas@extundo.com>
1831
1832         * gc.h, gc-libgcrypt.c: Add ciphers.
1833
1834 2005-10-17  Simon Josefsson  <jas@extundo.com>
1835
1836         * sha1.c: Use uint32_t instead of md5_uint32.t
1837
1838         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1839         md5.h.
1840
1841         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
1842
1843         * md5.h: Use stdint.h and uint32_t.  Doc fix.
1844
1845 2005-10-15  Simon Josefsson  <jas@extundo.com>
1846
1847         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1848
1849         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1850
1851 2005-10-14  Simon Josefsson  <jas@extundo.com>
1852
1853         * arcfour.h, arcfour.c: New files.
1854
1855 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
1856
1857         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1858         include <wchar.h>; no longer needed.
1859
1860 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
1861         and  Ulrich Drepper  <drepper@redhat.com>
1862
1863         Import from libc.
1864         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1865         instead of inline stream orientation test and two separate
1866         function calls.  Pay no attention to USE_IN_LIBIO.
1867
1868 2005-10-14  Roland McGrath  <roland@redhat.com>
1869
1870         Import from libc.  [BZ #1331]
1871         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1872         macro argument.
1873         Reported by Matej Vela <vela@debian.org>.
1874
1875 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1876
1877         * mkdir-p.c (make_dir_parents): Don't report an error if an
1878         intermediate directory is in a read-only file system.  Problem
1879         reported by Eric Blake.
1880
1881 2005-10-13  Simon Josefsson  <jas@extundo.com>
1882
1883         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1884         Move memory allocation outside of loop.
1885
1886 2005-10-12  Simon Josefsson  <jas@extundo.com>
1887
1888         * gc-pbkdf2-sha1.c: New file.
1889
1890         * gc.h: Add gc_pbkdf2_sha1 prototype.
1891
1892 2005-10-12  Simon Josefsson  <jas@extundo.com>
1893
1894         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
1895         suggested by Bruno Haible <bruno@clisp.org>.
1896
1897 2005-10-12  Simon Josefsson  <jas@extundo.com>
1898
1899         * gc-libgcrypt.c (gc_hmac_sha1): New function.
1900
1901         * gc-gnulib.c (gc_hmac_sha1): New function.
1902
1903 2005-10-12  Simon Josefsson  <jas@extundo.com>
1904
1905         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
1906
1907 2005-10-12  Simon Josefsson  <jas@extundo.com>
1908
1909         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
1910         GC_USE_HMAC_MD5, respectively.
1911
1912         * gc-libgcrypt.c (gc_md5): Fix assert call.
1913         (gc_md5): Fix typo.
1914
1915         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
1916
1917         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
1918
1919         * gc-gnulib.c (gc_hash_buffer): Ditto.
1920
1921 2005-10-11  Bruno Haible  <bruno@clisp.org>
1922
1923         * c-strcasestr.h: New file, from GNU gettext.
1924         * c-strcasestr.c: New file, from GNU gettext.
1925
1926 2005-10-11  Bruno Haible  <bruno@clisp.org>
1927
1928         * c-strcase.h: New file, from GNU gettext.
1929         * c-strcasecmp.c: New file, from GNU gettext.
1930         * c-strncasecmp.c: New file, from GNU gettext.
1931
1932 2005-10-11  Simon Josefsson  <jas@extundo.com>
1933
1934         * crc.h, crc.c: New files.
1935
1936         * gc.h (gc_hash_buffer): Add doc.
1937
1938 2005-10-08  Simon Josefsson  <jas@extundo.com>
1939
1940         * gc.h: Add gc_hash and gc_hash_buffer.
1941
1942         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
1943
1944         * gc-libgcrypt.c (gc_hash_buffer): Add.
1945
1946 2005-10-11  Bruno Haible  <bruno@clisp.org>
1947
1948         * strcasecmp.c: Include limits.h.
1949         (strcasecmp): Avoid integer overflow on exotic platforms.
1950         * strncasecmp.c: Include limits.h.
1951         (strncasecmp): Avoid integer overflow on exotic platforms.
1952         Reported by Paul Eggert.
1953
1954 2005-10-06  Simon Josefsson  <jas@extundo.com>
1955
1956         * hmac-md5.c: New file.
1957
1958         * hmac.h: New file.
1959
1960 2005-10-06  Simon Josefsson  <jas@extundo.com>
1961
1962         * memxor.c (memxor): Avoid casts and warnings.
1963
1964 2005-10-05  Derek Price  <derek@ximbiot.com>
1965
1966         * getdelim.c (SIZE_MAX): New macro, if not already defined.
1967
1968 2005-10-05  Simon Josefsson  <jas@extundo.com>
1969
1970         * memxor.c (memxor): Fix compiler error.
1971
1972         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
1973         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
1974
1975         * memxor.h, memxor.c: New files.
1976
1977         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
1978         we assume all systems have it, suggested by Jim Meyering
1979         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
1980         any systems lack sys/socket.h; mingw32 is known to lack it, but we
1981         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
1982         same reasons.
1983
1984 2005-10-04  Bruno Haible  <bruno@clisp.org>
1985
1986         * verify.h (verify_true): Provide alternative definition for C++.
1987
1988 2005-10-04  Simon Josefsson  <jas@extundo.com>
1989
1990         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
1991         D. Baushke" <mdb@gnu.org>.
1992
1993 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
1994
1995         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
1996         (SSIZE_MAX): New macro, if not already defined.
1997         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
1998         than 2 GiB.
1999
2000 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2001
2002         * exclude.c: Include verify.h.
2003         (verify): Remove.  All callers changed to use verify.h's version.
2004         * strtoimax.c: Likewise.
2005         * utimecmp.c: Likewis.e
2006
2007         Sync from coreutils.
2008         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2009         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2010         * .cvsignore: Add fts.h, search.h, t-fpending.
2011         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2012         bother returning ENOSYS if settimeofday or stime fails; just let
2013         them return whatever errno they want to return.
2014         * utimens.c: Include unistd.h, for dup2.
2015         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2016         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2017
2018 2005-10-02  Jim Meyering  <jim@meyering.net>
2019
2020         Sync from coreutils.
2021         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2022         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2023         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2024         Remove AT_FDCWD test.
2025         Do not consume the fd unless successful.
2026         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2027         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2028         block, so that we don't even try to compile it if settimeofday is
2029         available.  This works around a compilation failure on OSF1 V5.1,
2030         due to stime requiring a `long int*' while tv_sec is `int'.
2031
2032 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2033
2034         * getdelim.c (getdelim): Remove unused variables.
2035
2036 2005-10-01  Simon Josefsson  <jas@extundo.com>
2037
2038         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2039         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2040         AI_* and EAI_* definitions.  Protect function declarations.
2041
2042 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2043
2044         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2045         so that the code works even with ancient cpp.  Portability problem
2046         with GCC 2.7.2.1 reported by Thomas M.Ott.
2047
2048 2005-09-27  Jim Meyering  <jim@meyering.net>
2049
2050         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2051
2052         * intprops.h (signed_type_or_expr__): Define.
2053         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2054         for unsigned types.
2055
2056 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2057
2058         * verify.h (verify_expr): Remove, replacing with:
2059         (verify_true): New macro that returns true instead of void.
2060         (verify_type__): Remove.
2061         (verify): Use verify_true rather than verify_type__.
2062
2063 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2064
2065         * utimens.c (ENOSYS): Define if not already defined.
2066         (futimens): Support having a null PATH if the file descriptor
2067         is nonnegative.
2068
2069         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2070         Remove.
2071         (__attribute): Define to empty unless GCC 3.1 or later.
2072         This works around a core dump on OpenBSD 3.4, which has GCC
2073         2.95.3, which dumps core when given __attribute__(()).  It also
2074         simplifies other tests, since we really don't want to bother with
2075         worrying about which ancient version of GCC supported what.
2076         Original problem reported by Yoann Vandoorselaere, with part of
2077         the fix suggested by Derek Price.
2078
2079 2005-09-24  Jim Meyering  <jim@meyering.net>
2080
2081         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2082         so we can once again use a positive bitfield width of 1 -- now we
2083         don't have to explain why we were using a bitfield width of 2.
2084
2085 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2086
2087         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2088         Problem reported by Eric Blake.
2089         (getaddrinfo): Initialize se so that it's not garbage.
2090         Redo internal storage allocation so that it doesn't make unportable
2091         assumptions about alignment.
2092         Fix a memory leak.
2093
2094         * utimens.c (futimens): Use futimesat if available.
2095         Prefer it to futimes since it doesn't have the futimes bug.
2096
2097         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2098         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2099         Instead, declare a function that returns a pointer to an array,
2100         and use verify_type__ to declare the size of the array.
2101         Problem and germ of a solution reported by Bruno Haible.
2102         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2103         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2104
2105 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2106
2107         Sync from coreutils.
2108
2109         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2110         stat-time.h.
2111         * argmatch.h: Include verify.h
2112         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2113         (ARGMATCH_ASSERT): Remove; unused.
2114         * canonicalize.c: Assume STDC_HEADERS.
2115         * exclude.c: Include "strcase.h".
2116         * regex_internal.h [!defined _LIBC]: Likewise.
2117         * getusershell.c: Include stdio--.h rather than stdio.h
2118         and stdio-safer.h.
2119         (getusershell): Call fopen, not fopen_safer.
2120         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2121         Do not include unistd-safer.h.
2122         (save_cwd): Don't call fd_safer; no longer needed
2123         now that we include fcntl--.h.
2124
2125         * getdate.y (relative_time): New type.
2126         (RELATIVE_TIME_0): New constant.
2127         (parser_control): Use relative_time instead of doing it ourselves.
2128         (%union): Add new relative_time rel member.
2129         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2130         Now typeless.
2131         (relunit, relunit_snumber): Now of type rel.
2132         (zone, rel, relunit, get_date): Adjust to above changes.
2133
2134         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2135         Do not include unistd-safer.h.
2136         (getloadavg): Don't call fd_safer; no longer needed
2137         now that we include fcntl--.h.
2138
2139         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2140         (make_dir_parents): Treat ENOSYS like EEXIST.
2141
2142         Improve quality of diagnostics on restore_cwd failure.
2143         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2144         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2145         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2146         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2147         each time through the loop.  Do not diagnose restore_cwd failure;
2148         that is the caller's job (and perhaps the caller does not care).
2149
2150         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2151         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2152         If the file already exists but is not a directory, don't bother
2153         to try to make its parents.
2154         Close potential file descriptor leak if we can't chdir("/") (!).
2155         Don't always return true if chdir($PWD) fails; return true only
2156         if the requested action was done successfully (except for the
2157         chdir($PWD)).
2158         Don't log final directory unless we actually made it.
2159         Refactor to avoid duplicate code to fix up permissions.
2160         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2161
2162         * strftime.c (my_strftime): Rewrite the previous change slightly,
2163         to make it a bit faster and (I hope) clearer.
2164         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2165         Fix bug in formats like %2N.
2166
2167         * verify.h: New file.
2168
2169 2005-09-22  Jim Meyering  <jim@meyering.net>
2170
2171         Sync from coreutils.
2172
2173         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2174
2175         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2176         the .tm_year member, since otherwise gcc-4.0 would now warn about
2177         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2178
2179         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2180         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2181
2182         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2183         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2184         when run in a time zone for which daylight savings time is in effect
2185         for the starting date.
2186
2187         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2188         stop us from restricting permissions of just-created absolute-named
2189         directories.
2190         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2191         to restore initial working directory.
2192         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2193         to tell caller if/when we change the working directory and are
2194         unable to return to the initial one.
2195         * mkdir-p.h (make_dir_parents): Update prototype.
2196         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2197         `return false'.  This fixes a bug introduced on 2004-07-30.
2198
2199         * openat.c (fdopendir): Be sure to close the supplied
2200         file descriptor before returning.  This makes our replacement
2201         implementation a little closer to Solaris's, where fdopendir
2202         ties the file descriptor to the returned DIR* pointer.
2203         * openat.c (unlinkat): New function.
2204         * openat.h (unlinkat): Add prototype.
2205         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2206         (openat_restore_fail): Rename from openat_restore_die.
2207         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2208
2209         Provide an alternative to exiting immediately upon save_cwd or
2210         restore_cwd failure.  Now, an application can arrange e.g.,
2211         to perform a longjump in that case.
2212         * openat.c: Include dirname.h.
2213         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2214         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2215         and openat_restore_die rather than calling error directly.
2216         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2217
2218         * openat-die.c (openat_save_die, openat_restore_die): New file.
2219         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2220
2221         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2222         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2223                             int utc, int nanoseconds);
2224         Background:
2225         date should not have to allocate a megabyte of virtual memory to
2226         handle a format argument like +%1048575T.  When implemented with
2227         strftime, it must allocate such a buffer, use strftime to fill it
2228         in, print it, then free it.
2229         With fprintftime, it simply prints everything and exits.
2230         With no need for memory allocation, that's one fewer way to fail.
2231         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2232         optional field width, not before, so we accept %9:z, not %:9z.
2233         (my_strftime): Be sure to use L_('x') for literals.
2234
2235         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2236         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2237         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2238         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2239         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2240         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2241         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2242         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2243         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2244
2245         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2246         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2247         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2248         and don't include <sys/file.h>).
2249
2250 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2251
2252         Sync from coreutils.
2253
2254         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2255         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2256         [!LDAV_DONE]: Avoid unused variable warning.
2257
2258 2005-09-21  Bruno Haible  <bruno@clisp.org>
2259
2260         * unicodeio.h (unicode_to_mb): New declaration.
2261
2262 2005-09-20  Derek Price  <derek@ximbiot.com>
2263
2264         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2265
2266 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2267
2268         Use a consistent style for including <config.h>.
2269         * __fpending.c, acl.c, argmatch.c,
2270         argp-help.c, argp-parse.c,
2271         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2272         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2273         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2274         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2275         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2276         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2277         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2278         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2279         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2280         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2281         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2282         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2283         modechange.c, mountlist.c, open-safer.c, physmem.c,
2284         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2285         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2286         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2287         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2288         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2289         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2290         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2291         userspec.c, utimecmp.c, version-etc-fsf.c,
2292         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2293         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2294         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2295         Standardize inclusion of config.h.
2296         * __fpending.h, dirfd.h, getdate.h, human.h,
2297         inttostr.h:  Removed inclusion of config.h from header files.
2298         * inttostr.c:  Adjusted in-tree users.
2299         * timespec.h: Remove superfluous warning to include config.h.
2300         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2301         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2302         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2303         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2304
2305 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2306
2307         * stat-time.h: New file.
2308         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2309         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2310         in a different way.
2311         (timespec_cmp): New function.
2312         * utimecmp.c: Include stat-time.h.
2313         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2314         members exist, not on the obsolescent ST_MTIM_NSEC.
2315         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2316
2317 2005-09-15  Derek Price  <derek@ximbiot.com>
2318             Paul Eggert  <eggert@cs.ucla.edu>
2319
2320         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2321         changes, consolidating in...
2322         * regex_internal.h: ...this file.
2323
2324 2005-09-15  Derek Price  <derek@ximbiot.com>
2325
2326         * regex_internal.h: Blank `pure' for GNUC < 3.
2327         * regex_internal.c: Ditto, using this...
2328         (__GNUC_PREREQ): ...new macro.
2329         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2330         (__GNUC_PREREQ): ...this new macro.
2331
2332         * strstr.h: Include string.h. Define strstr as a macro here.
2333
2334 2005-09-13  Derek Price  <derek@ximbiot.com>
2335
2336         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2337         failure.
2338         Reported by Jim Meyering  <jim@meyering.net>.
2339
2340 2005-09-13  Jim Meyering  <jim@meyering.net>
2341
2342         * canon-host.c: Filter through gnu indent and reword comments slightly.
2343         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2344
2345 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2346
2347         * lib/base64.c: Typo.
2348         (base64_encode): Put b64str in initialized data section.
2349
2350 2005-09-12  Derek Price  <derek@ximbiot.com>
2351
2352         Return usable errors from canon-host.
2353         * canon-host.h: New file.
2354         * canon-host.c (canon_host): Wrap...
2355         (canon_host_r): ...this new function, which now relies exclusively on
2356         getaddrinfo.
2357         (ch_strerror): New function.
2358         (last_cherror): New global.
2359         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2360         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2361         void *.
2362         (freeaddrinfo): Free ai->ai_canonname when set.
2363
2364 2005-09-12  Derek Price  <derek@ximbiot.com>
2365             Paul Eggert  <eggert@cs.ucla.edu>
2366
2367         * glob-libc.h: Renamed from glob_.h.  The new version is
2368         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2369         protecting things that should be done only in gnulib contexts.
2370         * glob_.h: New file, containing only the glob things needed for
2371         gnulib.
2372         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2373         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2374         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2375         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2376         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2377         and to respect the namespace rules better.
2378
2379 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2380
2381         Merge glibc and coreutils changes into gnulib, plus a few
2382         extra fixes.
2383         * md5.c: Use #error rather than a string.
2384         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2385         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2386         (__attribute__): Define to empty for non recent-GCC.
2387         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2388         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2389         Renamed from their non-__ counterparts, with new macros replacing
2390         them if not _LIBC.  Add __THROW attribute.
2391         (rol): Remove.
2392         (struct md5_ctx): Align buffer if using GCC.
2393         * sha1.h (struct sha1_ctx): Likewise.
2394         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2395         The old name was backwards.
2396         (NOTSWAP): Remove; not used.
2397         (rol): New macro, moved here from md5.h.
2398         (sha1_process_block): Remove a FIXME that doesn't make sense.
2399
2400 2005-09-12  Derek Price  <derek@ximbiot.com>
2401
2402         * gai_strerror.c: Include config.h when available.  Include
2403         getaddrinfo.h before other headers to test interface.
2404         Reported by Larry Jones <lawrence.jones@ugs.com>.
2405
2406 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2407
2408         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2409         definitions, since that's the preferred style in glibc.
2410         Fix a minor spacing issue, and update copyright notice to match glibc's.
2411
2412 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2413
2414         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2415
2416 2005-09-06  Simon Josefsson  <jas@extundo.com>
2417
2418         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2419         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2420
2421 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2422
2423         Change bitset word type from unsigned int to unsigned long int,
2424         as this has better performance on typical 64-bit hosts.
2425         Port bitset code to hosts with unusual word sizes.
2426         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2427         (build_collating_symbol):
2428         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2429         argument is a bitset.  This is merely a style issue, but it makes
2430         it clearer that an entire array is expected.
2431         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2432         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2433         Port to the case where bitset_word is not the same as unsigned int.
2434         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2435         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2436         Likewise.
2437         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2438         (build_trtable, group_nodes_into_DFAstates):
2439         Likewise.
2440         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2441         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2442         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2443         * regexec.c (group_nodes_into_DFAstates): Likewise.
2444         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2445         * regcomp.c (optimize_subexps, lower_subexp):
2446         Work even if bitset_word has holes in its bitwise representation.
2447         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2448         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2449         Likewise.
2450         * regex_internal.c (re_string_reconstruct):
2451         Don't assume UCHAR_MAX == 255.
2452         * regex_internal.h (bitset_set_all): Likewise.
2453         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2454         All uses changed.
2455         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2456         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2457         All uses changed.
2458         (BITSET_WORD_MAX): New macro.
2459         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2460         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2461         (bitset_empty, bitset_copy):
2462         Prefer sizeof (bitset) to multiplying it out ourselves.
2463         (bitset_not_merge): Remove; unused.
2464         (bitset_contain): Return bool, not unsigned int with one bit on.
2465         All callers changed.
2466         * regexec.c (build_trtable): Don't assume bitset has no stricter
2467         alignment than re_node_set; do this by defining a new internal
2468         type struct dests_alloc and using it to allocate memory.
2469
2470 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2471
2472         Check for arithmetic overflow when calculating sizes, to prevent
2473         some buffer-overflow issues.  These patches are conservative, in the
2474         sense that when I couldn't determine whether an overflow was possible,
2475         I inserted a run-time check.
2476         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2477         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2478         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2479         (re_xnrealloc, re_x2nrealloc): New inline functions.
2480         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2481         (build_equiv_class, build_charclass): Check for arithmetic overflow
2482         in size expression calculations.
2483         * lib/regex_internal.c (re_string_realloc_buffers):
2484         (build_wcs_upper_buffer, re_node_set_add_intersect):
2485         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2486         (re_dfa_add_node, register_state): Likewise.
2487         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2488         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2489         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2490         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2491
2492 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2493
2494         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2495         to avoid a collision with bits/local_lim.h in glibc.
2496         All uses changed.  Problem reported by Dmitry V. Levin in
2497         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2498
2499         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2500         bugs in int versus size_t comparisons.
2501         (re_string_context_at): Fix bug where the code assumed that
2502         Idx is signed.
2503
2504         Use bool where appropriate.
2505         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2506         All callers changed.
2507         (calc_eclosure_iter): Likewise, for ROOT arg.
2508         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2509         (build_charclass_op): Likewise, for NON_MATCH arg.
2510         * regex_internal.c (re_string_allocate, re_string_construct):
2511         (re_string_construct_common): Likewise, for ICASE arg.
2512         * regexec.c (re_search_2_stub, re_search_stub):
2513         Likewise, for RET_LEN arg.
2514         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2515         (set_regs): Likewise, for FL_BACKTRACK arg.
2516         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2517         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2518         (calc_eclosure_iter, parse_bracket_exp):
2519         Use bool for internal variables that are booleans.
2520         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2521         (set_regs, build_sifted_states, sift_states_bkref):
2522         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2523         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2524         (find_collation_sequence_value):
2525         Likewise.
2526         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2527         (re_node_set_compare):
2528         Return bool, not int. All callers changed.
2529         * regexec.c (check_halt_node_context, check_dst_limits):
2530         (build_trtable, check_node_accept): Likewise.
2531         * regex_internal.h: Include stdbool.h.
2532
2533         Fix bugs uncovered when converting to bool.
2534         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2535         failure instead of charging ahead blindly.
2536         * regex_internal.c (register_state): Likewise.
2537         * regexec.c (re_search_2_stub): Use simpler method than boolean
2538         for freeing internal storage.
2539         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2540         bitset pieces used as boolean, to avoid undefined behavior
2541         on hosts that do int overflow checking.
2542
2543 2005-08-31  Derek Price  <derek@ximbiot.com>
2544
2545         * getdelim.c (getdelim): Return EOF on EOF.
2546         Reported by Larry Jones <lawrence.jones@ugs.com>.
2547
2548 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2549
2550         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2551         lengths fit in regoff_t; this isn't true if regoff_t is the same
2552         width as size_t.
2553         * regex.c (re_search_internal): 5th arg is LAST_START
2554         (= START + RANGE) instead of RANGE.  This avoids overflow
2555         problems when regoff_t is the same width as size_t.
2556         All callers changed.
2557         (re_search_2_stub): Check for overflow when adding the
2558         sizes of the two strings.
2559         (re_search_stub): Check for overflow when adding START
2560         to RANGE; if it occurs, substitute the extreme value.
2561
2562 2005-08-31  Jim Meyering  <jim@meyering.net>
2563
2564         * regcomp.c (search_duplicated_node): Make first pointer arg
2565         a pointer-to-const.
2566         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2567         (register_state): Likewise.
2568         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2569         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2570         (group_nodes_into_DFAstates): Likewise.
2571
2572 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2573
2574         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2575         old glibc regex code mishandles strings longer than 2**31 bytes.
2576         This patch fixes this when the regex code is used in gnulib
2577         (i.e., outside glibc).
2578
2579         This patch should not affect the use of the regex code inside
2580         glibc.  No doubt this problem also needs to be handled for glibc
2581         as well, but the result will be an incompatible change to the
2582         glibc ABI, and the old ABI will have to be supported too.  That
2583         can be the the subject for another patch.
2584
2585         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2586         governing whether the rest of this patch is active.  By default,
2587         the macro is disabled and the patch has no effect.
2588         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2589         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2590         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2591         (re_match_2, re_set_registers): Use the new types.
2592         * regex_internal.h (Idx, re_hashval_t): New types.
2593         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2594         New macros.
2595         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2596         (re_string_context_at, bin_tree_t, re_dfastate_t):
2597         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2598         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2599         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2600         (re_string_char_size_at, re_string_wchar_at):
2601         (re_string_elem_size_at):
2602         Use the new types and macros to port to 64-bit hosts.
2603         Use unsigned types for internal values, so that the code
2604         mostly works even for arrays larger than SSIZE_MAX.
2605         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2606         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2607         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2608         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2609         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2610         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2611         (calc_inveclosure, parse_dup_op, build_range_exp):
2612         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2613         (fetch_number, create_token_tree, mark_opt_subexp):
2614         Likewise.
2615         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2616         (create_cd_newstate, re_string_allocate, re_string_construct):
2617         (re_string_realloc_buffers, build_wcs_upper_buffer):
2618         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2619         (re_string_reconstruct, re_string_peek_byte_case):
2620         (re_string_fetch_byte_case, re_string_context_at):
2621         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2622         (re_node_set_init_copy, re_node_set_add_intersect):
2623         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2624         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2625         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2626         (re_acquire_state, re_acquire_state_context, register_state):
2627         Likewise.
2628         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2629         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2630         (re_search_internal, re_search_2_stub, re_search_stub)
2631         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2632         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2633         (update_cur_sifted_state, check_dst_limits):
2634         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2635         (check_subexp_limits, sift_states_bkref, merge_state_array):
2636         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2637         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2638         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2639         (expand_bkref_cache, check_node_accept_bytes):
2640         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2641         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2642         (acquire_init_state_context, check_halt_node_context):
2643         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2644         (sift_states_backward, clean_state_log_if_needed):
2645         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2646         (find_recover_state, transit_state_sb, transit_state_mb):
2647         (transit_state_bkref, build_trtable, match_ctx_clean):
2648         Likewise.
2649         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2650         to work around an assumption that REG_MISSING is negative.
2651
2652         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2653         (seek_collating_symbol_entry) [defined _LIBC]:
2654         (lookup_collation_sequence_value) [defined _LIBC]:
2655         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2656         Use prototypes rather than old-style function definitions.
2657         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2658         (transit_state_sb) [0]:
2659         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2660
2661         * regexec.c (re_search_internal): Simplify update of rm_so and
2662         rm_eo.
2663
2664         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2665         (optimize_subexps, lower_subexp):
2666         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2667         since the signed shift might overflow.  Use 1u<<31 instead.
2668         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2669         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2670         Likewise.
2671
2672         * regcomp.c (optimize_subexps, lower_subexp):
2673         Use CHAR_BIT rather than 8, for clarity.
2674         * regexec.c (check_dst_limits_calc_pos_1):
2675         (check_subexp_matching_top): Likewise.
2676         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2677         have to worry about portability issues when shifting it left.
2678         Remove no-longer-needed test for table_size > 0.
2679         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2680         in a word, as the resulting behavior is undefined.
2681         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2682         in one case, a <= should have been an <, and in another case the
2683         whole test was missing.
2684         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
2685         the standard name CHAR_BIT.
2686         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2687         this is not true on one's complement and signed-magnitude hosts.
2688
2689         * regex_internal.h (re_sub_match_top_t): Remove unused member
2690         next_last_offset.
2691         (struct re_dfa_t): Remove unused member states_alloc.
2692         * regcomp.c (init_dfa): Don't initialize unused members.
2693
2694 2005-08-31  Bruno Haible  <bruno@clisp.org>
2695
2696         * strstr.c: Include <stddef.h>, for NULL.
2697         * strcasestr.c: Likewise.
2698         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2699
2700 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
2701
2702         * iconvme.h: Add prototype for iconv_alloc.
2703
2704 2005-08-29  Simon Josefsson  <jas@extundo.com>
2705
2706         * iconvme.c: Fix errno.
2707
2708 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
2709
2710         * iconvme.c: Split iconv_string into iconv_alloc.
2711
2712 2005-08-27  Jim Meyering  <jim@meyering.net>
2713
2714         * fopen-safer.c: Merge minor changes from coreutils.
2715         * dup-safer.c: Likewise.
2716         * fd-safer.c: Likewise.
2717
2718         Merge from coreutils.
2719         * stdio--.h: New file.
2720         * stdlib--.h: New file.
2721         * mkstemp-safer.c: New file.
2722
2723         GNU tar needs these.
2724         * pipe-safer.c: New file.
2725         * creat-safer.c: New file.
2726         * fcntl--.h (creat): Define to creat_safer.
2727         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2728         * unistd--.h (pipe): Define to pipe_safer.
2729         * unistd-safer.h: Declare pipe_safer.
2730
2731 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2732
2733         * regex_internal.h: Remove all references to
2734         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2735         or better.
2736         (bitset_not, bitset_merge, bitset_not_merge):
2737         (bitset_mask, re_string_allocate, re_string_construct):
2738         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2739         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2740         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2741         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2742         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2743         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2744         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2745         (re_acquire_state_context):
2746         Remove unnecessary forward decls.
2747         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2748         Put __attribute at function definition,
2749         now that the function decl has been removed.
2750         * lib/regex_internal.c (re_string_peek_byte_case):
2751         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2752         Likewise.
2753
2754 2005-08-26  Simon Josefsson  <jas@extundo.com>
2755
2756         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2757         Haible <bruno@clisp.org>.
2758
2759 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2760
2761         * regexec.c (set_regs): Don't alloca with an unbounded size.
2762
2763         alloca modernization/simplification for regex.
2764         * regex.c: Remove portability cruft for alloca.  This no longer
2765         needs to be at the start of the file, and can be moved into
2766         regex_internal.h and simplified.
2767         * regex_internal.h: Include <alloca.h>.
2768         (__libc_use_alloca) [!defined _LIBC]: New macro.
2769         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2770         now works outside glibc.
2771
2772 2005-08-24  Simon Josefsson  <jas@extundo.com>
2773
2774         * getpass.c: Add WIN32 implementation.  Conditionalize use of
2775         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
2776         GLIBC specific code.
2777
2778 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2779
2780         Make regex safe for g++.  This fixes one real bug (an "err"
2781         that should have been "*err").  g++ problem reported by
2782         Sam Steingold.
2783         * regex_internal.h (re_calloc): New macro, consistent with
2784         re_malloc etc.  All callers of calloc changed to use re_calloc.
2785         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2786         not int.  All callers changed.
2787         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2788         just use an array of size MB_LEN_MAX.
2789         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2790         (find_recover_state): Change "err" to "*err"; this fixes what
2791         appears to be a real bug.
2792         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2793         versus int.
2794
2795 2005-08-25  Jim Meyering  <jim@meyering.net>
2796
2797         * open-safer.c: Include <config.h>.
2798         Otherwise, we'd lose LARGEFILE support in any file using
2799         e.g. "fcntl--.h"
2800
2801 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2802
2803         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2804         * regex.h (regerror): Likewise.
2805
2806         * regex.c: Do not include <sys/types.h>, as POSIX no longer
2807         requires this.  (The code never needed it.)
2808
2809         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2810         All uses of recently-renamed identifiers changed to use the new,
2811         POSIX-compliant names.  The code will build and run just fine
2812         without these changes, but it's better to eat our own dog food
2813         and use the standard-conforming names.
2814
2815         * regex.h: Fix a multitude of POSIX name space violations.
2816         These changes have an effect only for programs that define
2817         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2818         do not change anything for programs compiled in the normal way.
2819         Also, there is no effect on the ABI.
2820
2821         (_REGEX_SOURCE): New macro.
2822         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2823         defined and _GNU_SOURCE is not; this fixes a name space violation.
2824
2825         Rename the following macros to obey POSIX requirements.
2826         The old names are still visible as macros if _REGEX_SOURCE is defined.
2827         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2828         RE_BACKSLASH_ESCAPE_IN_LISTS.
2829         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2830         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2831         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2832         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2833         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2834         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2835         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2836         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2837         (REG_INTERVALS): renamed from RE_INTERVALS.
2838         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2839         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2840         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2841         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2842         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2843         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2844         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2845         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2846         RE_UNMATCHED_RIGHT_PAREN_ORD.
2847         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2848         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2849         (REG_DEBUG): renamed from RE_DEBUG.
2850         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2851         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
2852         unusual, since we can't clash with the POSIX REG_ICASE.
2853         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2854         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2855         (REG_NO_SUB): renamed from RE_NO_SUB.
2856         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2857         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2858         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2859         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2860         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2861         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2862         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2863         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2864         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2865         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2866         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2867         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2868         RE_SYNTAX_POSIX_MINIMAL_BASIC.
2869         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2870         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2871         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2872         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
2873         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2874         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2875         (REG_FIXED): Renamed from REGS_FIXED.
2876         (REG_NREGS): Renamed from RE_NREGS.
2877
2878         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2879         of other REG_* macros, since POSIX says the user is allowed to
2880         #undef these macros selectively.
2881
2882         (reg_errcode_t): Update comment stating what other tables need
2883         to be consistent.
2884
2885         Rename the following enum values to obey POSIX requirements.
2886         The old names are still visible as macros.
2887         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
2888         is not defined, since GNU is supposed to be a superset of POSIX as
2889         much as possible, and since we want reg_errcode_t to be a signed
2890         type for implementation consistency.
2891         (_REG_NOERROR): Renamed from REG_NOERROR.
2892         (_REG_NOMATCH): Renamed from REG_NOMATCH.
2893         (_REG_BADPAT): Renamed from REG_BADPAT.
2894         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
2895         (_REG_ECTYPE): Renamed from REG_ECTYPE.
2896         (_REG_EESCAPE): Renamed from REG_EESCAPE.
2897         (_REG_ESUBREG): Renamed from REG_ESUBREG.
2898         (_REG_EBRACK): Renamed from REG_EBRACK.
2899         (_REG_EPAREN): Renamed from REG_EPAREN.
2900         (_REG_EBRACE): Renamed from REG_EBRACE.
2901         (_REG_BADBR): Renamed from REG_BADBR.
2902         (_REG_ERANGE): Renamed from REG_ERANGE.
2903         (_REG_ESPACE): Renamed from REG_ESPACE.
2904         (_REG_BADRPT): Renamed from REG_BADRPT.
2905         (_REG_EEND): Renamed from REG_EEND.
2906         (_REG_ESIZE): Renamed from REG_ESIZE.
2907         (_REG_ERPAREN): Renamed from REG_ERPAREN.
2908         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
2909         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
2910         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
2911         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
2912
2913         (_REG_RE_NAME, _REG_RM_NAME): New macros.
2914         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
2915         changed.  But support the old name if the new one is not defined
2916         and if _REGEX_SOURCE.
2917
2918         Change the following member names in struct re_pattern_buffer.
2919         The old names are still supported if !_REGEX_SOURCE.
2920         The new names are always supported, regardless of _REGEX_SOURCE.
2921         (re_buffer): Renamed from buffer.
2922         (re_allocated): Renamed from allocated.
2923         (re_used): Renamed from used.
2924         (re_syntax): Renamed from syntax.
2925         (re_fastmap): Renamed from fastmap.
2926         (re_translate): Renamed from translate.
2927         (re_can_be_null): Renamed from can_be_null.
2928         (re_regs_allocated): Renamed from regs_allocated.
2929         (re_fastmap_accurate): Renamed from fastmap_accurate.
2930         (re_no_sub): Renamed from no_sub.
2931         (re_not_bol): Renamed from not_bol.
2932         (re_not_eol): Renamed from not_eol.
2933         (re_newline_anchor): Renamed from newline_anchor.
2934
2935         Change the following member names in struct re_registers.
2936         The old names are still supported if !_REGEX_SOURCE.
2937         The new names are always supported, regardless of _REGEX_SOURCE.
2938         (rm_num_regs): Renamed from num_regs.
2939         (rm_start): Renamed from start.
2940         (rm_end): Renamed from end.
2941
2942         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
2943         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
2944         Prepend __ to parameter names.
2945
2946         Undo yesterday's changes.
2947
2948 2005-08-24  Jim Meyering  <jim@meyering.net>
2949
2950         Sync from coreutils.
2951         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
2952
2953 2005-08-21  Bruno Haible  <bruno@clisp.org>
2954
2955         * lock.h: Add multiple inclusion guard.
2956         * tls.h: Add multiple inclusion guard.
2957
2958 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2959
2960         * regex.h (REG_NOSYS)
2961         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
2962         Define, since POSIX requires it as of 2001.
2963         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
2964         New private symbol, used to keep the enum signed in all cases.
2965         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
2966         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
2967
2968         * regex_internal.c (re_string_skip_chars, register_state):
2969         (calc_state_hash):
2970         Remove forward decls; no longer needed now that we use prototypes.
2971         * regexec.c (acquire_init_state_context, check_halt_node_context):
2972         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
2973         (clean_state_log_if_needed): Likewise.
2974
2975 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2976
2977         Fix problems reported by Sam Steingold in
2978         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
2979         * regexec.c (sift_states_bkref): Fix portability bug: the code
2980         assumed that reg_errcode_t is a signed type, which is not
2981         necessarily true if _XOPEN_SOURCE is not defined.
2982         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
2983         some compilers warn about it otherwise.
2984
2985 2005-08-20  Jim Meyering  <jim@meyering.net>
2986
2987         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2988         of unused local, dfa.
2989
2990 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2991
2992         * regcomp.c (create_initial_state): Remove duplicate decl.
2993         (init_word_char, create_initial_state, duplicate_node_closure):
2994         (fetch_token, peek_token_bracket, build_range_exp):
2995         (build_collating_symbol): Remove forward decls; no longer needed
2996         now that we use prototypes.
2997
2998         * regcomp.c:
2999         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3000         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3001         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3002         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3003         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3004         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3005         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3006         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3007         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3008         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3009         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3010         (build_charclass, build_charclass_op, fetch_number, create_tree):
3011         (create_token_tree, mark_opt_subexp, duplicate_tree):
3012         Use prototypes rather than old-style definitions.
3013
3014         * regex_internal.c:
3015         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3016         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3017         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3018         (re_string_reconstruct, re_string_peek_byte_case):
3019         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3020         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3021         (re_node_set_init_copy, re_node_set_add_intersect):
3022         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3023         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3024         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3025         (re_acquire_state, re_acquire_state_context, register_state):
3026         (create_ci_newstate, create_cd_newstate, free_state):
3027         Likewise.
3028         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3029         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3030         (re_search_internal, prune_impossible_nodes):
3031         (acquire_init_state_context, check_matching, static):
3032         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3033         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3034         (update_regs, sift_states_backward, build_sifted_states):
3035         (clean_state_log_if_needed, merge_state_array):
3036         (update_cur_sifted_state, add_epsilon_src_nodes):
3037         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3038         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3039         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3040         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3041         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3042         (check_arrival, check_arrival_add_next_nodes):
3043         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3044         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3045         (check_node_accept_bytes, check_node_accept, extend_buffers):
3046         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3047         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3048         (sift_ctx_init):
3049         Likewise.
3050
3051         * regex_internal.h:
3052         (re_string_allocate, re_string_construct, re_string_reconstruct):
3053         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3054         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3055         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3056         (re_string_context_at, re_string_peek_byte_case):
3057         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3058         is defined, since we now use prototypes always.
3059
3060         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3061         C89 or better.  All uses removed.
3062
3063 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3064
3065         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3066         [defined lint]: Suppress bogus uninitialized-variable warnings.
3067
3068         * regcomp.c (duplicate_node): Return new index, not an error code,
3069         and let the caller return REG_ESPACE if out of space.  This
3070         removes an uninitialied-variable warning with GCC 4.0.1, and also
3071         avoids taking the address of a local variable.  All callers
3072         changed.
3073
3074 2005-08-19  Jim Meyering  <jim@meyering.net>
3075
3076         * regexec.c (proceed_next_node): Redo local variables to
3077         avoid GCC shadowing warnings.
3078
3079 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3080
3081         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3082         (re_node_set_insert_last, re_dfa_add_node):
3083         Rename local variables to avoid GCC shadowing warnings.
3084
3085 2005-08-18  Bruno Haible  <bruno@clisp.org>
3086
3087         * strstr.c (strstr): Fix return value in multibyte case.
3088         * strcasestr.c (strcasestr): Likewise.
3089
3090 2005-08-17  Jim Meyering  <jim@meyering.net>
3091
3092         Make the %s format (seconds since the epoch) work for a negative
3093         number and when used with a zero-padded field width, e.g. %015s.
3094
3095         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3096         label so that it precedes the code to set `digits'.  Otherwise,
3097         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3098         print `00-22'.  Now, it prints `-0022', as it should.
3099
3100 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3101
3102         * regex.h: Remove useless space-before-tab.  From coreutils.
3103
3104 2005-08-17  Bruno Haible  <bruno@clisp.org>
3105
3106         * strcasestr.h: New file.
3107         * strcasestr.c: New file.
3108
3109 2005-08-17  Bruno Haible  <bruno@clisp.org>
3110
3111         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3112         * strstr.c: Completely rewritten, with multibyte locale support.
3113
3114 2005-08-17  Bruno Haible  <bruno@clisp.org>
3115
3116         * strcasecmp.c: Use mbuiter.h.
3117
3118 2005-08-17  Bruno Haible  <bruno@clisp.org>
3119
3120         * mbuiter.h: New file.
3121
3122 2005-08-16  Bruno Haible  <bruno@clisp.org>
3123
3124         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3125         (mbi_init): Update.
3126         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3127         NUL byte, not after it.
3128
3129 2005-08-16  Bruno Haible  <bruno@clisp.org>
3130
3131         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3132         the valid ones. Makes the comparison operations transitive:
3133         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3134         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3135
3136 2005-08-16  Bruno Haible  <bruno@clisp.org>
3137
3138         * strcase.h (strcasecmp): Add note in comments.
3139         * strncasecmp.c: Use code from strcasecmp.c.
3140         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3141         (strcasecmp): Work correctly in multibyte locales.
3142
3143 2005-08-16  Bruno Haible  <bruno@clisp.org>
3144
3145         * strnlen1.h: New file.
3146         * strnlen1.c: New file.
3147
3148 2005-08-16  Bruno Haible  <bruno@clisp.org>
3149
3150         * mbfile.h: New file.
3151
3152 2005-08-16  Bruno Haible  <bruno@clisp.org>
3153
3154         * mbiter.h: New file.
3155
3156 2005-08-16  Bruno Haible  <bruno@clisp.org>
3157
3158         * mbchar.h: New file.
3159         * mbchar.c: New file.
3160
3161 2005-08-16  Bruno Haible  <bruno@clisp.org>
3162
3163         * tls.h: New file, from GNU gettext.
3164         * tls.c: New file, from GNU gettext.
3165
3166 2005-08-15  Bruno Haible  <bruno@clisp.org>
3167
3168         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3169         is defined.
3170
3171 2005-08-14  Jim Meyering  <jim@meyering.net>
3172
3173         Sync from coreutils.
3174
3175         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3176         Use the hash-table-based cycle-detection code not just when
3177         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3178         Reported by James Youngman in
3179         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3180         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3181         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3182         This lets us compile with -DFTS_DEBUG, once again.
3183         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3184         * fts.c (fd_safer): Remove decl.
3185         Include fcntl--.h rather than unistd-safer.h
3186         (fts_safe_changedir): Don't call fd_safer; no longer needed
3187         now that we include fcntl--.h.
3188
3189 2005-08-11  Simon Josefsson  <jas@extundo.com>
3190
3191         * readline.h, readline.c: New file.
3192
3193 2005-08-11  Bruno Haible  <bruno@clisp.org>
3194
3195         * strnlen.h (strnlen): Change parameter name to match comment.
3196
3197 2005-08-10  Simon Josefsson  <jas@extundo.com>
3198
3199         * strndup.c: Use strnlen.h.
3200
3201         * strnlen.h: New file.
3202
3203 2005-08-02  Simon Josefsson  <jas@extundo.com>
3204
3205         * getline.h, getline.c: Rewrite.
3206
3207         * getdelim.h, getdelim.c: New files, ported from glibc.
3208
3209 2005-07-31  Bruno Haible  <bruno@clisp.org>
3210
3211         * lock.h (gl_lock_initializer): New macro.
3212         (gl_lock_define_initialized): Use it.
3213         (gl_rwlock_initializer): New macro.
3214         (gl_rwlock_define_initialized): Use it.
3215         (gl_recursive_lock_initializer): New macro.
3216         (gl_recursive_lock_define_initialized): Use it.
3217
3218 2005-07-26  Bruno Haible  <bruno@clisp.org>
3219
3220         * lock.h: Update from GNU gettext.
3221         * lock.c: Update from GNU gettext.
3222
3223 2005-07-18  Bruno Haible  <bruno@clisp.org>
3224
3225         * lock.h (gl_once_t): New type.
3226         (gl_once_define, gl_once): New macros.
3227         * lock.c (fresh_once): New variable.
3228         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3229         functions.
3230
3231 2005-07-18  Simon Josefsson  <jas@extundo.com>
3232
3233         * check-version.c (check_version): Accept identical versions too.
3234
3235 2005-07-18  Bruno Haible  <bruno@clisp.org>
3236
3237         * lock.h: New file, from GNU gettext.
3238         * lock.c: New file, from GNU gettext.
3239
3240 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3241
3242         * quotearg.c: Add translator comment suggested by Bruno Haible,
3243         with a minor change.
3244
3245 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3246
3247         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3248         copyright symbol and the year.
3249         * version-etc.c (COPYRIGHT_YEAR): New constant.
3250         (version_etc_va): Use parameterized copyright notice.
3251         Reword to conform to the current GNU coding standards.
3252
3253 2005-07-11  Simon Josefsson  <jas@extundo.com>
3254
3255         * size_max.h: New file.
3256
3257 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3258
3259         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3260         block of defines.
3261
3262 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3263        and  Paul Eggert  <eggert@cs.ucla.edu>
3264
3265         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3266         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3267
3268 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3269
3270         * regex.c, regex.h: Sync from libc.
3271         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3272         New files, synced from libc, except that regex_internal.h
3273         currently has a small porting fix.
3274
3275 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3276
3277         Remove the dependency of the strftime module on the tzset module.
3278         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3279         Copy the input structure, to work around some of the bug with
3280         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3281         Solaris releases, you should also use the tzset module, but we won't
3282         require it as a dependency any more since we don't want LGPLed code
3283         to depend on GPLed code.
3284
3285 2005-07-02  Jim Meyering  <jim@meyering.net>
3286
3287         * backupfile.c (backup_args): Change a `0' to NULL.
3288
3289 2005-07-01  Jim Meyering  <jim@meyering.net>
3290
3291         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3292         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3293         * save-cwd.c, tempname.c:
3294         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3295         and don't include <sys/file.h>).
3296
3297 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3298
3299         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3300         declares only 'struct timespec;' (!).
3301
3302 2005-06-29  Jim Meyering  <jim@meyering.net>
3303
3304         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3305         type name.  Use the variable name instead.
3306         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3307
3308 2005-06-28  Simon Josefsson  <jas@extundo.com>
3309
3310         * check-version.h, check-version.c: New files.
3311
3312 2005-06-28  Simon Josefsson  <jas@extundo.com>
3313
3314         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3315         collision with global variable.  Better indentation.  Don't
3316         increment buffer pointer beyond buffer end.  Based on comments
3317         from Paul Eggert <eggert@cs.ucla.edu>.
3318
3319         * base64.h: Indent.
3320
3321 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3322
3323         * canon-host.c (canon-host): Append trailing "," to 0 in
3324         initializer of struct addrinfo, as an indication that we don't
3325         care how many members the structure has.
3326
3327 2005-06-24  Derek Price  <derek@ximbiot.com>
3328         and Bruno Haible  <bruno@clisp.org>
3329
3330         Remove stat module & update lstat.
3331         * stat.c: Remove this file...
3332         (slash_aware_lstat): ...moving this content and its support...
3333         * lstat.c (rpl_lstat): ...into here.
3334         * lstat.h: New file.
3335
3336 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3337
3338         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3339         (ranged_convert): Don't save conversion in a temporary struct.
3340         This causes a warning with GCC 4.0.0, and anyway in the typical
3341         case it's not worth the extra 100 bytes or so of code.
3342         (ranged_convert, __mktime_internal): When calling a function via a
3343         pointer P, use P () rather than (*P) (), as we now assume C89 or
3344         better.
3345
3346 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3347
3348         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3349         "who -r" failed to give output.  Problem reported by Tim Waugh.
3350
3351         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3352         (xcalloc): Use it to avoid needless tests.
3353         Problem reported by Jim Meyering.
3354
3355 2005-06-16  Jim Meyering  <jim@meyering.net>
3356
3357         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3358         when either N or S is zero.
3359
3360 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3361
3362         * argp.h (__option_is_short): Check upper limit of
3363         __key. Isprint() requires its argument to have the value
3364         of an unsigned char or EOF.
3365
3366 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3367
3368         * fnmatch.c (fnmatch): If there is an encoding error in a
3369         multibyte string or pattern, fall back on unibyte matching.
3370         Problem reported by James Youngman.
3371
3372 2005-06-08  Bruno Haible  <bruno@clisp.org>
3373
3374         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3375         warning on mingw.
3376
3377 2005-06-08  Bruno Haible  <bruno@clisp.org>
3378
3379         * csharpcomp.h: New file, from GNU gettext.
3380         * csharpcomp.c: New file, from GNU gettext.
3381         * csharpcomp.sh.in: New file, from GNU gettext.
3382
3383 2005-06-07  Derek Price  <derek@ximbiot.com>
3384
3385         Sync from CVS.
3386         * glob_.h: Indent nested #ifdef.
3387
3388 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3389
3390         Sync from coreutils.
3391         Use "file name" when talking about file names, instead of "filename"
3392         or "path", as per the GNU coding standards.
3393         * mkdir-p.c: Renamed from makepath.c.
3394         (make_dir_parents): Renamed from make_path.  All callers changed.
3395         * mkdir-p.h: Likewise.  All includers changed.
3396         * filenamecat.c: Renamed from path-concat.c.
3397         (file_name_concat): Renamed from path_concat.  All callers changed.
3398         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3399         * filenamecat.h: Likewise.  All includers changed.
3400         * acl.c: Don't use "path" or "filename" to mean "file name"
3401         in comments or local variable names.
3402         * basename.c: Likewise.
3403         * canonicalize.c, canonicalize.h: Likewise.
3404         * dirname.c, dirname.h: Likewise.
3405         * euidaccess.c: Likewise.
3406         * exclude.c: Likewise
3407         * fnmatch_.h, fnmatch_loop.c: Likewise.
3408         * fsusage.c, fsuage.h: Likewise.
3409         * fts.c, fts_.h: Likewise.
3410         * getcwd.c: Likewise.
3411         * getloadavg.c: Likewise.
3412         * mkstemp.c: Likewise.
3413         * mountlist.c, mountlist.h: Likewise.
3414         * openat.c, openat.h: Likewise.
3415         * readlink-stub.c: Likewise.
3416         * readutmp.c, readutmp.h: Likewise.
3417         * rename.c: Likewise.
3418         * rmdir.c: Likewise.
3419         * same.c: Likewise.
3420         * savedir.c: Likewise.
3421         * stripslash.c: Likewise.
3422         * tempname.c: Likewise.
3423         * xreadlink.c: Likewise.
3424         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3425         All uses changed.
3426         * exclude.h: Likewise.
3427
3428         * euidaccess.c (getuid, getgid, getuid, getegid)
3429         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3430         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3431         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3432         * pathmax.h: Include <limits.h> unconditionally, since other
3433         files have been getting away with it for years (MORE/BSD 4.3
3434         is extinct now).
3435         * userspec.c (getpwnam, getgrnam, getgrgid)
3436         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3437
3438         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3439         Define to 256, not 255, as per modern POSIX.
3440
3441 2005-06-01  Bruno Haible  <bruno@clisp.org>
3442
3443         * csharpexec.h: New file, from GNU gettext.
3444         * csharpexec.c: New file, from GNU gettext.
3445         * csharpexec.sh.in: New file, from GNU gettext.
3446
3447 2005-05-31  Derek Price  <derek@ximbiot.com>
3448             Paul Eggert  <eggert@cs.ucla.edu>
3449
3450         Sync from cvs.
3451         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3452
3453 2005-05-29  Derek Price  <derek@ximbiot.com>
3454             Paul Eggert  <eggert@cs.ucla.edu>
3455
3456         * glob_.h, glob.c: New files.
3457
3458 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3459
3460         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3461
3462         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3463         the configuration hassle isn't worth it.
3464         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3465         (LONGEST_MODIFIER, PRIuMAX): Remove.
3466
3467 2005-05-27  Bruno Haible  <bruno@clisp.org>
3468
3469         * getlogin_r.h: Remove second include of <stddef.h>.
3470
3471 2005-05-25  Bruno Haible  <bruno@clisp.org>
3472             Derek Price  <derek@ximbiot.com>
3473
3474         * getlogin_r.h: Simplify API documentation.
3475
3476 2005-05-25  Derek Price  <derek@ximbiot.com>
3477             Paul Eggert  <eggert@cs.ucla.edu>
3478
3479         * getlogin_r.c, getlogin_r.h: New files.
3480
3481 2005-05-22  Bruno Haible  <bruno@clisp.org>
3482
3483         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3484         Also include <sys/param.h> if it defines MIN, MAX.
3485         Based on a patch by Derek Price <derek@ximbiot.com>.
3486
3487 2005-05-22  Bruno Haible  <bruno@clisp.org>
3488
3489         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3490         (INT64_MIN): Fix definition.
3491         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3492
3493         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3494         NEED_SIGNED_INT_TYPES.
3495
3496         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3497         HAVE_SYSTEM_INTTYPES.
3498
3499 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3500
3501         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3502         so that unistd-safer.h (GPL'ed code) need not be included.
3503
3504 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3505
3506         New fts module.
3507         * fts.c: Don't include "cycle-check.h" or "hash.h".
3508         (setup_dir, free_dir): New functions.
3509         (enter_dir, leave_dir): Define trivial
3510         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3511         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3512         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3513         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3514         Move to fts-cycle.c.
3515         (fts_open): Use setup_dir.
3516         (fts_close): Use free_dir.
3517         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3518         This adds a label and some gotos, but the alternatives were messier.
3519         Check for memory allocation failure when entering a dir.
3520         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3521         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3522         (FTS): New member fts_cycle, that is a union that contains the
3523         old active_dir_ht and cycle_state.  All uses changed to mention
3524         fts_cycle.ht and fts_cycle.state.
3525         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3526         fts.c, with the following changes:
3527         (setup_dir, free_dir): New functions.
3528         (enter_dir): Now returns bool.  Return true if successful, false
3529         if memory exhausted.  All callers changed.
3530         Do not bother partly cleaning up on
3531         memory allocation failure; that is free_dir's job.
3532         However, free ad if hash_insert fails, to avoid memory leak.
3533         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3534         fts->fts_options to see which union member to use.
3535
3536 2005-05-20  Jim Meyering  <jim@meyering.net>
3537
3538         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3539         Now a macro, to pacify GCC.
3540
3541 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3542
3543         * chown.c (rpl_chown): Return -1 on failure.
3544
3545 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3546
3547         * canonicalize.c: Include canonicalize.h first, to test interface.
3548         Include <stddef.h> unconditionally, since we assume C89 now.
3549         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3550         * fts.c: Include fts_.h first, to check interface.
3551         Do not include intprops.h; no longer needed.
3552         Include cycle-check.h and hash.h, since fts_.h no longer does.
3553         Remove unnecessary casts of closedir to void.
3554         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3555         decide whether to decrement nlinks.
3556         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3557         (FTS): Use struct hash_table * instead of Hash_table, so that
3558         we no longer need to include hash.h here.
3559
3560 2005-05-17  Jim Meyering  <jim@meyering.net>
3561
3562         * fts.c, fts_.h: New files, from coreutils.
3563
3564 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3565
3566         Sync from coreutils.
3567         * unlinkdir.c, unlinkdir.h: New files.
3568         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3569         regex.h, unlocked-io.h, xtime.h:
3570         White space changes only.
3571         * makepath.c (make_path): Port to hosts where leading "//" is special.
3572         * yesno.c: Include getline.h, not ctype.h.
3573         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3574         Use getline to remove arbitrary restriction on response length.
3575
3576 2005-05-13  Bruno Haible  <bruno@clisp.org>
3577
3578         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3579         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3580         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3581         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3582         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3583         Add support for 64-bit integers in the MSVC compiler.
3584
3585 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3586
3587         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3588         Change the initial comment to refer to GPL, not LGPL.
3589         gnulib-tool will change it to LGPL as needed.
3590
3591         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3592         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3593         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3594         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3595         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3596         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3597         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3598         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3599         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3600         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3601         concatpath.c, config.charset, copy-file.c, copy-file.h,
3602         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3603         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3604         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3605         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3606         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3607         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3608         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3609         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3610         full-read.c, full-read.h, full-write.c, full-write.h,
3611         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3612         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3613         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3614         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3615         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3616         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3617         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3618         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3619         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3620         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3621         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3622         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3623         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3624         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3625         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3626         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3627         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3628         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3629         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3630         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3631         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3632         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3633         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3634         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3635         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3636         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3637         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3638         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3639         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3640         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3641         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3642         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3643         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3644         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3645         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3646         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3647         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3648         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3649         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3650         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3651         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3652         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3653         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3654         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3655         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3656         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3657         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3658         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3659         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3660         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3661         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3662         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3663         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3664         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3665         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3666         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3667         Update FSF postal mail address.
3668
3669 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3670
3671         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3672         specified in ai_socktype. Fix invalid ai_protocol
3673         check. ai_protocol is usually set to 0 or depending on
3674         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
3675         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
3676         ai_socktype / ai_protocol in the returned addrinfo structure.
3677
3678 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3679             Bruno Haible  <bruno@clisp.org>
3680
3681         * inet_ntop.h: New file.
3682         * inet_ntop.c: New file, from glibc with modifications.
3683
3684 2005-05-08  Jim Meyering  <jim@meyering.net>
3685
3686         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3687
3688 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
3689
3690         Merge from coreutils.  Among other things,
3691         add bulletproofing for cases where stdin, stdout, or stderr are closed.
3692         * fd-safer.c: New file.
3693         * fcntl-safer.h, open-safer.c: Remove.
3694         * chdir-long.c: Fix comment "fetish" -> "coreutils".
3695         * dup-safer.c: Include unistd-safer.h first.
3696         Don't include errno.h.
3697         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3698         * file-type.h: Don't assume invoker included sys/stat.h first.
3699         * file-type.c: Rely on file-type.h change.
3700         * getloadavg.c: Include unistd-safer.h.
3701         (getloadavg): Use safer open.
3702         * getusershell.c: Include "stdio-safer.h".
3703         (getusershell): Use safer fopen.
3704         * long-options.c (long_options): Use NULL rather than 0.
3705         * modechange.h (mode_free): Remove; all callers changed to invoke
3706         'free'.
3707         * modechange.c: Likewise.
3708         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3709         (MODE_DONE): New constant.
3710         (struct mode_change): Remove 'next' member.
3711         (make_node_op_equals): New function; like the old one of the
3712         same name, except it allocates an array.
3713         (mode_compile, mode_create_from_ref): Use it.
3714         (mode_compile): Allocate result as an array, not a linked list.
3715         Parse octal string ourself, so that we catch mistakes like "+0".
3716         (mode_adjust): Arg is an array, not a linked list.
3717         * modechange.c: Include stat-macros.h, xalloc.h.
3718         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3719         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3720         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3721         Remove.  This is now stat-macros.h's job.
3722         (talloc): Remove.  All callers replaced by xalloc, so that
3723         our invokers don't have to worry about reporting memory failures.
3724         (make_node_op_equals): Remove.
3725         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3726         New constants.
3727         (struct mode_change): Moved here from modechange.h.
3728         (mode_append_entry): Remove.
3729         (mode_compile): Remove MASKED_OPS arg, since it encouraged
3730         apps to have incorrect behavior.  Use simpler algorithm for head
3731         and tail.  Don't futz with umask; that's now the job of mode_adjust.
3732         Detect more invalid usages rather than having somewhat-random behavior.
3733         Don't insert an "a=" action, as that leads to incorrect behavior.
3734         (mode_compile, mode_create_from_ref): Return NULL on error instead
3735         of an enum, since now there's only one way to have an error.  All
3736         callers changed.
3737         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3738         at the correct time.  Simplify calculation of "+u" and its ilk.
3739         Don't mishandle "+X".
3740         (mode_free): Remove "register" and localize decls.
3741         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3742         (struct mode_change): Move to modechange.c; callers don't
3743         need to see this stuff.
3744         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3745         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3746         (mode_change, mode_adjust): Reflect the new signatures noted above.
3747         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3748         that might redefine system include files.
3749         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3750         (my_usleep): Use NULL rather than (void *) 0.
3751         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3752         Use siginterrupt to specify that system calls should be interrupted.
3753         (rpl_nanosleep): Move initialization of suspended closer to call of
3754         my_usleep.
3755         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
3756         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
3757         (desirable_utmp_entry): New function.
3758         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3759         using x2nrealloc, to simplify logic.
3760         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3761         size calculation.  Do not assume utmp file is a regular file.
3762         * readutmp.h (UT_PID): Moved here from ../src/who.c.
3763         (READ_UTMP_CHECK_PIDS): New constant.
3764         * save-cwd.c: Include unistd-safer.h.
3765         (save_cwd): Use fd_safer.
3766         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3767         [!_LIBC] Include "stat-macros.h" instead.
3768         * unistd-safer.h (fd_safer): New decl.
3769
3770 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
3771
3772         * byteswap_.h: New file.
3773
3774 2005-04-25  Albert Chin  <china@thewrittenword.com>
3775
3776         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3777         Toolkit C bug.
3778
3779 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
3780
3781         * getdate.y (zone): Allow relunit_snumber after tZONE, so
3782         that "UTC +1 second" continues to work.  Problem reported
3783         by Dmitry V. Levin.
3784         (relunit_snumber): New rule.
3785         (relunit): Use it.
3786
3787 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
3788
3789         * getdate.y (universal_time_zone_table): New constant.
3790         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3791         universal_time_zone_table.
3792         (lookup_zone): Prefer universal_time_zone_table to
3793         local_time_zone_table, so that "GMT" time stamps are allowed in
3794         London during the summer.  Problem reported by Ian Abbott.
3795
3796 2005-04-12  Jim Meyering  <jim@meyering.net>
3797
3798         * human.c (humblock): Set *options even when returning due to
3799         xstrtoumax conversion failure.  Thanks to a used-uninitialized
3800         warning from gcc-4.
3801
3802 2005-04-09  Jim Meyering  <jim@meyering.net>
3803
3804         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3805         -Wuninitialized: initialize tm0.tm_year.
3806
3807 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
3808
3809         * getdate.y (parser_control): rels_seen is now a boolean, not a
3810         count, since there's no maximum.  All uses changed.
3811         Add member dsts_seen.
3812         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3813         not being INT_MAX.
3814         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3815         Use pc_rels_seen to decide whther a date is absolute.
3816
3817         * getdate.y (number): Don't overwrite year.
3818         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3819         check.
3820
3821 2005-04-02  Simon Josefsson  <jas@extundo.com>
3822
3823         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3824         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3825
3826 2005-03-27  Jim Meyering  <jim@meyering.net>
3827
3828         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3829
3830 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
3831
3832         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3833         "one's complement" -> "ones' complement" in comment, as per Knuth.
3834         "value of type" -> "type or expression" in comment.
3835         * mktime.c, strftime.c: Propagate intprops.h comment nits.
3836
3837 2005-03-26  Jim Meyering  <jim@meyering.net>
3838
3839         Comment nits.
3840         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3841         Correct typos: s/or/of/.
3842
3843 2005-03-23  Jim Meyering  <jim@meyering.net>
3844
3845         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3846
3847 2005-03-21  Jim Meyering  <jim@meyering.net>
3848
3849         Changes imported from coreutils.
3850
3851         * cycle-check.c: Don't include xalloc.h.
3852
3853         * path-concat.c: Don't include assert.h.
3854         (path_concat): Remove assertion that would have triggered
3855         for ABASE starting with more than one slash.
3856         Reported by Andreas Schwab.
3857
3858         * path-concat.c (path_concat): Set *BASE_IN_RESULT
3859         properly when ABASE is an absolute file name.
3860         Correct the description of this function.
3861         Include <assert.h>.
3862         Add an assertion and a test driver.
3863         This fixes a bug introduced on 2004-07-02.
3864         Andreas Schwab reported the resulting failure of cp --parents:
3865         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3866
3867 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
3868
3869         * strftime.c (my_strftime): If the underlying strftime returns 0
3870         (which shouldn't happen), generate nothing instead of returning 0
3871         immediately, so that nstrftime (NULL, ...) doesn't return 0.
3872
3873 2005-03-16  Bruno Haible  <bruno@clisp.org>
3874
3875         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3876
3877 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
3878
3879         * strftime.c (my_strftime): Prepend space to format so that we can
3880         reliably distinguish strftime failure from empty output on POSIX
3881         hosts.
3882
3883 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3884
3885         * iconvme.c (SIZE_MAX): New macro, if not already defined.
3886         (iconv_string): Don't guess a size-zero buffer, as that might cause
3887         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
3888         result would be 'too large', where 'too large' is (heuristically)
3889         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3890         overflow concerns.  This will prevent some unwanted malloc failures
3891         when the inputs are very large.
3892
3893 2005-03-15  Bruno Haible  <bruno@clisp.org>
3894
3895         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
3896         'negate'.
3897
3898         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
3899         variable.
3900
3901         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
3902
3903 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
3904
3905         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
3906         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
3907         intprops.h.
3908         * strtol.c: Likewise.
3909
3910 2005-03-14  Simon Josefsson  <jas@extundo.com>
3911
3912         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
3913         <fx@gnu.org>.
3914
3915 2005-03-14  Jim Meyering  <jim@meyering.net>
3916
3917         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
3918         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
3919         to be nonzero so that we (and caller) can detect the difference
3920         between a valid zero-length expansion and an error return, even
3921         when the underlying strftime fails before writing anything into
3922         that location.
3923
3924 2005-03-10  Jim Meyering  <jim@meyering.net>
3925
3926         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
3927         so that this module works on systems without fchdir.
3928
3929 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
3930
3931         Factor int-properties macros into a single file, except for
3932         glibc-related files.
3933         * intprops.h: New file.
3934         * getloadavg.c: Include it instead of limits.h.
3935         (INT_STRLEN_BOUND): Remove.
3936         * human.c: Include intprops.h.
3937         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
3938         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
3939         * inttostr.h: Include intprops.h instead of limits.h.
3940         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
3941         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
3942         for consistency with intprops.h.
3943         (time_t_is_integer, twos_complement_arithmetic): Use them.
3944         * sig2str.h: Include <signal.h>, intprops.h.
3945         (INT_STRLEN_BOUND): Remove.
3946         * strftime.c (TYPE_SIGNED): Remove.
3947         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
3948         * strtol.c: Adjust comments to match intprops.h.
3949         * userspec.c: Include intprops.h.
3950         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
3951         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
3952         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
3953         instead of rolling our own expressions.
3954         * xstrtol.c: Include xstrtol.h first, to test interface.
3955
3956         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
3957         instead of int.
3958         (my_strftime): Do not mishandle years close to INT_MAX, by doing
3959         the right thing even if adding 1900 would overflow.  Similarly
3960         for tm_mon + 1 and tm_yday + 1.
3961         Make %Y always equivalent to %C%y, and similarly for %G and %g.
3962         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
3963         (DO_SIGNED_NUMBER): New macro.
3964         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
3965
3966 2005-03-07  Bruno Haible  <bruno@clisp.org>
3967
3968         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
3969
3970 2005-03-03  Derek R. Price  <derek@ximbiot.com>
3971             Bruno Haible  <bruno@clisp.org>
3972
3973         * pagealign_alloc.h: New file.
3974         * pagealign_alloc.c: New file.
3975
3976 2005-01-28  Bruno Haible  <bruno@clisp.org>
3977
3978         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
3979         stpncpy.c uses it.
3980
3981 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
3982
3983         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
3984         The workaround isn't strictly needed for POSIX conformance, and
3985         it's too much of a pain to configure and maintain.  We'll ask
3986         people to fix their kernels instead.
3987         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
3988         (NANOSLEEP_BUG_WORKAROUND): Remove.
3989         (xnanosleep): Remove the workaround.
3990
3991 2005-02-12  Bruno Haible  <bruno@clisp.org>
3992
3993         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
3994
3995 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
3996
3997         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
3998         * timespec.h (gettime): Return void, since it always
3999         succeeds now.  All uses changed.
4000         * gettime.c (gettime) Likewise.
4001         [HAVE_NANOTIME]: Prefer nanotime.
4002         Assume gettimeofday succeeds, as POSIX requires.
4003         Assime time () succeeds, since other code already does.
4004         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4005         (timespec_subtract): Remove.
4006         (NANOSLEEP_BUG_WORKAROUND): New constant.
4007         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4008         things considerably.  Use it only on GNU/Linux hosts, since the
4009         workaround shouldn't be needed elsewhere.
4010
4011 2005-02-24  Bruno Haible  <bruno@clisp.org>
4012
4013         * gettext.h: Update from GNU gettext 0.14.2.
4014
4015 2005-02-24  Bruno Haible  <bruno@clisp.org>
4016
4017         * localcharset.c: Update from GNU gettext 0.14.2.
4018         * config.charset: Update from GNU gettext 0.14.2.
4019
4020 2005-02-22  Simon Josefsson  <jas@extundo.com>
4021
4022         * iconvme.h, iconvme.c: New files, from libc.
4023
4024 2005-02-20  Neil Conway  <neilc@samurai.com>
4025
4026         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4027         returned by OSX/Darwin if the specified buffer is not large
4028         enough for the hostname.
4029
4030 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4031
4032         * memrchr.h: New file.
4033         * chdir-long.c: Include it.
4034         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4035         Don't bother including stddef.h.
4036
4037 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4038
4039         * argp-help.c (__argp_help): Create a fake struct argp_state and
4040         pass it to _help, otherwise the latter coredumps trying to
4041         dereference state.root_argp.
4042
4043 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4044
4045         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4046         inclusion.
4047         Include <sys/types.h>, for dev_t.
4048         (ME_DUMMY, ME_REMOTE): Move from here....
4049         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4050         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4051         Dmitry V. Levin.
4052         Include mountlist.h first, to test the interface.
4053
4054 2005-01-29  Bruno Haible  <bruno@clisp.org>
4055
4056         * progname.c (program_name): Initialize.
4057         Needed when linking statically on MacOS X.
4058
4059 2005-01-28  Bruno Haible  <bruno@clisp.org>
4060
4061         * javacomp.sh.in: New file, from GNU gettext.
4062         * javacomp.h: New file, from GNU gettext.
4063         * javacomp.c: New file, from GNU gettext.
4064
4065 2005-01-26  Bruno Haible  <bruno@clisp.org>
4066
4067         * javaexec.sh.in: New file, from GNU gettext.
4068         * javaexec.h: New file, from GNU gettext.
4069         * javaexec.c: New file, from GNU gettext.
4070
4071 2005-01-26  Simon Josefsson  <jas@extundo.com>
4072
4073         * gai_strerror.c: Use GPL in header.
4074
4075 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4076
4077         * argp-help.c (hol_entry_help): Avoid using non-constant
4078         initializers for struct pentry_state.
4079         (__argp_error): Check return value of __asprintf
4080         (__argp_failure): Translate error message
4081
4082         * argp-parse.c: Removed braces around the expansion of N_()
4083
4084 2005-01-21  Jim Meyering  <jim@meyering.net>
4085
4086         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4087         same value as for Solaris 9.
4088
4089         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4090         component length.  This included changing the parameter to be
4091         of type `char *' rather than `char const *'.
4092         * chdir-long.h (chdir_long): Update prototype.
4093
4094         * openat.c (fdopendir, fstatat): New functions.
4095         * openat.h: Include headers required for use of DIR and struct stat.
4096         [AT_SYMLINK_NOFOLLOW]: Define.
4097         (fdopendir, fstatat): Add prototypes.
4098
4099 2005-01-21  Bruno Haible  <bruno@clisp.org>
4100
4101         * classpath.h: New file, from GNU gettext.
4102         * classpath.c: New file, from GNU gettext.
4103
4104 2005-01-20  Simon Josefsson  <jas@extundo.com>
4105
4106         * version-etc-fsf.c: New file, with version_etc_copyright.
4107         * version-etc.c: Remove version_etc_copyright.
4108         * version-etc.h (version_etc_copyright): Use [] instead of * in
4109         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4110
4111 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4112
4113         * save-cwd.c (save_cwd): Remove code to support the case
4114         where fchdir is missing or flaky.
4115
4116 2005-01-20  Simon Josefsson  <jas@extundo.com>
4117
4118         * base64.h (isbase64): Add.
4119
4120         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4121         using a unsigned prototype, don't inline.
4122         (base64_decode): Use it.
4123
4124 2005-01-19  Bruno Haible  <bruno@clisp.org>
4125
4126         * sh-quote.h: New file, from GNU gettext.
4127         * sh-quote.c: New file, from GNU gettext.
4128
4129 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4130
4131         Merge changes from coreutils, as described below in several
4132         changelogs dated today.
4133
4134         * save-cwd.c: Include "save-cwd.h" before other include files.
4135         (O_DIRECTORY): Remove; not needed here, since "." must be
4136         a directory.  All uses removed.
4137         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4138         universal on Suns, and we also need to test for IRIX.
4139         Revamp code to use 'if' rather than '#if'.
4140         Avoid unnecessary comparison of cwd->desc to 0.
4141
4142         * utimens.c (futimens): Robustify the previous patch, by checking
4143         for known valid error numbers rather than observed invalid ones.
4144
4145 2005-01-18  Jim Meyering  <jim@meyering.net>
4146
4147         * version-etc.c (version_etc_copyright): Update copyright date.
4148
4149         * utimens.c (futimens): Account for the fact that futimes
4150         can also fail with errno == ENOSYS or errno == ENOENT.
4151         Patch from Dmitry V. Levin.
4152
4153         Change the name of the robust chdir function from chdir to chdir_long.
4154         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4155         (restore_cwd): Use chdir_long, not chdir.
4156         * chdir-long.c: Renamed from chdir.c.
4157         * chdir-long.h: Renamed from chdir.h.
4158         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4159         Hurd.
4160
4161 2005-01-18  Bob Proulx  <bob@proulx.com>
4162
4163         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4164         offsetof() macro construct to avoid compile failure with native HP-UX
4165         11.0 ANSI C compiler.
4166
4167 2005-01-06  Bruno Haible  <bruno@clisp.org>
4168
4169         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4170         because stpncpy.m4 takes care of it.
4171
4172 2004-01-24  Bruno Haible  <bruno@clisp.org>
4173
4174         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4175
4176 2003-10-09  Bruno Haible  <bruno@clisp.org>
4177
4178         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4179
4180 2005-01-06  Bruno Haible  <bruno@clisp.org>
4181
4182         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4183         * fwriteerror.c: Include <stdbool.h>.
4184         (fwriteerror): At the end, close the file stream. Record whether
4185         stdout was already closed.
4186
4187 2004-05-27  Bruno Haible  <bruno@clisp.org>
4188
4189         * execute.c (environ): Declare if needed.
4190         * pipe.c (environ): Likewise.
4191         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4192
4193 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4194
4195         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4196         definitions to be after all include files, to avoid collisions.
4197         Problem reported by Bob Proulx.
4198
4199 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4200
4201         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4202         not needed.  This removes a dependency on the gettext module.
4203         [defined _LIBC]: Do not include <libintl.h>; not needed.
4204
4205 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4206
4207         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4208         HAVE_DECL_STRTOLD.
4209
4210 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4211
4212         * argp-parse.c: Include <stddef.h>.
4213         (alignof, alignto): New macros.
4214         (parser_init): Don't assume that void * is aligned sufficiently
4215         for struct option.
4216
4217         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4218         need to extend the stack.
4219         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4220         large.
4221
4222 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4223
4224         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4225
4226 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4227
4228         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4229         Remove now-obsolete comment about AIX.
4230         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4231         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4232         (YYMAXDEPTH): New macro.
4233
4234 2004-12-18  Bruno Haible  <bruno@clisp.org>
4235
4236         * fatal-signal.c (fatal_signals): Make non-const.
4237         (init_fatal_signals): New function.
4238         (uninstall_handlers, install_handlers): Ignore signals that were set to
4239         SIG_IGN.
4240         (at_fatal_signal): Call init_fatal_signals.
4241         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4242         SIG_IGN.
4243         Reported by Paul Eggert.
4244
4245 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4246
4247         * getdate.y (textint): New member "negative".
4248         (time_zone_hhmm): New function.
4249         Expect 14 shift-reduce conflicts, not 13.
4250         (o_colon_minutes): New rule.
4251         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4252         (yylex): Set the "negative" member of signed numbers.
4253
4254 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4255
4256         Changes imported from coreutils.
4257         * hard-locale.c: Assume <locale.h> exists.
4258         Include "strdup.h".
4259         (GLIBC_VERSION): New macro.
4260         (hard_locale): Assume setlocale exists.
4261         Rewrite to avoid #ifdef.
4262         Use strdup rather than malloc + strcpy.
4263         * human.c: Assume <locale.h> exists.
4264         (human_readable): Assume localeconv exists.
4265
4266 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4267
4268         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4269         convert T2, not T.  (Imported from libc.)
4270
4271 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4272
4273         * getcwd.c (is_ENAMETOOLONG): New macro.
4274         (__getcwd.c): Don't restore errno; glibc doesn't.
4275         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4276         first, falling back to our code only if its results look suspicious.
4277         Ensure that the resulting buffer is only as large as necessary.
4278
4279         * readutmp.c: Include readutmp.h first.
4280         Include <errno.h>, since readutmp.h no longer does that.
4281         * readutmp.h: Don't include <errno.h>,
4282         <sys/param.h>, <time.h>; not needed to establish interface.
4283         (errno): Remove decl.
4284         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4285         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4286         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4287
4288 2004-11-28  Simon Josefsson  <jas@extundo.com>
4289
4290         * base64.h, base64.c: New file.
4291
4292 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4293
4294         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4295
4296 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4297
4298         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4299         HP's ANSI C compiler.
4300         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4301         Declaring int functions causes warnings on some modern systems and
4302         shouldn't be needed to compile on ancient ones.
4303         * same.c (MIN) [defined MIN]: Don't define, since it's already
4304         defined.
4305
4306         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4307         with the following changes.
4308         (__set_errno): Parenthesize properly.
4309         Include <stdbool.h>.
4310         (MIN, MAX, MATCHING_INO): New macros.
4311         (__getcwd): Define with prototype, not K&R form.
4312         Use heuristics to allocate default buffer on stack if possible.
4313         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4314         behavior, and to avoid the PATH_MAX limit when computing
4315         ../../../../...
4316         Use MATCHING_INO to compare inode number to file.
4317         Check for arithmetic overflow in size calculations.
4318         Fix bug in reallocation of dot array that caused getcwd to fail
4319         on directories nested deeper than 75.
4320         Be more careful about saving errno on error.
4321         Do not use realloc; use only free+malloc, as this is a bit
4322         more flexible and avoids a needless copy operation.
4323         Do not inspect st_dev and st_ino for symbolic links; POSIX
4324         doesn't specify the latter.
4325         Check for closedir errors.
4326         Avoid needless casts.
4327         Use "#ifdef weak_alias" around weak_alias, to be like other
4328         glibc code.
4329         The following changes to getcwd.c have effect only when used in
4330         gnulib; they have no effect inside glibc proper.
4331         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4332         as alloca isn't used.
4333         (alloca, __alloca): Likewise.
4334         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4335         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4336         unconditionally, as gnulib assumes C89 or better.
4337         Do not include <sys/param.h>.
4338         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4339         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4340         better.
4341         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4342         Include <dirent.h> in a way that is compatible with modern Autoconf.
4343         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4344         New macros, if not already defined.
4345         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4346         Use "_LIBC", not "defined _LIBC", for consistency.
4347         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4348         a mempcpy module.
4349         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4350         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4351         * xgetcwd.c: David MacKenzie's old code was removed, so give
4352         credit only to Jim Meyering and adjust the copyright dates.
4353         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4354         <stdlib.h>, <unistd.h>, "pathmax.h".
4355         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4356         (INITIAL_BUFFER_SIZE): Remove.
4357         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4358
4359 2004-11-23  Jim Meyering  <jim@meyering.net>
4360
4361         * getopt_.h: Remove trailing blanks.
4362
4363 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4364
4365         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4366         (futimens): New function, which uses futimes if available.
4367         (futimens, utimens): Support timespec==NULL, with same semantics
4368         as utime and utimens.
4369         * utimens.h (futimens): New decl.
4370
4371 2004-11-23  Jim Meyering  <jim@meyering.net>
4372
4373         * __fpending.c: Add comment.
4374
4375 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4376
4377         * getopt_.h: Re-addition of __getopt_argv_const caused
4378         redefinition warnings. To avoid them, include the defines
4379         in `#if !defined __need_getopt ... #endif'. The only place
4380         where __getopt_argv_const is used is in definitions
4381         of getopt_long and getopt_long_only below, which are as well
4382         protected by `#ifndef __need_getopt'.
4383         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4384         __need_getopt after including <stdio.h> and <unistd.h> These
4385         headers might have defined it.
4386
4387 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4388
4389         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4390         New macros.
4391         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4392         optopt): Use them instead of invoking ## directly; otherwise, the
4393         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4394
4395 2004-11-19  Bruno Haible  <bruno@clisp.org>
4396
4397         * strtok_r.c: Move comments from here...
4398         * strtok_r.h: ... to here.
4399
4400 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4401
4402         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4403         might fail.  Problem reported by Yoann Vandoorselaere.
4404         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4405         that mishandle size_t overflow.
4406
4407 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4408
4409         * canon-host.c: Include "strdup.h".
4410         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4411         Use strdup instead of malloc/strcpy to duplicate strings.
4412
4413         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4414         (human_space_before_unit): New constant.
4415         * human.c (human_readable): Support it.
4416
4417         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4418         (xgetcwd): Set errno correctly when failing.
4419         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4420         the failure is actually due to a PATH_MAX problem.
4421
4422         Further getopt changes to make it more likely that glibc will
4423         buy the changes back.
4424         * getopt.c (POSIXLY_CORRECT): New constant.
4425         (getopt): Use it, so to preserve glibc semantic
4426         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4427         when compiling for libc.
4428         * getopt_.h (__getopt_argv_const): Bring it back.
4429         (getopt_long, getopt_long_only): Use it.
4430
4431         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4432         New arg POSIXLY_CORRECT.  All callers changed.
4433         (getopt): Argv is now char * const *, as per standard.
4434         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4435         not char *__getopt_argv_const *.
4436         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4437         _getopt_long_only_r): Likewise.
4438         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4439         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4440         _getopt_long_r, _getopt_long_only_r): Likewise.
4441         * getopt_.h (__getopt_argv_const): Remove.
4442         (getopt): Argv is now char * const *, as per standard.
4443
4444         * getdate.y (tORDINAL): New token.
4445         (day, relunit): Allow it for relative times.
4446         (relative_time_table): Use tORDINAL for ordinals.
4447
4448 2004-11-15  Jim Meyering  <jim@meyering.net>
4449
4450         * closeout.c: Include "__fpending.h" once again.
4451         Include <stdbool.h>.
4452         (close_stdout): Don't fail just because stdout was closed initially,
4453         since some programs don't write to stdout in the normal course of
4454         operation (other than --version and --help), and we don't want this
4455         function to make e.g. `touch file >&-' fail.
4456         But do fail if it was closed and someone has tried to write to it.
4457         E.g., `printf foo >&-' must fail.
4458
4459 2004-11-11  Simon Josefsson  <jas@extundo.com>
4460
4461         * strtok_r.h, strtok_r.c: New file.
4462
4463 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4464
4465         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4466         we can stop lying to compilers about the constness of argv when we
4467         are compiled outside glibc.
4468         (getopt, getopt_long, getopt_long_only): Use it.
4469         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4470         getopt): Likewise.
4471         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4472         _getopt_long_only_r): Likewise.
4473         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4474         _getopt_long_only_r): Likewise.
4475
4476         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4477         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4478         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4479         the other external symbols.
4480         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4481         declaration, since the above renaming now works around collisions.
4482
4483 2004-11-11  Jim Meyering  <jim@meyering.net>
4484
4485         * linebreak.c: Remove trailing blanks.
4486         * alloca_.h: Likewise.
4487         * acosl.c: Likewise.
4488         * euidaccess.c: Likewise.
4489         * allocsa.h: Likewise.
4490
4491 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4492
4493         * mktime.c (SHR): New macro, which is a portable
4494         substitute for >> that should work even on Crays.
4495         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4496         Problem reported by Mark D. Baushke in
4497         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4498         * getdate.y (SHR): Likewise.
4499         (tm_diff): Use it.
4500         * strftime.c (SHR): Likewise.
4501         (tm_diff): Use it.
4502         * quotearg.c (struct quoting_options): Use unsigned int for
4503         quote_these_too, so that right shifts are well defined.  All uses
4504         changed.
4505
4506 2004-11-10  Simon Josefsson  <jas@extundo.com>
4507
4508         * getaddrinfo.h, getaddrinfo.c: New files.
4509
4510 2004-11-10  Jim Meyering  <jim@meyering.net>
4511
4512         Ensure that no close failure goes unreported.
4513         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4514         return early when it seems there's nothing to flush.
4515         Don't include __fpending.h.
4516
4517 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4518
4519         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4520
4521 2004-11-05  Bruno Haible  <bruno@clisp.org>
4522
4523         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4524         Reported by Mark D. Baushke <mdb@cvshome.org>.
4525
4526 2004-11-04  Bruno Haible  <bruno@clisp.org>
4527
4528         2004-09-11  Bruno Haible  <bruno@clisp.org>
4529                 * allocsa.valgrind: New file.
4530         2004-02-06  Bruno Haible  <bruno@clisp.org>
4531                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4532                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4533                 Reported by Christopher Seip <chris.seip@hp.com>.
4534
4535 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4536
4537         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4538         with errno == ERANGE if the buffer is too small.
4539         Problem reported by Mark D. Baushke.
4540
4541 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4542
4543         * xreadlink.c (MAXSIZE): New macro.
4544         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4545         size does not exceed MAXSIZE.  Avoid cast.
4546         As suggested by Mark D. Baushke in
4547         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4548         if readlink fails with buffer size just under MAXSIZE, try again
4549         with MAXSIZE.
4550
4551 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4552         and  Paul Eggert  <eggert@cs.ucla.edu>
4553
4554         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4555         (get_date): Overparenthesize to avoid GCC warning.
4556
4557 2004-11-02  Bruno Haible  <bruno@clisp.org>
4558
4559         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4560         function returns void.
4561
4562 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4563
4564         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4565         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4566         already declared.
4567
4568 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4569
4570         * getdate.y: Add support for TZ="foo" within a date string.
4571         Fix some bugs near time_t boundaries.  Reject dates with
4572         out-of-range components, e.g., "Sept 31".
4573         Include <stdlib.h>, "setenv.h", "xalloc.h".
4574         (ISDIGIT_LOCALE): Remove; unused.
4575         Note that the TZ and time functions used here are not reentrant.
4576         (mktime_ok, get_tz): New functions.
4577         (TZBUFSIZE): New constant.
4578         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4579         This requires that we sometimes generate our own TZ="XXX..." setting.
4580
4581 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4582
4583         * mktime.c (not_equal_tm): Remove redundant check.
4584
4585 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4586
4587         * getdate.y: Use Bison 1.875 features, and some minor
4588         code cleanups.  This change does not affect semantics.
4589         Don't include <stdlib.h>; no longer needed.
4590         Don't include unlocked-io.h; only the "#if TEST" code uses
4591         stdio, and performance isn't crucial there.
4592         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4593         Bison 1.875 features as described below.
4594         All uses of "PC." replaced by "pc->".
4595         (YYSTYPE): Add a forward declaration.
4596         (yylex, yyerror): Use full prototypes in forward decls.
4597         Use "%pure-parser" rather than obsolescent "%pure_parser".
4598         Use %parse-param and %lex-param instead of obsolescent
4599         YYPARSE_PARAM and YYLEX_PARAM.
4600         (meridian_table, month_and_day_table, time_units_table,
4601         relative_time_table, time_zone_table, military_table,
4602         lookup_zone, lookup_word, get_date):
4603         Use NULL instead of 0 where appropriate.
4604         (to_hour): Avoid abort (), to avoid a dependency on
4605         stdlib.h.
4606         (yyerror, yylex): Now accepts parser_control * arg.
4607         (main) [TEST]: Use '\0' rather than 0 for char.
4608
4609 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4610
4611         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4612         It's now the caller's responsibility to handle the case where
4613         !HAVE_GETPAGESIZE && !defined getpagesize.
4614
4615         * mktime.c (leapyear): Arg is long int, not int.
4616
4617 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4618
4619         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4620
4621 2004-10-12  Simon Josefsson  <jas@extundo.com>
4622
4623         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4624         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4625         to real functions.
4626
4627 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4628
4629         * vsnprintf.h: New file.
4630         * vsnprintf.c: New file.
4631
4632 2004-10-07  Bruno Haible  <bruno@clisp.org>
4633
4634         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4635         into the provided buffer.
4636
4637 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4638
4639         * diacrit.c, diacrit.h: Add GPL notice.
4640
4641         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4642         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4643         * logl.c (logl): Keep the code as similar to glibc as possible.
4644         This avoids a potential constant-folding bug.
4645
4646 2004-10-05  Bruno Haible  <bruno@clisp.org>
4647
4648         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4649
4650 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4651
4652         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4653         * xmalloc.c (xmemdup): Likewise.
4654         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4655         XFREE): Remove these long-obsolescent macros.
4656         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4657         * xstrdup.c: Remove.
4658
4659         * regex.c (re_comp): Cast gettext return value to char *,
4660         Problem reported by Martin Neitzel via Mark D. Baushke.
4661
4662 2004-10-04  Simon Josefsson  <jas@extundo.com>
4663
4664         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4665         '#ifdef USE_UNLOCKED_IO'.
4666
4667 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4668
4669         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4670         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4671         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4672         regex.c, sha1.c, version-etc.c, yesno.c:
4673         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4674         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4675         the includer's responsibility.
4676
4677         Sync from coreutils.
4678
4679         * modechange.c (mode_compile): Don't decrement a pointer that
4680         points to the start of a string, as the C Standard says the
4681         resulting behavior is undefined.
4682
4683         * backupfile.h (enum backuptype): Rename none -> no_backups,
4684         simple -> simple_backups, numbered_existing ->
4685         numbered_existing_backups, numbered -> numbered_backups
4686         to avoid shadowing problems.  All uses changed.
4687         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4688         * backupfile.c (check_extension, numbered_backup):
4689         Rename locals to avoid shadowing 'basename'.
4690         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4691         once.
4692
4693         * .cppi-disable: Add getopt_.h, getopt_int.h.
4694         * .cvsignore: Add getopt.h.
4695
4696 2004-10-04  Simon Josefsson  <jas@extundo.com>
4697
4698         * memmem.h: New file.
4699         * memmem.c: New file, taken from glibc.
4700
4701 2004-10-02  Jim Meyering  <jim@meyering.net>
4702
4703         * dirfd.h, getpagesize.h: Add copyright notice.
4704
4705 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4706
4707         * snprintf.c: Remove comments as to why each header is needed.
4708
4709 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
4710
4711         * strsep.h: New file.
4712         * strsep.c: New file.
4713
4714 2004-10-01  Simon Josefsson  <jas@extundo.com>
4715
4716         * snprintf.c (snprintf): Handle size==0.
4717
4718 2004-10-01  Simon Josefsson  <jas@extundo.com>
4719             Bruno Haible  <bruno@clisp.org>
4720
4721         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4722         (snprintf): Declare 'args'.
4723
4724 2004-09-30  Simon Josefsson  <jas@extundo.com>
4725
4726         * snprintf.h, snprintf.c: New files.
4727
4728 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4729
4730         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4731         (hol_entry_help): Never translate an empty string.
4732         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4733         * argp.h (OPTION_NO_TRANS): New option.
4734
4735 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
4736
4737         * xvasprintf.c: Include xalloc.h.
4738         (xvasprintf): Use xalloc_die, not xmalloc_die.
4739
4740 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
4741
4742         * dummy.c: Change copyright notice to FSF, and license to GPL.
4743
4744 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
4745
4746         * argp-pvh.c (argp_program_version_hook): Provide initial value.
4747         Problem reported by Bruno Haible in:
4748         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4749
4750 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
4751
4752         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4753         in case some system header has #define'd it.  Problem reported by
4754         Soeren D. Schulze in
4755         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4756
4757 2004-09-08  Bruno Haible  <bruno@clisp.org>
4758
4759         * stdint_.h: New file, taken from GNU clisp.
4760
4761 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
4762
4763         * xvasprintf.h: New file.
4764         * xvasprintf.c: New file.
4765         * xasprintf.c: New file.
4766
4767 2004-09-08  Bruno Haible  <bruno@clisp.org>
4768
4769         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4770         is > INT_MAX.
4771         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4772
4773 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4774
4775         Import from coreutils.
4776         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4777         strings on unbounded length.  alloca's performance benefits aren't
4778         that important here.
4779         (V_STRDUP): Remove.
4780         (parse_with_separator): New function, with most of the internals
4781         of the old parse_user_spec.  Allow user to omit both user and group,
4782         for compatibility with FreeBSD.
4783         Clone only the user name, not the entire spec.
4784         Do not set *uid, *gid unless entirely successful.
4785         Avoid memory leak in some failing cases.
4786         Fix regression for USER.GROUP reported by Dmitry V. Levin in
4787         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4788         (parse_user_spec): Rewrite to use parse_with_separator.
4789
4790 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
4791
4792         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4793         its complicated substitute.
4794         * argp-help.c: Include <errno.h>, for program_invocation_short_name
4795         and program_invocation_name.
4796         (__argp_basename) [!_LIBC]: Remove; the only use was
4797         replaced by its body.
4798         (__argp_short_program_name): Change condition from
4799         !defined __argp_short_program_name to
4800         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4801         to match argp-namefrob.h.
4802         (__argp_failure): Don't assume strerror_r returns char *.
4803         * argp-parse.c (N_): Define unconditionally.
4804         (argp_default_options): Fill out initializers with 0 to avoid
4805         gcc warnings.
4806
4807 2004-08-12  Simon Josefsson  <jas@extundo.com>
4808
4809         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4810         * getopt_.h: Renamed from getopt.h.
4811
4812 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4813
4814         Merge from coreutils.
4815
4816         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4817         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
4818         for Reliant Unix 5.43.
4819
4820         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4821         (union fooround): Use uintmax_t, not long int.
4822         The rest is a merge from libc:
4823         [defined _LIBC]: Include <shlib-compat.h>.
4824         (_obstack) [defined _LIBC]: Remove after 2.3.4.
4825
4826         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4827
4828         * strverscmp.c: Convert to UTF-8.
4829
4830 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4831
4832         * obstack.h (obstack_empty_p):
4833         Don't assume that chunk->contents is suitably aligned.
4834         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4835         Likewise. Problem reported by Benno in
4836         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4837
4838         * chown.c (rpl_chown): Work even if the file is writeable but not
4839         readable.  This could be improved further but it'd take some work.
4840
4841 2004-08-08  Simon Josefsson  <jas@extundo.com>
4842
4843         * xgethostname.c: Don't include error.h (not used).
4844
4845         * getpass.h: Add.
4846         * getpass.c: Include getpass.h first.
4847
4848 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
4849
4850         * xalloc-die.c: New files.
4851         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4852         All uses removed.
4853         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4854         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4855         (_, N_, xalloc_die): Move to xalloc-die.c.
4856         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4857         so that we needn't mess with xalloc_msg_memory_exhausted.
4858
4859         * sha1.h: Renamed from sha.h.
4860         (SHA1_H): Renamed from _SHA_H.
4861         (sha1_ctx): Renamed from sha_ctx.
4862         (sha1_init_ctx): Renamed from sha_init_ctx.
4863         (sha1_process_block): Renamed from sha_process_block.
4864         (sha1_process_bytes): Renamed from sha_process_bytes.
4865         (sha1_finish_ctx): Renamed from sha_finish_ctx.
4866         (sha1_read_ctx): Renamed from sha_read_ctx.
4867         (sha1_stream): Renamed from sha_stream.
4868         (sha1_buffer): Renamed from sha_buffer.
4869         * sha1.c: Likewise; renamed from sha.c.
4870         Do not include <sys/types.h>.
4871         Include <stddef.h> rather than <stdlib.h>.
4872
4873 2004-08-08  Bruno Haible  <bruno@clisp.org>
4874
4875         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4876         FILESYSTEM_PREFIX_LEN.
4877         * progreloc.c: Likewise.
4878         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4879
4880 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
4881
4882         Merge from tar.
4883         * argp-help.c (make_hol, hol_append): Don't assume that
4884         SIZE_MAX is a valid preprocessor constant.
4885         (__argp_basename): Change from "#ifndef _LIBC"
4886         to "#ifndef __argp_short_program_name", so that
4887         we don't compile these functions for tar.
4888
4889         More merges from coreutils.
4890         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4891         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4892         yesno.h: New files.
4893         * addext.c: Remove; no longer needed.
4894         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
4895         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
4896         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
4897         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
4898         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
4899         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
4900         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
4901         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
4902         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
4903         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
4904         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
4905         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
4906         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
4907         Import changes from coreutils.
4908
4909 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
4910
4911         Merge from coreutils.
4912
4913         * .gdb-history: Remove; this doesn't belong here.
4914
4915         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
4916         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
4917         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
4918
4919         * dirname.h: Include <stdbool.h>.
4920         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
4921         for consistency with POSIX terminology.  All uses changed.
4922         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
4923         (strip_trailing_slashes): Use bool for booleans.
4924         * stripslash.c (strip_trailing_slashes): Likewise.
4925
4926         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
4927         sometimes returns a positive errno value even when it succeeds.
4928         (print_errno_message) [!LIBC]: Fall back on strerror if
4929         __strerror_r fails.
4930
4931         * path-concat.c (mempcpy): Don't define if a system header defines it.
4932         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
4933         (longest_relative_suffix): New function.
4934         (path_concat): Use it.  Assume first argument is not NULL.
4935         Port to DOS.  Omit redundant separators.
4936         Report an error instead of returning NULL.
4937         Use mempcpy instead of memcpy.
4938         (xpath_concat): Remove: not declared or used.
4939
4940         * same.h: Include <stdbool.h>
4941         (same_name): Return bool, not int.
4942         * same.c (same_name): Likewise.
4943         (errno): Don't declare; we assume C89 or better now.
4944
4945         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
4946         if not already defined.
4947
4948         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
4949         * dup-safer.c (errno): Likewise.
4950
4951 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
4952
4953         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
4954         working.
4955
4956 2004-08-03  Simon Josefsson  <jas@extundo.com>
4957
4958         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
4959         * progname.h: Don't include stdbool.h.
4960
4961 2004-08-02  Simon Josefsson  <jas@extundo.com>
4962
4963         * getsubopt.h: New file, with comments from Bruno Haible.
4964         * getsubopt.c: New file, from glibc, but slightly modified based on
4965         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
4966
4967 2004-08-01  Simon Josefsson  <jas@extundo.com>
4968
4969         * xgetdomainname.c: Include stdlib.h, for free().
4970
4971 2004-07-16  Simon Josefsson  <jas@extundo.com>
4972
4973         * dummy.c: New file.
4974
4975 2004-07-16  Bruno Haible  <bruno@clisp.org>
4976
4977         * backupfile.h: Add extern "C" for C++.
4978         * closeout.h: Likewise.
4979         * copy-file.h: Likewise.
4980         * findprog.h: Likewise.
4981         * full-write.h: Likewise.
4982         * pathname.h: Likewise.
4983         * progname.h: Likewise.
4984         * stpcpy.h: Likewise.
4985         * stpncpy.h: Likewise.
4986         * strcase.h: Likewise.
4987         * strstr.h: Likewise.
4988         * xalloc.h: Likewise.
4989
4990         * mbswidth.h: Add extern "C" for C++.
4991         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
4992
4993 2004-07-09  Simon Josefsson  <jas@extundo.com>
4994
4995         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
4996         failed without this.)
4997
4998 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4999
5000         * fchown-stub.c: New file.
5001
5002 2004-06-24  Jim Meyering  <jim@meyering.net>
5003
5004         * obstack.h (obstack_base): Cast to (void *), per documentation.
5005
5006 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5007
5008         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5009
5010 2004-06-01  Jim Meyering  <jim@meyering.net>
5011
5012         * calloc.c: New file.
5013
5014 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5015
5016         * getdate.y (yylex): Allow space between sign and number.
5017         Problem reported by Dan Jacobson.
5018
5019 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5020         and  Jim Meyering  <jim@meyering.net>
5021
5022         Merge from coreutils CVS.
5023
5024         * stat-macros.h: New file, with contents from file-type.h
5025         and coreutils' system.h.
5026         * file-type.c: Include "stat-macros.h".
5027         * file-type.h (file_type): Move all macro definitions to new file,
5028         stat-macros.h.
5029
5030         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5031         Wrap old code with this conditional.
5032         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5033         function that does not dereference symlinks.
5034         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5035
5036         * xreadlink.c: Include xreadlink.h first, to catch .h file
5037         dependency problems.
5038         (xreadlink): Accept new arg SIZE, for efficiency.
5039         All decls and uses changed.
5040         * xreadlink.h: Include <stddef.h>, for size_t.
5041
5042         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5043         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5044
5045         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5046
5047 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5048
5049         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5050         macros to be defined.
5051         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5052         the allocator returns NULL because the requested size is zero.
5053
5054 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5055
5056         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5057         var.  Add comment explaining why libc still defines it.  This
5058         merges the following patch from glibc:
5059         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5060
5061 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5062
5063         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5064         present in glibc since revision 1.1 of this file.
5065         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5066         obstack_alignment_mask, obstack_alloc, obstack_base,
5067         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5068         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5069         obstack_grow0, obstack_init, obstack_int_grow,
5070         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5071         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5072         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5073         nonexistent functions.
5074
5075 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5076             Paul Eggert  <eggert@cs.ucla.edu>
5077
5078         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5079
5080 2004-05-14  Bruno Haible  <bruno@clisp.org>
5081
5082         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5083         that consists of a '.' followed by an empty digit string.
5084         Patch by Tor Lillqvist <tml@iki.fi>.
5085
5086 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5087
5088         Port obstack to the AS/400, where pointers are 16 bytes wide and
5089         you cannot cast an integer to a valid pointer.  This patch is
5090         currently waiting to be integrated into glibc; see
5091         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5092
5093         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5094         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5095         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5096         (struct obstack): temp member is now a union of a pointer and
5097         an integer, instead of an integer.  All integer uses changed.
5098         This does not affect the physical layout of struct obstack,
5099         except on hosts (like the AS/400) where the size or alignment of
5100         void * is greater than that of ptrdiff_t.
5101         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5102         __STDC__)]: Store temporary in pointer member of union, not
5103         integer member.
5104         * obstack.c: Include <stddef.h>, for offsetof.
5105         (struct fooalign): Remove; it doesn't need a name.
5106         (union fooround): Change double to long double, and add void *.
5107         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5108         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5109         not a macro.  Hence the values are always int; so remove all
5110         casts-to-int in uses.
5111
5112 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5113             Derek Price  <derek@ximbiot.com>
5114
5115         * alloca.c: Include <alloca.h>, to get our interface.
5116         * alloca_.h: Use __alloca on AIX, so that we don't have to
5117         include <alloca.h> first.  Use C89 prototype for alloca; this
5118         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5119         Use #elif for simplicity, since we can assume C89 now.
5120         Don't try to source the system alloca.h since it will not be found
5121         and to prevent recursively including its replacement.
5122         * fnmatch.c: Include <alloca.h> instead of opencoding.
5123         * regex.c: Likewise.
5124
5125 2004-05-16  Derek Price  <derek@ximbiot.com>
5126             Paul Eggert  <eggert@cs.ucla.edu>
5127
5128         getline cleanup.  This changes the getndelim2 API: both order of
5129         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5130         no delimiter).
5131
5132         * getline.c: Don't include stddef.h or stdio.h, since our
5133         interface does that.
5134         (getline): Always use getdelim, so that we don't have two
5135         copies of this code.
5136         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5137         if available.
5138         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5139         (GETNDELIM2_MAXIMUM): New macro.
5140         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5141         instead of the old practice of delim2==0.  All callers changed.
5142         Return -1 on overflow, instead of returning junk.
5143         Do not set *linesize unless allocation succeeds.
5144         * getndelim2.h: Do not include stddef.h; no longer needed, now
5145         that we include sys/types.h.
5146         * getnline.h: Likewise.
5147         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5148         (getndelim2): Reorder arguments.
5149         * getnline.c (getnline, getndelim):
5150         Don't discard the NMAX argument.
5151         (getnline): Invoke getndelim, to avoid code duplication.
5152         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5153         of (size_t) -1 by callers of the getnline family.
5154
5155 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         * nanosleep.c (suspended): Change its type from int to
5158         sig_atomic_t volatile.
5159         (first_call): Make it private to rpl_nanosleep, and have it
5160         be zero initially as that's a bit faster.
5161         (my_usleep): Round up fractional times instead of truncating them,
5162         as this is the usual meaning for 'sleep'.
5163
5164         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5165         doesn't work.
5166         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5167         (ENOSYS): Define if not defined.
5168         (settime): Fall back on stime if it exists and settimeofday fails.
5169         But don't bother with fallbacks if a method fails with errno == EPERM.
5170
5171 2004-05-11  Jim Meyering  <jim@meyering.net>
5172
5173         Prior to this change, the save_cwd caller required read access to the
5174         current directory on most systems (ones with the fchdir function).
5175
5176         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5177         fails, try write-only, and finally, resort to using xgetcwd.
5178
5179 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5180
5181         * obstack.c, obstack.h: Import changes from libc.
5182
5183 2004-04-28  Bruno Haible  <bruno@clisp.org>
5184
5185         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5186         implicitly appends .exe to executables.
5187         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5188         accepts Windows pathnames.
5189         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5190         Cygwin like Windows, since it now accepts Windows pathnames.
5191         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5192         Cygwin like Windows, since it now accepts Windows pathnames.
5193         Reported by Derek Robert Price <derek@ximbiot.com>.
5194
5195 2004-04-20  Jim Meyering  <jim@meyering.net>
5196
5197         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5198
5199 2004-04-20  Jim Meyering  <jim@meyering.net>
5200             Bruno Haible  <bruno@clisp.org>
5201
5202         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5203         memory when realloc fails.
5204
5205 2004-04-18  Jim Meyering  <jim@meyering.net>
5206
5207         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5208         don't leak memory and do call END_UTMP_ENT.
5209
5210 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5211
5212         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5213         (CHAR_BIT): Remove, since we assume C89.
5214         Include <stdint.h> if available, as per current Autoconf CVS advice.
5215
5216 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5217
5218         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5219         not bool, to be more consistent with Unix conventions.
5220         Suggested by Bruno Haible.
5221
5222         Merge from coreutils.
5223
5224         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5225         New files.
5226
5227         * getdate.h: Include stdbool.h, and timespec.h instead of
5228         the usual <time.h> dance.
5229         (get_date): Change signature to support fractional time stamps.
5230         All callers changed.
5231         * getdate.y: Include "getdate.h" first, as we can now
5232         assume C89 and don't need to worry about 'const'.
5233         Similarly, include "unlocked-io.h" near start, not in middle.
5234         Include <limits.h>.
5235         (textint.value): Use long int rather than int.
5236         (textint.digits): Use size_t rather than int.
5237         (BILLION, LOG10_BILLION): New constants.
5238         (parser_control): New member rel_ns.  Members day_ordinal,
5239         time_zone, month, day, hour, minutes, rel_year, rel_month,
5240         rel_day, rel_hour, rel_minutes, rel_seconds
5241         are now long int, not int.  Member seconds is now struct timespec,
5242         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5243         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5244         not int.
5245         (%union.intval): Now long int, not int.
5246         New member timespec.
5247         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5248         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5249         (spec): Now is a timespec or an item list.
5250         (timespec, items): New nonterminals.
5251         (time, rel, relunit, number, get_date):
5252         Add support for fractional seconds.
5253         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5254         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5255         (to_hour): First arg is now long int, not int.
5256         (to_year): Returns long int, not int.
5257         Don't treat year -70 like 70.
5258         (tm_diff): Returns long int, not int.
5259         (lookup_word): Use bool instead of int when appropriate.
5260         (yylex): Use size_t for count, not int.
5261         Detect overflow when parsing large integer constants.
5262         Add support for fractions.
5263         (get_date): Make pointers 'const' if possible.
5264         Use more-portable code to detect integer overflow.
5265         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5266         Don't use ctime; it's not reliable if the year has >4 digits.
5267
5268         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5269         This is for compatibility with BSD.
5270
5271         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5272         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5273         From coreutils' system.h.
5274
5275         * userspec.c: Don't include "posixver.h".
5276         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5277         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5278         compatible extension.  Simplify code by removing a boolean int
5279         that was always nonzero if a string was nonnull.
5280
5281 2004-03-30  Jim Meyering  <jim@meyering.net>
5282
5283         Merge from coreutils.
5284
5285         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5286
5287         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5288         an empty input stream.
5289
5290         * readtokens.c: Include <stdbool.h>.
5291         (readtoken): Use `size_t' rather than int/long.
5292         All callers adjusted.
5293         Use `bool' rather than `int' where appropriate.
5294         Use memset rather than an explicit loop.
5295         Use x2nrealloc rather than xrealloc.
5296         Allow the use of `\0' as a delimiter.
5297         (readtokens): Likewise.
5298         * readtokens.h (readtoken, readtokens): Update prototypes.
5299
5300 2004-03-30  Bruno Haible  <bruno@clisp.org>
5301
5302         * getloadavg.c (getloadavg): Don't assume setlocale returns
5303         nonnull.
5304
5305 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5306
5307         Merge changes to getloadavg.c from coreutils and Emacs.
5308
5309         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5310         Define to an expression, not to the empty string.
5311         Include cloexec.h and xalloc.h.
5312         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5313         Use set_cloexec_flag rather than rolling our own.
5314         * cloexec.c, cloexec.h: New files.
5315
5316 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5317
5318         * getopt.h: Sync with libc CVS.
5319
5320 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5321             Bruno Haible  <bruno@clisp.org>
5322
5323         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5324         not on all platforms that have <wchar.h>.
5325         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5326
5327 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5328
5329         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5330         Sync with libc CVS.
5331         * getopt_int.h: New file, also synced from libc.
5332
5333 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5334
5335         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5336         '#if' expressions.  Unlike the code it replaces, it does not
5337         depend on (defined _SC_PAGESIZE).  However, it does depend on
5338         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5339         first reported by Jason Andrade in
5340         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5341
5342 2004-01-18  Simon Josefsson  <jas@extundo.com>
5343
5344         * strdup.h: New file.
5345         * strdup.c: Include it.
5346         * path-concat.c: Include strdup.h. Drop strdup declaration.
5347         * userspec.c: Include strdup.h. Drop strdup declaration.
5348
5349 2004-02-06  Karl Berry  <karl@gnu.org>
5350
5351         * config.charset: update from gettext 0.14.1.
5352
5353 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5354
5355         Add comments and code, prompted by suggestions from Bruno Haible
5356         for sh-quote.
5357         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5358         describing the enum quoting_style values.
5359         * quotearg.c (quotearg_alloc): New function.
5360         (quotearg_buffer_restyled): Treat lone { and } as special.
5361         Treat = as special.  Work around bug with older shells
5362         that "see" a '\' that is really the 2nd byte of a multibyte char.
5363         Quote empty string with shell_quoting_style.
5364
5365 2004-02-03  Bruno Haible  <bruno@clisp.org>
5366
5367         * pipe.h: New file, from GNU gettext.
5368         * pipe.c: New file, from GNU gettext.
5369
5370 2004-01-27  Bruno Haible  <bruno@clisp.org>
5371
5372         * execute.h: New file, from GNU gettext.
5373         * execute.c: New file, from GNU gettext.
5374         * w32spawn.h: New file, from GNU gettext.
5375
5376 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5377
5378         Exit-status fix from coreutils.
5379
5380         Use exit_failure consistently in place of EXIT_FAILURE,
5381         so that program exit statuses are consistent on failure.
5382
5383         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5384         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5385         * argmatch.h: Comment fix to match the above.
5386         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5387         Now a macro referring to exit_failure, instead of a separate
5388         variable.  Include "exitfail.h" to get it.
5389         * xstrtol.h: Include "exitfail.h".
5390         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5391
5392         * long-options.c (parse_long_options): Use prototype
5393         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5394         for clarity.
5395
5396 2004-01-21  Jim Meyering  <jim@meyering.net>
5397
5398         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5399         so as not to conflict with a different-sized __mktime_internal
5400         function in GNU libc.
5401         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5402         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5403
5404 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5405
5406         Merge from diffutils.
5407
5408         * file-type.c (file_type): Add typed memory objects.
5409         * file-type.h (S_TYPEISTMO): New macro.
5410
5411         * c-stack.h (c_stack_action): Remove argv argument.
5412         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5413         (die): Don't calculate message unless segv_action returns.
5414         (get_stack_location, min_address_from_argv, max_address_from_argv,
5415         volatile stack_base, volatile_stack_size): Remove.
5416         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5417         that every segmentation violation is a stack overflow.  (Ouch!)
5418         See Debian bug 136249 (still outstanding) for more info about why
5419         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5420
5421 2003-11-30  Bruno Haible  <bruno@clisp.org>
5422
5423         Safer stack allocation.
5424         * setenv.c: Include allocsa.h.
5425         (alloca): Remove fallback definition.
5426         (freea): Remove macro.
5427         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5428         instead of freea.
5429
5430 2003-10-17  Bruno Haible  <bruno@clisp.org>
5431
5432         * binary-io.h: Avoid warnings on Cygwin.
5433
5434 2003-12-28  Bruno Haible  <bruno@clisp.org>
5435
5436         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5437         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5438
5439 2003-11-28  Bruno Haible  <bruno@clisp.org>
5440
5441         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5442
5443 2003-11-27  Bruno Haible  <bruno@clisp.org>
5444
5445         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5446
5447 2003-11-17  Bruno Haible  <bruno@clisp.org>
5448
5449         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5450
5451 2003-11-24  Bruno Haible  <bruno@clisp.org>
5452
5453         * xallocsa.h: New file, from GNU gettext.
5454         * xallocsa.c: New file, from GNU gettext.
5455
5456 2003-11-24  Bruno Haible  <bruno@clisp.org>
5457
5458         * allocsa.h: New file, from GNU gettext.
5459         * allocsa.c: New file, from GNU gettext.
5460
5461 2003-11-24  Bruno Haible  <bruno@clisp.org>
5462
5463         * eealloc.h: New file.
5464
5465 2004-01-15  Jim Meyering  <jim@meyering.net>
5466
5467         Merge from coreutils.
5468
5469         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5470         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5471         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5472
5473         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5474         optional configure-time default.
5475
5476         * version-etc.c (version_etc_copyright): Update copyright date.
5477
5478         * xreadlink.c (xreadlink): Correct outdated comment.
5479
5480 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5481
5482         Merge from coreutils.
5483
5484         * posixver.c: Include posixver.h.
5485
5486         * same.c: Include <stdbool.h>, <limits.h>.
5487         (_POSIX_NAME_MAX): Define if not defined.
5488         (MIN): New macro.
5489         (same_name): If file names are silently truncated, report
5490         that the file names are the same if they are the same after
5491         the silent truncation.
5492
5493         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5494         conversion function.
5495         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5496         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5497         longer needed.
5498
5499 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5500
5501         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5502         with like-named macro in fnmatch.c.
5503         (EXT): Use an internal constant instead.
5504
5505         Merge fnmatch patches from glibc.
5506         * fnmatch.c (mbsinit): Remove define.
5507         Add libc_hidden_ver (__fnmatch, fnmatch).
5508         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5509         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5510
5511 2003-12-14  Karl Berry  <karl@gnu.org>
5512
5513         * config.charset: update from gettext-runtime.
5514
5515 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5516
5517         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5518         Bug reported by Alfred M. Szmidt.
5519
5520 2003-11-29  Karl Berry  <karl@gnu.org>
5521
5522         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5523
5524 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5525             Bruno Haible  <bruno@clisp.org>
5526
5527         * printf-parse.h: Don't include sys/types.h.
5528         (ARG_NONE): New macro.
5529         (char_directive): Change type of *arg_index fields to size_t.
5530         * printf-parse.c: Don't include sys/types.h.
5531         (SSIZE_MAX): Remove macro.
5532         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5533         Remove unnecessary overflow check.
5534         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5535         fields.
5536
5537 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5538
5539         * alloca.c: Remove dependency on xalloc module.
5540         (xalloc_die): Remove.
5541         (memory_full) [!defined emacs]: New macro.
5542         [!defined emacs]: Don't include xalloc.h.
5543         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5544         address arithmetic overflows.  Change datatypes a bit to avoid
5545         unnecessary casts.
5546
5547 2003-11-22  Jim Meyering  <jim@meyering.net>
5548
5549         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5550
5551 2003-11-17  Bruno Haible  <bruno@clisp.org>
5552
5553         * vasnprintf.c (alloca): Remove fallback definition.
5554         (freea): Remove definition.
5555         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5556         Reported by Paul Eggert.
5557
5558 2003-11-17  Jim Meyering  <jim@meyering.net>
5559
5560         On systems without utime and without a utimes function capable of
5561         dealing with a NULL struct utimbuf* argument, this utime replacement
5562         could -- in unusual circumstances -- leak a file descriptor.
5563         * utime.c: Include <unistd.h> and <errno.h>.
5564         (utime_null): Be sure to close `fd' and to preserve errno.
5565         Reported by Geoff Collyer via Arnold Robbins.
5566
5567 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5568             Bruno Haible  <bruno@clisp.org>
5569
5570         Protect against address arithmetic overflow.
5571         * printf-args.h: Include stddef.h.
5572         (arguments): Change type of field 'count' to size_t.
5573         * printf-args.c (printf_fetchargs): Use size_t instead of
5574         'unsigned int' where appropriate.
5575         * printf-parse.h: Include sys/types.h.
5576         (char_directive): Change type of *arg_index fields to ssize_t.
5577         (char_directives): Change type of fields 'count', max_*_length to
5578         size_t.
5579         * printf-parse.c: Include sys/types.h and xsize.h.
5580         (SSIZE_MAX): Define fallback value.
5581         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5582         instead of 'int' where appropriate. Check a_allocated, d_allocated
5583         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5584         * vasnprintf.c: Include xsize.h.
5585         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5586         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5587         overflow. Avoid wraparound when converting a width or precision from
5588         decimal to binary.
5589
5590 2003-11-16  Bruno Haible  <bruno@clisp.org>
5591
5592         Update from GNU gettext.
5593         * printf-parse.c: Generalize to it can be compiled for wide strings.
5594         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5595         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5596         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5597         SNPRINTF): New macros.
5598         Don't include <alloca.h> if the file is used inside libintl.
5599         (local_wcslen): New function, for Solaris 2.5.1.
5600         (VASNPRINTF): Use it instead of wcslen.
5601
5602 2003-11-16  Bruno Haible  <bruno@clisp.org>
5603
5604         * xsize.h (xmax): New function.
5605         (xsum, xsum3, xsum4): Declare as "pure" functions.
5606
5607 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5608
5609         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5610         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5611         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5612         heuristic is just as accurate as far as we know, and it removes a
5613         dependency on size_max.m4 and ptrdiff_max.m4.
5614
5615 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5616
5617         * xstrtol.c (__xstrtol): Remove "break" immediately after
5618         "return", to pacify some unknown compiler.  Problem reported
5619         by Joerg Schilling.
5620
5621 2003-11-11  Bruno Haible  <bruno@clisp.org>
5622
5623         * xsize.h (SIZE_MAX): Remove fallback definition.
5624         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5625         defined.
5626
5627 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5628
5629         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5630         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5631         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5632         From Bruno Haible.
5633         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5634         not (size_t) -1, since it's defined here.
5635
5636 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5637
5638         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5639         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5640         Reject sizes of exactly SIZE_MAX bytes.
5641         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5642         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5643
5644 2003-11-05  Bruno Haible  <bruno@clisp.org>
5645
5646         * xsize.h: Include limits.h, to avoid a possible collision with
5647         SIZE_MAX defined in <limits.h> on Solaris.
5648
5649 2003-11-04  Bruno Haible  <bruno@clisp.org>
5650
5651         * xsize.h: New file.
5652         * linebreak.c: Include xsize.h.
5653         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5654         argument for overflow.
5655         Suggested by Paul Eggert.
5656
5657 2003-10-31  Bruno Haible  <bruno@clisp.org>
5658
5659         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5660         to avoid (extremely rare) race condition.
5661         Suggested by Paul Eggert.
5662
5663 2003-11-03  Jim Meyering  <jim@meyering.net>
5664
5665         * userspec.c: Include "userspec.h".
5666         * userspec.h: New file.
5667
5668 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5669
5670         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5671         * mountlist.c (SIZE_MAX): Define if not defined already.
5672         (read_filesystem_list): Set and use me_type_malloced.
5673         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5674         whatever the type happens to be), for brevity and consistency.
5675         Check for size calculation overflow on Alphas running OSF/1.
5676
5677 2003-10-31  Jim Meyering  <jim@meyering.net>
5678
5679         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5680
5681         * linebuffer.c: Include <string.h> for declaration of memset.
5682
5683 2003-10-30  Paul Eggert  <eggert@twinsun.com>
5684             Bruno Haible  <bruno@clisp.org>
5685
5686         * vasprintf.c: Include <limits.h>, <stdlib.h>.
5687         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5688
5689 2003-10-29  Paul Eggert  <eggert@twinsun.com>
5690
5691         * xalloc.h (xalloc_oversized): Now a macro, not a function,
5692         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
5693         no longer needed.
5694         * quotearg.c (quotearg_n_options): Use it.
5695         * group-member.c: Include <stdbool.h>.
5696         (free_group_info): Arg is now const *; don't free arg.
5697         (get_group_info): Now returns bool and accepts struct group_info *,
5698         rather than returning a malloc'ed struct group_info *.
5699         All uses changed.  Check for overflow in internal size calculation.
5700
5701         * getusershell.c (readname): Simplify the code by using x2nrealloc
5702         rather than xmalloc/xrealloc.
5703         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5704         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
5705         conformance bug: the old code used a pointer after freeing the
5706         storage that it addressed.
5707         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5708         rather than doing it by hand.
5709         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5710         the buffer preserved.  Use free and xmalloc instead.
5711         * quotearg.c (quotearg_n_options): Likewise.
5712         Use a simpler test for size overflow.  Don't use xalloc_oversized
5713         because unsigned int might be wider than size_t (!); this suggests
5714         that we should switch from unsigned int to size_t for slot numbers.
5715
5716 2003-10-27  Bruno Haible  <bruno@clisp.org>
5717
5718         * stdbool_.h: Better support for BeOS.
5719
5720 2003-10-27  Paul Eggert  <eggert@twinsun.com>
5721
5722         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5723         to allocate the returned structure.  Do not allocate a subarray,
5724         as x2nrealloc will do that.
5725         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5726         instead of xnrealloc.
5727         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5728
5729 2003-10-26  Paul Eggert  <eggert@twinsun.com>
5730
5731         * xalloc.h (xalloc_oversized): New static inline function, for
5732         callers that want to do their own size-overflow checking.  Include
5733         <stdbool.h>, since xalloc_oversized returns bool.
5734         * xalloc.c (array_size_overflow): Remove.  All callers changed
5735         to use xalloc_oversized.
5736
5737         Add two functions x2realloc, x2nrealloc, for programs that grow
5738         arrays dynamically by doubling their sizes.
5739         * xalloc.h (x2realloc, x2nrealloc): New decls.
5740         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5741         New functions.
5742
5743         Port to C99 semantics for 'inline' of external functions.
5744         Bug reported by Bruno Haible.
5745         * xmalloc.c (xnmalloc_inline): New static inline function,
5746         with the old contents of xnmalloc.
5747         (xnmalloc, xmalloc): Use it.
5748         (xnrealloc_inline): New static inline function,
5749         with the old contents of xnrealloc.
5750         (xnrealloc, xrealloc): Use it.
5751
5752         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5753
5754 2003-10-25  Paul Eggert  <eggert@twinsun.com>
5755
5756         Fix several address-calculation bugs in the hash modules,
5757         plus some minor code cleanup.
5758
5759         * hash.h: Include <stdbool.h>, for bool.
5760         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5761         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5762         hash_get_n_entries, hash_get_max_bucket_length,
5763         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5764         hash_rehash): Use size_t rather than unsigned.
5765         * hash.c (struct hash_table, hash_get_n_buckets,
5766         hash_get_n_buckets_used, hash_get_n_entries,
5767         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5768         hash_get_entries, hash_do_for_each, hash_string, is_prime,
5769         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5770         Likewise.
5771         (SIZE_MAX): Define if not defined.
5772         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5773         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5774         hash_print):
5775         Use const * when possible.
5776         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5777         (check_tuning): Fix bug: if tuning parameters were very close to
5778         0 or 1, rounding errors could have caused subscript violations.
5779         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5780         (hash_initialize): Add 'fail:' label
5781         to free table and return NULL, and use it to simplify code.
5782         Use calloc rather than clearing the storage ourself.
5783         (hash_initialize, hash_rehash): Check for arithmetic overflow in
5784         buffer size calculations.
5785         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5786         Include <stddef.h>, for size_t.
5787         * hash-pjw.c (hash_pjw): Likewise.
5788         Switch to method described by Bruno Haible.
5789         Include <limits.h>, for CHAR_BIT.
5790         (SIZE_BITS): New macro.
5791
5792 2003-10-21  Paul Eggert  <eggert@twinsun.com>
5793
5794         * getndelim2.c (getndelim2): When size calculation overflows,
5795         ceiling the allocation at NMAX bytes rather than silently
5796         discarding input bytes before NMAX is reached.  This makes
5797         a difference only if NMAX exceeds SIZE_MAX / 2.
5798
5799         * obstack.c: Merge from glibc.
5800         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5801         Add libc_hidden_def (_obstack_newchunk).
5802         (_obstack_free) [! defined _LIBC]: Remove.
5803         [defined _LIBC]: Make a strong alias from obstack_free, rather than
5804         a clone of the function body.
5805         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5806         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5807
5808         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5809         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5810         arg to memcpy.
5811
5812         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5813         (obstack_ptr_grow_fast, obstack_int_grow_fast):
5814         Don't use lvalue casts, as GCC plans to remove support for them
5815         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
5816         was also present in the non-GCC version, indicating that this
5817         code had always been buggy and had never been widely used.
5818         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5819         Use the fast variant of each macro, rather than copying the
5820         definiens of the fast variant; that way, we'll be more likely to
5821         catch future bugs in the fast variants.
5822
5823 2003-10-20  Bruno Haible  <bruno@clisp.org>
5824
5825         * wait-process.h: New file, from GNU gettext.
5826         * wait-process.c: New file, from GNU gettext.
5827
5828 2003-10-19  Jim Meyering  <jim@meyering.net>
5829
5830         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5831
5832 2003-10-16  Paul Eggert  <eggert@twinsun.com>
5833
5834         * getgroups.c: Include <errno.h>, <stdlib.h>.
5835         (getgroups): First arg is int, not size_t.
5836         Don't let 'free' mangle errno.
5837
5838 2003-10-16  Jim Meyering  <jim@meyering.net>
5839
5840         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5841
5842 2003-10-15  Paul Eggert  <eggert@twinsun.com>
5843
5844         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5845         (SIZE_MAX): Remove.
5846         (new_exclude, add_exclude_file): Initial size no longer needs to
5847         be a power of 2.
5848         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5849         our own address arithmetic overflow checking.
5850
5851         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5852         (fnmatch): Do not alloca more than 2000 wide characters;
5853         instead, use malloc for large buffers.
5854         Check for address arithmetic overflow, and return -1
5855         with errno set to ENOMEM in that case.
5856         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5857         (NEW_PATTERN): Do not alloca more than 8000 bytes;
5858         instead, return -1.  Check for address arithmetic overflow.
5859
5860 2003-10-14  Paul Eggert  <eggert@twinsun.com>
5861
5862         Handle invalid suffixes and overflow independently, so that
5863         callers can treat them independently as needed.  Fix some bugs in
5864         suffix handling, e.g., "100k@" was not diagnosed as an invalid
5865         suffix for a human-readable blocksize.  The major caller-visible
5866         change is the addition of a new
5867         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5868         that both overflow and suffix chars were found.
5869
5870         * human.c (humblock): Don't check separately for invalid suffix
5871         char; that is xstrtoumax's job (now that its bug is fixed).
5872         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5873         INTMAX_MAX]: New macros.
5874         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5875         TYPE_MAXIMUM): New macros.
5876         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5877         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5878         if overflow occurs, as it's what __strtol does and it's more useful
5879         in practice.
5880         (__xstrtol): If __strtol reports some error other than ERANGE,
5881         reflect it to the caller as LONGINT_INVALID.  If it reports
5882         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5883         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5884         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5885         value.
5886         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
5887         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5888         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5889         [defined UINTMAX_MAX]: New macros.
5890
5891 2003-10-14  Bruno Haible  <bruno@clisp.org>
5892
5893         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5894         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
5895         Also use volatile where needed.
5896
5897 2003-10-12  Paul Eggert  <eggert@twinsun.com>
5898
5899         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
5900         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
5901         and define in terms of the other primitives.
5902         * xmalloc.c: Include stdbool.h; do not include exit.h.
5903         (SIZE_MAX): Define if not already defined.
5904         (array_size_overflow): New function.
5905         (xalloc_die): Abort instead of exiting if 'error' returns.
5906         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
5907         (xmalloc, xrealloc): Use them.
5908         (xcalloc): Check for address arithmetic overflow.
5909         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
5910         a bit faster than strcpy.
5911
5912 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5913
5914         Merge getpass from libc, plus a few fixes.
5915
5916         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
5917         Include <stdbool.h>.
5918         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
5919         __fsetlocking to empty.
5920         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
5921         do include <bits/libc-lock.h>.
5922         Do not include <fcntl.h>; not needed.
5923         [_LIBC]: Include <wchar.h>.
5924         (NOTCANCEL_MODE): New macro.
5925         (flockfile, funlockfile) [_LIBC]: New macros.
5926         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
5927         [!_LIBC]: New macros.
5928         (call_fclose): New function.
5929         (getpass): Use it.  Save tty stream separately; this simplifies the
5930         code and makes it more reliable if stdin happens to equal stdout.
5931         Invoke __fsetlocking on tty.
5932         Handle thread cancellation if needed.
5933         Namespace cleanup (use __tcgetattr, __getline).
5934         Use bool for Booleans.
5935         [USE_IN_LIBIO]: Handle wide streams.
5936         [!_LIBC]: Unconditionally do the fseek, since we don't know what
5937         stream might go where.
5938
5939         * unlocked-io.h: Include <stdio.h>, so that the caller
5940         doesn't have to include <stdio.h> before us.
5941         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
5942         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
5943         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
5944         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
5945         if not declared, so that we can use getpass.c code from libc without
5946         rewriting it.
5947         (flockfile, ftrylockfile, funlockfile): New macros.
5948
5949 2003-10-06  Bruno Haible  <bruno@clisp.org>
5950
5951         * version-etc-2.h: Remove file.
5952         * version-etc-2.c: Remove file.
5953
5954 2003-09-25  Jim Meyering  <jim@meyering.net>
5955             Bruno Haible  <bruno@clisp.org>
5956
5957         This lets translators provide better translations for the
5958         "Written by ..." part of --version output.
5959         * version-etc.h: Include stdarg.h.
5960         (version_etc_copyright): Declare as readonly.
5961         (version_etc): Make this function variadic with a NULL-terminated list
5962         of author name strings.
5963         (version_etc_va): New declaration.
5964         * version-etc.c: Include stdarg.h, stdlib.h.
5965         (version_etc_copyright): Declare as readonly.
5966         (version_etc_va): New function. Provide a different translatable string
5967         for each possible number of authors < 10. Abbreviate when there are 10
5968         authors or more.
5969         (version_etc): Make this function variadic. Call version_etc_va.
5970         Suggestion from Gary V. Vaughan.
5971
5972         * long-options.h (parse_long_options): Change prototype: the authors
5973         string is moved to the end and becomes variadic.
5974         * long-options.c: Include stdarg.h.
5975         (parse_long_options): Make this function variadic, too.
5976         Call version_etc_va, not version_etc.
5977
5978 2003-10-06  Bruno Haible  <bruno@clisp.org>
5979
5980         * fatal-signal.h: New file, from GNU gettext.
5981         * fatal-signal.c: New file, from GNU gettext.
5982
5983 2003-10-04  Karl Berry  <karl@gnu.org>
5984
5985         * argp*: update from libc.
5986
5987 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
5988
5989         * getpass.c (getpass): Use a no-op fseek when switching from input to
5990         output mode on the same stream.
5991
5992 2003-09-29  Paul Eggert  <eggert@twinsun.com>
5993
5994         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
5995         Fix arg typo in previous patch.
5996
5997 2003-09-28  Jim Meyering  <jim@meyering.net>
5998
5999         * error.c: Correct cpp indentation.
6000
6001 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6002
6003         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6004         Omit the special code that used __typeof__, since we worry that
6005         it could be more trouble than it's worth.  See:
6006         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6007         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6008
6009         * free.c: New file.
6010
6011 2003-09-26  Jim Meyering  <jim@meyering.net>
6012
6013         * error.c (error_tail): Move some declarations
6014         into inner scope where the local variables are used.
6015
6016 2003-09-26  Bruno Haible  <bruno@clisp.org>
6017
6018         * stpncpy.h (gnu_stpncpy): New declaration.
6019         (stpncpy): Define as alias for gnu_stpncpy.
6020         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6021
6022 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6023
6024         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6025         (error_tail): Do not loop, reallocating temporary buffer, since
6026         the output cannot contain more wide characters than the input
6027         contains bytes, the size must be big enough already.  This avoids
6028         one potential size overflow calculation.  Check for size overflow
6029         when calculating temporary buffer size.  Free temporary buffer
6030         when done, if it was allocated with malloc; this plugs a memory
6031         leak.  Remove casts from void * to pointers, that are no longer
6032         needed now that we're assuming C89 or better.
6033
6034         Merge error changes from glibc.
6035
6036         * error.c, error.h: Update copyright notice header to match glibc.
6037         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6038         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6039         Disable cancellation while printing error.
6040         * error.h: Prepend __ to parameter names.
6041
6042 2003-09-25  Karl Berry  <karl@gnu.org>
6043
6044         * argp-fmtstream.c, argp-help.c: update from libc.
6045
6046 2003-09-25  Bruno Haible  <bruno@clisp.org>
6047
6048         * version-etc-2.h: New file, from version-etc.h with modifications.
6049         * version-etc-2.c: New file, from version-etc.c with modifications.
6050
6051 2003-09-25  Simon Josefsson  <jas@extundo.com>
6052
6053         * xgetdomainname.h: New file.
6054         * xgetdomainname.c: New file.
6055
6056 2003-09-25  Simon Josefsson  <jas@extundo.com>
6057             Bruno Haible  <bruno@clisp.org>
6058
6059         * getdomainname.h: New file.
6060         * getdomainname.c: New file.
6061
6062 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6063
6064         * linebuffer.c (freebuffer): Don't free the argument, just
6065         the buffer associated with the argument.  Bug reported by
6066         Simon Josefsson.
6067
6068 2003-09-19  Karl Berry  <karl@gnu.org>
6069
6070         * argp.h: update from libc.
6071
6072 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6073
6074         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6075         input error, instead of returning NULL the next time we are called
6076         (and therefore losing track of errno).
6077
6078 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6079
6080         * getndelim2.c (getndelim2): Don't trash errno when a read
6081         fails, so that the caller gets the proper errno.
6082
6083         * readutmp.c (read_utmp): Likewise.
6084         Check for fstat error.  Close stream and free storage
6085         when failing.
6086
6087 2003-09-14  Bruno Haible  <bruno@clisp.org>
6088
6089         * fwriteerror.h: New file.
6090         * fwriteerror.c: New file.
6091
6092 2003-09-14  Jim Meyering  <jim@meyering.net>
6093
6094         * getloadavg.c: Correct cpp indentation.
6095         * strdup.c: Likewise.
6096         * vasnprintf.c: Likewise.
6097
6098 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6099
6100         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6101         * obstack.c [!defined _LIBC]: Likewise.
6102         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6103         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6104         * exitfail.c: Don't include stdlib.h; no longer needed.
6105
6106         More changes to assume C89 or better.
6107
6108         * error.c (error_tail): Assume vprintf.
6109
6110         * argmatch.c (getenv): Remove decl.
6111         * progreloc.c (get_full_program_name): Define via prototype.
6112         * setenv.c (clearenv): Likewise.
6113         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6114         needed.
6115         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6116         (malloc, memcpy): Remove decls.
6117         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6118         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6119         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6120         (memcpy): Remove macro.
6121         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6122         (__P): Remove.  All uses removed.
6123         (PTR): Remove.  All uses changed to void *.
6124         (CHAR_BIT, NULL): Remove.
6125         (spaces, zeros, memset_space, memset_zero)
6126         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6127         Remove.
6128         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6129         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6130         Define with prototype.
6131         Remove now-unnecessary prototype decl.
6132         (extra_args_spec): Assume ANSI C.  All uses changed.
6133         (extra_args_spec_iso): Remove.
6134         (my_strftime, emacs_strftimeu): Define via prototype.
6135         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6136         unconditionally.
6137         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6138         * strtoimax.c: Include <stdlib.h> unconditionally.
6139         (strtoul, strtol): Remove decls.
6140         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6141         LONG_MAX): Remove.
6142         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6143         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6144         (LOCALE_PARAM_PROTO): New macro.
6145         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6146         (INTERNAL (strtol), strtol): Define with a prototype.
6147         (PARAMS): Remove.  All uses removed.
6148         * tempname.c: Include <string.h> unconditionally.
6149         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6150         * xgethostname.c (main): Define with a prototype.
6151         * xmalloc.c: Include "xalloc.h" first, to check interface.
6152         Include <stdlib.h> unconditionally.
6153         (calloc, malloc, realloc, free): Remove decls.
6154         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6155         Include <stdlib.h> unconditionally.  Sort include file names.
6156         (strtod): Remove.
6157         (xstrtod): Define with a prototype.
6158         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6159         (strtol, strtoul): Remove decls.
6160
6161 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6162
6163         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6164         Include <stdlib.h>, <string.h> unconditionally.
6165         Remove now-unnecessary cast to char *.
6166         * strnlen.c: Include <string.h> unconditionally.
6167         * yesno.c (yesno): Define with a prototype.
6168
6169 2003-09-10  Bruno Haible  <bruno@clisp.org>
6170
6171         * strcspn.c: Include <string.h> unconditionally.
6172         * strpbrk.c: Include <string.h> unconditionally.
6173         * strstr.c: Include <string.h> unconditionally.
6174         * unicodeio.c: Include <string.h> unconditionally.
6175         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6176         * unsetenv.c: Likewise.
6177         * xreadlink.c: Include <stdlib.h> unconditionally.
6178         * yesno.c: Include <stdlib.h> unconditionally.
6179         (rpmatch): Add prototype.
6180
6181 2003-09-10  Jim Meyering  <jim@meyering.net>
6182
6183         * error.c: Correct indentation of cpp directives.
6184
6185 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6186
6187         More K&R removal.
6188
6189         * acosl.c (main): Use a prototype.
6190         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6191         tanl.c: Likewise.
6192
6193         * getloadavg.c (getloadavg, main): Define via prototypes.
6194
6195         * getopt.h (struct option.name): Assume C89, and use 'const'.
6196         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6197         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6198         with a prototype.
6199         * getopt.c (const): Remove macro.
6200         Include <string.h> unconditionally.
6201         (my_index): Remove; all uses changed to strchr.
6202         (strlen): Remove decl.
6203         (exchange): Remove forward decl; no longer needed.
6204         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6205         Define with prototype.
6206         * getopt1.c (const): Remove macro.
6207         (getopt_long, getopt_long_only, main): Define with prototype.
6208
6209         * getugroups.c: Include <string.h> unconditionally.
6210
6211         * getusershell.c: Include <stdlib.h> unconditionally.
6212         (getusershell, setusershell, endusershell, readname, main):
6213         Define with prototypes.
6214
6215         * group-member.c: Include group-member.h first.
6216         Include <stdlib.h> unconditionally.
6217
6218         * hard-locale.c: Include hard-locale.h first.
6219         Include <stdlib.h>, <string.h> unconditionally.
6220
6221         * hash.c (free, malloc): Remove decls.
6222         Include <stdlib.h> unconditionally.
6223
6224         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6225         (getenv): Do not declare.
6226
6227         * idcache.c: Include <string.h> unconditionally.
6228
6229         * long-options.c: Include long-options.h first, to test interface.
6230         Include <stdlib.h> unconditionally.
6231
6232         * makepath.c: Include makepath.h first, to test interface.
6233         Include <stdlib.h> and <string.h> unconditionally.
6234
6235         * linebuffer.c: Include <stdlib.h>.
6236         (free): Remove decl.
6237
6238         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6239         rpl_malloc returns void *, not char *.
6240         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6241
6242         * md5.h: Include <limits.h> unconditionally.
6243         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6244         (__P): Remove; all uses removed.
6245         * md5.c: Include "md5.h" first.
6246         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6247         md5_buffer, md5_process_bytes, md5_process_block):
6248         Define with prototypes.
6249         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6250         * sha.c: Include "sha.h" first.
6251         Include <stdlib.h>, <string.h> unconditionally.
6252
6253         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6254         * memcmp.c (__ptr_t): Likewise.
6255         * memrchr.c (__ptr_t): Likewise.
6256         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6257         Include <string.h> unconditionally.
6258         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6259         * memchr.c: Include <stdlib.h> unconditionally.
6260         * memchr.c (LONG_MAX): Remove.
6261         * memrchr.c (LONG_MAX): Likewise.
6262         * memchr.c (__memchr): Define via a prototype.
6263         * memrchr.c (__memrchr): Likewise.
6264         * memcmp.c (__P): Remove, and remove all uses.
6265         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6266         Remove forward decls; no longer needed.
6267         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6268         Use types required by C89 in prototype.
6269
6270         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6271         * savedir.c: Likewise.
6272         * mkdir.c (free): Remove decl.
6273         * rmdir.c (rmdir): Define with a prototype.
6274         * savedir.c: Include savedir.h first, to test interface.
6275
6276         * mktime.c (STDC_HEADERS): Remove.
6277         Include <stdlib.h>, <string.h> unconditionally.
6278
6279         * modechange.c: Include <stdlib.h> unconditionally.
6280         (malloc): Remove decl.
6281
6282         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6283         (free): Remove decl.
6284
6285         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6286         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6287         (This type really should be intptr_t, but that's a C99ism.)
6288         (_obstack_memcpy): Remove: all uses changed to memcpy.
6289         Include <string.h> unconditionally.
6290         (struct obstack): Assume __STDC__ for types of members
6291         chunkfun, freefun, extra_arg.
6292         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6293         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6294         obstack_begin, obstack_specify_allocation,
6295         obstack_specify_allocation_with_arg, obstack_chunkfun,
6296         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6297         Remove unprototyped decls and the macros that use them.
6298         * obstack.c (POINTER): Remove.  All uses changed to void *.
6299         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6300         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6301         (defined __STDC__ && __STDC__)]:
6302         Remove nonprototyped code.
6303         Include <stdlib.h> unconditionally.
6304         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6305         _obstack_allocated_p, _obstack_free, obstack_free,
6306         _obstack_memory_used, print_and_abort):
6307         Define using prototypes.
6308         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6309         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6310         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6311         obstack_next_free, obstack_object_size, obstack_room) [0]:
6312         Remove unused, unprototyped code.
6313
6314         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6315
6316         * physmem.c (physmem_total, physmem_available, main): Define
6317         with prototypes.
6318
6319         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6320         (main): Define with a prototype.
6321
6322         * posixver.c (getenv): Remove decl.
6323
6324         * putenv.c (malloc): Returns void *, not char *.
6325         Include <string.h> unconditionally.
6326         (strchr, memcpy, NULL): Do not define.
6327
6328         * readtokens.c: Include readtokens.h first, to test interface.
6329         Include <stdlib.h>, <string.h> unconditionally.
6330         (init_tokenbuffer): Define with a prototype.
6331
6332         * regex.c (PARAMS): Remove.  All uses removed.
6333         All uses of _RE_ARGS removed, too.
6334         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6335         unconditionally.
6336         (bzero): Assume memset exists.
6337         (memcmp, memcpy, NULL): Remove.
6338         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6339         char, or assignments to local vars of type signed char.
6340         (init_syntax_once, PREFIX(extract_number_and_incr),
6341         PREFIX(print_partial_compiled_pattern),
6342         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6343         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6344         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6345         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6346         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6347         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6348         wcs_compile_range, byte_compile_range, truncate_wchar,
6349         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6350         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6351         count_mbs_length, wcs_re_match_2_internal,
6352         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6353         PREFIX(alt_match_null_string_p),
6354         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6355         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6356         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6357         now-unnecessary declaration, if any.
6358         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6359         regcomp, regexec):
6360         Remove now-unnecessary casts among pointer types.
6361         * regex.h (_RE_ARGS): Remove.  All uses removed.
6362
6363         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6364         (free): Remove decl.
6365
6366         * rpmatch.c: Include <stdlib.h> unconditionally.
6367
6368         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6369         (free): Remove decl.
6370
6371         * save-cwd.c: Include <stdlib.h> unconditionally.
6372         * xgetcwd.c: Likewise.
6373
6374         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6375         (free): Remove decl.
6376
6377         * strchrnul.c (strchrnul): Define with a prototype.
6378         Fix bug: c_in was not converted to char before searching.
6379
6380         The following changes are not K&R related:
6381
6382         * group-member.h: Include <sys/types.h>, so that this file is
6383         self-contained.
6384         * makepath.h: Likewise.
6385
6386         * getusershell.c (readname, default_index, line_size, readname):
6387         Use size_t, not int, for sizes.
6388         (readname): If the size overflows, report an error instead of
6389         looping forever.
6390
6391 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6392
6393         * getndelim2.c: Assume stdlib.h per the C89 spec.
6394
6395 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6396
6397         Assume C89 or better; remove K&R cruft.
6398         A few of these changes were first proposed by Derek Robert Price
6399         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6400
6401         * addext.c: Include <string.h> unconditionally.
6402         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6403         Don't declare getenv or malloc.
6404
6405         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6406         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6407         (NULL): Remove.
6408         (find_stack_direction, alloca): Use prototypes.
6409
6410         * atexit.c (atexit): Define using a prototype.
6411
6412         * basename.c, dirname.c, stripslash.c:
6413         Include <string.h> unconditionally.
6414
6415         * bcopy.c: Include <stddef.h>.
6416         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6417
6418         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6419
6420         * error.h (error, error_at_line, error_print_progname)
6421         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6422         * error.c: Include error.h first, to check interface.
6423         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6424         (VA_START): Remove; all uses changeed to va_start.
6425         (exit, strerror): Remove decls.
6426         (error_print_progname): Prototype uncondionally.
6427         Don't include <errno.h>; no longer needed.
6428         (private_strerror): Remove.
6429         (error_tail): Always define.
6430         (error, error_at_line): Assume C89 or better; always use prototypes.
6431         * fatal.c: Include "fatal.h" first, to test interface.
6432         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6433         (VA_START): Remove; all uses changed to va_start.
6434         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6435         this case.
6436         (exit): Remove decl.
6437         (fatal): Prototype unconditionally.  Assume va_start works.
6438         Abort at end, to pacify gcc.
6439
6440         * euidaccess.c (main): Define with a prototype.
6441
6442         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6443
6444         * exitfail.c: Include <stdlib.h> unconditionally.
6445
6446         * fnmatch_.h (__P): Remove.  All uses changed to assume
6447         prototypes.
6448         * fnmatch.c: Include fnmatch.h first, to test interface.
6449         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6450         (getenv): Remove decl.
6451         (fnmatch): Define using a prototype.
6452         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6453         (FCT): Define using a prototype.
6454
6455         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6456
6457         * gethostname.c: Include <stddef.h>.
6458         (gethostname): Define with prototype.  Length is size_t, not int.
6459
6460 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6461
6462         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6463         getversion.c should have been removed then, but was accidentally
6464         preserved.
6465
6466         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6467         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6468
6469 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6470
6471         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6472         copy_tm_result.  Bug reported by Simon Josefsson in
6473         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6474
6475 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6476
6477         * time_r.c, time_r.h: New files.
6478
6479         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6480         __localtime_r.
6481         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6482         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6483
6484         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6485         __gmtime_r.
6486         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6487         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6488         Include <time_r.h>.
6489
6490         * timegm.c: Switch to glibc implementation, with the following changes:
6491         [defined HAVE_CONFIG_H]: Include <config.h>.
6492         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6493         (__mktime_internal) [!defined _LIBC]: New decl.
6494         (__gmtime_r) [!defined _LIBC]: New macro and function.
6495         (timegm): Use a prototype, since gnulib assumes C89.
6496         Do not bother declaring tmp to be const, as it's not really usefu.
6497         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6498         (timegm): Declare only if HAVE_DECL_TIMEGM.
6499
6500 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6501
6502         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6503         Bug reported by Lute Kamstra in
6504         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6505
6506         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6507         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6508         course with correspondingly smaller numbers for tomorrow and
6509         yesterday.  From Tadayoshi Funaba.  Originally installed into
6510         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6511         coreutils merge?).
6512
6513 2003-08-31  Simon Josefsson  <jas@extundo.com>
6514
6515         * timegm.h: New file.
6516         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6517
6518 2003-08-31  Karl Berry  <karl@gnu.org>
6519
6520         * argp.h: update from libc.
6521
6522 2003-08-28  Bruno Haible  <bruno@clisp.org>
6523
6524         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6525         warning on QNX, which defines O_BINARY to 000000.
6526
6527 2003-08-24  Bruno Haible  <bruno@clisp.org>
6528
6529         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6530         MSVC7 <stdio.h> is included later.
6531
6532 2003-08-20  Bruno Haible  <bruno@clisp.org>
6533
6534         * progname.h: New file, from GNU gettext.
6535         * progname.c: New file, from GNU gettext.
6536         * progreloc.c: New file, from GNU gettext.
6537
6538 2003-08-19  Bruno Haible  <bruno@clisp.org>
6539
6540         * xstrdup.c: Assume <string.h> exists.
6541
6542 2003-08-18  Jim Meyering  <jim@meyering.net>
6543
6544         * setenv.h: Indent nested cpp directive.
6545         * vasnprintf.c: Remove trailing blanks.
6546
6547 2003-08-17  Simon Josefsson  <jas@extundo.com>
6548             Bruno Haible  <bruno@clisp.org>
6549
6550         * xstrndup.h: New file.
6551         * xstrndup.c: New file.
6552
6553 2003-08-17  Bruno Haible  <bruno@clisp.org>
6554
6555         * strndup.h: New file.
6556
6557 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6558
6559         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6560         space, undoing this 2003-08-12 change:
6561         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6562
6563 2003-08-16  Jim Meyering  <jim@meyering.net>
6564
6565         Merge from coreutils.
6566         * xstrtoimax.c: #else #if -> #elif.
6567         * xstrtoumax.c: Likewise.
6568
6569 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6570
6571         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6572         rather than tab, after '#' in shell-script copyright notices.
6573         Suggested by Bruno Haible.
6574
6575 2003-08-15  Jim Meyering  <jim@meyering.net>
6576         and Paul Eggert  <eggert@twinsun.com>
6577
6578         Merge from coreutils.
6579         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6580         member but strut utmpx does not.  Needed for AIX 4.3.3.
6581         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6582
6583 2003-08-15  Jim Meyering  <jim@meyering.net>
6584
6585         Merge from coreutils.
6586         * xgethostname.c: Include <stdlib.h>.
6587         (xghostname): Don't exit for anything other than memory-related
6588         failure; just return NULL.
6589         * userspec.c: Include "posixver.h".
6590         (parse_user_spec): Accept `.' as a separator only
6591         in pre-POSIX-200112 mode.
6592         * strtoimax.c: Use #elif rather than #else #if.
6593         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6594         Remove function, now that we can rely on a working tzset function.
6595         [!_LIBC]: Ensure that the required autoconf test has been run.
6596         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6597         Use underlying_strftime for %r.
6598         * sha.c: Merge in some clean-up and optimization changes from glibc.
6599         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6600         Ensure that it is a multiple of 64.
6601         Rearrange loop exit tests so as to avoid performing an
6602         additional fread after encountering an error or EOF.
6603         * realloc.c: Update copyright date.
6604
6605 2003-08-14  Jim Meyering  <jim@meyering.net>
6606
6607         Merge from coreutils.
6608         * obstack.h: Whitespace changes.
6609         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6610         and xcalloc return values.
6611         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6612         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6613         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6614         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6615         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6616         error from mntctl.
6617         Use mntctl's return value to drive the entry-processing loop, since
6618         we can't rely on the value of the vmt_length member in the last
6619         entry.  On some systems doing so could result in exhausting
6620         virtual memory.  Based in part on a patch from Mike Jetzer.
6621
6622 2003-08-14  Jim Meyering  <jim@meyering.net>
6623         and Paul Eggert  <eggert@twinsun.com>
6624
6625         Merges from coreutils, plus other fixes.
6626         * physmem.c: Merge in portability changes from gcc/libiberty
6627         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6628         for credits and details.  Thanks to Kaveh Ghazi for helping
6629         to keep these files in sync.
6630         (ARRAY_SIZE): Define it.
6631         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6632         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6633         (memcasecmp): Don't assume size_t fits in unsigned int.
6634         Remove casts and duplicate code.
6635         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6636         (memcpy): Remove definition.
6637         Merge in some clean-up and optimization changes from glibc.
6638         [BLOCKSIZE]: Move definition to top of file.
6639         Ensure that it is a multiple of 64.
6640         Rearrange loop exit tests so as to avoid performing an
6641         additional fread after encountering an error or EOF.
6642         * md5.h (md5_uintptr): Define.
6643         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6644         return to the initial working directory.  Preserve errno
6645         for caller.
6646         * idcache.c: Include "xalloc.h".
6647         (xmalloc, xrealloc): Remove decls.
6648         (getuser): Remove casts no longer required in C89.
6649         * human.c: Include stdio.h, for sprintf.
6650         * group-member.c: Include "xalloc.h".
6651         (xmalloc, xrealloc): Remove decls.
6652         (get_group_info): Remove casts no longer required in C89.
6653         * getusershell.c (readname): Remove casts no longer required in C89.
6654         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6655         * getline.c: Whitespace fix, from coreutils.
6656
6657 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6658
6659         * exclude.c: Include <ctype.h>
6660         (IN_CTYPE_DOMAIN): New macro.
6661         (is_space): New fn.
6662         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6663         and empty lines.
6664
6665         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6666         Undo previous (whitespace-only) change.
6667
6668 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6669
6670         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6671         Normalize leading white space and remove trailing white space.
6672         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6673         notice, as per ../config/srclist-update.
6674
6675         Merge from coreutils.
6676         * euidaccess.h: New file.
6677         * euidaccess.c: Include it.
6678         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6679         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
6680         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6681
6682 2003-08-11  Bruno Haible  <bruno@clisp.org>
6683
6684         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6685         (vasnprintf): Use it instead of wcslen.
6686
6687 2003-08-11  Bruno Haible  <bruno@clisp.org>
6688
6689         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6690         value to ensure that _Bool promotes to int. Use #define for _Bool when
6691         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6692
6693 2003-08-10  Karl Berry  <karl@gnu.org>
6694
6695         * regex.h: update from libc (whitespace fix).
6696
6697 2003-08-09  Paul Eggert  <eggert@twinsun.com>
6698
6699         Merge some files from coreutils.  These changes were
6700         originally made by Jim Meyering.
6701         * acl.c: Include <sys/types.h> before <sys/stat.h>;
6702         many older Unixes require this.
6703         * alloca.c (alloca): Remove cast to argument of free;
6704         no longer needed in C89.
6705         * alloca_.h, regex.h: Fix white space to match
6706         what GNU indent does.
6707
6708 2003-08-05  Paul Eggert  <eggert@twinsun.com>
6709
6710         * bumpalloc.h: Remove.
6711
6712 2003-08-04  Paul Eggert  <eggert@twinsun.com>
6713
6714         * getloadavg.c: Change copyright notice and spacing to conform to
6715         GNU coding style.
6716
6717         Merge from coreutils.
6718         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6719         From glibc.
6720         * getdate.y (date): Also accept dates like May-23-2003; suggestion
6721         from Karl Berry, implemented by Jim Meyering.
6722         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6723         from Dmitry V. Levin.
6724         Remove anachronistic cast of xrealloc.
6725         * fnmatch_.h (__const): Remove.  Use 'const'.
6726         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6727         type. Otherwise, it wouldn't compile with at least /bin/cc on
6728         ymp-cray-unicos9.0.2.X.
6729         Combine two mostly-identical uses of alloca into one.
6730         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6731
6732 2003-08-04  Dave Love <d.love@dl.ac.uk>
6733
6734         [From Emacs.]
6735
6736         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
6737         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
6738         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6739         obsolete NLIST_NAME_UNION.
6740         [__GNU__]: Undef BSD and FSCALE.
6741         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6742
6743 2003-08-03  Paul Eggert  <eggert@twinsun.com>
6744
6745         * stdbool_.h (_Bool): Make it signed char, instead of
6746         an enum type, so that it's guaranteed to promote to int.  See:
6747         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6748
6749 2003-07-31  Paul Eggert  <eggert@twinsun.com>
6750
6751         * strerror.c: Include config.h, limits.h.  Declare sprintf.
6752         (strerror): Don't assume that a printable int fits in 14 bytes.
6753
6754 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
6755             Bruno Haible  <bruno@clisp.org>
6756
6757         * getline.h (getline, getdelim): Change return type to ssize_t.
6758         * getline.c (getline, getdelim): Likewise.
6759         Remove _GNU_SOURCE define; now it's defined in config.h through
6760         m4/getline.m4.
6761
6762 2003-07-22  Paul Eggert  <eggert@twinsun.com>
6763
6764         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6765         over-parenthesization in macros.
6766
6767         Sync with coreutils.
6768
6769         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6770         required by C99.
6771
6772         Use `exit_failure' for xalloc and xmemcoll instead of their own
6773         private exit-failure variables.
6774         * xalloc.h (xalloc_exit_failure): Remove.
6775         * xmalloc.c: Likewise.  Include exitfail.h.
6776         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6777         * xmemcoll.h (xmemcoll_exit_failure): Remove.
6778         * xmemcoll.c: Likewise.  Include exitfail.h.
6779         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6780
6781 2003-07-18  Paul Eggert  <eggert@twinsun.com>
6782
6783         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6784         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
6785         to test that it can stand by itself.  Include "exitfail.h".
6786         Clients should set exit_failure instead.
6787         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
6788
6789 2003-07-18  Andreas Schwab  <schwab@suse.de>
6790
6791         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6792
6793 2003-07-18  Bruno Haible  <bruno@clisp.org>
6794
6795         * getndelim2.h: New file.
6796         * getndelim2.c: Make into a module of its own. Include config.h,
6797         getndelim2.h.
6798         (getndelim2): Make non-static. Change return type to ssize_t.
6799         * getline.h: Change argument names.
6800         * getline.c: Include getndelim2.h instead of getndelim2.c.
6801         * getnline.c: Include getndelim2.h.
6802
6803 2003-07-17  Bruno Haible  <bruno@clisp.org>
6804
6805         * Makefile.am: Remove file.
6806         * Makefile.in: Remove file.
6807
6808 2003-07-17  Bruno Haible  <bruno@clisp.org>
6809
6810         * getnline.h: New file.
6811         * getnline.c: New file.
6812         * getndelim2.c: New file, extracted from getline.c.
6813         (getndelim2): Renamed from getdelim2, with added nmax argument.
6814         * getline.c: Include getndelim2.c.
6815         (getdelim2): Moved out to getndelim2.c.
6816         (getline, getdelim): Update.
6817
6818 2003-07-15    <karl@gnu.org>
6819
6820         * vasnprintf.c: update from gettext.
6821
6822 2003-07-15  Jim Meyering  <jim@meyering.net>
6823
6824         * makepath.c (make_path): Enclose diagnostic in _(...).
6825
6826 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6827
6828         * asnprintf.c, asprintf.c, config.charset, gettext.h,
6829         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6830         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6831         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6832         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
6833         updated automatically by ../config/srclist-update.  This changes
6834         their license from LPGL to GPL.
6835
6836 2003-07-14  Jim Meyering  <jim@meyering.net>
6837
6838         Don't emit diagnostics.  Let callers do that.
6839         * save-cwd.c: Don't include "error.h".
6840         (save_cwd): Don't call error.  Ensure that errno is valid
6841         when returning nonzero.
6842
6843         * save-cwd.h (restore_cwd): Update prototype.
6844         * save-cwd.c (restore_cwd): Remove two parameters.
6845         Simplify.  Don't call error upon failure.  Let callers do that.
6846         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6847         when auditing is enabled.  But don't bother updating the #if.
6848
6849 2003-07-14  Simon Josefsson  <jas@extundo.com>
6850
6851         * mempcpy.h: New file.
6852         * mempcpy.c: New file.
6853
6854 2003-07-14  Paul Eggert  <eggert@twinsun.com>
6855
6856         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6857         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6858         unicodeio.c, unicodeio.h, unlocked-io.h:
6859         Switch from LGPL to GPL.
6860
6861 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
6862
6863         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6864         it breaks C++ compilation.
6865         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6866
6867 2003-07-10  Jim Meyering  <jim@meyering.net>
6868
6869         * vasnprintf.c: Remove trailing blanks.
6870         Make cpp indentation consistent.
6871
6872 2003-07-09  Paul Eggert  <eggert@twinsun.com>
6873
6874         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6875         posixver.c, strftime.c, strnlen.c, strverscmp.c:
6876         Switch from LGPL to GPL.
6877
6878 2003-07-07  Paul Eggert  <eggert@twinsun.com>
6879
6880         * mktime.c: Fix some boundary cases and remove need for floating point.
6881
6882         Issue a compile-time diagnostic if time_t is floating point, or if
6883         two's complement arithmetic is not in effect, or if arithmetic
6884         right shift does not propagate the sign.  These assumptions were
6885         all in the original code but they weren't checked.
6886
6887         (TIME_T_MIDPOINT, verify): New macros.
6888         (__isleap): Remove; it has integer overflow problems.
6889         (leapyear): New function, without those problems.
6890         (ydhms_tm_diff): Remove; splitting into two parts.
6891         (ydhms_diff): New function, containing the arithmetic part of
6892         the old ydhms_tm_diff function.  Issue a compile-time
6893         diagnostic if we are not using C99 integer division.
6894         Avoid casts when possible.
6895         (guess_time_tm): New function, containing the checking part of
6896         the old ydhms_tm_diff function.  Return the new value, rather than
6897         the difference between it and the old.  Accept a new argument T
6898         so that *T specifies the old value.  Check for overflow in the result.
6899
6900         (__mktime_internal): Use a time_t offset, not a long int offset.
6901         This undoes the 2003-06-04 change, which is no longer needed now
6902         that we have better overflow checking.
6903         (localtime_offset): Likewise.
6904
6905         (__mktime_internal): Avoid harmful overflow on hosts where time_t
6906         and long are 64-bit but int is only 32-bit.
6907         (ydhms_diff): Use long int to store year1 and yday1.
6908         Issue a compile-time diagnostic if long int is not wide enough.
6909
6910         (__mktime_internal): Use long int to store adjusted year and yday.
6911         Use plain C rather than preprocessor commands, if that doesn't
6912         affect efficiency.
6913         Check for overflow (and try to repair) after each probe
6914         rather than checking only at the very end.  This avoids some bugs
6915         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
6916         does not equal GMT offset at maximum time).
6917         Use integer to check for overflow rather than floating point; this
6918         is more portable to non-IEEE hosts, and is a tad faster.
6919         When we detect that we are oscillating between two values,
6920         don't check whether tm_isdst has the requested value, since
6921         we already know the answer.  When tm_isdst has the wrong value,
6922         use a different heuristic to find the right one, based on the
6923         extreme values actually observed in practice in tz2003a,
6924         rather than the (overly optimistic) "previous 3 calendar quarters".
6925
6926         (not_equal_tm, print_tm, check_result): Use "const T" rather than
6927         "T const" to accommodate glibc style.
6928         (check_result): Use less-confusing report format.  "long" -> "long int.
6929         (main): Likewise.
6930         Don't loop if the iteration overflows time_t.
6931         Allow a negative step in the iteration.
6932
6933 2003-07-01  Paul Eggert  <eggert@twinsun.com>
6934
6935         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
6936         having it depend on HAVE_SYS_TYPES_H.
6937
6938 2003-06-25  Bruno Haible  <bruno@clisp.org>
6939
6940         * readlink.c: New file.
6941
6942 2003-06-20  Bruno Haible  <bruno@clisp.org>
6943
6944         Assume C89, so PARAMS isn't needed.
6945         * unicodeio.h (PARAMS): Remove.
6946         * unicodeio.c: Don't use PARAMS.
6947
6948 2003-06-18  Jim Meyering  <jim@meyering.net>
6949
6950         Merge changes from coreutils.
6951         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
6952         Remove explicit declarations of xmalloc and realloc.
6953         Include xalloc.h.
6954         (read_utmp): Remove anachronistic cast of xmalloc.
6955
6956 2003-06-17  Paul Eggert  <eggert@twinsun.com>
6957
6958         Assume C89, so PARAMS isn't needed.
6959         * backupfile.h (PARAMS): Remove.  All uses removed.
6960         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
6961         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
6962         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
6963         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
6964         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
6965         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
6966         xstrtol.h: Likewise.
6967         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
6968         same.h, strverscmp.h: Do not include config.h; no longer needed.
6969         Anyway, config.h should always be included before any other file.
6970
6971 2003-06-11  Simon Josefsson  <jas@extundo.com>
6972
6973         * sysexit_.h: New file.
6974
6975 2003-05-20  Derek Price  <derek@ximbiot.com>
6976
6977         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
6978
6979 2003-06-10  Simon Josefsson  <jas@extundo.com>
6980
6981         * strchrnul.h: New file.
6982         * strchrnul.c: New file.
6983
6984 2003-06-10  Simon Josefsson <jas@extundo.com>
6985
6986         * argp.h: New file, from glibc.
6987         * argp-ba.c: New file, from glibc.
6988         * argp-eexst.c: New file, from glibc.
6989         * argp-fmtstream.c: New file, from glibc.
6990         * argp-fmtstream.h: New file, from glibc.
6991         * argp-fs-xinl.c: New file, from glibc.
6992         * argp-help.c: New file, from glibc.
6993         * argp-namefrob.h: New file, from glibc.
6994         * argp-parse.c: New file, from glibc.
6995         * argp-pv.c: New file, from glibc.
6996         * argp-pvh.c: New file, from glibc.
6997         * argp-xinl.c: New file, from glibc.
6998
6999 2003-06-07  Jim Meyering  <jim@meyering.net>
7000
7001         * readtokens.h: Put `Free Software Foundation, Inc.'
7002         in place of my name in the copyright comment.
7003         Remove definition and uses of __P.
7004
7005         From coreutils.
7006         * stat.c: Don't declare xmalloc explicitly.
7007         Instead, include "xalloc.h".
7008         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7009         xrealloc, and xcalloc return values.
7010         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7011         Improve comment.
7012         * xgetcwd.h: Remove definition/uses of PARAMS.
7013
7014 2003-06-06  Jim Meyering  <jim@meyering.net>
7015
7016         * stdbool_.h: Renamed from stdbool.h.in.
7017
7018 2003-06-06  Jim Meyering  <jim@meyering.net>
7019
7020         Merge from coreutils.
7021         * same.c: (same_name): Declare *_basename locals to be `const'.
7022         Consolidate declarations and initializations of *_base* locals.
7023
7024         Merge from coreutils.
7025         This avoids a core dump on systems without GNU putenv,
7026         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7027         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7028         (unsetenv): New static function, from GNU libc.
7029         (rpl_putenv): Use it.
7030
7031         * modechange.c: Remove trailing blanks.
7032
7033         Merge from coreutils.
7034         * fsusage.c: Remove declaration of statfs.
7035         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7036
7037         * posixtm.c: Include <stdbool.h> unconditionally.
7038
7039 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7040
7041         * mktime.c (__mktime_internal): When resolving a tm_isdst
7042         mismatch, look in future quarters as well as past.  This fixes a
7043         bug when processing fall-backwards gaps immediately after a long
7044         period of daylight-saving time.
7045
7046         * mktime.c: Assume freestanding C89 or better.
7047         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7048         (__P): Remove; not used.
7049         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7050         (mktime, not_equal_tm, print_tm, check_result,
7051         main): Use prototypes.  Use const * where appropriate.
7052         (main): Fix typo in testing code that uncovered by above changes.
7053         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7054
7055 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7056
7057         * mktime.c: Fix Debian bug 177940
7058         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7059         (localtime_offset): Now long int, not time_t, because we want it
7060         to be guaranteed to be signed.  All uses changed.
7061         (__mktime_internal): If overflow would occur when adding offset,
7062         don't add it.
7063
7064         Merge 'human' changes from coreutils.  Rewrite to support
7065         locale-specific notations like thousands separators.
7066         * human.c: Simplify authorship notice.
7067         Include human.h immediately after config.h.
7068         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7069         <limits.h>: Do not include, since human.h does.
7070         (SIZE_MAX, UINTMAX_MAX): New macros.
7071         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7072         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7073         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7074         (power_letter): Renamed from suffixes.
7075         (generate_suffix_backwards): Remove.
7076         (adjust_value): Now takes int style (because of human.h changes)
7077         and long double value (for greater precision on some platforms).
7078         (group_number): New function.
7079         (human_readable): Use it.  Use integer options, not enum.
7080         Put the options before the sizes in the arg list.
7081         Support all the new options.
7082         The old human_readable function has been removed;
7083         use inttostr.h instead.
7084         (human_readable, default_block_size, humblock):
7085         Use uintmax_t, not int, for block sizes.
7086         (human_readable_inexact, block_size_types): Remove.
7087         (block_size_opts): New constant.
7088         (human_options): Renamed from human_block_size, with new signature
7089         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7090         * human.h: Add copyright and authorship notice.
7091         Include <limits.h> and <stdbool.h> unconditionally.
7092         (PARAMS): Remove.  All uses removed.
7093         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7094         (enum human_inexact_style): Remove tag; now a nameless enum.
7095         (human_floor, human_ceiling, human_round_to_even): Now have
7096         values 2, 0, 1 rather than -1, 1, 0.
7097         (human_group_digits, human_suppress_point_zero, human_autoscale,
7098         human_base_1024, human_SI, human_B): New constants.
7099         (human_readable_inexact, human_block_size): Remove.
7100         (human_readable): Size args are now uintmax_t, not int.
7101         (human_options): New decl.
7102
7103         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7104         unnecessary now that we assume C89 or better.  This change
7105         imported from coreutils.
7106
7107         * mktime.c (__mktime_internal): Do not reject negative timestamps
7108         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7109         in the 2003-05-30 sync from glibc.
7110
7111         .h files should stand alone, but we shouldn't include <sys/types.h>
7112         if we can get away with just <stddef.h>.
7113
7114         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7115         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7116         rather than <sys/types.h>, as we merely need size_t.
7117         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7118         to get size_t.
7119         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7120         Include <stdio.h>, to get FILE.
7121         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7122         memcasecmp.h has included <stddef.h> and all we need is size_t.
7123         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7124         our interface, instead of including <sys/types.h>
7125
7126 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7127
7128         [from coreutils]
7129         Fix some minor time-related bugs with POSIX time arguments.
7130         Some valid time stamps were being rejected (notably -1, and
7131         time stamps before 1900 on 64-bit hosts).  And some invalid
7132         time stamps were being accepted, e.g. September 31.
7133
7134         * posixtm.h (posixtime): Return bool instead of time_t, so
7135         that we can return (time_t) -1 successfully.
7136         * posixtm.c: Likewise.
7137         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7138         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7139         (t): Remove static var.
7140         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7141         of static var.  All uses changed.
7142         (year): Do not reject years before 1900; they can occur with
7143         64-bit time_t.
7144         (posix_time_parse): Do not check for out-of-range components;
7145         that is now the caller's responsibility, since our checks were
7146         only approximations.
7147         (posixtime): Use mktime to check for out-of-range components,
7148         since it knows them exactly.
7149         If mktime returns (time_t) -1, check whether an error actually occurred
7150         by invoking localtime on -1.
7151         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7152         posixtime failures better.
7153         Improve the test data (in comments only).
7154
7155 2003-05-30    <karl@gnu.org>
7156
7157         * mktime.c: update from libc.
7158
7159 2003-05-30  Bruno Haible  <bruno@clisp.org>
7160
7161         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7162         * localcharset.h: Likewise.
7163         * localcharset.c: Likewise.
7164
7165 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7166
7167         Assume the headers required for C89 freestanding compilers.
7168         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7169         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7170         without checking for HAVE_LIMITS_H.
7171         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7172         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7173         to do that.
7174         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7175         * exclude.c: Include <stdbool.h> unconditionally.
7176         * tempname.c: Include <stddef.h> unconditionally.
7177         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7178         * modechange.c, rpmatch.c (NULL): Don't define, since
7179         <stddef.h> does that.
7180         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7181         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7182         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7183         * xstrtol.c: Likewise.
7184         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7185         * savedir.c: Include <stddef.h> instead of defining NULL.
7186
7187         * addext.c (addext): Use assignment rather than cast, to avoid
7188         warnings on some platforms.
7189
7190         * mktime.c (__mktime_internal): Do not reject negative timestamps
7191         arbitrarily.
7192
7193 2003-05-10  Bruno Haible  <bruno@clisp.org>
7194
7195         * linebreak.c (iconv_string_length): Don't return -1 just because the
7196         string is longer than 4 KB.
7197
7198 2003-05-12  Jim Meyering  <jim@meyering.net>
7199
7200         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7201         the space-padded-by-default conversion specifiers, %e, %k, %l.
7202
7203 2003-05-03  Bruno Haible  <bruno@clisp.org>
7204
7205         Upgrade to Unicode-4.0.
7206         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7207         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7208         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7209         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7210         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7211         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7212         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7213         Change width of U+E0100..U+E01EF from 1 to 0.
7214
7215 2003-04-25  Bruno Haible  <bruno@clisp.org>
7216
7217         * copy-file.c: Include <stddef.h>, for size_t.
7218
7219 2003-04-25  Jim Meyering  <jim@meyering.net>
7220
7221         * copy-file.c (copy_file_preserving): Declare buf_size to be
7222         of type size_t, not int.
7223
7224 2003-04-11  Jim Meyering  <jim@meyering.net>
7225
7226         Merge changes from Coreutils.
7227
7228         2003-03-22  Jim Meyering  <jim@meyering.net>
7229
7230         * strftime.c (widen): Cast alloca return value to proper type.
7231
7232         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7233
7234         From GNU libc.
7235         * strftime.c (my_strftime): Handle very large width
7236         specifications for numeric values correctly.  Improve checks for
7237         overflow.
7238
7239         2003-01-19  Jim Meyering  <jim@meyering.net>
7240
7241         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7242         (nl_get_alt_digit) [! defined my_strftime]: Define.
7243         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7244         _nl_get_alt_digit and _nl_get_walt_digit.
7245
7246         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7247         These changes have no effect outside of _LIBC.
7248
7249 2003-04-10  Bruno Haible  <bruno@clisp.org>
7250
7251         * findprog.h: New file, from GNU gettext.
7252         * findprog.c: New file, from GNU gettext.
7253
7254 2003-04-05  Jim Meyering  <jim@meyering.net>
7255
7256         Merge changes from Coreutils.
7257
7258         * exclude.h (PARAMS): Remove definition and uses.
7259         * exclude.c: Remove uses of `PARAMS'.
7260
7261         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7262         Add test-cases for DOS filenames. Declare program_name.
7263         (main): Set up program_name.  Patch by Rich Dawe.
7264
7265         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7266         error from mntctl.
7267         Use mntctl's return value to drive the entry-processing loop, since
7268         we can't rely on the value of the vmt_length member in the last
7269         entry.  On some systems doing so could result in exhausting
7270         virtual memory.  Based in part on a patch from Mike Jetzer.
7271
7272 2003-04-04  Bruno Haible  <bruno@clisp.org>
7273
7274         * linebreak.h: New file, from GNU gettext.
7275         * linebreak.c: New file, from GNU gettext with slight modifications.
7276         * lbrkprop.h: New file, from GNU gettext.
7277
7278 2003-04-03  Bruno Haible  <bruno@clisp.org>
7279
7280         * utf8-ucs4.h: New file, from GNU gettext.
7281         * utf16-ucs4.h: New file, from GNU gettext.
7282         * ucs4-utf8.h: New file, from GNU gettext.
7283         * ucs4-utf16.h: New file, from GNU gettext.
7284
7285 2003-04-02  Bruno Haible  <bruno@clisp.org>
7286
7287         * binary-io.h: New file, from GNU gettext.
7288
7289 2003-04-01  Bruno Haible  <bruno@clisp.org>
7290
7291         * pathname.h: New file, from GNU gettext.
7292         * concatpath.c: New file, from GNU gettext.
7293
7294 2003-03-30  Bruno Haible  <bruno@clisp.org>
7295
7296         * copy-file.c (copy_file_preserving): Don't set owner if the function
7297         chown() doesn't exist.
7298
7299 2003-03-28  Bruno Haible  <bruno@clisp.org>
7300
7301         * copy-file.h: New file, from GNU gettext.
7302         * copy-file.c: New file, from GNU gettext.
7303
7304 2003-03-18  Jim Meyering  <jim@meyering.net>
7305
7306         * quote.c (quote_n): Fix typo in comment.
7307
7308 2003-03-14  Jim Meyering  <jim@meyering.net>
7309
7310         Merge changes from Coreutils.
7311         * obstack.h (obstack_object_size): Declare temporary, __o,
7312         to be const, in order to avoid warnings.
7313         (obstack_room): Likewise.
7314         (obstack_empty_p): Likewise.
7315
7316 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7317
7318         Merge changes from Bison.
7319         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7320         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7321         when compiling Bison 1.875's `bitset bset = obstack_alloc
7322         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7323         * hash.c: Include <stdbool.h> unconditionally.
7324
7325 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7326
7327         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7328         Reported by Bruce Becker; see:
7329         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7330
7331 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7332             Bruno Haible  <bruno@clisp.org>
7333
7334         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7335         Reported by John Hughes, see
7336         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7337
7338 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7339
7340         * poll_.h: New file.
7341         * poll.c: New file.
7342
7343 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7344
7345         * mathl.h: New file.
7346         * acosl.c: New file.
7347         * asinl.c: New file.
7348         * atanl.c: New file.
7349         * ceill.c: New file.
7350         * cosl.c: New file.
7351         * expl.c: New file.
7352         * floorl.c: New file.
7353         * frexpl.c: New file.
7354         * ldexpl.c: New file.
7355         * logl.c: New file.
7356         * sincosl.c: New file.
7357         * sinl.c: New file.
7358         * sqrtl.c: New file.
7359         * tanl.c: New file.
7360         * trigl.c: New file.
7361         * trigl.h: New file.
7362
7363 2003-02-17  Bruno Haible  <bruno@clisp.org>
7364
7365         * mkdtemp.h: New file, from GNU gettext.
7366         * mkdtemp.c: New file, from GNU gettext.
7367
7368 2003-01-31  Bruno Haible  <bruno@clisp.org>
7369
7370         * rename.c: #undef rename before defining rpl_rename.
7371         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7372
7373 2003-01-30  Bruno Haible  <bruno@clisp.org>
7374
7375         * printf-args.h: New file, from GNU gettext.
7376         * printf-args.c: New file, from GNU gettext.
7377         * printf-parse.h: New file, from GNU gettext.
7378         * printf-parse.c: New file, from GNU gettext.
7379         * vasnprintf.h: New file, from GNU gettext.
7380         * vasnprintf.c: New file, from GNU gettext.
7381         * asnprintf.c: New file, from GNU gettext.
7382         * vasprintf.h: New file, from GNU gettext with modifications.
7383         * vasprintf.c: New file, from GNU gettext.
7384         * asprintf.c: New file, from GNU gettext.
7385
7386 2003-01-29  Bruno Haible  <bruno@clisp.org>
7387
7388         * stpncpy.h: New file, from GNU gettext with modifications.
7389         * stpncpy.c: New file, from GNU gettext with modifications.
7390
7391 2003-01-28  Bruno Haible  <bruno@clisp.org>
7392
7393         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7394         Paul Eggert.
7395         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7396         Paul Eggert.
7397
7398 2003-01-27  Bruno Haible  <bruno@clisp.org>
7399
7400         * xsetenv.h: New file, from GNU gettext.
7401         * xsetenv.c: New file, from GNU gettext.
7402
7403 2003-01-23  Bruno Haible  <bruno@clisp.org>
7404
7405         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7406
7407 2003-01-22  Bruno Haible  <bruno@clisp.org>
7408
7409         * exit.h: New file, from GNU gettext.
7410
7411 2003-01-11  Bruno Haible  <bruno@clisp.org>
7412
7413         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7414         * strcase.h (strcasecmp, strncasecmp): Likewise.
7415
7416 2003-01-14  Jim Meyering  <jim@meyering.net>
7417
7418         * same.c (same_name): Tweak a comment.
7419
7420 2003-01-11  Bruno Haible  <bruno@clisp.org>
7421
7422         * same.c (same_name): Reorder tests so as to avoid calling stat()
7423         when a string comparison is sufficient.
7424
7425 2003-01-11  Bruno Haible  <bruno@clisp.org>
7426
7427         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7428         'unsigned int'.
7429
7430 2003-01-11  Bruno Haible  <bruno@clisp.org>
7431
7432         * hash-pjw.c: Add comment about low quality of this function.
7433
7434 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7435
7436         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7437         to avoid collisions with libcurses and libreadline.
7438
7439         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7440         * getstr.h, getstr.c: Remove.
7441         * getline.c: Include "getline.h", to check interface.
7442         Move body of old getstr.c here: this defines MIN_CHUNK and
7443         declares getdelim2, which is renamed from getstr.
7444         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7445
7446         * linebuffer.c (readlinebuffer): Renamed from readline.
7447         All uses changed.
7448         * linebuffer.h: Likewise.
7449         (readline): Remove backward-compatibility macro.
7450
7451 2003-01-12  Jim Meyering  <jim@meyering.net>
7452
7453         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7454
7455 2003-01-10  Bruno Haible  <bruno@clisp.org>
7456
7457         * alloca_.h: New file.
7458         * getdate.y: Unconditionally include alloca.h.
7459         * makepath.c: Likewise.
7460         * setenv.c: Likewise.
7461         * userspec.c: Likewise.
7462
7463 2003-01-09  Bruno Haible  <bruno@clisp.org>
7464
7465         * stdbool.h.in: New file.
7466
7467 2003-01-08  Bruno Haible  <bruno@clisp.org>
7468
7469         * safe-read.c: Include specification header first, to ensure its
7470         selfcontainedness.
7471         * full-write.c: Likewise.
7472
7473 2003-01-08  Jim Meyering  <jim@meyering.net>
7474
7475         * full-write.c: Undefine and define-away `const' after inclusion
7476         of errno.h, not before.  Suggestion from Bruno Haible.
7477
7478 2003-01-07  Jim Meyering  <jim@meyering.net>
7479
7480         * full-write.c: Rework so that it may serve to define full_read, too.
7481         * full-read.c: Simply #define FULL_READ and include full-write.c.
7482
7483 2003-01-06  Jim Meyering  <jim@meyering.net>
7484
7485         * version-etc.c: Update year in translatable copyright string.
7486
7487 2002-12-25  Bruno Haible  <bruno@clisp.org>
7488
7489         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7490         * xstrtol.h: Likewise.
7491         * xstrtoimax.c: Likewise.
7492         * xstrtoumax.c: Likewise.
7493         * human.h: Likewise.
7494
7495         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7496         on systems that have <inttypes.h> but not <stdint.h>.
7497
7498 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7499
7500         * memcoll.c (memcoll): Fall back on a simple algorithm using
7501         memcmp if strcoll doesn't work.
7502
7503 2002-12-23  Bruno Haible  <bruno@clisp.org>
7504
7505         * localcharset.h: New file.
7506         * localcharset.c: Include it.
7507         * unicodeio.c: Likewise.
7508
7509 2002-12-22  Bruno Haible  <bruno@clisp.org>
7510
7511         * utime.c (utime_null): No need to call ftruncate if the file was
7512         nonempty.
7513
7514 2002-12-23  Bruno Haible  <bruno@clisp.org>
7515
7516         * memcoll.c (STRCOLL): New macro.
7517         (memcoll): Use it.
7518
7519 2002-12-22  Bruno Haible  <bruno@clisp.org>
7520
7521         * getstr.h (getstr): Define, to avoid clash with libcurses.
7522         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7523
7524 2002-12-22  Bruno Haible  <bruno@clisp.org>
7525
7526         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7527
7528 2002-12-23  Bruno Haible  <bruno@clisp.org>
7529
7530         * getline.h: Include <stddef.h>, for size_t.
7531
7532         * unicodeio.h: Include <stddef.h>, for size_t.
7533         * unicodeio.c: Don't include <stddef.h>.
7534
7535 2002-12-17  Bruno Haible  <bruno@clisp.org>
7536
7537         * canon-host.c (strdup): Remove unused declaration.
7538
7539         * fsusage.c: Include full_read.h.
7540         (get_fs_usage): Use full_read instead of safe_read.
7541
7542         * utime.c (utime_null): Use SAFE_READ_ERROR.
7543
7544 2002-12-11  Bruno Haible  <bruno@clisp.org>
7545
7546         * setenv.h: Rewritten to cope with systems that have setenv() but not
7547         unsetenv().
7548         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7549         modifications:
7550
7551         2002-12-11  Bruno Haible  <bruno@clisp.org>
7552
7553                 * setenv.c (alloca): Fall back to malloc.
7554                 (freea): New macro.
7555                 (setenv): Use freea() to free memory allocated with alloca().
7556
7557         2002-11-13  Bruno Haible  <bruno@clisp.org>
7558
7559                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7560                 function declarations.
7561                 * unsetenv.c (unsetenv): Likewise.
7562
7563         2002-03-04  Bruno Haible  <bruno@clisp.org>
7564
7565                 Portability to AIX 4.3.3.
7566                 * unsetenv.c: New file, extracted from setenv.c.
7567                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7568
7569         2001-12-20  Bruno Haible  <bruno@clisp.org>
7570
7571                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7572                 use malloc instead. For SunOS 4.
7573
7574         2001-12-11  Bruno Haible  <bruno@clisp.org>
7575
7576                 * setenv.c: Declare alloca.
7577                 (compar_fn_t): New typedef.
7578                 (KNOWN_VALUE, STORE_VALUE): Use it.
7579
7580         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7581         setenv.h.
7582
7583 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7584
7585         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7586         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7587         Choose values that are less likely to collide with system fnmatch
7588         options.
7589         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7590         defined (e.g., a pure POSIX system).
7591         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7592         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7593
7594 2002-12-06  Jim Meyering  <jim@meyering.net>
7595
7596         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7597
7598         Merge in changes from libc's misc/error.c, in preparation
7599         for the merge of gnulib's changes back into libc.
7600
7601         * error.c (_): Define only if not already defined.
7602         Move definition to follow all #include directives.
7603         Include unlocked-io.h only if !_LIBC.
7604         [_LIBC]: Include <libio/libioP.h>.
7605         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7606         (fflush): Tweak definition to use INTUSE.
7607         (putc): Define.
7608
7609 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7610
7611         * alloca.c [defined emacs]: Include "lisp.h".
7612         (xalloc_die) [defined emacs]: New macro.
7613         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7614         [! defined emacs]: Include <xalloc.h>.
7615         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7616         (pointer): Typedef to POINTER_TYPE *.
7617         (malloc): Remove decl; we now always use xmalloc.
7618         (alloca): Use old-style definition, since Emacs needs this.
7619         Check for arithmetic overflow when computing combined size.
7620
7621 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7622
7623         Do not generate unlocked-io.h automatically, since it's easier to
7624         maintain it by hand.
7625
7626         * unlocked-io.h: New file, from GNU diffutils,
7627         but with proper copyright notice and attribution.
7628         * gen-uio: Remove.
7629         * Makefile.am: Add copyright notice.
7630         (libfetish_a_SOURCES): Add unlocked-io.h.
7631         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7632         (DISTCLEANFILES, io_functions): Remove macros.
7633         (EXTRA_DIST): Remove gen_uio.
7634         (unlocked-io.h): Remove rule.
7635
7636 2002-12-04  Jim Meyering  <jim@meyering.net>
7637
7638         Reflect the fact that stat.c and lstat.c are no longer generated.
7639         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7640         (DISTCLEANFILES): Likewise.
7641         (EXTRA_DIST): Likewise.
7642         (all_local): Don't depend on stat.c or lstat.c.
7643         (stat.c, lstat.c): Remove rules.
7644         (EXTRA_DIST): Remove xstat.in.
7645
7646         * xstat.in: Remove file.  Contents moved into stat.c.
7647         * stat.c: New file.  Contents mostly from xstat.in.
7648         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7649         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7650
7651         * safe-read.c: Rework so that it may serve to define safe_write, too.
7652         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7653
7654 2002-12-03  Jim Meyering  <jim@meyering.net>
7655
7656         * safe-read.c, safe-write.c: Change variable names and comments, but
7657         not semantics, to minimize the differences between these two files.
7658         (safe_read): Change comment to mention SAFE_READ_ERROR.
7659
7660         * safe-read.c (IS_EINTR): Define.
7661         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7662
7663 2002-12-02  Bruno Haible  <bruno@clisp.org>
7664
7665         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7666         Define, taken from safe-read.c.
7667         (INT_MAX): Provide fallback.
7668         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7669         * safe-write.h (SAFE_WRITE_ERROR): Define.
7670
7671         * safe-read.c (EINTR): Remove definition.
7672         (safe_read): Don't use EINTR if it is absent.
7673
7674 2002-12-02  Jim Meyering  <jim@meyering.net>
7675
7676         * safe-read.c (EINTR): Define.
7677         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7678         (INT_MAX): Provide fallback.
7679         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7680
7681         * safe-read.h (SAFE_READ_ERROR): Define.
7682
7683 2002-12-01  Jim Meyering  <jim@meyering.net>
7684
7685         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7686         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7687
7688 2002-11-27  Paul Eggert  <eggert@twinsun.com>
7689
7690         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7691         hash_rehash): Replace `if (limit <= value) abort ();' with
7692         `if (! (value < limit)) abort ();', for readability.
7693
7694 2002-11-26    <karl@gnu.org>
7695
7696         * strdup.c: copy from libc again, with jim's ok.
7697         * .cppi-disable: re-add strdup.c
7698
7699 2002-11-25    <karl@gnu.org>
7700
7701         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7702         instead of "strtol.c".
7703
7704 2002-11-25  Jim Meyering  <jim@meyering.net>
7705
7706         * mktime.c: Sync from libc, now that it has the latest fix.
7707
7708 2002-11-24    <karl@gnu.org>
7709
7710         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7711         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7712
7713 2002-11-24  Jim Meyering  <jim@meyering.net>
7714
7715         Update from coreutils:
7716
7717         * mktime.c: Merge in changes from libc.
7718
7719         Avoid a link-time failure on some Linux systems.
7720         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7721         (__mon_yday): Declare with the STATIC attribute.
7722         (__mktime_internal): Likewise.
7723         Based on a report from Greg Schafer.
7724
7725 2002-11-23  Jim Meyering  <jim@meyering.net>
7726
7727         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7728         Use `unsigned', not `int', as type of index.
7729
7730         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7731
7732         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7733
7734 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7735
7736         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7737         hint that one should use `if (! x) abort ();' rather than `assert
7738         (x);', and anyway it's one less thing to worry about configuring.
7739         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7740         hash_rehash, hash_insert): Use abort rather than assert.
7741
7742 2002-11-22  Paul Eggert  <eggert@twinsun.com>
7743
7744         * quotearg.h: Allow multiple inclusion by surrounding with
7745         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
7746         so that we can be included first.
7747         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
7748         * quotearg.c: Include quotearg.h immediately after config.h.
7749         No need to include stddef.h or sys/types.h any more.
7750         Surround local include files with "", not "<>".
7751         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7752         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7753         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7754         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7755         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7756         (ISPRINT): Remove; no longer needed now that we assume C89.
7757
7758         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7759         Preserve errno.
7760
7761         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7762         quotearg_char): Use SIZE_MAX rather than
7763         (size_t) -1 when we are talking about "infinity".
7764
7765         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7766
7767 2002-11-22  Bruno Haible  <bruno@clisp.org>
7768
7769         * safe-read.h: Assume C89. Add comments.
7770         (safe_read): Change return type to size_t.
7771         * safe-read.c (safe_read): Change return type to size_t. Handle byte
7772         counts > SSIZE_MAX correctly.
7773         * safe-write.h: New file.
7774         * safe-write.c: New file.
7775         * full-read.h: New file.
7776         * full-read.c: New file.
7777         * full-write.h: Assume C89. Add comments.
7778         * full-write.c: Include safe-write.h.
7779         (full_write): Rewritten to use safe_write.
7780         Suggested by Jim Meyering and Paul Eggert.
7781
7782 2002-11-21  Bruno Haible  <bruno@clisp.org>
7783
7784         Remove case insensitive option matching.
7785         * argmatch.h (argcasematch): Remove declaration.
7786         (ARGCASEMATCH): Remove macro.
7787         (__xargmatch_internal): Remove case_sensitive argument.
7788         (XARGMATCH): Update.
7789         (XARGCASEMATCH): Remove macro.
7790         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7791         case_sensitive argument.
7792         (argcasematch): Remove function.
7793         (__xargmatch_internal): Remove case_sensitive argument.
7794         (main): Use XARGMATCH instead of XARGCASEMATCH.
7795
7796         * xmalloc.c: Change compile-time error message. Add comment about
7797         required autoconf version.
7798
7799 2002-11-21  Jim Meyering  <jim@meyering.net>
7800
7801         * strdup.c (strdup): Tweak comment and initial #if/#include.
7802
7803         Merge in changes from the coreutils.
7804
7805         2002-09-25  Paul Eggert  <eggert@twinsun.com>
7806         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7807         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7808         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7809         int.  Work more efficiently if X is the same width as uintmax_t.
7810         Do not compare X to -1, to avoid bogus compiler warning.
7811         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7812         Don't assume that f_frsize and f_bsize are the same type.
7813
7814         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7815         on FreeBSD.
7816
7817         * makepath.c (make_path): Restore umask *before* creating the final
7818         component.
7819         (make_path): Minor reformatting.
7820
7821         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7822         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7823
7824         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7825         ones.  At least on GNU/Linux systems, `auto' means something else.
7826         From Michael Stone.
7827
7828 2002-11-20  Paul Eggert  <eggert@twinsun.com>
7829
7830         Merge argmatch cleanups from Bison.  Assume C89.
7831
7832         * argmatch.c: Include config.h here, not in argmatch.h.
7833         Include stdlib.h, for EXIT_FAILURE.
7834         Always include <string.h>, since we assume C89.
7835         (EXIT_FAILURE): Remove pre-C89 bug workaround.
7836         * argmatch.h: Do not include <config.h> or <sys/types.h>.
7837         Include <stddef.h> instead, since it's all we need for size_t.
7838         (PARAMS): Remove.  All uses removed.
7839         (ARRAY_CARDINALITY): Do not bother to #undef.
7840         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7841         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7842         Remove unnecessary parentheses.
7843         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7844         Insert necessary parentheses.
7845         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7846         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7847
7848 2002-11-19  Bruno Haible  <bruno@clisp.org>
7849
7850         * mbswidth.c: Include mbswidth.h right at the beginning.
7851         * mbswidth.h: Include <stddef.h>, for size_t.
7852
7853         * mbswidth.h (PARAMS): Remove macro.
7854         (mbswidth, mbsnwidth): Use ANSI C function declarations.
7855         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7856
7857         * gcd.h (PARAMS): Remove macro.
7858         (gcd): Use ANSI C function declarations.
7859         * gcd.c (gcd): Likewise.
7860
7861 2002-11-15  Bruno Haible  <bruno@clisp.org>
7862
7863         * strcspn.c: Include <stddef.h>.
7864         (strcspn): Use ANSI C function declaration. Change return type to
7865         size_t. Use NULL.
7866         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7867         (strpbrk): Use NULL.
7868         * strpbrk.h (PARAMS): Remove macro.
7869         (strpbrk): Use ANSI C function declaration.
7870         * strstr.c: Don't include <sys/types.h>.
7871         * strstr.h (PARAMS): Remove macro.
7872         (strstr): Use ANSI C function declarations.
7873
7874 2002-11-06  Bruno Haible  <bruno@clisp.org>
7875
7876         * gcd.h (gcd): Change argument type to 'unsigned long'.
7877         * gcd.c (gcd): Likewise.
7878
7879 2002-11-05  Bruno Haible  <bruno@clisp.org>
7880
7881         * gcd.h: New file, from gettext-0.11.5.
7882         * gcd.c: New file, from gettext-0.11.5.
7883
7884 2002-11-05  Bruno Haible  <bruno@clisp.org>
7885
7886         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7887         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7888         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7889         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7890
7891         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7892         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7893
7894         * closeout.c: Include gettext.h instead of <libintl.h>.
7895         * human.c: Include gettext.h instead of <libintl.h>.
7896         * quotearg.c: Include gettext.h instead of <libintl.h>.
7897         * rpmatch.c: Include gettext.h instead of <libintl.h>.
7898         * unicodeio.c: Include gettext.h instead of <libintl.h>.
7899         * userspec.c: Include gettext.h instead of <libintl.h>.
7900         * version-etc.c: Include gettext.h instead of <libintl.h>.
7901         * xmalloc.c: Include gettext.h instead of <libintl.h>.
7902         (textdomain): Remove definition.
7903         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
7904
7905         * long-options.c: Remove include of <libintl.h> and definition of _.
7906         * same.c: Remove include of <libintl.h> and definition of _.
7907
7908 2002-11-04  Bruno Haible  <bruno@clisp.org>
7909
7910         * stpcpy.h: New file, from GNU gettext-0.11.5.
7911         * strcase.h: New file, from GNU gettext-0.11.5.
7912         * strpbrk.h: New file, from GNU gettext-0.11.5.
7913         * strstr.h: New file, from GNU gettext-0.11.5.
7914         * xgetcwd.h: New file, from GNU gettext-0.11.5.
7915
7916 2002-05-09  Bruno Haible  <bruno@clisp.org>
7917
7918         * config.charset: Update for newest glibc. Add canonical names
7919         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
7920
7921 2002-05-09  Bruno Haible  <bruno@clisp.org>
7922
7923         * localcharset.c (get_charset_aliases): Add more Windows specific
7924         aliases.
7925
7926 2002-05-08  Owen Taylor  <otaylor@redhat.com>
7927
7928         * config.charset: A few additions for Solaris.
7929
7930 2001-12-05  Bruno Haible  <bruno@clisp.org>
7931
7932         * localcharset.c (locale_charset): Don't return an empty string.
7933
7934 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
7935
7936         * config.charset: msdos in uk_UA uses CP1125.
7937
7938 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
7939
7940         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
7941         * localcharset.c (locale_charset): Declare as extern "C".
7942
7943 2002-02-15  Bruno Haible  <bruno@clisp.org>
7944
7945         * config.charset [msdosdjgpp]: For Russian, use CP866.
7946
7947 2002-02-11  Bruno Haible  <bruno@clisp.org>
7948
7949         * config.charset: Add support for NetBSD.
7950
7951 2002-09-25    <karl@gnu.org>
7952
7953         * strdup.c: copy from libc/string (via ../config/srclist*).
7954         * getopt*: copy from libc/posix.
7955         * gettext.h: copy from gettext.
7956         * .cppi-disable: add strdup.c, gettext.h.
7957
7958 2002-07-01  Jim Meyering  <meyering@lucent.com>
7959
7960         * c-stack.c: Include sys/time.h.
7961         From Volker Borchert.
7962
7963 2002-06-11  Paul Eggert  <eggert@twinsun.com>
7964
7965         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
7966         New macro.  Use it uniformly instead of
7967         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
7968         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
7969         reported by Vin Shelton.
7970
7971 2002-06-22  Jim Meyering  <meyering@lucent.com>
7972
7973         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
7974         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
7975
7976 2002-06-22  Paul Eggert  <eggert@twinsun.com>
7977
7978         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
7979         Do not assume SA_SIGINFO behavior.
7980         Bug reported by Jim Meyering on NetBSD 1.5.2.
7981
7982 2002-06-22  Jim Meyering  <meyering@lucent.com>
7983
7984         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
7985
7986         * exitfail.c, exitfail.h: Likewise.
7987         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
7988
7989         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
7990         of fnmatch.h.
7991         (EXTRA_DIST): Add fnmatch_loop.c.
7992         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
7993
7994         * fnmatch_loop.c: New file, from diffutils-2.8.2.
7995         * fnmatch.c: Update from diffutils-2.8.2.
7996         * fnmatch_.h: New file.  From diffutils-2.8.2.
7997         * fnmatch.h: Remove file.
7998
7999 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8000
8001         * file-type.h: Report an error if neither S_ISREG nor
8002         S_IFREG is defined, instead of using a test specific to glibc
8003         2.2.  This should be safe, since POSIX requires S_ISREG and
8004         Unix Version 7 had S_IFREG.  We don't need to check for
8005         <sys/types.h> since we don't use any symbols that it defines.
8006
8007 2002-06-15  Jim Meyering  <meyering@lucent.com>
8008
8009         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8010         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8011         have been included before this file.
8012
8013 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8014
8015         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8016         so that each temporary file name is unique and valid in the first
8017         8 characters, for operation under DOS.
8018
8019 2002-06-15  Jim Meyering  <meyering@lucent.com>
8020
8021         Work even with DJGPP 2.03, which lacks support for symlinks.
8022         From Richard Dawe.
8023         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8024         is defined.
8025         * lchown.c (S_ISLNK): Likewise.
8026
8027 2002-06-14  Jim Meyering  <meyering@lucent.com>
8028
8029         * file-type.h: Use the version from diffutils-2.8.2.
8030         * file-type.c: Likewise.
8031
8032 2002-05-27  Jim Meyering  <meyering@lucent.com>
8033
8034         Fix a problem seen only on nonconforming systems whereby ls.c's
8035         use of localtime, and then of gettimeofday would cause trouble:
8036         the localtime call used to initialize rpl_gettimeofday's save
8037         mechanism would clobber ls's current local time information so
8038         that in any long listing the first file would always be listed
8039         with date 1970-01-01.  Analysis by Volker Borchert.
8040
8041         * gettimeofday.c (localtime): Undefine.
8042         (rpl_localtime): New function.
8043
8044 2002-05-22  Jim Meyering  <meyering@lucent.com>
8045
8046         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8047         * file-type.h: New file.
8048         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8049
8050 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8051
8052         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8053
8054 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8055
8056         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8057         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8058         of 127, since 64 is the largest conceivable number for ancient
8059         nonstandard hosts.
8060         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8061
8062 2002-04-28  Jim Meyering  <meyering@lucent.com>
8063
8064         * sig2str.c (WTERMSIG): Remove definition (unused).
8065
8066 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8067
8068         * sig2str.h, sig2str.c: New files.
8069         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8070
8071 2002-04-24  Jim Meyering  <meyering@lucent.com>
8072
8073         * gettext.h: New file, from Gettext.
8074         * Makefile.am (INCLUDES): Remove -I../intl.
8075         (libfetish_a_SOURCES): Add gettext.h.
8076
8077 2002-04-16  Jim Meyering  <meyering@lucent.com>
8078
8079         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8080         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8081         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8082
8083 2002-04-12  Jim Meyering  <meyering@lucent.com>
8084
8085         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8086
8087 2002-03-10  Jim Meyering  <meyering@lucent.com>
8088
8089         * makepath.c (make_path): Remove a comma from a diagnostic.
8090         Suggestion from Santiago Vila.
8091
8092 2002-03-08  Jim Meyering  <meyering@lucent.com>
8093
8094         * rename.c: Mention that this wrapper is needed also on
8095         mips-dec-ultrix4.4 systems.
8096
8097 2002-03-02  Jim Meyering  <meyering@lucent.com>
8098
8099         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8100         not HAVE_CLOCK_SETTIME.
8101
8102 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8103
8104         * nanosleep.h: Rename to....
8105         * timespec.h: New name for nanosleep.h.  All uses changed.
8106
8107         * gettime.c: New file.
8108         * settime.c: New file.
8109         * stime.c: Remove.
8110
8111         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8112         timespec.h.  Remove nanosleep.h.
8113
8114 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8115
8116         * acl.c, acl.h: New files.
8117         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8118
8119 2002-02-24  Jim Meyering  <meyering@lucent.com>
8120
8121         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8122         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8123         cause trouble.  Reported by Nelson Beebe.
8124
8125 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8126
8127         * path-concat.c (xpath_concat): Reorder code to pacify
8128         compilers that don't know that xalloc_die never returns.
8129
8130 2002-02-20  Jim Meyering  <meyering@lucent.com>
8131
8132         * getdate.c: Regenerate using bison-1.33.
8133
8134 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8135
8136         * posixver.c, posixver.h: New files.
8137         * Makefile.am (libfetish_a_SOURCES): Add them.
8138
8139 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8140             Bruno Haible  <bruno@clisp.org>
8141
8142         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8143         (fwrite_success_callback): New declaration.
8144         * unicodeio.c (unicode_to_mb): New function, extracted from
8145         print_unicode_char. Call failure callback instead of error.
8146         (fwrite_success_callback): New function.
8147         (exit_failure_callback): New function.
8148         (fallback_failure_callback): New function.
8149         (print_unicode_char): Call unicode_to_mb.
8150
8151 2002-01-26  Jim Meyering  <meyering@lucent.com>
8152
8153         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8154
8155 2002-01-22  Jim Meyering  <meyering@lucent.com>
8156
8157         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8158         Otherwise, some versions of automake would omit the rule that makes
8159         Makefile from Makefile.in.
8160
8161 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8162
8163         * xmemcoll.h, xmemcoll.c: New files.
8164         * Makefile.am (libfetish_a_SOURCES): Add them.
8165         * memcoll.c: Include errno.h, and declare errno if not defined.
8166         (memcoll): Set errno to zero if there is no error.
8167
8168         * quotearg.c (quotearg_buffer_restyled):
8169         Fix bug with quoting buffers containing NUL when backslashing escapes.
8170         This bug was exposed by the other changes in this patch.
8171         (quotearg_n_options): New arg ARGSIZE.
8172         All callers changed.
8173         (quoting_options_from_style): New function.
8174         (quotearg_n_style): Use it.
8175         (quotearg_n_style_mem): New function.
8176
8177         * quotearg.h (quotearg_n_style_mem): New function.
8178
8179 2002-01-16  Jim Meyering  <meyering@lucent.com>
8180
8181         * getdate.y: Add three semicolons, each just before a closing brace.
8182         Bison (as of version 1.31) no longer papers over that mistake.
8183
8184 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8185
8186         * backupfile.c (ISDIGIT): Comment fix.
8187         * getdate.y (ISDIGIT): Likewise.
8188         * posixtm.c (ISDIGIT, year): Likewise.
8189         * strverscmp.c (ISDIGIT): Likewise.
8190         * userspec.c (ISDIGIT): Likewise.
8191
8192 2002-01-05  Jim Meyering  <meyering@lucent.com>
8193
8194         * version-etc.c (version_etc_copyright): Update copyright year.
8195
8196 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8197
8198         * closeout.c (close_stdout_status): If ferror (stdout), do
8199         not silently exit merely because the output buffer happens to
8200         have nothing pending.
8201
8202 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8203
8204         See the big note in ../ChangeLog.
8205         * human.c (suffixes): Prefer K to k for 1024.
8206         (generate_suffix_backwards): New function.
8207         (human_readable_inexact): Use it.
8208         * xstrtol.c (__xstrtol): If there is no number but there
8209         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8210         Accept 'K' as well as 'k'.
8211
8212 2001-12-15  Jim Meyering  <meyering@lucent.com>
8213
8214         * regex.h (__restrict_arr): Update from libc.
8215
8216         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8217         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8218         (STREQ): Define.
8219
8220 2001-12-10  Jim Meyering  <meyering@lucent.com>
8221
8222         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8223         Instead, include "xalloc.h".
8224         (initbuffer): Don't cast xmalloc return value to char*.
8225         (readline): Reword comment.
8226         Don't cast xrealloc return value to char*
8227         Return NULL, not 0.
8228
8229 2001-12-09  Jim Meyering  <meyering@lucent.com>
8230
8231         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8232         `signed and unsigned type in conditional expression'.
8233         * posixtm.c (posix_time_parse): Likewise.
8234
8235         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8236
8237         * readtokens.c (readtoken): Declare an index to be of type unsigned
8238         to avoid a pedantic warning.
8239
8240         * getstr.c: Don't include assert.h.
8241         (getstr): Remove warning-evoking assertions.
8242         Return -1 if offset parameter is out of bounds.
8243         Change the type of a local from int to size_t.
8244
8245         * strftime.c (my_strftime_localtime_r): Include this function
8246         definition in the `#if ! HAVE_TM_GMTOFF' block.
8247
8248         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8249         Include xalloc.h instead.
8250
8251 2001-12-02  Jim Meyering  <meyering@lucent.com>
8252
8253         * tempname.c: Don't declare getenv, thus reverting the change of
8254         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8255         included.
8256
8257         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8258         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8259
8260 2001-11-30  Akim Demaille  <akim@epita.fr>
8261
8262         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8263         before being defined.
8264
8265 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8266
8267         * quotearg.h (quotearg_n, quotearg_n_style):
8268         First arg is int, not unsigned.
8269         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8270         (SIZE_MAX, UINT_MAX): New macros.
8271         (quotearg_n_options): Abort if N is negative.
8272         Avoid overflow check on hosts where size_t is 64 bits and int
8273         is 32 bits, as overflow is impossible there.
8274         Fix off-by-one typo that caused unnecessary reallocation.
8275
8276 2001-11-27  Jim Meyering  <meyering@lucent.com>
8277
8278         * tempname.c: Merge with version from libc.
8279         * regex.c: Likewise.
8280
8281         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8282         for which STDC_HEADERS is 0, it was not included, resulting in a
8283         warning about an integer-to-pointer conversion problem with getenv.
8284         Reported by Volker Borchert.
8285
8286 2001-11-26  Jim Meyering  <meyering@lucent.com>
8287
8288         * gtod.h: Remove file.
8289         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8290         * gettimeofday.c: Don't include gtod.h.
8291         (GTOD_init): Remove function.
8292         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8293         Suggestion from Volker Borchert.
8294
8295 2001-11-23  Jim Meyering  <meyering@lucent.com>
8296
8297         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8298         * hash.c (struct hash_table): Define it here instead.
8299
8300 2001-11-22  Jim Meyering  <meyering@lucent.com>
8301
8302         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8303
8304 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8305
8306         * tempname.c (TMP_MAX): Remove; no longer needed.
8307         (TEMPORARIES): New macro.
8308         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8309         removes an artificial limitation (e.g. HP-UX 10.20, where
8310         TMP_MAX is 17576).
8311
8312 2001-11-18  Jim Meyering  <meyering@lucent.com>
8313
8314         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8315         on SunOS 4.
8316
8317         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8318         files will be created before anything else.
8319
8320 2001-11-17  Jim Meyering  <meyering@lucent.com>
8321
8322         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8323         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8324         rather than group writable.  Patch by Juan F. Codagnone.
8325
8326         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8327         Instead, include "xalloc.h".
8328
8329         * mountlist.c: Include unlocked-io.h after all system headers.
8330         Remove explicit declarations of xmalloc, xrealloc,
8331         and xstrdup.  Instead, include "xalloc.h".
8332
8333         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8334         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8335         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8336
8337         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8338         Reported by Padraig Brady.
8339
8340         * mkstemp.c: #undef mkstemp.
8341         Include config.h.
8342         (rpl_mkstemp): Rename from mkstemp.
8343         Protoize.
8344
8345 2001-11-16  Jim Meyering  <meyering@lucent.com>
8346
8347         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8348         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8349         determine the amount of total physical memory, use pstat_getstatic.
8350         HPUX-11 doesn't define _SC_PHYS_PAGES.
8351         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8352         If sysconf couldn't be used to determine the amount of available
8353         physical memory, use both pstat_getstatic and pstat_getdynamic.
8354         Based on a patch from Bob Proulx.
8355
8356 2001-11-05  Jim Meyering  <meyering@lucent.com>
8357
8358         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8359
8360 2001-11-03  Jim Meyering  <meyering@lucent.com>
8361
8362         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8363         in argmatch_to_argument call.
8364
8365         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8366         argument.
8367
8368         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8369         e.g., a fault due to an attempt to free a NULL pointer.
8370
8371 2001-11-01  Jim Meyering  <meyering@lucent.com>
8372
8373         * dirfd.c, dirfd.h: New files.
8374         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8375
8376         * hash.c (hash_print) [TESTING]: Clean up.
8377
8378 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8379
8380         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8381         to avoid a warning if -Wall.
8382
8383 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8384
8385         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8386
8387 2001-10-21  Jim Meyering  <meyering@lucent.com>
8388
8389         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8390         this code would end up calling gettext even in packages built
8391         with --disable-nls.
8392         * getopt.c (_): Likewise.
8393         * regex.c (_): Likewise.
8394
8395 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8396
8397         * error.c (strerror_r): Do not declare unless !_LIBC.
8398         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8399         Use strerror_r that is only a macro, even if it is not a function.
8400         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8401         (private_strerror): Use prototypes, not old-style function definition.
8402         (print_errno_message): New function.
8403         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8404         char*-flavored one.
8405         (error_tail, error, error_at_line): Use it.
8406
8407 2001-10-11  Jim Meyering  <meyering@lucent.com>
8408
8409         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8410         and quote_n (1, ... to avoid clobbering a buffer.
8411
8412 2001-10-05  Jim Meyering  <meyering@lucent.com>
8413
8414         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8415         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8416         * hash-pjw.h: New file.
8417
8418 2001-09-30  Jim Meyering  <meyering@lucent.com>
8419
8420         * mountlist.c [MOUNTED_GETFSSTAT]:
8421         Include <sys/ucred.h>, for Apple Darwin.
8422         Include sys/mount.h and sys/fs_types.h only if available.
8423         (FS_TYPE): Define.
8424         (read_filesystem_list): Use FS_TYPE.
8425
8426 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8427
8428         * exclude.c (excluded_filename): 0 -> false, since it's
8429         a boolean context.
8430
8431 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8432
8433         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8434         #defines strtoimax.  Also treat the other strto* functions
8435         like strtoimax.
8436
8437         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8438         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8439         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8440
8441 2001-09-26  Jim Meyering  <meyering@lucent.com>
8442
8443         Most macros in unlocked-io.h had the wrong number of arguments.
8444         * gen-uio: New script.
8445         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8446         * unlocked-io.hin: Remove file.
8447         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8448         rather than trying to embed it here.
8449         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8450         Reported by Padraig Brady.
8451
8452 2001-09-25  Volker Borchert  <bt@teknon.de>
8453
8454         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8455
8456 2001-09-23  Jim Meyering  <meyering@lucent.com>
8457
8458         * mountlist.c: Remove useless parentheses in #if directives.
8459         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8460         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8461
8462 2001-09-22  Jim Meyering  <meyering@lucent.com>
8463
8464         * localcharset.c: Update from latest gettext.
8465         * config.charset: Likewise.
8466
8467 2001-09-20  Jim Meyering  <meyering@lucent.com>
8468
8469         * xstrtol.c (strtoimax): Guard declaration with
8470         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8471         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8472         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8473         (strtoumax): Likewise, for completeness (it wasn't necessary).
8474
8475 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8476
8477         * strtoimax.c (HAVE_LONG_LONG):
8478         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8479         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8480         to work around bug in IBM C compiler.
8481
8482 2001-09-16  Jim Meyering  <meyering@lucent.com>
8483
8484         * mkdir.c: New file.
8485
8486 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8487
8488         * xgetcwd.c: Revert some of the previous change; intead,
8489         fix the HAVE_GETCWD_NULL code to behave more like the
8490         !HAVE_GETCWD_NULL code used to.
8491
8492         Include "xalloc.h".
8493         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8494         invoke xalloc_die.
8495
8496 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8497
8498         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8499         Use ssize_t, not int, to store result of readlink.
8500         Check for ssize_t overflow as well as size_t overflow,
8501         as POSIX says the result of readlink is implementation-defined
8502         when ssize_t overflows.
8503         Remove unnecessary cast to char*.
8504         Use free+malloc instead of realloc, as the storage doesn't need
8505         to be preserved and it's clearer and can be more efficient that way.
8506         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8507         * xreadlink.h (xreadlink): Update prototype.
8508
8509 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8510
8511         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8512         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8513         spotted by Jim Meyering.
8514
8515 2001-09-03  Jim Meyering  <meyering@lucent.com>
8516
8517         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8518
8519 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8520
8521         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8522         like the HAVE_GETCWD_NULL code.
8523         Include pathmax.h if not HAVE_GETCWD.
8524         Do not include xalloc.h.
8525         (INITIAL_BUFFER_SIZE): New symbol.
8526         Do not use xmalloc / xrealloc, since the caller is responsible for
8527         handling errors.  Preserve errno around `free' during failure.
8528         Do not overrun buffer when using getwd.
8529
8530 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8531
8532         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8533         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8534
8535 2001-09-02  Jim Meyering  <meyering@lucent.com>
8536
8537         * error.c: Update from GNU libc.
8538
8539 2001-09-01  Jim Meyering  <meyering@lucent.com>
8540
8541         * xreadlink.c: New file.
8542         * xreadlink.h: New file.
8543         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8544
8545         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8546         doesn't conflict with sparc Solaris 7's definition in
8547         /usr/include/sys/int_types.h.
8548
8549         * exclude.c: Use `""', not `<>' to #include non-system header files.
8550         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8551         and strncasecmp as r-values.  Unixware didn't have declarations.
8552
8553 2001-08-31  Jim Meyering  <meyering@lucent.com>
8554
8555         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8556         Use an initial, malloc'd, buffer of length 128 rather than
8557         a statically allocated one of length 1024.
8558
8559 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8560
8561         * xgetcwd.c: Don't include pathmax.h.
8562         Include stdlib.h and unistd.h if available.
8563         Include xalloc.h.
8564         (xmalloc, xstrdup, free): Remove decls.
8565         (xgetcwd): Don't assume sizes fit in unsigned.
8566         Check for overflow when computing sizes.
8567         Simplify reallocation code.
8568
8569 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8570
8571         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8572
8573         * strtoimax.c: Renamed from strtoxmax.c, removing the
8574         old strtoimax.c.
8575
8576         Also, make the following further changes to make this file's
8577         configuration more similar to that of strtol.c:
8578         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8579         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8580         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8581         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8582         changed to signed values.
8583
8584         And make the following changes as well:
8585         Fix copyright notice, as 1999 was missing.
8586         (verify): New macro.
8587         (strtoimax): Check sizes at compile-time, not run-time.
8588         Prefer strtol to strtoll if both work.
8589         (main): Remove; it was not that useful and was a pain to maintain.
8590
8591         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8592
8593 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8594
8595         * savedir.c (savedir): Remove size parameter, as POSIX says that
8596         a directory's st_size can have an arbitrary value, so the old
8597         usage could waste an arbitrary amount of memory.  All uses
8598         changed.
8599         * savedir.h: Update prototype.
8600
8601 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8602
8603         * xstrtol.c (strtoimax): New decl.
8604
8605 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8606
8607         * xstrtol.h: Add copyright notice.
8608         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8609         LONGINT_INVALID_SUFFIX_CHAR.
8610
8611 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8612
8613         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8614         tm to be declared.
8615
8616 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8617
8618         * hash.c: Remove '2001' from copyright notice.
8619
8620 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8621
8622         * full-write.h: New file.
8623         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8624         * full-write.c: Correct credits, as cccp.c no longer
8625         exists and anyway it was so heavily changed from the old cccp
8626         code as to be unrecognizable.  Include full-write.h.
8627         (full_write) Return size_t, with short writes meaning failure.
8628         All callers changed.  This fixes a bug with large buffers
8629         on 64-bit hosts.
8630         * utime.c: Include full-write.h.
8631
8632 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8633
8634         Merge 'exclude' changes from tar 1.13.22.
8635         This fixes one or two unlikely storage allocation overflow bugs,
8636         but doesn't change user-visible behavior otherwise.
8637
8638 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8639
8640         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8641         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8642         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8643         Include if available.
8644         (<xalloc.h>): Include
8645         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8646         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8647         collide with FNM macros.
8648         (struct patopts): New struct.
8649         (struct exclude): Use it, as exclude patterns now come with options.
8650         (new_exclude): Support above changes.
8651         (new_exclude, add_exclude_file):
8652         Initial size must now be a power of two to simplify overflow checking.
8653         (free_exclude, fnmatch_no_wildcards): New function.
8654         (excluded_filename): No longer requires options arg, as the options
8655         are determined by add_exclude.  Now returns bool, not int.
8656         (excluded_filename, add_exclude):
8657         Add support for the fancy new exclusion options.
8658         (add_exclude, add_exclude_file): Now takes int options arg.
8659         Check for arithmetic overflow when computing sizes.
8660         (add_exclude_file): xrealloc might modify errno, so don't
8661         realloc until after errno might be used.
8662
8663         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8664         New macros.
8665         (free_exclude): New decl.
8666         (add_exclude, add_exclude_file): Now takes int options arg.
8667         (excluded_filename): No longer requires options arg, as the options
8668         are determined by add_exclude.  Now returns bool, not int.
8669
8670 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8671
8672         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8673
8674 2001-08-27  Jim Meyering  <meyering@lucent.com>
8675
8676         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8677
8678         * version-etc.c (N_): Remove definition.
8679         Revert most of last change.
8680         Instead, simply don't mark the `Copyright...' string for translation.
8681         Based on advice from Paul Eggert.
8682
8683         * strtoxmax.c: Tweak comment.
8684
8685 2001-08-26  Jim Meyering  <meyering@lucent.com>
8686
8687         * version-etc.c (version_etc_copyright_fmt): Replace literal year
8688         of copyright with `%s' so translators don't get an untranslated
8689         message in 2002.
8690         (COPYRIGHT_YEAR): Define.
8691         (version_etc): Use fprintf rather than fputs.
8692         Suggestion from Ulrich Drepper.
8693
8694         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8695
8696         * strtoll.c: New file, from GNU libc.
8697         * xstrtoimax.c: New file.
8698
8699         * xstrtol.h: Add xstrtoimax.
8700         * strtoumax.c: New file.  Simply include "strtoumax.c".
8701         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
8702
8703         * strtoumax.c: Factor to work both for unsigned and signed types, ...
8704         * strtoxmax.c: ... then renamed to this.
8705
8706 2001-08-13  Paul Eggert  <eggert@twinsun.com>
8707
8708         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8709         Port to Solaris 8, where 'sed' requires a space after the 'r'
8710         command, and where sh dislikes "$/".  Clean up the spacing a bit.
8711         Redirect output to $tmp just once.
8712
8713 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
8714
8715         * addext.c (<errno.h>): Include.
8716         (errno): Declare if not defined.
8717         (addext): Work correctly when pathconf returns -1 and leaves
8718         errno alone because there is no limit.  Also, work even if
8719         pathconf returns a value greater than SIZE_MAX.
8720
8721 2001-08-12  Jim Meyering  <meyering@lucent.com>
8722
8723         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8724         Simply `return getcwd (NULL, 0);'.
8725         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8726         Use 1300 as initial value for length, not PATH_MAX.
8727
8728         * pathmax.h: Clean up cpp syntax.
8729
8730 2001-08-12  Jim Meyering  <meyering@lucent.com>
8731
8732         * gettimeofday.c: New file.
8733         * gtod.h: New file.
8734         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8735
8736 2001-08-04  Jim Meyering  <meyering@lucent.com>
8737
8738         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8739         to get in sync with glibc.
8740
8741 2001-08-03  Paul Eggert  <eggert@twinsun.com>
8742
8743         The following changes are from gettext 0.10.39 as maintained by
8744         Bruno Haible.
8745
8746         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8747         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8748         with inverted sense.  All uses changed.
8749
8750         * mbswidth.c: Don't include <limits.h>.
8751         Include <stdlib.h> and <string.h> unconditionally.
8752         (iswcntrl, mbsinit, ISCNTRL): New macros.
8753         (mbsnwidth): Use K&R style function declarations.
8754         Don't bother checking for MB_LEN_MAX == 1, since the compiler
8755         can optimize it when MB_CUR_MAX == 1.
8756         The width of control characters is zero, not 1.
8757
8758 2001-07-15  Jim Meyering  <meyering@lucent.com>
8759
8760         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8761         (BUILT_SOURCES): Add unlocked-io.h.
8762         (io_functions): Define.
8763         (unlocked-io.h): New rule.
8764         (DISTCLEANFILES): Add unlocked-io.h.
8765         (all-local): Depend on unlocked-io.h, to ensure it is created.
8766
8767         * unlocked-io.hin: New file
8768
8769         * regex.c: Update from glibc.
8770
8771 2001-07-05  Jim Meyering  <meyering@lucent.com>
8772
8773         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8774         recommendation.
8775         (libfetish_a_SOURCES): Put all .h files here instead.
8776         Remove a thus-exposed (better checks in automake) duplicate and
8777         two unnecessary .h files.
8778
8779 2001-06-11  Jim Meyering  <meyering@lucent.com>
8780
8781         * regex.c: Update from GNU libc.
8782
8783 2001-05-27  Jim Meyering  <meyering@lucent.com>
8784
8785         * readutmp.h (UT_TYPE): Define.
8786
8787 2001-05-24  Jim Meyering  <meyering@lucent.com>
8788
8789         * argmatch.c: Include "quote.h".
8790         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
8791         quote function.  Reported by Göran Uddeborg.
8792
8793 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
8794
8795         * dirname.c (dir_name): Compute append_dot using path, not newpath
8796         which is not yet declared.
8797
8798 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8799
8800         * Makefile.am (libfetish_a_SOURCES):
8801         Add strftime.c, since we now compile it on all hosts.
8802
8803         * strftime.c (my_strftime):
8804         Define to nstrftime if emacs, but only if my_strftime is not defined.
8805         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8806         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8807         Add one more extra argument: a nanoseconds value.
8808         All uses changed.
8809         (ns): New macro.
8810         (my_strftime function): Add %N format.
8811         (emacs_strftimeu): Renamed from emacs_strftime,
8812         with extra ut argument.
8813
8814 2001-05-11  Paul Eggert  <eggert@twinsun.com>
8815
8816         dirname code cleanup.  base_name now behaves more compatibly
8817         with POSIX basename when given file names that have trailing
8818         slashes, and similarly for dir_name.  Add new primitives
8819         base_len and dir_len.  Put the directory-name-related decls
8820         into dirname.h.
8821
8822         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8823         * backupfile.c (base_name): Likewise.
8824         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8825         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8826         * makepath.c (strip_trailing_slashes): Likewise.
8827         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8828         Likewise.
8829         * rename.c (strip_trailing_slashes): Likewise.
8830         * same.c (base_name): Likewise.
8831         * stripslash.c (ISSLASH): Likewise.
8832
8833         * addext.c: Include <dirname.h> after size_t is defined.
8834         * backupfile.c: Likewise.
8835
8836         * addext.c (addext): Use base_len to trim redundant
8837         trailing slashes instead of doing it ourselves.
8838         But do not trim the last slash if it is not redundant.
8839
8840         * backupfile.c (find_backup_file_name,
8841         max_backup_version): Use base_len instead of rolling it ourselves.
8842         Handle the case of "" and (on DOS) "C:" correctly.
8843
8844         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8845         Include <string.h>, <dirname.h>.
8846         (base_name): Allow file names ending in slashes, other than names
8847         that are all slashes.  In this case, return the basename followed
8848         by the slashes.  This is more general, and can be used in places
8849         where the original base_name purposely had an assertion failure.
8850         (base_len): New function.
8851
8852         * dirname.c: Include <string.h> instead of <stdlib.h>.
8853         Do not include <assert.h>; no longer needed.
8854         Include xalloc.h.
8855         (memrchr): Remove decl.
8856         (dir_name_r): Remove.
8857         (dir_len): Renamed from dirlen.  All callers changed.
8858         Rewrite in terms of base_name, for simplicity and consistency.
8859         (dir_name): Never return NULL.  All callers changed.
8860         Do not include <stdlib.h> in test program; no longer needed.
8861         return 0; is fine for test program.
8862
8863         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8864         New macros.
8865         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8866
8867         * path-concat.c (path_concat): Use base_len to compute
8868         base length, not strlen; this means we cannot rely on memcpy
8869         to null-terminate.
8870
8871         * same.c (STREQ): Remove.
8872         (same_name): Handle the case where the basename ends in trailing '/'.
8873
8874         * stripslash.c (strip_trailing_slashes): Return nonzero if
8875         a slash was stripped.  Do not strip the last slash after a
8876         file system prefix.
8877
8878 2001-04-08  Jim Meyering  <meyering@lucent.com>
8879
8880         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8881         recomputed; that's necessary when the offset spans a DST transition.
8882         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
8883
8884 2001-04-02  Jim Meyering  <meyering@lucent.com>
8885
8886         * regex.h, regex.c: Update from GNU libc.
8887
8888 2001-03-19  Paul Eggert  <eggert@twinsun.com>
8889
8890         * version-etc.c (version_etc_copyright): Update to 2001.
8891
8892 2001-03-16  Paul Eggert  <eggert@twinsun.com>
8893
8894         * tempname.c (uint64_t): Define to uintmax_t if
8895         not defined, and if UINT64_MAX is not defined.
8896         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
8897         Reported by John David Anglin.
8898
8899 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
8900
8901         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
8902         alias if codeset is empty.
8903         * config.charset (BeOS): Use wildcard syntax.
8904
8905 2001-03-13  Jim Meyering  <meyering@lucent.com>
8906
8907         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
8908         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
8909         From Bruno Haible.
8910
8911 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8912
8913         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
8914         Don't return NULL.
8915         * unicodeio.c (print_unicode_char): Simplify accordingly.
8916
8917 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
8918
8919         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
8920         support for DOS/DJGPP.
8921
8922 2001-02-28  Paul Eggert  <eggert@twinsun.com>
8923
8924         * Makefile.am (libfetish_a_SOURCES):
8925         Add dup-safer.c, fopen-safer.c.
8926         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
8927
8928         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
8929
8930 2001-02-25  Paul Eggert  <eggert@twinsun.com>
8931
8932         The mkstemp replacement is taken from glibc 2.2.2, with some
8933         portability fixes for use outside glibc, as follows:
8934
8935         * tempname.c (struct_stat64): New macro.
8936         (direxists, __gen_tempname): Use it.
8937         This avoids a portability problem with Solaris 8.
8938
8939         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
8940         (<stddef.h>, <stdint.h>, <string.h>):
8941         Include only if STDC_HEADERS || _LIBC.
8942         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
8943         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
8944         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
8945         (__set_errno): Define this macro if <errno.h> doesn't.
8946         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
8947         Define these macros if <stdio.h> doesn't.
8948         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
8949         Define these macros if <sys/stat.h>
8950         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
8951         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
8952         __xstat64): Define if not _LIBC.
8953         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
8954         (__gen_tempname): Invoke gettimeofday only if
8955         HAVE_GETTIMEOFDAY || _LIBC;
8956         otherwise, fall back on plain "time".
8957         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
8958
8959         * mkstemp.c (__GT_FILE): Define to zero if not defined.
8960
8961         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
8962
8963 2001-02-17  Jim Meyering  <meyering@lucent.com>
8964
8965         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
8966         around included file name.
8967
8968         * strnlen.c (__strnlen): Merge in a change from GNU libc.
8969
8970         * strftime.c: Update from GNU libc (the only changes were to comments).
8971
8972 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
8973
8974         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
8975
8976 2001-02-17  Paul Eggert  <eggert@twinsun.com>
8977
8978         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
8979         Remove workaround macros for hosts that have mbrtowc but not
8980         mbstate_t, as we now insist on proper declarations for both
8981         before using mbrtowc.
8982
8983 2001-02-17  Jim Meyering  <meyering@lucent.com>
8984
8985         * regex.c: Update from libc.
8986
8987 2001-02-16  Paul Eggert  <eggert@twinsun.com>
8988
8989         * alloca.c (malloc): Undef before defining, since stdlib.h
8990         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
8991         Reported by Mark Hounschell via Paul Eggert.
8992
8993 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
8994
8995         * config.charset: Update for FreeBSD 4.2.
8996
8997 2001-01-26  Jim Meyering  <meyering@lucent.com>
8998
8999         * quotearg.c: Include stddef.h.
9000         * quote.c: Include stddef.h.
9001         Reported by Axel Kittenberger.
9002
9003         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9004         line in double quotes so that it evokes a better diagnostic.
9005         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9006         Reported by Axel Kittenberger.
9007
9008 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9009
9010         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9011         to avoid a warning.  Add back 'const' to inptr.
9012
9013 2001-01-16  Jim Meyering  <meyering@lucent.com>
9014
9015         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9016         From Bruno Haible.
9017
9018 2001-01-14  Jim Meyering  <meyering@lucent.com>
9019
9020         * rename.c: New file.  From Volker Borchert.
9021         Include stdlib.h, string.h or strings.h, and xalloc.h.
9022         Use strip_trailing_slashes rather than open-coding it.
9023
9024 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9025
9026         * strftime.c: Sync with glibc time/strftime.c 1.81.
9027
9028 2001-01-03  Jim Meyering  <meyering@lucent.com>
9029
9030         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9031         local `inptr' to avoid warning with some system declarations of iconv.
9032
9033 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9034
9035         * modechange.c: Do not assume that mode_t uses the
9036         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9037         the other-execute bit of FOO even if S_IXOTH != 1.
9038
9039         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9040         WOTH, XOTH, ALLM): New macros.
9041         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9042          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9043         Use them.
9044         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9045         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9046         (mode_compile):
9047         No need to use uintmax_t; unsigned long is long enough.
9048         Don't bother to get suffix since we don't use it.
9049
9050 2000-12-24  Jim Meyering  <meyering@lucent.com>
9051
9052         * hash.c (is_prime): Return explicit boolean values.
9053         (hash_get_first): Return NULL to appease Irix5.6's 89.
9054         Reported by Nelson Beebe.
9055
9056 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9057
9058         * localcharset.c (locale_charset): Add support for Win32.
9059
9060 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9061
9062         * physmem.h, physmem.c: New files.
9063
9064         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9065         (noinst_HEADERS): Add physmem.h.
9066
9067         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9068         't' for compatibility with Solaris 8 sort.
9069
9070 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9071
9072         * config.charset: Add support for BeOS.
9073
9074 2000-12-16  Jim Meyering  <meyering@lucent.com>
9075
9076         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9077         SHELLS_FILE to a file name that's useful on djgpp systems.
9078         Include stdlib.h.
9079         (ADDITIONAL_DEFAULT_SHELLS): Define.
9080         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9081         Based mostly on a patch from Prashant TR.
9082
9083 2000-12-16  Jim Meyering  <meyering@lucent.com>
9084
9085         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9086         N and M) would have treated it like `chown N:N FILE'.
9087
9088         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9089
9090 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9091
9092         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9093         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9094         to the list of canonical encodings. Rename EUC-CN to GB2312.
9095
9096 2000-12-08  Andreas Schwab  <schwab@suse.de>
9097
9098         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9099         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9100
9101 2000-12-07  Jim Meyering  <meyering@lucent.com>
9102
9103         * stripslash.c (ISSLASH): Define.
9104         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9105         From Prashant TR.
9106
9107         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9108         (dir_name_r): Declare this function as static.
9109         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9110         manifest itself on a name containing a mix of slashes and
9111         backslashes.
9112         Make this function work with names starting with a DOS-style
9113         drive letter and colon prefix.
9114         (dir_name): Append `.' if necessary.
9115         Based mostly on patches from Prashant TR and Eli Zaretskii.
9116
9117         * dirname.h (dir_name_r): Remove prototype.
9118
9119 2000-12-05  Jim Meyering  <meyering@lucent.com>
9120
9121         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9122
9123 2000-12-04  Jim Meyering  <meyering@lucent.com>
9124
9125         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9126         Also include memory.h, stdlib.h, unistd.h if appropriate.
9127         Reported by Andreas Jaeger (conflicting declaration of malloc).
9128
9129 2000-12-02  Jim Meyering  <meyering@lucent.com>
9130
9131         * closeout.h: Make idempotent, to avoid some obscure warnings.
9132
9133 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9134
9135         * memrchr.c: Include <config.h> before any system include file.
9136
9137 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9138
9139         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9140
9141 2000-11-26  Jim Meyering  <meyering@lucent.com>
9142
9143         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9144
9145 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9146
9147         * strftime.c (my_strftime): Do not invoke mbrlen with a
9148         size of (size_t) -1; it's not portable.
9149
9150 2000-11-17  Akim Demaille  <akim@epita.fr>
9151
9152         * obstack.h: Formatting changes.
9153         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9154         prevent type checking.
9155         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9156         cast the value to (void *): assigning a `foo *' to a `void *'
9157         variable is valid.
9158         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9159
9160 2000-11-17  Jim Meyering  <meyering@lucent.com>
9161
9162         * strstr.c: Update from GNU libc.
9163
9164 2000-11-16  Jim Meyering  <meyering@lucent.com>
9165
9166         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9167
9168 2000-11-11  Jim Meyering  <meyering@lucent.com>
9169
9170         * error.c: Add a couple #includes, merging from GNU libc version.
9171
9172 2000-11-10  Jim Meyering  <meyering@lucent.com>
9173
9174         * obstack.h: Update from GNU libc.
9175         * obstack.c: Likewise.
9176
9177 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9178
9179         * getusershell.c (setusershell): Use rewind rather than
9180         fseek/fseeko, to avoid configuration hassles with fseeko.
9181         Don't bother opening SHELLS_FILE if shellstream is NULL;
9182         it's not necessary.
9183
9184 2000-11-05  Jim Meyering  <meyering@lucent.com>
9185
9186         * makepath.h (make_dir): Declare.
9187         * makepath.c (make_dir): Remove `static' attribute.
9188         Tweak a comment.
9189
9190 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9191
9192         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9193         last one in a bucket, advance to the next bucket.
9194
9195 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9196
9197         * fnmatch.c: Do not comment out all the code if we are using
9198         the GNU C library, because in some cases we are replacing buggy
9199         code in the GNU C library itself.
9200
9201 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9202
9203         * error.h, getline.h, modechange.h:
9204         Remove "2000" from Copyright line, as the file hasn't been
9205         changed this year other than in the copyright notice.
9206
9207         * xalloc.h: Add "2000" to Copyright line, as this file
9208         was changed this year.
9209
9210 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9211
9212         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9213         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9214         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9215
9216 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9217
9218         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9219         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9220         doesn't define __restrict_arr.
9221
9222 2000-10-29  Jim Meyering  <meyering@lucent.com>
9223
9224         * xstat.in: Fix grammar in comment.
9225
9226 2000-10-28  Jim Meyering  <meyering@lucent.com>
9227
9228         * memchr.c: Update from libc.
9229         Adjust for portability:
9230         [HAVE_STDLIB_H]: Include stdlib.h.
9231         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9232         Undef __memchr, too.
9233         [!weak_alias]: Define __memchr to memchr.
9234
9235         * regex.c: Update from libc.
9236         * regex.h: Likewise.
9237         * getopt1.c: Likewise.
9238         * memcmp.c: Likewise.
9239
9240         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9241         Avoid using fseek, when possible -- it's broken by design.
9242         Patch by Ulrich Drepper.
9243
9244 2000-10-26  Jim Meyering  <meyering@lucent.com>
9245
9246         * strftime.c: Update from libc.
9247
9248 2000-10-25  Jim Meyering  <meyering@lucent.com>
9249
9250         * obstack.c: Update from libc.
9251
9252 2000-10-23  Jim Meyering  <meyering@lucent.com>
9253
9254         * hard-locale.c (hard_locale): Revert last change -- it was simply
9255         wrong.  That set_locale call must not have any side effects.
9256         From Paul Eggert.
9257
9258 2000-10-22  Jim Meyering  <meyering@lucent.com>
9259
9260         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9261         [CYCLIC]: Remove now-unused definition.
9262
9263         * save-cwd.c (O_DIRECTORY): Define, if needed.
9264         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9265         Suggestion from Ulrich Drepper.
9266
9267 2000-10-21  Jim Meyering  <meyering@lucent.com>
9268
9269         * dirname.c (dir_name_r): New function, factored out of dir_name.
9270         (dir_name): Use dir_name_r.
9271         * dirname.h (dir_name_r): Declare it.
9272
9273 2000-10-21  Jim Meyering  <meyering@lucent.com>
9274
9275         * dirname.c (memrchr): Declare if necessary.
9276         (dir_name): Remove the restriction that there be no
9277         trailing slashes.  Now, this code skips past them, effectively
9278         ignoring them.
9279         [TEST_DIRNAME] (main): New unit tests.
9280
9281         * memrchr.c: New file from GNU libc.
9282         Undef __memrchr, too.
9283         [!weak_alias]: Define __memrchr to memrchr.
9284         Guard weak_alias use with `#ifdef weak_alias'.
9285
9286 2000-10-17  Jim Meyering  <meyering@lucent.com>
9287
9288         * quote.h (PARAMS): Define and use.
9289         Reported by Akim Demaille.
9290
9291         * getopt.c: Update from libc.
9292
9293 2000-10-16  Jim Meyering  <meyering@lucent.com>
9294
9295         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9296         From Jan Fedak.
9297
9298 2000-09-25  Jim Meyering  <meyering@lucent.com>
9299
9300         * md5.h (rol): Define (from GnuPG).
9301
9302         * sha.c: Give credit (GnuPG) where due.
9303         (M): Use rol rather than open-coding it.
9304         Add a FIXME comment.
9305
9306 2000-09-21  Jim Meyering  <meyering@lucent.com>
9307
9308         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9309         Reported by Michael Stone.
9310
9311 2000-09-20  Jim Meyering  <meyering@lucent.com>
9312
9313         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9314         (noinst_HEADERS): Add sha.h.
9315         Based on code from Scott G. Miller and from GnuPG.
9316
9317 2000-09-15  Jim Meyering  <meyering@lucent.com>
9318
9319         * regex.c: Update from libc.
9320
9321 2000-09-10  Jim Meyering  <meyering@lucent.com>
9322
9323         * getopt.c (_getopt_internal): Update from glibc.
9324
9325 2000-09-09  Jim Meyering  <meyering@lucent.com>
9326
9327         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9328         think it should be used as a general replacement for isascii.
9329         * fnmatch.c: Likewise.
9330         * mbswidth.c: Likewise
9331         * regex.c: Likewise.
9332
9333         Don't use atoi.
9334         * userspec.c: Include sys/param.h and limits.h.
9335         Include xstrtol.h.
9336         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9337         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9338         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9339         UID, GID.  Check range.
9340
9341 2000-09-06  Jim Meyering  <meyering@lucent.com>
9342
9343         * getopt.c (_getopt_internal): Update from glibc.
9344
9345 2000-08-30  Jim Meyering  <meyering@lucent.com>
9346
9347         * strftime.c: Merge in changes from GNU libc.
9348
9349 2000-08-26  Jim Meyering  <meyering@lucent.com>
9350
9351         * closeout.c: Include "__fpending.h".
9352         (close_stdout_status): Return right away if there's nothing to flush.
9353
9354         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9355         * __fpending.c: New file.
9356         * __fpending.h: New file.
9357
9358 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9359
9360         Standardize on "memory exhausted" instead of "Memory exhausted"
9361         or "virtual memory exhausted".
9362         * obstack.c (print_and_abort): Use "memory exhausted", not
9363         "virtual memory exhausted".
9364         * same.c (same_name): Invoke xalloc_die instead of printing
9365         our own message.
9366         * userspec.c (parse_user_spec): Likewise.
9367         * bumpalloc.h: comment fix
9368         * same.c, userspec.c: Include xalloc.h.
9369
9370         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9371         not char *const and pointing to a constant array.
9372         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9373         (xrealloc): Comment fix.
9374
9375         * userspec.c (parse_user_spec):
9376         Don't translate a message until just before returning,
9377         to avoid unnecessary translation.
9378
9379 2000-08-07  Jim Meyering  <meyering@lucent.com>
9380
9381         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9382         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9383         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9384         getgroups.c, gethostname.c, getopt.h, group-member.c,
9385         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9386         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9387         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9388         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9389         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9390         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9391         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9392         yesno.c: Back out Copyright date changes for each file with no change
9393         this year.  This eases coordination with other programs using the same
9394         source code modules.  From Paul Eggert.
9395
9396 2000-08-03  Greg McGary  <greg@mcgary.org>
9397
9398         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9399         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9400         (EXTEND_BUFFER): Use them.
9401
9402 2000-08-01  Jim Meyering  <meyering@lucent.com>
9403
9404         * dirname.c (ISSLASH): Define.
9405         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9406         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9407         both `\' and `/' may be use as path separators.
9408         Based on a patch from Prashant TR.
9409
9410 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9411
9412         * quotearg.c (quotearg_n_options): Don't make the initial
9413         slot vector a constant, since it might get modified.
9414
9415 2000-07-31  Jim Meyering  <meyering@lucent.com>
9416
9417         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9418         * obstack.c (print_and_abort): Likewise.
9419
9420 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9421
9422         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9423         buffer, so that the caller can always quote one small
9424         component of a "memory exhausted" message in slot 0.
9425         From a suggestion by Jim Meyering.
9426
9427 2000-07-30  Jim Meyering  <meyering@lucent.com>
9428
9429         * makepath.c (make_path): Quote the other instance, too.
9430
9431         * quotearg.c (N_STATIC_SLOTVECS): Define.
9432         (STATIC_BUF_SIZE): Define.
9433         (quotearg_n_options): Use only statically allocated storage when
9434         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9435         than STATIC_BUF_SIZE.
9436
9437 2000-07-29  Jim Meyering  <meyering@lucent.com>
9438
9439         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9440         * dirname.c (dir_name): Likewise.
9441
9442         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9443
9444         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9445         (dir_name): Assert that there are no trailing slashes.
9446
9447 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9448
9449         * mbswidth.h (mbswidth): Add a flags argument.
9450         (mbswidth): New declaration.
9451         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9452         * mbswidth.c (mbswidth): Add a flags argument.
9453         (mbsnwidth): New function.
9454
9455 2000-07-24  Jim Meyering  <meyering@lucent.com>
9456
9457         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9458
9459 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9460
9461         * mbswidth.c (_XOPEN_SOURCE):
9462         Don't define; this causes problems on Solaris 7.
9463         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9464
9465 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9466
9467         * quotearg.c:
9468         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9469         so that mbstate_t is always defined.
9470
9471         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9472         be 1 in at least one GCC installation, and this configuration
9473         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9474         performance on hosts that have mbrtowc but have only unibyte
9475         locales, but I assume these hosts are rare.
9476
9477 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9478
9479         * quotearg.c: Streamline by invoking multibyte code only if needed.
9480         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9481         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9482         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9483         invoke multibyte primitives.
9484
9485 2000-07-23  Jim Meyering  <meyering@lucent.com>
9486
9487         * basename.c (base_name): Add an assertion.
9488
9489 2000-07-15  Bruno Haible  <clisp.cons.org>
9490
9491         * quotearg.c: When the system forces us to redefine mbstate_t,
9492         shadow its mbsinit function.
9493
9494 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9495
9496         * mbswidth.h: New file.
9497         * mbswidth.c: New file.
9498         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9499         (noinst_HEADERS): Add mbswidth.h.
9500
9501 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9502
9503         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9504         and IRIX 6.
9505
9506 2000-07-15  Jim Meyering  <meyering@lucent.com>
9507
9508         * makepath.c: Include quote.h.
9509         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9510         corresponding argument in a `quote (...)' call.
9511         Give better diagnostics.
9512
9513         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9514         (noinst_HEADERS): Add quote.h.
9515
9516         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9517         from tar's src/misc.c.
9518         * quote.h: New file.  Prototypes for same.
9519
9520 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9521
9522         From a suggestion by Bruno Haible.
9523         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9524         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9525         to decide whether to define the BeOS workaround macro;
9526         this adjusts to the change to AC_MBSTATE_T.
9527
9528 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9529
9530         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9531
9532         * quotearg.c (quoting_style_args, quoting_style_vals,
9533         quotearg_buffer_restyled): Add support for
9534         clocale_quoting_style.  Undo previous change to
9535         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9536         and "{RIGHT QUOTATION MARK}" msgids.
9537
9538 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9539
9540         The old behavior of quoting `like this' doesn't look good with
9541         newer, ISO-style fonts.  See:
9542         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9543
9544         Instead, quote "like this" by default.  Let the translator
9545         tailor the locale-specific quoting behavior by providing
9546         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9547
9548         * quotearg.c (N_): New macro.
9549         (gettext_default): New function.
9550         (quotearg_buffer_restyled): Use
9551         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9552         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9553
9554 2000-07-09  Jim Meyering  <meyering@lucent.com>
9555
9556         * Most files: Update copyright dates to include 2000.
9557
9558 2000-07-08  Jim Meyering  <meyering@lucent.com>
9559
9560         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9561         if not defined.
9562         (xgethostname): Remove now-unnecessary #ifdef.
9563         Move declaration of `err' into loop where it's used.
9564
9565 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9566
9567         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9568         by allocating a larger buffer. Test the gethostname return value for
9569         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9570         returns an error and ENAMETOOLONG isn't defined.
9571
9572 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9573         and Bruno Haible  <haible@clisp.cons.org>
9574
9575         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9576
9577 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9578
9579         * quotearg.c (struct quoting_options): Simplify quote_these_too
9580         dimension.
9581
9582 2000-07-03  Jim Meyering  <meyering@lucent.com>
9583
9584         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9585         Reported by Bruno Haible.
9586
9587 2000-07-04  Jim Meyering  <meyering@lucent.com>
9588
9589         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9590         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9591         lacks mbrtowc.
9592
9593 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9594         and Bruno Haible  <haible@clisp.cons.org>
9595
9596         * quotearg.c (mbrtowc):
9597         Assign to *pwc, and return 1 only if result is nonzero.
9598         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9599
9600 2000-07-03  Jim Meyering  <meyering@lucent.com>
9601
9602         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9603         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9604         From Bob Proulx.
9605
9606 2000-07-02  Jim Meyering  <meyering@lucent.com>
9607
9608         * quotearg.c (mbstate_t): Don't define here.
9609
9610 2000-07-02  Jim Meyering  <meyering@lucent.com>
9611
9612         * nanosleep.c (SIGCONT): Define if not already defined.
9613
9614 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9615
9616         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9617         per change in ../m4/ls-mntd-fs.m4.
9618         (read_filesystem_list): Ignore symbolic links.
9619
9620 2000-06-29  Jim Meyering  <meyering@lucent.com>
9621
9622         * same.c: Include <string.h> or <strings.h>, as appropriate,
9623         for declaration of strcmp.
9624
9625         * long-options.c: Include <stdlib.h>, for declaration of exit.
9626
9627         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9628         Avoid warning by casting result to `char *' to remove `const'.
9629
9630 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9631
9632         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9633
9634 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9635
9636         savedir now sets errno on failure and invokes xmalloc to get memory.
9637         Fix a couple of other minor bugs while we're at it.
9638
9639         * savedir.c (<unistd.h>): Do not include; there's no need.
9640         (NAMLEN): Remove macro.
9641         (malloc, realloc): Remove decls.
9642         (stpcpy): Likewise.
9643         ("xalloc.h"): Include.
9644         (NAME_SIZE_DEFAULT): New macro.
9645         (savedir): Use xmalloc / xrealloc to allocate memory.
9646         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9647         Skip "" directory entries.
9648         Use strlen to calculate directory entry length, since the old method
9649         is rarely used these days and isn't worth supporting.
9650         Don't use a pointer after freeing it.
9651         Check for integer overflow when calculating allocation size.
9652         Use memcpy to copy entries, instead of stpcpy.
9653         Set errno properly when returning NULL.
9654         Check for readdir error.
9655
9656 2000-06-26  Jim Meyering  <meyering@lucent.com>
9657
9658         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9659
9660 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9661
9662         * getusershell.c (xmalloc, xrealloc): Remove functions.
9663         Include xalloc.h.
9664         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9665
9666 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9667
9668         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9669
9670 2000-06-24  Jim Meyering  <meyering@lucent.com>
9671
9672         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9673
9674 2000-06-21  Jim Meyering  <meyering@lucent.com>
9675
9676         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
9677
9678 2000-06-19  Paul Eggert  <eggert@twinsun.com>
9679
9680         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9681         (mbrtowc, mbstate_t): Define substitutes if
9682         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9683         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9684         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9685
9686 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9687
9688         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9689         than 1024, return a memory chunk of least possible size, instead
9690         of size PATH_MAX + 2. In the loop, increment the size proportionally.
9691         Use free/xmalloc instead of xrealloc to avoid copying for very long
9692         paths.
9693
9694 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9695
9696         * canon-host.c (canon_host): Use malloc and memcpy to copy an
9697         address, not strdup.  Include <stdlib.h> and don't declare free().
9698
9699 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9700
9701         * path-concat.c (path_concat): Don't access dir[-1] if dir is
9702         the empty string.
9703
9704 2000-06-21  Jim Meyering  <meyering@lucent.com>
9705
9706         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9707         (noinst_HEADERS): Add getstr.h.
9708
9709         * getline.c (getstr): Move into a separate file.
9710         * getstr.c (getstr): New file, extracted from getline.c, with
9711         the following changes: new parameter, delim2; both delim[12]
9712         parameters have type `int', not `char'.  The latter would lose
9713         with 8-bit delimiters.
9714         * getstr.h: New file.
9715
9716 2000-06-19  Jim Meyering  <meyering@lucent.com>
9717
9718         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9719
9720 2000-06-18  Jim Meyering  <meyering@lucent.com>
9721
9722         * mkdir.c: Remove file, due mainly to copyright incompatibility.
9723         Besides, these days every porting target provides a mkdir function.
9724
9725         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9726         (this snippet comes from src/system.h).
9727
9728 2000-06-15  Paul Eggert  <eggert@twinsun.com>
9729
9730         * human.c (adjust_value): New function.
9731         (human_readable_inexact): Apply rounding style even when
9732         printing approximate values.
9733
9734 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9735
9736         * human.c (human_readable_inexact): Allow an input block
9737         size that is not a multiple of the output block size, and vice versa.
9738         Reported by Piergiorgio Sartor.
9739
9740 2000-06-14  Paul Eggert  <eggert@twinsun.com>
9741
9742         * getdate.y (get_date): Apply relative times after time
9743         zone indicator, not before.  Reported by Todd A. Jacobs.
9744
9745 2000-06-13  Jim Meyering  <meyering@lucent.com>
9746
9747         * Makefile.am (all-local): Depend on lstat.c and stat.c.
9748
9749         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9750
9751 2000-06-12  Paul Eggert  <eggert@twinsun.com>
9752
9753         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9754
9755 2000-06-04  Paul Eggert  <eggert@twinsun.com>
9756
9757         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9758
9759 2000-06-04  Jim Meyering  <meyering@lucent.com>
9760
9761         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9762         SunOS 4.1.4 for which gid_t is an unsigned type.
9763
9764 2000-06-03  Jim Meyering  <meyering@lucent.com>
9765
9766         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9767
9768 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
9769
9770         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9771         newer, don't install charset.alias.
9772         * config.charset: Change the Linux/glibc rules so they become empty
9773         on glibc-2.1 or newer.
9774
9775 2000-06-02  Jim Meyering  <meyering@lucent.com>
9776
9777         * mountlist.c: Back out last change.  Instead, do this...
9778         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9779         member using the same `ignore'-testing code.
9780         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9781         fs_type strings.
9782         From Mark D. Roth.
9783
9784 2000-05-29  Jim Meyering  <meyering@lucent.com>
9785
9786         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9787         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
9788
9789 2000-05-22  Jim Meyering  <meyering@lucent.com>
9790
9791         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9792
9793 2000-05-18  Jim Meyering  <meyering@lucent.com>
9794
9795         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9796         back, too, since it may have been modified by allocate_entry.
9797         (hash_delete): Rewrite to use neither the assignment operator
9798         nor the comma operator in an if-expression.
9799
9800 2000-05-15  Paul Eggert  <eggert@twinsun.com>
9801
9802         * closeout.c:
9803         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9804         Remove; no longer needed.
9805         "quotearg.h": Add include.
9806         (file_name): Do not bother to explicitly initialize to NULL; it's less
9807         efficient on some hosts.
9808         (close_stdout_status): Remove test as to whether stdout was already
9809         closed; it breaks for the case "echo x | sort >&-".
9810         Quote file name colons.
9811         Do not assume that _("write error") lacks format strings.
9812
9813 2000-05-15  Jim Meyering  <meyering@lucent.com>
9814
9815         * version-etc.c (version_etc_copyright): Update the copyright string
9816         used in all --version output.
9817
9818 2000-05-14  Jim Meyering  <meyering@lucent.com>
9819
9820         * closeout.c (close_stdout_set_file_name): New function.
9821         (close_stdout_status): Use new file-scoped global.
9822         Return right away if fstat says the stdout file descriptor is invalid.
9823         * closeout.h (close_stdout_set_file_name): Declare.
9824
9825 2000-05-10  Jim Meyering  <meyering@lucent.com>
9826
9827         * closeout.c [default_exit_status]: New file-scoped variable.
9828         (close_stdout_set_status): New function.
9829         * closeout.h (close_stdout_set_status): Declare.
9830
9831 2000-05-08  Jim Meyering  <meyering@lucent.com>
9832
9833         * long-options.c: Don't include closeout.h.
9834         (parse_long_options): Don't call close_stdout for --version.
9835
9836 2000-05-06  Jim Meyering  <meyering@lucent.com>
9837
9838         * strnlen.c: Undefine __strnlen and strnlen.
9839         [!weak_alias]: Define __strnlen to strnlen.
9840
9841         * atexit.c: New file, from libiberty.
9842
9843 2000-05-06  Jim Meyering  <meyering@lucent.com>
9844
9845         * closeout.c (close_stdout_status): Also check for errors on the
9846         stderr stream.
9847
9848 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
9849
9850         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9851         instead of xmalloc, xrealloc, path_concat.
9852         (locale_charset): Treat empty environment variables as absent.
9853         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9854
9855 2000-05-04  Jim Meyering  <meyering@lucent.com>
9856
9857         * getopt.c: Update from glibc.
9858         * obstack.c: Likewise.
9859         * obstack.h: Likewise.
9860         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
9861
9862         * regex.h: Likewise.
9863         * strndup.c: Likewise.
9864         * strnlen.c: New file, from glibc.
9865
9866 2000-05-01  Jim Meyering  <meyering@lucent.com>
9867
9868         * full-write.c (full_write): Remove `FIXME' part of comment.
9869
9870 2000-04-29  Jim Meyering  <meyering@lucent.com>
9871
9872         * path-concat.c: Declare strdup only if it's not defined.
9873         * canon-host.c: Likewise.
9874
9875 2000-04-28  Jim Meyering  <meyering@lucent.com>
9876
9877         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9878         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
9879         included first, then limits.h is included by locale.h by libintl.h.
9880         From John David Anglin.
9881
9882 2000-04-25  Jim Meyering  <meyering@lucent.com>
9883
9884         * makepath.c (S_IRWXUGO): Define.
9885         (make_path): Always perform explicit chmod if MODE specifies any
9886         of the `special' permission bits.  Prompted by a bug report against
9887         install from Mate Wierdl and Joost van Baal.
9888
9889 2000-04-18  Jim Meyering  <meyering@lucent.com>
9890
9891         * README: New file.
9892
9893         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9894         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
9895
9896 2000-04-17  Jim Meyering  <meyering@lucent.com>
9897
9898         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
9899         the definition of it to rpl_strftime also defined-away the system's
9900         declaration.
9901
9902 2000-04-15  Jim Meyering  <meyering@lucent.com>
9903
9904         Use `C' to denote so-called `contiguous' files, the same way
9905         that tar does.
9906         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
9907         (ftypelet): Use S_ISCTG.
9908         From Michael Deutschmann.
9909
9910 2000-04-14  Jim Meyering  <meyering@lucent.com>
9911
9912         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
9913
9914 2000-04-08  Jim Meyering  <meyering@lucent.com>
9915
9916         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
9917         names don't conflict.  Reported by Eli Zaretskii.
9918
9919 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
9920
9921         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
9922         bug.  Deal with the different error behavior of Irix iconv.
9923
9924 2000-04-07  Jim Meyering  <meyering@lucent.com>
9925
9926         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
9927         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
9928
9929 2000-04-05  Jim Meyering  <meyering@lucent.com>
9930
9931         Portability tweaks required for ultrix4.3.
9932         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
9933         * readutmp.c: Include sys/types.h before sys/stat.h.
9934         * canon-host.c: Declare strdup.
9935         * path-concat.c: Likewise.
9936         From John David Anglin.
9937
9938 2000-04-04  Jim Meyering  <meyering@lucent.com>
9939
9940         Be more DOS 8.3-friendly.
9941         * ref-add.sin: Renamed from ref-add.sed.in.
9942         * ref-del.sin: Renamed from ref-del.sed.in.
9943         * Makefile.am: Reflect renaming.
9944         Reported by Eli Zaretskii.
9945
9946         Use a temporary file name that won't clash with `charset.alias'
9947         in the DOS 8.3 name space.
9948         * Makefile.am (charset_tmp): Define.
9949         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
9950         (uninstall-local): Likewise.
9951         Reported by Eli Zaretskii.
9952
9953 2000-03-29  Paul Eggert  <eggert@twinsun.com>
9954
9955         * time/strftime.c (my_strftime): Make sure we call the system
9956         strftime, not ourselves, when invoking the underlying strftime.
9957
9958 2000-03-24  Jim Meyering  <meyering@lucent.com>
9959
9960         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
9961         (charset_alias): Define.
9962         (install-exec-local): Factor out common code.
9963         (uninstall-local): Split lines longer than 80.
9964         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
9965         (SUFFIXES): Define.
9966         (.sed.in.sed): New rule.  Don't redirect directly to $@.
9967         (CLEANFILES): Add ref-add.sed and ref-del.sed.
9968
9969 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
9970
9971         * config.charset: Output a line containing "Packages using this file".
9972         * ref-add.sed.in, ref-del.sed.in: New files.
9973         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
9974         ref-del.sed): New rules.
9975
9976 2000-03-17  Jim Meyering  <meyering@lucent.com>
9977
9978         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
9979         Otherwise, include <strings.h>
9980
9981 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
9982
9983         * unicodeio.c (utf8_wctomb): New function.
9984         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
9985         format instead of in UCS-4 with platform dependent endianness.
9986
9987 2000-03-07  Paul Eggert  <eggert@twinsun.com>
9988
9989         * savedir.c (savedir): Work even if directory size is
9990         negative; this can happen with some screwy NFS configurations.
9991
9992 2000-03-06  Jim Meyering  <meyering@lucent.com>
9993
9994         * localcharset.c (get_charset_aliases): Don't try to free file_name
9995         if it's NULL (because we ran out of memory).  From Bruno Haible.
9996
9997 2000-03-05  Jim Meyering  <meyering@lucent.com>
9998
9999         * localcharset.c ("path-concat.h"): Include.
10000         (get_charset_aliases): Use path_concat instead of ANSI string
10001         concatenation.
10002
10003         * unicodeio.h (PARAMS): Define.
10004         Use it to guard prototype.
10005
10006 2000-03-04  Jim Meyering  <meyering@lucent.com>
10007
10008         * Makefile.am (install-exec-local): Create $(libdir) before installing
10009         into it.
10010         (uninstall-local): Uncomment this rule so `make distcheck' works
10011         once again.
10012
10013         * unicodeio.c (<errno.h>): Include it.
10014         (errno): Declare if not defined.
10015
10016         * localcharset.c: Add Bruno's comment justifying use of volatile.
10017
10018         * config.charset: New version, incorporating remarks from a linux
10019         i18n mailing list.  From Bruno Haible.
10020
10021 2000-03-02  Jim Meyering  <meyering@lucent.com>
10022
10023         * Makefile.am (EXTRA_DIST): Add config.charset.
10024
10025 2000-03-01  Jim Meyering  <meyering@lucent.com>
10026
10027         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10028         * unicodeio.c: Likewise.
10029
10030 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10031
10032         * config.charset: New file.
10033         * localcharset.c: New file.
10034         * unicodeio.h, unicodeio.c: New files.
10035         * Makefile.am (DEFS): Add -DLIBDIR=...
10036         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10037         (noinst_HEADERS): Add unicodeio.h.
10038         (all-local, install-exec-local, charset.alias): New targets.
10039
10040 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10041
10042         * quotearg.c (ALERT_CHAR): New macro.
10043         (quotearg_buffer_restyled): Use it.
10044
10045 2000-02-27  Jim Meyering  <meyering@lucent.com>
10046
10047         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10048         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10049
10050         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10051         not `#if STDC_HEADERS'.
10052         Declare malloc if needed.
10053
10054         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10055         now that autoconf always defines the HAVE_DECL_ symbols.
10056         * human.c: Likewise.
10057         * same.c: Likewise.
10058         * strtoumax.c: Likewise.
10059
10060         * backupfile.c: Arrange for cpp to fail if the configure-time
10061         declaration check was not run.
10062         * hash.c: Likewise.
10063         * human.c: Likewise.
10064         * same.c: Likewise.
10065         * strtoumax.c: Likewise.
10066
10067         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10068         then first look up the entire `.'-containing string as a login name.
10069
10070 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10071
10072         * getdate.y: Handle two-digit years with leading zeros correctly.
10073         (textint): New typedef.
10074         (parser_control): Member year changed from int to textint.
10075         All uses changed.
10076         (YYSTYPE): Removed; replaced by %union with int and textint members.
10077         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10078         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10079         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10080         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10081         (date, number, to_year): Use width of number in digits, not its value,
10082         to determine whether it's a 2-digit year, or a 2-digit time.
10083         (yylex): Store number of digits of numeric tokens.
10084         Reported by John Kendall.
10085
10086         (parser_control): Changed from struct parser_control to typedef (for
10087         consistency).  All uses changed.
10088
10089         (tID): Removed; not used.
10090         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10091
10092 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10093
10094         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10095         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10096
10097 2000-02-12  Jim Meyering  <meyering@lucent.com>
10098
10099         * userspec.c (ISDIGIT): Define it.
10100         (isdigit): Remove definition.
10101         (is_number): Use ISDIGIT, not isdigit.
10102         <libintl.h>: Include.
10103         (_ and N_): Define.
10104         (parse_user_spec): Mark translatable strings.
10105
10106 2000-02-10  Jim Meyering  <meyering@lucent.com>
10107
10108         With these changes, nanosleep.[ch] are finally enough like the other
10109         lib/* replacement files to compile on a few more losing systems.
10110
10111         * nanosleep.h: Don't include config.h.
10112         Remove prototype from declaration of nanosleep.
10113         (PARAMS): Remove now-unneeded definition.
10114         * nanosleep.c: #undef nanosleep.
10115         (rpl_nanosleep): Rename from nanosleep.
10116
10117 2000-02-03  Jim Meyering  <meyering@lucent.com>
10118
10119         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10120         rather than with `#if HAVE_UTMPNAME'.
10121
10122 2000-02-01  Jim Meyering  <meyering@lucent.com>
10123
10124         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10125
10126 2000-01-31  Jim Meyering  <meyering@lucent.com>
10127
10128         * nanosleep.h (nanosleep): Guard declaration with
10129         `#if ! HAVE_DECL_NANOSLEEP'.
10130         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10131         the declaration in that vendor's sys/timers.h.
10132         Reported by Christian Krackowizer.
10133
10134         * quotearg.c (ISASCII): Add #undef and move definition to follow
10135         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10136         (ISPRINT): Likewise.
10137         Reported by Tom Tromey.
10138
10139 2000-01-30  Jim Meyering  <meyering@lucent.com>
10140
10141         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10142         uses of ->ut_name.  The latter doesn't work with new Linux header files
10143         where only utmpx.ut_user is declared.
10144
10145         * readutmp.h (UT_USER): Define.
10146
10147 2000-01-23  Jim Meyering  <meyering@lucent.com>
10148
10149         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10150         obstack.c.
10151
10152 2000-01-22  Jim Meyering  <meyering@lucent.com>
10153
10154         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10155         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10156         Required for some AIX systems.  Reported by Christian Krackowizer.
10157         [TESTING] (main): New function.
10158
10159         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10160         * dirname.c (dir_name): Support for DOS-style file names with drive
10161         letters.
10162
10163         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10164
10165         * strverscmp.c (ISDIGIT): Define.
10166         (strverscmp): Use ISDIGIT, not isdigit.
10167
10168 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10169
10170         * nanosleep.c (nanosleep):
10171         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10172         POSIX.1 doesn't require SA_INTERRUPT and some systems
10173         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10174         it's been part of POSIX.1 since day 1 (in 1988).
10175
10176 2000-01-17  Jim Meyering  <meyering@lucent.com>
10177
10178         * interlock: Remove unused file.  Reported by François Pinard.
10179
10180 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10181
10182         * quotearg.c (quotearg_buffer_restyled): Do not quote
10183         alert, backslash, formfeed, and vertical tab unnecessarily in
10184         shell quoting style.
10185
10186
10187 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10188 Free Software Foundation, Inc.
10189 Copying and distribution of this file, with or without modification,
10190 are permitted provided the copyright notice and this notice are preserved.